main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0 //true
  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 (
  21. g.each(t, function (t, e) {
  22. n = i.call(e, n, t, e)
  23. }),
  24. n
  25. )
  26. }
  27. function r(t, i, n) {
  28. var e, o, r
  29. if (t === i) return !0
  30. if (!t || !i || t.constructor !== i.constructor) return !1
  31. for (e = 0, o = n.length; o > e; e += 1) {
  32. if (((r = n[e]), t[r] && y(t[r].equals) && !t[r].equals(i[r]))) return !1
  33. if (t[r] !== i[r]) return !1
  34. }
  35. return !0
  36. }
  37. function s(t, i, n, e) {
  38. ;(this.left = E(t)),
  39. (this.top = E(i)),
  40. (this.width = E(n)),
  41. (this.height = E(e)),
  42. (this.right = this.left + this.width),
  43. (this.bottom = this.top + this.height)
  44. }
  45. function h(t, i, n, e) {
  46. ;(this.visible = t || 0),
  47. (this.viewport = i || 0),
  48. (this.possible = n || 0),
  49. (this.rects = (e && T({}, e)) || null)
  50. }
  51. function l(t, i) {
  52. ;(this.els = t), (this.viewport = i)
  53. }
  54. function c(t, i, n) {
  55. var e
  56. return (
  57. g.inArray(n, q) >= 0 ? (e = s.ofElement(t)) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  58. e ? e[n] : 0
  59. )
  60. }
  61. function u(t, i) {
  62. return t.val - i.val
  63. }
  64. function a(t, i) {
  65. return i.val - t.val
  66. }
  67. function f(t) {
  68. var i = s.ofContent(t, !0),
  69. n = s.ofViewport(t, !0),
  70. e = i.width - n.width,
  71. o = i.height - n.height
  72. ;(this.content = i),
  73. (this.viewport = n),
  74. (this.width = 0 >= e ? null : n.left / e),
  75. (this.height = 0 >= o ? null : n.top / o),
  76. (this.left = n.left),
  77. (this.top = n.top),
  78. (this.right = i.right - n.right),
  79. (this.bottom = i.bottom - n.bottom)
  80. }
  81. function p(t) {
  82. this.el = t || window
  83. }
  84. function d(t, i) {
  85. ;(this.context = t), (this.viewport = i), this.init()
  86. }
  87. function v(t, i, n, e) {
  88. ;(this.context = new l(t, i)), (this.property = n), (this.descending = e), this.init()
  89. }
  90. function w(t) {
  91. t && t !== window && t !== document
  92. ? ((this.context = t), (this.$autoTarget = g(t)))
  93. : (this.context = window),
  94. this.init()
  95. }
  96. var g = jQuery,
  97. m = g(window),
  98. b = g(document),
  99. T = g.extend,
  100. y = g.isFunction,
  101. k = Math.max,
  102. V = Math.min,
  103. E = Math.round,
  104. x = (function () {
  105. var t = {},
  106. i = 1
  107. return function (n) {
  108. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0
  109. }
  110. })()
  111. T(s.prototype, {
  112. equals: function (t) {
  113. return r(this, t, ['left', 'top', 'width', 'height'])
  114. },
  115. area: function () {
  116. return this.width * this.height
  117. },
  118. relativeTo: function (t) {
  119. return new s(this.left - t.left, this.top - t.top, this.width, this.height)
  120. },
  121. intersection: function (t) {
  122. if (!i(t, s)) return null
  123. var n = k(this.left, t.left),
  124. e = V(this.right, t.right),
  125. o = k(this.top, t.top),
  126. r = V(this.bottom, t.bottom),
  127. h = e - n,
  128. l = r - o
  129. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null
  130. },
  131. envelope: function (t) {
  132. if (!i(t, s)) return this
  133. var n = V(this.left, t.left),
  134. e = k(this.right, t.right),
  135. o = V(this.top, t.top),
  136. r = k(this.bottom, t.bottom),
  137. h = e - n,
  138. l = r - o
  139. return new s(n, o, h, l)
  140. }
  141. }),
  142. T(s, {
  143. ofContent: function (t, i) {
  144. return t && t !== document && t !== window
  145. ? i
  146. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  147. : new s(
  148. t.offsetLeft - t.scrollLeft,
  149. t.offsetTop - t.scrollTop,
  150. t.scrollWidth,
  151. t.scrollHeight
  152. )
  153. : new s(0, 0, b.width(), b.height())
  154. },
  155. ofViewport: function (t, i) {
  156. return t && t !== document && t !== window
  157. ? i
  158. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  159. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  160. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height())
  161. },
  162. ofElement: function (t) {
  163. var i = g(t)
  164. if (!i.is(':visible')) return null
  165. var n = i.offset()
  166. return new s(n.left, n.top, i.outerWidth(), i.outerHeight())
  167. }
  168. }),
  169. T(h.prototype, {
  170. equals: function (t) {
  171. return this.fracsEqual(t) && this.rectsEqual(t)
  172. },
  173. fracsEqual: function (t) {
  174. return r(this, t, ['visible', 'viewport', 'possible'])
  175. },
  176. rectsEqual: function (t) {
  177. return r(this.rects, t.rects, ['document', 'element', 'viewport'])
  178. }
  179. }),
  180. T(h, {
  181. of: function (t, i) {
  182. var e, o, r
  183. return (
  184. (t = (n(t) && s.ofElement(t)) || t),
  185. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  186. t instanceof s && (e = t.intersection(i))
  187. ? ((o = e.area()),
  188. (r = V(t.width, i.width) * V(t.height, i.height)),
  189. new h(o / t.area(), o / i.area(), o / r, {
  190. document: e,
  191. element: e.relativeTo(t),
  192. viewport: e.relativeTo(i)
  193. }))
  194. : new h()
  195. )
  196. }
  197. })
  198. var q = ['width', 'height', 'left', 'right', 'top', 'bottom'],
  199. S = ['possible', 'visible', 'viewport']
  200. T(l.prototype, {
  201. sorted: function (t, i) {
  202. var n = this.viewport
  203. return g
  204. .map(this.els, function (i) {
  205. return {
  206. el: i,
  207. val: c(i, n, t)
  208. }
  209. })
  210. .sort(i ? a : u)
  211. },
  212. best: function (t, i) {
  213. return this.els.length ? this.sorted(t, i)[0] : null
  214. }
  215. }),
  216. T(f.prototype, {
  217. equals: function (t) {
  218. return r(this, t, [
  219. 'width',
  220. 'height',
  221. 'left',
  222. 'top',
  223. 'right',
  224. 'bottom',
  225. 'content',
  226. 'viewport'
  227. ])
  228. }
  229. }),
  230. T(p.prototype, {
  231. equals: function (t) {
  232. return r(this, t, ['el'])
  233. },
  234. scrollState: function () {
  235. return new f(this.el)
  236. },
  237. scrollTo: function (t, i, n) {
  238. var e = g(this.el === window ? 'html,body' : this.el)
  239. ;(t = t || 0),
  240. (i = i || 0),
  241. (n = isNaN(n) ? 1e3 : n),
  242. e.stop(!0).animate(
  243. {
  244. scrollLeft: t,
  245. scrollTop: i
  246. },
  247. n
  248. )
  249. },
  250. scroll: function (t, i, n) {
  251. var e = this.el === window ? m : g(this.el)
  252. ;(t = t || 0), (i = i || 0), this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  253. },
  254. scrollToRect: function (t, i, n, e) {
  255. ;(i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e)
  256. },
  257. scrollToElement: function (t, i, n, e) {
  258. var o = s.ofElement(t).relativeTo(s.ofContent(this.el))
  259. this.scrollToRect(o, i, n, e)
  260. }
  261. })
  262. var C = {
  263. init: function () {
  264. ;(this.callbacks = g.Callbacks('memory unique')),
  265. (this.currVal = null),
  266. (this.prevVal = null),
  267. (this.checkProxy = g.proxy(this.check, this)),
  268. this.autoCheck()
  269. },
  270. bind: function (t) {
  271. this.callbacks.add(t)
  272. },
  273. unbind: function (t) {
  274. t ? this.callbacks.remove(t) : this.callbacks.empty()
  275. },
  276. trigger: function () {
  277. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  278. },
  279. check: function (t) {
  280. var i = this.updatedValue(t)
  281. return void 0 !== i && ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  282. },
  283. $autoTarget: m,
  284. autoEvents: 'load resize scroll',
  285. autoCheck: function (t) {
  286. this.$autoTarget[t === !1 ? 'off' : 'on'](this.autoEvents, this.checkProxy)
  287. }
  288. }
  289. T(d.prototype, C, {
  290. updatedValue: function () {
  291. var t = h.of(this.context, this.viewport)
  292. return this.currVal && this.currVal.equals(t) ? void 0 : t
  293. }
  294. }),
  295. T(v.prototype, C, {
  296. updatedValue: function () {
  297. var t = this.context.best(this.property, this.descending)
  298. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t) ? t : void 0
  299. }
  300. }),
  301. T(w.prototype, C, {
  302. updatedValue: function () {
  303. var t = new f(this.context)
  304. return this.currVal && this.currVal.equals(t) ? void 0 : t
  305. }
  306. })
  307. var L = function (t, i) {
  308. var n = [].slice,
  309. e = jQuery,
  310. o = e.extend,
  311. r = e.isFunction,
  312. s = o({}, i),
  313. h = function (i, n, o, s) {
  314. return (
  315. (o = r(o) ? o.apply(i, n) : o),
  316. r(s[o])
  317. ? s[o].apply(i, n)
  318. : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  319. )
  320. },
  321. l = function () {
  322. return h(this, n.call(arguments), s.defaultStatic, l)
  323. },
  324. c = function (t) {
  325. return r(c[t])
  326. ? c[t].apply(this, n.call(arguments, 1))
  327. : h(this, n.call(arguments), s.defaultMethod, c)
  328. },
  329. u = function (t) {
  330. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u)
  331. }
  332. ;(u.prev = {
  333. statics: e[t],
  334. methods: e.fn[t]
  335. }),
  336. u(i),
  337. (e[t] = l),
  338. (e.fn[t] = c)
  339. },
  340. M = 'fracs'
  341. L(M, {
  342. statics: {
  343. version: '0.15.0',
  344. Rect: s,
  345. Fractions: h,
  346. Group: l,
  347. ScrollState: f,
  348. Viewport: p,
  349. FracsCallbacks: d,
  350. GroupCallbacks: v,
  351. ScrollStateCallbacks: w,
  352. fracs: function (t, i) {
  353. return h.of(t, i)
  354. }
  355. },
  356. methods: {
  357. content: function (t) {
  358. return this.length ? s.ofContent(this[0], t) : null
  359. },
  360. envelope: function () {
  361. return o(this, function (t) {
  362. var i = s.ofElement(this)
  363. return t ? t.envelope(i) : i
  364. })
  365. },
  366. fracs: function (i, n, o) {
  367. t(i, 'string') || ((o = n), (n = i), (i = null)), y(n) || ((o = n), (n = null)), (o = e(o))
  368. var r = M + '.fracs.' + x(o)
  369. return 'unbind' === i
  370. ? this.each(function () {
  371. var t = g(this).data(r)
  372. t && t.unbind(n)
  373. })
  374. : 'check' === i
  375. ? this.each(function () {
  376. var t = g(this).data(r)
  377. t && t.check()
  378. })
  379. : y(n)
  380. ? this.each(function () {
  381. var t = g(this),
  382. i = t.data(r)
  383. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n)
  384. })
  385. : this.length
  386. ? h.of(this[0], o)
  387. : null
  388. },
  389. intersection: function () {
  390. return o(this, function (t) {
  391. var i = s.ofElement(this)
  392. return t ? t.intersection(i) : i
  393. })
  394. },
  395. max: function (t, i, n) {
  396. return (
  397. y(i) || ((n = i), (i = null)),
  398. (n = e(n)),
  399. i ? (new v(this, n, t, !0).bind(i), this) : this.pushStack(new l(this, n).best(t, !0).el)
  400. )
  401. },
  402. min: function (t, i, n) {
  403. return (
  404. y(i) || ((n = i), (i = null)),
  405. (n = e(n)),
  406. i ? (new v(this, n, t).bind(i), this) : this.pushStack(new l(this, n).best(t).el)
  407. )
  408. },
  409. rect: function () {
  410. return this.length ? s.ofElement(this[0]) : null
  411. },
  412. scrollState: function (i, n) {
  413. var e = M + '.scrollState'
  414. return (
  415. t(i, 'string') || ((n = i), (i = null)),
  416. 'unbind' === i
  417. ? this.each(function () {
  418. var t = g(this).data(e)
  419. t && t.unbind(n)
  420. })
  421. : 'check' === i
  422. ? this.each(function () {
  423. var t = g(this).data(e)
  424. t && t.check()
  425. })
  426. : y(n)
  427. ? this.each(function () {
  428. var t = g(this),
  429. i = t.data(e)
  430. i || ((i = new w(this)), t.data(e, i)), i.bind(n)
  431. })
  432. : this.length
  433. ? new f(this[0])
  434. : null
  435. )
  436. },
  437. scroll: function (t, i, n) {
  438. return this.each(function () {
  439. new p(this).scroll(t, i, n)
  440. })
  441. },
  442. scrollTo: function (t, i, n, o) {
  443. return (
  444. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  445. (t = e(t)),
  446. this.each(function () {
  447. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  448. })
  449. )
  450. },
  451. scrollToThis: function (t, i, n, o) {
  452. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this
  453. },
  454. softLink: function (t, i, n, o) {
  455. return (
  456. (o = new p(e(o))),
  457. this.filter('a[href^=#]').each(function () {
  458. var e = g(this)
  459. e.on('click', function () {
  460. o.scrollToElement(g(e.attr('href'))[0], t, i, n)
  461. })
  462. })
  463. )
  464. },
  465. sort: function (i, n, o) {
  466. return (
  467. t(n, 'boolean') || ((o = n), (n = null)),
  468. (o = e(o)),
  469. this.pushStack(
  470. g.map(new l(this, o).sorted(i, !n), function (t) {
  471. return t.el
  472. })
  473. )
  474. )
  475. },
  476. viewport: function (t) {
  477. return this.length ? s.ofViewport(this[0], t) : null
  478. }
  479. },
  480. defaultStatic: 'fracs',
  481. defaultMethod: 'fracs'
  482. })
  483. })()
  484. if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery")
  485. ;+(function (t) {
  486. 'use strict'
  487. function e(e) {
  488. return this.each(function () {
  489. var o = t(this),
  490. s = o.data('bs.tooltip'),
  491. n = 'object' == typeof e && e
  492. ;(s || 'destroy' != e) &&
  493. (s || o.data('bs.tooltip', (s = new i(this, n))), 'string' == typeof e && s[e]())
  494. })
  495. }
  496. var i = function (t, e) {
  497. ;(this.type =
  498. this.options =
  499. this.enabled =
  500. this.timeout =
  501. this.hoverState =
  502. this.$element =
  503. null),
  504. this.init('tooltip', t, e)
  505. }
  506. ;(i.VERSION = '3.2.0'),
  507. (i.DEFAULTS = {
  508. animation: !0,
  509. placement: 'top',
  510. selector: !1,
  511. template:
  512. '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  513. trigger: 'hover focus',
  514. title: '',
  515. delay: 0,
  516. html: !1,
  517. container: !1,
  518. viewport: {
  519. selector: 'body',
  520. padding: 0
  521. }
  522. }),
  523. (i.prototype.init = function (e, i, o) {
  524. ;(this.enabled = !0),
  525. (this.type = e),
  526. (this.$element = t(i)),
  527. (this.options = this.getOptions(o)),
  528. (this.$viewport =
  529. this.options.viewport && t(this.options.viewport.selector || this.options.viewport))
  530. for (var s = this.options.trigger.split(' '), n = s.length; n--; ) {
  531. var r = s[n]
  532. if ('click' == r)
  533. this.$element.on('click.' + this.type, this.options.selector, t.proxy(this.toggle, this))
  534. else if ('manual' != r) {
  535. var a = 'hover' == r ? 'mouseenter' : 'focusin',
  536. l = 'hover' == r ? 'mouseleave' : 'focusout'
  537. this.$element.on(a + '.' + this.type, this.options.selector, t.proxy(this.enter, this)),
  538. this.$element.on(l + '.' + this.type, this.options.selector, t.proxy(this.leave, this))
  539. }
  540. }
  541. this.options.selector
  542. ? (this._options = t.extend({}, this.options, {
  543. trigger: 'manual',
  544. selector: ''
  545. }))
  546. : this.fixTitle()
  547. }),
  548. (i.prototype.getDefaults = function () {
  549. return i.DEFAULTS
  550. }),
  551. (i.prototype.getOptions = function (e) {
  552. return (
  553. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  554. e.delay &&
  555. 'number' == typeof e.delay &&
  556. (e.delay = {
  557. show: e.delay,
  558. hide: e.delay
  559. }),
  560. e
  561. )
  562. }),
  563. (i.prototype.getDelegateOptions = function () {
  564. var e = {},
  565. i = this.getDefaults()
  566. return (
  567. this._options &&
  568. t.each(this._options, function (t, o) {
  569. i[t] != o && (e[t] = o)
  570. }),
  571. e
  572. )
  573. }),
  574. (i.prototype.enter = function (e) {
  575. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  576. return (
  577. i ||
  578. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  579. t(e.currentTarget).data('bs.' + this.type, i)),
  580. clearTimeout(i.timeout),
  581. (i.hoverState = 'in'),
  582. i.options.delay && i.options.delay.show
  583. ? void (i.timeout = setTimeout(function () {
  584. // "in" == i.hoverState && i.show()
  585. }, i.options.delay.show))
  586. : i.show()
  587. )
  588. }),
  589. (i.prototype.leave = function (e) {
  590. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  591. return (
  592. i ||
  593. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  594. t(e.currentTarget).data('bs.' + this.type, i)),
  595. clearTimeout(i.timeout),
  596. (i.hoverState = 'out'),
  597. i.options.delay && i.options.delay.hide
  598. ? void (i.timeout = setTimeout(function () {
  599. 'out' == i.hoverState && i.hide()
  600. }, i.options.delay.hide))
  601. : i.hide()
  602. )
  603. }),
  604. (i.prototype.show = function () {
  605. var e = t.Event('show.bs.' + this.type)
  606. if (this.hasContent() && this.enabled) {
  607. this.$element.trigger(e)
  608. var i = t.contains(document.documentElement, this.$element[0])
  609. if (e.isDefaultPrevented() || !i) return
  610. var o = this,
  611. s = this.tip(),
  612. n = this.getUID(this.type)
  613. this.setContent(),
  614. s.attr('id', n),
  615. this.$element.attr('aria-describedby', n),
  616. this.options.animation && s.addClass('fade')
  617. var r =
  618. 'function' == typeof this.options.placement
  619. ? this.options.placement.call(this, s[0], this.$element[0])
  620. : this.options.placement,
  621. a = /\s?auto?\s?/i,
  622. l = a.test(r)
  623. l && (r = r.replace(a, '') || 'top'),
  624. s
  625. .detach()
  626. .css({
  627. top: 0,
  628. left: 0,
  629. display: 'block'
  630. })
  631. .addClass(r)
  632. .data('bs.' + this.type, this),
  633. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element)
  634. var p = this.getPosition(),
  635. h = s[0].offsetWidth,
  636. f = s[0].offsetHeight
  637. if (l) {
  638. var u = r,
  639. c = this.$element.parent(),
  640. d = this.getPosition(c)
  641. ;(r =
  642. 'bottom' == r && p.top + p.height + f - d.scroll > d.height
  643. ? 'top'
  644. : 'top' == r && p.top - d.scroll - f < 0
  645. ? 'bottom'
  646. : 'right' == r && p.right + h > d.width
  647. ? 'left'
  648. : 'left' == r && p.left - h < d.left
  649. ? 'right'
  650. : r),
  651. s.removeClass(u).addClass(r)
  652. }
  653. var g = this.getCalculatedOffset(r, p, h, f)
  654. this.applyPlacement(g, r)
  655. var y = function () {
  656. o.$element.trigger('shown.bs.' + o.type), (o.hoverState = null)
  657. }
  658. t.support.transition && this.$tip.hasClass('fade')
  659. ? s.one('bsTransitionEnd', y).emulateTransitionEnd(150)
  660. : y()
  661. }
  662. }),
  663. (i.prototype.applyPlacement = function (e, i) {
  664. var o = this.tip(),
  665. s = o[0].offsetWidth,
  666. n = o[0].offsetHeight,
  667. r = parseInt(o.css('margin-top'), 10),
  668. a = parseInt(o.css('margin-left'), 10)
  669. isNaN(r) && (r = 0),
  670. isNaN(a) && (a = 0),
  671. (e.top = e.top + r),
  672. (e.left = e.left + a),
  673. t.offset.setOffset(
  674. o[0],
  675. t.extend(
  676. {
  677. using: function (t) {
  678. o.css({
  679. top: Math.round(t.top),
  680. left: Math.round(t.left)
  681. })
  682. }
  683. },
  684. e
  685. ),
  686. 0
  687. ),
  688. o.addClass('in')
  689. var l = o[0].offsetWidth,
  690. p = o[0].offsetHeight
  691. 'top' == i && p != n && (e.top = e.top + n - p)
  692. var h = this.getViewportAdjustedDelta(i, e, l, p)
  693. h.left ? (e.left += h.left) : (e.top += h.top)
  694. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  695. u = h.left ? 'left' : 'top',
  696. c = h.left ? 'offsetWidth' : 'offsetHeight'
  697. o.offset(e), this.replaceArrow(f, o[0][c], u)
  698. }),
  699. (i.prototype.replaceArrow = function (t, e, i) {
  700. this.arrow().css(i, t ? 50 * (1 - t / e) + '%' : '')
  701. }),
  702. (i.prototype.setContent = function () {
  703. var t = this.tip(),
  704. e = this.getTitle()
  705. t.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](e),
  706. t.removeClass('fade in top bottom left right')
  707. }),
  708. (i.prototype.hide = function () {
  709. function e() {
  710. 'in' != i.hoverState && o.detach(), i.$element.trigger('hidden.bs.' + i.type)
  711. }
  712. var i = this,
  713. o = this.tip(),
  714. s = t.Event('hide.bs.' + this.type)
  715. if (
  716. (this.$element.removeAttr('aria-describedby'),
  717. this.$element.trigger(s),
  718. !s.isDefaultPrevented())
  719. )
  720. return (
  721. o.removeClass('in'),
  722. t.support.transition && this.$tip.hasClass('fade')
  723. ? o.one('bsTransitionEnd', e).emulateTransitionEnd(150)
  724. : e(),
  725. (this.hoverState = null),
  726. this
  727. )
  728. }),
  729. (i.prototype.fixTitle = function () {
  730. var t = this.$element
  731. ;(t.attr('title') || 'string' != typeof t.attr('data-original-title')) &&
  732. t.attr('data-original-title', t.attr('title') || '').attr('title', '')
  733. }),
  734. (i.prototype.hasContent = function () {
  735. return this.getTitle()
  736. }),
  737. (i.prototype.getPosition = function (e) {
  738. e = e || this.$element
  739. var i = e[0],
  740. o = 'BODY' == i.tagName
  741. return t.extend(
  742. {},
  743. 'function' == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null,
  744. {
  745. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  746. width: o ? t(window).width() : e.outerWidth(),
  747. height: o ? t(window).height() : e.outerHeight()
  748. },
  749. o
  750. ? {
  751. top: 0,
  752. left: 0
  753. }
  754. : e.offset()
  755. )
  756. }),
  757. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  758. return 'bottom' == t
  759. ? {
  760. top: e.top + e.height,
  761. left: e.left + e.width / 2 - i / 2
  762. }
  763. : 'top' == t
  764. ? {
  765. top: e.top - o,
  766. left: e.left + e.width / 2 - i / 2
  767. }
  768. : 'left' == t
  769. ? {
  770. top: e.top + e.height / 2 - o / 2,
  771. left: e.left - i
  772. }
  773. : {
  774. top: e.top + e.height / 2 - o / 2,
  775. left: e.left + e.width
  776. }
  777. }),
  778. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  779. var s = {
  780. top: 0,
  781. left: 0
  782. }
  783. if (!this.$viewport) return s
  784. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  785. r = this.getPosition(this.$viewport)
  786. if (/right|left/.test(t)) {
  787. var a = e.top - n - r.scroll,
  788. l = e.top + n - r.scroll + o
  789. a < r.top ? (s.top = r.top - a) : l > r.top + r.height && (s.top = r.top + r.height - l)
  790. } else {
  791. var p = e.left - n,
  792. h = e.left + n + i
  793. p < r.left ? (s.left = r.left - p) : h > r.width && (s.left = r.left + r.width - h)
  794. }
  795. return s
  796. }),
  797. (i.prototype.getTitle = function () {
  798. var t,
  799. e = this.$element,
  800. i = this.options
  801. return (t =
  802. e.attr('data-original-title') ||
  803. ('function' == typeof i.title ? i.title.call(e[0]) : i.title))
  804. }),
  805. (i.prototype.getUID = function (t) {
  806. do t += ~~(1e6 * Math.random())
  807. while (document.getElementById(t))
  808. return t
  809. }),
  810. (i.prototype.tip = function () {
  811. return (this.$tip = this.$tip || t(this.options.template))
  812. }),
  813. (i.prototype.arrow = function () {
  814. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  815. }),
  816. (i.prototype.validate = function () {
  817. this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null))
  818. }),
  819. (i.prototype.enable = function () {
  820. this.enabled = !0
  821. }),
  822. (i.prototype.disable = function () {
  823. this.enabled = !1
  824. }),
  825. (i.prototype.toggleEnabled = function () {
  826. this.enabled = !this.enabled
  827. }),
  828. (i.prototype.toggle = function (e) {
  829. var i = this
  830. e &&
  831. ((i = t(e.currentTarget).data('bs.' + this.type)),
  832. i ||
  833. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  834. t(e.currentTarget).data('bs.' + this.type, i))),
  835. i.tip().hasClass('in') ? i.leave(i) : i.enter(i)
  836. }),
  837. (i.prototype.destroy = function () {
  838. clearTimeout(this.timeout),
  839. this.hide()
  840. .$element.off('.' + this.type)
  841. .removeData('bs.' + this.type)
  842. })
  843. var o = t.fn.tooltip
  844. ;(t.fn.tooltip = e),
  845. (t.fn.tooltip.Constructor = i),
  846. (t.fn.tooltip.noConflict = function () {
  847. return (t.fn.tooltip = o), this
  848. })
  849. })(jQuery)
  850. !(function (e, t, n) {
  851. 'undefined' != typeof module && module.exports
  852. ? (module.exports = n())
  853. : 'function' == typeof define && define.amd
  854. ? define(n)
  855. : (t[e] = n())
  856. })('Keen', this, function () {
  857. 'use strict'
  858. function Keen() {
  859. return _init.apply(this, arguments)
  860. }
  861. function _init(e) {
  862. if (_isUndefined(e))
  863. throw new Error(
  864. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  865. )
  866. if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1)
  867. throw new Error('Please provide a projectId')
  868. this.configure(e)
  869. }
  870. function _extend(e) {
  871. for (var t = 1; t < arguments.length; t++) for (var n in arguments[t]) e[n] = arguments[t][n]
  872. return e
  873. }
  874. function _isUndefined(e) {
  875. return void 0 === e
  876. }
  877. function _type(e) {
  878. var t = e && e.constructor ? e.constructor.toString() : void 0
  879. return t ? t.match(/function (.*)\(/)[1] : 'Null'
  880. }
  881. function _each(e, t, n) {
  882. var r
  883. if (!e) return 0
  884. if (((n = n ? n : e), 'array' === _type(e))) {
  885. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0
  886. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0
  887. return 1
  888. }
  889. function _parse_params(e) {
  890. for (
  891. var t,
  892. n = {},
  893. r = /\+/g,
  894. i = /([^&=]+)=?([^&]*)/g,
  895. o = function (e) {
  896. return decodeURIComponent(e.replace(r, ' '))
  897. },
  898. a = e.split('?')[1];
  899. (t = i.exec(a));
  900. )
  901. n[o(t[1])] = o(t[2])
  902. return n
  903. }
  904. function _set_protocol(e) {
  905. switch (e) {
  906. case 'http':
  907. return 'http'
  908. case 'auto':
  909. return location.protocol.replace(/:/g, '')
  910. case 'https':
  911. case void 0:
  912. default:
  913. return 'https'
  914. }
  915. }
  916. function _set_request_type(e) {
  917. var t = e || 'jsonp',
  918. n = !1
  919. return (
  920. ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) &&
  921. 'withCredentials' in new XMLHttpRequest() &&
  922. (n = !0),
  923. null == t || 'xhr' == t ? (n ? 'xhr' : 'jsonp') : t
  924. )
  925. }
  926. function _build_url(e) {
  927. return this.client.endpoint + '/projects/' + this.client.projectId + e
  928. }
  929. function _uploadEvent(e, t, n, r, i) {
  930. var o = _build_url.apply(this, ['/events/' + e]),
  931. a = {}
  932. ;(n = n !== !1), this.client.globalProperties && (a = this.client.globalProperties(e))
  933. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c])
  934. switch (this.client.requestType) {
  935. case 'xhr':
  936. _request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, n, r, i])
  937. break
  938. case 'jsonp':
  939. var s = JSON.stringify(a),
  940. l = Keen.Base64.encode(s)
  941. ;(o = o + '?api_key=' + this.client.writeKey),
  942. (o = o + '&data=' + l),
  943. (o = o + '&modified=' + new Date().getTime()),
  944. _request.jsonp.apply(this, [o, this.client.writeKey, r, i])
  945. break
  946. case 'beacon':
  947. var s = JSON.stringify(a),
  948. l = Keen.Base64.encode(s)
  949. ;(o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)),
  950. (o = o + '&data=' + encodeURIComponent(l)),
  951. (o = o + '&modified=' + encodeURIComponent(new Date().getTime())),
  952. (o += '&c=clv1'),
  953. _request.beacon.apply(this, [o, null, r, i])
  954. }
  955. }
  956. Keen.prototype.configure = function (e) {
  957. return (
  958. (e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
  959. (e.protocol = _set_protocol(e.protocol)),
  960. (e.requestType = _set_request_type(e.requestType)),
  961. (this.client = {
  962. projectId: e.projectId,
  963. writeKey: e.writeKey,
  964. readKey: e.readKey,
  965. globalProperties: null,
  966. endpoint: e.protocol + '://' + e.host,
  967. requestType: e.requestType
  968. }),
  969. Keen.trigger('client', this, e),
  970. this.trigger('ready'),
  971. this
  972. )
  973. }
  974. var _request = {
  975. xhr: function (e, t, n, r, i, o, a, c) {
  976. if (!i)
  977. return Keen.log(
  978. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  979. )
  980. var s = new XMLHttpRequest()
  981. if (
  982. ((s.onreadystatechange = function () {
  983. if (4 == s.readyState)
  984. if (s.status >= 200 && s.status < 300) {
  985. var e
  986. try {
  987. e = JSON.parse(s.responseText)
  988. } catch (e) {
  989. Keen.log('Could not JSON parse HTTP response: ' + s.responseText), c && c(s, e)
  990. }
  991. a && e && a(e)
  992. } else Keen.log('HTTP request failed.'), c && c(s, null)
  993. }),
  994. s.open(e, t, o),
  995. i && s.setRequestHeader('Authorization', i),
  996. r && s.setRequestHeader('Content-Type', 'application/json'),
  997. n)
  998. )
  999. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l])
  1000. var u = r ? JSON.stringify(r) : null
  1001. s.send(u)
  1002. },
  1003. jsonp: function (e, t, n, r) {
  1004. if (!t)
  1005. return Keen.log(
  1006. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  1007. )
  1008. if (t && e.indexOf('api_key') < 0) {
  1009. var i = e.indexOf('?') > 0 ? '&' : '?'
  1010. e = e + i + 'api_key=' + t
  1011. }
  1012. for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a'
  1013. var a = !1
  1014. ;(window[o] = function (e) {
  1015. ;(a = !0), n && e && n(e), (window[o] = void 0)
  1016. }),
  1017. (e = e + '&jsonp=' + o)
  1018. var c = document.createElement('script')
  1019. ;(c.id = 'keen-jsonp'),
  1020. (c.src = e),
  1021. document.getElementsByTagName('head')[0].appendChild(c),
  1022. (c.onreadystatechange = function () {
  1023. a === !1 && 'loaded' === this.readyState && ((a = !0), r && r())
  1024. }),
  1025. (c.onerror = function () {
  1026. a === !1 && ((a = !0), r && r())
  1027. })
  1028. },
  1029. beacon: function (e, t, n, r) {
  1030. if (t && e.indexOf('api_key') < 0) {
  1031. var i = e.indexOf('?') > 0 ? '&' : '?'
  1032. e = e + i + 'api_key=' + t
  1033. }
  1034. var o = !1,
  1035. a = document.createElement('img')
  1036. ;(a.onload = function () {
  1037. if (((o = !0), 'naturalHeight' in this)) {
  1038. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror()
  1039. } else if (this.width + this.height === 0) return void this.onerror()
  1040. n &&
  1041. n({
  1042. created: !0
  1043. })
  1044. }),
  1045. (a.onerror = function () {
  1046. ;(o = !0), r && r()
  1047. }),
  1048. (a.src = e)
  1049. }
  1050. },
  1051. Events = (Keen.Events = {
  1052. on: function (e, t) {
  1053. this.listeners || (this.listeners = {})
  1054. var n = this.listeners[e] || (this.listeners[e] = [])
  1055. return (
  1056. n.push({
  1057. callback: t
  1058. }),
  1059. this
  1060. )
  1061. },
  1062. off: function (e, t) {
  1063. if (!e && !t) return (this.listeners = void 0), delete this.listeners, this
  1064. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1065. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1066. (t && 0 != n.length) || ((this.listeners[e] = void 0), delete this.listeners[e])
  1067. return this
  1068. },
  1069. trigger: function (e) {
  1070. if (!this.listeners) return this
  1071. for (
  1072. var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0;
  1073. r < n.length;
  1074. r++
  1075. )
  1076. n[r].callback.apply(this, t)
  1077. return this
  1078. }
  1079. })
  1080. _extend(Keen.prototype, Events),
  1081. _extend(Keen, Events),
  1082. (Keen.loaded = !0),
  1083. (Keen.utils = {
  1084. each: _each,
  1085. extend: _extend,
  1086. parseParams: _parse_params
  1087. }),
  1088. (Keen.ready = function (e) {
  1089. Keen.loaded ? e() : Keen.on('ready', e)
  1090. }),
  1091. (Keen.log = function (e) {
  1092. 'object' == typeof console && console.log('[Keen IO]', e)
  1093. })
  1094. var Plugins = (Keen.Plugins = {})
  1095. ;(Keen.prototype.addEvent = function () {
  1096. _uploadEvent.apply(this, arguments)
  1097. }),
  1098. (Keen.prototype.addEventSync = function (e, t, n, r) {
  1099. _uploadEvent.apply(this, [e, t, !1, n, r])
  1100. }),
  1101. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  1102. var o = e,
  1103. a = o.metaKey,
  1104. c = o.target,
  1105. s = !1,
  1106. l = function () {}
  1107. return (
  1108. void 0 === r && (r = 500),
  1109. 'A' === c.nodeName
  1110. ? (l = function () {
  1111. a || s || ((s = !0), (window.location = c.href))
  1112. })
  1113. : 'FORM' === c.nodeName &&
  1114. (l = function () {
  1115. s || ((s = !0), c.submit())
  1116. }),
  1117. i &&
  1118. (l = function () {
  1119. s || ((s = !0), i())
  1120. }),
  1121. _uploadEvent.call(this, t, n, l, l),
  1122. setTimeout(function () {
  1123. l()
  1124. }, r),
  1125. !!a && void 0
  1126. )
  1127. }),
  1128. (Keen.prototype.setGlobalProperties = function (e) {
  1129. if (!this.client)
  1130. return Keen.log(
  1131. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  1132. )
  1133. if (!e || 'function' != typeof e) throw new Error('Invalid value for global properties: ' + e)
  1134. this.client.globalProperties = e
  1135. }),
  1136. (Keen.Base64 = {
  1137. map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1138. encode: function (e) {
  1139. var t,
  1140. n,
  1141. r,
  1142. i,
  1143. o,
  1144. a,
  1145. c,
  1146. s = '',
  1147. l = 0,
  1148. u = this.map
  1149. for (e = this.utf8.encode(e); l < e.length; )
  1150. (t = e.charCodeAt(l++)),
  1151. (n = e.charCodeAt(l++)),
  1152. (r = e.charCodeAt(l++)),
  1153. (i = t >> 2),
  1154. (o = ((3 & t) << 4) | (n >> 4)),
  1155. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1156. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1157. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c))
  1158. return s
  1159. },
  1160. decode: function (e) {
  1161. var t,
  1162. n,
  1163. r,
  1164. i,
  1165. o,
  1166. a,
  1167. c,
  1168. s = '',
  1169. l = 0,
  1170. u = this.map,
  1171. f = String.fromCharCode
  1172. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
  1173. (t = u.indexOf(e.charAt(l++))),
  1174. (n = u.indexOf(e.charAt(l++))),
  1175. (r = u.indexOf(e.charAt(l++))),
  1176. (i = u.indexOf(e.charAt(l++))),
  1177. (o = (t << 2) | (n >> 4)),
  1178. (a = ((15 & n) << 4) | (r >> 2)),
  1179. (c = ((3 & r) << 6) | i),
  1180. (s = s + (f(o) + (64 != r ? f(a) : '')) + (64 != i ? f(c) : ''))
  1181. return this.utf8.decode(s)
  1182. },
  1183. utf8: {
  1184. encode: function (e) {
  1185. for (var t, n = '', r = 0, i = String.fromCharCode; r < e.length; )
  1186. (t = e.charCodeAt(r++)),
  1187. (n +=
  1188. 128 > t
  1189. ? i(t)
  1190. : t > 127 && 2048 > t
  1191. ? i((t >> 6) | 192) + i((63 & t) | 128)
  1192. : i((t >> 12) | 224) + i(((t >> 6) & 63) | 128) + i((63 & t) | 128))
  1193. return n
  1194. },
  1195. decode: function (e) {
  1196. for (var t, n, r = '', i = 0, o = String.fromCharCode; i < e.length; )
  1197. (n = e.charCodeAt(i)),
  1198. (r +=
  1199. 128 > n
  1200. ? [o(n), i++][0]
  1201. : n > 191 && 224 > n
  1202. ? [o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))), (i += 2)][0]
  1203. : [
  1204. o(
  1205. ((15 & n) << 12) |
  1206. ((63 & (t = e.charCodeAt(i + 1))) << 6) |
  1207. (63 & (c3 = e.charCodeAt(i + 2)))
  1208. ),
  1209. (i += 3)
  1210. ][0])
  1211. return r
  1212. }
  1213. }
  1214. }),
  1215. 'object' != typeof JSON && (JSON = {}),
  1216. (function () {
  1217. function f(e) {
  1218. return 10 > e ? '0' + e : e
  1219. }
  1220. function quote(e) {
  1221. return (
  1222. (escapable.lastIndex = 0),
  1223. escapable.test(e)
  1224. ? '"' +
  1225. e.replace(escapable, function (e) {
  1226. var t = meta[e]
  1227. return 'string' == typeof t
  1228. ? t
  1229. : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1230. }) +
  1231. '"'
  1232. : '"' + e + '"'
  1233. )
  1234. }
  1235. function str(e, t) {
  1236. var n,
  1237. r,
  1238. i,
  1239. o,
  1240. a,
  1241. c = gap,
  1242. s = t[e]
  1243. switch (
  1244. (s && 'object' == typeof s && 'function' == typeof s.toJSON && (s = s.toJSON(e)),
  1245. 'function' == typeof rep && (s = rep.call(t, e, s)),
  1246. typeof s)
  1247. ) {
  1248. case 'string':
  1249. return quote(s)
  1250. case 'number':
  1251. return isFinite(s) ? String(s) : 'null'
  1252. case 'boolean':
  1253. case 'null':
  1254. return String(s)
  1255. case 'object':
  1256. if (!s) return 'null'
  1257. if (
  1258. ((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(s))
  1259. ) {
  1260. for (o = s.length, n = 0; o > n; n += 1) a[n] = str(n, s) || 'null'
  1261. return (
  1262. (i =
  1263. 0 === a.length
  1264. ? '[]'
  1265. : gap
  1266. ? '[\n' + gap + a.join(',\n' + gap) + '\n' + c + ']'
  1267. : '[' + a.join(',') + ']'),
  1268. (gap = c),
  1269. i
  1270. )
  1271. }
  1272. if (rep && 'object' == typeof rep)
  1273. for (o = rep.length, n = 0; o > n; n += 1)
  1274. 'string' == typeof rep[n] &&
  1275. ((r = rep[n]), (i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1276. else
  1277. for (r in s)
  1278. Object.prototype.hasOwnProperty.call(s, r) &&
  1279. ((i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1280. return (
  1281. (i =
  1282. 0 === a.length
  1283. ? '{}'
  1284. : gap
  1285. ? '{\n' + gap + a.join(',\n' + gap) + '\n' + c + '}'
  1286. : '{' + a.join(',') + '}'),
  1287. (gap = c),
  1288. i
  1289. )
  1290. }
  1291. }
  1292. 'function' != typeof Date.prototype.toJSON &&
  1293. ((Date.prototype.toJSON = function () {
  1294. return isFinite(this.valueOf())
  1295. ? this.getUTCFullYear() +
  1296. '-' +
  1297. f(this.getUTCMonth() + 1) +
  1298. '-' +
  1299. f(this.getUTCDate()) +
  1300. 'T' +
  1301. f(this.getUTCHours()) +
  1302. ':' +
  1303. f(this.getUTCMinutes()) +
  1304. ':' +
  1305. f(this.getUTCSeconds()) +
  1306. 'Z'
  1307. : null
  1308. }),
  1309. (String.prototype.toJSON =
  1310. Number.prototype.toJSON =
  1311. Boolean.prototype.toJSON =
  1312. function () {
  1313. return this.valueOf()
  1314. }))
  1315. var cx =
  1316. /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1317. escapable =
  1318. /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1319. gap,
  1320. indent,
  1321. meta = {
  1322. '\b': '\\b',
  1323. '\t': '\\t',
  1324. '\n': '\\n',
  1325. '\f': '\\f',
  1326. '\r': '\\r',
  1327. '"': '\\"',
  1328. '\\': '\\\\'
  1329. },
  1330. rep
  1331. 'function' != typeof JSON.stringify &&
  1332. (JSON.stringify = function (e, t, n) {
  1333. var r
  1334. if (((gap = ''), (indent = ''), 'number' == typeof n))
  1335. for (r = 0; n > r; r += 1) indent += ' '
  1336. else 'string' == typeof n && (indent = n)
  1337. if (
  1338. ((rep = t),
  1339. t && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length))
  1340. )
  1341. throw new Error('JSON.stringify')
  1342. return str('', {
  1343. '': e
  1344. })
  1345. }),
  1346. 'function' != typeof JSON.parse &&
  1347. (JSON.parse = function (text, reviver) {
  1348. function walk(e, t) {
  1349. var n,
  1350. r,
  1351. i = e[t]
  1352. if (i && 'object' == typeof i)
  1353. for (n in i)
  1354. Object.prototype.hasOwnProperty.call(i, n) &&
  1355. ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n])
  1356. return reviver.call(e, t, i)
  1357. }
  1358. var j
  1359. if (
  1360. ((text = String(text)),
  1361. (cx.lastIndex = 0),
  1362. cx.test(text) &&
  1363. (text = text.replace(cx, function (e) {
  1364. return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1365. })),
  1366. /^[\],:{}\s]*$/.test(
  1367. text
  1368. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  1369. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
  1370. .replace(/(?:^|:|,)(?:\s*\[)+/g, '')
  1371. ))
  1372. )
  1373. return (
  1374. (j = eval('(' + text + ')')),
  1375. 'function' == typeof reviver
  1376. ? walk(
  1377. {
  1378. '': j
  1379. },
  1380. ''
  1381. )
  1382. : j
  1383. )
  1384. throw new SyntaxError('JSON.parse')
  1385. })
  1386. })(),
  1387. !(function (e, t, n) {
  1388. 'undefined' != typeof module && module.exports
  1389. ? (module.exports = n())
  1390. : 'function' == typeof define && define.amd
  1391. ? define(n)
  1392. : (t[e] = n())
  1393. })('domready', Keen.utils, function (e) {
  1394. function t(e) {
  1395. for (d = 1; (e = r.shift()); ) e()
  1396. }
  1397. var n,
  1398. r = [],
  1399. i = !1,
  1400. o = document,
  1401. a = o.documentElement,
  1402. c = a.doScroll,
  1403. s = 'DOMContentLoaded',
  1404. l = 'addEventListener',
  1405. u = 'onreadystatechange',
  1406. f = 'readyState',
  1407. p = c ? /^loaded|^c/ : /^loaded|c/,
  1408. d = p.test(o[f])
  1409. return (
  1410. o[l] &&
  1411. o[l](
  1412. s,
  1413. (n = function () {
  1414. o.removeEventListener(s, n, i), t()
  1415. }),
  1416. i
  1417. ),
  1418. c &&
  1419. o.attachEvent(
  1420. u,
  1421. (n = function () {
  1422. ;/^c/.test(o[f]) && (o.detachEvent(u, n), t())
  1423. })
  1424. ),
  1425. (e = c
  1426. ? function (t) {
  1427. self != top
  1428. ? d
  1429. ? t()
  1430. : r.push(t)
  1431. : (function () {
  1432. try {
  1433. a.doScroll('left')
  1434. } catch (n) {
  1435. return setTimeout(function () {
  1436. e(t)
  1437. }, 50)
  1438. }
  1439. t()
  1440. })()
  1441. }
  1442. : function (e) {
  1443. d ? e() : r.push(e)
  1444. })
  1445. )
  1446. })
  1447. var loaded = window.Keen,
  1448. cached = window._Keen || {},
  1449. clients,
  1450. ready
  1451. if (loaded && cached) {
  1452. ;(clients = cached.clients || {}), (ready = cached.ready || [])
  1453. for (var instance in clients)
  1454. if (clients.hasOwnProperty(instance)) {
  1455. var client = clients[instance]
  1456. for (var method in Keen.prototype)
  1457. Keen.prototype.hasOwnProperty(method) &&
  1458. (loaded.prototype[method] = Keen.prototype[method])
  1459. if (
  1460. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1461. (loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
  1462. client._config && (client.configure.call(client, client._config), delete client._config),
  1463. client._setGlobalProperties)
  1464. ) {
  1465. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1466. client.setGlobalProperties.apply(client, globals[i])
  1467. delete client._setGlobalProperties
  1468. }
  1469. if (client._addEvent) {
  1470. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1471. client.addEvent.apply(client, queue[i])
  1472. delete client._addEvent
  1473. }
  1474. var callback = client._on || []
  1475. if (client._on) {
  1476. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i])
  1477. client.trigger('ready'), delete client._on
  1478. }
  1479. }
  1480. for (var i = 0; i < ready.length; i++) {
  1481. var callback = ready[i]
  1482. Keen.on('ready', function () {
  1483. callback()
  1484. })
  1485. }
  1486. }
  1487. return (
  1488. Keen.loaded &&
  1489. setTimeout(function () {
  1490. Keen.utils.domready(function () {
  1491. Keen.trigger('ready')
  1492. })
  1493. }, 0),
  1494. Keen
  1495. )
  1496. })
  1497. !(function () {
  1498. var t = (window.analytics = window.analytics || [])
  1499. if (!t.initialize) {
  1500. if (t.invoked)
  1501. return void (
  1502. window.console &&
  1503. console.error &&
  1504. console.error('Segment snippet included twice.')
  1505. )
  1506. ;(t.invoked = !0),
  1507. (t.methods = [
  1508. 'trackSubmit',
  1509. 'trackClick',
  1510. 'trackLink',
  1511. 'trackForm',
  1512. 'pageview',
  1513. 'identify',
  1514. 'reset',
  1515. 'group',
  1516. 'track',
  1517. 'ready',
  1518. 'alias',
  1519. 'debug',
  1520. 'page',
  1521. 'once',
  1522. 'off',
  1523. 'on'
  1524. ]),
  1525. (t.factory = function (e) {
  1526. return function () {
  1527. var n = Array.prototype.slice.call(arguments)
  1528. return n.unshift(e), t.push(n), t
  1529. }
  1530. })
  1531. for (var e = 0; e < t.methods.length; e++) {
  1532. var n = t.methods[e]
  1533. t[n] = t.factory(n)
  1534. }
  1535. ;(t.load = function (t) {
  1536. var e = document.createElement('script')
  1537. ;(e.type = 'text/javascript'),
  1538. (e.async = !0),
  1539. (e.src =
  1540. ('https:' === document.location.protocol ? 'https://' : 'http://') +
  1541. 'cdn.segment.com/analytics.js/v1/' +
  1542. t +
  1543. '/analytics.min.js')
  1544. var n = document.getElementsByTagName('script')[0]
  1545. n.parentNode.insertBefore(e, n)
  1546. }),
  1547. (t.SNIPPET_VERSION = '4.0.0')
  1548. }
  1549. })()
  1550. !(function (i, e) {
  1551. 'use strict'
  1552. var s = '',
  1553. r = '?',
  1554. o = 'function',
  1555. a = 'undefined',
  1556. n = 'object',
  1557. t = 'major',
  1558. d = 'model',
  1559. w = 'name',
  1560. l = 'type',
  1561. p = 'vendor',
  1562. m = 'version',
  1563. c = 'architecture',
  1564. u = 'console',
  1565. g = 'mobile',
  1566. f = 'tablet',
  1567. h = 'smarttv',
  1568. b = {
  1569. has: function (i, e) {
  1570. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1571. },
  1572. lowerize: function (i) {
  1573. return i.toLowerCase()
  1574. }
  1575. },
  1576. y = {
  1577. rgx: function () {
  1578. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1579. var c = m[p],
  1580. u = m[p + 1]
  1581. if (typeof i === a) {
  1582. i = {}
  1583. for (t in u) (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e)
  1584. }
  1585. for (s = r = 0; s < c.length; s++)
  1586. if ((w = c[s].exec(this.getUA()))) {
  1587. for (t = 0; t < u.length; t++)
  1588. (l = w[++r]),
  1589. (d = u[t]),
  1590. typeof d === n && d.length > 0
  1591. ? 2 == d.length
  1592. ? typeof d[1] == o
  1593. ? (i[d[0]] = d[1].call(this, l))
  1594. : (i[d[0]] = d[1])
  1595. : 3 == d.length
  1596. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1597. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1598. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1599. : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e)
  1600. : (i[d] = l ? l : e)
  1601. break
  1602. }
  1603. if (w) break
  1604. }
  1605. return i
  1606. },
  1607. str: function (i, s) {
  1608. for (var o in s)
  1609. if (typeof s[o] === n && s[o].length > 0) {
  1610. for (var a = 0; a < s[o].length; a++) if (b.has(s[o][a], i)) return o === r ? e : o
  1611. } else if (b.has(s[o], i)) return o === r ? e : o
  1612. return i
  1613. }
  1614. },
  1615. v = {
  1616. browser: {
  1617. oldsafari: {
  1618. major: {
  1619. 1: ['/8', '/1', '/3'],
  1620. 2: '/4',
  1621. '?': '/'
  1622. },
  1623. version: {
  1624. '1.0': '/8',
  1625. 1.2: '/1',
  1626. 1.3: '/3',
  1627. '2.0': '/412',
  1628. '2.0.2': '/416',
  1629. '2.0.3': '/417',
  1630. '2.0.4': '/419',
  1631. '?': '/'
  1632. }
  1633. }
  1634. },
  1635. device: {
  1636. sprint: {
  1637. model: {
  1638. 'Evo Shift 4G': '7373KT'
  1639. },
  1640. vendor: {
  1641. HTC: 'APA',
  1642. Sprint: 'Sprint'
  1643. }
  1644. }
  1645. },
  1646. os: {
  1647. windows: {
  1648. version: {
  1649. ME: '4.90',
  1650. 'NT 3.11': 'NT3.51',
  1651. 'NT 4.0': 'NT4.0',
  1652. 2e3: 'NT 5.0',
  1653. XP: ['NT 5.1', 'NT 5.2'],
  1654. Vista: 'NT 6.0',
  1655. 7: 'NT 6.1',
  1656. 8: 'NT 6.2',
  1657. 8.1: 'NT 6.3',
  1658. RT: 'ARM'
  1659. }
  1660. }
  1661. }
  1662. },
  1663. k = {
  1664. browser: [
  1665. [
  1666. /(opera\smini)\/((\d+)?[\w\.-]+)/i,
  1667. /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,
  1668. /(opera).+version\/((\d+)?[\w\.]+)/i,
  1669. /(opera)[\/\s]+((\d+)?[\w\.]+)/i
  1670. ],
  1671. [w, m, t],
  1672. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1673. [[w, 'Opera'], m, t],
  1674. [
  1675. /(kindle)\/((\d+)?[\w\.]+)/i,
  1676. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1677. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1678. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1679. /(rekonq)((?:\/)[\w\.]+)*/i,
  1680. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
  1681. ],
  1682. [w, m, t],
  1683. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1684. [[w, 'IE'], m, t],
  1685. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1686. [[w, 'Yandex'], m, t],
  1687. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1688. [[w, /_/g, ' '], m, t],
  1689. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1690. [w, m, t],
  1691. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1692. [[w, 'Dolphin'], m, t],
  1693. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1694. [[w, 'Chrome'], m, t],
  1695. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1696. [m, t, [w, 'Mobile Safari']],
  1697. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1698. [m, t, w],
  1699. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1700. [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]],
  1701. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1702. [w, m, t],
  1703. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1704. [[w, 'Netscape'], m, t],
  1705. [
  1706. /(swiftfox)/i,
  1707. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1708. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1709. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1710. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1711. /(links)\s\(((\d+)?[\w\.]+)/i,
  1712. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1713. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1714. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i
  1715. ],
  1716. [w, m, t],
  1717. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1718. [w, m, t],
  1719. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1720. [w, m],
  1721. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1722. [w, m, t],
  1723. [
  1724. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1725. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1726. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1727. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i
  1728. ],
  1729. [w, m, t],
  1730. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1731. [w, m, t],
  1732. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1733. [[w, 'Flip Player'], m, t],
  1734. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1735. [w],
  1736. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1737. [w, m, t],
  1738. [
  1739. /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i,
  1740. /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
  1741. /(lavf)((\d+)[\d\.]+)/i
  1742. ],
  1743. [w, m, t],
  1744. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1745. [[w, /_/g, ' '], m, t],
  1746. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1747. [w, m],
  1748. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1749. [w, m, t],
  1750. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1751. [w],
  1752. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1753. [w, m, t],
  1754. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1755. [w, m, t],
  1756. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1757. [w, m, t],
  1758. [
  1759. /(winamp)3 version ((\d+)[\w\.-]+)/i,
  1760. /(winamp)\s((\d+)[\w\.-]+)/i,
  1761. /(winamp)mpeg\/((\d+)[\w\.-]+)/i
  1762. ],
  1763. [w, m, t],
  1764. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1765. [w],
  1766. [
  1767. /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i
  1768. ],
  1769. [w, m, t],
  1770. [/(smp)((\d+)[\d\.]+)/i],
  1771. [w, m, t],
  1772. [
  1773. /(vlc) media player - version ((\d+)[\w\.]+)/i,
  1774. /(vlc)\/((\d+)[\w\.-]+)/i,
  1775. /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i,
  1776. /(foobar2000)\/((\d+)[\d\.]+)/i,
  1777. /(itunes)\/((\d+)[\d\.]+)/i
  1778. ],
  1779. [w, m, t],
  1780. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1781. [[w, /-/g, ' '], m, t],
  1782. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1783. [m, t, [w, 'Windows']],
  1784. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1785. [w, m, t],
  1786. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1787. [[w, 'rad.io'], m, t]
  1788. ],
  1789. cpu: [
  1790. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1791. [[c, 'amd64']],
  1792. [/(ia32(?=;))/i],
  1793. [[c, b.lowerize]],
  1794. [/((?:i[346]|x)86)[;\)]/i],
  1795. [[c, 'ia32']],
  1796. [/windows\s(ce|mobile);\sppc;/i],
  1797. [[c, 'arm']],
  1798. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1799. [[c, /ower/, '', b.lowerize]],
  1800. [/(sun4\w)[;\)]/i],
  1801. [[c, 'sparc']],
  1802. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1803. [c, b.lowerize]
  1804. ],
  1805. device: [
  1806. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1807. [d, p, [l, f]],
  1808. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1809. [d, [p, 'Apple'], [l, f]],
  1810. [/(apple\s{0,1}tv)/i],
  1811. [
  1812. [d, 'Apple TV'],
  1813. [p, 'Apple']
  1814. ],
  1815. [
  1816. /(hp).+(touchpad)/i,
  1817. /(kindle)\/([\w\.]+)/i,
  1818. /\s(nook)[\w\s]+build\/(\w+)/i,
  1819. /(dell)\s(strea[kpr\s\d]*[\dko])/i
  1820. ],
  1821. [p, d, [l, f]],
  1822. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1823. [d, p, [l, g]],
  1824. [/\((ip[honed|\s\w*]+);/i],
  1825. [d, [p, 'Apple'], [l, g]],
  1826. [
  1827. /(blackberry)[\s-]?(\w+)/i,
  1828. /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,
  1829. /(hp)\s([\w\s]+\w)/i,
  1830. /(asus)-?(\w+)/i
  1831. ],
  1832. [p, d, [l, g]],
  1833. [/\((bb10);\s(\w+)/i],
  1834. [[p, 'BlackBerry'], d, [l, g]],
  1835. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1836. [[p, 'Asus'], d, [l, f]],
  1837. [/(sony)\s(tablet\s[ps])/i],
  1838. [p, d, [l, f]],
  1839. [/(nintendo)\s([wids3u]+)/i],
  1840. [p, d, [l, u]],
  1841. [/((playstation)\s[3portablevi]+)/i],
  1842. [[p, 'Sony'], d, [l, u]],
  1843. [/(sprint\s(\w+))/i],
  1844. [
  1845. [p, y.str, v.device.sprint.vendor],
  1846. [d, y.str, v.device.sprint.model],
  1847. [l, g]
  1848. ],
  1849. [
  1850. /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,
  1851. /(zte)-(\w+)*/i,
  1852. /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i
  1853. ],
  1854. [p, [d, /_/g, ' '], [l, g]],
  1855. [
  1856. /\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
  1857. /(mot)[\s-]?(\w+)*/i
  1858. ],
  1859. [[p, 'Motorola'], d, [l, g]],
  1860. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1861. [[p, 'Motorola'], d, [l, f]],
  1862. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1863. [[p, 'Samsung'], d, [l, f]],
  1864. [
  1865. /((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,
  1866. /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
  1867. /sec-((sgh\w+))/i
  1868. ],
  1869. [[p, 'Samsung'], d, [l, g]],
  1870. [/(sie)-(\w+)*/i],
  1871. [[p, 'Siemens'], d, [l, g]],
  1872. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1873. [[p, 'Nokia'], d, [l, g]],
  1874. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1875. [[p, 'Acer'], d, [l, f]],
  1876. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1877. [[p, 'LG'], d, [l, f]],
  1878. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1879. [[p, 'LG'], d, [l, g]],
  1880. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1881. [[p, 'Lenovo'], d, [l, f]],
  1882. [/(lg) netcast\.tv/i],
  1883. [p, [l, h]],
  1884. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1885. [l, p, d]
  1886. ],
  1887. engine: [
  1888. [
  1889. /(presto)\/([\w\.]+)/i,
  1890. /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,
  1891. /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,
  1892. /(icab)[\/\s]([23]\.[\d\.]+)/i
  1893. ],
  1894. [w, m],
  1895. [/rv\:([\w\.]+).*(gecko)/i],
  1896. [m, w]
  1897. ],
  1898. os: [
  1899. [/microsoft\s(windows)\s(vista|xp)/i],
  1900. [w, m],
  1901. [
  1902. /(windows)\snt\s6\.2;\s(arm)/i,
  1903. /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
  1904. ],
  1905. [w, [m, y.str, v.os.windows.version]],
  1906. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1907. [
  1908. [w, 'Windows'],
  1909. [m, y.str, v.os.windows.version]
  1910. ],
  1911. [/\((bb)(10);/i],
  1912. [[w, 'BlackBerry'], m],
  1913. [
  1914. /(blackberry)\w*\/?([\w\.]+)*/i,
  1915. /(tizen)\/([\w\.]+)/i,
  1916. /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i
  1917. ],
  1918. [w, m],
  1919. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1920. [[w, 'Symbian'], m],
  1921. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1922. [[w, 'Firefox OS'], m],
  1923. [
  1924. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  1925. /(mint)[\/\s\(]?(\w+)*/i,
  1926. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  1927. /(hurd|linux)\s?([\w\.]+)*/i,
  1928. /(gnu)\s?([\w\.]+)*/i
  1929. ],
  1930. [w, m],
  1931. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1932. [[w, 'Chromium OS'], m],
  1933. [/(sunos)\s?([\w\.]+\d)*/i],
  1934. [[w, 'Solaris'], m],
  1935. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1936. [w, m],
  1937. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1938. [
  1939. [w, 'iOS'],
  1940. [m, /_/g, '.']
  1941. ],
  1942. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1943. [w, [m, /_/g, '.']],
  1944. [
  1945. /(haiku)\s(\w+)/i,
  1946. /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,
  1947. /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
  1948. /(unix)\s?([\w\.]+)*/i
  1949. ],
  1950. [w, m]
  1951. ]
  1952. },
  1953. x = function (e) {
  1954. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s)
  1955. return this instanceof x
  1956. ? ((this.getBrowser = function () {
  1957. return y.rgx.apply(this, k.browser)
  1958. }),
  1959. (this.getCPU = function () {
  1960. return y.rgx.apply(this, k.cpu)
  1961. }),
  1962. (this.getDevice = function () {
  1963. return y.rgx.apply(this, k.device)
  1964. }),
  1965. (this.getEngine = function () {
  1966. return y.rgx.apply(this, k.engine)
  1967. }),
  1968. (this.getOS = function () {
  1969. return y.rgx.apply(this, k.os)
  1970. }),
  1971. (this.getResult = function () {
  1972. return {
  1973. ua: this.getUA(),
  1974. browser: this.getBrowser(),
  1975. engine: this.getEngine(),
  1976. os: this.getOS(),
  1977. device: this.getDevice(),
  1978. cpu: this.getCPU()
  1979. }
  1980. }),
  1981. (this.getUA = function () {
  1982. return r
  1983. }),
  1984. (this.setUA = function (i) {
  1985. return (r = i), this
  1986. }),
  1987. void this.setUA(r))
  1988. : new x(e).getResult()
  1989. }
  1990. if (typeof exports !== a)
  1991. typeof module !== a && module.exports && (exports = module.exports = x), (exports.UAParser = x)
  1992. else if (
  1993. ((i.UAParser = x),
  1994. typeof define === o &&
  1995. define.amd &&
  1996. define(function () {
  1997. return x
  1998. }),
  1999. typeof i.jQuery !== a)
  2000. ) {
  2001. var A = i.jQuery,
  2002. _ = new x()
  2003. ;(A.ua = _.getResult()),
  2004. (A.ua.get = function () {
  2005. return _.getUA()
  2006. }),
  2007. (A.ua.set = function (i) {
  2008. _.setUA(i)
  2009. var e = _.getResult()
  2010. for (var s in e) A.ua[s] = e[s]
  2011. })
  2012. }
  2013. })(this)
  2014. window.Modernizr = (function (n, e, t) {
  2015. function o(n) {
  2016. d.cssText = n
  2017. }
  2018. function r(n, e) {
  2019. return typeof n === e
  2020. }
  2021. var i,
  2022. c,
  2023. u,
  2024. a = '2.8.2',
  2025. f = {},
  2026. s = e.documentElement,
  2027. l = 'modernizr',
  2028. p = e.createElement(l),
  2029. d = p.style,
  2030. y = ({}.toString, {}),
  2031. w = [],
  2032. b = w.slice,
  2033. v = {}.hasOwnProperty
  2034. ;(u =
  2035. r(v, 'undefined') || r(v.call, 'undefined')
  2036. ? function (n, e) {
  2037. return e in n && r(n.constructor.prototype[e], 'undefined')
  2038. }
  2039. : function (n, e) {
  2040. return v.call(n, e)
  2041. }),
  2042. Function.prototype.bind ||
  2043. (Function.prototype.bind = function (n) {
  2044. var e = this
  2045. if ('function' != typeof e) throw new TypeError()
  2046. var t = b.call(arguments, 1),
  2047. o = function () {
  2048. if (this instanceof o) {
  2049. var r = function () {}
  2050. r.prototype = e.prototype
  2051. var i = new r(),
  2052. c = e.apply(i, t.concat(b.call(arguments)))
  2053. return Object(c) === c ? c : i
  2054. }
  2055. return e.apply(n, t.concat(b.call(arguments)))
  2056. }
  2057. return o
  2058. }),
  2059. (y.webgl = function () {
  2060. return !!n.WebGLRenderingContext
  2061. })
  2062. for (var h in y)
  2063. u(y, h) && ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? '' : 'no-') + c))
  2064. return (
  2065. (f.addTest = function (n, e) {
  2066. if ('object' == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o])
  2067. else {
  2068. if (((n = n.toLowerCase()), f[n] !== t)) return f
  2069. ;(e = 'function' == typeof e ? e() : e),
  2070. 'undefined' != typeof enableClasses &&
  2071. enableClasses &&
  2072. (s.className += ' ' + (e ? '' : 'no-') + n),
  2073. (f[n] = e)
  2074. }
  2075. return f
  2076. }),
  2077. o(''),
  2078. (p = i = null),
  2079. (f._version = a),
  2080. f
  2081. )
  2082. })(this, this.document)
  2083. !(function (e, t, a) {
  2084. 'use strict'
  2085. function n(t, h, m) {
  2086. function H(a) {
  2087. var n = 0,
  2088. i = Ee.length
  2089. if (
  2090. ((Ce.old = e.extend({}, Ce)),
  2091. (Ie = we ? 0 : be[ge.horizontal ? 'width' : 'height']()),
  2092. (ke = Be[ge.horizontal ? 'width' : 'height']()),
  2093. (ze = we ? t : Pe[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2094. (Ee.length = 0),
  2095. (Ce.start = 0),
  2096. (Ce.end = q(ze - Ie, 0)),
  2097. Re)
  2098. ) {
  2099. ;(n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0)
  2100. var r,
  2101. s = c(Pe, ge.horizontal ? 'paddingLeft' : 'paddingTop'),
  2102. o = c(Pe, ge.horizontal ? 'paddingRight' : 'paddingBottom'),
  2103. l = 'border-box' === e(qe).css('boxSizing'),
  2104. u = 'none' !== qe.css('float'),
  2105. f = 0,
  2106. v = qe.length - 1
  2107. ;(ze = 0),
  2108. qe.each(function (t, a) {
  2109. var n = e(a),
  2110. i = a.getBoundingClientRect(),
  2111. l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top),
  2112. d = c(n, ge.horizontal ? 'marginLeft' : 'marginTop'),
  2113. p = c(n, ge.horizontal ? 'marginRight' : 'marginBottom'),
  2114. h = l + d + p,
  2115. m = !d || !p,
  2116. g = {}
  2117. ;(g.el = a),
  2118. (g.size = m ? l : h),
  2119. (g.half = g.size / 2),
  2120. (g.start = ze + (m ? d : 0)),
  2121. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  2122. (g.end = g.start - Ie + g.size),
  2123. t || (ze += s),
  2124. (ze += h),
  2125. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  2126. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  2127. Ne.push(g),
  2128. (r = g)
  2129. }),
  2130. (Pe[0].style[ge.horizontal ? 'width' : 'height'] = (l ? ze : ze - s - o) + 'px'),
  2131. (ze -= f),
  2132. Ne.length
  2133. ? ((Ce.start = Ne[0][Me ? 'center' : 'start']),
  2134. (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start))
  2135. : (Ce.start = Ce.end = 0)
  2136. }
  2137. if (
  2138. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  2139. Q(),
  2140. Se.length &&
  2141. ke > 0 &&
  2142. (ge.dynamicHandle
  2143. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)),
  2144. (Te = d(Te, ge.minHandleSize, ke)),
  2145. (Se[0].style[ge.horizontal ? 'width' : 'height'] = Te + 'px'))
  2146. : (Te = Se[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2147. (xe.end = ke - Te),
  2148. it || j()),
  2149. !we && Ie > 0)
  2150. ) {
  2151. var p = Ce.start,
  2152. h = ''
  2153. if (Re)
  2154. e.each(Ne, function (e, t) {
  2155. Me
  2156. ? Ee.push(t.center)
  2157. : t.start + t.size > p &&
  2158. p <= Ce.end &&
  2159. ((p = t.start),
  2160. Ee.push(p),
  2161. (p += Ie),
  2162. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  2163. })
  2164. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie)
  2165. if (De[0] && i !== Ee.length) {
  2166. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m)
  2167. ;(Ae = De.html(h).children()), Ae.eq(Oe.activePage).addClass(ge.activeClass)
  2168. }
  2169. }
  2170. if (((Oe.slideeSize = ze), (Oe.frameSize = Ie), (Oe.sbSize = ke), (Oe.handleSize = Te), Re)) {
  2171. a && null != ge.startAt && (W(ge.startAt), ye[Le ? 'toCenter' : 'toStart'](ge.startAt))
  2172. var g = Ne[Oe.activeItem]
  2173. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  2174. } else a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end))
  2175. pe('load')
  2176. }
  2177. function X(e, t, a) {
  2178. if (Re && at.released && !a) {
  2179. var n = $(e),
  2180. i = e > Ce.start && e < Ce.end
  2181. Le
  2182. ? (i && (e = Ne[n.centerItem].center), Me && ge.activateMiddle && W(n.centerItem))
  2183. : i && (e = Ne[n.firstItem].start)
  2184. }
  2185. at.init && at.slidee && ge.elasticBounds
  2186. ? e > Ce.end
  2187. ? (e = Ce.end + (e - Ce.end) / 6)
  2188. : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)
  2189. : (e = d(e, Ce.start, Ce.end)),
  2190. (et.start = +new Date()),
  2191. (et.time = 0),
  2192. (et.from = Ce.cur),
  2193. (et.to = e),
  2194. (et.delta = e - Ce.cur),
  2195. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  2196. (et.immediate = !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  2197. (at.tweese = 0),
  2198. e !== Ce.dest && ((Ce.dest = e), pe('change'), it || Y()),
  2199. K(),
  2200. Q(),
  2201. Z(),
  2202. F()
  2203. }
  2204. function Y() {
  2205. if (ye.initialized) {
  2206. if (!it) return (it = w(Y)), void (at.released && pe('moveStart'))
  2207. et.immediate
  2208. ? (Ce.cur = et.to)
  2209. : et.tweesing
  2210. ? ((et.tweeseDelta = et.to - Ce.cur),
  2211. x(et.tweeseDelta) < 0.1
  2212. ? (Ce.cur = et.to)
  2213. : (Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)))
  2214. : ((et.time = N(+new Date() - et.start, ge.speed)),
  2215. (Ce.cur =
  2216. et.from +
  2217. et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed))),
  2218. et.to === Ce.cur ? ((Ce.cur = et.to), (at.tweese = it = 0)) : (it = w(Y)),
  2219. pe('move'),
  2220. we ||
  2221. (f
  2222. ? (Pe[0].style[f] =
  2223. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + -Ce.cur + 'px)')
  2224. : (Pe[0].style[ge.horizontal ? 'left' : 'top'] = -E(Ce.cur) + 'px')),
  2225. !it && at.released && pe('moveEnd'),
  2226. j()
  2227. }
  2228. }
  2229. function j() {
  2230. Se.length &&
  2231. ((xe.cur =
  2232. Ce.start === Ce.end
  2233. ? 0
  2234. : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start)) *
  2235. xe.end),
  2236. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  2237. _e.hPos !== xe.cur &&
  2238. ((_e.hPos = xe.cur),
  2239. f
  2240. ? (Se[0].style[f] =
  2241. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + xe.cur + 'px)')
  2242. : (Se[0].style[ge.horizontal ? 'left' : 'top'] = xe.cur + 'px')))
  2243. }
  2244. function F() {
  2245. Ae[0] &&
  2246. _e.page !== Oe.activePage &&
  2247. ((_e.page = Oe.activePage),
  2248. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  2249. pe('activePage', _e.page))
  2250. }
  2251. function M() {
  2252. ;(tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  2253. (ot = at.init ? w(M) : 0),
  2254. (tt.now = +new Date()),
  2255. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  2256. X(at.init ? tt.pos : E(tt.pos)),
  2257. at.init || Ce.cur !== Ce.dest || pe('moveEnd'),
  2258. (tt.lastTime = tt.now)
  2259. }
  2260. function L(e, t, n) {
  2261. if (('boolean' === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n)
  2262. else {
  2263. if (Le && 'center' !== e) return
  2264. var r = ye.getPos(t)
  2265. r && X(r[e], n, !Le)
  2266. }
  2267. }
  2268. function R(e) {
  2269. return null != e ? (l(e) ? (e >= 0 && e < Ne.length ? e : -1) : qe.index(e)) : -1
  2270. }
  2271. function U(e) {
  2272. return R(l(e) && 0 > e ? e + Ne.length : e)
  2273. }
  2274. function W(e, t) {
  2275. var a = R(e)
  2276. return (
  2277. !(!Re || 0 > a) &&
  2278. ((_e.active !== a || t) &&
  2279. (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2280. qe.eq(a).addClass(ge.activeClass),
  2281. (_e.active = Oe.activeItem = a),
  2282. Z(),
  2283. pe('active', a)),
  2284. a)
  2285. )
  2286. }
  2287. function $(e) {
  2288. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end)
  2289. var t = {},
  2290. a = Me ? 0 : Ie / 2
  2291. if (!we)
  2292. for (var n = 0, i = Ee.length; i > n; n++) {
  2293. if (e >= Ce.end || n === Ee.length - 1) {
  2294. t.activePage = Ee.length - 1
  2295. break
  2296. }
  2297. if (e <= Ee[n] + a) {
  2298. t.activePage = n
  2299. break
  2300. }
  2301. }
  2302. if (Re) {
  2303. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2304. if (
  2305. (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2306. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2307. c === u - 1 || e <= Ne[c].end + Ne[c].half)
  2308. ) {
  2309. s = c
  2310. break
  2311. }
  2312. ;(t.firstItem = l(r) ? r : 0),
  2313. (t.centerItem = l(o) ? o : t.firstItem),
  2314. (t.lastItem = l(s) ? s : t.centerItem)
  2315. }
  2316. return t
  2317. }
  2318. function Q(t) {
  2319. e.extend(Oe, $(t))
  2320. }
  2321. function Z() {
  2322. var e = Ce.dest <= Ce.start,
  2323. t = Ce.dest >= Ce.end,
  2324. a = (e ? 1 : 0) | (t ? 2 : 0)
  2325. if (
  2326. (_e.slideePosState !== a &&
  2327. ((_e.slideePosState = a),
  2328. Je.is('button,input') && Je.prop('disabled', e),
  2329. Ke.is('button,input') && Ke.prop('disabled', t),
  2330. Je.add(Qe)[e ? 'addClass' : 'removeClass'](ge.disabledClass),
  2331. Ke.add($e)[t ? 'addClass' : 'removeClass'](ge.disabledClass)),
  2332. _e.fwdbwdState !== a &&
  2333. at.released &&
  2334. ((_e.fwdbwdState = a),
  2335. Qe.is('button,input') && Qe.prop('disabled', e),
  2336. $e.is('button,input') && $e.prop('disabled', t)),
  2337. Re && null != Oe.activeItem)
  2338. ) {
  2339. var n = 0 === Oe.activeItem,
  2340. i = Oe.activeItem >= Ne.length - 1,
  2341. r = (n ? 1 : 0) | (i ? 2 : 0)
  2342. _e.itemsButtonState !== r &&
  2343. ((_e.itemsButtonState = r),
  2344. Ze.is('button,input') && Ze.prop('disabled', n),
  2345. Ge.is('button,input') && Ge.prop('disabled', i),
  2346. Ze[n ? 'addClass' : 'removeClass'](ge.disabledClass),
  2347. Ge[i ? 'addClass' : 'removeClass'](ge.disabledClass))
  2348. }
  2349. }
  2350. function G(e, t, a) {
  2351. if (
  2352. ((e = U(e)),
  2353. (t = U(t)),
  2354. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1))
  2355. ) {
  2356. qe.eq(e)[a ? 'insertAfter' : 'insertBefore'](Ne[t].el)
  2357. var n = t > e ? e : a ? t : t - 1,
  2358. i = e > t ? e : a ? t + 1 : t,
  2359. r = e > t
  2360. null != Oe.activeItem &&
  2361. (e === Oe.activeItem
  2362. ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1)
  2363. : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  2364. H()
  2365. }
  2366. }
  2367. function J(e, t) {
  2368. for (var a = 0, n = Ve[e].length; n > a; a++) if (Ve[e][a] === t) return a
  2369. return -1
  2370. }
  2371. function K() {
  2372. at.released && !ye.isPaused && ye.resume()
  2373. }
  2374. function V(e) {
  2375. return E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start
  2376. }
  2377. function _() {
  2378. ;(at.history[0] = at.history[1]),
  2379. (at.history[1] = at.history[2]),
  2380. (at.history[2] = at.history[3]),
  2381. (at.history[3] = at.delta)
  2382. }
  2383. function ee(e) {
  2384. ;(at.released = 0), (at.source = e), (at.slidee = 'slidee' === e)
  2385. }
  2386. function te(t) {
  2387. var a = 'touchstart' === t.type,
  2388. n = t.data.source,
  2389. i = 'slidee' === n
  2390. at.init ||
  2391. (!a && ie(t.target)) ||
  2392. (('handle' !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2393. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2394. (a || r(t),
  2395. ee(n),
  2396. (at.init = 0),
  2397. (at.$source = e(t.target)),
  2398. (at.touch = a),
  2399. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2400. (at.initX = at.pointer.pageX),
  2401. (at.initY = at.pointer.pageY),
  2402. (at.initPos = i ? Ce.cur : xe.cur),
  2403. (at.start = +new Date()),
  2404. (at.time = 0),
  2405. (at.path = 0),
  2406. (at.delta = 0),
  2407. (at.locked = 0),
  2408. (at.history = [0, 0, 0, 0]),
  2409. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2410. b.on(a ? z : I, ae),
  2411. ye.pause(1),
  2412. (i ? Pe : Se).addClass(ge.draggedClass),
  2413. pe('moveStart'),
  2414. i && (rt = setInterval(_, 10))))
  2415. }
  2416. function ae(e) {
  2417. if (
  2418. ((at.released = 'mouseup' === e.type || 'touchend' === e.type),
  2419. (at.pointer = at.touch
  2420. ? e.originalEvent[at.released ? 'changedTouches' : 'touches'][0]
  2421. : e),
  2422. (at.pathX = at.pointer.pageX - at.initX),
  2423. (at.pathY = at.pointer.pageY - at.initY),
  2424. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2425. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2426. at.released || !(at.path < 1))
  2427. ) {
  2428. if (!at.init) {
  2429. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY))) return ne()
  2430. at.init = 1
  2431. }
  2432. r(e),
  2433. !at.locked &&
  2434. at.path > at.pathToLock &&
  2435. at.slidee &&
  2436. ((at.locked = 1), at.$source.on(B, s)),
  2437. at.released &&
  2438. (ne(),
  2439. ge.releaseSwing &&
  2440. at.slidee &&
  2441. ((at.swing = ((at.delta - at.history[0]) / 40) * 300),
  2442. (at.delta += at.swing),
  2443. (at.tweese = x(at.swing) > 10))),
  2444. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2445. }
  2446. }
  2447. function ne() {
  2448. clearInterval(rt),
  2449. (at.released = !0),
  2450. b.off(at.touch ? z : I, ae),
  2451. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2452. setTimeout(function () {
  2453. at.$source.off(B, s)
  2454. }),
  2455. Ce.cur === Ce.dest && at.init && pe('moveEnd'),
  2456. ye.resume(1),
  2457. (at.init = 0)
  2458. }
  2459. function ie(t) {
  2460. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2461. }
  2462. function re() {
  2463. ye.stop(), b.off('mouseup', re)
  2464. }
  2465. function se(e) {
  2466. switch ((r(e), this)) {
  2467. case $e[0]:
  2468. case Qe[0]:
  2469. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on('mouseup', re)
  2470. break
  2471. case Ze[0]:
  2472. ye.prev()
  2473. break
  2474. case Ge[0]:
  2475. ye.next()
  2476. break
  2477. case Je[0]:
  2478. ye.prevPage()
  2479. break
  2480. case Ke[0]:
  2481. ye.nextPage()
  2482. }
  2483. }
  2484. function oe(e) {
  2485. return (
  2486. (nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2487. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2488. Re
  2489. ? ((p = +new Date()),
  2490. nt.last < p - nt.resetTime && (nt.delta = 0),
  2491. (nt.last = p),
  2492. (nt.delta += nt.curDelta),
  2493. x(nt.delta) < 1
  2494. ? (nt.finalDelta = 0)
  2495. : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2496. nt.finalDelta)
  2497. : nt.curDelta
  2498. )
  2499. }
  2500. function le(e) {
  2501. e.originalEvent[g] = ye
  2502. var t = +new Date()
  2503. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window) return void (O = t)
  2504. if (ge.scrollBy && Ce.start !== Ce.end) {
  2505. var a = oe(e.originalEvent)
  2506. ;(ge.scrollTrap || (a > 0 && Ce.dest < Ce.end) || (0 > a && Ce.dest > Ce.start)) && r(e, 1),
  2507. ye.slideBy(ge.scrollBy * a)
  2508. }
  2509. }
  2510. function ce(e) {
  2511. ge.clickBar &&
  2512. e.target === Be[0] &&
  2513. (r(e),
  2514. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2515. }
  2516. function de(e) {
  2517. if (ge.keyboardNavBy)
  2518. switch (e.which) {
  2519. case ge.horizontal ? 37 : 38:
  2520. r(e), ye['pages' === ge.keyboardNavBy ? 'prevPage' : 'prev']()
  2521. break
  2522. case ge.horizontal ? 39 : 40:
  2523. r(e), ye['pages' === ge.keyboardNavBy ? 'nextPage' : 'next']()
  2524. }
  2525. }
  2526. function ue(e) {
  2527. return ie(this)
  2528. ? void (e.originalEvent[g + 'ignore'] = !0)
  2529. : void (this.parentNode !== Pe[0] || e.originalEvent[g + 'ignore'] || ye.activate(this))
  2530. }
  2531. function fe() {
  2532. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2533. }
  2534. function ve(e) {
  2535. ge.pauseOnHover && ye['mouseenter' === e.type ? 'pause' : 'resume'](2)
  2536. }
  2537. function pe(e, t) {
  2538. if (Ve[e]) {
  2539. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++) T.push(Ve[e][he])
  2540. for (he = 0; me > he; he++) T[he].call(ye, e, t)
  2541. }
  2542. }
  2543. var he,
  2544. me,
  2545. ge = e.extend({}, n.defaults, h),
  2546. ye = this,
  2547. we = l(t),
  2548. be = e(t),
  2549. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2550. Ie = 0,
  2551. ze = 0,
  2552. Ce = {
  2553. start: 0,
  2554. center: 0,
  2555. end: 0,
  2556. cur: 0,
  2557. dest: 0
  2558. },
  2559. Be = e(ge.scrollBar).eq(0),
  2560. Se = Be.children().eq(0),
  2561. ke = 0,
  2562. Te = 0,
  2563. xe = {
  2564. start: 0,
  2565. end: 0,
  2566. cur: 0
  2567. },
  2568. De = e(ge.pagesBar),
  2569. Ae = 0,
  2570. Ee = [],
  2571. qe = 0,
  2572. Ne = [],
  2573. Oe = {
  2574. firstItem: 0,
  2575. lastItem: 0,
  2576. centerItem: 0,
  2577. activeItem: null,
  2578. activePage: 0
  2579. },
  2580. He = new u(be[0]),
  2581. Xe = new u(Pe[0]),
  2582. Ye = new u(Be[0]),
  2583. je = new u(Se[0]),
  2584. Fe = 'basic' === ge.itemNav,
  2585. Me = 'forceCentered' === ge.itemNav,
  2586. Le = 'centered' === ge.itemNav || Me,
  2587. Re = !we && (Fe || Le || Me),
  2588. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2589. We = ge.dragSource ? e(ge.dragSource) : be,
  2590. $e = e(ge.forward),
  2591. Qe = e(ge.backward),
  2592. Ze = e(ge.prev),
  2593. Ge = e(ge.next),
  2594. Je = e(ge.prevPage),
  2595. Ke = e(ge.nextPage),
  2596. Ve = {},
  2597. _e = {},
  2598. et = {},
  2599. tt = {},
  2600. at = {
  2601. released: 1
  2602. },
  2603. nt = {
  2604. last: 0,
  2605. delta: 0,
  2606. resetTime: 200
  2607. },
  2608. it = 0,
  2609. rt = 0,
  2610. st = 0,
  2611. ot = 0
  2612. we || (t = be[0]),
  2613. (ye.initialized = 0),
  2614. (ye.frame = t),
  2615. (ye.slidee = Pe[0]),
  2616. (ye.pos = Ce),
  2617. (ye.rel = Oe),
  2618. (ye.items = Ne),
  2619. (ye.pages = Ee),
  2620. (ye.isPaused = 0),
  2621. (ye.options = ge),
  2622. (ye.dragging = at),
  2623. (ye.reload = function () {
  2624. H()
  2625. }),
  2626. (ye.getPos = function (e) {
  2627. if (Re) {
  2628. var t = R(e)
  2629. return -1 !== t && Ne[t]
  2630. }
  2631. var a = Pe.find(e).eq(0)
  2632. if (a[0]) {
  2633. var n = ge.horizontal
  2634. ? a.offset().left - Pe.offset().left
  2635. : a.offset().top - Pe.offset().top,
  2636. i = a[ge.horizontal ? 'outerWidth' : 'outerHeight']()
  2637. return {
  2638. start: n,
  2639. center: n - Ie / 2 + i / 2,
  2640. end: n - Ie + i,
  2641. size: i
  2642. }
  2643. }
  2644. return !1
  2645. }),
  2646. (ye.moveBy = function (e) {
  2647. ;(tt.speed = e),
  2648. !at.init &&
  2649. tt.speed &&
  2650. Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) &&
  2651. ((tt.lastTime = +new Date()),
  2652. (tt.startPos = Ce.cur),
  2653. ee('button'),
  2654. (at.init = 1),
  2655. pe('moveStart'),
  2656. y(ot),
  2657. M())
  2658. }),
  2659. (ye.stop = function () {
  2660. 'button' === at.source && ((at.init = 0), (at.released = 1))
  2661. }),
  2662. (ye.prev = function () {
  2663. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2664. }),
  2665. (ye.next = function () {
  2666. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2667. }),
  2668. (ye.prevPage = function () {
  2669. ye.activatePage(Oe.activePage - 1)
  2670. }),
  2671. (ye.nextPage = function () {
  2672. ye.activatePage(Oe.activePage + 1)
  2673. }),
  2674. (ye.slideBy = function (e, t) {
  2675. e &&
  2676. (Re
  2677. ? ye[Le ? 'toCenter' : 'toStart'](
  2678. d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)
  2679. )
  2680. : X(Ce.dest + e, t))
  2681. }),
  2682. (ye.slideTo = function (e, t) {
  2683. X(e, t)
  2684. }),
  2685. (ye.toStart = function (e, t) {
  2686. L('start', e, t)
  2687. }),
  2688. (ye.toEnd = function (e, t) {
  2689. L('end', e, t)
  2690. }),
  2691. (ye.toCenter = function (e, t) {
  2692. L('center', e, t)
  2693. }),
  2694. (ye.getIndex = R),
  2695. (ye.activate = function (e, t) {
  2696. var a = W(e)
  2697. ge.smart &&
  2698. a !== !1 &&
  2699. (Le
  2700. ? ye.toCenter(a, t)
  2701. : a >= Oe.lastItem
  2702. ? ye.toStart(a, t)
  2703. : a <= Oe.firstItem
  2704. ? ye.toEnd(a, t)
  2705. : K())
  2706. }),
  2707. (ye.activatePage = function (e, t) {
  2708. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2709. }),
  2710. (ye.resume = function (e) {
  2711. ge.cycleBy &&
  2712. ge.cycleInterval &&
  2713. ('items' !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2714. !(e < ye.isPaused) &&
  2715. ((ye.isPaused = 0),
  2716. st ? (st = clearTimeout(st)) : pe('resume'),
  2717. (st = setTimeout(function () {
  2718. switch ((pe('cycle'), ge.cycleBy)) {
  2719. case 'items':
  2720. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1)
  2721. break
  2722. case 'pages':
  2723. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2724. }
  2725. }, ge.cycleInterval)))
  2726. }),
  2727. (ye.pause = function (e) {
  2728. e < ye.isPaused || ((ye.isPaused = e || 100), st && ((st = clearTimeout(st)), pe('pause')))
  2729. }),
  2730. (ye.toggle = function () {
  2731. ye[st ? 'pause' : 'resume']()
  2732. }),
  2733. (ye.set = function (t, a) {
  2734. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2735. }),
  2736. (ye.add = function (t, a) {
  2737. var n = e(t)
  2738. Re
  2739. ? (null == a || !Ne[0] || a >= Ne.length
  2740. ? n.appendTo(Pe)
  2741. : Ne.length && n.insertBefore(Ne[a].el),
  2742. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length))
  2743. : Pe.append(n),
  2744. H()
  2745. }),
  2746. (ye.remove = function (t) {
  2747. if (Re) {
  2748. var a = U(t)
  2749. if (a > -1) {
  2750. qe.eq(a).remove()
  2751. var n = a === Oe.activeItem
  2752. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2753. H(),
  2754. n && ((_e.active = null), ye.activate(Oe.activeItem))
  2755. }
  2756. } else e(t).remove(), H()
  2757. }),
  2758. (ye.moveAfter = function (e, t) {
  2759. G(e, t, 1)
  2760. }),
  2761. (ye.moveBefore = function (e, t) {
  2762. G(e, t)
  2763. }),
  2764. (ye.on = function (e, t) {
  2765. if ('object' === i(e)) for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a])
  2766. else if ('function' === i(t))
  2767. for (var n = e.split(' '), r = 0, s = n.length; s > r; r++)
  2768. (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t)
  2769. else if ('array' === i(t)) for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o])
  2770. }),
  2771. (ye.one = function (e, t) {
  2772. function a() {
  2773. t.apply(ye, arguments), ye.off(e, a)
  2774. }
  2775. ye.on(e, a)
  2776. }),
  2777. (ye.off = function (e, t) {
  2778. if (t instanceof Array) for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a])
  2779. else
  2780. for (var i = e.split(' '), r = 0, s = i.length; s > r; r++)
  2781. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0
  2782. else {
  2783. var o = J(i[r], t)
  2784. ;-1 !== o && Ve[i[r]].splice(o, 1)
  2785. }
  2786. }),
  2787. (ye.destroy = function () {
  2788. return (
  2789. Ue.add(Se)
  2790. .add(Be)
  2791. .add(De)
  2792. .add($e)
  2793. .add(Qe)
  2794. .add(Ze)
  2795. .add(Ge)
  2796. .add(Je)
  2797. .add(Ke)
  2798. .off('.' + g),
  2799. b.off('keydown', de),
  2800. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2801. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2802. De.empty(),
  2803. we ||
  2804. (be.off('.' + g),
  2805. He.restore(),
  2806. Xe.restore(),
  2807. Ye.restore(),
  2808. je.restore(),
  2809. e.removeData(t, g)),
  2810. (Ne.length = Ee.length = 0),
  2811. (_e = {}),
  2812. (ye.initialized = 0),
  2813. ye
  2814. )
  2815. }),
  2816. (ye.init = function () {
  2817. if (!ye.initialized) {
  2818. ye.on(m)
  2819. var e = ['overflow', 'position'],
  2820. t = [
  2821. 'position',
  2822. 'webkitTransform',
  2823. 'msTransform',
  2824. 'transform',
  2825. 'left',
  2826. 'top',
  2827. 'width',
  2828. 'height'
  2829. ]
  2830. He.save.apply(He, e), Ye.save.apply(Ye, e), Xe.save.apply(Xe, t), je.save.apply(je, t)
  2831. var a = Se
  2832. return (
  2833. we ||
  2834. ((a = a.add(Pe)),
  2835. be.css('overflow', 'hidden'),
  2836. f || 'static' !== be.css('position') || be.css('position', 'relative')),
  2837. f
  2838. ? v && a.css(f, v)
  2839. : ('static' === Be.css('position') && Be.css('position', 'relative'),
  2840. a.css({
  2841. position: 'absolute'
  2842. })),
  2843. ge.forward && $e.on(S, se),
  2844. ge.backward && Qe.on(S, se),
  2845. ge.prev && Ze.on(B, se),
  2846. ge.next && Ge.on(B, se),
  2847. ge.prevPage && Je.on(B, se),
  2848. ge.nextPage && Ke.on(B, se),
  2849. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  2850. Be[0] && Be.on(B, ce),
  2851. Re && ge.activateOn && be.on(ge.activateOn + '.' + g, '*', ue),
  2852. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + '.' + g, '*', fe),
  2853. We.on(
  2854. P,
  2855. {
  2856. source: 'slidee'
  2857. },
  2858. te
  2859. ),
  2860. Se &&
  2861. Se.on(
  2862. P,
  2863. {
  2864. source: 'handle'
  2865. },
  2866. te
  2867. ),
  2868. b.on('keydown', de),
  2869. we || (be.on('mouseenter.' + g + ' mouseleave.' + g, ve), be.on('scroll.' + g, o)),
  2870. (ye.initialized = 1),
  2871. H(!0),
  2872. ge.cycleBy && !we && ye[ge.startPaused ? 'pause' : 'resume'](),
  2873. ye
  2874. )
  2875. }
  2876. })
  2877. }
  2878. function i(e) {
  2879. return null == e
  2880. ? String(e)
  2881. : 'object' == typeof e || 'function' == typeof e
  2882. ? Object.prototype.toString
  2883. .call(e)
  2884. .match(/\s([a-z]+)/i)[1]
  2885. .toLowerCase() || 'object'
  2886. : typeof e
  2887. }
  2888. function r(e, t) {
  2889. e.preventDefault(), t && e.stopPropagation()
  2890. }
  2891. function s(t) {
  2892. r(t, 1), e(this).off(t.type, s)
  2893. }
  2894. function o() {
  2895. ;(this.scrollLeft = 0), (this.scrollTop = 0)
  2896. }
  2897. function l(e) {
  2898. return !isNaN(parseFloat(e)) && isFinite(e)
  2899. }
  2900. function c(e, t) {
  2901. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ''))
  2902. }
  2903. function d(e, t, a) {
  2904. return t > e ? t : e > a ? a : e
  2905. }
  2906. function u(e) {
  2907. var t = {}
  2908. return (
  2909. (t.style = {}),
  2910. (t.save = function () {
  2911. if (e && e.nodeType) {
  2912. for (var a = 0; a < arguments.length; a++) t.style[arguments[a]] = e.style[arguments[a]]
  2913. return t
  2914. }
  2915. }),
  2916. (t.restore = function () {
  2917. if (e && e.nodeType) {
  2918. for (var a in t.style) t.style.hasOwnProperty(a) && (e.style[a] = t.style[a])
  2919. return t
  2920. }
  2921. }),
  2922. t
  2923. )
  2924. }
  2925. var f,
  2926. v,
  2927. p,
  2928. h = 'sly',
  2929. m = 'Sly',
  2930. g = h,
  2931. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  2932. w = t.requestAnimationFrame,
  2933. b = e(document),
  2934. P = 'touchstart.' + g + ' mousedown.' + g,
  2935. I = 'mousemove.' + g + ' mouseup.' + g,
  2936. z = 'touchmove.' + g + ' touchend.' + g,
  2937. C = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + g,
  2938. B = 'click.' + g,
  2939. S = 'mousedown.' + g,
  2940. k = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
  2941. T = [],
  2942. x = Math.abs,
  2943. D = Math.sqrt,
  2944. A = Math.pow,
  2945. E = Math.round,
  2946. q = Math.max,
  2947. N = Math.min,
  2948. O = 0
  2949. b.on(C, function (e) {
  2950. var t = e.originalEvent[g],
  2951. a = +new Date()
  2952. ;(!t || t.options.scrollHijack < a - O) && (O = a)
  2953. }),
  2954. (function (e) {
  2955. function t(e) {
  2956. var t = new Date().getTime(),
  2957. n = Math.max(0, 16 - (t - a)),
  2958. i = setTimeout(e, n)
  2959. return (a = t), i
  2960. }
  2961. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t
  2962. var a = new Date().getTime(),
  2963. n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout
  2964. y = function (t) {
  2965. n.call(e, t)
  2966. }
  2967. })(window),
  2968. (function () {
  2969. function e(e) {
  2970. for (var n = 0, i = t.length; i > n; n++) {
  2971. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e
  2972. if (null != a.style[r]) return r
  2973. }
  2974. }
  2975. var t = ['', 'webkit', 'moz', 'ms', 'o'],
  2976. a = document.createElement('div')
  2977. ;(f = e('transform')), (v = e('perspective') ? 'translateZ(0) ' : '')
  2978. })(),
  2979. (t[m] = n),
  2980. (e.fn[h] = function (t, a) {
  2981. var r, s
  2982. return (
  2983. e.isPlainObject(t) ||
  2984. (('string' === i(t) || t === !1) &&
  2985. ((r = t === !1 ? 'destroy' : t), (s = Array.prototype.slice.call(arguments, 1))),
  2986. (t = {})),
  2987. this.each(function (i, o) {
  2988. var l = e.data(o, g)
  2989. l || r ? l && r && l[r] && l[r].apply(l, s) : (l = e.data(o, g, new n(o, t, a).init()))
  2990. })
  2991. )
  2992. }),
  2993. (n.defaults = {
  2994. slidee: null,
  2995. horizontal: !1,
  2996. itemNav: null,
  2997. itemSelector: null,
  2998. smart: !1,
  2999. activateOn: null,
  3000. activateMiddle: !1,
  3001. scrollSource: null,
  3002. scrollBy: 0,
  3003. scrollHijack: 300,
  3004. scrollTrap: !1,
  3005. dragSource: null,
  3006. mouseDragging: !1,
  3007. touchDragging: !1,
  3008. releaseSwing: !1,
  3009. swingSpeed: 0.2,
  3010. elasticBounds: !1,
  3011. interactive: null,
  3012. scrollBar: null,
  3013. dragHandle: !1,
  3014. dynamicHandle: !1,
  3015. minHandleSize: 50,
  3016. clickBar: !1,
  3017. syncSpeed: 0.5,
  3018. pagesBar: null,
  3019. activatePageOn: null,
  3020. pageBuilder: function (e) {
  3021. return '<li>' + (e + 1) + '</li>'
  3022. },
  3023. forward: null,
  3024. backward: null,
  3025. prev: null,
  3026. next: null,
  3027. prevPage: null,
  3028. nextPage: null,
  3029. cycleBy: null,
  3030. cycleInterval: 5e3,
  3031. pauseOnHover: !1,
  3032. startPaused: !1,
  3033. moveBy: 300,
  3034. speed: 0,
  3035. easing: 'swing',
  3036. startAt: null,
  3037. keyboardNavBy: null,
  3038. draggedClass: 'dragged',
  3039. activeClass: 'active',
  3040. disabledClass: 'disabled'
  3041. })
  3042. })(jQuery, window)
  3043. !(function e(t, i, n) {
  3044. function r(a, s) {
  3045. if (!i[a]) {
  3046. if (!t[a]) {
  3047. var l = 'function' == typeof require && require
  3048. if (!s && l) return l(a, !0)
  3049. if (o) return o(a, !0)
  3050. var c = new Error("Cannot find module '" + a + "'")
  3051. throw ((c.code = 'MODULE_NOT_FOUND'), c)
  3052. }
  3053. var h = (i[a] = {
  3054. exports: {}
  3055. })
  3056. t[a][0].call(
  3057. h.exports,
  3058. function (e) {
  3059. var i = t[a][1][e]
  3060. return r(i ? i : e)
  3061. },
  3062. h,
  3063. h.exports,
  3064. e,
  3065. t,
  3066. i,
  3067. n
  3068. )
  3069. }
  3070. return i[a].exports
  3071. }
  3072. for (var o = 'function' == typeof require && require, a = 0; a < n.length; a++) r(n[a])
  3073. return r
  3074. })(
  3075. {
  3076. 1: [
  3077. function (e, t, i) {
  3078. ;(function (i) {
  3079. 'use strict'
  3080. function n(e) {
  3081. ;(this.player = null),
  3082. (this.director = null),
  3083. (this.modelManager = null),
  3084. (this.container = null),
  3085. (this.tagManager = null),
  3086. (this.fadeInSpeed = e),
  3087. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0)
  3088. }
  3089. var r = e('three'),
  3090. o = e('./util/logger'),
  3091. a = (e('./util/common'), e('./enum/PlayerEvents')),
  3092. s = e('./enum/DirectorEvents'),
  3093. l = e('./settings'),
  3094. c = e('./enum/Viewmode'),
  3095. h = (e('./enum/WarpStyle'), e('./enum/BlackoutStyle'), e('./enum/ModelManagerEvents')),
  3096. u = e('./enum/tagEvents'),
  3097. d = e('./util/transitions'),
  3098. p = e('./util/lerp'),
  3099. f = new o(i)
  3100. //window.THREE = r;
  3101. ;(n.prototype.init = function (e, t, i, n, r) {
  3102. window.app = this
  3103. ;(this.player = t),
  3104. (this.director = e),
  3105. (this.modelManager = i),
  3106. (this.tagManager = n),
  3107. (this.container = r),
  3108. this.updateModel(),
  3109. this.bindEvents()
  3110. }),
  3111. (n.prototype.bindEvents = function () {
  3112. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  3113. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  3114. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  3115. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  3116. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  3117. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  3118. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  3119. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  3120. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  3121. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  3122. }),
  3123. (n.prototype.updateModel = function () {
  3124. //模型this.model
  3125. this.model = this.modelManager.getActiveModel()
  3126. }),
  3127. (n.prototype.handleWarpStarted = function () {
  3128. this.hidePlayerReticule()
  3129. }),
  3130. (n.prototype.ontagActivated = function () {
  3131. this.hidePlayerReticule()
  3132. }),
  3133. (n.prototype.onNavigationTotag = function () {
  3134. this.hidePlayerReticule()
  3135. }),
  3136. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  3137. var n = this.modelManager.getActiveModel(),
  3138. r =
  3139. this.player.is360View(t, i) || this.director.tourIsPlaying
  3140. ? 0
  3141. : l[t].markerOpacity
  3142. n.fadePanoMarkers(r), n.setMode(t)
  3143. }),
  3144. (n.prototype.handlePlayerModeChanged = function (e, t) {
  3145. var i = this.modelManager.getActiveModel(),
  3146. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide
  3147. i.setSide(n), i.setMode(t)
  3148. }),
  3149. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  3150. i !== c.TRANSITIONING &&
  3151. (e && !this.director.tourIsPlaying && e.hoverOff(i),
  3152. t && !this.director.tourIsPlaying && t.hoverOn(i))
  3153. }),
  3154. (n.prototype.handleActionInterruption = function () {}),
  3155. (n.prototype.handleStartInside = function (e) {
  3156. var t = l[this.player.mode],
  3157. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength
  3158. this.fadeIn(this.fadeInSpeed),
  3159. (this.model.alpha = 0),
  3160. (this.model.skybox.material.uniforms.opacity.value = 1),
  3161. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity)
  3162. var n = this.player.reticule
  3163. d.start(p.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac')
  3164. }),
  3165. (n.prototype.handleStartOutside = function (e) {
  3166. this.fadeIn(e)
  3167. }),
  3168. (n.prototype.fadeIn = function (e) {
  3169. ;(null !== e && void 0 !== e) ||
  3170. ((e = 2e3),
  3171. f.warn(
  3172. 'DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.'
  3173. )),
  3174. $(this.container).fadeIn(e)
  3175. }),
  3176. (n.prototype.hidePlayerReticule = function () {
  3177. this.player.reticule.hide()
  3178. }),
  3179. (t.exports = n)
  3180. }).call(this, '/js/DisplayController.js')
  3181. },
  3182. {
  3183. './enum/BlackoutStyle': 18,
  3184. './enum/DirectorEvents': 23,
  3185. './enum/tagEvents': 32,
  3186. './enum/ModelManagerEvents': 33,
  3187. './enum/PlayerEvents': 40,
  3188. './enum/Viewmode': 51,
  3189. './enum/WarpStyle': 52,
  3190. './settings': 166,
  3191. './util/common': 185,
  3192. './util/lerp': 188,
  3193. './util/logger': 189,
  3194. './util/transitions': 195,
  3195. three: 217
  3196. }
  3197. ],
  3198. 2: [
  3199. function (e, t, i) {
  3200. 'use strict'
  3201. function n() {
  3202. ;(this.baseStartTime = performance.timing.navigationStart),
  3203. (this.loadingStartTime = null),
  3204. (this.waitingStartTime = null),
  3205. (this.appReadyTime = null)
  3206. }
  3207. ;(n.prototype.setBaseStartTime = function (e) {
  3208. this.baseStartTime = e || Date.now()
  3209. }),
  3210. (n.prototype.setWaitingStartTime = function (e) {
  3211. this.waitingStartTime = e || Date.now()
  3212. }),
  3213. (n.prototype.setLoadingStartTime = function (e) {
  3214. this.loadingStartTime = e || Date.now()
  3215. }),
  3216. (n.prototype.setAppReadyTime = function (e) {
  3217. this.appReadyTime = e || Date.now()
  3218. }),
  3219. (n.prototype.calcFullLoadingTime = function () {
  3220. var e = this.appReadyTime - this.baseStartTime
  3221. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e
  3222. }),
  3223. (t.exports = n)
  3224. },
  3225. {}
  3226. ],
  3227. 3: [
  3228. function (e, t, i) {
  3229. ;(function (i) {
  3230. 'use strict'
  3231. function n() {
  3232. return 100 * Math.random()
  3233. }
  3234. var r = e('./util/logger'),
  3235. o = e('./util/browser'),
  3236. a = new r(i),
  3237. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3238. initialized: !1,
  3239. init: function (e, t) {
  3240. if (((t = t || {}), !this.initialized)) {
  3241. ;(this.initialized = !0),
  3242. o.valueFromHash('tilegen') && (t.tilegen = 1 === o.valueFromHash('tilegen', 0)),
  3243. o.valueFromHash('imgopt') && (t.imgopt = 1 === o.valueFromHash('imgopt', 0))
  3244. for (var i in e) {
  3245. var r = i.match('^sc_tilegen_([0-9]+)$')
  3246. r && (s.tilegen = n() < parseInt(r[1]))
  3247. var l = i.match('^sc_imgopt_([0-9]+)$')
  3248. l && (s.imgopt = n() < parseInt(l[1]))
  3249. }
  3250. for (var c in t) (s[c] = t[c]), a.debug('A/B override:', c, s[c])
  3251. }
  3252. },
  3253. changeIfTileGenerating: function (e) {
  3254. return s.tilegen && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
  3255. },
  3256. changeIfImageOptimzing: function (e) {
  3257. return (
  3258. s.imgopt &&
  3259. e.indexOf('imgopt=1') === -1 &&
  3260. ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')),
  3261. e
  3262. )
  3263. },
  3264. tilegen: !1,
  3265. imgopt: !1
  3266. })
  3267. t.exports = s
  3268. }).call(this, '/js/ab.js')
  3269. },
  3270. {
  3271. './util/browser': 182,
  3272. './util/logger': 189
  3273. }
  3274. ],
  3275. 4: [
  3276. function (e, t, i) {
  3277. ;(function (i) {
  3278. 'use strict'
  3279. function n() {
  3280. return {
  3281. addons: [
  3282. {
  3283. name: 'keen:ua_parser',
  3284. input: {
  3285. ua_string: 'user_agent'
  3286. },
  3287. output: 'parsed_user_agent'
  3288. }
  3289. ]
  3290. }
  3291. }
  3292. function r(e, t, i, n) {
  3293. function r(t) {
  3294. l[t.sid] = !0
  3295. var i = t.billboard.media && t.billboard.media.type,
  3296. n = {
  3297. tag_id: t.sid,
  3298. tags_visited: Object.keys(l).length,
  3299. tag_count: Object.keys(e.tags).length,
  3300. tag_view_count: ++E,
  3301. has_media: !!i
  3302. }
  3303. i && (n.media_type = i), u('tag_opened', n)
  3304. }
  3305. var l = {},
  3306. h = Date.now() - N,
  3307. f = null
  3308. n && (f = Date.now() - window.navigationStart)
  3309. var g
  3310. try {
  3311. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  3312. } catch (e) {
  3313. g = !1
  3314. }
  3315. var v,
  3316. A = e.supportsVR
  3317. A ||
  3318. ((v = 'VR disabled at the model/account level'),
  3319. m.valueFromHash('vr') === _.NONE
  3320. ? (v = 'VR disabled, using &vr=0')
  3321. : m.detectAndroid()
  3322. ? b.isDeviceSupported(w.Android) || (v = 'VR disabled, unsupported Android version')
  3323. : m.detectIOS() &&
  3324. (b.isDeviceSupported(w.IOS) || (v = 'VR disabled, unsupported iOS version'))),
  3325. u('model_loaded', {
  3326. duration: h,
  3327. duration_from_navigation_start: f,
  3328. has_hlr: g,
  3329. has_vr: A,
  3330. vr_reason: v
  3331. })
  3332. var I = 0
  3333. e.panos.forEach(function (e) {
  3334. e.on('enter', function () {
  3335. c('pano_viewed', {
  3336. pano_id: e.id,
  3337. pano_view_count: ++I,
  3338. alignment_type: e.alignmentType,
  3339. interaction_source: O,
  3340. navigation_source: p
  3341. })
  3342. })
  3343. })
  3344. var E = 0
  3345. for (var T in e.tags) e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]))
  3346. t.on('tour_auto', function (e) {
  3347. p = 'tour_' + e
  3348. }),
  3349. t.on('tour_manual', function (e) {
  3350. ;(O = 'gui-' + e), (p = 'tour_manual')
  3351. }),
  3352. i.on(C.InteractionKey, function () {
  3353. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  3354. }),
  3355. i.on(C.InteractionDirect, function () {
  3356. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  3357. }),
  3358. o(t),
  3359. a(),
  3360. s()
  3361. }
  3362. function o(e) {
  3363. I.on(T.OPENED, function () {
  3364. c('showcase_share_intent', {
  3365. pano_id: e.currentPano && e.currentPano.id
  3366. })
  3367. }),
  3368. I.on(T.LINK_CLICKED, function (t) {
  3369. c('showcase_share_action', {
  3370. channel: t.channel,
  3371. pano_id: e.currentPano && e.currentPano.id
  3372. })
  3373. }),
  3374. E.on(x.ORIGIN_LINK_CLICKED, function () {
  3375. c('showcase_share_origin_link_clicked')
  3376. })
  3377. }
  3378. function a() {}
  3379. function s() {
  3380. b.on(
  3381. S.OPENED,
  3382. c.bind(this, 'showcase_gui', {
  3383. gui_action: 'click_vr_button'
  3384. })
  3385. ),
  3386. b.on(S.LAUNCH, function (e) {
  3387. c('showcase_gui', {
  3388. gui_action: 'launch_vr',
  3389. vr_platform: e.vr_platform,
  3390. vr_app: e.vr_app
  3391. })
  3392. }),
  3393. b.on(
  3394. S.PREV,
  3395. c.bind(this, 'showcase_gui', {
  3396. gui_action: 'vr_modal_prev'
  3397. })
  3398. ),
  3399. b.on(S.NEXT, function (e) {
  3400. c('showcase_gui', {
  3401. gui_action: e.nextAction
  3402. })
  3403. }),
  3404. b.on(
  3405. S.CLOSED,
  3406. c.bind(this, 'showcase_gui', {
  3407. gui_action: 'vr_modal_close'
  3408. })
  3409. ),
  3410. b.on(S.falseICECHOSEN, function (e) {
  3411. c('showcase_gui', {
  3412. gui_action: e.name + ' '
  3413. })
  3414. }),
  3415. b.on(S.STORE, function (e) {
  3416. c('showcase_gui', {
  3417. gui_action: 'launch_store',
  3418. store: e
  3419. })
  3420. })
  3421. }
  3422. function l(e, t) {
  3423. if (f)
  3424. try {
  3425. f.addEvent(
  3426. e,
  3427. v.extendObject(
  3428. {
  3429. host: window.location.host,
  3430. keen: n(),
  3431. user_agent: '${keen.user_agent}',
  3432. referrer: {
  3433. url: v.normalizeUrl(document.referrer),
  3434. domain: v.domainFromUrl(document.referrer),
  3435. url_original: document.referrer
  3436. },
  3437. embedded: m.inIframe(),
  3438. is_mobile: m.isMobile(),
  3439. version: '2.25.6-0-gd87e5b1'
  3440. },
  3441. t
  3442. )
  3443. )
  3444. } catch (e) {
  3445. P.warn(
  3446. 'analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' +
  3447. e
  3448. )
  3449. }
  3450. }
  3451. function c(e, t) {
  3452. if (((t = t || {}), L))
  3453. try {
  3454. window.analytics.track(e, v.extendObject(t, B), {
  3455. context: {
  3456. app: {
  3457. name: 'showcase',
  3458. version: '2.25.6-0-gd87e5b1'
  3459. },
  3460. screen: {
  3461. width: window.screen.width,
  3462. height: window.screen.height,
  3463. density: window.devicePixelRatio
  3464. }
  3465. }
  3466. })
  3467. } catch (t) {
  3468. console.warn('Failed to send data to segment for ' + e)
  3469. }
  3470. }
  3471. function h(e, t) {
  3472. if (((t = t || {}), navigator.sendBeacon && L))
  3473. try {
  3474. navigator.sendBeacon(
  3475. 'https://api.segment.io/v1/t',
  3476. JSON.stringify({
  3477. event: e,
  3478. anonymousId: window.analytics.user().anonymousId(),
  3479. properties: v.extendObject(t, B),
  3480. writeKey: L,
  3481. sentAt: Date.now(),
  3482. type: 'track',
  3483. context: {
  3484. userAgent: m.userAgent(),
  3485. library: {
  3486. name: 'showcase-beacon',
  3487. version: '2.25.6-0-gd87e5b1'
  3488. },
  3489. app: {
  3490. name: 'showcase',
  3491. version: '2.25.6-0-gd87e5b1'
  3492. }
  3493. }
  3494. })
  3495. )
  3496. } catch (e) {
  3497. console.warn('Failed to send async segment request')
  3498. }
  3499. }
  3500. function u(e, t) {
  3501. ;(t = t || {}), c(e, t)
  3502. }
  3503. function d(e, t) {
  3504. ;(O = e === C.InteractionGui ? 'gui-' + t : e), (p = 'self_guided')
  3505. }
  3506. var p,
  3507. f,
  3508. g = (e('three'), e('./util/ajax'), e('./ab')),
  3509. m = e('./util/browser'),
  3510. v = e('./util/common'),
  3511. A = e('./settings'),
  3512. y = (e('./localization/localize'), e('./enum/Viewmode')),
  3513. C = e('./enum/ControlEvents'),
  3514. I = e('./gui/sharing/modal'),
  3515. E = e('./gui/title/titleBar'),
  3516. b = e('./gui/vr/vrModal'),
  3517. w = e('./enum/VRPlatforms'),
  3518. _ = e('./enum/VROption'),
  3519. T = e('./gui/sharing/ShareEvents'),
  3520. x = e('./gui/title/TitleEvents'),
  3521. S = e('./gui/vr/vrEvent'),
  3522. M = e('./tag/Billboard/BillboardEvent'),
  3523. R = e('./util/logger'),
  3524. P = new R(i),
  3525. O = (e('./enum/PlayerEvents'), 'direct'),
  3526. L = null,
  3527. D = !1,
  3528. N = null,
  3529. B = null,
  3530. F = v.uuid4()
  3531. t.exports = {
  3532. report: function (e, t, i, n) {
  3533. l('Session starts', {
  3534. model: e,
  3535. status: t,
  3536. loadtime: Date.now() - (N || Date.now()),
  3537. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3538. autoplay: i,
  3539. quickstart: n,
  3540. ab_tilegen: g.tilegen,
  3541. ab_imgopt: g.imgopt
  3542. })
  3543. },
  3544. impression: function (e) {
  3545. e = e || {}
  3546. var t = void 0 === e.isVisible || e.isVisible,
  3547. i =
  3548. (void 0 !== e.immediate && e.immediate,
  3549. window.location.search.substr(1).split('&'))
  3550. u('impression', {
  3551. visible: t,
  3552. url_params: i
  3553. })
  3554. },
  3555. initKeen: function (e) {
  3556. return e.token && e.appId
  3557. ? void (f = new Keen({
  3558. projectId: e.appId,
  3559. writeKey: e.token,
  3560. readKey: '',
  3561. requestType: 'xhr'
  3562. }))
  3563. : void P.warn('no keen token/appId')
  3564. },
  3565. initSegment: function (e) {
  3566. return e.token
  3567. ? ((L = e.token),
  3568. window.analytics.load(e.token),
  3569. (B = {
  3570. model_id: e.model,
  3571. start_source: e.startSource,
  3572. autoplay: e.autoplay,
  3573. quickstart: e.quickstart,
  3574. language_tag: A.languageTag,
  3575. is_mobile: m.isMobile(),
  3576. iframe: m.inIframe(),
  3577. aspect_ratio: m.aspectRatio(),
  3578. session_id: F,
  3579. window: {
  3580. width: $('#player').width(),
  3581. height: $('#player').height()
  3582. },
  3583. platform: {
  3584. browser: {
  3585. name: $.ua.browser.name,
  3586. major: $.ua.browser.major,
  3587. version: $.ua.browser.version
  3588. },
  3589. os: {
  3590. name: $.ua.os.name,
  3591. version: $.ua.os.version
  3592. },
  3593. device: {
  3594. vendor: $.ua.device.vendor,
  3595. model: $.ua.device.model,
  3596. type: $.ua.device.type
  3597. }
  3598. }
  3599. }),
  3600. (D = Math.random() < A.analytics.sessionTrackingRate),
  3601. P.debug('tracking sample rate = ' + A.analytics.sessionTrackingRate),
  3602. void P.debug('tracking this session = ' + D))
  3603. : void P.warn('no segment token')
  3604. },
  3605. sessionStart: function (e) {
  3606. P.debug('analytics user_session_start'),
  3607. c('session_started'),
  3608. (N = Date.now()),
  3609. window.addEventListener('unload', function () {
  3610. h('session_ended', {
  3611. duration: Date.now() - N
  3612. })
  3613. })
  3614. },
  3615. modelLoaded: function (e, t, i, n) {
  3616. r(e, t, i, n)
  3617. },
  3618. loadComplete: function (e) {
  3619. var t = {
  3620. time_to_app_start: e
  3621. }
  3622. c('load_times', t)
  3623. },
  3624. track: function (e, t) {
  3625. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t))
  3626. },
  3627. trackAlways: function (e, t) {
  3628. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t)
  3629. },
  3630. getSessionId: function () {
  3631. return F
  3632. },
  3633. updateInteraction: d
  3634. }
  3635. }).call(this, '/js/analytics.js')
  3636. },
  3637. {
  3638. './ab': 3,
  3639. './enum/ControlEvents': 21,
  3640. './enum/PlayerEvents': 40,
  3641. './enum/VROption': 47,
  3642. './enum/VRPlatforms': 49,
  3643. './enum/Viewmode': 51,
  3644. './gui/sharing/ShareEvents': 76,
  3645. './gui/sharing/modal': 77,
  3646. './gui/title/TitleEvents': 80,
  3647. './gui/title/titleBar': 82,
  3648. './gui/vr/vrEvent': 85,
  3649. './gui/vr/vrModal': 87,
  3650. './localization/localize': 108,
  3651. './tag/Billboard/BillboardEvent': 120,
  3652. './settings': 166,
  3653. './util/ajax': 181,
  3654. './util/browser': 182,
  3655. './util/common': 185,
  3656. './util/logger': 189,
  3657. three: 217
  3658. }
  3659. ],
  3660. 5: [
  3661. function (e, t, i) {
  3662. 'use strict'
  3663. function n() {
  3664. r.PerspectiveCamera.call(
  3665. this,
  3666. a.clampVFOV(o.dollhouseFOV),
  3667. $('#player').width() / $('#player').height(),
  3668. o.dollhouseNear,
  3669. o.dollhouseFar
  3670. ),
  3671. (this.controls = null)
  3672. }
  3673. var r = e('three'),
  3674. o = e('../constants'),
  3675. a = e('../util/cameraLight')
  3676. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3677. (n.prototype.updateAspect = function (e) {
  3678. ;(this.aspect = e), this.updateProjectionMatrix()
  3679. }),
  3680. (t.exports = n)
  3681. },
  3682. {
  3683. '../constants': 8,
  3684. '../util/cameraLight': 184,
  3685. three: 217
  3686. }
  3687. ],
  3688. 6: [
  3689. function (e, t, i) {
  3690. 'use strict'
  3691. function n() {
  3692. var e = $('#player').width() / $('#player').height()
  3693. r.OrthographicCamera.call(
  3694. this,
  3695. -o.orthoBase,
  3696. o.orthoBase,
  3697. o.orthoBase / e,
  3698. -o.orthoBase / e,
  3699. o.orthoNear,
  3700. o.orthoFar
  3701. ),
  3702. (this.controls = null),
  3703. this.updateAspect(e)
  3704. }
  3705. var r = e('three'),
  3706. o = e('../constants')
  3707. ;(n.prototype = Object.create(r.OrthographicCamera.prototype)),
  3708. (n.prototype.updateAspect = function (e) {
  3709. ;(this.aspect = e),
  3710. (this.top = o.orthoBase / e),
  3711. (this.bottom = -o.orthoBase / e),
  3712. this.updateProjectionMatrix()
  3713. }),
  3714. (t.exports = n)
  3715. },
  3716. {
  3717. '../constants': 8,
  3718. three: 217
  3719. }
  3720. ],
  3721. 7: [
  3722. function (e, t, i) {
  3723. 'use strict'
  3724. function n() {
  3725. r.PerspectiveCamera.call(
  3726. this,
  3727. a.clampVFOV(o.insideFOV),
  3728. $('#player').width() / $('#player').height(),
  3729. o.insideNear,
  3730. o.insideFar
  3731. ),
  3732. (this.controls = null)
  3733. }
  3734. var r = e('three'),
  3735. o = e('../settings'),
  3736. a = e('../util/cameraLight')
  3737. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3738. (n.prototype.updateAspect = function (e) {
  3739. ;(this.aspect = e), this.updateProjectionMatrix()
  3740. }),
  3741. (t.exports = n)
  3742. },
  3743. {
  3744. '../settings': 166,
  3745. '../util/cameraLight': 184,
  3746. three: 217
  3747. }
  3748. ],
  3749. 8: [
  3750. function (e, t, i) {
  3751. 'use strict'
  3752. t.exports = {
  3753. signedUrlDefaultExpireTime: 24e4,
  3754. signedUrlCheckInterval: 1e4,
  3755. signedUrlRefreshBuffer: 15e3,
  3756. dollhouseFOV: 70,
  3757. dollhouseNear: 1,
  3758. dollhouseFar: 5e3,
  3759. insideFOV: 70,
  3760. insideFOVMax: 120,
  3761. insideNear: 0.1,
  3762. insideFar: 5e3,
  3763. insideLookSpeed: 0.12,
  3764. insideLookLimitUp: 40, //视角
  3765. insideLookLimitDown: -40,
  3766. orthoNear: 1,
  3767. orthoFar: 5e3,
  3768. orthoBase: 10,
  3769. narrowLandscapeHeight: 290,
  3770. reallyNarrowLandscapeHeight: 250,
  3771. visionTilingStartDate: new Date('8/26/2016'),
  3772. visionTilingStartVersion: '1.1.407.13667',
  3773. windowHeightHighQualityThreshold: 900,
  3774. tourStepDelayDefault: 3500,
  3775. tourStepDelaySlideShow: 5e3,
  3776. workshopApsect: 9 / 16,
  3777. highQualityMaxZoom: 2,
  3778. ultraHighQualityMaxZoom: 3
  3779. }
  3780. },
  3781. {}
  3782. ],
  3783. 9: [
  3784. function (e, t, i) {
  3785. 'use strict'
  3786. function n() {
  3787. ;(this.activeControl = null), (this.controls = {}), (this.cameras = {})
  3788. }
  3789. var r = e('./PanoramaControls'),
  3790. o = e('./DollhouseControls'),
  3791. a = e('./FloorplanControls'),
  3792. s = e('../cameras/PanoramaCamera'),
  3793. l = e('../cameras/DollhouseCamera'),
  3794. c = e('../cameras/FloorplanCamera'),
  3795. h = e('events').EventEmitter,
  3796. u = e('../enum/ControlEvents'),
  3797. d = e('../enum/ModelManagerEvents'),
  3798. p = e('../enum/Viewmode'),
  3799. f = e('../settings')
  3800. ;(n.prototype = Object.create(h.prototype)),
  3801. (n.prototype.init = function (e, t) {
  3802. this.setUpControls(), this.bindEvents(e, t)
  3803. }),
  3804. (n.prototype.activateControls = function (e) {
  3805. this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)),
  3806. this.controls[e] && (this.controls[e].enabled = !0),
  3807. (this.activeControl = this.controls[e])
  3808. }),
  3809. (n.prototype.setUpControls = function () {
  3810. var e = {},
  3811. t = {},
  3812. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  3813. n = [s, l, c],
  3814. h = [r, o, a]
  3815. i.forEach(
  3816. function (i, r) {
  3817. ;(e[i] = new n[r]()),
  3818. (t[i] = new h[r](e[i])),
  3819. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3820. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3821. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3822. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3823. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3824. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3825. }.bind(this)
  3826. ),
  3827. (this.controls = t),
  3828. (this.cameras = e)
  3829. }),
  3830. (n.prototype.bindEvents = function (e, t) {
  3831. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  3832. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  3833. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  3834. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  3835. f.useWheel &&
  3836. (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), { passive: false }),
  3837. e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
  3838. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  3839. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  3840. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  3841. e.addEventListener('contextmenu', function (e) {
  3842. e.preventDefault()
  3843. }),
  3844. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  3845. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  3846. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  3847. e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
  3848. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  3849. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  3850. document.addEventListener('keyup', this.onKeyUp.bind(this)),
  3851. t.on(
  3852. d.ActiveModelChanged,
  3853. function (e) {
  3854. this.setModelForControls(e.model)
  3855. }.bind(this)
  3856. )
  3857. }),
  3858. (n.prototype.setModelForControls = function (e) {
  3859. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox)
  3860. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding)
  3861. ;[p.DOLLHOUSE, p.FLOORPLAN].forEach(
  3862. function (e) {
  3863. this.controls[e].setBounds(t)
  3864. }.bind(this)
  3865. )
  3866. }),
  3867. (n.prototype.onMouseDown = function (e) {
  3868. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e)
  3869. }),
  3870. (n.prototype.onMouseMove = function (e) {
  3871. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e)
  3872. }),
  3873. (n.prototype.onMouseUp = function (e) {
  3874. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e)
  3875. }),
  3876. (n.prototype.onMouseOver = function (e) {
  3877. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e)
  3878. }),
  3879. (n.prototype.onMouseWheel = function (e) {
  3880. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e)
  3881. }),
  3882. (n.prototype.onTouchStart = function (e) {
  3883. e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e)
  3884. var hotList = $('#hotListWrap')[0]
  3885. hotList.classList.remove('hotListActive')
  3886. $('#hotListContent ul .active').removeClass('active')
  3887. $('#hotList')[0].classList.remove('active')
  3888. }),
  3889. (n.prototype.onTouchMove = function (e) {
  3890. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e)
  3891. }),
  3892. (n.prototype.onTouchEnd = function (e) {
  3893. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e)
  3894. }),
  3895. (n.prototype.onPointerDown = function (e) {
  3896. if ((e.preventDefault(), this.activeControl))
  3897. switch (e.pointerType) {
  3898. case 'mouse':
  3899. this.activeControl.onMouseDown(e)
  3900. break
  3901. default:
  3902. this.activeControl.onPointerDown(e)
  3903. }
  3904. }),
  3905. (n.prototype.onPointerMove = function (e) {
  3906. if ((e.preventDefault(), this.activeControl))
  3907. switch (e.pointerType) {
  3908. case 'mouse':
  3909. this.activeControl.onMouseMove(e)
  3910. break
  3911. default:
  3912. this.activeControl.onPointerMove(e)
  3913. }
  3914. }),
  3915. (n.prototype.onPointerUp = function (e) {
  3916. if ((e.preventDefault(), this.activeControl))
  3917. switch (e.pointerType) {
  3918. case 'mouse':
  3919. this.activeControl.onMouseUp(e)
  3920. break
  3921. default:
  3922. this.activeControl.onPointerUp(e)
  3923. }
  3924. }),
  3925. (n.prototype.onPointerCancel = function (e) {
  3926. e.preventDefault(),
  3927. this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e)
  3928. }),
  3929. (n.prototype.onKeyDown = function (e) {
  3930. e.metaKey ||
  3931. e.ctrlKey ||
  3932. (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e))
  3933. }),
  3934. (n.prototype.onKeyUp = function (e) {
  3935. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e)
  3936. }),
  3937. (t.exports = n)
  3938. },
  3939. {
  3940. '../cameras/DollhouseCamera': 5,
  3941. '../cameras/FloorplanCamera': 6,
  3942. '../cameras/PanoramaCamera': 7,
  3943. '../enum/ControlEvents': 21,
  3944. '../enum/ModelManagerEvents': 33,
  3945. '../enum/Viewmode': 51,
  3946. '../settings': 166,
  3947. './DollhouseControls': 10,
  3948. './FloorplanControls': 11,
  3949. './PanoramaControls': 13,
  3950. events: 202
  3951. }
  3952. ],
  3953. 10: [
  3954. function (e, t, i) {
  3955. 'use strict'
  3956. function n(e) {
  3957. a.call(this, e),
  3958. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  3959. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  3960. (this.minDistance = o.dollhouseDefault.minDistance),
  3961. (this.maxDistance = o.dollhouseDefault.maxDistance),
  3962. (this.adjustedMinDistance = this.minDistance),
  3963. (this.adjustedMaxDistance = this.maxDistance)
  3964. }
  3965. var r = e('three'),
  3966. o = e('../settings'),
  3967. a = e('./OutsideControls')
  3968. ;(n.prototype = Object.create(a.prototype)),
  3969. (n.prototype.pan = function (e, t) {
  3970. this.camera.updateMatrix()
  3971. var i = this.camera.position.clone().sub(this.target).length()
  3972. ;(i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)),
  3973. this.panLeft((2 * e * i) / $('#player').height()),
  3974. this.panUp((-2 * t * i) / $('#player').height())
  3975. }),
  3976. (n.prototype.updateZoom = function () {
  3977. var e = this.offset.length()
  3978. return e * this.scale
  3979. }),
  3980. (n.prototype.setZoomBounds = function (e) {
  3981. var t = e.min.distanceTo(e.max)
  3982. ;(this.adjustedMinDistance = Math.max(
  3983. Math.min(t / 2, o.dollhouseDefault.minDistance),
  3984. 0
  3985. )),
  3986. (this.adjustedMaxDistance = Math.min(
  3987. Math.max(t, o.dollhouseDefault.maxDistance),
  3988. o.skyboxRadius
  3989. )),
  3990. (this.minDistance = this.adjustedMinDistance),
  3991. (this.maxDistance = this.adjustedMaxDistance)
  3992. }),
  3993. (n.prototype.resetRanges = function (e, t) {
  3994. e
  3995. ? ((this.minDistance = Math.min(e, this.minDistance)),
  3996. (this.maxDistance = Math.max(e, this.maxDistance)))
  3997. : ((this.minDistance = this.adjustedMinDistance),
  3998. (this.maxDistance = this.adjustedMaxDistance)),
  3999. t
  4000. ? ((this.minPolarAngle = r.Math.degToRad(-15)),
  4001. (this.maxPolarAngle = r.Math.degToRad(89.9)))
  4002. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4003. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle))
  4004. }),
  4005. (n.prototype.toJSON = function () {
  4006. return a.prototype.toJSON.call(this)
  4007. }),
  4008. (t.exports = n)
  4009. },
  4010. {
  4011. '../settings': 166,
  4012. './OutsideControls': 12,
  4013. three: 217
  4014. }
  4015. ],
  4016. 11: [
  4017. function (e, t, i) {
  4018. 'use strict'
  4019. function n(e) {
  4020. a.call(this, e),
  4021. (this.minDistance = 15),
  4022. (this.maxDistance = 50),
  4023. (this.noRotateUpDown = !0),
  4024. (this.minPolarAngle = 0),
  4025. (this.maxPolarAngle = 0),
  4026. (this.mouseActions[l.LEFT] = s.PAN),
  4027. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  4028. (this.mouseActions[l.RIGHT] = s.ROTATE),
  4029. (this.touchActions[1] = s.PAN),
  4030. (this.touchActions[2] = s.ROTATE_DOLLY),
  4031. (this.absoluteScale = 1),
  4032. (this.currentScale = 1)
  4033. }
  4034. var r = e('three'),
  4035. o = e('../settings'),
  4036. a = e('./OutsideControls'),
  4037. s = e('../enum/ControlActions'),
  4038. l = e('../enum/MouseButton'),
  4039. c = e('../util/math'),
  4040. h = e('../util/browser')
  4041. ;(n.prototype = Object.create(a.prototype)),
  4042. (n.prototype.zoomToContain = function (e) {
  4043. this.absoluteScale = this.getDefaultAbsoluteScale(e)
  4044. this.currentScale = this.absoluteScale
  4045. }),
  4046. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  4047. let defaultRatio = 1.2,
  4048. absoluteScale
  4049. if (_settings.floorPlanAngle) {
  4050. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  4051. var angle = parseFloat(_settings.floorPlanAngle)
  4052. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  4053. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  4054. var screenSize = Math.min($('#player').width(), $('#player').height())
  4055. var maxSize = 800 //模型最大占据像素
  4056. ratio =
  4057. ratio != void 0
  4058. ? ratio
  4059. : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio)
  4060. absoluteScale = (n / 2 / o.orthoBase) * ratio //根据模型所占最大视口尺寸调整缩放
  4061. } else {
  4062. var t = Math.max(modelSize.x, modelSize.z),
  4063. i = Math.min(modelSize.x, modelSize.z),
  4064. n = Math.max(t, i * this.camera.aspect),
  4065. r = Math.max(i, t * this.camera.aspect)
  4066. absoluteScale = ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) * defaultRatio
  4067. }
  4068. return absoluteScale
  4069. }),
  4070. /* n.prototype.rotateToView = function(e, t) {
  4071. var i = 0
  4072. , n = h.aspectRatio() < 1
  4073. , r = e.x < e.z;
  4074. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  4075. this.rotateLeft(i),
  4076. this.update(0)
  4077. },
  4078. */
  4079. (n.prototype.rotateToView = function (modelSize, direction) {
  4080. let i = 0,
  4081. n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  4082. if (_settings.floorPlanAngle) {
  4083. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  4084. i = parseFloat(_settings.floorPlanAngle)
  4085. } else {
  4086. let r = modelSize.x < modelSize.z //是否视口为“窄屏”
  4087. if (n === r) {
  4088. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  4089. if (direction.z > 0) {
  4090. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  4091. i = Math.PI //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  4092. }
  4093. //(第二种情况) 不做处理
  4094. } else if (direction.x > 0) {
  4095. i = Math.PI / 2
  4096. } else {
  4097. i = -Math.PI / 2
  4098. }
  4099. }
  4100. this.rotateLeft(i)
  4101. this.update(0)
  4102. }),
  4103. (n.prototype.rotateToAngle = function (angle) {
  4104. //add 旋转到特定角度
  4105. this.rotateLeft(angle + this.lon)
  4106. this.update(0)
  4107. }),
  4108. (n.prototype.pan = function (e, t) {
  4109. this.camera.updateMatrix(),
  4110. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  4111. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height())
  4112. }),
  4113. (n.prototype.updateZoom = function () {
  4114. return (
  4115. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  4116. (this.absoluteScale = Math.max(
  4117. o.zoomNearLimit,
  4118. Math.min(this.absoluteScale, o.zoomFarLimit)
  4119. )),
  4120. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  4121. (this.camera.left = -o.orthoBase * this.currentScale),
  4122. (this.camera.right = o.orthoBase * this.currentScale),
  4123. (this.camera.top = (o.orthoBase * this.currentScale) / this.camera.aspect),
  4124. (this.camera.bottom = (-o.orthoBase * this.currentScale) / this.camera.aspect),
  4125. this.camera.updateProjectionMatrix(),
  4126. this.offset.length()
  4127. )
  4128. }),
  4129. (n.prototype.toJSON = (function () {
  4130. var e = new r.Quaternion(),
  4131. t = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90)),
  4132. i = new r.Quaternion()
  4133. return function () {
  4134. var n = a.prototype.toJSON.call(this)
  4135. return (
  4136. e.copy(n.camera_quaternion),
  4137. i.copy(t),
  4138. i.multiply(e),
  4139. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  4140. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  4141. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  4142. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  4143. (n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4)),
  4144. n
  4145. )
  4146. }
  4147. })()),
  4148. (t.exports = n)
  4149. },
  4150. {
  4151. '../enum/ControlActions': 20,
  4152. '../enum/MouseButton': 34,
  4153. '../settings': 166,
  4154. '../util/browser': 182,
  4155. '../util/math': 190,
  4156. './OutsideControls': 12,
  4157. three: 217
  4158. }
  4159. ],
  4160. 12: [
  4161. function (e, t, i) {
  4162. 'use strict'
  4163. function n(e) {
  4164. ;(this.camera = e),
  4165. (this.camera.controls = this),
  4166. (this.enabled = !1),
  4167. (this.target = new r.Vector3()),
  4168. (this.targetBounds = new r.Box3()),
  4169. (this.zoomSpeed = 1),
  4170. (this.minDistance = 0),
  4171. (this.maxDistance = 1 / 0),
  4172. (this.noRotateUpDown = !1),
  4173. (this.rotateSpeed = 1),
  4174. (this.keyboardZoomSpeed = 0),
  4175. (this.keyPanSpeed = 7),
  4176. (this.autoRotate = !1),
  4177. (this.autoRotateSpeed = 2),
  4178. (this.autoPan = !1),
  4179. (this.autoPanPosition = new r.Vector3()),
  4180. (this.minPolarAngle = r.Math.degToRad(25)),
  4181. (this.maxPolarAngle = r.Math.degToRad(65)),
  4182. (this.rotationAcceleration = new r.Vector2()),
  4183. (this.rotationSpeed = new r.Vector2()),
  4184. (this.panAcceleration = new r.Vector2()),
  4185. (this.panSpeed = new r.Vector2()),
  4186. (this.rotateStart = new r.Vector2()),
  4187. (this.rotateEnd = new r.Vector2()),
  4188. (this.rotateDelta = new r.Vector2()),
  4189. (this.panStart = new r.Vector2()),
  4190. (this.panEnd = new r.Vector2()),
  4191. (this.panDelta = new r.Vector2()),
  4192. (this.panOffset = new r.Vector3()),
  4193. (this.offset = new r.Vector3()),
  4194. (this.dollyStart = new r.Vector2()),
  4195. (this.dollyEnd = new r.Vector2()),
  4196. (this.dollyDelta = new r.Vector2()),
  4197. (this.phiDelta = 0),
  4198. (this.thetaDelta = 0),
  4199. (this.scale = 1),
  4200. (this.panVector = new r.Vector3()),
  4201. (this.lastPosition = new r.Vector3()),
  4202. (this.state = c.NONE),
  4203. (this.mouseActions = {}),
  4204. (this.mouseActions[h.LEFT] = c.ROTATE),
  4205. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  4206. (this.mouseActions[h.RIGHT] = c.PAN),
  4207. (this.touchActions = {}),
  4208. (this.touchActions[1] = c.ROTATE),
  4209. (this.touchActions[2] = c.PAN_DOLLY),
  4210. (this.lastMoveTime = 0),
  4211. (this.pointersLimit = 2),
  4212. (this.pointers = [])
  4213. }
  4214. var r = e('three'),
  4215. o = e('../settings'),
  4216. a = e('../util/common'),
  4217. s = e('../util/math'),
  4218. l = e('../enum/Vectors'),
  4219. c = e('../enum/ControlActions'),
  4220. h = e('../enum/MouseButton'),
  4221. u = e('../enum/Keys'),
  4222. d = e('../enum/ControlEvents'),
  4223. p = e('events').EventEmitter,
  4224. f = 1e-6
  4225. ;(n.prototype = Object.create(p.prototype)),
  4226. (n.prototype.setBounds = function (e) {
  4227. this.targetBounds = e
  4228. }),
  4229. (n.prototype.isEngaged = function () {
  4230. return this.state !== c.NONE
  4231. }),
  4232. (n.prototype.rotateLeft = function (e) {
  4233. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e)
  4234. }),
  4235. (n.prototype.rotateUp = function (e) {
  4236. this.noRotateUpDown ||
  4237. (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e))
  4238. }),
  4239. (n.prototype.panLeft = function (e) {
  4240. var t = this.camera.matrix.elements
  4241. this.panOffset.set(t[0], 0, t[2]).normalize(),
  4242. this.panOffset.multiplyScalar(-e),
  4243. this.panVector.add(this.panOffset)
  4244. }),
  4245. (n.prototype.panUp = function (e) {
  4246. var t = this.camera.matrix.elements
  4247. this.panOffset.set(t[4], 0, t[6]).normalize(),
  4248. this.panOffset.multiplyScalar(-e),
  4249. this.panVector.add(this.panOffset)
  4250. }),
  4251. (n.prototype.startRotating = function (e, t) {
  4252. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t)
  4253. }),
  4254. (n.prototype.stopRotating = function (e) {
  4255. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4256. this.navRotationAcc('x', 0),
  4257. this.navRotationAcc('y', 0)
  4258. }),
  4259. (n.prototype.setAutoPanPosition = (function (e, t) {
  4260. var i = new r.Vector3(),
  4261. n = new r.Vector3()
  4262. return function (e, t) {
  4263. i.copy(this.camera.position),
  4264. (void 0 === e && null === e) || i.setX(e),
  4265. (void 0 === t && null === t) || i.setZ(t)
  4266. var r = this.camera.position.distanceTo(this.target),
  4267. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion)
  4268. ;(this.targetClamped = !1),
  4269. n.copy(i).addScaledVector(o, r),
  4270. this.targetBounds.containsPoint(n) ||
  4271. (this.targetBounds.clampPoint(n, n),
  4272. i.copy(n).addScaledVector(o, -r),
  4273. (this.targetClamped = !0)),
  4274. (this.autoPanPosition.x = i.x),
  4275. (this.autoPanPosition.z = i.z),
  4276. this.autoPan && this.stopAutoPanning()
  4277. }
  4278. })()),
  4279. (n.prototype.stopAutoPanning = function () {
  4280. var e = this.autoPan
  4281. ;(this.autoPan = !1),
  4282. this.emit(
  4283. this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete
  4284. )
  4285. }),
  4286. (n.prototype.dollyIn = function (e) {
  4287. void 0 === e && (e = this.getZoomScale()), (this.scale /= e)
  4288. }),
  4289. (n.prototype.dollyOut = function (e) {
  4290. void 0 === e && (e = this.getZoomScale()), (this.scale *= e)
  4291. }),
  4292. (n.prototype.updatePan = function (e) {
  4293. if (
  4294. (this.panSpeed
  4295. .multiplyScalar(1 - o.panFriction)
  4296. .addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  4297. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4298. this.autoPan)
  4299. ) {
  4300. var t = new r.Vector3().copy(this.autoPanPosition).sub(this.camera.position)
  4301. t.setY(0).clampLength(0, 50 * e),
  4302. this.target.add(t),
  4303. this.camera.position.add(t),
  4304. this.autoPanPosition.x === this.camera.position.x &&
  4305. this.autoPanPosition.z === this.camera.position.z &&
  4306. ((this.autoPan = !1), this.stopAutoPanning())
  4307. }
  4308. }),
  4309. (n.prototype.update = function (e) {
  4310. e || (e = 1 / 60)
  4311. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4312. this.rotationSpeed
  4313. .multiplyScalar(1 - friction)
  4314. .addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  4315. this.rotateLeft(-this.rotationSpeed.x),
  4316. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4317. this.updatePan(e)
  4318. var t = this.camera.position
  4319. this.offset.copy(t).sub(this.target)
  4320. var i = Math.atan2(this.offset.x, this.offset.z),
  4321. n = Math.atan2(
  4322. Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z),
  4323. this.offset.y
  4324. )
  4325. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4326. (i += this.thetaDelta),
  4327. (n += this.phiDelta),
  4328. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  4329. (n = Math.max(f, Math.min(Math.PI - f, n)))
  4330. ;(this.lon = i), (this.lat = n) //add
  4331. var r = this.updateZoom()
  4332. ;(r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  4333. this.target.add(this.panVector),
  4334. this.targetBounds.clampPoint(this.target, this.target),
  4335. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  4336. (this.offset.y = r * Math.cos(n)),
  4337. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  4338. t.copy(this.target).add(this.offset),
  4339. this.camera.lookAt(this.target),
  4340. (this.thetaDelta = 0),
  4341. (this.phiDelta = 0),
  4342. (this.scale = 1),
  4343. this.panVector.set(0, 0, 0),
  4344. this.lastPosition.distanceTo(this.camera.position) > 0 &&
  4345. this.lastPosition.copy(this.camera.position)
  4346. }),
  4347. (n.prototype.getAutoRotationAngle = function () {
  4348. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed
  4349. }),
  4350. (n.prototype.getZoomScale = function () {
  4351. return Math.pow(0.95, this.zoomSpeed)
  4352. }),
  4353. (n.prototype.onMouseDown = function (e) {
  4354. if (this.enabled) {
  4355. switch (
  4356. (e.preventDefault(),
  4357. this.stopAutoPanning(),
  4358. (this.mouseDown = !0),
  4359. (this.state = this.mouseActions[e.button]),
  4360. this.state)
  4361. ) {
  4362. case c.ROTATE:
  4363. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4364. this.rotationSpeed.set(0, 0)
  4365. break
  4366. case c.DOLLY:
  4367. this.dollyStart.set(e.clientX, e.clientY)
  4368. break
  4369. case c.PAN:
  4370. this.panStart.set(e.clientX, e.clientY)
  4371. }
  4372. this.emit(d.InputStart, 'mouse')
  4373. }
  4374. }),
  4375. (n.prototype.onMouseMove = function (e) {
  4376. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4377. switch ((e.preventDefault(), this.state)) {
  4378. case c.ROTATE:
  4379. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4380. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4381. this.rotateLeft(
  4382. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4383. ),
  4384. this.rotateUp(
  4385. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4386. this.rotateSpeed
  4387. ),
  4388. this.rotateStart.copy(this.rotateEnd)
  4389. break
  4390. case c.DOLLY:
  4391. this.dollyEnd.set(e.clientX, e.clientY),
  4392. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart)
  4393. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut
  4394. t.call(this), this.dollyStart.copy(this.dollyEnd)
  4395. break
  4396. case c.PAN:
  4397. this.panEnd.set(e.clientX, e.clientY),
  4398. this.panDelta.subVectors(this.panEnd, this.panStart),
  4399. this.pan(this.panDelta.x, this.panDelta.y),
  4400. this.panStart.copy(this.panEnd)
  4401. }
  4402. this.emit(d.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update()
  4403. }
  4404. }),
  4405. (n.prototype.onMouseUp = function (e) {
  4406. this.enabled &&
  4407. ((this.mouseDown = !1),
  4408. (this.state = c.NONE),
  4409. 'mouseover' !== e.type &&
  4410. (e.timeStamp > this.lastMoveTime + 100
  4411. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4412. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  4413. this.update(),
  4414. this.rotationAcceleration.set(0, 0),
  4415. this.rotateDelta.set(0, 0)))
  4416. }),
  4417. (n.prototype.onMouseOver = function (e) {
  4418. ;(0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4419. }),
  4420. (n.prototype.onMouseWheel = function (e) {
  4421. if (this.enabled && o.useWheel) {
  4422. this.emit(d.Move, 'wheel')
  4423. var t = e.wheelDelta || -e.detail,
  4424. i = t > 0 ? this.dollyOut : this.dollyIn
  4425. i.call(this), this.update()
  4426. }
  4427. }),
  4428. (n.prototype.onKeyDown = function (e) {
  4429. this.enabled &&
  4430. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4431. }),
  4432. (n.prototype.navRotationAcc = function (e, t) {
  4433. 'y' === e
  4434. ? this.noRotateUpDown
  4435. ? (this.keyboardZoomSpeed = t)
  4436. : (this.rotationAcceleration.y = t)
  4437. : (this.rotationAcceleration.x = t)
  4438. }),
  4439. (n.prototype.navPanAcc = function (e, t) {
  4440. this.stopAutoPanning(), (this.panAcceleration[e] = t)
  4441. }),
  4442. (n.prototype.handleKeyDown = function (e) {
  4443. var t = !0
  4444. switch (e) {
  4445. case u.UPARROW:
  4446. case u.I:
  4447. this.navRotationAcc('y', 1)
  4448. break
  4449. case u.DOWNARROW:
  4450. case u.K:
  4451. this.navRotationAcc('y', -1)
  4452. break
  4453. case u.LEFTARROW:
  4454. case u.J:
  4455. this.navRotationAcc('x', -1)
  4456. break
  4457. case u.RIGHTARROW:
  4458. case u.L:
  4459. this.navRotationAcc('x', 1)
  4460. break
  4461. case u.W:
  4462. this.navPanAcc('y', 1)
  4463. break
  4464. case u.S:
  4465. this.navPanAcc('y', -1)
  4466. break
  4467. case u.A:
  4468. this.navPanAcc('x', -1)
  4469. break
  4470. case u.D:
  4471. this.navPanAcc('x', 1)
  4472. break
  4473. default:
  4474. t = !1
  4475. }
  4476. t && this.emit(d.Move, 'key')
  4477. }),
  4478. (n.prototype.onKeyUp = function (e) {
  4479. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4480. }),
  4481. (n.prototype.handleKeyUp = function (e) {
  4482. switch (e) {
  4483. case u.I:
  4484. case u.K:
  4485. case u.UPARROW:
  4486. case u.DOWNARROW:
  4487. ;(this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0)
  4488. break
  4489. case u.J:
  4490. case u.L:
  4491. case u.LEFTARROW:
  4492. case u.RIGHTARROW:
  4493. this.rotationAcceleration.x = 0
  4494. break
  4495. case u.S:
  4496. case u.W:
  4497. this.panAcceleration.y = 0
  4498. break
  4499. case u.A:
  4500. case u.D:
  4501. this.panAcceleration.x = 0
  4502. }
  4503. }),
  4504. (n.prototype.onTouchStart = function (e) {
  4505. if (this.enabled || this.state === c.NONE) {
  4506. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning()
  4507. var t = function () {
  4508. if (2 === e.touches.length) {
  4509. var t = e.touches[0].pageX - e.touches[1].pageX,
  4510. i = e.touches[0].pageY - e.touches[1].pageY
  4511. this.dollyStart.set(t, i)
  4512. }
  4513. }.bind(this),
  4514. i = function () {
  4515. this.panStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  4516. }.bind(this),
  4517. n = function () {
  4518. this.rotateStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  4519. }.bind(this)
  4520. switch (((this.state = this.touchActions[e.touches.length]), this.state)) {
  4521. case c.PAN_DOLLY:
  4522. t()
  4523. case c.PAN:
  4524. i()
  4525. break
  4526. case c.ROTATE_DOLLY:
  4527. t()
  4528. case c.ROTATE:
  4529. n()
  4530. }
  4531. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, 'touch')
  4532. }
  4533. }),
  4534. (n.prototype.onTouchMove = function (e) {
  4535. if (this.enabled && this.state !== c.NONE) {
  4536. e.preventDefault(), e.stopPropagation()
  4537. var t = function () {
  4538. var t = e.touches[0].pageX - e.touches[1].pageX,
  4539. i = e.touches[0].pageY - e.touches[1].pageY
  4540. this.dollyEnd.set(t, i)
  4541. var n = this.dollyStart.length() - this.dollyEnd.length()
  4542. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  4543. this.dollyStart.copy(this.dollyEnd)
  4544. }.bind(this),
  4545. i = function () {
  4546. this.panEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4547. this.panDelta.subVectors(this.panEnd, this.panStart),
  4548. this.pan(this.panDelta.x, this.panDelta.y),
  4549. this.panStart.copy(this.panEnd),
  4550. this.rotateDelta.set(0, 0)
  4551. }.bind(this),
  4552. n = function () {
  4553. this.rotateEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4554. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4555. this.rotateLeft(
  4556. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4557. ),
  4558. this.rotateUp(
  4559. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4560. this.rotateSpeed
  4561. ),
  4562. this.rotateStart.copy(this.rotateEnd)
  4563. }.bind(this),
  4564. r = function () {
  4565. if (2 === e.touches.length) {
  4566. var i = window.devicePixelRatio || 1,
  4567. r = e.touches[1].pageX - e.touches[0].pageX,
  4568. s = e.touches[1].pageY - e.touches[0].pageY,
  4569. l = Math.sqrt(r * r + s * s),
  4570. h = Math.abs(this.dollyStart.length() - l)
  4571. if (h > o.input.touchMoveThreshold * i) (this.state = c.DOLLY), t()
  4572. else {
  4573. var u = a.average(e.touches, 'pageX'),
  4574. d = a.average(e.touches, 'pageY'),
  4575. p = this.rotateDelta.set(u, d).sub(this.rotateStart).length()
  4576. p > o.input.touchMoveThreshold &&
  4577. ((this.state = c.ROTATE), this.rotateStart.set(u, d), n())
  4578. }
  4579. }
  4580. }.bind(this)
  4581. switch (this.state) {
  4582. case c.PAN_DOLLY:
  4583. t()
  4584. case c.PAN:
  4585. i()
  4586. break
  4587. case c.ROTATE_DOLLY:
  4588. r()
  4589. break
  4590. case c.DOLLY:
  4591. t()
  4592. break
  4593. case c.ROTATE:
  4594. n()
  4595. break
  4596. default:
  4597. this.state = c.NONE
  4598. }
  4599. ;(this.lastMoveTime = e.timeStamp), this.emit(d.Move, 'touch')
  4600. }
  4601. }),
  4602. (n.prototype.onTouchEnd = function (e) {
  4603. this.enabled &&
  4604. (this.state === c.ROTATE &&
  4605. (e.timeStamp > this.lastMoveTime + 100
  4606. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4607. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4608. (this.state = c.NONE),
  4609. this.update(),
  4610. this.rotationAcceleration.set(0, 0),
  4611. this.rotateDelta.set(0, 0))
  4612. }),
  4613. (n.prototype.onPointerDown = function (e) {
  4614. this.enabled &&
  4615. ('touch' === e.pointerType &&
  4616. (this.pointers.length < this.pointersLimit &&
  4617. this.pointers.push({
  4618. id: e.pointerId,
  4619. pageX: e.pageX,
  4620. pageY: e.pageY
  4621. }),
  4622. (e.touches = this.pointers),
  4623. this.onTouchStart(e)),
  4624. this.emit(d.InputStart, 'pointer'))
  4625. }),
  4626. (n.prototype.onPointerMove = function (e) {
  4627. this.enabled &&
  4628. 'touch' === e.pointerType &&
  4629. (this.pointers.forEach(function (t) {
  4630. e.pointerId === t.id && ((t.pageX = e.pageX), (t.pageY = e.pageY))
  4631. }),
  4632. (e.touches = this.pointers),
  4633. this.onTouchMove(e))
  4634. }),
  4635. (n.prototype.onPointerUp = function (e) {
  4636. this.enabled &&
  4637. 'touch' === e.pointerType &&
  4638. (this.pointers.forEach(
  4639. function (t, i) {
  4640. e.pointerId === t.id && this.pointers.splice(i, 1)
  4641. }.bind(this)
  4642. ),
  4643. (e.touches = this.pointers),
  4644. this.onTouchEnd(e))
  4645. }),
  4646. (n.prototype.reset = function () {
  4647. ;(this.state = c.NONE),
  4648. this.stopAutoPanning(),
  4649. this.rotationSpeed.set(0, 0),
  4650. this.rotationAcceleration.set(0, 0),
  4651. this.panSpeed.set(0, 0),
  4652. this.panAcceleration.set(0, 0)
  4653. }),
  4654. (n.prototype.toJSON = function () {
  4655. var e = {
  4656. camera_position: {
  4657. x: s.toPrecision(this.camera.position.x, 4),
  4658. y: s.toPrecision(this.camera.position.y, 4),
  4659. z: s.toPrecision(this.camera.position.z, 4)
  4660. },
  4661. camera_quaternion: {
  4662. x: s.toPrecision(this.camera.quaternion.x, 4),
  4663. y: s.toPrecision(this.camera.quaternion.y, 4),
  4664. z: s.toPrecision(this.camera.quaternion.z, 4),
  4665. w: s.toPrecision(this.camera.quaternion.w, 4)
  4666. }
  4667. }
  4668. return e
  4669. }),
  4670. (t.exports = n)
  4671. },
  4672. {
  4673. '../enum/ControlActions': 20,
  4674. '../enum/ControlEvents': 21,
  4675. '../enum/Keys': 30,
  4676. '../enum/MouseButton': 34,
  4677. '../enum/Vectors': 50,
  4678. '../settings': 166,
  4679. '../util/common': 185,
  4680. '../util/math': 190,
  4681. events: 202,
  4682. three: 217
  4683. }
  4684. ],
  4685. 13: [
  4686. function (e, t, i) {
  4687. ;(function (i) {
  4688. 'use strict'
  4689. function n(e) {
  4690. ;(this.camera = e),
  4691. (this.camera.controls = this),
  4692. (this.target = new r.Vector3(0, 0, 0)),
  4693. (this.lookVector = new r.Vector3()),
  4694. (this.lookSpeed = 0.05),
  4695. (this.rotationAcc = new r.Vector2()),
  4696. (this.rotationSpeed = new r.Vector2()),
  4697. (this.lat = 0),
  4698. (this.lon = 0),
  4699. (this.phi = 0),
  4700. (this.theta = 0),
  4701. (this.enabled = !1),
  4702. (this.locked = !1),
  4703. (this.pointer = new r.Vector2(0, 0)),
  4704. (this.rotationHistory = []),
  4705. (this.rotationDifference = new r.Vector2()),
  4706. (this.pointerDragOn = !1),
  4707. (this.pointerDragStart = new r.Vector2(0, 0)),
  4708. (this.pinchDistance = 0),
  4709. (this.moveStart = new r.Vector2()),
  4710. (this.moveTolerance = 0.01),
  4711. (this.pointersLimit = 2),
  4712. (this.pointers = [])
  4713. }
  4714. var r = e('three'),
  4715. o = e('../util/logger'),
  4716. a = e('../settings'),
  4717. s = e('../util/common'),
  4718. l = e('../util/math'),
  4719. c = (e('../enum/Vectors'), e('../enum/MouseButton')),
  4720. h = e('../enum/Keys'),
  4721. u = e('../enum/ControlEvents'),
  4722. d = e('events').EventEmitter
  4723. new o(i)
  4724. ;(n.prototype = Object.create(d.prototype)),
  4725. (n.prototype.usable = function () {
  4726. return this.enabled && !this.locked
  4727. }),
  4728. /* n.prototype.lookAt = function(e) {
  4729. var t = this.camera.position.clone().sub(e)
  4730. , i = Math.atan(t.z / t.x);
  4731. i += t.x < 0 ? Math.PI : 0,
  4732. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4733. this.lon = r.Math.radToDeg(i) + 180;
  4734. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4735. , o = Math.atan(t.y / n);
  4736. this.lat = -r.Math.radToDeg(o)
  4737. }
  4738. */
  4739. (n.prototype.lookAt = function (aim, dir) {
  4740. var t = dir || this.camera.position.clone().sub(aim) //aim所指点的笛卡尔坐标系
  4741. var i = Math.atan(t.z / t.x)
  4742. i += t.x < 0 ? Math.PI : 0
  4743. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0
  4744. this.lon = r.Math.radToDeg(i) + 180
  4745. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4746. o = Math.atan(t.y / n)
  4747. this.lat = -r.Math.radToDeg(o)
  4748. }),
  4749. (n.prototype.startRotationFrom = function (e, t) {
  4750. l.convertScreenPositionToNDC(e, t, this.pointer),
  4751. (this.pointerDragOn = !0),
  4752. this.pointerDragStart.copy(this.pointer),
  4753. this.moveStart.copy(this.pointer),
  4754. (this.rotationHistory = []),
  4755. this.rotationSpeed.set(0, 0)
  4756. }),
  4757. (n.prototype.onMouseOver = function (e) {
  4758. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4759. }),
  4760. (n.prototype.onTouchStart = function (e) {
  4761. if (this.usable()) {
  4762. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4763. case 1:
  4764. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY)
  4765. break
  4766. case 2:
  4767. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4768. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4769. this.pinchDistance = Math.sqrt(t * t + i * i)
  4770. }
  4771. this.emit(u.InputStart, 'touch')
  4772. }
  4773. }),
  4774. (n.prototype.onPointerDown = function (e) {
  4775. this.usable() &&
  4776. 'touch' === e.pointerType &&
  4777. (this.pointers.length < this.pointersLimit &&
  4778. this.pointers.push({
  4779. id: e.pointerId,
  4780. clientX: e.clientX,
  4781. clientY: e.clientY
  4782. }),
  4783. (e.touches = this.pointers),
  4784. this.onTouchStart(e),
  4785. this.emit(u.InputStart, 'pointer'))
  4786. }),
  4787. (n.prototype.onMouseDown = function (e) {
  4788. if (this.usable()) {
  4789. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4790. case c.LEFT:
  4791. this.startRotationFrom(e.clientX, e.clientY)
  4792. }
  4793. SoundManager.pause('tour') // zeg 点击场景时停止语音
  4794. this.emit(u.InputStart, 'mouse')
  4795. }
  4796. }),
  4797. (n.prototype.updateRotation = function () {
  4798. if (this.usable() && this.pointerDragOn) {
  4799. var e = new r.Vector3(
  4800. this.pointerDragStart.x,
  4801. this.pointerDragStart.y,
  4802. -1
  4803. ).unproject(this.camera),
  4804. t = new r.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4805. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4806. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4807. o = Math.atan2(e.y, i),
  4808. a = Math.atan2(t.y, n)
  4809. ;(this.rotationDifference.y = r.Math.radToDeg(o - a)), (e.y = 0), (t.y = 0)
  4810. var s = Math.acos(e.dot(t) / e.length() / t.length())
  4811. isNaN(s) ||
  4812. ((this.rotationDifference.x = r.Math.radToDeg(s)),
  4813. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4814. this.pointerDragStart.copy(this.pointer)
  4815. }
  4816. }),
  4817. (n.prototype.onMouseMove = function (e) {
  4818. this.usable() &&
  4819. (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4820. this.pointerDragOn &&
  4821. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance ||
  4822. Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4823. this.emit(u.Move, 'mouse'))
  4824. }),
  4825. (n.prototype.onTouchMove = function (e) {
  4826. if (this.usable())
  4827. switch ((this.emit(u.Move, 'touch'), e.touches.length)) {
  4828. case 1:
  4829. l.convertScreenPositionToNDC(
  4830. e.touches[0].clientX,
  4831. e.touches[0].clientY,
  4832. this.pointer
  4833. )
  4834. break
  4835. case 2:
  4836. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4837. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4838. n = this.pinchDistance - Math.sqrt(t * t + i * i)
  4839. Math.abs(n) > 0.01 &&
  4840. (this.emit(u.InteractionDirect),
  4841. this.emit(u.Pinch, n),
  4842. (this.pinchDistance -= n))
  4843. }
  4844. }),
  4845. (n.prototype.onPointerMove = function (e) {
  4846. this.usable() &&
  4847. 'touch' === e.pointerType &&
  4848. (this.pointers.forEach(function (t) {
  4849. e.pointerId === t.id && ((t.clientX = e.clientX), (t.clientY = e.clientY))
  4850. }),
  4851. (e.touches = this.pointers),
  4852. this.onTouchMove(e))
  4853. }),
  4854. (n.prototype.endRotation = function () {
  4855. this.pointerDragOn = !1
  4856. var e = s.averageVectors(this.rotationHistory)
  4857. this.rotationSpeed.set(
  4858. e.x * a.rotationAfterMoveMultiplier,
  4859. e.y * a.rotationAfterMoveMultiplier
  4860. )
  4861. }),
  4862. (n.prototype.onTouchEnd = function (e) {
  4863. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4864. }),
  4865. (n.prototype.onMouseUp = function (e) {
  4866. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4867. }),
  4868. (n.prototype.onPointerUp = function (e) {
  4869. this.usable() &&
  4870. 'touch' === e.pointerType &&
  4871. (this.pointers.forEach(
  4872. function (t, i) {
  4873. e.pointerId === t.id && this.pointers.splice(i, 1)
  4874. }.bind(this)
  4875. ),
  4876. (e.touches = this.pointers),
  4877. this.onTouchEnd(e))
  4878. }),
  4879. (n.prototype.update = function (e) {
  4880. this.lon, this.lat
  4881. for (
  4882. this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone());
  4883. this.rotationHistory.length > a.rotationAfterMoveHistoryCount;
  4884. )
  4885. this.rotationHistory.shift()
  4886. ;(this.lon += this.rotationDifference.x),
  4887. (this.lat += this.rotationDifference.y),
  4888. this.rotationDifference.set(0, 0)
  4889. //改
  4890. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4891. ;(this.rotationSpeed.x =
  4892. this.rotationSpeed.x * (1 - friction) +
  4893. this.rotationAcc.x * a.rotationAccelerationInside),
  4894. (this.rotationSpeed.y =
  4895. this.rotationSpeed.y * (1 - friction) +
  4896. this.rotationAcc.y * a.rotationAccelerationInside),
  4897. (this.lon += this.rotationSpeed.x * e),
  4898. (this.lat += this.rotationSpeed.y * e)
  4899. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4900. let insideLookLimitDown =
  4901. this.insideLookLimitDown != void 0
  4902. ? this.insideLookLimitDown
  4903. : a.insideLookLimitDown
  4904. let insideLookLimitUp =
  4905. this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4906. insideLookLimitDown = insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2
  4907. insideLookLimitUp = insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2
  4908. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)) //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4909. ;(this.phi = r.Math.degToRad(90 - this.lat)),
  4910. (this.theta = r.Math.degToRad(this.lon)),
  4911. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4912. (this.lookVector.y = Math.cos(this.phi)),
  4913. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4914. this.target.copy(this.lookVector).add(this.camera.position),
  4915. this.camera.lookAt(this.target)
  4916. }),
  4917. (n.prototype.onMouseWheel = function (e) {
  4918. if (this.usable()) {
  4919. var t = e.wheelDelta || -e.detail
  4920. this.emit(u.InteractionDirect), this.emit(u.Scroll, t)
  4921. }
  4922. }),
  4923. (n.prototype.onKeyDown = function (e) {
  4924. this.usable() &&
  4925. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4926. }),
  4927. (n.prototype.handleKeyDown = function (e) {
  4928. var t = function (e, t) {
  4929. this.rotationAcc[e] = t
  4930. }.bind(this)
  4931. this.emit(u.InteractionKey)
  4932. var i = !0
  4933. switch (e) {
  4934. case h.LEFTARROW:
  4935. case h.J:
  4936. t('x', -1)
  4937. break
  4938. case h.RIGHTARROW:
  4939. case h.L:
  4940. t('x', 1)
  4941. break
  4942. case h.I:
  4943. t('y', 1)
  4944. break
  4945. case h.K:
  4946. t('y', -1)
  4947. break
  4948. default:
  4949. i = !1
  4950. }
  4951. i && this.emit(u.Move, 'key')
  4952. }),
  4953. (n.prototype.onKeyUp = function (e) {
  4954. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4955. }),
  4956. (n.prototype.handleKeyUp = function (e) {
  4957. switch (e) {
  4958. case h.LEFTARROW:
  4959. case h.J:
  4960. case h.RIGHTARROW:
  4961. case h.L:
  4962. this.rotationAcc.x = 0
  4963. break
  4964. case h.I:
  4965. case h.K:
  4966. this.rotationAcc.y = 0
  4967. }
  4968. }),
  4969. (n.prototype.startRotating = function (e, t) {
  4970. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
  4971. }),
  4972. (n.prototype.stopRotating = function (e) {
  4973. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
  4974. }),
  4975. (n.prototype.reset = function () {
  4976. ;(this.pointerDragOn = !1),
  4977. this.rotationAcc.set(0, 0),
  4978. this.rotationSpeed.set(0, 0),
  4979. (this.pointers = [])
  4980. }),
  4981. (n.prototype.toJSON = function () {
  4982. var e = {
  4983. camera_position: {
  4984. x: l.toPrecision(this.camera.position.x, 4),
  4985. y: l.toPrecision(this.camera.position.y, 4),
  4986. z: l.toPrecision(this.camera.position.z, 4)
  4987. },
  4988. camera_quaternion: {
  4989. x: l.toPrecision(this.camera.quaternion.x, 4),
  4990. y: l.toPrecision(this.camera.quaternion.y, 4),
  4991. z: l.toPrecision(this.camera.quaternion.z, 4),
  4992. w: l.toPrecision(this.camera.quaternion.w, 4)
  4993. }
  4994. }
  4995. return e
  4996. }),
  4997. (n.prototype.setStateFromJSON = function (e) {
  4998. this.camera.position.copy(e.camera_position),
  4999. this.camera.quaternion.copy(e.camera_quaternion)
  5000. }),
  5001. (t.exports = n)
  5002. }).call(this, '/js/controls/PanoramaControls.js')
  5003. },
  5004. {
  5005. '../enum/ControlEvents': 21,
  5006. '../enum/Keys': 30,
  5007. '../enum/MouseButton': 34,
  5008. '../enum/Vectors': 50,
  5009. '../settings': 166,
  5010. '../util/common': 185,
  5011. '../util/logger': 189,
  5012. '../util/math': 190,
  5013. events: 202,
  5014. three: 217
  5015. }
  5016. ],
  5017. 14: [
  5018. function (e, t, i) {
  5019. ;(function (i) {
  5020. 'use strict'
  5021. var n = e('three'),
  5022. r = e('../enum/Viewmode'),
  5023. o = e('../util/logger'),
  5024. a = new o(i)
  5025. t.exports = {
  5026. serialize: function (e) {
  5027. return encodeURI(JSON.stringify(e))
  5028. },
  5029. deserialize: function (e) {
  5030. function t(e) {
  5031. function t(e, t) {
  5032. return e && 'number' == typeof t && !isNaN(t)
  5033. }
  5034. return e.reduce(t, !0)
  5035. }
  5036. try {
  5037. var i = JSON.parse(decodeURI(e)),
  5038. o = {
  5039. mode: r.fromInt(i.camera_mode),
  5040. panoId: i.scan_id,
  5041. position: new n.Vector3().copy(i.camera_position),
  5042. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  5043. zoom: i.ortho_zoom,
  5044. floorVisibility: i.floor_visibility
  5045. },
  5046. s = o.position
  5047. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0)
  5048. var l = o.quaternion
  5049. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o
  5050. } catch (i) {
  5051. a.debug(
  5052. 'Not able to parse start location as JSON; falling back to old array style parsing'
  5053. )
  5054. try {
  5055. var c = e.split(','),
  5056. h = {
  5057. x: parseFloat(c[2]),
  5058. y: parseFloat(c[3]),
  5059. z: parseFloat(c[4])
  5060. },
  5061. u = {
  5062. x: parseFloat(c[5]),
  5063. y: parseFloat(c[6]),
  5064. z: parseFloat(c[7]),
  5065. w: parseFloat(c[8])
  5066. }
  5067. return (
  5068. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  5069. t([u.x, u.y, u.z, u.w]) || ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  5070. {
  5071. mode: r.fromInt(c[0]),
  5072. panoId: c[1],
  5073. position: new n.Vector3().copy(h),
  5074. quaternion: new n.Quaternion().copy(u)
  5075. }
  5076. )
  5077. } catch (t) {
  5078. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  5079. }
  5080. }
  5081. return null
  5082. }
  5083. }
  5084. }).call(this, '/js/controls/serializer.js')
  5085. },
  5086. {
  5087. '../enum/Viewmode': 51,
  5088. '../util/logger': 189,
  5089. three: 217
  5090. }
  5091. ],
  5092. 15: [
  5093. function (e, t, i) {
  5094. ;(function (i) {
  5095. 'use strict'
  5096. function n() {
  5097. ;(this.endlessLoop = a.warp.loop),
  5098. (this.clock = new r.Clock(!0)),
  5099. (this.model = null),
  5100. (this.player = null),
  5101. (this.currentItem = null),
  5102. (this.destinationItem = null),
  5103. (this.tourIsPlaying = !1),
  5104. (this.transitionStage = y.None),
  5105. (this.nextFunc = null),
  5106. (this.onTheBus = !1),
  5107. (this.tourInProgress = !1),
  5108. (this.reachSource = null),
  5109. (this.interrupted = !1),
  5110. (this.nItems = 0),
  5111. (this.walkingSectionPaused = !1)
  5112. }
  5113. var r = e('three'),
  5114. o = e('./util/logger'),
  5115. a = e('./settings'),
  5116. s = e('./util/transitions'),
  5117. l = e('events').EventEmitter,
  5118. c = e('./enum/Viewmode'),
  5119. h = e('./analytics'),
  5120. u = e('./enum/WarpStyle'),
  5121. s = e('./util/transitions'),
  5122. d = (e('./model/ModelManager'), e('./enum/ModelManagerEvents')),
  5123. p = e('./enum/DirectorEvents'),
  5124. f = e('./enum/PlayerEvents'),
  5125. g = (e('./enum/ControlEvents'), e('./enum/BlackoutStyle')),
  5126. m = e('./enum/PathDiscardMode'),
  5127. v = e('./enum/PathDisplayMode'),
  5128. A = (e('./player'), new o(i)),
  5129. y = Object.freeze({
  5130. None: 0,
  5131. Moving: 1,
  5132. Aiming: 2,
  5133. Interlude: 3
  5134. }),
  5135. C = Object.freeze({
  5136. Forward: 1,
  5137. NoChange: 0,
  5138. Backwards: -1
  5139. }),
  5140. I = s.getUniqueId()
  5141. ;(n.prototype = Object.create(l.prototype)),
  5142. (n.prototype.init = function (e, t) {
  5143. ;(this.player = e),
  5144. (this.modelManager = t),
  5145. this.updateModel(),
  5146. this.resetAll(),
  5147. this.bindEvents()
  5148. // // zeg 查询pano对应的导览片段
  5149. // if(!this.panoIdMap) {
  5150. // this.panoIdMap = new Map()
  5151. // this.model.heroLocations.forEach( (value, index) => {
  5152. // // value.heroLocations.forEach( hl => {
  5153. // if(!value.heroLocations) return
  5154. // let hl = value.heroLocations[0]
  5155. // let arr = this.panoIdMap.get(hl.panoId)
  5156. // if(arr){
  5157. // this.panoIdMap.set(hl.panoId, [...arr, index])
  5158. // } else {
  5159. // this.panoIdMap.set(hl.panoId, [index])
  5160. // }
  5161. // // })
  5162. // })
  5163. // }
  5164. }),
  5165. (n.prototype.resetAll = function () {
  5166. if (
  5167. ((this.currentItem = null),
  5168. (this.destinationItem = null),
  5169. (this.tourIsPlaying = !1),
  5170. //this.bgmReplay(),//xzw
  5171. (this.transitionStage = y.None),
  5172. (this.nextFunc = null),
  5173. (this.onTheBus = !1),
  5174. (this.reachSource = null),
  5175. (this.interrupted = !1),
  5176. this.model)
  5177. ) {
  5178. var e = a.path.typ === u.WALK ? u.WALK : u.STD
  5179. this.defaultWarpStyle =
  5180. this.model.data.hasOwnProperty('player_options') &&
  5181. this.model.data.player_options &&
  5182. this.model.data.player_options.fast_transitions === !1
  5183. ? e
  5184. : u.BLACK
  5185. } else
  5186. (this.defaultWarpStyle = u.BLACK),
  5187. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions')
  5188. this.resetSpecialTransition()
  5189. }),
  5190. (n.prototype.updateModel = function () {
  5191. ;(this.model = this.modelManager.getActiveModel()),
  5192. (this.nItems = this.model.heroLocations.length)
  5193. }),
  5194. (n.prototype.bindEvents = function () {
  5195. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  5196. this.player.on(
  5197. f.WarpInterruptedWithFlyTo,
  5198. this.checkAndHandleWalkingtourInterruption.bind(this)
  5199. ),
  5200. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  5201. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  5202. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  5203. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  5204. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  5205. this.player.once(f.Move, function () {
  5206. s.cancelById(I)
  5207. })
  5208. }),
  5209. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  5210. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  5211. return (
  5212. /* e === u.WALK && ( */ this.interrupt(g.NONE),
  5213. this.pauseWalkingSection(),
  5214. this.player.fastForwardActivePanoFlight(),
  5215. !0
  5216. ) /* ) */
  5217. }),
  5218. (n.prototype.handlePlayerMove = function (e) {
  5219. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  5220. this.emit('update.controls')
  5221. }),
  5222. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  5223. this.intermediateState() ||
  5224. e.id === t.id ||
  5225. ((this.onTheBus = !1), this.emit('update.controls'))
  5226. }),
  5227. (n.prototype.handlePlayerModeChanged = function (e, t) {
  5228. this.intermediateState() ||
  5229. e === t ||
  5230. ((this.onTheBus = !1), this.emit('update.controls'))
  5231. }),
  5232. (n.prototype.handlePlayerInputStart = function (e) {
  5233. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  5234. }),
  5235. (n.prototype.handlePlayerFlyingStarted = function () {
  5236. this.clearWalkingSectionPaused()
  5237. }),
  5238. (n.prototype.describe = function () {
  5239. return {
  5240. nItems: this.nItems,
  5241. currentItem: this.currentItem,
  5242. destinationItem: this.destinationItem,
  5243. tourIsPlaying: this.tourIsPlaying,
  5244. onTheBus: this.onTheBus,
  5245. endlessLoop: this.endlessLoop,
  5246. viewMode: this.player.mode,
  5247. inTransition: this._inTransition(),
  5248. transitionStage: this.transitionStage,
  5249. tourInProgress: this.tourInProgress
  5250. }
  5251. }),
  5252. (n.prototype._inTransition = function () {
  5253. return (
  5254. this.player.flying ||
  5255. this.player.isWarping() ||
  5256. this.player.isWaitingToWarp() ||
  5257. this.player.mode === c.TRANSITIONING ||
  5258. this.tourIsPlaying
  5259. )
  5260. }),
  5261. (n.prototype.bounceable = function () {
  5262. var e = this.clock.getDelta()
  5263. return (
  5264. this.isInterrupted() ||
  5265. (e < 0.9 && e > 0.01) ||
  5266. (this.player.flying && !this.player.isWarping())
  5267. )
  5268. }),
  5269. (n.prototype.itemCompare = function (item1, item2, type) {
  5270. //add
  5271. if (type == 'equal') {
  5272. //==
  5273. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  5274. } else if (type == 'less') {
  5275. //<
  5276. return (
  5277. (item1 && item2 && item1[0] < item2[0]) ||
  5278. (item1[0] == item2[0] && item1[1] < item2[1])
  5279. )
  5280. }
  5281. })
  5282. ;(n.prototype.currentMoveDirection = function () {
  5283. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  5284. return null === this.currentItem || void 0 === this.currentItem
  5285. ? y.Forward
  5286. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  5287. ? y.NoChange
  5288. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  5289. ? y.Forward
  5290. : y.Backwards
  5291. }),
  5292. (n.prototype.clearPath = function () {
  5293. this._inTransition() || this.player.path.discardPathObject()
  5294. }),
  5295. (n.prototype.allFloors = function () {
  5296. this.model.toggleAllFloors()
  5297. }),
  5298. (n.prototype.actionComplete = function (e) {
  5299. if (
  5300. ((this.interrupted = !1),
  5301. (this.transitionStage = y.None),
  5302. this.resetSpecialTransition(),
  5303. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  5304. this.tourIsPlaying ||
  5305. (this.player.disablePreRendering(),
  5306. this.player.mode === c.PANORAMA &&
  5307. this.player.currentPano.isAligned() &&
  5308. this.model.fadePanoMarkers()),
  5309. this.emit('update.controls'),
  5310. this.nextFunc)
  5311. ) {
  5312. var t = this.nextFunc
  5313. ;(this.nextFunc = null), t()
  5314. }
  5315. }),
  5316. (n.prototype.awaitCompletion = function (e, t) {
  5317. ;(this.nextFunc = t), e()
  5318. }),
  5319. (n.prototype.updateSuccessFunction = function (e) {
  5320. this.nextFunc = e
  5321. }),
  5322. (n.prototype.interrupt = function (e, t) {
  5323. //滑动屏幕或按下键盘等
  5324. return (
  5325. !!this.wouldInterrupt() &&
  5326. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5327. (this.tourIsPlaying = !1),
  5328. //this.bgmReplay(),//xzw
  5329. (this.interrupted = !0),
  5330. (this.nextFunc = null),
  5331. this.emit(p.ActionInterrupted),
  5332. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  5333. this.player.interruptAndFastForward(e, t),
  5334. !0)
  5335. )
  5336. }),
  5337. (n.prototype.wouldInterrupt = function () {
  5338. return this.transitionStage !== y.None
  5339. }),
  5340. (n.prototype.intermediateState = function () {
  5341. return this.transitionStage !== y.None
  5342. }),
  5343. (n.prototype.isInterrupted = function () {
  5344. return this.interrupted
  5345. }),
  5346. (n.prototype.pauseWalkingSection = function () {
  5347. this.walkingSectionPaused = !0
  5348. }),
  5349. (n.prototype.clearWalkingSectionPaused = function () {
  5350. this.walkingSectionPaused = !1
  5351. }),
  5352. (n.prototype.autoTour = function () {
  5353. var e = Date.now()
  5354. this.model.auxDataPromise.then(
  5355. function () {
  5356. e = Date.now() - e
  5357. var t = a.warp.auto,
  5358. i =
  5359. this.model.data &&
  5360. this.model.data
  5361. .player_options /* && this.model.data.player_options.highlight_reel */
  5362. t >= 0 &&
  5363. this.model.heroCount() > 1 &&
  5364. i &&
  5365. s.trigger({
  5366. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5367. done: function () {
  5368. this.playTour()
  5369. }.bind(this),
  5370. name: '_atr',
  5371. id: I
  5372. })
  5373. }.bind(this)
  5374. )
  5375. }),
  5376. (n.prototype.atDestinationPano = function (pano) {
  5377. if (null === this.destinationItem) return !1
  5378. pano = pano || this.player.currentPano
  5379. if (!pano) {
  5380. return !1
  5381. }
  5382. var destination =
  5383. this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  5384. return destination && destination.panoId == pano.id
  5385. }),
  5386. (n.prototype.redirectToItem = function (e, t) {
  5387. if (null === e || void 0 === e)
  5388. return void A.warn('Director.redirectToItem() -> Redirecting to null item.')
  5389. if (!this.wouldInterrupt())
  5390. return void A.warn(
  5391. 'Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.'
  5392. )
  5393. if (this.player.mode === c.TRANSITIONING)
  5394. return void A.debug(
  5395. 'Director.redirectToItem() -> Cannot redirect while transitioning.'
  5396. )
  5397. A.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t)
  5398. var i = function () {
  5399. s.setTimeout(
  5400. function () {
  5401. this.setDestinationItem(e),
  5402. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  5403. }.bind(this),
  5404. 0
  5405. )
  5406. }.bind(this)
  5407. this.interrupt(g.END, 0), this.updateSuccessFunction(i)
  5408. }),
  5409. (n.prototype.useSpecialTransition = function (e) {
  5410. void 0 !== e &&
  5411. this.defaultWarpStyle !== u.BLACK &&
  5412. A.debug('useSpecialTransition(): ' + e),
  5413. (this.nextWarpStyle = u.BLACK)
  5414. }),
  5415. (n.prototype.resetSpecialTransition = function () {
  5416. this.nextWarpStyle = this.defaultWarpStyle
  5417. }),
  5418. (n.prototype.arrivedAtDestination = function (e) {
  5419. if (this.player.flying || this.player.isWarping())
  5420. A.warn('Cannot advance to interlude or aiming while player is flying or warping.')
  5421. else {
  5422. this.transitionStage = y.Aiming
  5423. var t = this.tourIsPlaying
  5424. ? this.tourInterlude.bind(this, this.nextItem(this.currentItem))
  5425. : null
  5426. this.player.model.fadePanoMarkers(0),
  5427. this.awaitCompletion(
  5428. function () {
  5429. this.resetSpecialTransition(),
  5430. e
  5431. ? this.player.aimTourCamera(
  5432. this.destinationItem,
  5433. v.Retain,
  5434. v.Slow,
  5435. this.actionComplete.bind(this)
  5436. )
  5437. : this.actionComplete()
  5438. }.bind(this),
  5439. t
  5440. )
  5441. }
  5442. }),
  5443. (n.prototype.goToDestination = function (e, t, i, n) {
  5444. //音频
  5445. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  5446. // zeg 手动导览不播放音频
  5447. if (musicInfo && musicInfo.music && !e) {
  5448. let musicType = localStorage.getItem('xunirole') || 'male'
  5449. let isMale = musicType.indexOf('female') < 0
  5450. let fixMusic = isMale ? musicInfo.music : musicInfo.fmusic || musicInfo.music
  5451. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  5452. let src = fixMusic
  5453. let audioObj = SoundManager.list.find(e => e.name == 'tour')
  5454. let audioSrc1 = common.getFileNameFromUrl(audioObj.src)
  5455. let audioSrc2 = common.getFileNameFromUrl(src)
  5456. if (audioSrc1 == audioSrc2) {
  5457. //应该是继续播放该folder
  5458. if (this.destinationItem[1] == 0) {
  5459. //从头开始播放 因为可能暂停后然后再点该缩略图播
  5460. SoundManager.play('tour', null, 0) // currentTime = 0;
  5461. } else if (
  5462. audioObj.audio.paused &&
  5463. audioObj.audio.currentTime < audioObj.audio.duration
  5464. ) {
  5465. //未播完
  5466. SoundManager.play('tour') //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  5467. }
  5468. } else {
  5469. //很可能是该folder的起始
  5470. SoundManager.play('tour', manage.dealURL(src))
  5471. }
  5472. }
  5473. let oldPos = this.player.position.clone()
  5474. let oldPano = this.player.currentPano
  5475. if (
  5476. ((this.onTheBus = !0),
  5477. this.emit('update.controls'),
  5478. this.player.updateLastView(),
  5479. !n && this.atDestinationPano())
  5480. ) {
  5481. /*
  5482. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  5483. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5484. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  5485. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5486. } */
  5487. return void this.arrivedAtDestination(!0)
  5488. }
  5489. if (this.player.flying || this.player.isWarping())
  5490. A.warn('Cannot go to new destination while player is flying or warping.')
  5491. else {
  5492. var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
  5493. o = null,
  5494. a1 = null
  5495. if (r.isPano()) {
  5496. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  5497. //var walk = window.DATA.black ? 'black' : 'walk';
  5498. //若是点击item,直接瞬间过渡。
  5499. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  5500. if (this.destinationItem[0] == 0 && this.destinationItem[1] == 0)
  5501. s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  5502. ;(a1 = this.player.warpToPanoByHeroIndex.bind(
  5503. this.player,
  5504. this.destinationItem,
  5505. v.Show,
  5506. m.Slow,
  5507. s,
  5508. true,
  5509. i,
  5510. this.actionComplete.bind(this)
  5511. )),
  5512. (o = this.arrivedAtDestination.bind(this, !0))
  5513. if (s == 'black' && r.zoom && r.zoom != this.player.zoomLevel) {
  5514. //add
  5515. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5516. }
  5517. } else {
  5518. ;(a1 = this.player.warpToNonPanoByHeroIndex.bind(
  5519. this.player,
  5520. this.destinationItem,
  5521. this.actionComplete.bind(this)
  5522. )),
  5523. (o = this.arrivedAtDestination.bind(this, !1))
  5524. }
  5525. ;(this.transitionStage = y.Moving),
  5526. this.model.fadePanoMarkers(0),
  5527. this.awaitCompletion(
  5528. function () {
  5529. a1()
  5530. }.bind(this),
  5531. o
  5532. ),
  5533. this.emit('update.controls')
  5534. }
  5535. }),
  5536. (n.prototype.tourInterlude = function () {
  5537. if (
  5538. (h.trackAlways('reach_highlight', {
  5539. reach_source: this.reachSource
  5540. }),
  5541. this.model.fadePanoMarkers(0),
  5542. this.emit('update.controls'),
  5543. this.tourIsPlaying)
  5544. )
  5545. return this.atEndOfTour() && !this.endlessLoop
  5546. ? ((this.tourInProgress = !1),
  5547. void this.awaitCompletion(
  5548. function () {
  5549. ;(this.transitionStage = y.Interlude),
  5550. this.player.tourInterlude(
  5551. this.nextItem(this.currentItem),
  5552. this.actionComplete.bind(this)
  5553. )
  5554. }.bind(this),
  5555. function () {
  5556. ;(this.currentItem = [0, 0]), this.stopTour(true), this.emit(p.TourEnd)
  5557. }.bind(this)
  5558. ),
  5559. void (
  5560. this.player.mode === c.PANORAMA &&
  5561. this.model.fadePanoMarkers(a.panorama.markerOpacity)
  5562. ))
  5563. : void this.awaitCompletion(
  5564. function () {
  5565. ;(this.transitionStage = y.Interlude),
  5566. this.player.tourInterlude(
  5567. this.nextItem(this.currentItem),
  5568. this.actionComplete.bind(this)
  5569. )
  5570. }.bind(this),
  5571. this.goNext.bind(this)
  5572. )
  5573. }),
  5574. (n.prototype.findNearestItem = function (endToStart = true) {
  5575. //找到离currentPano最近的导览
  5576. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  5577. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  5578. } */
  5579. //注:没有判断此刻是否在panorama模式,就使用currentPano
  5580. var result = { item: [0, 0], dis: Infinity }
  5581. var compare = (location, item) => {
  5582. if (location.panoId != void 0 && location.panoId != 'outside') {
  5583. var pano = this.model.panos.index[location.panoId]
  5584. var dis = pano.position.distanceTo(this.player.currentPano.position)
  5585. if (dis < result.dis) {
  5586. ;(result.item = item), (result.dis = dis)
  5587. } else if (dis == result.dis) {
  5588. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  5589. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  5590. result.item = item, result.dis = dis
  5591. } */
  5592. if (
  5593. this.currentItem &&
  5594. Math.abs(item[0] - this.currentItem[0]) <
  5595. Math.abs(result.item[0] - this.currentItem[0])
  5596. ) {
  5597. ;(result.item = item), (result.dis = dis)
  5598. }
  5599. }
  5600. }
  5601. }
  5602. this.model.heroLocations.forEach((e, i) => {
  5603. if (e.heroLocations) {
  5604. /* e.heroLocations.forEach((a,j)=>{
  5605. compare(a, [i,j])
  5606. }) */
  5607. var location = e.heroLocations.find(e => e.panoId != void 0)
  5608. location && compare(location, [i, 0]) //跳到此区域开头
  5609. } else {
  5610. compare(e, [i, 0])
  5611. }
  5612. })
  5613. if (endToStart && this.atEndOfTour(result.item)) {
  5614. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  5615. return [0, 0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  5616. }
  5617. return result.item
  5618. })
  5619. n.prototype.playTour = function () {
  5620. if (!this.bounceable() && this.model.heroLocations.length) {
  5621. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  5622. // if(!this.currentItem) this.currentItem = []
  5623. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  5624. // // zeg 从当前pano进行自动导览
  5625. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  5626. // // this.model.heroLocations.forEach( (value, index) => {
  5627. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  5628. // // currentPanoDestinations.push(index)
  5629. // // }
  5630. // // })
  5631. // if(!currentPanoDestinations) {
  5632. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  5633. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  5634. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  5635. // for(var i = 0; i < neighbourIndex.length; i++) {
  5636. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  5637. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  5638. // }
  5639. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  5640. // }
  5641. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  5642. // this.currentItem[0] = currentPanoDestinations[0]
  5643. // }
  5644. // }
  5645. return this.tourIsPlaying
  5646. ? void A.info('tour is already playing')
  5647. : void (
  5648. this.wouldInterrupt() ||
  5649. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5650. (this.tourInProgress = !0),
  5651. (this.reachSource = 'play'),
  5652. (this.tourIsPlaying = !0),
  5653. (this.wasZoomEnabled = this.player.zoomEnabled),
  5654. (this.player.zoomEnabled = !1),
  5655. this.resetSpecialTransition(),
  5656. this.emit('update.controls'),
  5657. this.emit(p.TourStart),
  5658. this.player.enablePreRendering(),
  5659. // this.currentItem[1] = null,
  5660. this.walkingSectionPaused
  5661. ? (this.clearWalkingSectionPaused(), this.goToDestination())
  5662. : /* this.goNext() */ (this.tourAdvance(0), this.goToDestination()))
  5663. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  5664. }
  5665. }
  5666. ;(n.prototype.playTourNearBy = function () {
  5667. //就近导览
  5668. if (!this.bounceable()) {
  5669. return this.tourIsPlaying
  5670. ? void A.info('tour is already playing')
  5671. : void (
  5672. this.wouldInterrupt() ||
  5673. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5674. (this.tourInProgress = !0),
  5675. (this.reachSource = 'play'),
  5676. (this.tourIsPlaying = !0),
  5677. (this.wasZoomEnabled = this.player.zoomEnabled),
  5678. (this.player.zoomEnabled = !1),
  5679. this.resetSpecialTransition(),
  5680. this.emit('update.controls'),
  5681. this.emit(p.TourStart),
  5682. this.player.enablePreRendering(),
  5683. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  5684. this.goToDestination()) : this.goNext())) */
  5685. this.setDestinationItem(this.findNearestItem()),
  5686. this.goToDestination())
  5687. )
  5688. }
  5689. }),
  5690. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5691. } */
  5692. (n.prototype.stopTour = function (isAutoStop) {
  5693. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5694. SoundManager.pause('tour'), // zeg 自动导览暂停时同时停止语音
  5695. this.isInterrupted() ||
  5696. (this.transitionStage === y.Moving &&
  5697. this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  5698. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5699. (this.tourIsPlaying = !1),
  5700. this.interrupt(),
  5701. this.clearWalkingSectionPaused(),
  5702. this.resetSpecialTransition(),
  5703. this.emit('update.controls'))
  5704. }),
  5705. (n.prototype.endTourProgress = function () {
  5706. ;(this.tourInProgress = !1), this.emit('update.controls'), this.emit(p.TourEnd)
  5707. }),
  5708. (n.prototype.goToHighlight = function (e) {
  5709. if (this.wouldInterrupt())
  5710. this.itemCompare(this.destinationItem, e, 'equal')
  5711. ? this.interrupt()
  5712. : this.redirectToItem(e, 'goToHighlight')
  5713. else {
  5714. if ((A.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return
  5715. this.clearWalkingSectionPaused(),
  5716. this.setDestinationItem(e),
  5717. this.useSpecialTransition('Hilight')
  5718. this.goToDestination(true), //add true
  5719. h.trackAlways('reach_highlight', {
  5720. reach_source: 'thumb'
  5721. })
  5722. }
  5723. }),
  5724. (n.prototype.prevHighlight = function () {
  5725. this.bounceable() ||
  5726. (this.player.emit('tour_manual', 'prev'),
  5727. this.interrupt(g.BEGINNING) ||
  5728. this.isInterrupted() ||
  5729. (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()))
  5730. }),
  5731. (n.prototype.nextHighlight = function () {
  5732. this.bounceable() ||
  5733. (this.player.emit('tour_manual', 'next'),
  5734. this.interrupt(g.BEGINNING) ||
  5735. this.isInterrupted() ||
  5736. (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()))
  5737. }),
  5738. (n.prototype.changeMode = function (e) {
  5739. var t = $.Deferred(),
  5740. i = t.resolve.bind(t),
  5741. n = t.reject.bind(t)
  5742. this.emit(p.StartModeChange)
  5743. var r = function () {
  5744. return (
  5745. this.clearWalkingSectionPaused(),
  5746. !!this.wouldInterrupt() && (this.interrupt(), !0)
  5747. )
  5748. }.bind(this)
  5749. if (!r()) {
  5750. switch (e) {
  5751. case c.PANORAMA:
  5752. this.player.mode === c.PANORAMA
  5753. ? this.player.currentPano.isAligned() ||
  5754. this.player.goToLastView(!0).done(i).fail(n)
  5755. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n)
  5756. break
  5757. case c.DOLLHOUSE:
  5758. case c.FLOORPLAN:
  5759. this.player
  5760. .flyToNewMode({
  5761. mode: e
  5762. })
  5763. .done(i)
  5764. .fail(n)
  5765. break
  5766. case c.OUTDOOR:
  5767. this.player.model.has360Views &&
  5768. (this.player.mode !== c.PANORAMA ||
  5769. (this.player.mode === c.PANORAMA && this.player.currentPano.isAligned())) &&
  5770. this.player.goToLastView(!1).done(i).fail(n)
  5771. }
  5772. return t.promise()
  5773. }
  5774. }),
  5775. (n.prototype.atEndOfTour = function (currentItem = this.currentItem) {
  5776. var end = currentItem && currentItem[0] >= this.nItems - 1
  5777. if (end) {
  5778. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations
  5779. if (heroLocations) {
  5780. end = currentItem[1] >= heroLocations.length - 1
  5781. }
  5782. }
  5783. return end
  5784. }),
  5785. (n.prototype.firstDestination = function () {
  5786. //return 0 < this.nItems ? 0 : null
  5787. return 0 < this.nItems ? [0, 0] : null
  5788. }),
  5789. (n.prototype.finalDestination = function () {
  5790. //return 0 < this.nItems ? this.nItems - 1 : null
  5791. return 0 < this.nItems ? [this.nItems - 1, 0] : null
  5792. }),
  5793. (n.prototype.goPrev = function () {
  5794. this.tourAdvance(-1)
  5795. }),
  5796. (n.prototype.goNext = function () {
  5797. this.tourAdvance(1)
  5798. }),
  5799. (n.prototype.setDestinationItem = function (e) {
  5800. ;(this.destinationItem = e), this.emit('update.controls')
  5801. }),
  5802. (n.prototype.setCurrentItem = function (e) {
  5803. ;(this.currentItem = e), this.emit('update.controls')
  5804. }),
  5805. (n.prototype.nextItem = function (currentItem) {
  5806. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5807. if (currentItem == void 0) return this.firstDestination()
  5808. var currentLocation = this.model.heroLocations[currentItem[0]]
  5809. var currentChildNum = currentLocation.heroLocations
  5810. ? currentLocation.heroLocations.length
  5811. : 1
  5812. var item
  5813. if (this.currentItem[1] >= currentChildNum - 1) {
  5814. //子目录中最后一个
  5815. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5816. } else {
  5817. item = [currentItem[0], currentItem[1] + 1]
  5818. }
  5819. if (item[0] >= this.nItems) {
  5820. item = this.firstDestination()
  5821. }
  5822. return item
  5823. //暂时不理会endlessLoop,默认为false
  5824. }),
  5825. (n.prototype.prevItem = function (currentItem) {
  5826. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5827. if (currentItem == void 0) return this.firstDestination()
  5828. var item
  5829. var lastLocation = this.model.heroLocations[currentItem[0] - 1]
  5830. if (!lastLocation)
  5831. return this.finalDestination() //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5832. else {
  5833. var lastChildNum = lastLocation.heroLocations
  5834. ? lastLocation.heroLocations.length
  5835. : 1
  5836. if (this.currentItem[1] == 0) {
  5837. //子目录中第一个
  5838. return [currentItem[0] - 1, lastChildNum - 1]
  5839. } else {
  5840. return [currentItem[0], currentItem[1] - 1]
  5841. }
  5842. }
  5843. }),
  5844. (n.prototype.tourAdvance = function (e) {
  5845. //e是1或-1 或 0
  5846. A.debug('tourAdvance(' + e + ')')
  5847. // // zeg改
  5848. if (null === this.currentItem || void 0 === this.currentItem) {
  5849. // this.setDestinationItem(this.firstDestination())
  5850. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5851. this.setDestinationItem([this.currentItem[0], 0])
  5852. }
  5853. // else if(this.currentItem[1] == null) {
  5854. // this.setDestinationItem([this.currentItem[0], 0])
  5855. // }
  5856. else {
  5857. var item = this.currentItem
  5858. if (e == 1) {
  5859. item = this.nextItem(this.currentItem)
  5860. } else if (e == -1) {
  5861. item = this.prevItem(this.currentItem)
  5862. }
  5863. this.setDestinationItem(item)
  5864. }
  5865. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')) {
  5866. this.useSpecialTransition('reverse-looping to end')
  5867. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  5868. this.useSpecialTransition('looping back to start')
  5869. }
  5870. /* var momentTour = this.getMomentTour(this.destinationItem);
  5871. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5872. var zoomLevel = this.player.zoomLevel;
  5873. this.player.zoomEnabled = true;
  5874. var zoom = function(e, d) {
  5875. this.player.zoomTo((1-e)*zoomLevel, true)
  5876. }.bind(this)
  5877. s.start(zoom, 1500, function(){
  5878. }, 0, d.easeOutQuad, "zoom")
  5879. } */
  5880. this.goToDestination()
  5881. }),
  5882. (n.prototype.getMomentTour = function (destinationItem) {
  5883. //add
  5884. var wholeMomentTour = window.DATA.momentTour || 'walk' //最外层 还有一种是'std'
  5885. if (!destinationItem) return wholeMomentTour
  5886. else {
  5887. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem) //最内层。 如果有使用最内层
  5888. if (currentLocation.momentTour) return currentLocation.momentTour
  5889. var currentLocation_ = this.model.heroLocations[destinationItem[0]]
  5890. return currentLocation_.momentTour || wholeMomentTour //若中间层或最内层有就使用,否则使用最外层
  5891. }
  5892. }),
  5893. (t.exports = n)
  5894. }).call(this, '/js/director.js')
  5895. },
  5896. {
  5897. './analytics': 4,
  5898. './enum/BlackoutStyle': 18,
  5899. './enum/ControlEvents': 21,
  5900. './enum/DirectorEvents': 23,
  5901. './enum/ModelManagerEvents': 33,
  5902. './enum/PathDiscardMode': 38,
  5903. './enum/PathDisplayMode': 39,
  5904. './enum/PlayerEvents': 40,
  5905. './enum/Viewmode': 51,
  5906. './enum/WarpStyle': 52,
  5907. './model/ModelManager': 140,
  5908. './player': 155,
  5909. './settings': 166,
  5910. './util/logger': 189,
  5911. './util/transitions': 195,
  5912. events: 202,
  5913. three: 217
  5914. }
  5915. ],
  5916. 16: [
  5917. function (e, t, i) {
  5918. 'use strict'
  5919. var n = e('three'),
  5920. r = e('./enum/Viewmode'),
  5921. o = (e('./settings'), e('./util/transitions')),
  5922. a = e('./enum/PlayerEvents'),
  5923. s = new n.ShaderPass(n.HorizontalBlurShader),
  5924. l = new n.ShaderPass(n.VerticalBlurShader)
  5925. l.renderToScreen = !0
  5926. var c = $('#player').width() / $('#player').height()
  5927. isNaN(c) && (c = 1)
  5928. var h = {
  5929. currentBlur: 0,
  5930. aspect: c,
  5931. blurStrength: 1,
  5932. hblurPass: s,
  5933. vblurPass: l,
  5934. fastTranMaskPass: new n.TransitionPass(),
  5935. bindEvents: function (e) {
  5936. e.on(a.ModeChanged, function (e, t) {
  5937. e === r.PANORAMA &&
  5938. (o.cancel(h.blur),
  5939. o.cancel(h.addBlur),
  5940. o.start(h.removeBlur, 500, null, 0, null, 'deblur'))
  5941. })
  5942. },
  5943. blur: function (e) {
  5944. h.currentBlur = e
  5945. var t = e * h.blurStrength
  5946. ;(l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512)
  5947. },
  5948. addBlur: function (e) {
  5949. ;(e = Math.max(e, h.currentBlur)), h.blur(e)
  5950. },
  5951. removeBlur: function (e) {
  5952. ;(e = Math.min(1 - e, h.currentBlur)), h.blur(e)
  5953. }
  5954. }
  5955. h.blur(0), (t.exports = h)
  5956. },
  5957. {
  5958. './enum/PlayerEvents': 40,
  5959. './enum/Viewmode': 51,
  5960. './settings': 166,
  5961. './util/transitions': 195,
  5962. three: 217
  5963. }
  5964. ],
  5965. 17: [
  5966. function (e, t, i) {
  5967. 'use strict'
  5968. t.exports = {
  5969. UNKNOWN: 0,
  5970. ALIGNED: 1,
  5971. UNALIGNED: 2,
  5972. PLACED: 3
  5973. }
  5974. },
  5975. {}
  5976. ],
  5977. 18: [
  5978. function (e, t, i) {
  5979. 'use strict'
  5980. t.exports = {
  5981. NONE: 0,
  5982. MIDDLE: 1,
  5983. END: 2,
  5984. BEGINNING: 3,
  5985. FADEIN: 4
  5986. }
  5987. },
  5988. {}
  5989. ],
  5990. 19: [
  5991. function (e, t, i) {
  5992. 'use strict'
  5993. var n = e('three')
  5994. t.exports = {
  5995. newBlue: new n.Color(4967932),
  5996. altBlue: new n.Color(47355),
  5997. tagDefault: new n.Color(223357),
  5998. classicBlue: new n.Color(53759),
  5999. mpYellow: new n.Color(16502016),
  6000. mpOrange: new n.Color(16428055),
  6001. mpBlue: new n.Color(12096),
  6002. mpLtGrey: new n.Color(13751252),
  6003. mpDkGrey: new n.Color(10000019),
  6004. mpRed: new n.Color(12525854),
  6005. mpOrangeDesat: new n.Color(16764529),
  6006. mpBlueDesat: new n.Color(4034734),
  6007. mpRedDesat: new n.Color(14705505),
  6008. white: new n.Color(16777215),
  6009. black: new n.Color(0),
  6010. _desat: function (e, t) {
  6011. var i = t || 0.3,
  6012. r = new n.Color().copy(e).getHSL()
  6013. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l)
  6014. },
  6015. _darken: function (e, t) {
  6016. var i = t || 0.2,
  6017. r = e.getHSL()
  6018. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i))
  6019. }
  6020. }
  6021. },
  6022. {
  6023. three: 217
  6024. }
  6025. ],
  6026. 20: [
  6027. function (e, t, i) {
  6028. 'use strict'
  6029. t.exports = {
  6030. NONE: -1,
  6031. ROTATE: 0,
  6032. DOLLY: 1,
  6033. PAN: 2,
  6034. ROTATE_DOLLY: 3,
  6035. PAN_DOLLY: 4
  6036. }
  6037. },
  6038. {}
  6039. ],
  6040. 21: [
  6041. function (e, t, i) {
  6042. 'use strict'
  6043. t.exports = {
  6044. Move: 'move',
  6045. InteractionDirect: 'interaction.direct',
  6046. InteractionKey: 'interaction.key',
  6047. InteractionGui: 'interaction.gui',
  6048. FlyInDirection: 'fly.direction',
  6049. InputStart: 'input.start',
  6050. Pinch: 'input.pinch',
  6051. Scroll: 'input.scroll',
  6052. AutoPanInterrupt: 'autopan.interrupt',
  6053. AutoPanComplete: 'autopan.complete',
  6054. AutoPanClamped: 'autopan.clamped',
  6055. LongTap: 'longtap'
  6056. }
  6057. },
  6058. {}
  6059. ],
  6060. 22: [
  6061. function (e, t, i) {
  6062. 'use strict'
  6063. t.exports = Object.freeze({
  6064. FORWARD: 'FORWARD',
  6065. LEFT: 'LEFT',
  6066. RIGHT: 'RIGHT',
  6067. BACK: 'BACK',
  6068. UP: 'UP',
  6069. DOWN: 'DOWN'
  6070. })
  6071. },
  6072. {}
  6073. ],
  6074. 23: [
  6075. function (e, t, i) {
  6076. 'use strict'
  6077. t.exports = {
  6078. ActionInterrupted: 'action.interrupted',
  6079. TourStart: 'tour.start',
  6080. TourEnd: 'tour.end',
  6081. StartModeChange: 'mode.startChange'
  6082. }
  6083. },
  6084. {}
  6085. ],
  6086. 24: [
  6087. function (e, t, i) {
  6088. 'use strict'
  6089. t.exports = Object.freeze({
  6090. None: 0,
  6091. Queued: 1,
  6092. ForceQueued: 2,
  6093. Downloading: 3,
  6094. Downloaded: 4,
  6095. DownloadFailed: 5
  6096. })
  6097. },
  6098. {}
  6099. ],
  6100. 25: [
  6101. function (e, t, i) {
  6102. 'use strict'
  6103. t.exports = {
  6104. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  6105. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  6106. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  6107. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  6108. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  6109. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  6110. }
  6111. },
  6112. {}
  6113. ],
  6114. 26: [
  6115. function (e, t, i) {
  6116. 'use strict'
  6117. t.exports = {
  6118. Texture2D: 0,
  6119. TextureCube: 1
  6120. }
  6121. },
  6122. {}
  6123. ],
  6124. 27: [
  6125. function (e, t, i) {
  6126. 'use strict'
  6127. t.exports = {
  6128. SMALL: 'small',
  6129. LARGE: 'large'
  6130. }
  6131. },
  6132. {}
  6133. ],
  6134. 28: [
  6135. function (e, t, i) {
  6136. 'use strict'
  6137. var n = e('./Viewmode'),
  6138. r = {
  6139. LANDING: {},
  6140. NAVIGATION: 'navigation',
  6141. MORE_HELP: 'moreHelp',
  6142. TOUR_INTERACTION: {}
  6143. }
  6144. ;(r.LANDING[n.PANORAMA] = 'panorama.landing'),
  6145. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  6146. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  6147. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  6148. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  6149. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  6150. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  6151. (t.exports = r)
  6152. },
  6153. {
  6154. './Viewmode': 51
  6155. }
  6156. ],
  6157. 29: [
  6158. function (e, t, i) {
  6159. 'use strict'
  6160. var n = {
  6161. UP: 1,
  6162. DOWN: -1,
  6163. LEFT: 'L',
  6164. RIGHT: 'R',
  6165. FORWARD: 'F',
  6166. BACK: 'B',
  6167. reverse: {},
  6168. opposite: function (e) {
  6169. return this.reverse[e.toString()]
  6170. }
  6171. }
  6172. !(function () {
  6173. ;(n.reverse[n.UP] = n.DOWN),
  6174. (n.reverse[n.DOWN] = n.UP),
  6175. (n.reverse[n.LEFT] = n.RIGHT),
  6176. (n.reverse[n.RIGHT] = n.LEFT),
  6177. (n.reverse[n.FORWARD] = n.BACK),
  6178. (n.reverse[n.BACK] = n.FORWARD)
  6179. })(),
  6180. (t.exports = n)
  6181. },
  6182. {}
  6183. ],
  6184. 30: [
  6185. function (e, t, i) {
  6186. 'use strict'
  6187. var n = e('../util/browser'),
  6188. r = {
  6189. ZERO: 48,
  6190. ONE: 49,
  6191. TWO: 50,
  6192. THREE: 51,
  6193. FOUR: 52,
  6194. FIVE: 53,
  6195. SIX: 54,
  6196. SEVEN: 55,
  6197. EIGHT: 56,
  6198. NINE: 57,
  6199. LEFTARROW: 37,
  6200. UPARROW: 38,
  6201. RIGHTARROW: 39,
  6202. DOWNARROW: 40,
  6203. A: 65,
  6204. B: 66,
  6205. C: 67,
  6206. D: 68,
  6207. E: 69,
  6208. F: 70,
  6209. G: 71,
  6210. H: 72,
  6211. I: 73,
  6212. J: 74,
  6213. K: 75,
  6214. L: 76,
  6215. M: 77,
  6216. N: 78,
  6217. O: 79,
  6218. P: 80,
  6219. Q: 81,
  6220. R: 82,
  6221. S: 83,
  6222. T: 84,
  6223. U: 85,
  6224. V: 86,
  6225. W: 87,
  6226. X: 88,
  6227. Y: 89,
  6228. Z: 90,
  6229. SPACE: 32,
  6230. RETURN: 13,
  6231. SEMICOLON: 186,
  6232. PLUSEQUALS: 187,
  6233. DASHUNDERSCORE: 189,
  6234. OPENBRACKET: 219
  6235. }
  6236. n.detectFirefox() && ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)),
  6237. (t.exports = r)
  6238. },
  6239. {
  6240. '../util/browser': 182
  6241. }
  6242. ],
  6243. 31: [
  6244. function (e, t, i) {
  6245. 'use strict'
  6246. t.exports = {
  6247. EN_US: 'en-US',
  6248. ES_MX: 'es-MX',
  6249. FR_FR: 'fr-FR',
  6250. DE_DE: 'de-DE',
  6251. RU_RU: 'ru-RU',
  6252. CN_CN: 'cn-CN',
  6253. JP_JP: 'jp-JP'
  6254. }
  6255. },
  6256. {}
  6257. ],
  6258. 32: [
  6259. function (e, t, i) {
  6260. 'use strict'
  6261. t.exports = {
  6262. TagActivated: 'tag.activated',
  6263. TagDismissed: 'tag.dismissed',
  6264. TagNavigation: 'tag.navigation'
  6265. }
  6266. },
  6267. {}
  6268. ],
  6269. 33: [
  6270. function (e, t, i) {
  6271. 'use strict'
  6272. t.exports = {
  6273. ModelAdded: 'model-added',
  6274. ActiveModelChanged: 'active-model-changed'
  6275. }
  6276. },
  6277. {}
  6278. ],
  6279. 34: [
  6280. function (e, t, i) {
  6281. 'use strict'
  6282. t.exports = {
  6283. LEFT: 0,
  6284. MIDDLE: 1,
  6285. RIGHT: 2
  6286. }
  6287. },
  6288. {}
  6289. ],
  6290. 35: [
  6291. function (e, t, i) {
  6292. 'use strict'
  6293. t.exports = {
  6294. PanoRenderComplete: 'panorama.render.complete',
  6295. TileRenderFailure: 'panorama.tile.render.failed',
  6296. TileRenderSuccess: 'panorama.tile.render.success',
  6297. TileUploadAttempted: 'panorama.tile.upload.attempted',
  6298. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  6299. ZoomLevelRenderStarted: 'panorama.zoom.render.started'
  6300. }
  6301. },
  6302. {}
  6303. ],
  6304. 36: [
  6305. function (e, t, i) {
  6306. 'use strict'
  6307. t.exports = {
  6308. BASE: 1,
  6309. STANDARD: 2,
  6310. HIGH: 3,
  6311. ULTRAHIGH: 4
  6312. }
  6313. },
  6314. {}
  6315. ],
  6316. 37: [
  6317. function (e, t, i) {
  6318. 'use strict'
  6319. t.exports = {
  6320. LoadComplete: 'panorama.load.complete',
  6321. LoadFailed: 'panorama.load.failed',
  6322. TileLoaded: 'panorama.tile.loaded'
  6323. }
  6324. },
  6325. {}
  6326. ],
  6327. 38: [
  6328. function (e, t, i) {
  6329. 'use strict'
  6330. t.exports = Object.freeze({
  6331. Standard: 0,
  6332. Slow: 1,
  6333. Retain: 2
  6334. })
  6335. },
  6336. {}
  6337. ],
  6338. 39: [
  6339. function (e, t, i) {
  6340. 'use strict'
  6341. t.exports = Object.freeze({
  6342. Show: 0,
  6343. Hide: 1,
  6344. Retain: 2
  6345. })
  6346. },
  6347. {}
  6348. ],
  6349. 40: [
  6350. function (e, t, i) {
  6351. 'use strict'
  6352. t.exports = {
  6353. Move: 'move',
  6354. MoveComplete: 'move.complete',
  6355. ModeChanged: 'mode.changed',
  6356. ModeChanging: 'mode.changing',
  6357. PanoChosen: 'pano.chosen',
  6358. ClosestPanoChanging: 'closest.pano.changing',
  6359. WarpStarted: 'warp.started',
  6360. WarpInterrupted: 'warp.interrupted',
  6361. WarpEnded: 'warp.ended',
  6362. FlyinFinished: 'flyin.finished',
  6363. FlyingStarted: 'flying.started',
  6364. FlyingInterrupted: 'flying.interrupted',
  6365. FlyingEnded: 'flying.ended',
  6366. Ready: 'ready',
  6367. StartInside: 'start.inside',
  6368. StartOutside: 'start.outside',
  6369. ViewChanged: 'view.changed',
  6370. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  6371. InputStart: 'input.start'
  6372. }
  6373. },
  6374. {}
  6375. ],
  6376. 41: [
  6377. function (e, t, i) {
  6378. 'use strict'
  6379. t.exports = Object.freeze({
  6380. DEFAULT: 0,
  6381. PANOMARKERS: 1,
  6382. RETICULE: 2,
  6383. TAG: 3
  6384. })
  6385. },
  6386. {}
  6387. ],
  6388. 42: [
  6389. function (e, t, i) {
  6390. 'use strict'
  6391. t.exports = {
  6392. visibleFloor: 1,
  6393. ghostFloor: 3,
  6394. boundingSkybox: 1,
  6395. panoMarker: 2,
  6396. reticule: 3,
  6397. tagStem: 4,
  6398. tagDisc: 5,
  6399. ribbon: 100
  6400. }
  6401. },
  6402. {}
  6403. ],
  6404. 43: [
  6405. function (e, t, i) {
  6406. 'use strict'
  6407. t.exports = {
  6408. ContextCreated: 'scene-renderer-context-created',
  6409. AfterRender: 'after-render',
  6410. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated'
  6411. }
  6412. },
  6413. {}
  6414. ],
  6415. 44: [
  6416. function (e, t, i) {
  6417. 'use strict'
  6418. t.exports = {
  6419. IDLE: 'idle',
  6420. BROWSE: 'browse',
  6421. EXAMINE: 'examine'
  6422. }
  6423. },
  6424. {}
  6425. ],
  6426. 45: [
  6427. function (e, t, i) {
  6428. 'use strict'
  6429. t.exports = {
  6430. TileDownloadSuccess: 'tiledownloader.download.success',
  6431. TileDownloadFailure: 'tiledownloader.download.failure',
  6432. PanoDownloadComplete: 'tiledownloader.pano.download.complete'
  6433. }
  6434. },
  6435. {}
  6436. ],
  6437. 46: [
  6438. function (e, t, i) {
  6439. 'use strict'
  6440. t.exports = {
  6441. CardboardAndroid: 'googlevr',
  6442. GearVR: 'gearvr',
  6443. CardboardIOS: 'googlevrios',
  6444. Cardboard: 'googlevr'
  6445. }
  6446. },
  6447. {}
  6448. ],
  6449. 47: [
  6450. function (e, t, i) {
  6451. 'use strict'
  6452. t.exports = {
  6453. NONE: 0,
  6454. CONTEXTUAL: 1,
  6455. ANDROID: 2
  6456. }
  6457. },
  6458. {}
  6459. ],
  6460. 48: [
  6461. function (e, t, i) {
  6462. 'use strict'
  6463. var n = {
  6464. Title: 0,
  6465. Cardboard: 1
  6466. },
  6467. r = {
  6468. Title: 0,
  6469. Cardboard: 1,
  6470. Gear: 2
  6471. }
  6472. !(function () {
  6473. ;[n, r].forEach(function (e) {
  6474. e.pageCount = Object.keys(e).length
  6475. })
  6476. })(),
  6477. (t.exports.ios = n),
  6478. (t.exports.standard = r)
  6479. },
  6480. {}
  6481. ],
  6482. 49: [
  6483. function (e, t, i) {
  6484. 'use strict'
  6485. t.exports = {
  6486. Android: 'android',
  6487. IOS: 'ios',
  6488. Desktop: 'desktop',
  6489. UnsupportedAndroid: 'android-unsupported'
  6490. }
  6491. },
  6492. {}
  6493. ],
  6494. 50: [
  6495. function (e, t, i) {
  6496. 'use strict'
  6497. var n = e('three')
  6498. t.exports = {
  6499. UP: new n.Vector3(0, 1, 0),
  6500. DOWN: new n.Vector3(0, -1, 0),
  6501. LEFT: new n.Vector3(-1, 0, 0),
  6502. RIGHT: new n.Vector3(1, 0, 0),
  6503. FORWARD: new n.Vector3(0, 0, -1),
  6504. BACK: new n.Vector3(0, 0, 1)
  6505. }
  6506. },
  6507. {
  6508. three: 217
  6509. }
  6510. ],
  6511. 51: [
  6512. function (e, t, i) {
  6513. 'use strict'
  6514. var n = e('../exception/ViewmodeConvertException'),
  6515. r = e('./coreViewmodes'),
  6516. o = e('../util/common'),
  6517. a = {
  6518. MESH: 'mesh',
  6519. OUTDOOR: 'outdoor',
  6520. TRANSITIONING: 'transitioning',
  6521. toInt: function (e) {
  6522. switch (e) {
  6523. case this.PANORAMA:
  6524. return 1
  6525. case this.DOLLHOUSE:
  6526. return 2
  6527. case this.FLOORPLAN:
  6528. return 3
  6529. case this.OUTDOOR:
  6530. return 4
  6531. case this.TRANSITIONING:
  6532. return -1
  6533. }
  6534. throw new n('No known conversion for Viewmode to int for mode: ' + e)
  6535. },
  6536. fromInt: function (e) {
  6537. switch (e) {
  6538. case '1':
  6539. case 1:
  6540. return this.PANORAMA
  6541. case '2':
  6542. case 2:
  6543. return this.DOLLHOUSE
  6544. case '3':
  6545. case 3:
  6546. return this.FLOORPLAN
  6547. case '4':
  6548. case 4:
  6549. return this.OUTDOOR
  6550. }
  6551. throw new n('No known conversion for int to viewmode for int: ' + e)
  6552. },
  6553. convertWorkshopModeInt: function (e) {
  6554. switch (e) {
  6555. case '0':
  6556. case 0:
  6557. case undefined: //xzw add
  6558. return this.PANORAMA
  6559. case '1':
  6560. case 1:
  6561. return this.FLOORPLAN
  6562. case '2':
  6563. case 2:
  6564. return this.DOLLHOUSE
  6565. case '3':
  6566. case 3:
  6567. return this.MESH
  6568. }
  6569. throw new n('No known conversion for Workshop int to viewmode for int: ' + e)
  6570. }
  6571. }
  6572. o.extendObject(a, r), (t.exports = a)
  6573. },
  6574. {
  6575. '../exception/ViewmodeConvertException': 58,
  6576. '../util/common': 185,
  6577. './coreViewmodes': 54
  6578. }
  6579. ],
  6580. 52: [
  6581. function (e, t, i) {
  6582. 'use strict'
  6583. t.exports = {
  6584. BLACK: 'black',
  6585. STD: 'std',
  6586. WALK: 'walk'
  6587. }
  6588. },
  6589. {}
  6590. ],
  6591. 53: [
  6592. function (e, t, i) {
  6593. 'use strict'
  6594. t.exports = {
  6595. ZoomIn: 'zoom.in',
  6596. ZoomOut: 'zoom.out',
  6597. ZoomMax: 'zoom.max',
  6598. ZoomMin: 'zoom.min'
  6599. }
  6600. },
  6601. {}
  6602. ],
  6603. 54: [
  6604. function (e, t, i) {
  6605. 'use strict'
  6606. t.exports = {
  6607. PANORAMA: 'panorama',
  6608. DOLLHOUSE: 'dollhouse',
  6609. FLOORPLAN: 'floorplan'
  6610. }
  6611. },
  6612. {}
  6613. ],
  6614. 55: [
  6615. function (e, t, i) {
  6616. 'use strict'
  6617. function n(e) {
  6618. this.message = e
  6619. }
  6620. t.exports = n
  6621. },
  6622. {}
  6623. ],
  6624. 56: [
  6625. function (e, t, i) {
  6626. 'use strict'
  6627. function n(e) {
  6628. r.call(this, e)
  6629. }
  6630. var r = e('./BasicException')
  6631. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  6632. },
  6633. {
  6634. './BasicException': 55
  6635. }
  6636. ],
  6637. 57: [
  6638. function (e, t, i) {
  6639. 'use strict'
  6640. function n(e) {
  6641. r.call(this, e)
  6642. }
  6643. var r = e('./BasicException')
  6644. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  6645. },
  6646. {
  6647. './BasicException': 55
  6648. }
  6649. ],
  6650. 58: [
  6651. function (e, t, i) {
  6652. 'use strict'
  6653. function n(e) {
  6654. r.call(this, e)
  6655. }
  6656. var r = e('./BasicException')
  6657. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  6658. },
  6659. {
  6660. './BasicException': 55
  6661. }
  6662. ],
  6663. 59: [
  6664. function (e, t, i) {
  6665. ;(function (i) {
  6666. 'use strict'
  6667. function n(e) {
  6668. var t = {}
  6669. if (e) {
  6670. var i = e.flags
  6671. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0)
  6672. return t
  6673. }
  6674. return l.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null
  6675. }
  6676. var r = e('./util/ajax'),
  6677. o = e('./util/showcase'),
  6678. a = e('./util/logger'),
  6679. s = '',
  6680. l = new a(i),
  6681. c = {}
  6682. t.exports = {
  6683. loadFeatureFlags: function (e) {
  6684. var t = $.Deferred()
  6685. return (
  6686. r
  6687. .get(e.urlBase + s, {
  6688. responseType: 'json',
  6689. prefetchFrom: 'user',
  6690. auth: o.getAuthorizationHeader()
  6691. })
  6692. .done(function (e) {
  6693. ;(c = n(e)), c ? t.resolve(c) : t.reject('loading-failed')
  6694. })
  6695. .fail(function () {
  6696. l.debug('Retrieval of feature flags failed.'), t.reject('loading-failed')
  6697. }),
  6698. t.promise()
  6699. )
  6700. },
  6701. getFlags: function () {
  6702. return c
  6703. },
  6704. updateDependentSettings: function (e, t) {
  6705. ;(e = e || c),
  6706. e.labels && (t.labels.enabled = !0),
  6707. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  6708. e.showcase_sdk && (t.sdkInit = !0),
  6709. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  6710. e.showcase_webvr && (t.vr.allowWebVR = !0),
  6711. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  6712. e.hide_sc_sharing && (t.share.enabled = !1)
  6713. }
  6714. }
  6715. }).call(this, '/js/featureflags.js')
  6716. },
  6717. {
  6718. './util/ajax': 181,
  6719. './util/logger': 189,
  6720. './util/showcase': 193
  6721. }
  6722. ],
  6723. 60: [
  6724. function (e, t, i) {
  6725. 'use strict'
  6726. var n =
  6727. (e('../util/common'),
  6728. {
  6729. status: 0,
  6730. set: function (e) {
  6731. if (isNaN(e)) return !1
  6732. var t = $('.progressbar')
  6733. 0 > e && (e = 0)
  6734. e > 100 && (e = 100)
  6735. var width = parseInt(t.css('width').replace('px', '')) / 100 //获取进度条总长度除以100
  6736. var barperc = e * width
  6737. var perc = Math.round(e)
  6738. var labelpos = parseInt(barperc) - 15
  6739. t.find('.bar').css('width', barperc) //已经再跑颜色的百分比
  6740. t.find('.label').css('left', labelpos) //上面跟着的字的百分比
  6741. t.find('.perc').text(perc + '%') //具体数字的百分比
  6742. this.status = e
  6743. },
  6744. done: function (e) {
  6745. return e || this.status ? ((this.status = null), this.set(100)) : this
  6746. }
  6747. })
  6748. t.exports.circleLoader = n
  6749. },
  6750. {
  6751. '../util/common': 185
  6752. }
  6753. ],
  6754. 61: [
  6755. function (e, t, i) {
  6756. 'use strict'
  6757. t.exports = Object.freeze({
  6758. CLOSE: 'modal.closer.close'
  6759. })
  6760. },
  6761. {}
  6762. ],
  6763. 62: [
  6764. function (e, t, i) {
  6765. 'use strict'
  6766. function n(e, t) {
  6767. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(l.CLOSE, e), g.reset()
  6768. }
  6769. function r(e, t) {
  6770. function i() {
  6771. var t = e.offsetHeight >= $('#player').height() && e.offsetWidth >= $('#player').width()
  6772. t !== f &&
  6773. ((f = t),
  6774. t
  6775. ? (e.classList.add('closeByFooter'), h.classList.add('closeByFooter'))
  6776. : (e.classList.remove('closeByFooter'), h.classList.remove('closeByFooter')))
  6777. }
  6778. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6779. }
  6780. var o = e('../../settings'),
  6781. a = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  6782. s = e('../../util/common'),
  6783. l = e('./ModalCloserEvent'),
  6784. c = e('events').EventEmitter,
  6785. h = document.getElementsByClassName('footer')[0],
  6786. u = h.querySelectorAll('.close')[0],
  6787. d = null,
  6788. p = null,
  6789. f = null,
  6790. g =
  6791. (a.isMobile(),
  6792. {
  6793. open: function (e) {
  6794. e &&
  6795. (r(e),
  6796. d && u.removeEventListener('click', d, !0),
  6797. (d = n.bind(this, e.id)),
  6798. u.addEventListener('click', d, !0),
  6799. p && window.removeEventListener('resize', p, !0),
  6800. (p = r.bind(this, e)),
  6801. window.addEventListener('resize', p, !0))
  6802. },
  6803. reset: function () {
  6804. h.classList.remove('closeByFooter'),
  6805. u.removeEventListener('click', d, !0),
  6806. window.removeEventListener('resize', p, !0),
  6807. (d = p = f = null)
  6808. }
  6809. })
  6810. s.extendObject(g, c.prototype), (t.exports = g)
  6811. },
  6812. {
  6813. '../../tag/Media/MediaEvent': 131,
  6814. '../../settings': 166,
  6815. '../../util/browser': 182,
  6816. '../../util/common': 185,
  6817. './ModalCloserEvent': 61,
  6818. events: 202
  6819. }
  6820. ],
  6821. 63: [
  6822. function (e, t, i) {
  6823. 'use strict'
  6824. function n(e, t, i) {
  6825. var n = new r.GUI({
  6826. width: 400
  6827. }),
  6828. u = n.addFolder('Flydown from Dollhouse')
  6829. u.add(h.flydown, 'movementEasing', Object.keys(a)),
  6830. u.add(h.flydown, 'movementDelay', 0, 1).step(0.01),
  6831. u.add(h.flydown, 'rotationEasing', Object.keys(a)),
  6832. u.add(h.flydown, 'rotationDelay', 0, 1).step(0.01),
  6833. u.add(h.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  6834. u.add(h.flydown, 'skyboxDelay', 0, 1).step(0.01),
  6835. u.add(h.dollhouseDefault, 'minPolarAngle', 0, o.Math.degToRad(50)),
  6836. u.add(h.dollhouseDefault, 'maxPolarAngle', o.Math.degToRad(50), o.Math.degToRad(170))
  6837. var d = n.addFolder('Transition between panos')
  6838. d.add(h.transition, 'blur', 0, 10).onFinishChange(function () {}),
  6839. d
  6840. .add(h.transition, 'flySpeed', 0, 10)
  6841. .step(0.01)
  6842. .onFinishChange(function () {
  6843. ;(h.transition.flyTime = 0),
  6844. d.__controllers.forEach(function (e) {
  6845. e.updateDisplay()
  6846. })
  6847. }),
  6848. d.add(h.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  6849. ;(h.transition.flySpeed = 0),
  6850. d.__controllers.forEach(function (e) {
  6851. e.updateDisplay()
  6852. })
  6853. }),
  6854. d.add(h.transition, 'aimTime', 500, 2500).step(50),
  6855. d.add(h.transition, 'aimSlowFactor', 1, 3).step(0.1),
  6856. d.add(h.transition, 'movementEasing', Object.keys(a))
  6857. var p = n.addFolder('Path Display')
  6858. p
  6859. .add(h.path, 'opacity', 0, 1)
  6860. .step(0.01)
  6861. .onFinishChange(function () {}),
  6862. p
  6863. .add(h.path, 'height', 0, 0.2)
  6864. .step(0.01)
  6865. .onFinishChange(function () {}),
  6866. p
  6867. .add(h.path, 'outsideHeight', 0, 2)
  6868. .step(0.01)
  6869. .onFinishChange(function () {}),
  6870. p
  6871. .add(h.path, 'ribbonWidth', 0.01, 0.35)
  6872. .step(0.01)
  6873. .onFinishChange(function () {}),
  6874. p
  6875. .add(h.path, 'waypointRadius', 0.01, 1.2)
  6876. .step(0.01)
  6877. .onFinishChange(function () {}),
  6878. p
  6879. .add(h.path, 'waypointPulse', 0, 3600)
  6880. .step(20)
  6881. .onFinishChange(function () {}),
  6882. p
  6883. .add(h.path, 'waypointIndoorRadius', 0.01, 1.2)
  6884. .step(0.01)
  6885. .onFinishChange(function () {}),
  6886. p
  6887. .add(h.path, 'fadeInTime', 0, 1200)
  6888. .step(10)
  6889. .onFinishChange(function () {}),
  6890. p
  6891. .add(h.path, 'fadeOutTime', 0, 1200)
  6892. .step(10)
  6893. .onFinishChange(function () {}),
  6894. p.add(h.path, 'color', Object.keys(l)).onFinishChange(function () {
  6895. ;(h.path.color = l[h.path.color]),
  6896. (h.path.colorUp = l._desat(h.path.color)),
  6897. (h.path.colorDown = l.darken(h.path.color))
  6898. }),
  6899. p.add(h, 'reticuleColor', Object.keys(l)).onFinishChange(function () {
  6900. h.reticuleColor = l[h.reticuleColor]
  6901. })
  6902. var f = n.addFolder('Warping'),
  6903. g = f.addFolder('Warp/Teleport')
  6904. g.add(h.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  6905. g
  6906. .add(h.warp, 'softPushEnd', 0, 1)
  6907. .step(0.01)
  6908. .onFinishChange(function () {}),
  6909. g.add(h.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  6910. g.add(h.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  6911. g
  6912. .add(h.warp, 'softBendEnd', 0, 1)
  6913. .step(0.01)
  6914. .onFinishChange(function () {}),
  6915. g.add(h.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  6916. g.add(h.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  6917. g.add(h.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  6918. g
  6919. .add(h.warp, 'minBrakeAngle', 0, 5)
  6920. .step(0.01)
  6921. .onFinishChange(function () {}),
  6922. g
  6923. .add(h.warp, 'maxBrakeAngle', 0, 5)
  6924. .step(0.01)
  6925. .onFinishChange(function () {}),
  6926. g.add(h.path, 'mapGuides').onFinishChange(function () {}),
  6927. g
  6928. .add(h.warp, 'teleportTime', 0, 5e3)
  6929. .step(10)
  6930. .onFinishChange(function () {}),
  6931. g
  6932. .add(h.warp, 'outsideTime', 0, 5e3)
  6933. .step(10)
  6934. .onFinishChange(function () {}),
  6935. g.add(h.path, 'typ', Object.keys(c)).onFinishChange(function () {
  6936. h.path.typ = c[h.path.typ]
  6937. }),
  6938. g
  6939. .add(h.warp, 'loop')
  6940. .onChange(function () {})
  6941. .onFinishChange(function () {
  6942. t.endlessLoop = h.warp.loop
  6943. }),
  6944. g
  6945. .add(h.warp, 'walkSlideShowThreshhold', 1, 1e4)
  6946. .step(1)
  6947. .onFinishChange(function () {}),
  6948. g
  6949. .add(h.warp, 'walkExtraPanosDistance', 0, 3)
  6950. .step(0.1)
  6951. .onFinishChange(function () {}),
  6952. g
  6953. .add(h.transition, 'fastForwardFactor', 1, 10)
  6954. .step(1)
  6955. .onFinishChange(function () {})
  6956. var m = f.addFolder('Long Warp Only')
  6957. m
  6958. .add(h.warp, 'minWarpTime', 0, 5e3)
  6959. .step(10)
  6960. .onFinishChange(function () {
  6961. ;(h.warp.flySpeed = 0),
  6962. m.__controllers.forEach(function (e) {
  6963. e.updateDisplay()
  6964. })
  6965. }),
  6966. m
  6967. .add(h.warp, 'timePerMeter', 0, 5e3)
  6968. .step(10)
  6969. .onFinishChange(function () {}),
  6970. m
  6971. .add(h.warp, 'lookAheadMax', 0.01, 1)
  6972. .step(0.01)
  6973. .onFinishChange(function () {}),
  6974. m
  6975. .add(h.warp, 'lookAheadDist', 0.01, 4)
  6976. .step(0.01)
  6977. .onFinishChange(function () {}),
  6978. m
  6979. .add(h.warp, 'maxTurnPerSec', 0, 720)
  6980. .step(1)
  6981. .onFinishChange(function () {}),
  6982. m
  6983. .add(h.warp, 'maxAimPerSec', 0, 720)
  6984. .step(1)
  6985. .onFinishChange(function () {}),
  6986. m
  6987. .add(h.warp, 'turnFriction', 0, 1)
  6988. .step(0.01)
  6989. .onFinishChange(function () {}),
  6990. m
  6991. .add(h.warp, 'walkDelay', 0, 2e3)
  6992. .step(10)
  6993. .onFinishChange(function () {}),
  6994. m
  6995. .add(h.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  6996. .step(10)
  6997. .onFinishChange(function () {}),
  6998. m
  6999. .add(h.warp, 'walkMaxDist', 0, 100)
  7000. .step(1)
  7001. .onFinishChange(function () {})
  7002. var v = n.addFolder('Warp Esoterica')
  7003. v
  7004. .add(h.warp, 'nearPanoDist', 0.01, 12)
  7005. .step(0)
  7006. .onFinishChange(function () {}),
  7007. v.add(h.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  7008. v
  7009. .add(h.warp, 'flySpeed', 0, 10)
  7010. .step(0.01)
  7011. .onFinishChange(function () {
  7012. ;(h.warp.minWarpTime = 0),
  7013. v.__controllers.forEach(function (e) {
  7014. e.updateDisplay()
  7015. })
  7016. }),
  7017. v.add(h.warp, 'showBunny').onFinishChange(function () {}),
  7018. v
  7019. .add(h.warp, 'fastTime', 0, 2500)
  7020. .step(10)
  7021. .onFinishChange(function () {}),
  7022. v.add(h.warp, 'movementEasing', Object.keys(a))
  7023. var A = n.addFolder('Misc')
  7024. A.add(h, 'dollhouseFOV', 10, 180).onChange(function () {
  7025. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  7026. }),
  7027. A.add(h, 'insideFOV', 10, 180).onChange(function () {
  7028. i.cameras[s.PANORAMA].fov = h.insideFOV
  7029. }),
  7030. A.add(h, 'insideLookSpeed', 0.01, 0.3)
  7031. .step(0.01)
  7032. .onChange(function () {}),
  7033. A.add(h, 'rotationAccelerationInside', 0.1, 10)
  7034. .step(0.1)
  7035. .onChange(function () {}),
  7036. A.add(h, 'rotationAccelerationOutside', 0.1, 10)
  7037. .step(0.1)
  7038. .onChange(function () {})
  7039. var y = n.addFolder('Navigation')
  7040. y.add(h.navigation, 'panoScores').onFinishChange(function () {
  7041. h.navigation.panoScores ||
  7042. e.panos.forEach(function (e) {
  7043. e.floor.remove(e.text3d), (e.text3d = null)
  7044. })
  7045. }),
  7046. y.add(h.navigation, 'mouseDirection'),
  7047. y.add(h.navigation, 'filterStrictness', 0, 1),
  7048. y.add(h.navigation, 'angleFactor', -60, 0),
  7049. y.add(h.navigation, 'directionFactor', 1, 20),
  7050. y.add(h.navigation, 'distanceFactor', -5, 5),
  7051. y.add(h.navigation, 'optionalityFactor', 0.1, 10)
  7052. var C = n.addFolder('tags'),
  7053. I = C.addFolder('Tag Creation')
  7054. I.add(h.tags.pole, 'enabled').name('poleEnabled'),
  7055. I.add(h.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  7056. I.add(h.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  7057. I.add(h.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity')
  7058. var E = C.addFolder('Visibility')
  7059. E.add(h.tags.visibility, 'anyDistance'),
  7060. E.add(h.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  7061. E.add(h.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  7062. E.add(h.tags.visibility, 'hideViaFloor'),
  7063. E.add(h.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  7064. E.add(h.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject')
  7065. var b = C.addFolder('Disc Parameters')
  7066. b.add(h.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  7067. b.add(h.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  7068. b.add(h.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  7069. e &&
  7070. (h.tags.disc.scale.farBound =
  7071. h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  7072. }),
  7073. b
  7074. .add(h.tags.disc.scale, 'linkPercent', 0, 100)
  7075. .step(1)
  7076. .onChange(function (e) {
  7077. h.tags.disc.scale.linkFarBound &&
  7078. (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  7079. }),
  7080. b.add(h.tags.disc.scale, 'maxSize', 40, 200).step(1),
  7081. b.add(h.tags.disc.scale, 'minSize', 20, 100).step(1),
  7082. b.add(h.tags.disc.scale, 'responsiveness', 0, 100).step(1)
  7083. var w = C.addFolder('Navigate')
  7084. w.add(h.tags.navigate, 'nearestPano').name('nearestPano'),
  7085. w.add(h.tags.navigate, 'lineOfSight').name('lineOfSight'),
  7086. w.add(h.tags.navigate, 'reactivate').name('reactivate'),
  7087. w.add(h.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  7088. w.add(h.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  7089. w.add(h.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1)
  7090. var _ = n.addFolder('Debug')
  7091. _.add(h, 'wireframe').onFinishChange(function () {
  7092. e.chunks.forEach(function (t) {
  7093. t.material &&
  7094. (t.wireframeTwin ||
  7095. ((t.wireframeTwin = new o.WireframeHelper(t)),
  7096. (t.wireframeTwin.material.depthWrite = !1),
  7097. (t.wireframeTwin.material.depthTest = !1),
  7098. (t.wireframeTwin.material.opacity = 0.5),
  7099. (t.wireframeTwin.material.transparent = !0)),
  7100. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  7101. })
  7102. }),
  7103. _.add(h, 'skyboxWireframe').onFinishChange(function () {
  7104. h.skyboxWireframe
  7105. ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)),
  7106. e.add(e.skybox.wireframe))
  7107. : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null))
  7108. }),
  7109. _.add(h, 'showSweeps').onFinishChange(function () {
  7110. e.setSweepVisibility(h.showSweeps)
  7111. }),
  7112. _.add(h, 'showMesh').onFinishChange(function () {
  7113. e.chunks.forEach(function (e) {
  7114. e.visible = h.showMesh
  7115. })
  7116. }),
  7117. _.add(h, 'showFloors').onFinishChange(function () {
  7118. e.floors.forEach(function (e) {
  7119. e.collider.children.forEach(function (e) {
  7120. e.material.visible = h.showFloors
  7121. })
  7122. })
  7123. }),
  7124. _.add(h, 'showSkyboxes').onFinishChange(function () {
  7125. e.panos.forEach(function (e) {
  7126. e.skyboxMesh.visible = h.showSkyboxes
  7127. })
  7128. }),
  7129. _.add(h, 'showNeighbors').onChange(function () {}),
  7130. _.add(e, 'alpha', 0, 1)
  7131. }
  7132. var r = e('../lib/dat.gui'),
  7133. o = e('three'),
  7134. a = e('../util/easing'),
  7135. s = e('../enum/Viewmode'),
  7136. l = e('../enum/Colors'),
  7137. c = e('../enum/WarpStyle'),
  7138. h = e('../settings')
  7139. e('../tag/tag')
  7140. ;(r.GUI.prototype.removeFolder = function (e) {
  7141. var t = this.__folders[e]
  7142. t &&
  7143. (t.close(),
  7144. this.__ul.removeChild(t.domElement.parentNode),
  7145. delete this.__folders[e],
  7146. this.onResize())
  7147. }),
  7148. (t.exports.toggle = n)
  7149. },
  7150. {
  7151. '../enum/Colors': 19,
  7152. '../enum/Viewmode': 51,
  7153. '../enum/WarpStyle': 52,
  7154. '../lib/dat.gui': 93,
  7155. '../tag/tag': 123,
  7156. '../settings': 166,
  7157. '../util/easing': 186,
  7158. three: 217
  7159. }
  7160. ],
  7161. 64: [
  7162. function (e, t, i) {
  7163. ;(function (i) {
  7164. 'use strict'
  7165. function n(e, t, i, n) {
  7166. $('.gui-error .error-problem-text').text(e),
  7167. $('.gui-error .error-solution-text').text(t),
  7168. $('.gui-error .error-explanation').text(i),
  7169. $('.gui-error .error-actions').html(n),
  7170. $(window).resize(),
  7171. $('.gui-error').fadeIn(),
  7172. $('#bottom-logo').fadeIn()
  7173. }
  7174. function r(e) {
  7175. var t = [
  7176. '<div class="browser-tiles">',
  7177. '<div class="tile">',
  7178. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  7179. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  7180. 'rel="tiletip" title="Chrome"></a>',
  7181. '</div>',
  7182. '<div class="tile">',
  7183. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  7184. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  7185. 'rel="tiletip" title="Firefox"></a>',
  7186. '</div>',
  7187. '<div class="tile">',
  7188. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  7189. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  7190. 'rel="tiletip" title="Internet Explorer"></a>',
  7191. '</div>',
  7192. '<div class="tile">',
  7193. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  7194. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  7195. 'rel="tiletip" title="Safari"></a>',
  7196. '</div>',
  7197. '</div>'
  7198. ].join('')
  7199. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  7200. s.isMobile() ||
  7201. $('[rel=tiletip]').tooltip({
  7202. placement: 'bottom',
  7203. delay: {
  7204. show: 50,
  7205. hide: 0
  7206. },
  7207. trigger: 'hover',
  7208. viewport: {
  7209. selector: 'body',
  7210. padding: 10
  7211. }
  7212. })
  7213. }
  7214. function o() {
  7215. var e = s.isMobile()
  7216. ? ''
  7217. : '<span class="link install-browser">' +
  7218. h.ERROR_GENERIC_ACTIONS_2 +
  7219. '</span>' +
  7220. h.ERROR_GENERIC_ACTIONS_3,
  7221. t = [h.ERROR_GENERIC_ACTIONS_1, e].join('')
  7222. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
  7223. s.isMobile() ||
  7224. $('.install-browser').on('click touchstart', function (e) {
  7225. e.preventDefault(), e.stopPropagation(), r(' ')
  7226. })
  7227. }
  7228. function a(e) {
  7229. if (
  7230. ($('head title').text(c.pageTitle),
  7231. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  7232. $('#gui-loading').fadeOut(250),
  7233. $('#quick-blackout').hide(),
  7234. l.track('showcase_error', {
  7235. error_key: e
  7236. }),
  7237. h.locale || h.init(),
  7238. 'webgl-unsupported' === e)
  7239. )
  7240. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM)
  7241. else if ('webgl-ios' === e)
  7242. n(
  7243. h.ERROR_WEBGL_IOS_PROBLEM,
  7244. h.ERROR_WEBGL_IOS_SOLUTION,
  7245. '',
  7246. h.ERROR_WEBGL_IOS_ACTIONS_1 +
  7247. '<strong>' +
  7248. h.ERROR_WEBGL_IOS_ACTIONS_2 +
  7249. '</strong>.'
  7250. )
  7251. else if ('webgl-safari' === e)
  7252. n(
  7253. h.ERROR_WEBGL_SAFARI_PROBLEM,
  7254. '',
  7255. '',
  7256. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  7257. '<strong>' +
  7258. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  7259. '</strong>. ' +
  7260. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  7261. '<strong>' +
  7262. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  7263. '</strong>.'
  7264. )
  7265. else if ('webgl-generic' === e) o()
  7266. else if ('missing-urls' === e)
  7267. n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION)
  7268. else if ('loading-failed' === e)
  7269. n(
  7270. h.ERROR_LOADING_FAILED_PROBLEM,
  7271. '',
  7272. '',
  7273. h.ERROR_LOADING_FAILED_ACTIONS_1 +
  7274. '<a class="link" target="_blank" href=' +
  7275. p +
  7276. '>' +
  7277. h.ERROR_LOADING_FAILED_ACTIONS_2 +
  7278. '</a>.'
  7279. )
  7280. else {
  7281. if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e)
  7282. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  7283. }
  7284. }
  7285. var s = e('./../util/browser'),
  7286. l = e('./../analytics'),
  7287. c = e('./../settings'),
  7288. h = e('../localization/localize'),
  7289. u = e('./../util/logger'),
  7290. d = new u(i),
  7291. p = '"https://support.port.com/hc/articles/208220058"'
  7292. t.exports.error = a
  7293. }).call(this, '/js/gui/error.js')
  7294. },
  7295. {
  7296. '../localization/localize': 108,
  7297. './../analytics': 4,
  7298. './../settings': 166,
  7299. './../util/browser': 182,
  7300. './../util/logger': 189
  7301. }
  7302. ],
  7303. 65: [
  7304. function (e, t, i) {
  7305. ;(function (i) {
  7306. 'use strict'
  7307. function n() {
  7308. ;(Ue = []),
  7309. je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'),
  7310. Ue.push('.hideTarget', '.pinTop.right')
  7311. }
  7312. function r() {
  7313. for (var e in je)
  7314. if (je.hasOwnProperty(e)) {
  7315. var t = je[e]
  7316. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
  7317. }
  7318. je.highlight.visible && $('.pinBottom').addClass('highlightExists'),
  7319. je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'),
  7320. n()
  7321. }
  7322. function o(e, t) {
  7323. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying
  7324. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i)
  7325. }
  7326. function a() {
  7327. c(),
  7328. $('.pinBottom').toggleClass('open'),
  7329. $('#drawer').toggleClass('open'),
  7330. $('.footer').toggleClass('open'),
  7331. $('#drawer').hasClass('open')
  7332. ? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS),
  7333. Ze('highlights'))
  7334. : ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS),
  7335. ie.resetDrawer()),
  7336. setTimeout(
  7337. function () {
  7338. $('#pullTab').toggleClass('opened')
  7339. },
  7340. $('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
  7341. ),
  7342. $('.pinBottom').hasClass('open') &&
  7343. s($('.vr-popup')) &&
  7344. $('.vr-popup').is(':visible') &&
  7345. Ae.dismiss()
  7346. }
  7347. function s(e) {
  7348. var t
  7349. 'none' !== e.css('display')
  7350. ? (t = e.position().top + e.outerHeight())
  7351. : (e.attr('style', 'visibility: hidden'),
  7352. (t = e.position().top + e.outerHeight()),
  7353. e.attr('style', 'display: none'))
  7354. var i = $('#player').outerHeight(),
  7355. n = i - 130
  7356. return n < t + 25
  7357. }
  7358. function l(e) {
  7359. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation()
  7360. }
  7361. function c() {
  7362. W && (W.reload(), W.init())
  7363. }
  7364. function h(e) {
  7365. ne.show(e), r()
  7366. }
  7367. function u(e) {
  7368. ne.progress(e)
  7369. }
  7370. function d(e, t, i) {
  7371. var n = t.player
  7372. $('#gui-thumb').fadeOut(2500),
  7373. ne.hide(function () {
  7374. Ge = !1
  7375. }),
  7376. me.init(e, i),
  7377. de.finishSetup(Object.keys(e.tags).length),
  7378. i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'))
  7379. var s = function () {
  7380. i.dismissExaminedTag(), i.disableHovering()
  7381. }
  7382. Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s)
  7383. var l = i.enableHovering.bind(i)
  7384. if (
  7385. (Ae.on(ye.CLOSED, l),
  7386. Ce.on(Me.CLOSED, l),
  7387. he.on(ue.CLOSED, l),
  7388. fe.on(ge.CLOSED, l),
  7389. Q.labels.enabled && Object.keys(e.labels).length,
  7390. e.floors.length <= 1 || !je.floors.visible
  7391. ? (je.floors.visible = !1)
  7392. : (y(e, t), C(e.currentFloor, n.mode)),
  7393. getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
  7394. r(),
  7395. o(t, t.player),
  7396. $('#gui').fadeIn(1500),
  7397. je.highlight.visible &&
  7398. (2 !== Q.startHighlights || e.has360Views) &&
  7399. setTimeout(function () {
  7400. a(),
  7401. ((!e.has360Views && 1 !== Q.startHighlights) ||
  7402. (e.has360Views && 0 === Q.startHighlights)) &&
  7403. setTimeout(a, 2e3)
  7404. }, 2e3),
  7405. !K.isMobile())
  7406. )
  7407. for (
  7408. var c = [
  7409. 'a',
  7410. '#title-toggle',
  7411. '.next-button',
  7412. '.prev-button',
  7413. '.gui-floor',
  7414. '.meta-toggle',
  7415. '.thumbImg',
  7416. 'logo-button'
  7417. ],
  7418. h = 0;
  7419. h < c.length;
  7420. h++
  7421. )
  7422. $(c[h]).addClass('hasHover')
  7423. O(e), de.setupToggling()
  7424. //xzw:
  7425. window.editHotPanel && editHotPanel()
  7426. //czj
  7427. navBorderRadius(e)
  7428. //czj 编辑界面
  7429. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  7430. window.EditTools && new EditTools(n.sceneRenderer)
  7431. }
  7432. function navBorderRadius(e) {
  7433. var pullTab = $('#pullTab'),
  7434. mobileRadius = {
  7435. bottom: {
  7436. 'border-bottom-left-radius': '10px',
  7437. 'border-bottom-right-radius': '10px'
  7438. },
  7439. top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' }
  7440. },
  7441. topRadius = {
  7442. bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
  7443. top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' }
  7444. }
  7445. function BorderRadius(bottom, top) {
  7446. $('#gui-modes-map > div:visible:last').css(bottom)
  7447. if (pullTab.is(':visible')) {
  7448. $('.viewContainer > div:visible:first').css(top)
  7449. } else {
  7450. $('#gui-modes-map > div:visible:first').css(top)
  7451. }
  7452. }
  7453. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  7454. BorderRadius(mobileRadius.bottom, mobileRadius.top)
  7455. } else {
  7456. BorderRadius(topRadius.bottom, topRadius.top)
  7457. }
  7458. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  7459. if (window.DATA.model.special || window.DATA.special) {
  7460. window.specialScene && specialScene.special().afterImplement()
  7461. }
  7462. }
  7463. function p(e) {
  7464. e || (e = 0),
  7465. (We = !1),
  7466. window.setTimeout(
  7467. function () {
  7468. We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show())
  7469. }.bind(this),
  7470. e
  7471. )
  7472. }
  7473. function f() {
  7474. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1)
  7475. }
  7476. function g(e, t) {
  7477. var i = e.mode,
  7478. n = t || e.currentPano
  7479. $('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
  7480. $('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
  7481. $('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
  7482. i === _e.PANORAMA
  7483. ? ($('#view-controllers').slideUp(500),
  7484. Q.show360Views.enabled && !n.isAligned()
  7485. ? ($('.gui-floor').addClass('hidden'),
  7486. $('#gui-modes-outside').addClass('desktop-only'))
  7487. : ($('.gui-floor').removeClass('hidden'),
  7488. $('#gui-modes-outside').removeClass('desktop-only')),
  7489. $('#gui-modes-outside').removeClass('hidden'))
  7490. : i !== _e.TRANSITIONING &&
  7491. (f(),
  7492. (Be = i),
  7493. $('#gui-modes-outside').addClass('hidden'),
  7494. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  7495. $('#view-controllers').is(':visible') ||
  7496. $('#view-controllers').slideDown(Q.guiAnimationSpeed))
  7497. }
  7498. function m(e, t) {
  7499. var i = t.player
  7500. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  7501. l(e),
  7502. J.updateInteraction(Se.InteractionGui, 'inside-button'),
  7503. J.track('USER', {
  7504. event_type: 'showcase_gui',
  7505. gui_action: 'click_inside_mode_button'
  7506. }),
  7507. t.changeMode(_e.PANORAMA)
  7508. }),
  7509. $('#gui-modes-outside')
  7510. .find('a')
  7511. .on('click', function (e) {
  7512. l(e),
  7513. J.track('showcase_gui', {
  7514. gui_action: 'click_outside_mode_button'
  7515. }),
  7516. t.changeMode(Be)
  7517. }),
  7518. $('#gui-modes-floorplan').on('click', function (e) {
  7519. l(e),
  7520. i.mode !== _e.FLOORPLAN &&
  7521. (J.track('showcase_gui', {
  7522. gui_action: 'click_floorplan_mode_button'
  7523. }),
  7524. t.changeMode(_e.FLOORPLAN))
  7525. }),
  7526. $('#gui-modes-dollhouse').on('click', function (e) {
  7527. l(e),
  7528. i.mode !== _e.DOLLHOUSE &&
  7529. (J.track('showcase_gui', {
  7530. gui_action: 'click_dollhouse_mode_button'
  7531. }),
  7532. t.changeMode(_e.DOLLHOUSE))
  7533. })
  7534. }
  7535. function v(e, t) {
  7536. function i() {
  7537. document.getElementById('vr').classList.remove('hidden'),
  7538. Q.vr.allowWebVR
  7539. ? K.getVRDisplay().then(
  7540. function (e) {
  7541. K.supportsFullscreen()
  7542. ? n(e)
  7543. : (De.warn('Unable to use WebVR when full screen is not supported'),
  7544. $('.improper-embed').toggleClass('hidden', !1),
  7545. r())
  7546. },
  7547. function (e) {
  7548. r()
  7549. }
  7550. )
  7551. : r()
  7552. }
  7553. function n(i) {
  7554. De.info(i.displayName + ' detected, VR button activates WebVR experience'),
  7555. Ie.init(e.data, t, i, q),
  7556. Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')),
  7557. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  7558. }
  7559. function r() {
  7560. De.info('WebVR support not found, VR button activates native app VR modal'),
  7561. Ae.init(e.data, q),
  7562. Ae.on(
  7563. ye.OPENED,
  7564. (function () {
  7565. var e = document.getElementById('vr-modal')
  7566. return function () {
  7567. Ze('vr'), le.open(e)
  7568. }
  7569. })()
  7570. ),
  7571. Ae.on(ye.CLOSED, le.reset)
  7572. }
  7573. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
  7574. /*********************** 方奕卓 VR功能事件监听 ********************/
  7575. K.isMobile() && $('#vr').css('display', '') // 显示vr功能按钮
  7576. switch (Q.vr.option) {
  7577. case Pe.CONTEXTUAL:
  7578. i()
  7579. break
  7580. case Pe.ANDROID:
  7581. K.detectAndroid() && i()
  7582. break
  7583. case Pe.NONE:
  7584. }
  7585. }
  7586. }
  7587. function A(e, t) {
  7588. $('#play').on('mousedown touchstart', function (e) {
  7589. l(e)
  7590. Ze('tour')
  7591. ve.play()
  7592. J.trackAlways('showcase_gui', {
  7593. gui_action: 'play_highlights'
  7594. })
  7595. }),
  7596. (window.startAndPlay = function (e) {
  7597. // l(e);
  7598. Ze('tour')
  7599. ve.play()
  7600. J.trackAlways('showcase_gui', {
  7601. gui_action: 'play_highlights'
  7602. })
  7603. })
  7604. $('#pause').on('mousedown touchstart', function (e) {
  7605. l(e),
  7606. ve.pause(),
  7607. J.trackAlways('showcase_gui', {
  7608. gui_action: 'pause_highlights'
  7609. })
  7610. }),
  7611. $('#gui-zoomin')
  7612. .find('a')
  7613. .on('click', function (e) {
  7614. l(e), t.player.zoomInIncrementally()
  7615. }),
  7616. $('#gui-zoomout')
  7617. .find('a')
  7618. .on('click', function (e) {
  7619. l(e), t.player.zoomOutIncrementally()
  7620. })
  7621. }
  7622. function y(e, t) {
  7623. for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
  7624. if (getQueryVariable('m') === '372') continue
  7625. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(
  7626. e.floors.get(n).name
  7627. )
  7628. $('.gui-floor').find('.container').prepend(r)
  7629. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  7630. }
  7631. i
  7632. .find('.container')
  7633. .prepend(
  7634. '<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' +
  7635. Re.FLOOR_ALL +
  7636. '</div>'
  7637. ),
  7638. i.on('click', function (e) {
  7639. l(e), Ze('floor'), i.toggleClass('open')
  7640. }),
  7641. $('.floorChoice').on('click', function (e) {
  7642. l(e)
  7643. var n = $(this).data('index')
  7644. 'all' !== n
  7645. ? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7646. t.player.gotoFloor(n),
  7647. J.track('showcase_gui', {
  7648. gui_action: 'click_floor_select_button',
  7649. interaction_source: 'gui'
  7650. }))
  7651. : (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7652. Ze('move'),
  7653. t.allFloors(),
  7654. J.track('showcase_gui', {
  7655. gui_action: 'click_toggle_all_floors_button',
  7656. interaction_source: 'gui'
  7657. })),
  7658. i.removeClass('open')
  7659. })
  7660. }
  7661. function C(e, t) {
  7662. e &&
  7663. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  7664. ? ($('.allFloorBtn').show(),
  7665. $('.gui-floor-icon').hide(),
  7666. $('.gui-floor-title').show())
  7667. : ($('.allFloorBtn').hide(),
  7668. $('.gui-floor-icon').show(),
  7669. $('.gui-floor-title').hide()),
  7670. e.model.allFloorsVisible
  7671. ? ($('.gui-floor-title').text(Re.FLOOR_ALL),
  7672. $('.gui-floor-number').text(Re.FLOOR_ALL),
  7673. $('.floorChoice').removeClass('active'),
  7674. $('.floorChoice[data-index="all"]').addClass('active'))
  7675. : ($('.gui-floor-title').text(e.name),
  7676. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  7677. $('.floorChoice').removeClass('active'),
  7678. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')))
  7679. }
  7680. function I(e) {
  7681. return e.describe().inTransition
  7682. }
  7683. function b(e, t, i) {
  7684. Fe = e.heroLocations.length
  7685. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  7686. r = 100 / Fe + '%',
  7687. o = $('#thumb-container'),
  7688. a = $('#progressBar')
  7689. $('#status').find('.totalSteps').text(Fe)
  7690. for (var s = 0; s < Fe; s++) {
  7691. var c = e.heroLocations[s],
  7692. h = $(n)
  7693. var thumbUrl
  7694. if (c.heroLocations) {
  7695. //有子项,选第一张截图
  7696. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl) //.replace('https://','').replace('http://','')
  7697. } else {
  7698. thumbUrl = manage.dealURL(c.thumbUrl) //.replace('https://','').replace('http://','')
  7699. }
  7700. h.attr('data-index', s)
  7701. je.highlight.visible && h.find('img').attr('src', thumbUrl)
  7702. if (c.name) {
  7703. var u = $('<div class="overlay"></div>').text(c.name)
  7704. h.prepend(u)
  7705. }
  7706. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  7707. var d = e.panos.get(c.panoId),
  7708. p = d && !d.isAligned(),
  7709. f = p
  7710. ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>'
  7711. : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>'
  7712. h.prepend(f)
  7713. }
  7714. o.append(h),
  7715. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  7716. }
  7717. ;(j = 144 * Fe),
  7718. (Y = 111 * Fe),
  7719. $('.thumbImg').on('mouseover', function () {
  7720. I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]) //改
  7721. }),
  7722. $('.thumbImg').on('mouseout', function () {
  7723. t.clearPath()
  7724. }),
  7725. $('.thumbImg').on('click', function (e) {
  7726. l(e)
  7727. var i = $(this)
  7728. J.updateInteraction(Se.InteractionGui, 'thumbnail'),
  7729. J.trackAlways('showcase_gui', {
  7730. gui_action: 'click_highlight'
  7731. }),
  7732. t.goToHighlight([i.data('index'), 0]) //改
  7733. }),
  7734. $('.previous')
  7735. .find('a')
  7736. .on('click', function (e) {
  7737. l(e),
  7738. J.trackAlways('showcase_gui', {
  7739. gui_action: 'prev_highlight'
  7740. }),
  7741. t.prevHighlight()
  7742. }),
  7743. $('.next')
  7744. .find('a')
  7745. .on('click', function (e) {
  7746. l(e),
  7747. J.trackAlways('showcase_gui', {
  7748. gui_action: 'next_highlight'
  7749. }),
  7750. t.nextHighlight()
  7751. }),
  7752. $('#drawer').on('mouseleave', function (e) {
  7753. l(e)
  7754. var t
  7755. try {
  7756. t = new MouseEvent('mouseup', {
  7757. clientX: e.clientX,
  7758. clientY: e.clientY,
  7759. screenX: e.screenX,
  7760. screenY: e.screenY
  7761. })
  7762. } catch (i) {
  7763. ;(t = document.createEvent('MouseEvents')),
  7764. t.initMouseEvent(
  7765. 'mouseup',
  7766. e.bubbles,
  7767. e.cancelable,
  7768. e.view,
  7769. e.detail,
  7770. e.screenX,
  7771. e.screenY,
  7772. e.clientX,
  7773. e.clientY,
  7774. e.ctrlKey,
  7775. e.altKey,
  7776. e.shiftKey,
  7777. e.metaKey,
  7778. e.button,
  7779. e.relatedTarget
  7780. )
  7781. }
  7782. document.dispatchEvent(t)
  7783. }),
  7784. (W = new Sly($('#scrollFrame'), {
  7785. horizontal: !0,
  7786. itemNav: 'centered',
  7787. smart: !0,
  7788. scrollTrap: !0,
  7789. scrollBy: 1,
  7790. mouseDragging: !0,
  7791. touchDragging: !0,
  7792. speed: 300,
  7793. dragHandle: !0,
  7794. dynamicHandle: !0,
  7795. clickBar: !0,
  7796. scrollBar: $('#scroller'),
  7797. activateOn: null
  7798. }).init()),
  7799. W.on('active', function (e, t) {
  7800. ;(Ve = t),
  7801. Ze('tour'),
  7802. $('.step').removeClass('active'),
  7803. $('#status')
  7804. .find('.curIdx')
  7805. .text(t + 1)
  7806. for (var i = 0; i <= t; i++)
  7807. $('#progressBar')
  7808. .find("[data-idx='" + i + "']")
  7809. .addClass('active')
  7810. }),
  7811. w()
  7812. //add :
  7813. let scrollFrame = $(W.frame)
  7814. scrollFrame.on('wheel.sly', function () {
  7815. lastMoveScrollTime = Date.now()
  7816. })
  7817. let dragstart
  7818. /* scrollFrame.on("pointerdown", function() {
  7819. dragstart = true
  7820. })
  7821. scrollFrame.on("pointerup", function() {
  7822. dragstart = false
  7823. }) */
  7824. scrollFrame.on('pointermove', function () {
  7825. //if(dragstart){
  7826. lastMoveScrollTime = Date.now()
  7827. //}
  7828. })
  7829. }
  7830. function w() {
  7831. var e = $('#player').width() - 20,
  7832. t = $('#scroller'),
  7833. i = $('#drawer'),
  7834. n = $('.pinBottom')
  7835. if ($('#player').width() < 488 || $('#player').height() < 488)
  7836. t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll')
  7837. else {
  7838. var r = j > e,
  7839. o = !i.hasClass('noScroll'),
  7840. a = r !== o
  7841. a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'))
  7842. }
  7843. }
  7844. function _(e) {
  7845. je.tourControls.visible = true //e.tour_buttons && K.valueFromHash("gt", 1),
  7846. ;(je.coBrand.visible =
  7847. e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
  7848. (je.highlight.visible =
  7849. /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights)
  7850. }
  7851. function T(e) {
  7852. function t(t, i) {
  7853. return !!e.player_options[t] && e[i || t]
  7854. }
  7855. $('.model-title').text(e.name)
  7856. var i = Q.pageTitle
  7857. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7858. 2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
  7859. (document.title = i),
  7860. K.isMobile()
  7861. ? $('#gui-fullscreen').css('display', 'none')
  7862. : ($('[rel=tooltip]').tooltip({
  7863. delay: {
  7864. show: 50,
  7865. hide: 0
  7866. },
  7867. trigger: 'hover',
  7868. html: !1,
  7869. viewport: {
  7870. selector: 'body',
  7871. padding: 10
  7872. }
  7873. }),
  7874. K.inIframe() &&
  7875. document
  7876. .getElementsByClassName('pinBottom-container')[0]
  7877. .classList.add('embed')),
  7878. // 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"),
  7879. de.populate({
  7880. name: t('model_name', 'name'),
  7881. coBrand: t('presented_by'),
  7882. description: t('model_summary', 'summary') || '暂无内容',
  7883. contactName: t('contact_name'),
  7884. address: t('address'),
  7885. phone: t('contact_phone'),
  7886. formattedPhone: e.formatted_contact_phone,
  7887. email: t('contact_email'),
  7888. url: t('external_url'),
  7889. socialSharing: e.enable_social_sharing && e.is_public
  7890. })
  7891. }
  7892. function x(e, t, i, n, r, o) {
  7893. function a() {
  7894. o.setLoadingStartTime(),
  7895. H(),
  7896. r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l)
  7897. }
  7898. var s = $.Deferred(),
  7899. l = s.resolve.bind(s)
  7900. return (
  7901. (Ge = !0),
  7902. O(e),
  7903. e.data.player_options && _(e.data.player_options),
  7904. 1 === Q.specialEdition && $('body').addClass('specialEdition'),
  7905. Re.localizeGUI(),
  7906. T(e.data),
  7907. r || $('.quick').addClass('hidden'),
  7908. //e.data.image && !r && E(e.data.image),
  7909. n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
  7910. s
  7911. )
  7912. }
  7913. function S(e, t, i, n, r, a, s) {
  7914. ;(q = s),
  7915. e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  7916. e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  7917. ae.init(),
  7918. re.init(e, a),
  7919. Oe.init(e, t, n),
  7920. $('.icon').on('mouseover', function () {
  7921. t.player && t.player.reticule.hide()
  7922. }),
  7923. m(e, t),
  7924. A(e, t),
  7925. e.data.enable_social_sharing &&
  7926. e.data.is_public &&
  7927. Q.share.enabled &&
  7928. (Ce.init(window.DATA.name /* e.data.name */),
  7929. Ce.on(
  7930. Me.OPENED,
  7931. (function () {
  7932. var e = document.getElementById('share-modal')
  7933. return function () {
  7934. Ze('share'), le.open(e)
  7935. }
  7936. })()
  7937. ),
  7938. Ce.on(Me.CLOSED, le.reset)),
  7939. e.heroLocations.length > 0
  7940. ? b(e, t, i)
  7941. : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  7942. de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
  7943. z(),
  7944. g(i),
  7945. v(e, r),
  7946. e.on('floor.changed', C),
  7947. e.on('waiting', R.bind(this, e)),
  7948. e.on('waiting-done', P.bind(this, e)),
  7949. i.on(xe.ModeChanged, function (e, n) {
  7950. g(i),
  7951. o(t, i),
  7952. n === _e.PANORAMA &&
  7953. i.currentPano &&
  7954. !i.currentPano.isAligned() &&
  7955. (n = _e.OUTDOOR),
  7956. he.updateMode(n)
  7957. }),
  7958. n.on(Se.Move, Ze.bind(this, 'move')),
  7959. i.on(xe.Ready, function () {
  7960. ie.init(n, i, i.tagManager, t),
  7961. i.on(xe.ModeChanged, function (e, t) {
  7962. e !== t && $('.vr-popup').is(':visible') && Ae.dismiss()
  7963. })
  7964. }),
  7965. i.on(xe.PanoChosen, function (e, t) {
  7966. g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  7967. }),
  7968. le.on(ce.CLOSE, function (e) {
  7969. switch (e) {
  7970. case 'vr-modal':
  7971. Ae.dismiss()
  7972. break
  7973. case 'share-modal':
  7974. Ce.hide()
  7975. break
  7976. case 'terms-modal':
  7977. fe.hide()
  7978. }
  7979. })
  7980. var l = $('#play').eq(0),
  7981. c = $('#pause').eq(0),
  7982. h = $('.pinBottom').toArray(),
  7983. u = $('#drawer').eq(0),
  7984. d = $('#playHead').eq(0),
  7985. p = $('#progressBar').eq(0),
  7986. f = $('#thumb-container').eq(0),
  7987. y = f.children(),
  7988. I = p.children()
  7989. t.on('update.controls', function () {
  7990. //导览控制
  7991. var n = t.describe()
  7992. n.tourIsPlaying || i.isWarping()
  7993. ? (je.tourControls.visible && (l.hide(), c.show()),
  7994. n.tourInProgress &&
  7995. (h.forEach(function (e) {
  7996. e.classList.add('playing')
  7997. }),
  7998. u.addClass('playing'),
  7999. d.addClass('playing')))
  8000. : (je.tourControls.visible && (l.show(), c.hide()),
  8001. n.tourInProgress ||
  8002. (ve.stopTour(),
  8003. h.forEach(function (e) {
  8004. e.classList.remove('playing')
  8005. }),
  8006. u.removeClass('playing'),
  8007. d.removeClass('playing')))
  8008. var r, a, s
  8009. if (null !== n.currentItem) {
  8010. var p, f
  8011. $('#status')
  8012. .find('.curIdx')
  8013. .text(n.currentItem[0] + 1),
  8014. n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'))
  8015. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0]
  8016. /* for (r = 0; r < e.heroLocations.length; r += 1)
  8017. s = y.eq(r),
  8018. a = I.eq(r),
  8019. s.removeClass(f),
  8020. a.removeClass(f),
  8021. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  8022. a.addClass(p),
  8023. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  8024. a.addClass(p)) : (s.removeClass(p),
  8025. a.removeClass(p)) */
  8026. for (r = 0; r < e.heroLocations.length; r += 1) {
  8027. ;(s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f)
  8028. if (n.onTheBus && r === n.destinationItem[0]) {
  8029. s.addClass(p)
  8030. a.addClass(p)
  8031. if (Date.now() - lastMoveScrollTime > 2000) {
  8032. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  8033. W.activate(r) // scrollbar slide to this
  8034. }
  8035. } else {
  8036. n.onTheBus && g && r === n.currentItem[0]
  8037. ? (s.addClass(p), a.addClass(p))
  8038. : (s.removeClass(p), a.removeClass(p))
  8039. }
  8040. }
  8041. } else for (r = 0; r < e.heroLocations.length; r += 1) (s = y.eq(r)), (a = I.eq(r)), s.removeClass('active recent'), a.removeClass('active recent')
  8042. o(t, i)
  8043. }),
  8044. document.addEventListener(
  8045. 'keydown',
  8046. function (n) {
  8047. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  8048. case we.ZERO:
  8049. Q.debug && e.toggleAlpha()
  8050. break
  8051. case we.NINE:
  8052. Q.debug && se.toggle()
  8053. break
  8054. case we.ONE:
  8055. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA)
  8056. break
  8057. case we.TWO:
  8058. e.outsideAllowed() &&
  8059. !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) &&
  8060. t.changeMode(_e.DOLLHOUSE)
  8061. break
  8062. case we.THREE:
  8063. e.outsideAllowed() &&
  8064. !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) &&
  8065. t.changeMode(_e.FLOORPLAN)
  8066. break
  8067. case we.FOUR:
  8068. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR)
  8069. break
  8070. case we.SPACE:
  8071. je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'))
  8072. break
  8073. case we.RETURN:
  8074. Q.debug && e.toggleExplodeUp()
  8075. break
  8076. case we.P:
  8077. k()
  8078. break
  8079. case we.U:
  8080. B()
  8081. break
  8082. case we.X:
  8083. Q.debug && e.toggleExplode()
  8084. break
  8085. case we.PLUSEQUALS:
  8086. t.player.activatePersistentZooming(!0), ie.hideUi()
  8087. break
  8088. case we.DASHUNDERSCORE:
  8089. t.player.activatePersistentZooming(!1), ie.hideUi()
  8090. break
  8091. case we.SEVEN:
  8092. De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov)
  8093. break
  8094. case we.EIGHT:
  8095. t.player.decreaseZoomSpeed()
  8096. break
  8097. case we.NINE:
  8098. t.player.increaseZoomSpeed()
  8099. }
  8100. return i && i.reticule.hide(), !0
  8101. }.bind(this)
  8102. ),
  8103. document.addEventListener(
  8104. 'keyup',
  8105. function (e) {
  8106. switch (e.which) {
  8107. case we.PLUSEQUALS:
  8108. t.player.deactivatePersistentZooming()
  8109. break
  8110. case we.DASHUNDERSCORE:
  8111. t.player.deactivatePersistentZooming()
  8112. }
  8113. }.bind(this)
  8114. ),
  8115. F(e),
  8116. L(e, t.player),
  8117. M(i),
  8118. te.setAutoPlay(e.heroCount()),
  8119. he.init(i, a.mode),
  8120. he.on(ue.OPENED, Ze.bind(this, 'help')),
  8121. fe.init(),
  8122. fe.on(
  8123. ge.OPENED,
  8124. (function () {
  8125. var e = document.getElementById('terms-modal')
  8126. return function () {
  8127. Ze('terms'), le.open(e)
  8128. }
  8129. })()
  8130. ),
  8131. fe.on(ge.CLOSED, le.reset),
  8132. Q.quickstart.enabled ||
  8133. re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  8134. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  8135. Q.profiling.enabled && se.show(),
  8136. ve.init(t)
  8137. }
  8138. function M(e) {
  8139. var t = function (e, t) {
  8140. $(e)
  8141. .find('a')
  8142. .each(function (e, i) {
  8143. t
  8144. ? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled')
  8145. : $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  8146. (i.style.pointerEvents = t ? 'auto' : 'none')
  8147. })
  8148. },
  8149. i = function () {
  8150. e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0),
  8151. e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0)
  8152. }
  8153. e.on(Ne.ZoomMax, function () {
  8154. t('#gui-zoomin', !1), t('#gui-zoomout', !0)
  8155. }),
  8156. e.on(Ne.ZoomMin, function () {
  8157. t('#gui-zoomin', !0), t('#gui-zoomout', !1)
  8158. }),
  8159. e.on(Ne.ZoomIn, function () {
  8160. t('#gui-zoomout', !0)
  8161. }),
  8162. e.on(Ne.ZoomOut, function () {
  8163. t('#gui-zoomin', !0)
  8164. }),
  8165. i()
  8166. }
  8167. function R(e) {
  8168. O(e)
  8169. }
  8170. function P(e) {
  8171. O(e)
  8172. }
  8173. function O(e) {
  8174. var t = e.waitQueue.length
  8175. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  8176. }
  8177. function L(e, t) {
  8178. He = {
  8179. gui: null,
  8180. visible: !1,
  8181. model: e,
  8182. player: t
  8183. }
  8184. }
  8185. function D(e, t) {
  8186. function i() {
  8187. var i = t.toJSON()
  8188. ;(n.linkToLocation =
  8189. window.location.protocol +
  8190. '//' +
  8191. window.location.host +
  8192. window.location.pathname +
  8193. '?m=' +
  8194. e.sid +
  8195. '&start=' +
  8196. be.serialize(i)),
  8197. t.tagManager.activeTag && (n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid)
  8198. }
  8199. var n = {},
  8200. r = new Le.GUI({
  8201. autoPlace: !0,
  8202. width: '60%'
  8203. })
  8204. i(),
  8205. t.on(xe.ViewChanged, i),
  8206. r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(),
  8207. (r.domElement.id = 'datLinks')
  8208. var o = [].slice.call(r.domElement.querySelectorAll('.property-name'))
  8209. return (
  8210. o.forEach(function (e) {
  8211. if (!K.detectSafari()) {
  8212. var t = document.createElement('button')
  8213. t.classList.add('btn-deep-link'),
  8214. (t.innerText = Re.MENU_COPY),
  8215. e.nextSibling.appendChild(t)
  8216. var i = function () {
  8217. alert(Re.LINK_ALERT_COPY), t.hide()
  8218. }
  8219. t.addEventListener('click', function (e) {
  8220. try {
  8221. var t = e.target.parentNode.childNodes[0]
  8222. t.select()
  8223. var n = document.execCommand('copy')
  8224. t.blur(), n || i()
  8225. } catch (e) {
  8226. i()
  8227. }
  8228. })
  8229. }
  8230. }),
  8231. $(r.__closeButton).hide(),
  8232. r
  8233. )
  8234. }
  8235. function N(e) {
  8236. He.gui || (He.gui = D(He.model, He.player)),
  8237. (He.visible = e),
  8238. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  8239. }
  8240. function B() {
  8241. N(!He.visible)
  8242. }
  8243. function F(e) {
  8244. ke = {
  8245. gui: null,
  8246. visible: !1,
  8247. model: e
  8248. }
  8249. }
  8250. function V(e) {
  8251. var t = new Le.GUI()
  8252. return (
  8253. t
  8254. .add(Q, 'showSweeps')
  8255. .name('Show sweeps')
  8256. .onFinishChange(function () {
  8257. e.setSweepVisibility(Q.showSweeps)
  8258. }),
  8259. t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  8260. t
  8261. .add(Q.transition, 'flyTime', 0, 5e3)
  8262. .name('Transition time')
  8263. .onFinishChange(function () {
  8264. ;(Q.transition.flySpeed = 0),
  8265. t.__controllers.forEach(function (e) {
  8266. e.updateDisplay()
  8267. })
  8268. }),
  8269. t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
  8270. $(t.__closeButton).hide(),
  8271. t
  8272. )
  8273. }
  8274. function U(e) {
  8275. ke.gui || (ke.gui = V(ke.model)),
  8276. (ke.visible = e),
  8277. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  8278. }
  8279. function k() {
  8280. U(!ke.visible)
  8281. }
  8282. function H() {
  8283. function e(e) {
  8284. e.target === t ||
  8285. $.contains(t, e.target) ||
  8286. e.target === i ||
  8287. $.contains(i, e.target) ||
  8288. e.target === n ||
  8289. $.contains(n, e.target) /* || e.preventDefault()*/
  8290. }
  8291. $('body').css('touch-action', 'none'),
  8292. $('#gui-parent')
  8293. .find('*:not(#tag-billboards)')
  8294. .on('touchmove', function (e) {
  8295. // e.preventDefault()
  8296. })
  8297. var t = document.getElementById('terms-text'),
  8298. i = document.getElementById('more-help-wrapper'),
  8299. n =
  8300. (document.getElementById('navigation-help-wrapper'),
  8301. document.getElementById('help-dialog'),
  8302. document.getElementById('tag-billboards'))
  8303. Q.useWheel &&
  8304. (document.body.addEventListener('mousewheel', e, { passive: false }),
  8305. document.body.addEventListener('DOMMouseScroll', e)),
  8306. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  8307. .off('touchmove')
  8308. .on('touchmove', function (e) {
  8309. e.stopPropagation()
  8310. })
  8311. }
  8312. function G(e, t) {
  8313. for (var i = []; e; ) i.push(e), (e = e.parentNode)
  8314. for (; t && i.indexOf(t) === -1; ) t = t.parentNode
  8315. return t
  8316. }
  8317. function z() {
  8318. var e,
  8319. t = function (t) {
  8320. e = 0 === t.button || 1 === t.which ? t.target : null
  8321. },
  8322. i = function (t) {
  8323. e !== t.target && (e = G(e, t.target))
  8324. var i = document.getElementById('gui-parent')
  8325. if ((G(i, e) !== i && (e = null), e)) {
  8326. var n
  8327. try {
  8328. n = new MouseEvent('click', t)
  8329. } catch (e) {
  8330. ;(n = document.createEvent('MouseEvents')),
  8331. n.initMouseEvent(
  8332. 'click',
  8333. t.bubbles,
  8334. t.cancelable,
  8335. t.view,
  8336. t.detail,
  8337. t.screenX,
  8338. t.screenY,
  8339. t.clientX,
  8340. t.clientY,
  8341. t.ctrlKey,
  8342. t.altKey,
  8343. t.shiftKey,
  8344. t.metaKey,
  8345. t.button,
  8346. t.relatedTarget
  8347. )
  8348. }
  8349. ;(n.syntheticClick = !0), e.dispatchEvent(n), (e = null)
  8350. }
  8351. }
  8352. document.body.addEventListener('mousedown', t, !0),
  8353. document.body.addEventListener('mouseup', i, !0),
  8354. document.getElementById('gui-parent').addEventListener(
  8355. 'click',
  8356. function (e) {
  8357. e.syntheticClick ||
  8358. (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault())
  8359. },
  8360. !0
  8361. )
  8362. }
  8363. var lastMoveScrollTime = 0 //add
  8364. var W,
  8365. j,
  8366. Y,
  8367. X,
  8368. Z,
  8369. q,
  8370. K = (e('three'), e('../util/ajax'), e('../util/browser')),
  8371. Q = e('../settings'),
  8372. J = e('../analytics'),
  8373. ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
  8374. te = (e('../objects/Snapshot'), e('./helpManager')),
  8375. ie = e('./immersiveMode'),
  8376. ne = e('./loadingScreen'),
  8377. re = e('./landingScreen'),
  8378. oe = e('./playButton'),
  8379. ae = e('./populateModal'),
  8380. se = e('./memoryUsage'),
  8381. le = e('./closer/modalCloser'),
  8382. ce = e('./closer/ModalCloserEvent'),
  8383. he = e('./help/help'),
  8384. ue = e('./help/HelpEvent'),
  8385. de = e('./title/titleBar'),
  8386. pe = e('./title/TitleEvents'),
  8387. fe = e('./terms/terms'),
  8388. ge = e('./terms/TermsEvent'),
  8389. me = e('./title/tagToggle'),
  8390. ve = e('./tourInteraction'),
  8391. Ae = e('./vr/vrModal'),
  8392. ye = e('./vr/vrEvent'),
  8393. Ce = e('./sharing/modal'),
  8394. Ie = e('./webvr/webVRgui'),
  8395. Ee = e('./webvr/WebVrEvent'),
  8396. be = e('../controls/serializer'),
  8397. we = e('../enum/Keys'),
  8398. _e = e('../enum/Viewmode'),
  8399. Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
  8400. xe =
  8401. (e('../enum/PathDiscardMode'),
  8402. e('../enum/PathDisplayMode'),
  8403. e('../enum/DirectorEvents'),
  8404. e('../enum/PlayerEvents')),
  8405. Se = e('../enum/ControlEvents'),
  8406. Me = e('./sharing/ShareEvents'),
  8407. Re = e('../localization/localize'),
  8408. Pe =
  8409. (e('../enum/Vectors'),
  8410. e('../enum/WarpStyle'),
  8411. e('../enum/AlignmentType'),
  8412. e('../enum/VROption')),
  8413. Oe = e('./konami'),
  8414. Le = e('../lib/dat.gui'),
  8415. De = new ee(i),
  8416. Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
  8417. Be = _e.DOLLHOUSE,
  8418. Fe = 0,
  8419. Ve = 0,
  8420. Ue = ['.hideTarget'],
  8421. ke = null,
  8422. He = null,
  8423. Ge = !1,
  8424. ze = !1,
  8425. We = !1,
  8426. je = {
  8427. coBrand: {
  8428. visible: !0,
  8429. elements: ['.co-brand', '#loaderCoBrand']
  8430. },
  8431. help: {
  8432. visible: !0,
  8433. elements: ['.nav-help', '#nav-help']
  8434. },
  8435. tourControls: {
  8436. visible: !0,
  8437. elements: ['.next', '.previous', '#play']
  8438. },
  8439. highlight: {
  8440. visible: !0,
  8441. elements: ['#drawer', '#pullTab']
  8442. },
  8443. share: {
  8444. visible: !0,
  8445. elements: ['.socialButton', '#share']
  8446. },
  8447. fullScreen: {
  8448. visible: !0,
  8449. elements: ['#gui-fullscreen']
  8450. },
  8451. floors: {
  8452. visible: !0,
  8453. elements: ['.gui-floor']
  8454. }
  8455. },
  8456. Ye = (function () {
  8457. var e = document.getElementById('drawer')
  8458. return function () {
  8459. $('#player').height() < 400 && e.classList.contains('open') && a()
  8460. }
  8461. })(),
  8462. Xe = (function () {
  8463. var e = document.getElementById('meta-info')
  8464. return function () {
  8465. $('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0)
  8466. }
  8467. })(),
  8468. Ze = (function (e) {
  8469. function t() {
  8470. u.classList.contains('expand') && de.toggleMeta(!0)
  8471. }
  8472. function i() {
  8473. fe.hide()
  8474. }
  8475. function n() {
  8476. he.close()
  8477. }
  8478. function r() {
  8479. Ae.dismiss()
  8480. }
  8481. function o() {
  8482. p.hasClass('open') && a(!0)
  8483. }
  8484. function l() {
  8485. Ce.hide()
  8486. }
  8487. function c() {
  8488. f.hasClass('open') && f.removeClass('open')
  8489. }
  8490. function h() {
  8491. d.classList.contains('fadeIn') &&
  8492. (d.classList.contains('landing')
  8493. ? re.dismissModal()
  8494. : d.classList.contains('tour') && ve.dismissModal())
  8495. }
  8496. var u = document.getElementById('meta-info'),
  8497. d = document.getElementById('interaction-modal'),
  8498. p = $('#drawer').eq(0),
  8499. f = $('.gui-floor').eq(0),
  8500. g = $('.vr-popup').eq(0)
  8501. return function (e) {
  8502. switch (e) {
  8503. case 'info':
  8504. i(), n(), Ye(), l(), c(), r(), h()
  8505. break
  8506. case 'terms':
  8507. t(), n(), o(), l(), c(), r(), h()
  8508. break
  8509. case 'help':
  8510. t(), i(), l(), c(), r(), h()
  8511. break
  8512. case 'vr':
  8513. t(), i(), l(), c(), n(), h(), s(g) && o()
  8514. break
  8515. case 'highlights':
  8516. Xe(), i(), l(), c()
  8517. break
  8518. case 'share':
  8519. t(), i(), n(), c(), r(), h()
  8520. break
  8521. case 'floor':
  8522. i(), l(), r()
  8523. break
  8524. case 'view':
  8525. c(), l(), i(), r()
  8526. break
  8527. case 'tour':
  8528. i(), l(), c(), r()
  8529. break
  8530. case 'move':
  8531. i(), l(), c(), r()
  8532. break
  8533. case 'resize':
  8534. t(), Ye(), c()
  8535. break
  8536. case 'tag':
  8537. i(), n(), l(), c(), r()
  8538. }
  8539. }
  8540. })()
  8541. $(document).on(
  8542. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  8543. function (e) {
  8544. $('#gui-fullscreen').toggle(!K.isFullscreen()),
  8545. $('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
  8546. setTimeout(function () {
  8547. $('.icon:visible').hide().show(0)
  8548. }, 100)
  8549. }
  8550. ),
  8551. $('#gui-fullscreen')
  8552. .find('a')
  8553. .on('click', function (e) {
  8554. l(e),
  8555. K.requestFullscreen($('body')[0]),
  8556. J.track('showcase_gui', {
  8557. gui_action: 'click_enter_fullscreen',
  8558. interaction_source: 'gui'
  8559. })
  8560. //czj
  8561. //W.reload()
  8562. }),
  8563. $('#gui-fullscreen-exit')
  8564. .find('a')
  8565. .on('click', function (e) {
  8566. l(e),
  8567. K.exitFullscreen(),
  8568. J.track('showcase_gui', {
  8569. gui_action: 'click_exit_fullscreen',
  8570. interaction_source: 'gui'
  8571. })
  8572. })
  8573. $(window)
  8574. .on('resize', function (e) {
  8575. var t = e.target.innerHeight,
  8576. i = e.target.innerWidth
  8577. ;(t === X && i === Z) ||
  8578. (je.highlight.visible && w(),
  8579. Ze('resize'),
  8580. $('.pinTop.right').removeClass('hideUnderMeta'),
  8581. c(),
  8582. (X = t),
  8583. (Z = i))
  8584. })
  8585. .resize(),
  8586. K.supportsFullscreen() || $('#gui-fullscreen').hide(),
  8587. $('#pullTab').on('click', function (e) {
  8588. l(e),
  8589. $('#drawer').hasClass('open')
  8590. ? (J.trackAlways('showcase_gui', {
  8591. gui_action: 'hide_highlight_reel'
  8592. }),
  8593. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  8594. : (J.trackAlways('showcase_gui', {
  8595. gui_action: 'show_highlight_reel'
  8596. }),
  8597. $(this)
  8598. .removeClass('open')
  8599. .children('img')
  8600. .attr('src', 'images/auto-suspend.png'))
  8601. a()
  8602. })
  8603. /***********************方奕卓 热点列表事件监听 ************************/
  8604. if (window.DATA.showHotListSta) {
  8605. $('#hotList').css('display', '')
  8606. $('#hotList').on('click', function (e) {
  8607. l(e)
  8608. var hotList = $('#hotListWrap')[0]
  8609. var isActive = hotList.classList.contains('hotListActive')
  8610. if (isActive) {
  8611. hotList.classList.remove('hotListActive')
  8612. this.classList.remove('active')
  8613. } else {
  8614. hotList.classList.add('hotListActive')
  8615. this.classList.add('active')
  8616. }
  8617. }),
  8618. $('#hotListContent ul').on('mouseover', function (e) {
  8619. l(e)
  8620. var target = e.target
  8621. var hotList = document.getElementById('hotListWrap')
  8622. if (target.tagName === 'SPAN') {
  8623. var targetParent = target.parentElement.parentElement
  8624. if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  8625. hotList.style.width = target.offsetWidth + 116 + 'px'
  8626. } else {
  8627. hotList.style.width = ''
  8628. }
  8629. } else if (target.tagName === 'LI') {
  8630. var targetParent = target.parentElement
  8631. if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
  8632. hotList.style.width = target.children[0].offsetWidth + 116 + 'px'
  8633. } else {
  8634. hotList.style.width = ''
  8635. }
  8636. } else {
  8637. hotList.style.width = ''
  8638. }
  8639. })
  8640. $('#hotListContent ul').on('click', function (e) {
  8641. l(e)
  8642. this.preElem && this.preElem.classList.remove('active')
  8643. if (e.target.tagName === 'SPAN') {
  8644. e.target.parentElement.classList.add('active')
  8645. e.target.parentElement.hot &&
  8646. e.target.parentElement.hot.examine(window.player, true) // 打开热点
  8647. this.preElem = e.target.parentElement
  8648. } else {
  8649. e.target.classList.add('active')
  8650. e.target.hot && e.target.hot.examine(window.player, true) // 打开热点
  8651. this.preElem = e.target
  8652. }
  8653. })
  8654. $('#hotListClose').on('click', function (e) {
  8655. l(e)
  8656. var hotList = $('#hotListWrap')[0]
  8657. hotList.classList.remove('hotListActive')
  8658. $('#hotListContent ul .active').removeClass('active')
  8659. $('#hotList')[0].classList.remove('active')
  8660. })
  8661. }
  8662. /*****************************************************************/
  8663. $('#more-menu-button').on('click', function (e) {
  8664. l(e)
  8665. var t = $('#more-menu')
  8666. t.toggleClass('open')
  8667. }),
  8668. (t.exports.init = S),
  8669. (t.exports.startLoading = x),
  8670. (t.exports.endLoading = d),
  8671. (t.exports.onProgress = u)
  8672. }).call(this, '/js/gui/gui.js')
  8673. },
  8674. {
  8675. '../analytics': 4,
  8676. '../controls/serializer': 14,
  8677. '../enum/AlignmentType': 17,
  8678. '../enum/BlackoutStyle': 18,
  8679. '../enum/ControlEvents': 21,
  8680. '../enum/DirectorEvents': 23,
  8681. '../enum/Keys': 30,
  8682. '../enum/PathDiscardMode': 38,
  8683. '../enum/PathDisplayMode': 39,
  8684. '../enum/PlayerEvents': 40,
  8685. '../enum/VROption': 47,
  8686. '../enum/Vectors': 50,
  8687. '../enum/Viewmode': 51,
  8688. '../enum/WarpStyle': 52,
  8689. '../enum/ZoomEvents': 53,
  8690. '../lib/dat.gui': 93,
  8691. '../localization/localize': 108,
  8692. '../tag/Media/MediaEvent': 131,
  8693. '../objects/Snapshot': 153,
  8694. '../settings': 166,
  8695. '../util/ajax': 181,
  8696. '../util/browser': 182,
  8697. '../util/camera': 183,
  8698. '../util/logger': 189,
  8699. '../util/showcase': 193,
  8700. '../util/transitions': 195,
  8701. './closer/ModalCloserEvent': 61,
  8702. './closer/modalCloser': 62,
  8703. './help/HelpEvent': 66,
  8704. './help/help': 67,
  8705. './helpManager': 68,
  8706. './immersiveMode': 69,
  8707. './konami': 70,
  8708. './landingScreen': 71,
  8709. './loadingScreen': 72,
  8710. './memoryUsage': 73,
  8711. './playButton': 74,
  8712. './populateModal': 75,
  8713. './sharing/ShareEvents': 76,
  8714. './sharing/modal': 77,
  8715. './terms/TermsEvent': 78,
  8716. './terms/terms': 79,
  8717. './title/TitleEvents': 80,
  8718. './title/tagToggle': 81,
  8719. './title/titleBar': 82,
  8720. './tourInteraction': 84,
  8721. './vr/vrEvent': 85,
  8722. './vr/vrModal': 87,
  8723. './webvr/WebVrEvent': 88,
  8724. './webvr/webVRgui': 89,
  8725. three: 217
  8726. }
  8727. ],
  8728. 66: [
  8729. function (e, t, i) {
  8730. 'use strict'
  8731. t.exports = Object.freeze({
  8732. OPENED: 'help.opened',
  8733. CLOSED: 'help.closed'
  8734. })
  8735. },
  8736. {}
  8737. ],
  8738. 67: [
  8739. function (e, t, i) {
  8740. 'use strict'
  8741. function n() {
  8742. g.on('click', function (e) {
  8743. if (S && S !== l.TRANSITIONING) {
  8744. var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0
  8745. t && !M ? R.close() : r()
  8746. }
  8747. }),
  8748. w.on('click', function (e) {
  8749. R.close()
  8750. }),
  8751. E.on('click', function (e) {
  8752. S && S !== l.TRANSITIONING && (s(), o())
  8753. }),
  8754. b.on('click', function (e) {
  8755. s(), a()
  8756. })
  8757. }
  8758. function r() {
  8759. S &&
  8760. S !== l.TRANSITIONING &&
  8761. ((M = !0),
  8762. setTimeout(function () {
  8763. M = !1
  8764. }, d.help.modalStayDuration),
  8765. R.emit(h.OPENED),
  8766. m.addClass('open ' + S),
  8767. g.addClass('open'),
  8768. s(),
  8769. o(),
  8770. y.style.removeProperty
  8771. ? y.style.removeProperty('display')
  8772. : y.style.removeAttribute('display'),
  8773. y.classList.add('fadeIn'))
  8774. }
  8775. function o() {
  8776. E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S)
  8777. }
  8778. function a() {
  8779. b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help')
  8780. }
  8781. function s(e, t) {
  8782. m.removeClass(
  8783. 'more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR
  8784. ),
  8785. I.forEach(function (e) {
  8786. e.classList.remove('underline-tab')
  8787. })
  8788. }
  8789. var l = e('../../enum/Viewmode'),
  8790. c = e('../../enum/HelpModalType'),
  8791. h = e('./HelpEvent'),
  8792. u = (e('../helpManager'), e('./../populateModal')),
  8793. d = e('../../settings'),
  8794. p = e('../../util/common'),
  8795. f = e('events').EventEmitter,
  8796. g = $('.footer-help').eq(0),
  8797. m = $('#help-dialog').eq(0),
  8798. v = document.querySelector('#quick-logo'),
  8799. A = document.querySelector('#loaderCoBrand'),
  8800. y = document.querySelector('#help-dialog'),
  8801. C = document.querySelector('.footer'),
  8802. I = $('.help-tabs').children().toArray(),
  8803. E = $('.navigation-tab').eq(0),
  8804. b = $('.more-help-tab').eq(0),
  8805. w =
  8806. ($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
  8807. _ = m.find('.interactions').toArray(),
  8808. T = m.find('.ui-instructions').toArray(),
  8809. x = l.PANORAMA,
  8810. S = l.PANORAMA,
  8811. M = !1,
  8812. R = {
  8813. init: function (e, t) {
  8814. ;(S = t),
  8815. (x = t),
  8816. [y, A, v, C].forEach(function (e) {
  8817. e.classList.add(u.deviceType)
  8818. }),
  8819. n()
  8820. },
  8821. close: function () {
  8822. if (
  8823. m.hasClass('open') &&
  8824. (this.emit(h.CLOSED),
  8825. g.removeClass('open'),
  8826. m.removeClass('open'),
  8827. y.classList.contains('fadeIn'))
  8828. ) {
  8829. y.classList.remove('fadeIn')
  8830. var e = S === l.TRANSITIONING ? x : S
  8831. u.clear(_, c.NAVIGATION, e)
  8832. }
  8833. },
  8834. updateMode: function (e) {
  8835. ;(x = S), (S = e)
  8836. }
  8837. }
  8838. p.extendObject(R, f.prototype), (t.exports = R)
  8839. },
  8840. {
  8841. '../../enum/HelpModalType': 28,
  8842. '../../enum/Viewmode': 51,
  8843. '../../settings': 166,
  8844. '../../util/common': 185,
  8845. '../helpManager': 68,
  8846. './../populateModal': 75,
  8847. './HelpEvent': 66,
  8848. events: 202
  8849. }
  8850. ],
  8851. 68: [
  8852. function (e, t, i) {
  8853. ;(function (i) {
  8854. 'use strict'
  8855. var n = e('../util/browser'),
  8856. r = e('./../util/logger'),
  8857. o = e('./../settings'),
  8858. a = new r(i),
  8859. s = (function () {
  8860. var e
  8861. try {
  8862. return (
  8863. (e = window.localStorage.getItem('visitCount') || '0'),
  8864. (e = (parseFloat(e) + 1).toString()),
  8865. window.localStorage.setItem('visitCount', e),
  8866. a.debug('visitCount = ' + e),
  8867. e
  8868. )
  8869. } catch (t) {
  8870. ;(e = '1'), a.debug("couldn't set local storage")
  8871. }
  8872. })(),
  8873. l = !1
  8874. t.exports = {
  8875. isHelpDisabled: function () {
  8876. return '0' === n.valueFromHash('help', null) || l
  8877. },
  8878. isLargeHelpEnabled: function () {
  8879. return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled()
  8880. },
  8881. isSmallHelpEnabled: function () {
  8882. return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled()
  8883. },
  8884. isHelpEnabled: function () {
  8885. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  8886. },
  8887. setAutoPlay: function (e) {
  8888. l = o.warp.auto >= 0 && e > 1
  8889. }
  8890. }
  8891. }).call(this, '/js/gui/helpManager.js')
  8892. },
  8893. {
  8894. '../util/browser': 182,
  8895. './../settings': 166,
  8896. './../util/logger': 189
  8897. }
  8898. ],
  8899. 69: [
  8900. function (e, t, i) {
  8901. 'use strict'
  8902. function n(e, t, i, n) {
  8903. ;(F = n), r(e, t, i, F), o(), (N = t.mode)
  8904. }
  8905. function r(e, t, i, n) {
  8906. ;[C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  8907. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c)
  8908. }),
  8909. M.on('mousewheel DOMMouseScroll', a),
  8910. i.on(m.TagActivated, a),
  8911. i.on(m.TagNavigation, a),
  8912. t.on(A.FlyingEnded, s),
  8913. t.on(A.ModeChanging, function (e, t) {
  8914. B = t !== C.PANORAMA && e !== C.PANORAMA
  8915. }),
  8916. t.on(A.ModeChanged, function (e, i) {
  8917. // 备注sg 漫游状态通信
  8918. if (window.threeReact.state3d) window.threeReact.state3d(t.mode)
  8919. ;(N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange')
  8920. }),
  8921. n.on(y.TourStart, function () {
  8922. ;(L = !0), a()
  8923. }),
  8924. n.on(y.TourEnd, function () {
  8925. ;(L = !1), l()
  8926. }),
  8927. n.on(y.ActionInterrupted, function () {
  8928. L = !1
  8929. }),
  8930. R.addEventListener(
  8931. 'touchend',
  8932. function () {
  8933. $('#pullTab').hasClass('opened') && !L && l()
  8934. },
  8935. !0
  8936. )
  8937. }
  8938. function o() {
  8939. p.isMobile()
  8940. ? (b.forEach(function (e) {
  8941. e.classList.add('mobile')
  8942. }),
  8943. w.click(l))
  8944. : (b.forEach(function (e) {
  8945. e.addEventListener(
  8946. 'mouseleave',
  8947. function () {
  8948. !M.is(':hover') && b[0].classList.contains('detectHover') && l()
  8949. },
  8950. !0
  8951. )
  8952. }),
  8953. M.mouseleave(function () {
  8954. b[0].classList.contains('detectHover') && l()
  8955. }))
  8956. }
  8957. function a(e) {
  8958. D ||
  8959. (d(e) && _.hasClass('playing')) ||
  8960. (clearTimeout(O),
  8961. (P = !0),
  8962. g.close(),
  8963. h(e),
  8964. N !== C.DOLLHOUSE &&
  8965. N !== C.FLOORPLAN &&
  8966. ((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
  8967. _.hasClass('playing') ||
  8968. (b.forEach(function (e) {
  8969. e.classList.add('detectHover')
  8970. }),
  8971. (O = setTimeout(l, f.immersive.timeToShowAgain)))))
  8972. }
  8973. function s() {
  8974. _.hasClass('playing') ||
  8975. (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)))
  8976. }
  8977. function l() {
  8978. clearTimeout(O),
  8979. (P = !1),
  8980. I.forEach(function (e) {
  8981. e.classList.remove('drawerOpen')
  8982. }),
  8983. L ||
  8984. E.forEach(function (e) {
  8985. e.classList.remove('duringTour')
  8986. }),
  8987. b.forEach(function (e) {
  8988. e.classList.remove('detectHover')
  8989. })
  8990. }
  8991. function c() {
  8992. P ? l() : a(),
  8993. (D = !0),
  8994. setTimeout(function () {
  8995. D = !1
  8996. }, f.immersive.uiStayDuration)
  8997. }
  8998. function h(e) {
  8999. !d(e) && L
  9000. ? E.forEach(function (e) {
  9001. e.classList.remove('drawerOpen'), e.classList.add('duringTour')
  9002. })
  9003. : _.hasClass('open')
  9004. ? E.forEach(function (e) {
  9005. e.classList.remove('duringTour'), e.classList.add('drawerOpen')
  9006. })
  9007. : B ||
  9008. N === C.FLOORPLAN ||
  9009. N === C.DOLLHOUSE ||
  9010. E.forEach(function (e) {
  9011. e.classList.add('fadeOut')
  9012. })
  9013. }
  9014. function u() {
  9015. T.hasClass('duringTour') || ((L = !1), a('gui'), l())
  9016. }
  9017. function d(e) {
  9018. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e
  9019. }
  9020. var p = e('../util/browser'),
  9021. f = e('../settings'),
  9022. g = e('./help/help'),
  9023. m = e('../enum/tagEvents'),
  9024. v = e('../enum/ControlEvents'),
  9025. A = e('../enum/PlayerEvents'),
  9026. y = e('../enum/DirectorEvents'),
  9027. A = e('../enum/PlayerEvents'),
  9028. C = e('../enum/Viewmode'),
  9029. I = $(
  9030. '.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer'
  9031. ).toArray(),
  9032. E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  9033. b = $('#hover-bottom, #hover-top').toArray(),
  9034. w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  9035. _ = $('#drawer').eq(0),
  9036. T = $('#drawer-container').eq(0),
  9037. x = $('#meta-info').eq(0),
  9038. S = $('.pinTop.left').eq(0),
  9039. M = $('#player').eq(0),
  9040. R = document.getElementById('pullTab'),
  9041. P = !1,
  9042. O = null,
  9043. L = !1,
  9044. D = !1,
  9045. N = null,
  9046. B = !1,
  9047. F = null
  9048. ;(t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u)
  9049. },
  9050. {
  9051. '../enum/ControlEvents': 21,
  9052. '../enum/DirectorEvents': 23,
  9053. '../enum/tagEvents': 32,
  9054. '../enum/PlayerEvents': 40,
  9055. '../enum/Viewmode': 51,
  9056. '../settings': 166,
  9057. '../util/browser': 182,
  9058. './help/help': 67
  9059. }
  9060. ],
  9061. 70: [
  9062. function (e, t, i) {
  9063. ;(function (i) {
  9064. 'use strict'
  9065. function n(e, t, i) {
  9066. l.debug('konami has the modelInstance')
  9067. var n = []
  9068. $(window).on('keydown', function (e) {
  9069. n.push(e.which),
  9070. n.length > o.secretPanelWord.length && n.shift(),
  9071. s.equalLists(n, o.secretPanelWord) &&
  9072. (l.debug('Developer mode active.'), (o.debug = !0))
  9073. }),
  9074. $(window).on('keydown', function n(r) {
  9075. o.debug &&
  9076. 72 === r.which &&
  9077. (e && i
  9078. ? (a.toggle(e, t, i), $(window).off('keydown', n))
  9079. : console.warn("sorry we're not ready yet"))
  9080. })
  9081. }
  9082. var r = e('./../util/logger'),
  9083. o = e('./../settings'),
  9084. a = e('./debug'),
  9085. s = e('./../util/common'),
  9086. l = (e('./gui'), new r(i))
  9087. o.console && $('body').append('<div id="debug-console"></div>'), (t.exports.init = n)
  9088. }).call(this, '/js/gui/konami.js')
  9089. },
  9090. {
  9091. './../settings': 166,
  9092. './../util/common': 185,
  9093. './../util/logger': 189,
  9094. './debug': 63,
  9095. './gui': 65
  9096. }
  9097. ],
  9098. 71: [
  9099. function (e, t, i) {
  9100. 'use strict'
  9101. function n(e, t) {
  9102. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  9103. }
  9104. function r(e) {
  9105. var t = $.Deferred()
  9106. e || t.resolve()
  9107. var i = c.startupFlyinDelay
  9108. return (
  9109. e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  9110. setTimeout(t.resolve.bind(t), i),
  9111. t
  9112. )
  9113. }
  9114. function o(e, t, i) {
  9115. var n = 0
  9116. c.quickstart.enabled &&
  9117. (a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay))
  9118. var r = function () {
  9119. e.once(g.Move, l), t.once(f.TourStart, l)
  9120. }
  9121. s(n, r)
  9122. }
  9123. function a(e) {
  9124. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  9125. v.before(y),
  9126. A = $(".quick-brand").toArray()),*/
  9127. m.addClass('fadeOut'),
  9128. setTimeout(function () {
  9129. A.forEach(function (e) {
  9130. e.classList.add('fadeIn')
  9131. })
  9132. }, c.quickstart.showTextDelay),
  9133. setTimeout(function () {
  9134. A.forEach(function (e) {
  9135. e.classList.add('fadeOut')
  9136. })
  9137. }, c.quickstart.fadeOutDelay),
  9138. !0
  9139. }
  9140. function s(e, t) {
  9141. setTimeout(function () {
  9142. if (h.isHelpEnabled()) {
  9143. if (
  9144. (t(),
  9145. u.init(),
  9146. C.addClass('fadeIn landing ' + u.deviceType),
  9147. h.isSmallHelpEnabled())
  9148. )
  9149. return void C.addClass('small')
  9150. u.fill(I, d.LANDING[E]), C.addClass(E)
  9151. }
  9152. }, e)
  9153. //csz 用户引导界面
  9154. var helpData = {
  9155. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  9156. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png']
  9157. }
  9158. var navIcon = $('.nav-icon .icon')
  9159. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
  9160. navIcon.attr('src', helpData.mobile[0])
  9161. function paging(id) {
  9162. id.on('click', function () {
  9163. var navPage = null
  9164. $(this).attr('data-id') == 'plus'
  9165. ? (navPage = +navIcon.attr('data-page') + 1)
  9166. : (navPage = +navIcon.attr('data-page') - 1)
  9167. if (navPage > helpData.length || navPage < 1) return false
  9168. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  9169. navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] })
  9170. } else {
  9171. navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] })
  9172. }
  9173. })
  9174. }
  9175. paging($('.next-button'))
  9176. paging($('.prev-button'))
  9177. }
  9178. function l() {
  9179. u.clear(I, d.LANDING[E]), C.removeClass('fadeIn')
  9180. }
  9181. var c = e('../settings'),
  9182. h = (e('./help/help'), e('./helpManager')),
  9183. u = e('./populateModal'),
  9184. d = e('../enum/HelpModalType'),
  9185. p = e('../enum/Viewmode'),
  9186. f = e('../enum/DirectorEvents'),
  9187. g = e('../enum/PlayerEvents'),
  9188. m = $('#quick-blackout').eq(0),
  9189. v = $('#quick-logo').eq(0),
  9190. A = $('.quick-brand').toArray(),
  9191. y = $('#loaderCoBrand').eq(0),
  9192. C = $('#interaction-modal').eq(0),
  9193. I = C.find('.interaction').toArray(),
  9194. E =
  9195. ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  9196. '')
  9197. ;(t.exports.delayLanding = r),
  9198. (t.exports.showMessage = o),
  9199. (t.exports.init = n),
  9200. (t.exports.dismissModal = l)
  9201. },
  9202. {
  9203. '../enum/DirectorEvents': 23,
  9204. '../enum/HelpModalType': 28,
  9205. '../enum/PlayerEvents': 40,
  9206. '../enum/Viewmode': 51,
  9207. '../settings': 166,
  9208. './help/help': 67,
  9209. './helpManager': 68,
  9210. './populateModal': 75
  9211. }
  9212. ],
  9213. 72: [
  9214. function (e, t, i) {
  9215. 'use strict'
  9216. var n = e('./circleLoader').circleLoader
  9217. t.exports = {
  9218. element: $('#gui-loading'),
  9219. hide: function (e) {
  9220. n.done(), this.element.fadeOut(1500, e)
  9221. },
  9222. show: function (e) {
  9223. this.element.fadeIn(
  9224. 500,
  9225. function () {
  9226. this.element.css('display', 'table'), e && e()
  9227. }.bind(this)
  9228. )
  9229. },
  9230. progress: function (e) {
  9231. n.set(e)
  9232. }
  9233. }
  9234. },
  9235. {
  9236. './circleLoader': 60
  9237. }
  9238. ],
  9239. 73: [
  9240. function (e, t, i) {
  9241. 'use strict'
  9242. var n = e('../settings'),
  9243. r = $('#memory-info'),
  9244. o = r.find('#memory-gpu'),
  9245. a = !1
  9246. t.exports = {
  9247. show: function () {
  9248. n.profiling.enabled && (r.show(), (a = !0))
  9249. },
  9250. hide: function () {
  9251. r.hide(), (a = !1)
  9252. },
  9253. toggle: function () {
  9254. a ? this.hide() : this.show()
  9255. },
  9256. update: function (e) {
  9257. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB')
  9258. }
  9259. }
  9260. },
  9261. {
  9262. '../settings': 166
  9263. }
  9264. ],
  9265. 74: [
  9266. function (e, t, i) {
  9267. 'use strict'
  9268. var n = e('../util/browser'),
  9269. r = e('../analytics')
  9270. e('../settings')
  9271. t.exports = {
  9272. show: function (e, t) {
  9273. $('#gui-message').fadeOut(500, function () {
  9274. t()
  9275. })
  9276. }
  9277. }
  9278. },
  9279. {
  9280. '../analytics': 4,
  9281. '../settings': 166,
  9282. '../util/browser': 182
  9283. }
  9284. ],
  9285. 75: [
  9286. function (e, t, i) {
  9287. 'use strict'
  9288. function n(e, t, i, n) {
  9289. function r(e) {
  9290. return e.classList.contains(a)
  9291. }
  9292. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  9293. //for (var a in o) {
  9294. //var s = e.find(r);
  9295. //for (var l in o[a]) {
  9296. //var c = o[a][l];
  9297. //if ("top-info" === l || "bottom-info" === l) {
  9298. //var h = n ? c : "";
  9299. //czj 注释掉第一次打开的用户引导
  9300. //s.querySelector("." + l).textContent = h
  9301. //} else {
  9302. //var u = n ? c : "";
  9303. //, d = s.querySelector("." + l);
  9304. //d.src = u,
  9305. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  9306. //}
  9307. //}
  9308. //}
  9309. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  9310. // p.forEach(function(e) {
  9311. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  9312. // })
  9313. }
  9314. var r = e('../util/browser'),
  9315. o = e('../localization/localize'),
  9316. a = e('../enum/HelpModalType'),
  9317. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'))
  9318. t.exports = {
  9319. init: function () {
  9320. if (!this.hasInitialized) {
  9321. ;(this.hasInitialized = !0),
  9322. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  9323. (this.assets = {}),
  9324. (this.assets[a.LANDING[s.PANORAMA]] = {
  9325. desktop: {
  9326. left: {
  9327. 'top-info': o.ROTATE,
  9328. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9329. keyboard: 'images/nav_help_keyboard_left_right.png'
  9330. },
  9331. middle: {
  9332. 'top-info': o.MOVE,
  9333. 'big-image': 'images/nav_help_mouse_click.png',
  9334. keyboard: 'images/nav_help_keyboard_up_down.png'
  9335. },
  9336. right: {
  9337. 'top-info': o.ZOOM,
  9338. 'big-image': 'images/nav_help_mouse_zoom.png',
  9339. keyboard: 'images/nav_help_zoom_keys.png'
  9340. }
  9341. },
  9342. mobile: {
  9343. left: {
  9344. 'top-info': o.ROTATE,
  9345. 'big-image': 'images/nav_help_gesture_drag.png'
  9346. },
  9347. middle: {
  9348. 'top-info': o.MOVE,
  9349. 'big-image': 'images/nav_help_gesture_tap.png'
  9350. },
  9351. right: {
  9352. 'top-info': o.ZOOM,
  9353. 'big-image': 'images/nav_help_gesture_pinch.png'
  9354. }
  9355. }
  9356. }),
  9357. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(
  9358. JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])
  9359. )),
  9360. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  9361. desktop: {
  9362. left: {
  9363. 'top-info': o.ROTATE,
  9364. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9365. keyboard: 'images/nav_help_keyboard_left_right.png'
  9366. },
  9367. middle: {
  9368. 'top-info': o.MOVE,
  9369. 'big-image': 'images/nav_help_mouse_position_right.png'
  9370. }
  9371. },
  9372. mobile: {
  9373. left: {
  9374. 'top-info': o.ROTATE,
  9375. 'big-image': 'images/nav_help_gesture_drag.png'
  9376. },
  9377. middle: {
  9378. 'top-info': o.MOVE,
  9379. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  9380. }
  9381. }
  9382. }),
  9383. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  9384. desktop: {
  9385. left: {
  9386. 'top-info': o.MOVE,
  9387. 'big-image': 'images/nav_help_mouse_position_left.png'
  9388. },
  9389. middle: {
  9390. 'top-info': o.ROTATE,
  9391. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9392. keyboard: 'images/nav_help_keyboard_left_right.png'
  9393. }
  9394. },
  9395. mobile: {
  9396. left: {
  9397. 'top-info': o.MOVE,
  9398. 'big-image': 'images/nav_help_gesture_position.png'
  9399. },
  9400. middle: {
  9401. 'top-info': o.ROTATE,
  9402. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  9403. }
  9404. }
  9405. })
  9406. var e = {
  9407. 'top-info': o.INSIDE,
  9408. 'big-image': 'images/nav_help_click_inside.png',
  9409. keyboard: 'images/nav_help_inside_key.png'
  9410. }
  9411. ;(this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e),
  9412. (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e),
  9413. (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e)
  9414. var t = {
  9415. 'top-info': o.INSIDE,
  9416. 'big-image': 'images/nav_help_tap_inside.png'
  9417. }
  9418. ;(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  9419. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  9420. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  9421. (this.assets[a.NAVIGATION] = {}),
  9422. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  9423. desktop: {
  9424. left: {
  9425. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  9426. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  9427. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9428. keyboard: 'images/nav_help_keyboard_left_right.png'
  9429. },
  9430. middle: {
  9431. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  9432. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  9433. 'big-image': 'images/nav_help_mouse_click.png',
  9434. keyboard: 'images/nav_help_keyboard_up_down.png'
  9435. },
  9436. right: {
  9437. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  9438. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  9439. 'big-image': 'images/nav_help_mouse_zoom.png',
  9440. keyboard: 'images/nav_help_zoom_keys.png'
  9441. }
  9442. },
  9443. mobile: {
  9444. left: {
  9445. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  9446. 'big-image': 'images/nav_help_gesture_drag.png'
  9447. },
  9448. middle: {
  9449. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  9450. 'big-image': 'images/nav_help_gesture_tap.png'
  9451. },
  9452. right: {
  9453. 'top-info': o.HELP_MOBILE_3,
  9454. 'big-image': 'images/nav_help_gesture_pinch.png'
  9455. }
  9456. }
  9457. }),
  9458. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  9459. desktop: {
  9460. left: {
  9461. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  9462. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  9463. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9464. keyboard: 'images/nav_help_keyboard_all.png'
  9465. },
  9466. middle: {
  9467. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  9468. 'big-image': 'images/nav_help_mouse_position_right.png'
  9469. },
  9470. right: {
  9471. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  9472. 'big-image': 'images/nav_help_mouse_zoom.png'
  9473. }
  9474. },
  9475. mobile: {
  9476. left: {
  9477. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  9478. 'big-image': 'images/nav_help_gesture_drag.png'
  9479. },
  9480. middle: {
  9481. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  9482. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  9483. },
  9484. right: {
  9485. 'top-info': o.HELP_MOBILE_3,
  9486. 'big-image': 'images/nav_help_gesture_pinch.png'
  9487. }
  9488. }
  9489. }),
  9490. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  9491. desktop: {
  9492. left: {
  9493. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  9494. 'big-image': 'images/nav_help_mouse_position_left.png'
  9495. },
  9496. middle: {
  9497. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  9498. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  9499. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9500. keyboard: 'images/nav_help_keyboard_left_right.png'
  9501. },
  9502. right: {
  9503. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  9504. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  9505. 'big-image': 'images/nav_help_mouse_zoom.png',
  9506. keyboard: 'images/nav_help_keyboard_up_down.png'
  9507. }
  9508. },
  9509. mobile: {
  9510. left: {
  9511. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  9512. 'big-image': 'images/nav_help_gesture_position.png'
  9513. },
  9514. middle: {
  9515. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  9516. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  9517. },
  9518. right: {
  9519. 'top-info': o.HELP_MOBILE_3,
  9520. 'big-image': 'images/nav_help_gesture_pinch.png'
  9521. }
  9522. }
  9523. }),
  9524. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(
  9525. JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])
  9526. )),
  9527. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  9528. 'top-info': o.HELP_DESKTOP_360_2A,
  9529. 'bottom-info': o.HELP_DESKTOP_360_2B,
  9530. 'big-image': 'images/nav_help_click_inside.png',
  9531. keyboard: 'images/nav_help_inside_key.png'
  9532. }),
  9533. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  9534. 'top-info': o.HELP_MOBILE_360_2,
  9535. 'big-image': 'images/nav_help_tap_inside.png'
  9536. }),
  9537. (this.assets[a.MORE_HELP] = {
  9538. desktop: {
  9539. 'more-help-hlr': {
  9540. 'top-info': o.HELP_MORE_HLR_A,
  9541. 'big-image': 'images/nav_help_expand.svg',
  9542. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  9543. },
  9544. 'more-help-dollhouse': {
  9545. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9546. 'big-image': 'images/nav_help_dollhouse.svg',
  9547. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  9548. },
  9549. 'more-help-floors': {
  9550. 'top-info': o.HELP_MORE_FLOORS_A,
  9551. 'big-image': 'images/nav_help_floor picker.svg',
  9552. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  9553. },
  9554. 'more-help-tag': {
  9555. 'top-info': o.HELP_MORE_TAG_A,
  9556. 'big-image': 'images/nav_help_tag.svg',
  9557. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B
  9558. },
  9559. 'more-help-zoom': {
  9560. 'top-info': o.HELP_MORE_ZOOM_A,
  9561. 'big-image': 'images/nav_help_zoom.svg',
  9562. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B
  9563. },
  9564. 'more-help-tour': {
  9565. 'top-info': o.HELP_MORE_TOUR_A,
  9566. 'big-image': 'images/nav_help_play.png',
  9567. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  9568. },
  9569. 'more-help-inside': {
  9570. 'top-info': o.HELP_MORE_INSIDE_A,
  9571. 'big-image': 'images/nav_help_inside.svg',
  9572. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B
  9573. },
  9574. 'more-help-vr': {
  9575. 'top-info': o.HELP_MORE_VR_A,
  9576. 'big-image': 'images/nav_help_vr.svg',
  9577. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B
  9578. },
  9579. 'more-help-360': {
  9580. 'top-info': o.HELP_MORE_360_A,
  9581. 'big-image': 'images/nav_help_360.svg',
  9582. 'bottom-info': o.HELP_DESKTOP_MORE_360_B
  9583. },
  9584. 'more-help-fullscreen': {
  9585. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  9586. 'big-image': 'images/nav_help_fullscreen.svg',
  9587. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B
  9588. }
  9589. },
  9590. mobile: {
  9591. 'more-help-hlr': {
  9592. 'top-info': o.HELP_MORE_HLR_A,
  9593. 'big-image': 'images/nav_help_expand.svg',
  9594. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  9595. },
  9596. 'more-help-dollhouse': {
  9597. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9598. 'big-image': 'images/nav_help_dollhouse.svg',
  9599. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B
  9600. },
  9601. 'more-help-floors': {
  9602. 'top-info': o.HELP_MORE_FLOORS_A,
  9603. 'big-image': 'images/nav_help_floor picker.svg',
  9604. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  9605. },
  9606. 'more-help-tag': {
  9607. 'top-info': o.HELP_MORE_TAG_A,
  9608. 'big-image': 'images/nav_help_tag.svg',
  9609. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B
  9610. },
  9611. 'more-help-tour': {
  9612. 'top-info': o.HELP_MORE_TOUR_A,
  9613. 'big-image': 'images/nav_help_play.png',
  9614. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  9615. },
  9616. 'more-help-inside': {
  9617. 'top-info': o.HELP_MORE_INSIDE_A,
  9618. 'big-image': 'images/nav_help_inside.svg',
  9619. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B
  9620. },
  9621. 'more-help-vr': {
  9622. 'top-info': o.HELP_MORE_VR_A,
  9623. 'big-image': 'images/webvr.svg',
  9624. 'bottom-info': o.HELP_MOBILE_MORE_VR_B
  9625. },
  9626. 'more-help-360': {
  9627. 'top-info': o.HELP_MORE_360_A,
  9628. 'big-image': 'images/nav_help_360.svg',
  9629. 'bottom-info': o.HELP_MOBILE_MORE_360_B
  9630. }
  9631. }
  9632. }),
  9633. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  9634. desktop: {
  9635. left: {
  9636. 'top-info': o.ROTATE,
  9637. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9638. keyboard: 'images/nav_help_keyboard_left_right.png'
  9639. },
  9640. middle: {
  9641. 'top-info': o.MOVE,
  9642. 'big-image': 'images/nav_help_mouse_click.png',
  9643. keyboard: 'images/nav_help_keyboard_up_down.png'
  9644. },
  9645. right: {
  9646. 'top-info': o.PLAY,
  9647. 'big-image': 'images/Desktop-help-play-button.svg',
  9648. keyboard: 'images/Desktop-help-spacebar-2.svg'
  9649. }
  9650. },
  9651. mobile: {
  9652. left: {
  9653. 'top-info': o.ROTATE,
  9654. 'big-image': 'images/nav_help_gesture_drag.png'
  9655. },
  9656. middle: {
  9657. 'top-info': o.MOVE,
  9658. 'big-image': 'images/nav_help_gesture_tap.png'
  9659. },
  9660. right: {
  9661. 'top-info': o.PLAY,
  9662. 'big-image': 'images/mobile-help-play-button.svg'
  9663. }
  9664. }
  9665. }),
  9666. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(
  9667. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])
  9668. )),
  9669. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle =
  9670. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  9671. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle =
  9672. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  9673. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(
  9674. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])
  9675. )),
  9676. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left =
  9677. this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  9678. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left =
  9679. this.assets[a.LANDING[s.FLOORPLAN]].mobile.left)
  9680. }
  9681. },
  9682. fill: function (e, t, i) {
  9683. n.call(this, e, t, i, !0)
  9684. },
  9685. clear: function (e, t, i) {
  9686. n.call(this, e, t, i, !1)
  9687. }
  9688. }
  9689. },
  9690. {
  9691. '../enum/HelpModalSize': 27,
  9692. '../enum/HelpModalType': 28,
  9693. '../enum/Viewmode': 51,
  9694. '../localization/localize': 108,
  9695. '../util/browser': 182
  9696. }
  9697. ],
  9698. 76: [
  9699. function (e, t, i) {
  9700. 'use strict'
  9701. t.exports = Object.freeze({
  9702. OPENED: 'share.open',
  9703. CLOSED: 'share.closed',
  9704. LINK_CLICKED: 'share.linked'
  9705. })
  9706. },
  9707. {}
  9708. ],
  9709. 77: [
  9710. function (e, t, i) {
  9711. 'use strict'
  9712. function n(e) {
  9713. function t(t, i) {
  9714. var n = window.screenY + ($('#player').height() - i) / 2,
  9715. r = window.screenX + ($('#player').width() - t) / 2,
  9716. o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i
  9717. I.emit(l.LINK_CLICKED, {
  9718. channel: e
  9719. }),
  9720. window.open(C[e], 'shareWindow', o)
  9721. }
  9722. switch (e) {
  9723. case y.FACEBOOK:
  9724. t(580, 420)
  9725. break
  9726. case y.TWITTER:
  9727. t(550, 440)
  9728. break
  9729. case y.MAIL:
  9730. I.emit(l.LINK_CLICKED, {
  9731. channel: 'email'
  9732. }),
  9733. window.open(C[e], '_blank')
  9734. break
  9735. case y.LINKEDIN:
  9736. }
  9737. }
  9738. function r(e) {
  9739. I.emit(l.LINK_CLICKED, {
  9740. channel: 'copylink'
  9741. })
  9742. var t = document.createRange()
  9743. t.selectNodeContents(v)
  9744. var i = window.getSelection()
  9745. i.removeAllRanges(),
  9746. i.addRange(t),
  9747. document.execCommand('copy'),
  9748. A.classList.remove('hidden'),
  9749. v.classList.add('highlighted')
  9750. }
  9751. function o(e) {
  9752. ;(e && (e.stopPropagation(), e.target === v)) ||
  9753. (window.getSelection().removeAllRanges(),
  9754. v.classList.remove('highlighted'),
  9755. A.classList.add('hidden'))
  9756. }
  9757. var a = e('../../util/browser'),
  9758. s = e('../../localization/localize'),
  9759. l = e('./ShareEvents'),
  9760. c = e('../../util/common'),
  9761. h = e('events').EventEmitter,
  9762. u = document.getElementById('sharing'),
  9763. d = document.getElementById('share-modal'),
  9764. p = document.getElementById('share-close'),
  9765. f = document.getElementById('facebook-share'),
  9766. g = document.getElementById('twitter-share'),
  9767. m = document.getElementById('mail-share'),
  9768. v = document.getElementById('share-url-text'),
  9769. A = document.getElementById('copy-success'),
  9770. y = Object.freeze({
  9771. FACEBOOK: 'facebook',
  9772. TWITTER: 'twitter',
  9773. MAIL: 'mail',
  9774. LINKEDIN: 'linkedin'
  9775. }),
  9776. C = {}
  9777. ;(C[y.FACEBOOK] =
  9778. 'http://www.facebook.com/sharer.php?u=' +
  9779. encodeURIComponent(window.location.href + '&utm_source=1') +
  9780. '&t='),
  9781. (C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  9782. (C[y.MAIL] = 'mailto:?subject=')
  9783. var I = {
  9784. init: function (e) {
  9785. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ')
  9786. ;(C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  9787. (C[y.TWITTER] +=
  9788. t +
  9789. encodeURIComponent(
  9790. window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port'
  9791. )),
  9792. (C[y.MAIL] +=
  9793. encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) +
  9794. '&body=' +
  9795. t +
  9796. encodeURIComponent(window.location.href + '&utm_source=3')),
  9797. u.addEventListener('click', this.toggle.bind(this)),
  9798. p.addEventListener('click', this.hide.bind(this)),
  9799. v.addEventListener('click', r),
  9800. d.addEventListener('click', o),
  9801. f.addEventListener('click', n.bind(this, y.FACEBOOK)),
  9802. g.addEventListener('click', n.bind(this, y.TWITTER)),
  9803. m.addEventListener('click', n.bind(this, y.MAIL)),
  9804. (v.textContent = window.location.href + '&utm_source=4'),
  9805. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  9806. u.classList.remove('hidden')
  9807. },
  9808. show: function () {
  9809. this.emit(l.OPENED), d.classList.add('fadeIn')
  9810. },
  9811. hide: function () {
  9812. d.classList.contains('fadeIn') &&
  9813. (this.emit(l.CLOSED),
  9814. document.selection && document.selection.empty(),
  9815. window.getSelection().removeAllRanges(),
  9816. o(),
  9817. d.classList.remove('fadeIn'))
  9818. },
  9819. toggle: function () {
  9820. d.classList.contains('fadeIn') ? this.hide() : this.show()
  9821. }
  9822. }
  9823. c.extendObject(I, h.prototype), (t.exports = I)
  9824. },
  9825. {
  9826. '../../localization/localize': 108,
  9827. '../../util/browser': 182,
  9828. '../../util/common': 185,
  9829. './ShareEvents': 76,
  9830. events: 202
  9831. }
  9832. ],
  9833. 78: [
  9834. function (e, t, i) {
  9835. 'use strict'
  9836. t.exports = Object.freeze({
  9837. OPENED: 'terms.opened',
  9838. CLOSED: 'terms.closed'
  9839. })
  9840. },
  9841. {}
  9842. ],
  9843. 79: [
  9844. function (e, t, i) {
  9845. 'use strict'
  9846. var n = e('./TermsEvent'),
  9847. r = e('../../localization/localize'),
  9848. o = e('../../analytics'),
  9849. a = e('../../util/ajax'),
  9850. s = e('../../util/common'),
  9851. l = e('events').EventEmitter,
  9852. c = document.getElementById('terms-modal'),
  9853. h = {
  9854. init: function () {
  9855. $('.footer-terms').on(
  9856. 'click',
  9857. function (e) {
  9858. e.preventDefault(), this.show()
  9859. }.bind(this)
  9860. ),
  9861. $('#terms-modal .close').on('click', this.hide.bind(this))
  9862. },
  9863. show: function () {
  9864. this.emit(n.OPENED),
  9865. a
  9866. .get('static/' + r.TERMS_TEXT_FILE)
  9867. .done(function (e) {
  9868. var t = $('#terms-text').html(e)
  9869. o.track('showcase_gui', {
  9870. gui_action: 'click_terms_button',
  9871. interaction_source: 'gui'
  9872. }),
  9873. t.find('a').attr('target', '_blank')
  9874. })
  9875. .fail(function () {
  9876. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL)
  9877. }),
  9878. c.classList.add('fadeIn')
  9879. },
  9880. hide: function (e) {
  9881. e && e.preventDefault(),
  9882. c.classList.contains('fadeIn') && this.emit(n.CLOSED),
  9883. c.classList.remove('fadeIn')
  9884. }
  9885. }
  9886. s.extendObject(h, l.prototype), (t.exports = h)
  9887. },
  9888. {
  9889. '../../analytics': 4,
  9890. '../../localization/localize': 108,
  9891. '../../util/ajax': 181,
  9892. '../../util/common': 185,
  9893. './TermsEvent': 78,
  9894. events: 202
  9895. }
  9896. ],
  9897. 80: [
  9898. function (e, t, i) {
  9899. 'use strict'
  9900. t.exports = Object.freeze({
  9901. OPEN_INFO: 'title.open.info',
  9902. CLOSE_INFO: 'title.close.info',
  9903. SHOW_INFO: 'title.show.info',
  9904. HIDE_INFO: 'title.hide.info',
  9905. LINK_CLICKED: 'title.link.click',
  9906. CONTACT_LINK_CLICKED: 'title.contact.click',
  9907. ORIGIN_LINK_CLICKED: 'title.origin.click'
  9908. })
  9909. },
  9910. {}
  9911. ],
  9912. 81: [
  9913. function (e, t, i) {
  9914. 'use strict'
  9915. function n(e, t) {
  9916. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  9917. }
  9918. function r(e, t) {
  9919. function i(i) {
  9920. ;(e.shouldShowtags = 'show' === this.value),
  9921. e.shouldShowtags
  9922. ? t.showAlltags(o.tags.startup.fadeInDuration)
  9923. : t.hideAlltags(o.tags.startup.fadeInDuration)
  9924. }
  9925. document.getElementById('tag-toggles').classList.remove('hidden'),
  9926. (document.getElementById('radio-tag-show').checked = !0)
  9927. for (
  9928. var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0;
  9929. r < n.length;
  9930. r++
  9931. )
  9932. n[r].addEventListener('change', i)
  9933. }
  9934. var o = e('../../settings')
  9935. t.exports.init = n
  9936. },
  9937. {
  9938. '../../settings': 166
  9939. }
  9940. ],
  9941. 82: [
  9942. function (e, t, i) {
  9943. ;(function (i) {
  9944. 'use strict'
  9945. function n(e, t) {
  9946. return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
  9947. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  9948. (g_weixinObj.title = e),
  9949. e.length > g.minTooltipCharacters &&
  9950. I.parentElement.setAttribute('data-original-title', e),
  9951. t && 1 !== m.specialEdition && m.brand && !m.mls
  9952. ? (document.getElementById('cobrandTitle').innerText = t)
  9953. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  9954. document.getElementById('gui-name').classList.add('noCoBrand'),
  9955. document.getElementById('cobrandTitle').classList.add('hidden')),
  9956. !0)
  9957. : (document.getElementById('model-title').classList.add('hidden'), !1)
  9958. }
  9959. function r(e) {
  9960. return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden')
  9961. }
  9962. function o(e, t, i, n) {
  9963. if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1))
  9964. return void T.classList.add('hidden')
  9965. L = !0
  9966. var r = [],
  9967. o = c(r, '<br>')
  9968. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  9969. var a = n || t,
  9970. s = u.isMobile()
  9971. ? '<a id="phone" href="callto:' + t + '">' + a + '</a>'
  9972. : '<span>' + a + '</span>'
  9973. o(s)
  9974. }
  9975. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'),
  9976. (r[0] = ''),
  9977. (x.innerHTML = r.join(''))
  9978. }
  9979. function a(e) {
  9980. if ('string' == typeof e)
  9981. try {
  9982. e = JSON.parse(e)
  9983. } catch (e) {
  9984. return (
  9985. y.warn('Unable to parse address data'),
  9986. void S.parentElement.classList.add('hidden')
  9987. )
  9988. }
  9989. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  9990. return void S.parentElement.classList.add('hidden')
  9991. L = !0
  9992. var t = [],
  9993. i = c(t, ' ')
  9994. e.address_1 && i(e.address_1),
  9995. e.address_2 && i(e.address_2),
  9996. e.city && i(e.city, ', '),
  9997. e.state && i(e.state, ', '),
  9998. e.zip && i(e.zip, e.state ? ' ' : ', '),
  9999. (t[0] = ''),
  10000. (S.innerText = t.join(''))
  10001. }
  10002. function s(e) {
  10003. var t = document.createElement('a')
  10004. return (
  10005. (t.id = 'url'),
  10006. (t.target = '_blank'),
  10007. (t.href = e),
  10008. (t.innerText = e),
  10009. t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  10010. t
  10011. )
  10012. }
  10013. function l(e) {
  10014. return (
  10015. !(!e || (u.inIframe() && document.referrer === e)) &&
  10016. (R.classList.remove('hidden'),
  10017. (P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
  10018. P.appendChild(s(e)),
  10019. O.forEach(function (e) {
  10020. e.classList.add('share-link')
  10021. }),
  10022. !0)
  10023. )
  10024. }
  10025. function c(e, t) {
  10026. var i = e,
  10027. n = t
  10028. return function (e, t) {
  10029. i.push(t || n, e)
  10030. }
  10031. }
  10032. function h() {
  10033. document
  10034. .getElementById('title-toggle')
  10035. .addEventListener('click', N.toggleTitle.bind(N)),
  10036. L && I.addEventListener('click', N.toggleMeta.bind(N, !1))
  10037. var e = [].slice.call(_.querySelectorAll('a'))
  10038. e.forEach(function (e) {
  10039. e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED))
  10040. })
  10041. var t = [].slice.call(T.querySelectorAll('a'))
  10042. t.forEach(function (e) {
  10043. e.addEventListener(
  10044. 'click',
  10045. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  10046. contact_type: e.getAttribute('id')
  10047. })
  10048. )
  10049. })
  10050. }
  10051. var u = e('../../util/browser'),
  10052. d = e('../../util/common'),
  10053. p = e('../../util/logger'),
  10054. f = e('../../localization/localize'),
  10055. g = e('./titleBarSettings'),
  10056. m = e('../../settings'),
  10057. v = e('./TitleEvents'),
  10058. A = e('events').EventEmitter,
  10059. y = new p(i),
  10060. C = document.querySelector('.pinTop.left'),
  10061. I = document.getElementsByClassName('title-container')[0],
  10062. E = document.getElementById('title-toggle').querySelector('i'),
  10063. b = document.getElementById('meta-info-wrapper'),
  10064. w = document.getElementById('meta-info'),
  10065. _ = document.getElementById('meta-description'),
  10066. T = document.getElementsByClassName('contact-info')[0],
  10067. x = document.getElementById('contact-data'),
  10068. S = document.getElementById('addressTxt'),
  10069. M = document.getElementById('tag-toggles'),
  10070. R = document.getElementById('share-origin'),
  10071. P = document.getElementById('share-link-wrapper'),
  10072. O = [w, b, I],
  10073. L = !1,
  10074. D = !1,
  10075. N = {
  10076. populate: function (e) {
  10077. if (n(window.DATA.name, e.coBrand)) {
  10078. if (
  10079. (r(e.description),
  10080. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  10081. a(e.address),
  10082. L)
  10083. ) {
  10084. var t = document.createElement('br')
  10085. M.insertBefore(t, M.firstElementChild)
  10086. }
  10087. e.socialSharing && m.share.enabled && (D = l(e.url))
  10088. }
  10089. },
  10090. finishSetup: function (e) {
  10091. ;(L = L || !!e),
  10092. h(),
  10093. L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'))
  10094. },
  10095. toggleMeta: function (e, t) {
  10096. var title = document.getElementById('model-title')
  10097. t && t.preventDefault()
  10098. var i = w.classList.contains('expand')
  10099. ;(e && !i) ||
  10100. (i
  10101. ? (O.forEach(function (e) {
  10102. e.classList.remove('expand')
  10103. }),
  10104. this.emit(v.CLOSE_INFO),
  10105. title.classList.remove('expand'))
  10106. : (O.forEach(function (e) {
  10107. e.classList.add('expand')
  10108. }),
  10109. title.classList.add('expand'),
  10110. this.emit(v.OPEN_INFO)))
  10111. },
  10112. setupToggling: function () {
  10113. ;(b.style.height = w.offsetHeight + 'px'),
  10114. w.addEventListener('transitionend', function () {
  10115. b.style.height = w.offsetHeight + 'px'
  10116. })
  10117. },
  10118. toggleTitle: function (e) {
  10119. e && e.preventDefault(),
  10120. C.classList.contains('closed')
  10121. ? (C.classList.add('open'),
  10122. E.classList.remove('icon-dpad-right'),
  10123. E.classList.add('icon-dpad-left'),
  10124. this.emit(v.SHOW_INFO),
  10125. setTimeout(function () {
  10126. C.classList.remove('closed'), C.classList.remove('open')
  10127. }, g.removeAnimationClasses))
  10128. : (C.classList.add('closed'),
  10129. E.classList.remove('icon-dpad-left'),
  10130. E.classList.add('icon-dpad-right'),
  10131. this.emit(v.HIDE_INFO))
  10132. }
  10133. }
  10134. d.extendObject(N, A.prototype), (t.exports = N)
  10135. }).call(this, '/js/gui/title/titleBar.js')
  10136. },
  10137. {
  10138. '../../localization/localize': 108,
  10139. '../../settings': 166,
  10140. '../../util/browser': 182,
  10141. '../../util/common': 185,
  10142. '../../util/logger': 189,
  10143. './TitleEvents': 80,
  10144. './titleBarSettings': 83,
  10145. events: 202
  10146. }
  10147. ],
  10148. 83: [
  10149. function (e, t, i) {
  10150. 'use strict'
  10151. t.exports = Object.freeze({
  10152. minTooltipCharacters: 19,
  10153. removeAnimationClasses: 500
  10154. })
  10155. },
  10156. {}
  10157. ],
  10158. 84: [
  10159. function (e, t, i) {
  10160. 'use strict'
  10161. function n(e) {
  10162. ;(C = e),
  10163. P.forEach(function (e) {
  10164. b.addEventListener(e, u.bind(this, !1), !0),
  10165. w.addEventListener(e, u.bind(this, !0), !0),
  10166. E.addEventListener(e, stopTour2, !0)
  10167. S.forEach(function (t) {
  10168. //会触发导览停止
  10169. t.addEventListener(e, stopTour, !0)
  10170. })
  10171. $('#drawer img').on(e, stopTour)
  10172. })
  10173. document.addEventListener('keydown', u.bind(this, !1), !0)
  10174. C.on(v.TourStart, function () {
  10175. E.classList.add('playing')
  10176. })
  10177. }
  10178. function play() {
  10179. //r
  10180. // C.playTour(),
  10181. C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn')
  10182. }
  10183. function stopTour2() {
  10184. //o
  10185. E.classList.contains('playing') &&
  10186. (C.stopTour(),
  10187. _.addClass('fadeIn'),
  10188. setTimeout(function () {
  10189. _.removeClass('fadeIn')
  10190. }, p.tourInteraction.showPauseButton),
  10191. O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
  10192. setTimeout(function () {
  10193. E.classList.remove('playing')
  10194. }, p.tourInteraction.allowNextClick))
  10195. }
  10196. function stopTour() {
  10197. //a
  10198. C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'))
  10199. }
  10200. function togglePlay() {
  10201. //s
  10202. T.is(':visible') ? play() : stopTour2()
  10203. }
  10204. function l() {
  10205. x.hasClass('playing') &&
  10206. (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'))
  10207. }
  10208. function c() {
  10209. E.classList.remove('playing'), h()
  10210. }
  10211. function h() {
  10212. //去掉导览结束时的提示
  10213. /* if (!p.tourInteraction.disabled) {
  10214. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  10215. M.addClass("fadeIn tour " + m.deviceType);
  10216. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  10217. if (!p.tourInteraction.smallModal) {
  10218. var t;
  10219. 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,
  10220. m.fill(R, A.TOUR_INTERACTION[t]),
  10221. M.addClass(t)
  10222. }
  10223. M.addClass(e)
  10224. } */
  10225. }
  10226. function u(e, t) {
  10227. if (t) {
  10228. var i = 'keydown' === t.type,
  10229. n = t.which === f.SPACE || C.tourIsPlaying
  10230. ;(i && n) || e || (O = !0),
  10231. C.atEndOfTour() && d(),
  10232. !C.tourIsPlaying &&
  10233. C.tourInProgress &&
  10234. (_.removeClass('fadeIn'), d(), t.which !== f.SPACE && stopTour()),
  10235. i && n && togglePlay() //空格键播放或暂停
  10236. }
  10237. }
  10238. function d() {
  10239. M.removeClass('fadeIn')
  10240. }
  10241. var p = (e('../util/browser'), e('../settings')),
  10242. f = e('../enum/Keys'),
  10243. g = e('../enum/Viewmode'),
  10244. m = (e('./helpManager'), e('./populateModal')),
  10245. v = e('../enum/DirectorEvents'),
  10246. A = e('../enum/HelpModalType'),
  10247. y = e('../enum/HelpModalSize'),
  10248. C = null,
  10249. I = null,
  10250. E = document.getElementById('pause-overlay'),
  10251. b = document.getElementById('player'),
  10252. w = document.getElementById('gui'),
  10253. _ = $('#pause-icon').eq(0),
  10254. T = $('#play').eq(0),
  10255. x = $('#playHead').eq(0),
  10256. S = $(
  10257. '.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan'
  10258. ).toArray(),
  10259. M = $('#interaction-modal').eq(0),
  10260. R = $('#interaction-modal .interaction').toArray(),
  10261. P = ['touchstart', 'mousedown', 'pointerdown'],
  10262. O = !1
  10263. ;(t.exports.init = n),
  10264. (t.exports.play = play),
  10265. (t.exports.pause = stopTour2),
  10266. (t.exports.pauseWithoutCTA = stopTour),
  10267. (t.exports.togglePlay = togglePlay),
  10268. (t.exports.stopTour = l),
  10269. (t.exports.dismissModal = d)
  10270. },
  10271. {
  10272. '../enum/DirectorEvents': 23,
  10273. '../enum/HelpModalSize': 27,
  10274. '../enum/HelpModalType': 28,
  10275. '../enum/Keys': 30,
  10276. '../enum/Viewmode': 51,
  10277. '../settings': 166,
  10278. '../util/browser': 182,
  10279. './helpManager': 68,
  10280. './populateModal': 75
  10281. }
  10282. ],
  10283. 85: [
  10284. function (e, t, i) {
  10285. 'use strict'
  10286. t.exports = Object.freeze({
  10287. OPENED: 'vr.modal.opened',
  10288. LAUNCH: 'vr.modal.launch',
  10289. CLOSED: 'vr.modal.closed',
  10290. NEXT: 'vr.modal.next',
  10291. PREV: 'vr.modal.prev',
  10292. STORE: 'vr.modal.store',
  10293. falseICECHOSEN: 'vr.modal.device'
  10294. })
  10295. },
  10296. {}
  10297. ],
  10298. 86: [
  10299. function (e, t, i) {
  10300. 'use strict'
  10301. function n(e, t, i) {
  10302. function n(e, t, n, r) {
  10303. function o() {
  10304. return p + '&m=' + t + '&display=' + e
  10305. }
  10306. function s() {
  10307. var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
  10308. t = '&utm_source=' + u,
  10309. n = '&utm_showcase_session_id=' + i
  10310. return e + t + n
  10311. }
  10312. function l() {
  10313. return (
  10314. d +
  10315. '&sids=' +
  10316. t +
  10317. '&lsid=' +
  10318. t +
  10319. '&ln=' +
  10320. encodeURIComponent(n) +
  10321. '&ld=' +
  10322. encodeURIComponent(r) +
  10323. '&display=' +
  10324. e
  10325. )
  10326. }
  10327. return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s()
  10328. }
  10329. function r(e, t, i, r) {
  10330. var o = 'https://api.branch.io/v1/url',
  10331. a = n(e, t, i, r),
  10332. s = {
  10333. responseType: 'json',
  10334. data: {
  10335. branch_key: h.appConfig.branch_key,
  10336. data: {
  10337. m: t,
  10338. full_url: a,
  10339. $desktop_url: m,
  10340. $og_app_id: '331853976762864119',
  10341. $og_title: i,
  10342. $og_description: r,
  10343. $og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
  10344. $canonical_url: window.location.href
  10345. }
  10346. }
  10347. }
  10348. c.post(o, s)
  10349. .done(function (t) {
  10350. f[e] = t.url
  10351. })
  10352. .fail(
  10353. function (t) {
  10354. f[e] = t
  10355. }.bind(this, a)
  10356. )
  10357. }
  10358. function o(e, t, i) {
  10359. for (var r in s) {
  10360. var o = s[r],
  10361. a = n(o, e, t, i)
  10362. f[o] = a
  10363. }
  10364. }
  10365. var u = a.inIframe()
  10366. ? encodeURIComponent(document.referrer)
  10367. : encodeURIComponent(window.location.href),
  10368. d = g + '/vr/dlist/?ret=' + u,
  10369. p = g + '/vr/show/?ret=' + u,
  10370. m = ''
  10371. switch (e) {
  10372. case l.IOS:
  10373. r(s.CardboardIOS, t.sid, t.name, t.summary)
  10374. break
  10375. default:
  10376. o(t.sid, t.name, t.summary)
  10377. }
  10378. }
  10379. function r(e) {
  10380. var t = f[e]
  10381. window.open(t, '_blank')
  10382. }
  10383. function o(e) {
  10384. var t = u[e]
  10385. window.open(t, '_blank')
  10386. }
  10387. var a = e('../../util/browser'),
  10388. s = e('../../enum/VRApps'),
  10389. l = e('../../enum/VRPlatforms'),
  10390. c = e('../../util/ajax'),
  10391. h = e('../../settings'),
  10392. u = {}
  10393. ;(u[s.CardboardAndroid] =
  10394. 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  10395. (u[s.CardboardIOS] =
  10396. 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  10397. (u[s.GearVR] =
  10398. 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=')
  10399. for (var d in s) {
  10400. var p = s[d]
  10401. u[p] += encodeURIComponent(document.referrer + '&display=' + p)
  10402. }
  10403. var f = {},
  10404. g = (function () {
  10405. var e = window.location.host
  10406. return (
  10407. e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'),
  10408. 'https://' + e
  10409. )
  10410. })()
  10411. ;(t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o)
  10412. },
  10413. {
  10414. '../../enum/VRApps': 46,
  10415. '../../enum/VRPlatforms': 49,
  10416. '../../settings': 166,
  10417. '../../util/ajax': 181,
  10418. '../../util/browser': 182
  10419. }
  10420. ],
  10421. 87: [
  10422. function (e, t, i) {
  10423. 'use strict'
  10424. function n(e) {
  10425. var t
  10426. switch (e) {
  10427. case m.IOS:
  10428. return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1)
  10429. case m.Android:
  10430. return (
  10431. (t = p.androidVersion()),
  10432. t.major > 4 ||
  10433. (4 === t.major && t.minor > 4) ||
  10434. (4 === t.major && 4 === t.minor && t.patch >= 4)
  10435. )
  10436. }
  10437. return !1
  10438. }
  10439. function r(e, t) {
  10440. function i(e) {
  10441. K.emit(A.STORE, {
  10442. type: e
  10443. }),
  10444. f.launchStore(e)
  10445. }
  10446. function r(e) {
  10447. switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
  10448. case _.Title:
  10449. O.css('display', 'none'), L.text(u[e]), o(s)
  10450. break
  10451. case _.Cardboard:
  10452. O.css('display', 'block'),
  10453. L.text(u[e]),
  10454. M.filter('.cardboard').off(),
  10455. M.filter('.gearvr').off(),
  10456. c(e, s),
  10457. h(H, X, Z)
  10458. break
  10459. case _.Gear:
  10460. L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z)
  10461. break
  10462. case _.pageCount:
  10463. T.removeClass('fadeIn'), K.emit(A.CLOSED)
  10464. }
  10465. B.filter("[src='']").hide()
  10466. }
  10467. var s = (function () {
  10468. return p.detectAndroid()
  10469. ? p.detectAndroidMobile() && n(m.Android)
  10470. ? (T.addClass('supported'), (w = '.show-supported'), m.Android)
  10471. : (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
  10472. : p.detectIPhone() || p.detectIPod()
  10473. ? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
  10474. : (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop)
  10475. })()
  10476. f.init(s, e, t), s !== m.Desktop && T.addClass('mobile')
  10477. var l = function (e) {
  10478. K.emit(A.LAUNCH, {
  10479. vr_platform: s,
  10480. vr_app: e
  10481. }),
  10482. f.launch(e)
  10483. }
  10484. ;(q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  10485. (q.gear = l.bind(this, g.GearVR)),
  10486. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  10487. d(),
  10488. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  10489. $(w).show()
  10490. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  10491. y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done']
  10492. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  10493. $('#vr').on('click', function (e) {
  10494. e.preventDefault()
  10495. player.FlyToMode('panorama', () => {
  10496. if (!window.vrEnabled) {
  10497. // 开启VR
  10498. window.vrEnabled = true
  10499. this.classList.add('active')
  10500. $('#gui div').not('#vrOff').addClass('vrHide')
  10501. $('#vrOffImg').css({ display: 'inline-block' })
  10502. } else {
  10503. }
  10504. })
  10505. })
  10506. let exitVR = function () {
  10507. $('#gui div').not('#vrOff').removeClass('vrHide')
  10508. $('#vrOffImg').css({ display: 'none' })
  10509. $('#player canvas').css({ width: '', height: '' }) // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  10510. $('#vr').removeClass('active') // 清除vr按钮的激活样式
  10511. }
  10512. $('#vrOff').on('click', function () {
  10513. window.vrEnabled = false
  10514. exitVR()
  10515. })
  10516. window.bus.addEventListener('exitWebXR', e => {
  10517. exitVR()
  10518. })
  10519. var I = 'https://my.port.com/vr/show/?m=' + e.sid
  10520. s === m.IOS
  10521. ? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS))
  10522. : $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
  10523. $('.gearLink').on('click', i.bind(this, g.GearVR)),
  10524. $('span.modelLink').text(I),
  10525. O.on('click', function (e) {
  10526. K.emit(A.PREV), b--, r(b)
  10527. }),
  10528. L.on('click', function (e) {
  10529. L.text()
  10530. K.emit(A.NEXT, {
  10531. nextAction: y[b]
  10532. }),
  10533. b++,
  10534. r(b)
  10535. }),
  10536. T.find('.close').on('click', K.dismiss)
  10537. }
  10538. function o(e) {
  10539. switch (e) {
  10540. case m.Android:
  10541. M.filter('.cardboard').off().on('click', q.cardboardAndroid),
  10542. M.filter('.gearvr').off().on('click', q.gear),
  10543. s(H, G, 'logo-button', 'same-line')
  10544. break
  10545. case m.UnsupportedAndroid:
  10546. s('', z, '', '')
  10547. break
  10548. case m.IOS:
  10549. M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '')
  10550. break
  10551. case m.Desktop:
  10552. M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)),
  10553. M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)),
  10554. s(H, G, 'logo-button', 'same-line'),
  10555. Q.cardboard()
  10556. }
  10557. }
  10558. function a(e) {
  10559. $('.p1, .p2, .p3').hide(),
  10560. x.insertAfter(S),
  10561. T.removeClass('front-page'),
  10562. T.removeClass('details-page'),
  10563. T.removeClass('lastPage'),
  10564. M.removeClass('logo-button'),
  10565. M.removeClass('same-line'),
  10566. S.removeClass('headsetOptions'),
  10567. R.attr('src', ''),
  10568. R.filter('.second').removeClass('gear'),
  10569. R.css('display', 'inline-block'),
  10570. R.off(),
  10571. P.filter('.second').css('display', ''),
  10572. D.css('display', 'none'),
  10573. $('.p' + (e + 1) + w).show(),
  10574. R.filter('.third').insertBefore(P.filter('.third'))
  10575. }
  10576. function s(e, t, i, n) {
  10577. T.addClass('front-page'),
  10578. R.filter('.first').attr('src', e),
  10579. R.filter('.second').attr('src', t),
  10580. M.filter('.first').addClass(i),
  10581. M.filter('.second').addClass(i),
  10582. M.addClass(n),
  10583. '.show-desktop' === w && S.insertAfter(x)
  10584. }
  10585. function l(e, t, i) {
  10586. S.addClass('headsetOptions'),
  10587. M.off(),
  10588. R.filter('.second').attr('src', t),
  10589. D.css('display', 'block'),
  10590. P.filter('.second').css('display', 'none'),
  10591. D.on('click', function () {
  10592. a(_.Title), o(m.Desktop)
  10593. }),
  10594. e &&
  10595. (K.emit(A.falseICECHOSEN, {
  10596. name: g.GearVR
  10597. }),
  10598. R.filter('.first').attr('src', e),
  10599. R.filter('.second').addClass('gear'),
  10600. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10601. Q.gearvr()),
  10602. i &&
  10603. (K.emit(A.falseICECHOSEN, {
  10604. name: g.Cardboard
  10605. }),
  10606. R.filter('.third').attr('src', i),
  10607. R.filter('.third').show(),
  10608. R.filter('.third').insertAfter(R.filter('.second')),
  10609. R.filter('.third').addClass('link'),
  10610. R.filter('.second').addClass('link'),
  10611. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10612. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
  10613. Q.cardboard())
  10614. }
  10615. function c(e, t) {
  10616. switch (t) {
  10617. case m.IOS:
  10618. ;(X = Y), (Z = j)
  10619. break
  10620. case m.Desktop:
  10621. e === _.Cardboard
  10622. ? ((X = F),
  10623. (Z = U),
  10624. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10625. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
  10626. : ((X = V),
  10627. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10628. (Z = ''))
  10629. break
  10630. default:
  10631. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W))
  10632. }
  10633. }
  10634. function h(e, t, i) {
  10635. T.find('.inner').addClass('details-page'),
  10636. T.addClass('details-page'),
  10637. R.filter('.first').attr('src', e),
  10638. R.filter('.second').attr('src', t),
  10639. R.filter('.third').attr('src', i)
  10640. }
  10641. function u() {
  10642. T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED))
  10643. }
  10644. function d() {
  10645. var e = p.aspectRatio() > 1 && p.isMobile()
  10646. T.toggleClass('landscape', e).toggleClass('portrait', !e),
  10647. T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
  10648. T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight)
  10649. }
  10650. var p = e('../../util/browser'),
  10651. f = e('./vrLink'),
  10652. g = e('../../enum/VRApps'),
  10653. m = e('../../enum/VRPlatforms'),
  10654. v = e('../../enum/VRPages'),
  10655. A = e('./vrEvent'),
  10656. y = (e('../../settings'), e('../../constants')),
  10657. C = e('../../localization/localize'),
  10658. I = e('../../util/common'),
  10659. E = e('events').EventEmitter,
  10660. b = 0,
  10661. w = null,
  10662. _ = v.standard,
  10663. T = $('.vr-popup'),
  10664. x = T.find('.vr-popup-body'),
  10665. S = T.find('.vr-images'),
  10666. M = T.find('.img-container'),
  10667. R = T.find('.vr-sm-image'),
  10668. P = M.find('.vr-img-caption'),
  10669. O = $('.vr-buttons').find('.prev-button'),
  10670. L = $('.vr-buttons').find('.next-button'),
  10671. D = S.find('.front-close'),
  10672. N = $('.vr-page'),
  10673. B = T.find('img'),
  10674. F = 'images/apple-store.png',
  10675. V = 'images/badge-oculus.png',
  10676. U = 'images/badge-cardboard.png',
  10677. k = 'images/logo-samsung.png',
  10678. H = 'images/headset-cardboard.png',
  10679. G = 'images/headset-gearvr.png',
  10680. z = 'images/ico-android-robot.png',
  10681. W = 'images/ico-gearvr.png',
  10682. j = 'images/ico-vr.png',
  10683. Y = 'images/apple-logo-white.svg',
  10684. X = null,
  10685. Z = null,
  10686. q = {},
  10687. K = {
  10688. init: r,
  10689. dismiss: u,
  10690. isDeviceSupported: n
  10691. }
  10692. I.extendObject(K, E.prototype), $(window).resize(d)
  10693. var Q = (function () {
  10694. var e = P.filter('.first').find('.cardboard'),
  10695. t = P.filter('.first').find('.gearvr')
  10696. return {
  10697. cardboard: function () {
  10698. t.addClass('hidden'), e.removeClass('hidden')
  10699. },
  10700. gearvr: function () {
  10701. e.addClass('hidden'), t.removeClass('hidden')
  10702. }
  10703. }
  10704. })()
  10705. t.exports = K
  10706. },
  10707. {
  10708. '../../constants': 8,
  10709. '../../enum/VRApps': 46,
  10710. '../../enum/VRPages': 48,
  10711. '../../enum/VRPlatforms': 49,
  10712. '../../localization/localize': 108,
  10713. '../../settings': 166,
  10714. '../../util/browser': 182,
  10715. '../../util/common': 185,
  10716. './vrEvent': 85,
  10717. './vrLink': 86,
  10718. events: 202
  10719. }
  10720. ],
  10721. 88: [
  10722. function (e, t, i) {
  10723. 'use strict'
  10724. t.exports = Object.freeze({
  10725. OPENED: 'webvr.modal.opened',
  10726. SHOW_TERMS: 'webvr.footer.show.terms'
  10727. })
  10728. },
  10729. {}
  10730. ],
  10731. 89: [
  10732. function (e, t, i) {
  10733. ;(function (i) {
  10734. 'use strict'
  10735. function n(e, t, i, n) {
  10736. function r(e) {
  10737. e.preventDefault(), a(e.currentTarget.id)
  10738. }
  10739. function a(e) {
  10740. ne[e](),
  10741. Object.keys(ne).map(function (t, i) {
  10742. $('#' + t).toggleClass('tabs-underlined', t === e)
  10743. })
  10744. }
  10745. ;(y = i), (v = t), w.init(E.Android, e, n), m()
  10746. var l = new RegExp('daydream', 'i'),
  10747. c = l.test(y.displayName)
  10748. c
  10749. ? (a('tabdaydream'),
  10750. B.filter('.device-headset-side').attr('src', H),
  10751. D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
  10752. : (a('tabcardboard'),
  10753. B.filter('.device-headset-side').attr('src', Y),
  10754. D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
  10755. $('#vr').on('click', function (e) {
  10756. e.preventDefault(),
  10757. g('click_webvr_button'),
  10758. L.is(':hidden') && (ie.emit(_.OPENED), o())
  10759. }),
  10760. $('.webvr-popup .close').on('click', function (e) {
  10761. e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s()
  10762. }),
  10763. $('#tabcardboard').on('click', r),
  10764. $('#tabdaydream').on('click', r),
  10765. $('#tabnative').on('click', r),
  10766. $('.webvr-popup .open-with-app').on('click', function (e) {
  10767. e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p()
  10768. }),
  10769. $('.webvr-popup .help').on('click', function (e) {
  10770. e.preventDefault(),
  10771. g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'),
  10772. p()
  10773. }),
  10774. $('.webvr-popup .terms').on('click', function (e) {
  10775. e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS)
  10776. }),
  10777. F.on('click', function (e) {
  10778. e.preventDefault(), g(ee), window.open(J, '_blank')
  10779. }),
  10780. V.on('click', function (e) {
  10781. e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank')
  10782. }),
  10783. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  10784. e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid)
  10785. }),
  10786. $('.webvr-popup .badge-oculus').on('click', function (e) {
  10787. e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR)
  10788. })
  10789. }
  10790. function r() {
  10791. function e() {
  10792. y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e))
  10793. }
  10794. R.info('Headset mounted'), v.suspend()
  10795. var t = document.createElement('canvas')
  10796. for (
  10797. t.getContext('webgl'),
  10798. t.className = 'webvr-canvas',
  10799. document.bgColor = '#000',
  10800. document.body.style.backgroundColor = '#000';
  10801. document.body.firstChild;
  10802. )
  10803. document.body.removeChild(document.body.firstChild)
  10804. document.body.appendChild(t),
  10805. g('webvr_enter_app'),
  10806. y
  10807. .requestPresent([
  10808. {
  10809. source: t,
  10810. predistorted: !0
  10811. }
  10812. ])
  10813. .catch(function (t) {
  10814. R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e()
  10815. }),
  10816. A.then(function () {
  10817. window.dispatchEvent(new Event('vrapp-start'))
  10818. }),
  10819. window.addEventListener('vrdisplaypresentchange', e)
  10820. }
  10821. function o() {
  10822. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a()
  10823. }
  10824. function a() {
  10825. if (!A) {
  10826. var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
  10827. t = 'https://static.port.com/webvr/' + e + '/js/main.js'
  10828. A = new Promise(function (e, i) {
  10829. var n = document.createElement('script')
  10830. ;(n.type = 'text/javascript'),
  10831. (n.src = t),
  10832. (n.onload = e),
  10833. document.head.appendChild(n)
  10834. })
  10835. }
  10836. D.find('.enter-button').on('click', r)
  10837. }
  10838. function s() {
  10839. g('webvr_modal_close'),
  10840. D.find('.enter-button').off('click', r),
  10841. L.fadeOut(I.guiAnimationSpeed, function () {
  10842. D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen()
  10843. }),
  10844. O.fadeIn(I.guiAnimationSpeed)
  10845. }
  10846. function l() {
  10847. k.toggleClass('hidden', !1), U.toggleClass('hidden', !0)
  10848. }
  10849. function c() {
  10850. k.toggleClass('hidden', !0), U.toggleClass('hidden', !1)
  10851. }
  10852. function h() {
  10853. B.filter('.device-headset').attr('src', G),
  10854. B.filter('.device-phone').attr('src', z),
  10855. (J = Z),
  10856. (ee = K),
  10857. F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
  10858. V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
  10859. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  10860. c()
  10861. }
  10862. function u() {
  10863. B.filter('.badge-cardboard').attr('src', j),
  10864. B.filter('.badge-oculus').attr('src', X),
  10865. l()
  10866. }
  10867. function d() {
  10868. B.filter('.device-headset').attr('src', Y),
  10869. B.filter('.device-phone').attr('src', W),
  10870. (J = q),
  10871. (ee = Q),
  10872. F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
  10873. V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  10874. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  10875. c()
  10876. }
  10877. function p() {
  10878. D.toggleClass('hidden'), N.toggleClass('hidden')
  10879. }
  10880. function f() {
  10881. R.info('exiting webVR'),
  10882. g('webvr_exit_app'),
  10883. window.location.search.indexOf('&qs=1') === -1
  10884. ? (window.location = window.location + '&qs=1')
  10885. : (window.location = window.location)
  10886. }
  10887. function g(e) {
  10888. var t = C.isLandscape() ? 'landscape' : 'portrait'
  10889. T.trackAlways('showcase_gui', {
  10890. gui_action: e,
  10891. orientation: t
  10892. })
  10893. }
  10894. function m() {
  10895. var e = C.isLandscape()
  10896. L.toggleClass('landscape', e).toggleClass('portrait', !e)
  10897. }
  10898. var v,
  10899. A,
  10900. y,
  10901. C = e('../../util/browser'),
  10902. I = e('../../settings'),
  10903. E = (e('./../gui'), e('../../enum/VRPlatforms')),
  10904. b = e('../../enum/VRApps'),
  10905. w = e('./../vr/vrLink'),
  10906. _ = e('./WebVrEvent'),
  10907. T = e('../../analytics'),
  10908. x = (e('../../constants'), e('../../localization/localize')),
  10909. S = e('../../util/common'),
  10910. M = e('../../util/logger'),
  10911. R = new M(i),
  10912. P = e('events').EventEmitter,
  10913. O = $('#gui'),
  10914. L = $('.webvr-popup'),
  10915. D = $('.webvr-popup .page.p1'),
  10916. N = $('.webvr-popup .page.p2'),
  10917. B = L.find('.image'),
  10918. F = $('.webvr-popup .detail.headset'),
  10919. V = $('.webvr-popup .detail.phone'),
  10920. U = $('.webvr-popup .tab-content.webvr'),
  10921. k = $('.webvr-popup .tab-content.native'),
  10922. H = 'images/device-daydream-side.png',
  10923. G = 'images/device-daydream.png',
  10924. z = 'images/device-pixel.png',
  10925. W = 'images/ico-android-robot.png',
  10926. j = 'images/badge-cardboard.png',
  10927. Y = 'images/headset-cardboard.png',
  10928. X = 'images/badge-oculus.png',
  10929. Z = 'https://madeby.google.com/vr/',
  10930. q = 'https://vr.google.com/cardboard/get-cardboard/',
  10931. K = 'webvr_daydream_link',
  10932. Q = 'webvr_cardboard_link',
  10933. J = Z,
  10934. ee = K,
  10935. te = 'https://vr.google.com/daydream/phones/',
  10936. ie = {
  10937. init: n
  10938. },
  10939. ne = {
  10940. tabcardboard: d,
  10941. tabdaydream: h,
  10942. tabnative: u
  10943. }
  10944. S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie)
  10945. }).call(this, '/js/gui/webvr/webVRgui.js')
  10946. },
  10947. {
  10948. '../../analytics': 4,
  10949. '../../constants': 8,
  10950. '../../enum/VRApps': 46,
  10951. '../../enum/VRPlatforms': 49,
  10952. '../../localization/localize': 108,
  10953. '../../settings': 166,
  10954. '../../util/browser': 182,
  10955. '../../util/common': 185,
  10956. '../../util/logger': 189,
  10957. './../gui': 65,
  10958. './../vr/vrLink': 86,
  10959. './WebVrEvent': 88,
  10960. events: 202
  10961. }
  10962. ],
  10963. 90: [
  10964. function (e, t, i) {
  10965. 'use strict'
  10966. function n(e, t, i, n, o) {
  10967. n || 0 === n ? (this.floorId = n) : (this.floorId = -1),
  10968. (this.roomId = o || ''),
  10969. (this.labelId = e),
  10970. (this.position = new r.Vector3().copy(t)),
  10971. (this.text = i)
  10972. }
  10973. var r = e('three'),
  10974. o = e('../util/browser')
  10975. ;(n.prototype.build = function () {
  10976. var e = window.document.createElement('div')
  10977. o.isMobile()
  10978. ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile')
  10979. : e.setAttribute('class', 'gui-floorplan-label')
  10980. var t = window.document.createElement('div')
  10981. t.setAttribute('class', 'gui-floorplan-label-text')
  10982. var i = window.document.createTextNode(this.text)
  10983. t.appendChild(i),
  10984. e.appendChild(t),
  10985. window.document.body.appendChild(e),
  10986. (this.labelGui = e),
  10987. (this.textBlock = t),
  10988. $(this.labelGui).hide()
  10989. var n = window.getComputedStyle(this.labelGui)
  10990. this.initialTransform = n.transform || n.webkitTransform
  10991. }),
  10992. (t.exports = n)
  10993. },
  10994. {
  10995. '../util/browser': 182,
  10996. three: 217
  10997. }
  10998. ],
  10999. 91: [
  11000. function (e, t, i) {
  11001. 'use strict'
  11002. function n() {
  11003. ;(this.player = null), (this.modelManager = null), (this.container = null)
  11004. }
  11005. var r = e('three'),
  11006. o = (e('../util/common'), e('../enum/PlayerEvents')),
  11007. a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  11008. s = e('../settings'),
  11009. l = e('../enum/Viewmode'),
  11010. c =
  11011. (e('../enum/WarpStyle'),
  11012. e('../util/transitions'),
  11013. e('../util/lerp'),
  11014. e('../util/browser'))
  11015. //场景初始化
  11016. ;(n.prototype.init = function (e, t, i) {
  11017. ;(this.player = e),
  11018. (this.modelManager = t),
  11019. (this.container = i),
  11020. this.updateModel(),
  11021. this.bindEvents()
  11022. }),
  11023. (n.prototype.bindEvents = function () {
  11024. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  11025. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  11026. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  11027. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  11028. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  11029. }),
  11030. (n.prototype.updateModel = function () {
  11031. this.model = this.modelManager.getActiveModel()
  11032. }),
  11033. (n.prototype.handlePlayerViewChanged = function () {
  11034. this.updateLabelVisibility(), this.updateLabelDisplay()
  11035. }),
  11036. (n.prototype.getLabelsForFloor = function (e, t) {
  11037. return (
  11038. (t = t || []),
  11039. (t.length = 0),
  11040. this.model.labels.forEach(
  11041. function (i) {
  11042. this.labelVisibleForFloor(i, e) && t.push(i)
  11043. }.bind(this)
  11044. ),
  11045. t
  11046. )
  11047. }),
  11048. (n.prototype.getLabelsForCurrentFloor = function (e) {
  11049. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  11050. }),
  11051. (n.prototype.labelVisibleForFloor = function (e, t) {
  11052. var i =
  11053. (c.isMobile() &&
  11054. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) ||
  11055. (!c.isMobile() &&
  11056. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop)
  11057. if (!this.model.showingLabels || !e.labelGui || !i) return !1
  11058. var n = e.floorId === this.model.floors.size() - 1
  11059. return this.model.allFloorsVisible ? n : e.floorId === t
  11060. }),
  11061. (n.prototype.updateLabelVisibility = function (e) {
  11062. this.model.labels.forEach(
  11063. function (e) {
  11064. this.supportedMode() &&
  11065. this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  11066. ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
  11067. : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  11068. }.bind(this)
  11069. )
  11070. }),
  11071. (n.prototype.showAllLabels = function (e, t) {
  11072. this.model.labels.forEach(
  11073. function (i) {
  11074. this.showLabel(i, e, t)
  11075. }.bind(this)
  11076. )
  11077. }),
  11078. (n.prototype.hideAllLabels = function (e, t) {
  11079. this.model.labels.forEach(
  11080. function (i) {
  11081. this.hideLabel(i, e, t)
  11082. }.bind(this)
  11083. )
  11084. }),
  11085. (n.prototype.showLabel = function (e, t, i) {
  11086. this.model.showingLabels &&
  11087. (e.visible ||
  11088. ((e.visible = !0),
  11089. (e.labelGui.style.display = 'block'),
  11090. (e.labelGui.style.opacity = 0),
  11091. $(e.labelGui).delay(t).fadeTo(i, 1)))
  11092. }),
  11093. (n.prototype.hideLabel = function (e, t, i) {
  11094. e.visible &&
  11095. ((e.visible = !1),
  11096. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  11097. }),
  11098. (n.prototype.supportedMode = function () {
  11099. return this.player.mode === l.FLOORPLAN
  11100. }),
  11101. (n.prototype.updateLabelDisplay = (function () {
  11102. var e = (new r.Vector3(), new r.Vector3(), [])
  11103. return function () {
  11104. var t = this.player.getLabelScaleFactor(),
  11105. i = 0.6,
  11106. n = 1.2,
  11107. r = (1 - t) * n + i,
  11108. o = c.isMobile()
  11109. ? s.labels.zoomTruncateThreshhold.mobile
  11110. : s.labels.zoomTruncateThreshhold.desktop
  11111. this.getLabelsForCurrentFloor(e)
  11112. for (var a = 0; a < e.length; a++) {
  11113. var l = e[a]
  11114. this.supportedMode() &&
  11115. l.labelGui &&
  11116. (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  11117. t >= o && l.text.length >= s.labels.minLengthForTruncate
  11118. ? (l.textBlock.innerText =
  11119. l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
  11120. : (l.textBlock.innerText = l.text))
  11121. }
  11122. }
  11123. })()),
  11124. (n.prototype.updateProjectedGuiElement = (function () {
  11125. var e = new r.Vector3()
  11126. new r.Vector3()
  11127. return function (t, i, n, r, o) {
  11128. i.style.fontSize = 100 * o + '%'
  11129. var a = $('#player').width(),
  11130. s = $('#player').height(),
  11131. l = 0.5 * a,
  11132. c = 0.5 * s
  11133. e.copy(n), e.project(this.player.camera)
  11134. var h = e.x * l + l,
  11135. u = -(e.y * c) + c
  11136. ;(h -= t.offsetWidth / 2),
  11137. (u -= t.offsetHeight / 2),
  11138. (t.style.left = h + 'px'),
  11139. (t.style.top = u + 'px')
  11140. }
  11141. })()),
  11142. (n.prototype.handleStartInside = function (e) {
  11143. this.updateLabelVisibility()
  11144. }),
  11145. (n.prototype.handleStartOutside = function () {
  11146. this.updateLabelVisibility()
  11147. }),
  11148. (t.exports = n)
  11149. },
  11150. {
  11151. '../enum/DirectorEvents': 23,
  11152. '../enum/ModelManagerEvents': 33,
  11153. '../enum/PlayerEvents': 40,
  11154. '../enum/Viewmode': 51,
  11155. '../enum/WarpStyle': 52,
  11156. '../settings': 166,
  11157. '../util/browser': 182,
  11158. '../util/common': 185,
  11159. '../util/lerp': 188,
  11160. '../util/transitions': 195,
  11161. three: 217
  11162. }
  11163. ],
  11164. 92: [
  11165. function (e, t, i) {
  11166. 'use strict'
  11167. Array.prototype.findIndex ||
  11168. (Array.prototype.findIndex = function (e) {
  11169. if (null == this)
  11170. throw new TypeError('Array.prototype.findIndex called on null or undefined')
  11171. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  11172. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  11173. if (((t = i[o]), e.call(r, t, o, i))) return o
  11174. return -1
  11175. }),
  11176. Array.prototype.find ||
  11177. Object.defineProperty(Array.prototype, 'find', {
  11178. value: function (e) {
  11179. if (null == this) throw new TypeError('"this" is null or not defined')
  11180. var t = Object(this),
  11181. i = t.length >>> 0
  11182. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  11183. for (var n = arguments[1], r = 0; r < i; ) {
  11184. var o = t[r]
  11185. if (e.call(n, o, r, t)) return o
  11186. r++
  11187. }
  11188. }
  11189. })
  11190. },
  11191. {}
  11192. ],
  11193. 93: [
  11194. function (e, t, i) {
  11195. 'use strict'
  11196. var n = n || {}
  11197. ;(t.exports = n),
  11198. (n.gui = n.gui || {}),
  11199. (n.utils = n.utils || {}),
  11200. (n.controllers = n.controllers || {}),
  11201. (n.dom = n.dom || {}),
  11202. (n.color = n.color || {}),
  11203. (n.utils.css = (function () {
  11204. return {
  11205. load: function (e, t) {
  11206. t = t || document
  11207. var i = t.createElement('link')
  11208. ;(i.type = 'text/css'),
  11209. (i.rel = 'stylesheet'),
  11210. (i.href = e),
  11211. t.getElementsByTagName('head')[0].appendChild(i)
  11212. },
  11213. inject: function (e, t) {
  11214. t = t || document
  11215. var i = document.createElement('style')
  11216. ;(i.type = 'text/css'),
  11217. (i.innerHTML = e),
  11218. t.getElementsByTagName('head')[0].appendChild(i)
  11219. }
  11220. }
  11221. })()),
  11222. (n.utils.common = (function () {
  11223. var e = Array.prototype.forEach,
  11224. t = Array.prototype.slice
  11225. return {
  11226. BREAK: {},
  11227. extend: function (e) {
  11228. return (
  11229. this.each(
  11230. t.call(arguments, 1),
  11231. function (t) {
  11232. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i])
  11233. },
  11234. this
  11235. ),
  11236. e
  11237. )
  11238. },
  11239. defaults: function (e) {
  11240. return (
  11241. this.each(
  11242. t.call(arguments, 1),
  11243. function (t) {
  11244. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i])
  11245. },
  11246. this
  11247. ),
  11248. e
  11249. )
  11250. },
  11251. compose: function () {
  11252. var e = t.call(arguments)
  11253. return function () {
  11254. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  11255. i = [e[n].apply(this, i)]
  11256. return i[0]
  11257. }
  11258. },
  11259. each: function (t, i, n) {
  11260. if (t)
  11261. if (e && t.forEach && t.forEach === e) t.forEach(i, n)
  11262. else if (t.length === t.length + 0) {
  11263. for (var r = 0, o = t.length; r < o; r++)
  11264. if (r in t && i.call(n, t[r], r) === this.BREAK) return
  11265. } else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return
  11266. },
  11267. defer: function (e) {
  11268. setTimeout(e, 0)
  11269. },
  11270. toArray: function (e) {
  11271. return e.toArray ? e.toArray() : t.call(e)
  11272. },
  11273. isUndefined: function (e) {
  11274. return void 0 === e
  11275. },
  11276. isNull: function (e) {
  11277. return null === e
  11278. },
  11279. isNaN: function (e) {
  11280. return e !== e
  11281. },
  11282. isArray:
  11283. Array.isArray ||
  11284. function (e) {
  11285. return e.constructor === Array
  11286. },
  11287. isObject: function (e) {
  11288. return e === Object(e)
  11289. },
  11290. isNumber: function (e) {
  11291. return e === e + 0
  11292. },
  11293. isString: function (e) {
  11294. return e === e + ''
  11295. },
  11296. isBoolean: function (e) {
  11297. return e === !1 || e === !0
  11298. },
  11299. isFunction: function (e) {
  11300. return '[object Function]' === Object.prototype.toString.call(e)
  11301. }
  11302. }
  11303. })()),
  11304. (n.controllers.Controller = (function (e) {
  11305. var t = function (e, t) {
  11306. ;(this.initialValue = e[t]),
  11307. (this.domElement = document.createElement('div')),
  11308. (this.object = e),
  11309. (this.property = t),
  11310. (this.__onChange = void 0),
  11311. (this.__onFinishChange = void 0)
  11312. }
  11313. return (
  11314. e.extend(t.prototype, {
  11315. onChange: function (e) {
  11316. return (this.__onChange = e), this
  11317. },
  11318. onFinishChange: function (e) {
  11319. return (this.__onFinishChange = e), this
  11320. },
  11321. setValue: function (e) {
  11322. return (
  11323. (this.object[this.property] = e),
  11324. this.__onChange && this.__onChange.call(this, e),
  11325. this.updateDisplay(),
  11326. this
  11327. )
  11328. },
  11329. getValue: function () {
  11330. return this.object[this.property]
  11331. },
  11332. updateDisplay: function () {
  11333. return this
  11334. },
  11335. isModified: function () {
  11336. return this.initialValue !== this.getValue()
  11337. }
  11338. }),
  11339. t
  11340. )
  11341. })(n.utils.common)),
  11342. (n.dom.dom = (function (e) {
  11343. function t(t) {
  11344. if ('0' === t || e.isUndefined(t)) return 0
  11345. var i = t.match(r)
  11346. return e.isNull(i) ? 0 : parseFloat(i[1])
  11347. }
  11348. var i = {
  11349. HTMLEvents: ['change'],
  11350. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  11351. KeyboardEvents: ['keydown']
  11352. },
  11353. n = {}
  11354. e.each(i, function (t, i) {
  11355. e.each(t, function (e) {
  11356. n[e] = i
  11357. })
  11358. })
  11359. var r = /(\d+(\.\d+)?)px/,
  11360. o = {
  11361. makeSelectable: function (e, t) {
  11362. void 0 !== e &&
  11363. void 0 !== e.style &&
  11364. ((e.onselectstart = t
  11365. ? function () {
  11366. return !1
  11367. }
  11368. : function () {}),
  11369. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  11370. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  11371. (e.unselectable = t ? 'on' : 'off'))
  11372. },
  11373. makeFullscreen: function (t, i, n) {
  11374. e.isUndefined(i) && (i = !0),
  11375. e.isUndefined(n) && (n = !0),
  11376. (t.style.position = 'absolute'),
  11377. i && ((t.style.left = 0), (t.style.right = 0)),
  11378. n && ((t.style.top = 0), (t.style.bottom = 0))
  11379. },
  11380. fakeEvent: function (t, i, r, o) {
  11381. r = r || {}
  11382. var a = n[i]
  11383. if (!a) throw new Error('Event type ' + i + ' not supported.')
  11384. var s = document.createEvent(a)
  11385. switch (a) {
  11386. case 'MouseEvents':
  11387. var l = r.x || r.clientX || 0,
  11388. c = r.y || r.clientY || 0
  11389. s.initMouseEvent(
  11390. i,
  11391. r.bubbles || !1,
  11392. r.cancelable || !0,
  11393. window,
  11394. r.clickCount || 1,
  11395. 0,
  11396. 0,
  11397. l,
  11398. c,
  11399. !1,
  11400. !1,
  11401. !1,
  11402. !1,
  11403. 0,
  11404. null
  11405. )
  11406. break
  11407. case 'KeyboardEvents':
  11408. var h = s.initKeyboardEvent || s.initKeyEvent
  11409. e.defaults(r, {
  11410. cancelable: !0,
  11411. ctrlKey: !1,
  11412. altKey: !1,
  11413. shiftKey: !1,
  11414. metaKey: !1,
  11415. keyCode: void 0,
  11416. charCode: void 0
  11417. }),
  11418. h(
  11419. i,
  11420. r.bubbles || !1,
  11421. r.cancelable,
  11422. window,
  11423. r.ctrlKey,
  11424. r.altKey,
  11425. r.shiftKey,
  11426. r.metaKey,
  11427. r.keyCode,
  11428. r.charCode
  11429. )
  11430. break
  11431. default:
  11432. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  11433. }
  11434. e.defaults(s, o), t.dispatchEvent(s)
  11435. },
  11436. bind: function (e, t, i, n) {
  11437. return (
  11438. (n = n || !1),
  11439. e.addEventListener
  11440. ? e.addEventListener(t, i, n)
  11441. : e.attachEvent && e.attachEvent('on' + t, i),
  11442. o
  11443. )
  11444. },
  11445. unbind: function (e, t, i, n) {
  11446. return (
  11447. (n = n || !1),
  11448. e.removeEventListener
  11449. ? e.removeEventListener(t, i, n)
  11450. : e.detachEvent && e.detachEvent('on' + t, i),
  11451. o
  11452. )
  11453. },
  11454. addClass: function (e, t) {
  11455. if (void 0 === e.className) e.className = t
  11456. else if (e.className !== t) {
  11457. var i = e.className.split(/ +/)
  11458. i.indexOf(t) == -1 &&
  11459. (i.push(t),
  11460. (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')))
  11461. }
  11462. return o
  11463. },
  11464. removeClass: function (e, t) {
  11465. if (t)
  11466. if (void 0 === e.className);
  11467. else if (e.className === t) e.removeAttribute('class')
  11468. else {
  11469. var i = e.className.split(/ +/),
  11470. n = i.indexOf(t)
  11471. n != -1 && (i.splice(n, 1), (e.className = i.join(' ')))
  11472. }
  11473. else e.className = void 0
  11474. return o
  11475. },
  11476. hasClass: function (e, t) {
  11477. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1
  11478. },
  11479. getWidth: function (e) {
  11480. var i = getComputedStyle(e)
  11481. return (
  11482. t(i['border-left-width']) +
  11483. t(i['border-right-width']) +
  11484. t(i['padding-left']) +
  11485. t(i['padding-right']) +
  11486. t(i.width)
  11487. )
  11488. },
  11489. getHeight: function (e) {
  11490. var i = getComputedStyle(e)
  11491. return (
  11492. t(i['border-top-width']) +
  11493. t(i['border-bottom-width']) +
  11494. t(i['padding-top']) +
  11495. t(i['padding-bottom']) +
  11496. t(i.height)
  11497. )
  11498. },
  11499. getOffset: function (e) {
  11500. var t = {
  11501. left: 0,
  11502. top: 0
  11503. }
  11504. if (e.offsetParent)
  11505. do (t.left += e.offsetLeft), (t.top += e.offsetTop)
  11506. while ((e = e.offsetParent))
  11507. return t
  11508. },
  11509. isActive: function (e) {
  11510. return e === document.activeElement && (e.type || e.href)
  11511. }
  11512. }
  11513. return o
  11514. })(n.utils.common)),
  11515. (n.controllers.OptionController = (function (e, t, i) {
  11516. var n = function (e, r, o) {
  11517. n.superclass.call(this, e, r)
  11518. var a = this
  11519. if (((this.__select = document.createElement('select')), i.isArray(o))) {
  11520. var s = {}
  11521. i.each(o, function (e) {
  11522. s[e] = e
  11523. }),
  11524. (o = s)
  11525. }
  11526. i.each(o, function (e, t) {
  11527. var i = document.createElement('option')
  11528. ;(i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i)
  11529. }),
  11530. this.updateDisplay(),
  11531. t.bind(this.__select, 'change', function () {
  11532. var e = this.options[this.selectedIndex].value
  11533. a.setValue(e)
  11534. }),
  11535. this.domElement.appendChild(this.__select)
  11536. }
  11537. return (
  11538. (n.superclass = e),
  11539. i.extend(n.prototype, e.prototype, {
  11540. setValue: function (e) {
  11541. var t = n.superclass.prototype.setValue.call(this, e)
  11542. return (
  11543. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  11544. )
  11545. },
  11546. updateDisplay: function () {
  11547. return (
  11548. (this.__select.value = this.getValue()),
  11549. n.superclass.prototype.updateDisplay.call(this)
  11550. )
  11551. }
  11552. }),
  11553. n
  11554. )
  11555. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11556. (n.controllers.NumberController = (function (e, t) {
  11557. function i(e) {
  11558. return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0
  11559. }
  11560. var n = function (e, r, o) {
  11561. n.superclass.call(this, e, r),
  11562. (o = o || {}),
  11563. (this.__min = o.min),
  11564. (this.__max = o.max),
  11565. (this.__step = o.step),
  11566. t.isUndefined(this.__step)
  11567. ? 0 == this.initialValue
  11568. ? (this.__impliedStep = 1)
  11569. : (this.__impliedStep =
  11570. Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  11571. : (this.__impliedStep = this.__step),
  11572. (this.__precision = i(this.__impliedStep))
  11573. }
  11574. return (
  11575. (n.superclass = e),
  11576. t.extend(n.prototype, e.prototype, {
  11577. setValue: function (e) {
  11578. return (
  11579. void 0 !== this.__min && e < this.__min
  11580. ? (e = this.__min)
  11581. : void 0 !== this.__max && e > this.__max && (e = this.__max),
  11582. void 0 !== this.__step &&
  11583. e % this.__step != 0 &&
  11584. (e = Math.round(e / this.__step) * this.__step),
  11585. n.superclass.prototype.setValue.call(this, e)
  11586. )
  11587. },
  11588. min: function (e) {
  11589. return (this.__min = e), this
  11590. },
  11591. max: function (e) {
  11592. return (this.__max = e), this
  11593. },
  11594. step: function (e) {
  11595. return (
  11596. (this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
  11597. )
  11598. }
  11599. }),
  11600. n
  11601. )
  11602. })(n.controllers.Controller, n.utils.common)),
  11603. (n.controllers.NumberControllerBox = (function (e, t, i) {
  11604. function n(e, t) {
  11605. var i = Math.pow(10, t)
  11606. return Math.round(e * i) / i
  11607. }
  11608. var r = function (e, n, o) {
  11609. function a() {
  11610. var e = parseFloat(d.__input.value)
  11611. i.isNaN(e) || d.setValue(e)
  11612. }
  11613. function s() {
  11614. a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  11615. }
  11616. function l(e) {
  11617. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY)
  11618. }
  11619. function c(e) {
  11620. var t = u - e.clientY
  11621. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY)
  11622. }
  11623. function h() {
  11624. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h)
  11625. }
  11626. ;(this.__truncationSuspended = !1), r.superclass.call(this, e, n, o)
  11627. var u,
  11628. d = this
  11629. ;(this.__input = document.createElement('input')),
  11630. this.__input.setAttribute('type', 'text'),
  11631. t.bind(this.__input, 'change', a),
  11632. t.bind(this.__input, 'blur', s),
  11633. t.bind(this.__input, 'mousedown', l),
  11634. t.bind(this.__input, 'keydown', function (e) {
  11635. 13 === e.keyCode &&
  11636. ((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1))
  11637. }),
  11638. this.updateDisplay(),
  11639. this.domElement.appendChild(this.__input)
  11640. }
  11641. return (
  11642. (r.superclass = e),
  11643. i.extend(r.prototype, e.prototype, {
  11644. updateDisplay: function () {
  11645. return (
  11646. (this.__input.value = this.__truncationSuspended
  11647. ? this.getValue()
  11648. : n(this.getValue(), this.__precision)),
  11649. r.superclass.prototype.updateDisplay.call(this)
  11650. )
  11651. }
  11652. }),
  11653. r
  11654. )
  11655. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  11656. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  11657. function o(e, t, i, n, r) {
  11658. return n + (r - n) * ((e - t) / (i - t))
  11659. }
  11660. var a = function (e, i, n, r, s) {
  11661. function l(e) {
  11662. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e)
  11663. }
  11664. function c(e) {
  11665. e.preventDefault()
  11666. var i = t.getOffset(u.__background),
  11667. n = t.getWidth(u.__background)
  11668. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1
  11669. }
  11670. function h() {
  11671. t.unbind(window, 'mousemove', c),
  11672. t.unbind(window, 'mouseup', h),
  11673. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  11674. }
  11675. a.superclass.call(this, e, i, {
  11676. min: n,
  11677. max: r,
  11678. step: s
  11679. })
  11680. var u = this
  11681. ;(this.__background = document.createElement('div')),
  11682. (this.__foreground = document.createElement('div')),
  11683. t.bind(this.__background, 'mousedown', l),
  11684. t.addClass(this.__background, 'slider'),
  11685. t.addClass(this.__foreground, 'slider-fg'),
  11686. this.updateDisplay(),
  11687. this.__background.appendChild(this.__foreground),
  11688. this.domElement.appendChild(this.__background)
  11689. }
  11690. return (
  11691. (a.superclass = e),
  11692. (a.useDefaultStyles = function () {
  11693. i.inject(r)
  11694. }),
  11695. n.extend(a.prototype, e.prototype, {
  11696. updateDisplay: function () {
  11697. var e = (this.getValue() - this.__min) / (this.__max - this.__min)
  11698. return (
  11699. (this.__foreground.style.width = 100 * e + '%'),
  11700. a.superclass.prototype.updateDisplay.call(this)
  11701. )
  11702. }
  11703. }),
  11704. a
  11705. )
  11706. })(
  11707. n.controllers.NumberController,
  11708. n.dom.dom,
  11709. n.utils.css,
  11710. n.utils.common,
  11711. '/**\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}'
  11712. )),
  11713. (n.controllers.FunctionController = (function (e, t, i) {
  11714. var n = function (e, i, r) {
  11715. n.superclass.call(this, e, i)
  11716. var o = this
  11717. ;(this.__button = document.createElement('div')),
  11718. (this.__button.innerHTML = void 0 === r ? 'Fire' : r),
  11719. t.bind(this.__button, 'click', function (e) {
  11720. return e.preventDefault(), o.fire(), !1
  11721. }),
  11722. t.addClass(this.__button, 'button'),
  11723. this.domElement.appendChild(this.__button)
  11724. }
  11725. return (
  11726. (n.superclass = e),
  11727. i.extend(n.prototype, e.prototype, {
  11728. fire: function () {
  11729. this.__onChange && this.__onChange.call(this),
  11730. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11731. this.getValue().call(this.object)
  11732. }
  11733. }),
  11734. n
  11735. )
  11736. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11737. (n.controllers.BooleanController = (function (e, t, i) {
  11738. var n = function (e, i) {
  11739. function r() {
  11740. o.setValue(!o.__prev)
  11741. }
  11742. n.superclass.call(this, e, i)
  11743. var o = this
  11744. ;(this.__prev = this.getValue()),
  11745. (this.__checkbox = document.createElement('input')),
  11746. this.__checkbox.setAttribute('type', 'checkbox'),
  11747. t.bind(this.__checkbox, 'change', r, !1),
  11748. this.domElement.appendChild(this.__checkbox),
  11749. this.updateDisplay()
  11750. }
  11751. return (
  11752. (n.superclass = e),
  11753. i.extend(n.prototype, e.prototype, {
  11754. setValue: function (e) {
  11755. var t = n.superclass.prototype.setValue.call(this, e)
  11756. return (
  11757. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11758. (this.__prev = this.getValue()),
  11759. t
  11760. )
  11761. },
  11762. updateDisplay: function () {
  11763. return (
  11764. this.getValue() === !0
  11765. ? (this.__checkbox.setAttribute('checked', 'checked'),
  11766. (this.__checkbox.checked = !0))
  11767. : (this.__checkbox.checked = !1),
  11768. n.superclass.prototype.updateDisplay.call(this)
  11769. )
  11770. }
  11771. }),
  11772. n
  11773. )
  11774. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11775. (n.color.toString = (function (e) {
  11776. return function (t) {
  11777. if (1 == t.a || e.isUndefined(t.a)) {
  11778. for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i
  11779. return '#' + i
  11780. }
  11781. return (
  11782. 'rgba(' +
  11783. Math.round(t.r) +
  11784. ',' +
  11785. Math.round(t.g) +
  11786. ',' +
  11787. Math.round(t.b) +
  11788. ',' +
  11789. t.a +
  11790. ')'
  11791. )
  11792. }
  11793. })(n.utils.common)),
  11794. (n.color.interpret = (function (e, t) {
  11795. var i,
  11796. n,
  11797. r = function () {
  11798. n = !1
  11799. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0]
  11800. return (
  11801. t.each(o, function (r) {
  11802. if (r.litmus(e))
  11803. return (
  11804. t.each(r.conversions, function (r, o) {
  11805. if (((i = r.read(e)), n === !1 && i !== !1))
  11806. return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK
  11807. }),
  11808. t.BREAK
  11809. )
  11810. }),
  11811. n
  11812. )
  11813. },
  11814. o = [
  11815. {
  11816. litmus: t.isString,
  11817. conversions: {
  11818. THREE_CHAR_HEX: {
  11819. read: function (e) {
  11820. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)
  11821. return (
  11822. null !== t && {
  11823. space: 'HEX',
  11824. hex: parseInt(
  11825. '0x' +
  11826. t[1].toString() +
  11827. t[1].toString() +
  11828. t[2].toString() +
  11829. t[2].toString() +
  11830. t[3].toString() +
  11831. t[3].toString()
  11832. )
  11833. }
  11834. )
  11835. },
  11836. write: e
  11837. },
  11838. SIX_CHAR_HEX: {
  11839. read: function (e) {
  11840. var t = e.match(/^#([A-F0-9]{6})$/i)
  11841. return (
  11842. null !== t && {
  11843. space: 'HEX',
  11844. hex: parseInt('0x' + t[1].toString())
  11845. }
  11846. )
  11847. },
  11848. write: e
  11849. },
  11850. CSS_RGB: {
  11851. read: function (e) {
  11852. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)
  11853. return (
  11854. null !== t && {
  11855. space: 'RGB',
  11856. r: parseFloat(t[1]),
  11857. g: parseFloat(t[2]),
  11858. b: parseFloat(t[3])
  11859. }
  11860. )
  11861. },
  11862. write: e
  11863. },
  11864. CSS_RGBA: {
  11865. read: function (e) {
  11866. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)
  11867. return (
  11868. null !== t && {
  11869. space: 'RGB',
  11870. r: parseFloat(t[1]),
  11871. g: parseFloat(t[2]),
  11872. b: parseFloat(t[3]),
  11873. a: parseFloat(t[4])
  11874. }
  11875. )
  11876. },
  11877. write: e
  11878. }
  11879. }
  11880. },
  11881. {
  11882. litmus: t.isNumber,
  11883. conversions: {
  11884. HEX: {
  11885. read: function (e) {
  11886. return {
  11887. space: 'HEX',
  11888. hex: e,
  11889. conversionName: 'HEX'
  11890. }
  11891. },
  11892. write: function (e) {
  11893. return e.hex
  11894. }
  11895. }
  11896. }
  11897. },
  11898. {
  11899. litmus: t.isArray,
  11900. conversions: {
  11901. RGB_ARRAY: {
  11902. read: function (e) {
  11903. return (
  11904. 3 == e.length && {
  11905. space: 'RGB',
  11906. r: e[0],
  11907. g: e[1],
  11908. b: e[2]
  11909. }
  11910. )
  11911. },
  11912. write: function (e) {
  11913. return [e.r, e.g, e.b]
  11914. }
  11915. },
  11916. RGBA_ARRAY: {
  11917. read: function (e) {
  11918. return (
  11919. 4 == e.length && {
  11920. space: 'RGB',
  11921. r: e[0],
  11922. g: e[1],
  11923. b: e[2],
  11924. a: e[3]
  11925. }
  11926. )
  11927. },
  11928. write: function (e) {
  11929. return [e.r, e.g, e.b, e.a]
  11930. }
  11931. }
  11932. }
  11933. },
  11934. {
  11935. litmus: t.isObject,
  11936. conversions: {
  11937. RGBA_OBJ: {
  11938. read: function (e) {
  11939. return (
  11940. !!(
  11941. t.isNumber(e.r) &&
  11942. t.isNumber(e.g) &&
  11943. t.isNumber(e.b) &&
  11944. t.isNumber(e.a)
  11945. ) && {
  11946. space: 'RGB',
  11947. r: e.r,
  11948. g: e.g,
  11949. b: e.b,
  11950. a: e.a
  11951. }
  11952. )
  11953. },
  11954. write: function (e) {
  11955. return {
  11956. r: e.r,
  11957. g: e.g,
  11958. b: e.b,
  11959. a: e.a
  11960. }
  11961. }
  11962. },
  11963. RGB_OBJ: {
  11964. read: function (e) {
  11965. return (
  11966. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  11967. space: 'RGB',
  11968. r: e.r,
  11969. g: e.g,
  11970. b: e.b
  11971. }
  11972. )
  11973. },
  11974. write: function (e) {
  11975. return {
  11976. r: e.r,
  11977. g: e.g,
  11978. b: e.b
  11979. }
  11980. }
  11981. },
  11982. HSVA_OBJ: {
  11983. read: function (e) {
  11984. return (
  11985. !!(
  11986. t.isNumber(e.h) &&
  11987. t.isNumber(e.s) &&
  11988. t.isNumber(e.v) &&
  11989. t.isNumber(e.a)
  11990. ) && {
  11991. space: 'HSV',
  11992. h: e.h,
  11993. s: e.s,
  11994. v: e.v,
  11995. a: e.a
  11996. }
  11997. )
  11998. },
  11999. write: function (e) {
  12000. return {
  12001. h: e.h,
  12002. s: e.s,
  12003. v: e.v,
  12004. a: e.a
  12005. }
  12006. }
  12007. },
  12008. HSV_OBJ: {
  12009. read: function (e) {
  12010. return (
  12011. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  12012. space: 'HSV',
  12013. h: e.h,
  12014. s: e.s,
  12015. v: e.v
  12016. }
  12017. )
  12018. },
  12019. write: function (e) {
  12020. return {
  12021. h: e.h,
  12022. s: e.s,
  12023. v: e.v
  12024. }
  12025. }
  12026. }
  12027. }
  12028. }
  12029. ]
  12030. return r
  12031. })(n.color.toString, n.utils.common)),
  12032. (n.GUI = n.gui.GUI =
  12033. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  12034. function g(e, t, i, o) {
  12035. if (void 0 === t[i]) throw new Error('Object ' + t + ' has no property "' + i + '"')
  12036. var a
  12037. if (o.color) a = new h(t, i)
  12038. else {
  12039. var s = [t, i].concat(o.factoryArgs)
  12040. a = n.apply(e, s)
  12041. }
  12042. o.before instanceof r && (o.before = o.before.__li),
  12043. A(e, a),
  12044. p.addClass(a.domElement, 'c')
  12045. var l = document.createElement('span')
  12046. p.addClass(l, 'property-name'), (l.innerHTML = a.property)
  12047. var c = document.createElement('div')
  12048. c.appendChild(l), c.appendChild(a.domElement)
  12049. var u = m(e, c, o.before)
  12050. return (
  12051. p.addClass(u, V.CLASS_CONTROLLER_ROW),
  12052. p.addClass(u, typeof a.getValue()),
  12053. v(e, u, a),
  12054. e.__controllers.push(a),
  12055. a
  12056. )
  12057. }
  12058. function m(e, t, i) {
  12059. var n = document.createElement('li')
  12060. return (
  12061. t && n.appendChild(t),
  12062. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  12063. e.onResize(),
  12064. n
  12065. )
  12066. }
  12067. function v(e, t, i) {
  12068. if (
  12069. ((i.__li = t),
  12070. (i.__gui = e),
  12071. f.extend(i, {
  12072. options: function (t) {
  12073. return arguments.length > 1
  12074. ? (i.remove(),
  12075. g(e, i.object, i.property, {
  12076. before: i.__li.nextElementSibling,
  12077. factoryArgs: [f.toArray(arguments)]
  12078. }))
  12079. : f.isArray(t) || f.isObject(t)
  12080. ? (i.remove(),
  12081. g(e, i.object, i.property, {
  12082. before: i.__li.nextElementSibling,
  12083. factoryArgs: [t]
  12084. }))
  12085. : void 0
  12086. },
  12087. name: function (e) {
  12088. return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i
  12089. },
  12090. listen: function () {
  12091. return i.__gui.listen(i), i
  12092. },
  12093. remove: function () {
  12094. return i.__gui.remove(i), i
  12095. }
  12096. }),
  12097. i instanceof l)
  12098. ) {
  12099. var n = new s(i.object, i.property, {
  12100. min: i.__min,
  12101. max: i.__max,
  12102. step: i.__step
  12103. })
  12104. f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  12105. var t = i[e],
  12106. r = n[e]
  12107. i[e] = n[e] = function () {
  12108. var e = Array.prototype.slice.call(arguments)
  12109. return t.apply(i, e), r.apply(n, e)
  12110. }
  12111. }),
  12112. p.addClass(t, 'has-slider'),
  12113. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  12114. } else if (i instanceof s) {
  12115. var r = function (t) {
  12116. return f.isNumber(i.__min) && f.isNumber(i.__max)
  12117. ? (i.remove(),
  12118. g(e, i.object, i.property, {
  12119. before: i.__li.nextElementSibling,
  12120. factoryArgs: [i.__min, i.__max, i.__step]
  12121. }))
  12122. : t
  12123. }
  12124. ;(i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max))
  12125. } else
  12126. i instanceof o
  12127. ? (p.bind(t, 'click', function () {
  12128. p.fakeEvent(i.__checkbox, 'click')
  12129. }),
  12130. p.bind(i.__checkbox, 'click', function (e) {
  12131. e.stopPropagation()
  12132. }))
  12133. : i instanceof a
  12134. ? (p.bind(t, 'click', function () {
  12135. p.fakeEvent(i.__button, 'click')
  12136. }),
  12137. p.bind(t, 'mouseover', function () {
  12138. p.addClass(i.__button, 'hover')
  12139. }),
  12140. p.bind(t, 'mouseout', function () {
  12141. p.removeClass(i.__button, 'hover')
  12142. }))
  12143. : i instanceof h &&
  12144. (p.addClass(t, 'color'),
  12145. (i.updateDisplay = f.compose(function (e) {
  12146. return (t.style.borderLeftColor = i.__color.toString()), e
  12147. }, i.updateDisplay)),
  12148. i.updateDisplay())
  12149. i.setValue = f.compose(function (t) {
  12150. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t
  12151. }, i.setValue)
  12152. }
  12153. function A(e, t) {
  12154. var i = e.getRoot(),
  12155. n = i.__rememberedObjects.indexOf(t.object)
  12156. if (n != -1) {
  12157. var r = i.__rememberedObjectIndecesToControllers[n]
  12158. if (
  12159. (void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)),
  12160. (r[t.property] = t),
  12161. i.load && i.load.remembered)
  12162. ) {
  12163. var o,
  12164. a = i.load.remembered
  12165. if (a[e.preset]) o = a[e.preset]
  12166. else {
  12167. if (!a[L]) return
  12168. o = a[L]
  12169. }
  12170. if (o[n] && void 0 !== o[n][t.property]) {
  12171. var s = o[n][t.property]
  12172. ;(t.initialValue = s), t.setValue(s)
  12173. }
  12174. }
  12175. }
  12176. }
  12177. function y(e, t) {
  12178. return document.location.href + '.' + t
  12179. }
  12180. function C(e) {
  12181. var t = (e.__save_row = document.createElement('li'))
  12182. p.addClass(e.domElement, 'has-save'),
  12183. e.__ul.insertBefore(t, e.__ul.firstChild),
  12184. p.addClass(t, 'save-row')
  12185. var i = document.createElement('span')
  12186. ;(i.innerHTML = '&nbsp;'), p.addClass(i, 'button gears')
  12187. var n = document.createElement('span')
  12188. ;(n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save')
  12189. var r = document.createElement('span')
  12190. ;(r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as')
  12191. var o = document.createElement('span')
  12192. ;(o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert')
  12193. var a = (e.__preset_select = document.createElement('select'))
  12194. if (
  12195. (e.load && e.load.remembered
  12196. ? f.each(e.load.remembered, function (t, i) {
  12197. w(e, i, i == e.preset)
  12198. })
  12199. : w(e, L, !1),
  12200. p.bind(a, 'change', function () {
  12201. for (var t = 0; t < e.__preset_select.length; t++)
  12202. e.__preset_select[t].innerHTML = e.__preset_select[t].value
  12203. e.preset = this.value
  12204. }),
  12205. t.appendChild(a),
  12206. t.appendChild(i),
  12207. t.appendChild(n),
  12208. t.appendChild(r),
  12209. t.appendChild(o),
  12210. D)
  12211. ) {
  12212. var s = document.getElementById('dg-save-locally'),
  12213. l = document.getElementById('dg-local-explain')
  12214. s.style.display = 'block'
  12215. var c = document.getElementById('dg-local-storage')
  12216. 'true' === localStorage.getItem(y(e, 'isLocal')) &&
  12217. c.setAttribute('checked', 'checked')
  12218. var h = function () {
  12219. l.style.display = e.useLocalStorage ? 'block' : 'none'
  12220. }
  12221. h(),
  12222. p.bind(c, 'change', function () {
  12223. ;(e.useLocalStorage = !e.useLocalStorage), h()
  12224. })
  12225. }
  12226. var u = document.getElementById('dg-new-constructor')
  12227. p.bind(u, 'keydown', function (e) {
  12228. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide()
  12229. }),
  12230. p.bind(i, 'click', function () {
  12231. ;(u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)),
  12232. S.show(),
  12233. u.focus(),
  12234. u.select()
  12235. }),
  12236. p.bind(n, 'click', function () {
  12237. e.save()
  12238. }),
  12239. p.bind(r, 'click', function () {
  12240. var t = prompt('Enter a new preset name.')
  12241. t && e.saveAs(t)
  12242. }),
  12243. p.bind(o, 'click', function () {
  12244. e.revert()
  12245. })
  12246. }
  12247. function I(e) {
  12248. function t(t) {
  12249. return (
  12250. t.preventDefault(),
  12251. (r = t.clientX),
  12252. p.addClass(e.__closeButton, V.CLASS_DRAG),
  12253. p.bind(window, 'mousemove', i),
  12254. p.bind(window, 'mouseup', n),
  12255. !1
  12256. )
  12257. }
  12258. function i(t) {
  12259. return (
  12260. t.preventDefault(),
  12261. (e.width += r - t.clientX),
  12262. e.onResize(),
  12263. (r = t.clientX),
  12264. !1
  12265. )
  12266. }
  12267. function n() {
  12268. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  12269. p.unbind(window, 'mousemove', i),
  12270. p.unbind(window, 'mouseup', n)
  12271. }
  12272. ;(e.__resize_handle = document.createElement('div')),
  12273. f.extend(e.__resize_handle.style, {
  12274. width: '6px',
  12275. marginLeft: '-3px',
  12276. height: '200px',
  12277. cursor: 'ew-resize',
  12278. position: 'absolute'
  12279. })
  12280. var r
  12281. p.bind(e.__resize_handle, 'mousedown', t),
  12282. p.bind(e.__closeButton, 'mousedown', t),
  12283. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  12284. }
  12285. function E(e, t) {
  12286. ;(e.domElement.style.width = t + 'px'),
  12287. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'),
  12288. e.__closeButton && (e.__closeButton.style.width = t + 'px')
  12289. }
  12290. function b(e, t) {
  12291. var i = {}
  12292. return (
  12293. f.each(e.__rememberedObjects, function (n, r) {
  12294. var o = {},
  12295. a = e.__rememberedObjectIndecesToControllers[r]
  12296. f.each(a, function (e, i) {
  12297. o[i] = t ? e.initialValue : e.getValue()
  12298. }),
  12299. (i[r] = o)
  12300. }),
  12301. i
  12302. )
  12303. }
  12304. function w(e, t, i) {
  12305. var n = document.createElement('option')
  12306. ;(n.innerHTML = t),
  12307. (n.value = t),
  12308. e.__preset_select.appendChild(n),
  12309. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  12310. }
  12311. function _(e) {
  12312. for (var t = 0; t < e.__preset_select.length; t++)
  12313. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  12314. }
  12315. function T(e, t) {
  12316. var i = e.__preset_select[e.__preset_select.selectedIndex]
  12317. t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value)
  12318. }
  12319. function x(e) {
  12320. 0 != e.length &&
  12321. u(function () {
  12322. x(e)
  12323. }),
  12324. f.each(e, function (e) {
  12325. e.updateDisplay()
  12326. })
  12327. }
  12328. e.inject(i)
  12329. var S,
  12330. M,
  12331. R = 'dg',
  12332. P = 72,
  12333. O = 20,
  12334. L = 'Default',
  12335. D = (function () {
  12336. try {
  12337. return 'localStorage' in window && null !== window.localStorage
  12338. } catch (e) {
  12339. return !1
  12340. }
  12341. })(),
  12342. N = !0,
  12343. B = !1,
  12344. F = [],
  12345. V = function (e) {
  12346. function t() {
  12347. var e = i.getRoot()
  12348. ;(e.width += 1),
  12349. f.defer(function () {
  12350. e.width -= 1
  12351. })
  12352. }
  12353. var i = this
  12354. ;(this.domElement = document.createElement('div')),
  12355. (this.__ul = document.createElement('ul')),
  12356. this.domElement.appendChild(this.__ul),
  12357. p.addClass(this.domElement, R),
  12358. (this.__folders = {}),
  12359. (this.__controllers = []),
  12360. (this.__rememberedObjects = []),
  12361. (this.__rememberedObjectIndecesToControllers = []),
  12362. (this.__listening = []),
  12363. (e = e || {}),
  12364. (e = f.defaults(e, {
  12365. autoPlace: !0,
  12366. width: V.DEFAULT_WIDTH
  12367. })),
  12368. (e = f.defaults(e, {
  12369. resizable: e.autoPlace,
  12370. hideable: e.autoPlace
  12371. })),
  12372. f.isUndefined(e.load)
  12373. ? (e.load = {
  12374. preset: L
  12375. })
  12376. : e.preset && (e.load.preset = e.preset),
  12377. f.isUndefined(e.parent) && e.hideable && F.push(this),
  12378. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  12379. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0)
  12380. var n,
  12381. r = D && 'true' === localStorage.getItem(y(this, 'isLocal'))
  12382. if (
  12383. (Object.defineProperties(this, {
  12384. parent: {
  12385. get: function () {
  12386. return e.parent
  12387. }
  12388. },
  12389. scrollable: {
  12390. get: function () {
  12391. return e.scrollable
  12392. }
  12393. },
  12394. autoPlace: {
  12395. get: function () {
  12396. return e.autoPlace
  12397. }
  12398. },
  12399. preset: {
  12400. get: function () {
  12401. return i.parent ? i.getRoot().preset : e.load.preset
  12402. },
  12403. set: function (t) {
  12404. i.parent ? (i.getRoot().preset = t) : (e.load.preset = t),
  12405. _(this),
  12406. i.revert()
  12407. }
  12408. },
  12409. width: {
  12410. get: function () {
  12411. return e.width
  12412. },
  12413. set: function (t) {
  12414. ;(e.width = t), E(i, t)
  12415. }
  12416. },
  12417. name: {
  12418. get: function () {
  12419. return e.name
  12420. },
  12421. set: function (t) {
  12422. ;(e.name = t), a && (a.innerHTML = e.name)
  12423. }
  12424. },
  12425. closed: {
  12426. get: function () {
  12427. return e.closed
  12428. },
  12429. set: function (t) {
  12430. ;(e.closed = t),
  12431. e.closed
  12432. ? p.addClass(i.__ul, V.CLASS_CLOSED)
  12433. : p.removeClass(i.__ul, V.CLASS_CLOSED),
  12434. this.onResize(),
  12435. i.__closeButton &&
  12436. (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  12437. }
  12438. },
  12439. load: {
  12440. get: function () {
  12441. return e.load
  12442. }
  12443. },
  12444. useLocalStorage: {
  12445. get: function () {
  12446. return r
  12447. },
  12448. set: function (e) {
  12449. D &&
  12450. ((r = e),
  12451. e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n),
  12452. localStorage.setItem(y(i, 'isLocal'), e))
  12453. }
  12454. }
  12455. }),
  12456. f.isUndefined(e.parent))
  12457. ) {
  12458. if (
  12459. ((e.closed = !1),
  12460. p.addClass(this.domElement, V.CLASS_MAIN),
  12461. p.makeSelectable(this.domElement, !1),
  12462. D && r)
  12463. ) {
  12464. i.useLocalStorage = !0
  12465. var o = localStorage.getItem(y(this, 'gui'))
  12466. o && (e.load = JSON.parse(o))
  12467. }
  12468. ;(this.__closeButton = document.createElement('div')),
  12469. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  12470. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  12471. this.domElement.appendChild(this.__closeButton),
  12472. p.bind(this.__closeButton, 'click', function () {
  12473. i.closed = !i.closed
  12474. })
  12475. } else {
  12476. void 0 === e.closed && (e.closed = !0)
  12477. var a = document.createTextNode(e.name)
  12478. p.addClass(a, 'controller-name')
  12479. var s = m(i, a),
  12480. l = function (e) {
  12481. return e.preventDefault(), (i.closed = !i.closed), !1
  12482. }
  12483. p.addClass(this.__ul, V.CLASS_CLOSED),
  12484. p.addClass(s, 'title'),
  12485. p.bind(s, 'click', l),
  12486. e.closed || (this.closed = !1)
  12487. }
  12488. e.autoPlace &&
  12489. (f.isUndefined(e.parent) &&
  12490. (N &&
  12491. ((M = document.createElement('div')),
  12492. p.addClass(M, R),
  12493. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  12494. document.body.appendChild(M),
  12495. (N = !1)),
  12496. M.appendChild(this.domElement),
  12497. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  12498. this.parent || E(i, e.width)),
  12499. p.bind(window, 'resize', function () {
  12500. i.onResize()
  12501. }),
  12502. p.bind(this.__ul, 'webkitTransitionEnd', function () {
  12503. i.onResize()
  12504. }),
  12505. p.bind(this.__ul, 'transitionend', function () {
  12506. i.onResize()
  12507. }),
  12508. p.bind(this.__ul, 'oTransitionEnd', function () {
  12509. i.onResize()
  12510. }),
  12511. this.onResize(),
  12512. e.resizable && I(this),
  12513. (n = function () {
  12514. D &&
  12515. 'true' === localStorage.getItem(y(i, 'isLocal')) &&
  12516. localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()))
  12517. }),
  12518. (this.saveToLocalStorageIfPossible = n)
  12519. i.getRoot()
  12520. e.parent || t()
  12521. }
  12522. return (
  12523. (V.toggleHide = function () {
  12524. ;(B = !B),
  12525. f.each(F, function (e) {
  12526. ;(e.domElement.style.zIndex = B ? -999 : 999),
  12527. (e.domElement.style.opacity = B ? 0 : 1)
  12528. })
  12529. }),
  12530. (V.CLASS_AUTO_PLACE = 'a'),
  12531. (V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  12532. (V.CLASS_MAIN = 'main'),
  12533. (V.CLASS_CONTROLLER_ROW = 'cr'),
  12534. (V.CLASS_TOO_TALL = 'taller-than-window'),
  12535. (V.CLASS_CLOSED = 'closed'),
  12536. (V.CLASS_CLOSE_BUTTON = 'close-button'),
  12537. (V.CLASS_DRAG = 'drag'),
  12538. (V.DEFAULT_WIDTH = 245),
  12539. (V.TEXT_CLOSED = 'Close Controls'),
  12540. (V.TEXT_OPEN = 'Open Controls'),
  12541. p.bind(
  12542. window,
  12543. 'keydown',
  12544. function (e) {
  12545. 'text' === document.activeElement.type ||
  12546. (e.which !== P && e.keyCode != P) ||
  12547. V.toggleHide()
  12548. },
  12549. !1
  12550. ),
  12551. f.extend(V.prototype, {
  12552. add: function (e, t) {
  12553. return g(this, e, t, {
  12554. factoryArgs: Array.prototype.slice.call(arguments, 2)
  12555. })
  12556. },
  12557. addColor: function (e, t) {
  12558. return g(this, e, t, {
  12559. color: !0
  12560. })
  12561. },
  12562. remove: function (e) {
  12563. this.__ul.removeChild(e.__li),
  12564. this.__controllers.slice(this.__controllers.indexOf(e), 1)
  12565. var t = this
  12566. f.defer(function () {
  12567. t.onResize()
  12568. })
  12569. },
  12570. destroy: function () {
  12571. this.autoPlace && M.removeChild(this.domElement)
  12572. },
  12573. addFolder: function (e) {
  12574. if (void 0 !== this.__folders[e])
  12575. throw new Error(
  12576. 'You already have a folder in this GUI by the name "' + e + '"'
  12577. )
  12578. var t = {
  12579. name: e,
  12580. parent: this
  12581. }
  12582. ;(t.autoPlace = this.autoPlace),
  12583. this.load &&
  12584. this.load.folders &&
  12585. this.load.folders[e] &&
  12586. ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]))
  12587. var i = new V(t)
  12588. this.__folders[e] = i
  12589. var n = m(this, i.domElement)
  12590. return p.addClass(n, 'folder'), i
  12591. },
  12592. open: function () {
  12593. this.closed = !1
  12594. },
  12595. close: function () {
  12596. this.closed = !0
  12597. },
  12598. onResize: function () {
  12599. var e = this.getRoot()
  12600. if (e.scrollable) {
  12601. var t = p.getOffset(e.__ul).top,
  12602. i = 0
  12603. f.each(e.__ul.childNodes, function (t) {
  12604. ;(e.autoPlace && t === e.__save_row) || (i += p.getHeight(t))
  12605. }),
  12606. $('#player').height() - t - O < i
  12607. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  12608. (e.__ul.style.height = $('#player').height() - t - O + 'px'))
  12609. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  12610. (e.__ul.style.height = 'auto'))
  12611. }
  12612. e.__resize_handle &&
  12613. f.defer(function () {
  12614. e.__resize_handle.style.height = e.__ul.offsetHeight + 'px'
  12615. }),
  12616. e.__closeButton && (e.__closeButton.style.width = e.width + 'px')
  12617. },
  12618. remember: function () {
  12619. if (
  12620. (f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)),
  12621. this.parent)
  12622. )
  12623. throw new Error('You can only call remember on a top level GUI.')
  12624. var e = this
  12625. f.each(Array.prototype.slice.call(arguments), function (t) {
  12626. 0 == e.__rememberedObjects.length && C(e),
  12627. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  12628. }),
  12629. this.autoPlace && E(this, this.width)
  12630. },
  12631. getRoot: function () {
  12632. for (var e = this; e.parent; ) e = e.parent
  12633. return e
  12634. },
  12635. getSaveObject: function () {
  12636. var e = this.load
  12637. return (
  12638. (e.closed = this.closed),
  12639. this.__rememberedObjects.length > 0 &&
  12640. ((e.preset = this.preset),
  12641. e.remembered || (e.remembered = {}),
  12642. (e.remembered[this.preset] = b(this))),
  12643. (e.folders = {}),
  12644. f.each(this.__folders, function (t, i) {
  12645. e.folders[i] = t.getSaveObject()
  12646. }),
  12647. e
  12648. )
  12649. },
  12650. save: function () {
  12651. this.load.remembered || (this.load.remembered = {}),
  12652. (this.load.remembered[this.preset] = b(this)),
  12653. T(this, !1),
  12654. this.saveToLocalStorageIfPossible()
  12655. },
  12656. saveAs: function (e) {
  12657. this.load.remembered ||
  12658. ((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
  12659. (this.load.remembered[e] = b(this)),
  12660. (this.preset = e),
  12661. w(this, e, !0),
  12662. this.saveToLocalStorageIfPossible()
  12663. },
  12664. revert: function (e) {
  12665. f.each(
  12666. this.__controllers,
  12667. function (t) {
  12668. this.getRoot().load.remembered
  12669. ? A(e || this.getRoot(), t)
  12670. : t.setValue(t.initialValue)
  12671. },
  12672. this
  12673. ),
  12674. f.each(this.__folders, function (e) {
  12675. e.revert(e)
  12676. }),
  12677. e || T(this.getRoot(), !1)
  12678. },
  12679. listen: function (e) {
  12680. var t = 0 == this.__listening.length
  12681. this.__listening.push(e), t && x(this.__listening)
  12682. }
  12683. }),
  12684. V
  12685. )
  12686. })(
  12687. n.utils.css,
  12688. '<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>',
  12689. ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n",
  12690. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  12691. return function (s, l) {
  12692. var c = s[l]
  12693. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  12694. ? new e(s, l, arguments[2])
  12695. : a.isNumber(c)
  12696. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  12697. ? new i(s, l, arguments[2], arguments[3])
  12698. : new t(s, l, {
  12699. min: arguments[2],
  12700. max: arguments[3]
  12701. })
  12702. : a.isString(c)
  12703. ? new n(s, l)
  12704. : a.isFunction(c)
  12705. ? new r(s, l, '')
  12706. : a.isBoolean(c)
  12707. ? new o(s, l)
  12708. : void 0
  12709. }
  12710. })(
  12711. n.controllers.OptionController,
  12712. n.controllers.NumberControllerBox,
  12713. n.controllers.NumberControllerSlider,
  12714. (n.controllers.StringController = (function (e, t, i) {
  12715. var n = function (e, i) {
  12716. function r() {
  12717. a.setValue(a.__input.value)
  12718. }
  12719. function o() {
  12720. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  12721. }
  12722. n.superclass.call(this, e, i)
  12723. var a = this
  12724. ;(this.__input = document.createElement('input')),
  12725. this.__input.setAttribute('type', 'text'),
  12726. t.bind(this.__input, 'keyup', r),
  12727. t.bind(this.__input, 'change', r),
  12728. t.bind(this.__input, 'blur', o),
  12729. t.bind(this.__input, 'keydown', function (e) {
  12730. 13 === e.keyCode && this.blur()
  12731. }),
  12732. this.updateDisplay(),
  12733. this.domElement.appendChild(this.__input)
  12734. }
  12735. return (
  12736. (n.superclass = e),
  12737. i.extend(n.prototype, e.prototype, {
  12738. updateDisplay: function () {
  12739. return (
  12740. t.isActive(this.__input) || (this.__input.value = this.getValue()),
  12741. n.superclass.prototype.updateDisplay.call(this)
  12742. )
  12743. }
  12744. }),
  12745. n
  12746. )
  12747. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12748. n.controllers.FunctionController,
  12749. n.controllers.BooleanController,
  12750. n.utils.common
  12751. )),
  12752. n.controllers.Controller,
  12753. n.controllers.BooleanController,
  12754. n.controllers.FunctionController,
  12755. n.controllers.NumberControllerBox,
  12756. n.controllers.NumberControllerSlider,
  12757. n.controllers.OptionController,
  12758. (n.controllers.ColorController = (function (e, t, i, n, r) {
  12759. function o(e, t, i, n) {
  12760. ;(e.style.background = ''),
  12761. r.each(l, function (r) {
  12762. e.style.cssText +=
  12763. 'background: ' +
  12764. r +
  12765. 'linear-gradient(' +
  12766. t +
  12767. ', ' +
  12768. i +
  12769. ' 0%, ' +
  12770. n +
  12771. ' 100%); '
  12772. })
  12773. }
  12774. function a(e) {
  12775. ;(e.style.background = ''),
  12776. (e.style.cssText +=
  12777. 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  12778. (e.style.cssText +=
  12779. 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12780. (e.style.cssText +=
  12781. 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12782. (e.style.cssText +=
  12783. 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12784. (e.style.cssText +=
  12785. 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);')
  12786. }
  12787. var s = function (e, l) {
  12788. function c(e) {
  12789. p(e), t.bind(window, 'mousemove', p), t.bind(window, 'mouseup', h)
  12790. }
  12791. function h() {
  12792. t.unbind(window, 'mousemove', p), t.unbind(window, 'mouseup', h)
  12793. }
  12794. function u() {
  12795. var e = n(this.value)
  12796. e !== !1
  12797. ? ((g.__color.__state = e), g.setValue(g.__color.toOriginal()))
  12798. : (this.value = g.__color.toString())
  12799. }
  12800. function d() {
  12801. t.unbind(window, 'mousemove', f), t.unbind(window, 'mouseup', d)
  12802. }
  12803. function p(e) {
  12804. e.preventDefault()
  12805. var i = t.getWidth(g.__saturation_field),
  12806. n = t.getOffset(g.__saturation_field),
  12807. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  12808. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  12809. return (
  12810. o > 1 ? (o = 1) : o < 0 && (o = 0),
  12811. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12812. (g.__color.v = o),
  12813. (g.__color.s = r),
  12814. g.setValue(g.__color.toOriginal()),
  12815. !1
  12816. )
  12817. }
  12818. function f(e) {
  12819. e.preventDefault()
  12820. var i = t.getHeight(g.__hue_field),
  12821. n = t.getOffset(g.__hue_field),
  12822. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  12823. return (
  12824. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12825. (g.__color.h = 360 * r),
  12826. g.setValue(g.__color.toOriginal()),
  12827. !1
  12828. )
  12829. }
  12830. s.superclass.call(this, e, l),
  12831. (this.__color = new i(this.getValue())),
  12832. (this.__temp = new i(0))
  12833. var g = this
  12834. ;(this.domElement = document.createElement('div')),
  12835. t.makeSelectable(this.domElement, !1),
  12836. (this.__selector = document.createElement('div')),
  12837. (this.__selector.className = 'selector'),
  12838. (this.__saturation_field = document.createElement('div')),
  12839. (this.__saturation_field.className = 'saturation-field'),
  12840. (this.__field_knob = document.createElement('div')),
  12841. (this.__field_knob.className = 'field-knob'),
  12842. (this.__field_knob_border = '2px solid '),
  12843. (this.__hue_knob = document.createElement('div')),
  12844. (this.__hue_knob.className = 'hue-knob'),
  12845. (this.__hue_field = document.createElement('div')),
  12846. (this.__hue_field.className = 'hue-field'),
  12847. (this.__input = document.createElement('input')),
  12848. (this.__input.type = 'text'),
  12849. (this.__input_textShadow = '0 1px 1px '),
  12850. t.bind(this.__input, 'keydown', function (e) {
  12851. 13 === e.keyCode && u.call(this)
  12852. }),
  12853. t.bind(this.__input, 'blur', u),
  12854. t.bind(this.__selector, 'mousedown', function (e) {
  12855. t.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  12856. t.removeClass(g.__selector, 'drag')
  12857. })
  12858. })
  12859. var m = document.createElement('div')
  12860. r.extend(this.__selector.style, {
  12861. width: '122px',
  12862. height: '102px',
  12863. padding: '3px',
  12864. backgroundColor: '#222',
  12865. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'
  12866. }),
  12867. r.extend(this.__field_knob.style, {
  12868. position: 'absolute',
  12869. width: '12px',
  12870. height: '12px',
  12871. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  12872. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  12873. borderRadius: '12px',
  12874. zIndex: 1
  12875. }),
  12876. r.extend(this.__hue_knob.style, {
  12877. position: 'absolute',
  12878. width: '15px',
  12879. height: '2px',
  12880. borderRight: '4px solid #fff',
  12881. zIndex: 1
  12882. }),
  12883. r.extend(this.__saturation_field.style, {
  12884. width: '100px',
  12885. height: '100px',
  12886. border: '1px solid #555',
  12887. marginRight: '3px',
  12888. display: 'inline-block',
  12889. cursor: 'pointer'
  12890. }),
  12891. r.extend(m.style, {
  12892. width: '100%',
  12893. height: '100%',
  12894. background: 'none'
  12895. }),
  12896. o(m, 'top', 'rgba(0,0,0,0)', '#000'),
  12897. r.extend(this.__hue_field.style, {
  12898. width: '15px',
  12899. height: '100px',
  12900. display: 'inline-block',
  12901. border: '1px solid #555',
  12902. cursor: 'ns-resize'
  12903. }),
  12904. a(this.__hue_field),
  12905. r.extend(this.__input.style, {
  12906. outline: 'none',
  12907. textAlign: 'center',
  12908. color: '#fff',
  12909. border: 0,
  12910. fontWeight: 'bold',
  12911. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'
  12912. }),
  12913. t.bind(this.__saturation_field, 'mousedown', c),
  12914. t.bind(this.__field_knob, 'mousedown', c),
  12915. t.bind(this.__hue_field, 'mousedown', function (e) {
  12916. f(e), t.bind(window, 'mousemove', f), t.bind(window, 'mouseup', d)
  12917. }),
  12918. this.__saturation_field.appendChild(m),
  12919. this.__selector.appendChild(this.__field_knob),
  12920. this.__selector.appendChild(this.__saturation_field),
  12921. this.__selector.appendChild(this.__hue_field),
  12922. this.__hue_field.appendChild(this.__hue_knob),
  12923. this.domElement.appendChild(this.__input),
  12924. this.domElement.appendChild(this.__selector),
  12925. this.updateDisplay()
  12926. }
  12927. ;(s.superclass = e),
  12928. r.extend(s.prototype, e.prototype, {
  12929. updateDisplay: function () {
  12930. var e = n(this.getValue())
  12931. if (e !== !1) {
  12932. var t = !1
  12933. r.each(
  12934. i.COMPONENTS,
  12935. function (i) {
  12936. if (
  12937. !r.isUndefined(e[i]) &&
  12938. !r.isUndefined(this.__color.__state[i]) &&
  12939. e[i] !== this.__color.__state[i]
  12940. )
  12941. return (t = !0), {}
  12942. },
  12943. this
  12944. ),
  12945. t && r.extend(this.__color.__state, e)
  12946. }
  12947. r.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1)
  12948. var a = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0,
  12949. s = 255 - a
  12950. r.extend(this.__field_knob.style, {
  12951. marginLeft: 100 * this.__color.s - 7 + 'px',
  12952. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  12953. backgroundColor: this.__temp.toString(),
  12954. border: this.__field_knob_border + 'rgb(' + a + ',' + a + ',' + a + ')'
  12955. }),
  12956. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  12957. (this.__temp.s = 1),
  12958. (this.__temp.v = 1),
  12959. o(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  12960. r.extend(this.__input.style, {
  12961. backgroundColor: (this.__input.value = this.__color.toString()),
  12962. color: 'rgb(' + a + ',' + a + ',' + a + ')',
  12963. textShadow:
  12964. this.__input_textShadow + 'rgba(' + s + ',' + s + ',' + s + ',.7)'
  12965. })
  12966. }
  12967. })
  12968. var l = ['-moz-', '-o-', '-webkit-', '-ms-', '']
  12969. return s
  12970. })(
  12971. n.controllers.Controller,
  12972. n.dom.dom,
  12973. (n.color.Color = (function (e, t, i, n) {
  12974. function r(e, t, i) {
  12975. Object.defineProperty(e, t, {
  12976. get: function () {
  12977. return 'RGB' === this.__state.space
  12978. ? this.__state[t]
  12979. : (a(this, t, i), this.__state[t])
  12980. },
  12981. set: function (e) {
  12982. 'RGB' !== this.__state.space &&
  12983. (a(this, t, i), (this.__state.space = 'RGB')),
  12984. (this.__state[t] = e)
  12985. }
  12986. })
  12987. }
  12988. function o(e, t) {
  12989. Object.defineProperty(e, t, {
  12990. get: function () {
  12991. return 'HSV' === this.__state.space
  12992. ? this.__state[t]
  12993. : (s(this), this.__state[t])
  12994. },
  12995. set: function (e) {
  12996. 'HSV' !== this.__state.space && (s(this), (this.__state.space = 'HSV')),
  12997. (this.__state[t] = e)
  12998. }
  12999. })
  13000. }
  13001. function a(e, i, r) {
  13002. if ('HEX' === e.__state.space)
  13003. e.__state[i] = t.component_from_hex(e.__state.hex, r)
  13004. else {
  13005. if ('HSV' !== e.__state.space) throw 'Corrupted color state'
  13006. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  13007. }
  13008. }
  13009. function s(e) {
  13010. var i = t.rgb_to_hsv(e.r, e.g, e.b)
  13011. n.extend(e.__state, {
  13012. s: i.s,
  13013. v: i.v
  13014. }),
  13015. n.isNaN(i.h)
  13016. ? n.isUndefined(e.__state.h) && (e.__state.h = 0)
  13017. : (e.__state.h = i.h)
  13018. }
  13019. var l = function () {
  13020. if (((this.__state = e.apply(this, arguments)), this.__state === !1))
  13021. throw 'Failed to interpret color arguments'
  13022. this.__state.a = this.__state.a || 1
  13023. }
  13024. return (
  13025. (l.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  13026. n.extend(l.prototype, {
  13027. toString: function () {
  13028. return i(this)
  13029. },
  13030. toOriginal: function () {
  13031. return this.__state.conversion.write(this)
  13032. }
  13033. }),
  13034. r(l.prototype, 'r', 2),
  13035. r(l.prototype, 'g', 1),
  13036. r(l.prototype, 'b', 0),
  13037. o(l.prototype, 'h'),
  13038. o(l.prototype, 's'),
  13039. o(l.prototype, 'v'),
  13040. Object.defineProperty(l.prototype, 'a', {
  13041. get: function () {
  13042. return this.__state.a
  13043. },
  13044. set: function (e) {
  13045. this.__state.a = e
  13046. }
  13047. }),
  13048. Object.defineProperty(l.prototype, 'hex', {
  13049. get: function () {
  13050. return (
  13051. 'HEX' !== !this.__state.space &&
  13052. (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  13053. this.__state.hex
  13054. )
  13055. },
  13056. set: function (e) {
  13057. ;(this.__state.space = 'HEX'), (this.__state.hex = e)
  13058. }
  13059. }),
  13060. l
  13061. )
  13062. })(
  13063. n.color.interpret,
  13064. (n.color.math = (function () {
  13065. var e
  13066. return {
  13067. hsv_to_rgb: function (e, t, i) {
  13068. var n = Math.floor(e / 60) % 6,
  13069. r = e / 60 - Math.floor(e / 60),
  13070. o = i * (1 - t),
  13071. a = i * (1 - r * t),
  13072. s = i * (1 - (1 - r) * t),
  13073. l = [
  13074. [i, s, o],
  13075. [a, i, o],
  13076. [o, i, s],
  13077. [o, a, i],
  13078. [s, o, i],
  13079. [i, o, a]
  13080. ][n]
  13081. return {
  13082. r: 255 * l[0],
  13083. g: 255 * l[1],
  13084. b: 255 * l[2]
  13085. }
  13086. },
  13087. rgb_to_hsv: function (e, t, i) {
  13088. var n,
  13089. r,
  13090. o = Math.min(e, t, i),
  13091. a = Math.max(e, t, i),
  13092. s = a - o
  13093. return 0 == a
  13094. ? {
  13095. h: NaN,
  13096. s: 0,
  13097. v: 0
  13098. }
  13099. : ((r = s / a),
  13100. (n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s),
  13101. (n /= 6),
  13102. n < 0 && (n += 1),
  13103. {
  13104. h: 360 * n,
  13105. s: r,
  13106. v: a / 255
  13107. })
  13108. },
  13109. rgb_to_hex: function (e, t, i) {
  13110. var n = this.hex_with_component(0, 2, e)
  13111. return (
  13112. (n = this.hex_with_component(n, 1, t)),
  13113. (n = this.hex_with_component(n, 0, i))
  13114. )
  13115. },
  13116. component_from_hex: function (e, t) {
  13117. return (e >> (8 * t)) & 255
  13118. },
  13119. hex_with_component: function (t, i, n) {
  13120. return (n << (e = 8 * i)) | (t & ~(255 << e))
  13121. }
  13122. }
  13123. })()),
  13124. n.color.toString,
  13125. n.utils.common
  13126. )),
  13127. n.color.interpret,
  13128. n.utils.common
  13129. )),
  13130. (n.utils.requestAnimationFrame = (function () {
  13131. return (
  13132. window.requestAnimationFrame ||
  13133. window.webkitRequestAnimationFrame ||
  13134. window.mozRequestAnimationFrame ||
  13135. window.oRequestAnimationFrame ||
  13136. window.msRequestAnimationFrame ||
  13137. function (e, t) {
  13138. window.setTimeout(e, 1e3 / 60)
  13139. }
  13140. )
  13141. })()),
  13142. (n.dom.CenteredDiv = (function (e, t) {
  13143. var i = function () {
  13144. ;(this.backgroundElement = document.createElement('div')),
  13145. t.extend(this.backgroundElement.style, {
  13146. backgroundColor: 'rgba(0,0,0,0.8)',
  13147. top: 0,
  13148. left: 0,
  13149. display: 'none',
  13150. zIndex: '1000',
  13151. opacity: 0,
  13152. WebkitTransition: 'opacity 0.2s linear'
  13153. }),
  13154. e.makeFullscreen(this.backgroundElement),
  13155. (this.backgroundElement.style.position = 'fixed'),
  13156. (this.domElement = document.createElement('div')),
  13157. t.extend(this.domElement.style, {
  13158. position: 'fixed',
  13159. display: 'none',
  13160. zIndex: '1001',
  13161. opacity: 0,
  13162. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'
  13163. }),
  13164. document.body.appendChild(this.backgroundElement),
  13165. document.body.appendChild(this.domElement)
  13166. var i = this
  13167. e.bind(this.backgroundElement, 'click', function () {
  13168. i.hide()
  13169. })
  13170. }
  13171. return (
  13172. (i.prototype.show = function () {
  13173. var e = this
  13174. ;(this.backgroundElement.style.display = 'block'),
  13175. (this.domElement.style.display = 'block'),
  13176. (this.domElement.style.opacity = 0),
  13177. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  13178. this.layout(),
  13179. t.defer(function () {
  13180. ;(e.backgroundElement.style.opacity = 1),
  13181. (e.domElement.style.opacity = 1),
  13182. (e.domElement.style.webkitTransform = 'scale(1)')
  13183. })
  13184. }),
  13185. (i.prototype.hide = function () {
  13186. var t = this,
  13187. i = function () {
  13188. ;(t.domElement.style.display = 'none'),
  13189. (t.backgroundElement.style.display = 'none'),
  13190. e.unbind(t.domElement, 'webkitTransitionEnd', i),
  13191. e.unbind(t.domElement, 'transitionend', i),
  13192. e.unbind(t.domElement, 'oTransitionEnd', i)
  13193. }
  13194. e.bind(this.domElement, 'webkitTransitionEnd', i),
  13195. e.bind(this.domElement, 'transitionend', i),
  13196. e.bind(this.domElement, 'oTransitionEnd', i),
  13197. (this.backgroundElement.style.opacity = 0),
  13198. (this.domElement.style.opacity = 0),
  13199. (this.domElement.style.webkitTransform = 'scale(1.1)')
  13200. }),
  13201. (i.prototype.layout = function () {
  13202. ;(this.domElement.style.left =
  13203. $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + 'px'),
  13204. (this.domElement.style.top =
  13205. $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + 'px')
  13206. }),
  13207. i
  13208. )
  13209. })(n.dom.dom, n.utils.common)),
  13210. n.dom.dom,
  13211. n.utils.common
  13212. ))
  13213. },
  13214. {}
  13215. ],
  13216. 94: [
  13217. function (e, t, i) {
  13218. ;(function (e) {
  13219. 'use strict'
  13220. function i(t) {
  13221. function i(e) {
  13222. for (
  13223. var t = [
  13224. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24,
  13225. 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103,
  13226. 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72,
  13227. 92, 95, 98, 112, 100, 103, 99
  13228. ],
  13229. i = 0;
  13230. i < 64;
  13231. i++
  13232. ) {
  13233. var n = _((t[i] * e + 50) / 100)
  13234. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n)
  13235. }
  13236. for (
  13237. var r = [
  13238. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99,
  13239. 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13240. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13241. 99, 99, 99, 99
  13242. ],
  13243. o = 0;
  13244. o < 64;
  13245. o++
  13246. ) {
  13247. var a = _((r[o] * e + 50) / 100)
  13248. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a)
  13249. }
  13250. for (
  13251. var s = [
  13252. 1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379
  13253. ],
  13254. l = 0,
  13255. c = 0;
  13256. c < 8;
  13257. c++
  13258. )
  13259. for (var h = 0; h < 8; h++)
  13260. (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)),
  13261. (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)),
  13262. l++
  13263. }
  13264. function n(e, t) {
  13265. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  13266. for (var a = 1; a <= e[o]; a++)
  13267. (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++
  13268. i *= 2
  13269. }
  13270. return r
  13271. }
  13272. function r() {
  13273. ;(C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K))
  13274. }
  13275. function o() {
  13276. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  13277. for (var n = e; n < t; n++)
  13278. (P[32767 + n] = i),
  13279. (R[32767 + n] = []),
  13280. (R[32767 + n][1] = i),
  13281. (R[32767 + n][0] = n)
  13282. for (var r = -(t - 1); r <= -e; r++)
  13283. (P[32767 + r] = i),
  13284. (R[32767 + r] = []),
  13285. (R[32767 + r][1] = i),
  13286. (R[32767 + r][0] = t - 1 + r)
  13287. ;(e <<= 1), (t <<= 1)
  13288. }
  13289. }
  13290. function a() {
  13291. for (var e = 0; e < 256; e++)
  13292. (H[e] = 19595 * e),
  13293. (H[(e + 256) >> 0] = 38470 * e),
  13294. (H[(e + 512) >> 0] = 7471 * e + 32768),
  13295. (H[(e + 768) >> 0] = -11059 * e),
  13296. (H[(e + 1024) >> 0] = -21709 * e),
  13297. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  13298. (H[(e + 1536) >> 0] = -27439 * e),
  13299. (H[(e + 1792) >> 0] = -5329 * e)
  13300. }
  13301. function s(e) {
  13302. for (var t = e[0], i = e[1] - 1; i >= 0; )
  13303. t & (1 << i) && (N |= 1 << B),
  13304. i--,
  13305. B--,
  13306. B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0))
  13307. }
  13308. function l(e) {
  13309. D.push(e)
  13310. }
  13311. function c(e) {
  13312. l((e >> 8) & 255), l(255 & e)
  13313. }
  13314. function h(e, t) {
  13315. var i,
  13316. n,
  13317. r,
  13318. o,
  13319. a,
  13320. s,
  13321. l,
  13322. c,
  13323. h,
  13324. u = 0,
  13325. d = 8,
  13326. p = 64
  13327. for (h = 0; h < d; ++h) {
  13328. ;(i = e[u]),
  13329. (n = e[u + 1]),
  13330. (r = e[u + 2]),
  13331. (o = e[u + 3]),
  13332. (a = e[u + 4]),
  13333. (s = e[u + 5]),
  13334. (l = e[u + 6]),
  13335. (c = e[u + 7])
  13336. var f = i + c,
  13337. g = i - c,
  13338. m = n + l,
  13339. v = n - l,
  13340. A = r + s,
  13341. y = r - s,
  13342. C = o + a,
  13343. I = o - a,
  13344. E = f + C,
  13345. b = f - C,
  13346. w = m + A,
  13347. _ = m - A
  13348. ;(e[u] = E + w), (e[u + 4] = E - w)
  13349. var T = 0.707106781 * (_ + b)
  13350. ;(e[u + 2] = b + T), (e[u + 6] = b - T), (E = I + y), (w = y + v), (_ = v + g)
  13351. var x = 0.382683433 * (E - _),
  13352. S = 0.5411961 * E + x,
  13353. M = 1.306562965 * _ + x,
  13354. R = 0.707106781 * w,
  13355. P = g + R,
  13356. L = g - R
  13357. ;(e[u + 5] = L + S),
  13358. (e[u + 3] = L - S),
  13359. (e[u + 1] = P + M),
  13360. (e[u + 7] = P - M),
  13361. (u += 8)
  13362. }
  13363. for (u = 0, h = 0; h < d; ++h) {
  13364. ;(i = e[u]),
  13365. (n = e[u + 8]),
  13366. (r = e[u + 16]),
  13367. (o = e[u + 24]),
  13368. (a = e[u + 32]),
  13369. (s = e[u + 40]),
  13370. (l = e[u + 48]),
  13371. (c = e[u + 56])
  13372. var D = i + c,
  13373. N = i - c,
  13374. B = n + l,
  13375. F = n - l,
  13376. V = r + s,
  13377. U = r - s,
  13378. k = o + a,
  13379. H = o - a,
  13380. G = D + k,
  13381. z = D - k,
  13382. W = B + V,
  13383. j = B - V
  13384. ;(e[u] = G + W), (e[u + 32] = G - W)
  13385. var Y = 0.707106781 * (j + z)
  13386. ;(e[u + 16] = z + Y), (e[u + 48] = z - Y), (G = H + U), (W = U + F), (j = F + N)
  13387. var X = 0.382683433 * (G - j),
  13388. Z = 0.5411961 * G + X,
  13389. q = 1.306562965 * j + X,
  13390. K = 0.707106781 * W,
  13391. Q = N + K,
  13392. J = N - K
  13393. ;(e[u + 40] = J + Z),
  13394. (e[u + 24] = J - Z),
  13395. (e[u + 8] = Q + q),
  13396. (e[u + 56] = Q - q),
  13397. u++
  13398. }
  13399. var $
  13400. for (h = 0; h < p; ++h)
  13401. ($ = e[h] * t[h]), (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0)
  13402. return O
  13403. }
  13404. function u() {
  13405. c(65504),
  13406. c(16),
  13407. l(74),
  13408. l(70),
  13409. l(73),
  13410. l(70),
  13411. l(0),
  13412. l(1),
  13413. l(1),
  13414. l(0),
  13415. c(1),
  13416. c(1),
  13417. l(0),
  13418. l(0)
  13419. }
  13420. function d(e, t) {
  13421. c(65472),
  13422. c(17),
  13423. l(8),
  13424. c(t),
  13425. c(e),
  13426. l(3),
  13427. l(1),
  13428. l(17),
  13429. l(0),
  13430. l(2),
  13431. l(17),
  13432. l(1),
  13433. l(3),
  13434. l(17),
  13435. l(1)
  13436. }
  13437. function p() {
  13438. c(65499), c(132), l(0)
  13439. for (var e = 0; e < 64; e++) l(T[e])
  13440. l(1)
  13441. for (var t = 0; t < 64; t++) l(x[t])
  13442. }
  13443. function f() {
  13444. c(65476), c(418), l(0)
  13445. for (var e = 0; e < 16; e++) l(z[e + 1])
  13446. for (var t = 0; t <= 11; t++) l(W[t])
  13447. l(16)
  13448. for (var i = 0; i < 16; i++) l(j[i + 1])
  13449. for (var n = 0; n <= 161; n++) l(Y[n])
  13450. l(1)
  13451. for (var r = 0; r < 16; r++) l(X[r + 1])
  13452. for (var o = 0; o <= 11; o++) l(Z[o])
  13453. l(17)
  13454. for (var a = 0; a < 16; a++) l(q[a + 1])
  13455. for (var s = 0; s <= 161; s++) l(K[s])
  13456. }
  13457. function g() {
  13458. c(65498), c(12), l(3), l(1), l(0), l(2), l(17), l(3), l(17), l(0), l(63), l(0)
  13459. }
  13460. function m(e, t, i, n, r) {
  13461. for (
  13462. var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0;
  13463. f < d;
  13464. ++f
  13465. )
  13466. L[G[f]] = p[f]
  13467. var g = L[0] - i
  13468. ;(i = L[0]), 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]))
  13469. for (var m = 63; m > 0 && 0 == L[m]; m--);
  13470. if (0 == m) return s(a), i
  13471. for (var v, A = 1; A <= m; ) {
  13472. for (var y = A; 0 == L[A] && A <= m; ++A);
  13473. var C = A - y
  13474. if (C >= c) {
  13475. v = C >> 4
  13476. for (var I = 1; I <= v; ++I) s(l)
  13477. C &= 15
  13478. }
  13479. ;(o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++
  13480. }
  13481. return m != u && s(a), i
  13482. }
  13483. function v() {
  13484. for (var e = String.fromCharCode, t = 0; t < 256; t++) k[t] = e(t)
  13485. }
  13486. function A(e) {
  13487. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  13488. var t = 0
  13489. ;(t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)), i(t), (w = e)
  13490. }
  13491. }
  13492. function y() {
  13493. var e = new Date().getTime()
  13494. t || (t = 50), v(), r(), o(), a(), A(t)
  13495. new Date().getTime() - e
  13496. }
  13497. var C,
  13498. I,
  13499. E,
  13500. b,
  13501. w,
  13502. _ = (Math.round, Math.floor),
  13503. T = new Array(64),
  13504. x = new Array(64),
  13505. S = new Array(64),
  13506. M = new Array(64),
  13507. R = new Array(65535),
  13508. P = new Array(65535),
  13509. O = new Array(64),
  13510. L = new Array(64),
  13511. D = [],
  13512. N = 0,
  13513. B = 7,
  13514. F = new Array(64),
  13515. V = new Array(64),
  13516. U = new Array(64),
  13517. k = new Array(256),
  13518. H = new Array(2048),
  13519. G = [
  13520. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41,
  13521. 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38,
  13522. 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63
  13523. ],
  13524. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  13525. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13526. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  13527. Y = [
  13528. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145,
  13529. 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24,
  13530. 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72,
  13531. 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115,
  13532. 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147,
  13533. 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178,
  13534. 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  13535. 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232,
  13536. 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250
  13537. ],
  13538. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  13539. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13540. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  13541. K = [
  13542. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66,
  13543. 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37,
  13544. 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71,
  13545. 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106,
  13546. 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138,
  13547. 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169,
  13548. 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200,
  13549. 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231,
  13550. 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250
  13551. ]
  13552. ;(this.encode = function (t, i) {
  13553. var n = (new Date().getTime(), i.quality)
  13554. n && A(n),
  13555. (D = new Array()),
  13556. (N = 0),
  13557. (B = 7),
  13558. c(65496),
  13559. u(),
  13560. p(),
  13561. d(t.width, t.height),
  13562. f(),
  13563. g()
  13564. var r = 0,
  13565. o = 0,
  13566. a = 0
  13567. ;(N = 0), (B = 7), (this.encode.displayName = '_encode_')
  13568. for (
  13569. var l,
  13570. h,
  13571. v,
  13572. y,
  13573. w,
  13574. _,
  13575. T,
  13576. x,
  13577. R,
  13578. P = t.data,
  13579. O = t.width,
  13580. L = t.height,
  13581. k = i.flipY,
  13582. G = 4 * O,
  13583. z = k ? L : 0,
  13584. W = k ? -8 : 8;
  13585. (k && z > 0) || (!k && z < L);
  13586. ) {
  13587. for (l = 0; l < G; ) {
  13588. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  13589. (x = (k ? 63 - R : R) >> 3),
  13590. (T = 4 * (7 & R)),
  13591. (_ = w + x * G + T),
  13592. z + x >= L && (_ -= G * (z + 1 + x - L)),
  13593. l + T >= G && (_ -= l + T - G + 4),
  13594. (h = P[_++]),
  13595. (v = P[_++]),
  13596. (y = P[_++]),
  13597. (F[R] = ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) - 128),
  13598. (V[R] =
  13599. ((H[(h + 768) >> 0] + H[(v + 1024) >> 0] + H[(y + 1280) >> 0]) >> 16) -
  13600. 128),
  13601. (U[R] =
  13602. ((H[(h + 1280) >> 0] + H[(v + 1536) >> 0] + H[(y + 1792) >> 0]) >> 16) -
  13603. 128)
  13604. ;(r = m(F, S, r, C, E)), (o = m(V, M, o, I, b)), (a = m(U, M, a, I, b)), (l += 32)
  13605. }
  13606. z += W
  13607. }
  13608. if (B >= 0) {
  13609. var j = []
  13610. ;(j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j)
  13611. }
  13612. return c(65497), new e(D)
  13613. }),
  13614. y()
  13615. }
  13616. function n(e, t) {
  13617. ;(t = t || {}), (t.quality = t.quality || 50)
  13618. var n = t.quality,
  13619. r = new i(n),
  13620. o = r.encode(e, t)
  13621. return {
  13622. data: o,
  13623. width: e.width,
  13624. height: e.height
  13625. }
  13626. }
  13627. t.exports.encode = n
  13628. }).call(this, e('buffer').Buffer)
  13629. },
  13630. {
  13631. buffer: 198
  13632. }
  13633. ],
  13634. 95: [
  13635. function (e, t, i) {
  13636. 'use strict'
  13637. !(function () {
  13638. if (
  13639. ('performance' in window == !1 && (window.performance = {}),
  13640. (Date.now =
  13641. Date.now ||
  13642. function () {
  13643. return new Date().getTime()
  13644. }),
  13645. 'now' in window.performance == !1)
  13646. ) {
  13647. var e = Date.now()
  13648. performance.timing &&
  13649. performance.timing.navigationStart &&
  13650. (e = performance.timing.navigationStart),
  13651. (window.performance.now = function () {
  13652. return Date.now() - e
  13653. })
  13654. }
  13655. })()
  13656. },
  13657. {}
  13658. ],
  13659. 96: [
  13660. function (e, t, i) {
  13661. 'use strict'
  13662. var n = e('three')
  13663. ;(n.EffectComposer = function (e, t) {
  13664. if (((this.renderer = e), void 0 === t)) {
  13665. var i = {
  13666. minFilter: n.LinearFilter,
  13667. magFilter: n.LinearFilter,
  13668. format: n.RGBAFormat,
  13669. stencilBuffer: !1
  13670. },
  13671. r = e.getSize()
  13672. t = new n.WebGLRenderTarget(r.width, r.height, i)
  13673. }
  13674. ;(this.renderTarget1 = t),
  13675. (this.renderTarget2 = t.clone()),
  13676. (this.writeBuffer = this.renderTarget1),
  13677. (this.readBuffer = this.renderTarget2),
  13678. (this.passes = []),
  13679. void 0 === n.CopyShader &&
  13680. console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  13681. (this.copyPass = new n.ShaderPass(n.CopyShader))
  13682. }),
  13683. (n.EffectComposer.prototype = {
  13684. swapBuffers: function () {
  13685. var e = this.readBuffer
  13686. ;(this.readBuffer = this.writeBuffer), (this.writeBuffer = e)
  13687. },
  13688. addPass: function (e) {
  13689. this.passes.push(e)
  13690. },
  13691. insertPass: function (e, t) {
  13692. this.passes.splice(t, 0, e)
  13693. },
  13694. render: function (e) {
  13695. ;(this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2)
  13696. var t,
  13697. i,
  13698. r = !1,
  13699. o = this.passes.length
  13700. for (i = 0; i < o; i++)
  13701. if (((t = this.passes[i]), t.enabled)) {
  13702. if (
  13703. (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r), t.needsSwap)
  13704. ) {
  13705. if (r) {
  13706. var a = this.renderer.context
  13707. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  13708. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  13709. a.stencilFunc(a.EQUAL, 1, 4294967295)
  13710. }
  13711. this.swapBuffers()
  13712. }
  13713. t instanceof n.MaskPass ? (r = !0) : t instanceof n.ClearMaskPass && (r = !1)
  13714. }
  13715. },
  13716. reset: function (e) {
  13717. if (void 0 === e) {
  13718. var t = this.renderer.getSize()
  13719. ;(e = this.renderTarget1.clone()), e.setSize(t.width, t.height)
  13720. }
  13721. this.renderTarget1.dispose(),
  13722. this.renderTarget2.dispose(),
  13723. (this.renderTarget1 = e),
  13724. (this.renderTarget2 = e.clone()),
  13725. (this.writeBuffer = this.renderTarget1),
  13726. (this.readBuffer = this.renderTarget2)
  13727. },
  13728. setSize: function (e, t) {
  13729. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t)
  13730. this.passes.forEach(a => {
  13731. //add for TransitionPass
  13732. a.setSize && a.setSize(e, t)
  13733. })
  13734. }
  13735. })
  13736. },
  13737. {
  13738. three: 217
  13739. }
  13740. ],
  13741. 97: [
  13742. function (e, t, i) {
  13743. 'use strict'
  13744. var n = e('three')
  13745. ;(n.MaskPass = function (e, t) {
  13746. ;(this.scene = e),
  13747. (this.camera = t),
  13748. (this.enabled = !0),
  13749. (this.clear = !0),
  13750. (this.needsSwap = !1),
  13751. (this.inverse = !1)
  13752. }),
  13753. (n.MaskPass.prototype = {
  13754. render: function (e, t, i, n) {
  13755. var r = e.context
  13756. r.colorMask(!1, !1, !1, !1), r.depthMask(!1)
  13757. var o, a
  13758. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  13759. r.enable(r.STENCIL_TEST),
  13760. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  13761. r.stencilFunc(r.ALWAYS, o, 4294967295),
  13762. r.clearStencil(a),
  13763. e.render(this.scene, this.camera, i, this.clear),
  13764. e.render(this.scene, this.camera, t, this.clear),
  13765. r.colorMask(!0, !0, !0, !0),
  13766. r.depthMask(!0),
  13767. r.stencilFunc(r.EQUAL, 1, 4294967295),
  13768. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  13769. }
  13770. }),
  13771. (n.ClearMaskPass = function () {
  13772. this.enabled = !0
  13773. }),
  13774. (n.ClearMaskPass.prototype = {
  13775. render: function (e, t, i, n) {
  13776. var r = e.context
  13777. r.disable(r.STENCIL_TEST)
  13778. }
  13779. })
  13780. },
  13781. {
  13782. three: 217
  13783. }
  13784. ],
  13785. 98: [
  13786. function (e, t, i) {
  13787. 'use strict'
  13788. var n = e('three')
  13789. ;(n.RenderPass = function (e, t, i, r, o) {
  13790. ;(this.scene = e),
  13791. (this.camera = t),
  13792. (this.overrideMaterial = i),
  13793. (this.clearColor = r),
  13794. (this.clearAlpha = void 0 !== o ? o : 1),
  13795. (this.oldClearColor = new n.Color()),
  13796. (this.oldClearAlpha = 1),
  13797. (this.enabled = !0),
  13798. (this.clear = !0),
  13799. (this.needsSwap = !1)
  13800. }),
  13801. (n.RenderPass.prototype = {
  13802. render: function (e, t, i, n) {
  13803. ;(this.scene.overrideMaterial = this.overrideMaterial),
  13804. this.clearColor &&
  13805. (this.oldClearColor.copy(e.getClearColor()),
  13806. (this.oldClearAlpha = e.getClearAlpha()),
  13807. e.setClearColor(this.clearColor, this.clearAlpha)),
  13808. e.render(this.scene, this.camera, i, this.clear),
  13809. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  13810. (this.scene.overrideMaterial = null)
  13811. }
  13812. })
  13813. },
  13814. {
  13815. three: 217
  13816. }
  13817. ],
  13818. 99: [
  13819. function (e, t, i) {
  13820. 'use strict'
  13821. var n = e('three')
  13822. ;(n.ShaderPass = function (e, t) {
  13823. ;(this.textureID = void 0 !== t ? t : 'tDiffuse'),
  13824. e instanceof n.ShaderMaterial
  13825. ? ((this.uniforms = e.uniforms), (this.material = e))
  13826. : e &&
  13827. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  13828. (this.material = new n.ShaderMaterial({
  13829. defines: e.defines || {},
  13830. uniforms: this.uniforms,
  13831. vertexShader: e.vertexShader,
  13832. fragmentShader: e.fragmentShader
  13833. }))),
  13834. (this.renderToScreen = !1),
  13835. (this.enabled = !0),
  13836. (this.needsSwap = !0),
  13837. (this.clear = !1),
  13838. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  13839. (this.scene = new n.Scene()),
  13840. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  13841. this.scene.add(this.quad)
  13842. }),
  13843. (n.ShaderPass.prototype = {
  13844. render: function (e, t, i, n) {
  13845. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  13846. (this.quad.material = this.material),
  13847. this.renderToScreen
  13848. ? e.render(this.scene, this.camera)
  13849. : e.render(this.scene, this.camera, t, this.clear)
  13850. }
  13851. })
  13852. },
  13853. {
  13854. three: 217
  13855. }
  13856. ],
  13857. 100: [
  13858. function (e, t, i) {
  13859. 'use strict'
  13860. var n = e('three')
  13861. n.CopyShader = {
  13862. uniforms: {
  13863. tDiffuse: {
  13864. type: 't',
  13865. value: null
  13866. },
  13867. opacity: {
  13868. type: 'f',
  13869. value: 1
  13870. }
  13871. },
  13872. vertexShader: [
  13873. 'varying vec2 vUv;',
  13874. 'void main() {',
  13875. 'vUv = uv;',
  13876. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13877. '}'
  13878. ].join('\n'),
  13879. fragmentShader: [
  13880. 'uniform float opacity;',
  13881. 'uniform sampler2D tDiffuse;',
  13882. 'varying vec2 vUv;',
  13883. 'void main() {',
  13884. 'vec4 texel = texture2D( tDiffuse, vUv );',
  13885. 'gl_FragColor = opacity * texel;',
  13886. '}'
  13887. ].join('\n')
  13888. }
  13889. },
  13890. {
  13891. three: 217
  13892. }
  13893. ],
  13894. 101: [
  13895. function (e, t, i) {
  13896. 'use strict'
  13897. var n = e('three')
  13898. n.HorizontalBlurShader = {
  13899. uniforms: {
  13900. tDiffuse: {
  13901. type: 't',
  13902. value: null
  13903. },
  13904. h: {
  13905. type: 'f',
  13906. value: 1 / 512
  13907. }
  13908. },
  13909. vertexShader: [
  13910. 'varying vec2 vUv;',
  13911. 'void main() {',
  13912. 'vUv = uv;',
  13913. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13914. '}'
  13915. ].join('\n'),
  13916. fragmentShader: [
  13917. 'uniform sampler2D tDiffuse;',
  13918. 'uniform float h;',
  13919. 'varying vec2 vUv;',
  13920. 'void main() {',
  13921. 'vec4 sum = vec4( 0.0 );',
  13922. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  13923. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  13924. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  13925. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  13926. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13927. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  13928. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  13929. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  13930. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  13931. 'gl_FragColor = sum;',
  13932. '}'
  13933. ].join('\n')
  13934. }
  13935. },
  13936. {
  13937. three: 217
  13938. }
  13939. ],
  13940. 102: [
  13941. function (e, t, i) {
  13942. 'use strict'
  13943. var n = e('three')
  13944. n.VerticalBlurShader = {
  13945. uniforms: {
  13946. tDiffuse: {
  13947. type: 't',
  13948. value: null
  13949. },
  13950. v: {
  13951. type: 'f',
  13952. value: 1 / 512
  13953. }
  13954. },
  13955. vertexShader: [
  13956. 'varying vec2 vUv;',
  13957. 'void main() {',
  13958. 'vUv = uv;',
  13959. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13960. '}'
  13961. ].join('\n'),
  13962. fragmentShader: [
  13963. 'uniform sampler2D tDiffuse;',
  13964. 'uniform float v;',
  13965. 'varying vec2 vUv;',
  13966. 'void main() {',
  13967. 'vec4 sum = vec4( 0.0 );',
  13968. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  13969. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  13970. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  13971. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  13972. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13973. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  13974. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  13975. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  13976. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  13977. 'gl_FragColor = sum;',
  13978. '}'
  13979. ].join('\n')
  13980. }
  13981. },
  13982. {
  13983. three: 217
  13984. }
  13985. ],
  13986. 103: [
  13987. function (e, t, i) {
  13988. 'use strict'
  13989. var n = e('three')
  13990. !(function () {
  13991. if (
  13992. ('performance' in window == 0 && (window.performance = {}),
  13993. 'now' in window.performance == 0)
  13994. ) {
  13995. var e = Date.now()
  13996. performance.timing &&
  13997. performance.timing.navigationStart &&
  13998. (e = performance.timing.navigationStart),
  13999. (window.performance.now = function () {
  14000. return Date.now() - e
  14001. })
  14002. }
  14003. })(),
  14004. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  14005. var t,
  14006. i = this.extensions,
  14007. r = this.context
  14008. if (e === n.RepeatWrapping) return r.REPEAT
  14009. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE
  14010. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT
  14011. if (e === n.NearestFilter) return r.NEAREST
  14012. if (e === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST
  14013. if (e === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR
  14014. if (e === n.LinearFilter) return r.LINEAR
  14015. if (e === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST
  14016. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR
  14017. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE
  14018. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4
  14019. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1
  14020. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5
  14021. if (e === n.ByteType) return r.BYTE
  14022. if (e === n.ShortType) return r.SHORT
  14023. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT
  14024. if (e === n.IntType) return r.INT
  14025. if (e === n.UnsignedIntType) return r.UNSIGNED_INT
  14026. if (e === n.FloatType) return r.FLOAT
  14027. if (((t = i.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  14028. return t.HALF_FLOAT_OES
  14029. if (e === n.AlphaFormat) return r.ALPHA
  14030. if (e === n.RGBFormat) return r.RGB
  14031. if (e === n.RGBAFormat) return r.RGBA
  14032. if (e === n.LuminanceFormat) return r.LUMINANCE
  14033. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA
  14034. if (e === n.AddEquation) return r.FUNC_ADD
  14035. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT
  14036. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT
  14037. if (e === n.ZeroFactor) return r.ZERO
  14038. if (e === n.OneFactor) return r.ONE
  14039. if (e === n.SrcColorFactor) return r.SRC_COLOR
  14040. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR
  14041. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA
  14042. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA
  14043. if (e === n.DstAlphaFactor) return r.DST_ALPHA
  14044. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA
  14045. if (e === n.DstColorFactor) return r.DST_COLOR
  14046. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR
  14047. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE
  14048. if (((t = i.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  14049. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  14050. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  14051. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  14052. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  14053. }
  14054. if (((t = i.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  14055. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  14056. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  14057. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  14058. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  14059. }
  14060. if (
  14061. ((t = i.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)
  14062. )
  14063. return t.COMPRESSED_RGB_ETC1_WEBGL
  14064. if (((t = i.get('EXT_blend_minmax')), null !== t)) {
  14065. if (e === n.MinEquation) return t.MIN_EXT
  14066. if (e === n.MaxEquation) return t.MAX_EXT
  14067. }
  14068. return 0
  14069. }),
  14070. (n.WebGLState = function (e, t, i) {
  14071. var r = this,
  14072. o = new n.Vector4(),
  14073. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  14074. s = new Uint8Array(a),
  14075. l = new Uint8Array(a),
  14076. c = new Uint8Array(a),
  14077. h = {},
  14078. u = null,
  14079. d = null,
  14080. p = null,
  14081. f = null,
  14082. g = null,
  14083. m = null,
  14084. v = null,
  14085. A = null,
  14086. y = !1,
  14087. C = null,
  14088. I = null,
  14089. E = null,
  14090. b = null,
  14091. w = null,
  14092. _ = null,
  14093. T = null,
  14094. x = null,
  14095. S = null,
  14096. M = null,
  14097. R = null,
  14098. P = null,
  14099. O = null,
  14100. L = null,
  14101. D = null,
  14102. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  14103. B = void 0,
  14104. F = {},
  14105. V = new n.Vector4(),
  14106. U = null,
  14107. k = null,
  14108. H = new n.Vector4(),
  14109. G = new n.Vector4()
  14110. ;(this.init = function () {
  14111. this.clearColor(0, 0, 0, 1),
  14112. this.clearDepth(1),
  14113. this.clearStencil(0),
  14114. this.enable(e.DEPTH_TEST),
  14115. e.depthFunc(e.LEQUAL),
  14116. e.frontFace(e.CCW),
  14117. e.cullFace(e.BACK),
  14118. this.enable(e.CULL_FACE),
  14119. this.enable(e.BLEND),
  14120. e.blendEquation(e.FUNC_ADD),
  14121. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  14122. }),
  14123. (this.initAttributes = function () {
  14124. for (var e = 0, t = s.length; e < t; e++) s[e] = 0
  14125. }),
  14126. (this.enableAttribute = function (i) {
  14127. if (
  14128. ((s[i] = 1), 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)), 0 !== c[i])
  14129. ) {
  14130. var n = t.get('ANGLE_instanced_arrays')
  14131. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0)
  14132. }
  14133. }),
  14134. (this.enableAttributeAndDivisor = function (t, i, n) {
  14135. ;(s[t] = 1),
  14136. 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)),
  14137. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i))
  14138. }),
  14139. (this.disableUnusedAttributes = function () {
  14140. for (var t = 0, i = l.length; t < i; t++)
  14141. l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  14142. }),
  14143. (this.enable = function (t) {
  14144. h[t] !== !0 && (e.enable(t), (h[t] = !0))
  14145. }),
  14146. (this.disable = function (t) {
  14147. h[t] !== !1 && (e.disable(t), (h[t] = !1))
  14148. }),
  14149. (this.getCompressedTextureFormats = function () {
  14150. if (
  14151. null === u &&
  14152. ((u = []),
  14153. t.get('WEBGL_compressed_texture_pvrtc') ||
  14154. t.get('WEBGL_compressed_texture_s3tc') ||
  14155. t.get('WEBGL_compressed_texture_etc1'))
  14156. )
  14157. for (
  14158. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  14159. n < i.length;
  14160. n++
  14161. )
  14162. u.push(i[n])
  14163. return u
  14164. }),
  14165. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  14166. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  14167. (t === d && h === y) ||
  14168. (t === n.AdditiveBlending
  14169. ? h
  14170. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14171. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  14172. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  14173. : t === n.SubtractiveBlending
  14174. ? h
  14175. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14176. e.blendFuncSeparate(
  14177. e.ZERO,
  14178. e.ZERO,
  14179. e.ONE_MINUS_SRC_COLOR,
  14180. e.ONE_MINUS_SRC_ALPHA
  14181. ))
  14182. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  14183. : t === n.MultiplyBlending
  14184. ? h
  14185. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14186. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  14187. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  14188. : h
  14189. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14190. e.blendFuncSeparate(
  14191. e.ONE,
  14192. e.ONE_MINUS_SRC_ALPHA,
  14193. e.ONE,
  14194. e.ONE_MINUS_SRC_ALPHA
  14195. ))
  14196. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14197. e.blendFuncSeparate(
  14198. e.SRC_ALPHA,
  14199. e.ONE_MINUS_SRC_ALPHA,
  14200. e.ONE,
  14201. e.ONE_MINUS_SRC_ALPHA
  14202. )),
  14203. (d = t),
  14204. (y = h)),
  14205. t === n.CustomBlending
  14206. ? ((s = s || r),
  14207. (l = l || o),
  14208. (c = c || a),
  14209. (r === p && s === m) ||
  14210. (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  14211. (o === f && a === g && l === v && c === A) ||
  14212. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  14213. (f = o),
  14214. (g = a),
  14215. (v = l),
  14216. (A = c)))
  14217. : ((p = null), (f = null), (g = null), (m = null), (v = null), (A = null))
  14218. }),
  14219. (this.setDepthFunc = function (t) {
  14220. if (C !== t) {
  14221. if (t)
  14222. switch (t) {
  14223. case n.NeverDepth:
  14224. e.depthFunc(e.NEVER)
  14225. break
  14226. case n.AlwaysDepth:
  14227. e.depthFunc(e.ALWAYS)
  14228. break
  14229. case n.LessDepth:
  14230. e.depthFunc(e.LESS)
  14231. break
  14232. case n.LessEqualDepth:
  14233. e.depthFunc(e.LEQUAL)
  14234. break
  14235. case n.EqualDepth:
  14236. e.depthFunc(e.EQUAL)
  14237. break
  14238. case n.GreaterEqualDepth:
  14239. e.depthFunc(e.GEQUAL)
  14240. break
  14241. case n.GreaterDepth:
  14242. e.depthFunc(e.GREATER)
  14243. break
  14244. case n.NotEqualDepth:
  14245. e.depthFunc(e.NOTEQUAL)
  14246. break
  14247. default:
  14248. e.depthFunc(e.LEQUAL)
  14249. }
  14250. else e.depthFunc(e.LEQUAL)
  14251. C = t
  14252. }
  14253. }),
  14254. (this.setDepthTest = function (t) {
  14255. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  14256. }),
  14257. (this.setDepthWrite = function (t) {
  14258. I !== t && (e.depthMask(t), (I = t))
  14259. }),
  14260. (this.setColorWrite = function (t) {
  14261. E !== t && (e.colorMask(t, t, t, t), (E = t))
  14262. }),
  14263. (this.setStencilFunc = function (t, i, n) {
  14264. ;(w === t && _ === i && T === n) ||
  14265. (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n))
  14266. }),
  14267. (this.setStencilOp = function (t, i, n) {
  14268. ;(x === t && S === i && M === n) ||
  14269. (e.stencilOp(t, i, n), (x = t), (S = i), (M = n))
  14270. }),
  14271. (this.setStencilTest = function (t) {
  14272. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  14273. }),
  14274. (this.setStencilWrite = function (t) {
  14275. b !== t && (e.stencilMask(t), (b = t))
  14276. }),
  14277. (this.setFlipSided = function (t) {
  14278. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t))
  14279. }),
  14280. (this.setLineWidth = function (t) {
  14281. t !== P && (e.lineWidth(t), (P = t))
  14282. }),
  14283. (this.setPolygonOffset = function (t, i, n) {
  14284. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  14285. !t || (O === i && L === n) || (e.polygonOffset(i, n), (O = i), (L = n))
  14286. }),
  14287. (this.getScissorTest = function () {
  14288. return D
  14289. }),
  14290. (this.setScissorTest = function (t) {
  14291. ;(D = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  14292. }),
  14293. (this.activeTexture = function (t) {
  14294. void 0 === t && (t = e.TEXTURE0 + N - 1), B !== t && (e.activeTexture(t), (B = t))
  14295. }),
  14296. (this.bindTexture = function (t, i) {
  14297. void 0 === B && r.activeTexture()
  14298. var n = F[B]
  14299. void 0 === n &&
  14300. ((n = {
  14301. type: void 0,
  14302. texture: void 0
  14303. }),
  14304. (F[B] = n)),
  14305. (n.type === t && n.texture === i) ||
  14306. (e.bindTexture(t, i), (n.type = t), (n.texture = i))
  14307. }),
  14308. (this.compressedTexImage2D = function () {
  14309. try {
  14310. e.compressedTexImage2D.apply(e, arguments)
  14311. } catch (e) {
  14312. console.error(e)
  14313. }
  14314. }),
  14315. (this.texImage2D = function () {
  14316. try {
  14317. e.texImage2D.apply(e, arguments)
  14318. } catch (e) {
  14319. console.error(e)
  14320. }
  14321. }),
  14322. (this.clearColor = function (t, i, n, r) {
  14323. o.set(t, i, n, r), V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o))
  14324. }),
  14325. (this.clearDepth = function (t) {
  14326. U !== t && (e.clearDepth(t), (U = t))
  14327. }),
  14328. (this.clearStencil = function (t) {
  14329. k !== t && (e.clearStencil(t), (k = t))
  14330. }),
  14331. (this.scissor = function (t) {
  14332. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), H.copy(t))
  14333. }),
  14334. (this.viewport = function (t) {
  14335. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), G.copy(t))
  14336. }),
  14337. (this.reset = function () {
  14338. for (var t = 0; t < l.length; t++)
  14339. 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  14340. ;(h = {}),
  14341. (u = null),
  14342. (B = void 0),
  14343. (F = {}),
  14344. (d = null),
  14345. (E = null),
  14346. (I = null),
  14347. (b = null),
  14348. (R = null)
  14349. })
  14350. })
  14351. },
  14352. {
  14353. three: 217
  14354. }
  14355. ],
  14356. 104: [
  14357. function (e, t, i) {
  14358. ;(function (i, n) {
  14359. 'use strict'
  14360. function r(e) {
  14361. this.urls = e
  14362. var t = i(
  14363. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  14364. 'base64'
  14365. )
  14366. ;(this.builder = a.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'))
  14367. }
  14368. var o = e('three'),
  14369. a = e('protobufjs'),
  14370. s = e('../util/logger'),
  14371. l = (e('../util/common'), e('../util/ajax')),
  14372. c = e('../objects/Chunk'),
  14373. h = new s(n)
  14374. ;(r.prototype = {
  14375. constructor: r,
  14376. load: function (e, t, i, n) {
  14377. return (
  14378. h.time('download'),
  14379. l
  14380. .get(e, {
  14381. responseType: 'arraybuffer'
  14382. })
  14383. .done(
  14384. function (r) {
  14385. h.timeEnd('download'), this.parse(r, e, t, i, n)
  14386. }.bind(this)
  14387. )
  14388. .fail(n)
  14389. )
  14390. },
  14391. parse: function (e, t, i, n, r) {
  14392. var o = this.readProtobuf(e)
  14393. if (!o) return r()
  14394. try {
  14395. h.time('convert to webgl'),
  14396. this.convertProtobufToSceneObject(o, t, i, n, r),
  14397. h.timeEnd('convert to webgl')
  14398. } catch (e) {
  14399. return h.error('failed parsing .dam'), h.error(e.message), r()
  14400. }
  14401. },
  14402. readProtobuf: function (e) {
  14403. var t
  14404. try {
  14405. h.time('parse proto'), (t = this.decoder.decode(e)), h.timeEnd('parse proto')
  14406. } catch (e) {
  14407. return h.error('failed parsing proto for .dam'), h.error(e.message), null
  14408. }
  14409. return t
  14410. },
  14411. convertProtobufToSceneObject: function (e, t, i, n, r) {
  14412. function a(e) {
  14413. var i = new o.BufferGeometry()
  14414. return (
  14415. i.addAttribute(
  14416. 'position',
  14417. new o.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)
  14418. ),
  14419. e.vertices.uv.length > 0 &&
  14420. i.addAttribute(
  14421. 'uv',
  14422. new o.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)
  14423. ),
  14424. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  14425. i.applyMatrix(s),
  14426. i.computeBoundingBox(),
  14427. new c({
  14428. geometry: i,
  14429. textureName: e.material_name,
  14430. name: e.chunk_name,
  14431. meshUrl: t
  14432. })
  14433. )
  14434. }
  14435. if (0 === e.chunk.length) return h.warn('No chunks in damfile...'), i([])
  14436. var s = new o.Matrix4()
  14437. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)
  14438. var l = e.chunk.map(a)
  14439. return l ? i(l) : (h.error('.dam protobuf came out with no chunks...'), r())
  14440. }
  14441. }),
  14442. (t.exports = r)
  14443. }).call(this, e('buffer').Buffer, '/js/loaders/DamLoader.js')
  14444. },
  14445. {
  14446. '../objects/Chunk': 144,
  14447. '../util/ajax': 181,
  14448. '../util/common': 185,
  14449. '../util/logger': 189,
  14450. buffer: 198,
  14451. protobufjs: 214,
  14452. three: 217
  14453. }
  14454. ],
  14455. 105: [
  14456. function (e, t, i) {
  14457. ;(function (i) {
  14458. 'use strict'
  14459. var n = (e('three'), e('../settings'), e('../util/browser'), e('./DamLoader')),
  14460. r = e('../util/logger'),
  14461. o = (e('../ab'), new r(i))
  14462. t.exports = {
  14463. getLoaders: function () {
  14464. return [
  14465. ['_50k', '.dam', n],
  14466. ['', '.dam', n]
  14467. ]
  14468. },
  14469. load: function (e, t, i, n, r, a) {
  14470. var s = this.getLoaders()
  14471. a = a || 0
  14472. var l = s[a]
  14473. if (!l) return void (r && r('No suitable model file found...'))
  14474. var c = l[0],
  14475. h = l[1],
  14476. u = new l[2](t),
  14477. d = t.get(e + c + h)
  14478. d
  14479. ? (o.debug('Trying ' + c + h),
  14480. u.load(
  14481. d,
  14482. i,
  14483. n,
  14484. function () {
  14485. this.load(e, t, i, n, r, ++a)
  14486. }.bind(this)
  14487. ))
  14488. : (o.debug('Skipping ' + h + ', not available'), this.load(e, t, i, n, r, ++a))
  14489. }
  14490. }
  14491. }).call(this, '/js/loaders/ModelLoader.js')
  14492. },
  14493. {
  14494. '../ab': 3,
  14495. '../settings': 166,
  14496. '../util/browser': 182,
  14497. '../util/logger': 189,
  14498. './DamLoader': 104,
  14499. three: 217
  14500. }
  14501. ],
  14502. 106: [
  14503. function (e, t, i) {
  14504. ;(function (i) {
  14505. 'use strict'
  14506. var n = e('../util/common'),
  14507. r = e('../util/texture'),
  14508. o = e('../util/browser'),
  14509. a = e('../util/logger'),
  14510. s = e('../settings'),
  14511. l = new a(i)
  14512. t.exports = {
  14513. load: function (e, t) {
  14514. function i(e, i) {
  14515. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve())
  14516. }
  14517. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when()
  14518. var a = n.countUnique(
  14519. e.chunks.map(function (e) {
  14520. return e.textureName
  14521. })
  14522. ),
  14523. c = e.chunks[0].meshUrl.indexOf('_50k') !== -1 ? '_50k' : '',
  14524. h = '_50k' === c ? 'high' : 'low'
  14525. s.minimalMemoryMode &&
  14526. 'high' === h &&
  14527. (o.detectSamsungS6()
  14528. ? (l.warn('Galaxy S6 cannot handle large textures, turning down quality.'),
  14529. (h = 'low'))
  14530. : a > s.maxMobileTextures &&
  14531. (l.warn('Model probably too large for mobile, turning down quality.'),
  14532. (h = 'low')))
  14533. var u = e.data.job.uuid + c + '_texture_jpg_' + h + '/',
  14534. d = $.Deferred(),
  14535. p = 0
  14536. return (
  14537. e.chunks.forEach(function (t) {
  14538. if (!t.material.map && t.textureName) {
  14539. var n = e.urls.get(u + t.textureName)
  14540. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  14541. }
  14542. }),
  14543. d.promise()
  14544. )
  14545. }
  14546. }
  14547. }).call(this, '/js/loaders/ModelTextureLoader.js')
  14548. },
  14549. {
  14550. '../settings': 166,
  14551. '../util/browser': 182,
  14552. '../util/common': 185,
  14553. '../util/logger': 189,
  14554. '../util/texture': 194
  14555. }
  14556. ],
  14557. 107: [
  14558. function (e, t, i) {
  14559. ;(function (i, n) {
  14560. 'use strict'
  14561. function r(e) {
  14562. ;(this.model = e),
  14563. (this.modelDataPath =
  14564. this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()),
  14565. (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'))
  14566. var t = i(
  14567. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  14568. 'base64'
  14569. ),
  14570. n = o.loadProto(t)
  14571. this.decoder = n.build('VisionModeldata')
  14572. }
  14573. var o = e('protobufjs'),
  14574. a = e('../util/ajax'),
  14575. s = (e('../util/common'), e('../util/math')),
  14576. l = e('../util/logger'),
  14577. c = new l(n)
  14578. ;(r.prototype.load = function () {
  14579. return this.modelDataPath
  14580. ? (c.info('Using vision.modeldata'), this.loadVisionModelData())
  14581. : this.sweepLocationsPath
  14582. ? (c.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  14583. : (c.warn('No sweep file found'), $.when([]))
  14584. }),
  14585. (r.prototype.loadVisionModelData = function () {
  14586. return a
  14587. .get(this.modelDataPath, {
  14588. responseType: 'arraybuffer'
  14589. })
  14590. .then(
  14591. function (e) {
  14592. var t
  14593. try {
  14594. t = this.decoder.decode(e)
  14595. } catch (e) {
  14596. return (
  14597. c.warn('Could not decode vision.modeldata, trying sweep_locations.csv'),
  14598. this.loadSweepLocationsCSV()
  14599. )
  14600. }
  14601. var i = t.sweepLocations
  14602. .map(function (e) {
  14603. return {
  14604. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  14605. position: {
  14606. x: e.pose.translation.x,
  14607. y: e.pose.translation.y,
  14608. z: e.pose.translation.z
  14609. },
  14610. quaternion: {
  14611. x: e.pose.rotation.x,
  14612. y: e.pose.rotation.y,
  14613. z: e.pose.rotation.z,
  14614. w: e.pose.rotation.w
  14615. },
  14616. puck: {
  14617. x: e.puck.x,
  14618. y: e.puck.y,
  14619. z: e.puck.z
  14620. },
  14621. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  14622. neighbours: e.visibles,
  14623. alignmentType: e.alignment_type
  14624. }
  14625. })
  14626. .map(function (e) {
  14627. return (
  14628. (e.position = s.convertVisionVector(e.position)),
  14629. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14630. (e.puck = s.convertVisionVector(e.puck)),
  14631. e
  14632. )
  14633. })
  14634. return (
  14635. i.forEach(function (e) {
  14636. e.neighbours = e.neighbours.map(function (e) {
  14637. return i[e].uuid
  14638. })
  14639. }),
  14640. i
  14641. )
  14642. }.bind(this),
  14643. function () {
  14644. return (
  14645. c.warn('Could not load vision.modeldata, trying sweep_locations.csv'),
  14646. this.loadSweepLocationsCSV()
  14647. )
  14648. }.bind(this)
  14649. )
  14650. }),
  14651. (r.prototype.loadSweepLocationsCSV = function () {
  14652. return a
  14653. .get(this.sweepLocationsPath)
  14654. .then(function (e) {
  14655. var t = e
  14656. .split('\n')
  14657. .map(function (e) {
  14658. return e.split(', ')
  14659. })
  14660. .filter(function (e) {
  14661. return e.length > 1
  14662. })
  14663. .map(function (e) {
  14664. return {
  14665. uuid: e[0],
  14666. position: {
  14667. x: parseFloat(e[1]),
  14668. y: parseFloat(e[2]),
  14669. z: parseFloat(e[3])
  14670. },
  14671. quaternion: {
  14672. x: parseFloat(e[4]),
  14673. y: parseFloat(e[5]),
  14674. z: parseFloat(e[6]),
  14675. w: parseFloat(e[7])
  14676. }
  14677. }
  14678. })
  14679. .map(function (e) {
  14680. return (
  14681. (e.position = s.convertVisionVector(e.position)),
  14682. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14683. e
  14684. )
  14685. })
  14686. return t
  14687. })
  14688. .fail(function () {
  14689. c.warn('Could not load sweep_locations.csv, no sweeps loaded.')
  14690. })
  14691. }),
  14692. (t.exports = r)
  14693. }).call(this, e('buffer').Buffer, '/js/loaders/SweepDataLoader.js')
  14694. },
  14695. {
  14696. '../util/ajax': 181,
  14697. '../util/common': 185,
  14698. '../util/logger': 189,
  14699. '../util/math': 190,
  14700. buffer: 198,
  14701. protobufjs: 214
  14702. }
  14703. ],
  14704. 108: [
  14705. function (e, t, i) {
  14706. ;(function (i) {
  14707. 'use strict'
  14708. function n() {
  14709. this.locale = null
  14710. }
  14711. var r = e('../settings'),
  14712. o = e('../util/common'),
  14713. a = e('../util/logger'),
  14714. s = e('../enum/Locale'),
  14715. l = new a(i)
  14716. ;(n.prototype.init = function () {
  14717. var t
  14718. switch (r.languageTag) {
  14719. case null:
  14720. case 'en':
  14721. case s.EN_US:
  14722. ;(this.locale = s.EN_US), (t = e('./strings-en-US'))
  14723. break
  14724. case 'es':
  14725. case s.ES_MX:
  14726. ;(this.locale = s.ES_MX), (t = e('./strings-es-MX'))
  14727. break
  14728. case 'fr':
  14729. case s.FR_FR:
  14730. ;(this.locale = s.FR_FR), (t = e('./strings-fr-FR'))
  14731. break
  14732. case 'de':
  14733. case s.DE_DE:
  14734. ;(this.locale = s.DE_DE), (t = e('./strings-de-DE'))
  14735. break
  14736. case 'ru':
  14737. case s.RU_RU:
  14738. ;(this.locale = s.RU_RU), (t = e('./strings-ru-RU'))
  14739. break
  14740. case 'cn':
  14741. case s.CN_CN:
  14742. ;(this.locale = s.CN_CN), (t = e('./strings-cn-CN'))
  14743. break
  14744. case 'jp':
  14745. case s.JP_JP:
  14746. ;(this.locale = s.JP_JP), (t = e('./strings-jp-JP'))
  14747. break
  14748. default:
  14749. l.info("Unsupported language tag, defaulting to 'en-US'"),
  14750. (this.locale = s.EN_US),
  14751. (t = e('./strings-en-US'))
  14752. }
  14753. l.info("Using locale '" + this.locale + "'"), o.extendObject(this, t)
  14754. }),
  14755. (n.prototype.localizeGUI = function () {
  14756. var e = document.querySelector('#gui-parent')
  14757. this.localizeTree(e), this.localizeLoadingText()
  14758. }),
  14759. (n.prototype.localizeLoadingText = function () {
  14760. // var e = document.querySelector("#loader-cont")
  14761. // , t = e.getAttribute("title");
  14762. // e.removeAttribute("title"),
  14763. // e.setAttribute("data-status", t),
  14764. // e.classList.add(this.locale),
  14765. document.querySelector('#help-dialog').classList.add(this.locale),
  14766. document.querySelector('#interaction-modal').classList.add(this.locale),
  14767. document.querySelector('#gui').classList.add(this.locale)
  14768. }),
  14769. (n.prototype.localizeTree = function (e) {
  14770. var t,
  14771. i,
  14772. n = /{\[{ ?(\w+) ?}\]}/
  14773. if (e.nodeType === Node.TEXT_NODE)
  14774. (t = e.data.match(n)), t && ((i = t[1]), (e.data = this.localizeText(i) || i))
  14775. else if (e.nodeType === Node.ELEMENT_NODE) {
  14776. var r = e.getAttribute('title')
  14777. r &&
  14778. ((t = r.match(n)),
  14779. t && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i)))
  14780. }
  14781. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling)
  14782. }),
  14783. (n.prototype.localizeText = function (t) {
  14784. var i = this[t]
  14785. return (
  14786. i ||
  14787. this.locale === s.EN_US ||
  14788. (l.warn(
  14789. "Localization key '" +
  14790. t +
  14791. "' not available for locale '" +
  14792. this.locale +
  14793. "', defaulting to English."
  14794. ),
  14795. (i = e('./strings-en-US')[t])),
  14796. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  14797. i
  14798. )
  14799. }),
  14800. (t.exports = new n())
  14801. }).call(this, '/js/localization/localize.js')
  14802. },
  14803. {
  14804. '../enum/Locale': 31,
  14805. '../settings': 166,
  14806. '../util/common': 185,
  14807. '../util/logger': 189,
  14808. './strings-cn-CN': 109,
  14809. './strings-de-DE': 110,
  14810. './strings-en-US': 111,
  14811. './strings-es-MX': 112,
  14812. './strings-fr-FR': 113,
  14813. './strings-jp-JP': 114,
  14814. './strings-ru-RU': 115
  14815. }
  14816. ],
  14817. 109: [
  14818. function (e, t, i) {
  14819. 'use strict'
  14820. t.exports = {
  14821. PAGE_TITLE: '',
  14822. LOADING: '正在加载',
  14823. PRESENTED_BY_CAPS: '呈现者:',
  14824. POWERED_BY: '技术支持:',
  14825. POWERED_BY_CAPS: '技术支持:',
  14826. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14827. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14828. PRESENTED_BY: '呈现者:',
  14829. MORE: '更多 ',
  14830. LESS: '更少 ',
  14831. TAG_CONTENT: 'tag™ 内容',
  14832. SHOW: '显示',
  14833. HIDE: '隐藏',
  14834. DOLLHOUSE: '场景屋',
  14835. FLOOR_PLAN: '楼层平面图',
  14836. OPEN_HIGHLIGHTS: '打开精彩片段',
  14837. CLOSE_HIGHLIGHTS: '关闭',
  14838. PREVIOUS: '上一个',
  14839. PLAY: '播放',
  14840. PAUSE: '暂停',
  14841. NEXT: '下一个',
  14842. EXPLORE_3D_SPACE: '探索 3D 空间',
  14843. VIEW_DOLLHOUSE: '观看场景屋',
  14844. SOCIAL_SHARING: '分享这个空间',
  14845. VIEW_IN_VR: '以 VR 观看',
  14846. VIEW_FULLSCREEN: '全屏观看',
  14847. EXIT_FULLSCREEN: ' 退出全屏',
  14848. ZOOM_IN: '放大',
  14849. ZOOM_OUT: '缩小',
  14850. FLOOR_NAME: '楼层',
  14851. FLOOR_ALL: 'ALL',
  14852. FLOOR_Lang: ['Floor', ''],
  14853. TERMS: '条款',
  14854. PORT_TERMS: 'port 条款',
  14855. TERMS_OF_USE: '使用条款',
  14856. CLOSE_TERMS: '关闭',
  14857. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  14858. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  14859. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  14860. WEBVR_ENTER_WEBVR: '进入 VR',
  14861. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  14862. WEBVR_LEARN_MORE: '了解更多',
  14863. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  14864. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  14865. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14866. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  14867. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  14868. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  14869. VR_LEARN_MORE_CAPS: '了解更多',
  14870. VR_PREVIOUS_CAPS: '上一个’,',
  14871. VR_NEXT_CAPS: '下一个',
  14872. VR_GOT_IT_CAPS: '明白了',
  14873. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  14874. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  14875. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  14876. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  14877. VR_WHAT_YOU_NEED: '关于...您需要什么',
  14878. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  14879. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  14880. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  14881. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14882. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14883. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14884. VR_APP: 'port VR 应用程序',
  14885. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14886. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14887. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  14888. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  14889. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  14890. VR_COMPATIBLE_ANDROID_LONG:
  14891. '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  14892. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  14893. VR_ANDROID_DVICES: 'Android 设备',
  14894. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  14895. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  14896. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  14897. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  14898. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  14899. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  14900. VR_DOWNLOAD_HERE: '在此下载',
  14901. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  14902. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  14903. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  14904. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  14905. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  14906. SHARE_TO: '分享到',
  14907. SHARE_LINK: '直接链接',
  14908. SHARE_EXPLORE: '探索',
  14909. SHARE_AT: '在',
  14910. SHARE_WITH: '使用',
  14911. SHARE_3D: '以 3D',
  14912. SHARE_COPIED: '已复制!',
  14913. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  14914. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  14915. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  14916. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  14917. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  14918. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  14919. ERROR_GENERIC_ACTIONS_3: ' 或',
  14920. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  14921. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  14922. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  14923. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  14924. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  14925. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  14926. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  14927. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  14928. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  14929. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  14930. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  14931. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  14932. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  14933. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  14934. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  14935. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  14936. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  14937. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  14938. LINK_TO_LOCATION: '地点链接',
  14939. MENU_COPY: '复制',
  14940. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  14941. ROTATE: '旋转',
  14942. MOVE: '移动',
  14943. INSIDE: '内部',
  14944. ZOOM: '缩放',
  14945. HELP: '小帮手',
  14946. HELP_NAVIGATION_TAB: '导航',
  14947. HELP_MORE_HELP_TAB: '更多帮助',
  14948. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  14949. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  14950. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  14951. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  14952. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  14953. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  14954. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  14955. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  14956. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  14957. HELP_DESKTOP_DOLLHOUSE_2A:
  14958. '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  14959. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  14960. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  14961. HELP_DESKTOP_FLOORPLAN_1A:
  14962. '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  14963. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  14964. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  14965. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  14966. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  14967. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  14968. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  14969. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  14970. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  14971. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  14972. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  14973. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  14974. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  14975. HELP_MORE_HLR_A: '精彩片段集锦',
  14976. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  14977. HELP_MORE_DOLLHOUSE_A: '场景屋',
  14978. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  14979. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  14980. HELP_MORE_FLOORS_A: '楼层选择器',
  14981. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  14982. HELP_MORE_TAG_A: 'tag™ 贴文',
  14983. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  14984. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  14985. HELP_MORE_ZOOM_A: '缩放控件',
  14986. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  14987. HELP_MORE_TOUR_A: '导览控件',
  14988. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  14989. HELP_MORE_INSIDE_A: '内部视图',
  14990. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  14991. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  14992. HELP_MORE_VR_A: 'VR 模式',
  14993. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  14994. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  14995. HELP_MORE_360_A: '360° 视图',
  14996. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  14997. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  14998. HELP_MORE_FULLSCREEN_A: '全屏',
  14999. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  15000. CLOSE: '关闭'
  15001. }
  15002. },
  15003. {}
  15004. ],
  15005. 110: [
  15006. function (e, t, i) {
  15007. 'use strict'
  15008. t.exports = {
  15009. PAGE_TITLE: '',
  15010. LOADING: 'Lädt',
  15011. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  15012. POWERED_BY: 'Angetrieben von',
  15013. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  15014. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15015. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15016. PRESENTED_BY: 'Präsentiert von ',
  15017. MORE: 'Mehr ',
  15018. LESS: 'Weniger ',
  15019. TAG_CONTENT: 'tag™ Inhalt',
  15020. SHOW: 'Anzeigen',
  15021. HIDE: 'Verbergen',
  15022. DOLLHOUSE: 'Puppenhaus',
  15023. FLOOR_PLAN: 'Grundriss',
  15024. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  15025. CLOSE_HIGHLIGHTS: 'Schließen',
  15026. PREVIOUS: 'Vorheriges',
  15027. PLAY: 'Abspielen',
  15028. PAUSE: 'Pausieren',
  15029. NEXT: 'Nächstes',
  15030. EXPLORE_3D_SPACE: 'Innenraum betreten',
  15031. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  15032. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  15033. VIEW_IN_VR: 'In VR ansehen',
  15034. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  15035. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  15036. ZOOM_IN: 'Vergrößern',
  15037. ZOOM_OUT: 'Verkleinern',
  15038. FLOOR_NAME: 'Etage ',
  15039. FLOOR_ALL: 'Alle',
  15040. TERMS: 'Bedingungen',
  15041. PORT_TERMS: 'port Bedingungen',
  15042. TERMS_OF_USE: 'Nutzungsbedingungen',
  15043. TERMS_TEXT_FILE: 'terms-de-DE.html',
  15044. CLOSE_TERMS: 'Schließen',
  15045. TERMS_FAIL:
  15046. 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  15047. HELP: 'Hilfe',
  15048. HELP_NAVIGATION_TAB: 'Navigation',
  15049. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  15050. CLOSE: 'Schließen',
  15051. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  15052. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  15053. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15054. HELP_DESKTOP_PANORAMA_1B:
  15055. 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  15056. HELP_DESKTOP_PANORAMA_2B:
  15057. 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  15058. HELP_DESKTOP_PANORAMA_3B:
  15059. 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  15060. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  15061. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  15062. HELP_DESKTOP_DOLLHOUSE_1A:
  15063. 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  15064. HELP_DESKTOP_DOLLHOUSE_2A:
  15065. 'Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.',
  15066. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15067. HELP_DESKTOP_DOLLHOUSE_1B:
  15068. 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  15069. HELP_DESKTOP_FLOORPLAN_1A:
  15070. 'Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.',
  15071. HELP_DESKTOP_FLOORPLAN_2A:
  15072. 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  15073. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15074. HELP_DESKTOP_FLOORPLAN_2B:
  15075. 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  15076. HELP_DESKTOP_FLOORPLAN_3B:
  15077. 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  15078. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  15079. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  15080. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  15081. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  15082. HELP_MOBILE_DOLLHOUSE_1:
  15083. 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  15084. HELP_MOBILE_DOLLHOUSE_2:
  15085. 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  15086. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  15087. HELP_MOBILE_FLOORPLAN_2:
  15088. 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  15089. HELP_MORE_HLR_A: 'Liste das Highlight',
  15090. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  15091. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  15092. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15093. 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15094. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15095. 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15096. HELP_MORE_FLOORS_A: 'Etage auswählen',
  15097. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  15098. HELP_MORE_TAG_A: 'tag™ Posts',
  15099. HELP_DESKTOP_MORE_TAG_B:
  15100. 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  15101. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  15102. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  15103. HELP_DESKTOP_MORE_ZOOM_B:
  15104. 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  15105. HELP_MORE_TOUR_A: 'Tour Steuerung',
  15106. HELP_DESKTOP_MORE_TOUR_B:
  15107. 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  15108. HELP_MORE_INSIDE_A: 'Innenansicht',
  15109. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  15110. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  15111. HELP_MORE_VR_A: 'VR Modus',
  15112. HELP_DESKTOP_MORE_VR_B:
  15113. 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  15114. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  15115. HELP_MORE_360_A: '360° Views Ansicht ',
  15116. HELP_DESKTOP_MORE_360_B:
  15117. 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15118. HELP_MOBILE_MORE_360_B:
  15119. 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15120. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  15121. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  15122. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  15123. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  15124. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  15125. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  15126. WEBVR_LEARN_MORE: 'Mehr Infos',
  15127. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15128. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15129. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15130. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  15131. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  15132. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15133. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15134. VR_APP: 'port VR App',
  15135. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  15136. VR_COMPATIBLE_ANDROID_LONG:
  15137. 'Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15138. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  15139. VR_APP_FOR_ANDROID: 'port VR app für Android',
  15140. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  15141. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15142. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  15143. VR_PREVIOUS_CAPS: 'ZURÜCK',
  15144. VR_NEXT_CAPS: 'WEITER',
  15145. VR_GOT_IT_CAPS: 'VERSTANDEN',
  15146. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  15147. VR_SHOW_UNSUPPORTED:
  15148. 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  15149. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  15150. VR_SHOW_IOS_2:
  15151. 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  15152. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  15153. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  15154. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15155. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15156. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15157. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  15158. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  15159. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  15160. VR_ANDROID_DETAIL:
  15161. 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15162. VR_ANDROID_DVICES: 'Android Geräte',
  15163. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  15164. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  15165. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  15166. VR_DOWNLOAD_HERE: 'Hier runterladen',
  15167. VR_REQUIRE_HEADSET:
  15168. 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  15169. VR_REDIRECT_TO_STORE:
  15170. 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  15171. VR_IMPROPER_EMBED:
  15172. 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  15173. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  15174. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  15175. SHARE_TO: 'Teilen auf',
  15176. SHARE_LINK: 'Direkter Link',
  15177. SHARE_EXPLORE: 'Umsehen',
  15178. SHARE_AT: 'auf',
  15179. SHARE_WITH: 'mit',
  15180. SHARE_3D: 'in 3D',
  15181. SHARE_COPIED: 'Kopiert!',
  15182. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  15183. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  15184. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  15185. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  15186. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15187. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  15188. ERROR_GENERIC_ACTIONS_3: ' oder ',
  15189. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15190. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  15191. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  15192. ERROR_WEBGL_IOS_SOLUTION:
  15193. 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  15194. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  15195. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  15196. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  15197. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  15198. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  15199. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  15200. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  15201. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  15202. ERROR_MISSING_URLS_EXPLANATION:
  15203. 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  15204. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  15205. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15206. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15207. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  15208. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  15209. LINK_TO_LOCATION: 'Link zu',
  15210. MENU_COPY: 'Kopieren',
  15211. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  15212. ROTATE: 'Drehen',
  15213. INSIDE: 'Drinnen',
  15214. MOVE: 'Bewegen',
  15215. ZOOM: 'Vergrößern'
  15216. }
  15217. },
  15218. {}
  15219. ],
  15220. 111: [
  15221. function (e, t, i) {
  15222. 'use strict'
  15223. t.exports = {
  15224. PAGE_TITLE: '',
  15225. LOADING: 'Loading',
  15226. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15227. POWERED_BY: 'powered by ',
  15228. POWERED_BY_CAPS: 'POWERED BY',
  15229. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  15230. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  15231. PRESENTED_BY: 'Presented by ',
  15232. MORE: 'More ',
  15233. LESS: 'Less ',
  15234. TAG_CONTENT: 'tag™ Content',
  15235. SHOW: 'Show',
  15236. HIDE: 'Hide',
  15237. DOLLHOUSE: 'Dollhouse',
  15238. FLOOR_PLAN: 'Floor plan',
  15239. OPEN_HIGHLIGHTS: 'Open Highlights',
  15240. CLOSE_HIGHLIGHTS: 'Close',
  15241. PREVIOUS: 'Previous',
  15242. PLAY: 'Play',
  15243. PAUSE: 'Pause',
  15244. NEXT: 'Next',
  15245. EXPLORE_3D_SPACE: 'Explore 3D Space',
  15246. VIEW_DOLLHOUSE: 'View dollhouse',
  15247. SOCIAL_SHARING: 'Share this Space',
  15248. VIEW_IN_VR: 'View in VR',
  15249. VIEW_FULLSCREEN: '全屏',
  15250. EXIT_FULLSCREEN: '退出全屏',
  15251. ZOOM_IN: 'Zoom in',
  15252. ZOOM_OUT: 'Zoom out',
  15253. FLOOR_NAME: 'Floor ',
  15254. FLOOR_ALL: '全部',
  15255. TERMS: 'Terms',
  15256. PORT_TERMS: 'port terms',
  15257. TERMS_OF_USE: 'Terms of Use',
  15258. TERMS_TEXT_FILE: 'terms-en-US.html',
  15259. CLOSE_TERMS: 'Close',
  15260. TERMS_FAIL:
  15261. 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  15262. HELP: 'Help',
  15263. HELP_NAVIGATION_TAB: 'Navigation',
  15264. HELP_MORE_HELP_TAB: 'More Help',
  15265. CLOSE: 'Close',
  15266. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  15267. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  15268. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  15269. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  15270. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  15271. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  15272. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  15273. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  15274. HELP_DESKTOP_DOLLHOUSE_1A:
  15275. 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  15276. HELP_DESKTOP_DOLLHOUSE_2A:
  15277. 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  15278. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  15279. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  15280. HELP_DESKTOP_FLOORPLAN_1A:
  15281. 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  15282. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  15283. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  15284. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  15285. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  15286. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  15287. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  15288. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  15289. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  15290. HELP_MOBILE_DOLLHOUSE_1:
  15291. 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  15292. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  15293. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  15294. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  15295. HELP_MORE_HLR_A: 'Highlight Reel',
  15296. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  15297. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  15298. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15299. 'Click to view and rotate a top-down view of the entire Space in 3D.',
  15300. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15301. 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  15302. HELP_MORE_FLOORS_A: 'Floor Selector',
  15303. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  15304. HELP_MORE_TAG_A: 'tag™ Posts',
  15305. HELP_DESKTOP_MORE_TAG_B:
  15306. 'Click or hover over for information about features in the Space.',
  15307. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  15308. HELP_MORE_ZOOM_A: 'Zoom Controls',
  15309. HELP_DESKTOP_MORE_ZOOM_B:
  15310. 'Use these controls to zoom in and out or use the scroll wheel.',
  15311. HELP_MORE_TOUR_A: 'Tour Controls',
  15312. HELP_DESKTOP_MORE_TOUR_B:
  15313. 'Play, pause, and navigate forward and backward through a Guided Tour.',
  15314. HELP_MORE_INSIDE_A: 'Inside View',
  15315. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  15316. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  15317. HELP_MORE_VR_A: 'VR Mode',
  15318. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  15319. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  15320. HELP_MORE_360_A: '360° Views',
  15321. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  15322. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  15323. HELP_MORE_FULLSCREEN_A: 'Full screen',
  15324. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  15325. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  15326. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  15327. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  15328. WEBVR_ENTER_WEBVR: 'ENTER VR',
  15329. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  15330. WEBVR_LEARN_MORE: 'Learn more',
  15331. WEBVR_VIEW_SPACE: 'View Space in VR',
  15332. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15333. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  15334. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  15335. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  15336. VR_PREVIOUS_CAPS: 'PREVIOUS',
  15337. VR_NEXT_CAPS: 'NEXT',
  15338. VR_GOT_IT_CAPS: 'GOT IT',
  15339. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  15340. VR_SHOW_UNSUPPORTED:
  15341. "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  15342. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  15343. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  15344. VR_WHAT_YOU_NEED: "What You'll Need For...",
  15345. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  15346. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  15347. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  15348. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  15349. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15350. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15351. VR_APP: 'port VR App',
  15352. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15353. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15354. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  15355. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  15356. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  15357. VR_COMPATIBLE_ANDROID_LONG:
  15358. 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15359. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15360. VR_ANDROID_DVICES: 'Android Devices',
  15361. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  15362. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  15363. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  15364. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  15365. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  15366. VR_APP_OPEN: 'Open with the port VR app instead',
  15367. VR_DOWNLOAD_HERE: 'Download here',
  15368. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  15369. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  15370. VR_IMPROPER_EMBED:
  15371. 'The port Space is not embedded properly to support VR in your web browser.',
  15372. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  15373. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  15374. SHARE_TO: 'Share to',
  15375. SHARE_LINK: 'Direct Link',
  15376. SHARE_EXPLORE: 'Explore ',
  15377. SHARE_AT: 'at',
  15378. SHARE_WITH: 'with',
  15379. SHARE_3D: ' in 3D',
  15380. SHARE_COPIED: 'Copied!',
  15381. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  15382. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  15383. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  15384. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  15385. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  15386. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  15387. ERROR_GENERIC_ACTIONS_3: ' or ',
  15388. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  15389. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  15390. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  15391. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  15392. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  15393. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  15394. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  15395. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  15396. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  15397. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  15398. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  15399. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  15400. ERROR_MISSING_URLS_EXPLANATION:
  15401. 'This is an older model. The website owner may have a new model on the way.',
  15402. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  15403. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  15404. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  15405. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  15406. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  15407. LINK_TO_LOCATION: 'Link to location',
  15408. MENU_COPY: 'Copy',
  15409. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  15410. ROTATE: 'Rotate',
  15411. INSIDE: 'Inside',
  15412. MOVE: 'Move',
  15413. ZOOM: 'Zoom'
  15414. }
  15415. },
  15416. {}
  15417. ],
  15418. 112: [
  15419. function (e, t, i) {
  15420. 'use strict'
  15421. t.exports = {
  15422. PAGE_TITLE: '',
  15423. LOADING: 'Cargando',
  15424. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  15425. POWERED_BY: 'potenciando por ',
  15426. POWERED_BY_CAPS: 'POTENCIADO POR ',
  15427. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  15428. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  15429. PRESENTED_BY: 'Presentado por ',
  15430. MORE: 'Más ',
  15431. LESS: 'Menos ',
  15432. TAG_CONTENT: 'Contenido de tag™',
  15433. SHOW: 'Mostrar',
  15434. HIDE: 'Ocultar',
  15435. DOLLHOUSE: 'Dollhouse',
  15436. FLOOR_PLAN: 'Planos',
  15437. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  15438. CLOSE_HIGHLIGHTS: 'Cerrar',
  15439. PREVIOUS: 'Anterior',
  15440. PLAY: 'Play',
  15441. PAUSE: 'Pausa',
  15442. NEXT: 'Siguiente',
  15443. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  15444. VIEW_DOLLHOUSE: 'Ver dollhouse',
  15445. SOCIAL_SHARING: 'Compartir este espacio',
  15446. VIEW_IN_VR: 'Ver en realidad virtual',
  15447. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  15448. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  15449. ZOOM_IN: 'Acercar',
  15450. ZOOM_OUT: 'Alejar',
  15451. FLOOR_NAME: 'Piso ',
  15452. FLOOR_ALL: 'Todas',
  15453. TERMS: 'Condiciones',
  15454. PORT_TERMS: 'port términos de uso',
  15455. TERMS_OF_USE: 'Términos de uso',
  15456. TERMS_TEXT_FILE: 'terms-es-MX.html',
  15457. CLOSE_TERMS: 'Cerrar',
  15458. TERMS_FAIL:
  15459. 'No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.',
  15460. HELP: 'Ayuda',
  15461. HELP_NAVIGATION_TAB: 'Navegación',
  15462. HELP_MORE_HELP_TAB: 'Más Ayuda',
  15463. CLOSE: 'Cerrar',
  15464. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  15465. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  15466. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15467. HELP_DESKTOP_PANORAMA_1B:
  15468. 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  15469. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  15470. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  15471. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  15472. HELP_DESKTOP_360_2B:
  15473. 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  15474. HELP_DESKTOP_DOLLHOUSE_1A:
  15475. 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  15476. HELP_DESKTOP_DOLLHOUSE_2A:
  15477. 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  15478. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15479. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  15480. HELP_DESKTOP_FLOORPLAN_1A:
  15481. 'Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.',
  15482. HELP_DESKTOP_FLOORPLAN_2A:
  15483. 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  15484. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15485. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  15486. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  15487. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  15488. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  15489. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  15490. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  15491. HELP_MOBILE_DOLLHOUSE_1:
  15492. 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  15493. HELP_MOBILE_DOLLHOUSE_2:
  15494. 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  15495. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  15496. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  15497. HELP_MORE_HLR_A: 'Galería destacada',
  15498. HELP_DESKTOP_MORE_HLR_B:
  15499. 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  15500. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  15501. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15502. 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  15503. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15504. 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  15505. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  15506. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  15507. HELP_MORE_TAG_A: 'tag™ Posts',
  15508. HELP_DESKTOP_MORE_TAG_B:
  15509. 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  15510. HELP_MOBILE_MORE_TAG_B:
  15511. 'Toque para obtener más información acerca de las características del espacio.',
  15512. HELP_MORE_ZOOM_A: 'Controles de zoom',
  15513. HELP_DESKTOP_MORE_ZOOM_B:
  15514. 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  15515. HELP_MORE_TOUR_A: 'Controles de recorrido',
  15516. HELP_DESKTOP_MORE_TOUR_B:
  15517. 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  15518. HELP_MORE_INSIDE_A: 'Vista interior',
  15519. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  15520. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  15521. HELP_MORE_VR_A: 'Modo de realidad virtual',
  15522. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15523. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15524. HELP_MORE_360_A: '360° Views',
  15525. HELP_DESKTOP_MORE_360_B:
  15526. 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  15527. HELP_MOBILE_MORE_360_B:
  15528. 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  15529. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  15530. HELP_DESKTOP_MORE_FULLSCREEN_B:
  15531. 'Expanda el escenario 3D para verlo en pantalla completa.',
  15532. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  15533. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  15534. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  15535. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  15536. WEBVR_LEARN_MORE: 'Más información',
  15537. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  15538. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15539. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  15540. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  15541. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  15542. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  15543. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  15544. VR_APP: 'port VR App',
  15545. VR_COMPATIBLE_ANDROID_LONG:
  15546. 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  15547. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  15548. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  15549. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  15550. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  15551. VR_PREVIOUS_CAPS: 'ANTERIOR',
  15552. VR_NEXT_CAPS: 'SIGUIENTE',
  15553. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  15554. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  15555. VR_SHOW_UNSUPPORTED:
  15556. 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  15557. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  15558. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  15559. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  15560. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  15561. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  15562. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15563. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15564. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15565. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  15566. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15567. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  15568. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  15569. VR_ANDROID_DVICES: 'Dispositivos Android',
  15570. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  15571. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  15572. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  15573. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  15574. VR_DOWNLOAD_HERE: 'Descargar aquí',
  15575. VR_REQUIRE_HEADSET:
  15576. 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  15577. VR_REDIRECT_TO_STORE:
  15578. 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  15579. VR_IMPROPER_EMBED:
  15580. 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  15581. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  15582. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  15583. SHARE_TO: 'Compartir en',
  15584. SHARE_LINK: 'Enlace directo',
  15585. SHARE_EXPLORE: 'Explorar ',
  15586. SHARE_AT: 'en',
  15587. SHARE_WITH: 'con',
  15588. SHARE_3D: ' en 3D',
  15589. SHARE_COPIED: '¡Copiado!',
  15590. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  15591. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  15592. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  15593. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  15594. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  15595. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  15596. ERROR_GENERIC_ACTIONS_3: ' o ',
  15597. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  15598. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  15599. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  15600. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  15601. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  15602. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  15603. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  15604. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  15605. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  15606. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  15607. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  15608. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  15609. ERROR_MISSING_URLS_EXPLANATION:
  15610. 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  15611. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  15612. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  15613. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  15614. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  15615. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  15616. LINK_TO_LOCATION: 'Enlace a la ubicación',
  15617. MENU_COPY: 'Copiar',
  15618. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  15619. ROTATE: 'Girar',
  15620. INSIDE: 'Interior',
  15621. MOVE: 'Moverse',
  15622. ZOOM: 'Acercar o alejar'
  15623. }
  15624. },
  15625. {}
  15626. ],
  15627. 113: [
  15628. function (e, t, i) {
  15629. 'use strict'
  15630. t.exports = {
  15631. PAGE_TITLE: '',
  15632. LOADING: 'Chargement',
  15633. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  15634. POWERED_BY: 'alimenté par ',
  15635. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  15636. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15637. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15638. PRESENTED_BY: 'Présenté par ',
  15639. MORE: 'Plus ',
  15640. LESS: 'Moins ',
  15641. TAG_CONTENT: 'Contenu tag™',
  15642. SHOW: 'Montrer',
  15643. HIDE: 'Cacher',
  15644. DOLLHOUSE: 'Dollhouse',
  15645. FLOOR_PLAN: 'Plan de sol',
  15646. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  15647. CLOSE_HIGHLIGHTS: 'Fermer',
  15648. PREVIOUS: 'Précédent',
  15649. PLAY: 'Lecture',
  15650. PAUSE: 'Pause',
  15651. NEXT: 'Suivant',
  15652. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  15653. VIEW_DOLLHOUSE: 'Voir dollhouse',
  15654. SOCIAL_SHARING: 'Partager cet espace',
  15655. VIEW_IN_VR: 'Voir en VR',
  15656. VIEW_FULLSCREEN: 'Plein écran',
  15657. EXIT_FULLSCREEN: 'Fermer plein écran',
  15658. ZOOM_IN: 'Zoom avant',
  15659. ZOOM_OUT: 'Zoom arrière',
  15660. FLOOR_NAME: 'Étage ',
  15661. FLOOR_ALL: 'Tous',
  15662. TERMS: 'Mentions légales',
  15663. PORT_TERMS: 'port mentions légales',
  15664. TERMS_OF_USE: "Conditions d'utilisation",
  15665. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  15666. CLOSE_TERMS: 'Fermer',
  15667. TERMS_FAIL:
  15668. "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  15669. HELP: 'Aide',
  15670. HELP_NAVIGATION_TAB: 'Navigation',
  15671. HELP_MORE_HELP_TAB: 'Aide',
  15672. CLOSE: 'Fermer',
  15673. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  15674. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  15675. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15676. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  15677. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  15678. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  15679. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15680. HELP_DESKTOP_360_2B:
  15681. 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  15682. HELP_DESKTOP_DOLLHOUSE_1A:
  15683. 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  15684. HELP_DESKTOP_DOLLHOUSE_2A:
  15685. 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  15686. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15687. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  15688. HELP_DESKTOP_FLOORPLAN_1A:
  15689. 'Faites un clic droit pour changer la position du plan sur l’écran.',
  15690. HELP_DESKTOP_FLOORPLAN_2A:
  15691. 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  15692. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15693. HELP_DESKTOP_FLOORPLAN_2B:
  15694. 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  15695. HELP_DESKTOP_FLOORPLAN_3B:
  15696. 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  15697. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  15698. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  15699. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  15700. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15701. HELP_MOBILE_DOLLHOUSE_1:
  15702. 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  15703. HELP_MOBILE_DOLLHOUSE_2:
  15704. 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  15705. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  15706. HELP_MOBILE_FLOORPLAN_2:
  15707. 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  15708. HELP_MORE_HLR_A: 'Carrousel',
  15709. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  15710. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  15711. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15712. 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  15713. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15714. 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  15715. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  15716. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  15717. HELP_MORE_TAG_A: 'tag™ Posts',
  15718. HELP_DESKTOP_MORE_TAG_B:
  15719. 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  15720. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  15721. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  15722. HELP_DESKTOP_MORE_ZOOM_B:
  15723. 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  15724. HELP_MORE_TOUR_A: 'Commandes de la visite',
  15725. HELP_DESKTOP_MORE_TOUR_B:
  15726. "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  15727. HELP_MORE_INSIDE_A: 'Vue intérieure',
  15728. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  15729. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  15730. HELP_MORE_VR_A: 'Mode RV',
  15731. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  15732. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  15733. HELP_MORE_360_A: 'Vues 360°',
  15734. HELP_DESKTOP_MORE_360_B:
  15735. 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15736. HELP_MOBILE_MORE_360_B:
  15737. 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15738. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  15739. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  15740. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  15741. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  15742. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  15743. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  15744. WEBVR_LEARN_MORE: 'En savoir plus',
  15745. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  15746. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15747. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  15748. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  15749. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  15750. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  15751. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  15752. VR_NEXT_CAPS: 'SUIVANT',
  15753. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  15754. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  15755. VR_SHOW_UNSUPPORTED:
  15756. 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  15757. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  15758. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  15759. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  15760. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  15761. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  15762. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  15763. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  15764. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15765. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15766. VR_APP: 'port VR App',
  15767. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15768. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15769. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  15770. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15771. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  15772. VR_COMPATIBLE_ANDROID_LONG:
  15773. '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',
  15774. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  15775. VR_ANDROID_DVICES: 'Appareils Android',
  15776. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  15777. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  15778. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  15779. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  15780. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  15781. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  15782. VR_DOWNLOAD_HERE: 'Télécharger ici',
  15783. VR_REQUIRE_HEADSET:
  15784. "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  15785. VR_REDIRECT_TO_STORE:
  15786. "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  15787. VR_IMPROPER_EMBED:
  15788. "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  15789. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  15790. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  15791. SHARE_TO: 'Partager sur',
  15792. SHARE_LINK: 'Lien direct',
  15793. SHARE_EXPLORE: 'Explorer ',
  15794. SHARE_AT: 'à',
  15795. SHARE_WITH: 'avec',
  15796. SHARE_3D: ' en 3D',
  15797. SHARE_COPIED: 'Copié!',
  15798. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  15799. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  15800. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  15801. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  15802. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  15803. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  15804. ERROR_GENERIC_ACTIONS_3: ' ou ',
  15805. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  15806. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  15807. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  15808. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  15809. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  15810. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  15811. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  15812. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  15813. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  15814. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  15815. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  15816. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  15817. ERROR_MISSING_URLS_EXPLANATION:
  15818. 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  15819. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  15820. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  15821. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  15822. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  15823. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  15824. LINK_TO_LOCATION: "Lien vers l'emplacement",
  15825. MENU_COPY: 'Copie',
  15826. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  15827. ROTATE: 'Faire pivoter',
  15828. INSIDE: 'Intérieure',
  15829. MOVE: 'Se déplacer',
  15830. ZOOM: 'Zoom'
  15831. }
  15832. },
  15833. {}
  15834. ],
  15835. 114: [
  15836. function (e, t, i) {
  15837. 'use strict'
  15838. t.exports = {
  15839. PAGE_TITLE: '',
  15840. LOADING: '読み込み中',
  15841. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15842. POWERED_BY: 'powered by',
  15843. POWERED_BY_CAPS: 'POWERED BY',
  15844. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  15845. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  15846. PRESENTED_BY: 'Presented by ',
  15847. MORE: '全て表示 ',
  15848. LESS: '閉じる ',
  15849. TAG_CONTENT: 'tag™コンテンツ ',
  15850. SHOW: '表示',
  15851. HIDE: '非表示',
  15852. DOLLHOUSE: 'ドールハウス',
  15853. FLOOR_PLAN: 'フロアプラン',
  15854. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  15855. CLOSE_HIGHLIGHTS: '閉じる',
  15856. PREVIOUS: '前へ',
  15857. PLAY: '再生',
  15858. PAUSE: '一時停止',
  15859. NEXT: '次へ',
  15860. EXPLORE_3D_SPACE: '3DSpaceの探索',
  15861. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  15862. SOCIAL_SHARING: 'このSpaceを共有する',
  15863. VIEW_IN_VR: 'VRで表示',
  15864. VIEW_FULLSCREEN: 'フルスクリーン表示',
  15865. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  15866. ZOOM_IN: 'ズームイン',
  15867. ZOOM_OUT: 'ズームアウト',
  15868. FLOOR_NAME: 'フロア ',
  15869. FLOOR_ALL: 'すべて',
  15870. TERMS: '規約',
  15871. PORT_TERMS: 'port規約',
  15872. TERMS_OF_USE: '利用規約',
  15873. CLOSE_TERMS: '閉じる',
  15874. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  15875. TERMS_FAIL:
  15876. '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  15877. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  15878. WEBVR_ENTER_WEBVR: 'VRに入る',
  15879. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  15880. WEBVR_LEARN_MORE: 'もっと詳しく',
  15881. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  15882. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15883. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15884. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  15885. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  15886. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  15887. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  15888. VR_PREVIOUS_CAPS: '前へ',
  15889. VR_NEXT_CAPS: '次へ',
  15890. VR_GOT_IT_CAPS: '了解',
  15891. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  15892. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  15893. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  15894. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  15895. VR_WHAT_YOU_NEED: '必要なもの',
  15896. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  15897. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  15898. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  15899. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15900. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15901. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15902. VR_APP: 'port VRアプリ',
  15903. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15904. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  15905. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  15906. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  15907. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  15908. VR_COMPATIBLE_ANDROID_LONG:
  15909. 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  15910. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  15911. VR_ANDROID_DVICES: 'Androidデバイス',
  15912. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  15913. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  15914. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  15915. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  15916. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  15917. VR_APP_OPEN: 'port VRアプリで開く',
  15918. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  15919. VR_REQUIRE_HEADSET:
  15920. 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  15921. VR_REDIRECT_TO_STORE:
  15922. 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  15923. VR_IMPROPER_EMBED:
  15924. 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  15925. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  15926. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  15927. SHARE_TO: '共有先',
  15928. SHARE_LINK: 'ダイレクトリンク',
  15929. SHARE_EXPLORE: '探索',
  15930. SHARE_AT: '場所',
  15931. SHARE_WITH: '使用アプリ',
  15932. SHARE_3D: '3Dで',
  15933. SHARE_COPIED: 'コピーされました!',
  15934. ERROR_BROWSER_SOLUTION:
  15935. '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  15936. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  15937. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  15938. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  15939. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  15940. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  15941. ERROR_GENERIC_ACTIONS_3: 'または',
  15942. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  15943. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  15944. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  15945. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  15946. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  15947. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  15948. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  15949. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  15950. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  15951. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  15952. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  15953. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  15954. ERROR_MISSING_URLS_EXPLANATION:
  15955. 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  15956. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  15957. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  15958. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  15959. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  15960. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  15961. LINK_TO_LOCATION: 'ロケーションへのリンク',
  15962. MENU_COPY: 'コピー',
  15963. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  15964. ROTATE: '回転',
  15965. MOVE: '移動',
  15966. INSIDE: '内側',
  15967. ZOOM: 'ズーム',
  15968. HELP: 'ヘルプ',
  15969. HELP_NAVIGATION_TAB: 'ナビゲーション',
  15970. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  15971. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  15972. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  15973. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15974. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  15975. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  15976. HELP_DESKTOP_PANORAMA_3B:
  15977. 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  15978. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  15979. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  15980. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  15981. HELP_DESKTOP_DOLLHOUSE_2A:
  15982. '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  15983. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15984. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  15985. HELP_DESKTOP_FLOORPLAN_1A:
  15986. '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  15987. HELP_DESKTOP_FLOORPLAN_2A:
  15988. '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  15989. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15990. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  15991. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  15992. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  15993. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  15994. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  15995. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  15996. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  15997. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  15998. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  15999. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  16000. HELP_MORE_HLR_A: 'ハイライト',
  16001. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  16002. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  16003. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16004. 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  16005. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16006. 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  16007. HELP_MORE_FLOORS_A: 'フロアセレクター',
  16008. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  16009. HELP_MORE_TAG_A: 'tag™ Posts',
  16010. HELP_DESKTOP_MORE_TAG_B:
  16011. 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  16012. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  16013. HELP_MORE_ZOOM_A: 'ズームコントロール',
  16014. HELP_DESKTOP_MORE_ZOOM_B:
  16015. 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  16016. HELP_MORE_TOUR_A: 'ツアーコントロール',
  16017. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  16018. HELP_MORE_INSIDE_A: '内側ビュー',
  16019. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  16020. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  16021. HELP_MORE_VR_A: 'VRモード',
  16022. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  16023. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  16024. HELP_MORE_360_A: '360° Views',
  16025. HELP_DESKTOP_MORE_360_B:
  16026. 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  16027. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  16028. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  16029. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  16030. CLOSE: '閉じる'
  16031. }
  16032. },
  16033. {}
  16034. ],
  16035. 115: [
  16036. function (e, t, i) {
  16037. 'use strict'
  16038. t.exports = {
  16039. PAGE_TITLE: '',
  16040. LOADING: 'Загрузка',
  16041. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  16042. POWERED_BY: 'разработано на платформе ',
  16043. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  16044. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  16045. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  16046. PRESENTED_BY: 'Представлено ',
  16047. MORE: 'Больше ',
  16048. LESS: 'Меньше ',
  16049. TAG_CONTENT: 'tag™ Контент',
  16050. SHOW: 'Показать',
  16051. HIDE: 'Скрыть',
  16052. DOLLHOUSE: 'Dollhouse',
  16053. FLOOR_PLAN: 'Планировка',
  16054. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  16055. CLOSE_HIGHLIGHTS: 'Закрыть',
  16056. PREVIOUS: 'Предыдущий',
  16057. PLAY: 'Воспроизвести',
  16058. PAUSE: 'Пауза',
  16059. NEXT: 'Следующий',
  16060. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  16061. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  16062. SOCIAL_SHARING: 'Поделиться этой моделью',
  16063. VIEW_IN_VR: 'Посмотреть в VR',
  16064. VIEW_FULLSCREEN: 'Полный экран',
  16065. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  16066. ZOOM_IN: 'Увеличить',
  16067. ZOOM_OUT: 'Уменьшить',
  16068. FLOOR_NAME: 'Этаж ',
  16069. FLOOR_ALL: 'Все',
  16070. TERMS: 'Условия',
  16071. PORT_TERMS: 'Правила пользования',
  16072. TERMS_OF_USE: 'Условия использования',
  16073. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  16074. CLOSE_TERMS: 'Закрыть',
  16075. TERMS_FAIL:
  16076. 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  16077. HELP: 'Помощь',
  16078. HELP_NAVIGATION_TAB: 'Навигация',
  16079. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  16080. CLOSE: 'Закрыть',
  16081. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  16082. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  16083. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  16084. HELP_DESKTOP_PANORAMA_1B:
  16085. 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  16086. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  16087. HELP_DESKTOP_PANORAMA_3B:
  16088. 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  16089. HELP_DESKTOP_360_2A:
  16090. 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16091. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  16092. HELP_DESKTOP_DOLLHOUSE_1A:
  16093. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  16094. HELP_DESKTOP_DOLLHOUSE_2A:
  16095. 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  16096. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16097. HELP_DESKTOP_DOLLHOUSE_1B:
  16098. 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  16099. HELP_DESKTOP_FLOORPLAN_1A:
  16100. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  16101. HELP_DESKTOP_FLOORPLAN_2A:
  16102. 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  16103. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16104. HELP_DESKTOP_FLOORPLAN_2B:
  16105. 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  16106. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  16107. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  16108. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  16109. HELP_MOBILE_3:
  16110. 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  16111. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16112. HELP_MOBILE_DOLLHOUSE_1:
  16113. 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  16114. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  16115. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  16116. HELP_MOBILE_FLOORPLAN_2:
  16117. 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  16118. HELP_MORE_HLR_A: 'Фотоколлаж',
  16119. HELP_DESKTOP_MORE_HLR_B:
  16120. 'Откройте для перемещения по модели, используя иконки изображений.',
  16121. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  16122. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16123. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16124. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16125. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16126. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  16127. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  16128. HELP_MORE_TAG_A: 'tag™ Posts',
  16129. HELP_DESKTOP_MORE_TAG_B:
  16130. 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  16131. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  16132. HELP_MORE_ZOOM_A: 'Масштаб',
  16133. HELP_DESKTOP_MORE_ZOOM_B:
  16134. 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  16135. HELP_MORE_TOUR_A: 'Управление Туром',
  16136. HELP_DESKTOP_MORE_TOUR_B:
  16137. 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  16138. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  16139. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16140. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16141. HELP_MORE_VR_A: 'Режим VR',
  16142. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16143. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16144. HELP_MORE_360_A: '360° Views',
  16145. HELP_DESKTOP_MORE_360_B:
  16146. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16147. HELP_MOBILE_MORE_360_B:
  16148. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16149. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  16150. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  16151. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  16152. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  16153. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  16154. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  16155. WEBVR_LEARN_MORE: 'Узнать больше',
  16156. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  16157. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  16158. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16159. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  16160. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  16161. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16162. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  16163. VR_APP: 'port VR App',
  16164. VR_APP_OPEN: 'Или открыть через приложение port VR',
  16165. VR_COMPATIBLE_ANDROID_LONG:
  16166. 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  16167. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  16168. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  16169. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  16170. VR_VIEW_SPACE: 'Запустить модель в VR',
  16171. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  16172. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  16173. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  16174. VR_GOT_IT_CAPS: 'ЯСНО',
  16175. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  16176. VR_SHOW_UNSUPPORTED:
  16177. 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  16178. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  16179. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  16180. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  16181. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  16182. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  16183. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  16184. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  16185. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  16186. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  16187. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  16188. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  16189. VR_ANDROID_DVICES: 'Android устройства',
  16190. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  16191. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  16192. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  16193. VR_DOWNLOAD_HERE: 'Скачать здесь',
  16194. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  16195. VR_REDIRECT_TO_STORE:
  16196. 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  16197. VR_IMPROPER_EMBED:
  16198. 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  16199. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  16200. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  16201. SHARE_TO: 'Поделиться',
  16202. SHARE_LINK: 'Прямая ссылка',
  16203. SHARE_EXPLORE: 'просмотреть',
  16204. SHARE_AT: 'на',
  16205. SHARE_WITH: 'с',
  16206. SHARE_3D: 'в 3D',
  16207. SHARE_COPIED: 'Скопировано!',
  16208. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  16209. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  16210. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  16211. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  16212. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  16213. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  16214. ERROR_GENERIC_ACTIONS_3: ' или ',
  16215. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  16216. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  16217. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  16218. ERROR_WEBGL_IOS_SOLUTION:
  16219. 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  16220. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  16221. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  16222. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  16223. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  16224. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16225. 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  16226. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  16227. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  16228. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  16229. ERROR_MISSING_URLS_EXPLANATION:
  16230. 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  16231. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  16232. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  16233. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  16234. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  16235. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  16236. LINK_TO_LOCATION: 'Ссылка на местоположение',
  16237. MENU_COPY: 'Копировать',
  16238. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  16239. ROTATE: 'Вращать',
  16240. MOVE: 'Передвигаться',
  16241. INSIDE: 'Вид изнутри',
  16242. ZOOM: 'Масштаб'
  16243. }
  16244. },
  16245. {}
  16246. ],
  16247. 116: [
  16248. function (e, t, i) {
  16249. //main.js
  16250. ;(function (t) {
  16251. 'use strict'
  16252. var modelProgressBase = 0.4
  16253. var progressUpdate = function (e) {
  16254. // 0 <= e <= 1
  16255. console.log('e1:' + e)
  16256. e = Math.round(modelProgressBase * e * 100)
  16257. console.log('e2:' + e)
  16258. var t = $('.progressbar')
  16259. t.find('.bar').css('width', e + '%')
  16260. t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px') //上面跟着的字的百分比
  16261. t.find('.perc').text(e + '%') //具体数字的百分比
  16262. }
  16263. $('#gui-loading').fadeIn(200)
  16264. progressUpdate(0.1)
  16265. var fileName = g_version ? 'modeldata.js' : 'someData.json'
  16266. $.ajax(
  16267. g_Prefix + 'data/' + window.number + '/' + fileName + '?' + randomTime().getTime(),
  16268. { dataType: 'json' }
  16269. )
  16270. .done(function (e) {
  16271. //改
  16272. var data = matcher(e)
  16273. data.files.templates[0] =
  16274. g_Prefix + e.files.templates[0].replace('{{number}}', window.number)
  16275. data.user = {
  16276. is_authenticated: false,
  16277. flags: [
  16278. 'payment_show_past_due',
  16279. 'sc_imgopt_100',
  16280. 'mattertags',
  16281. 'labels',
  16282. 'fastly_v2_urls',
  16283. 'vr',
  16284. 'uhql',
  16285. 'sc_segment_100',
  16286. 'show_segment_metrics',
  16287. 'content_distribution',
  16288. 'workshop_webgl',
  16289. 'show360views',
  16290. 'showcase_vr',
  16291. 'ws_zooming',
  16292. 'model_settings',
  16293. 'ws_360snapshots',
  16294. 'img_multi_dl',
  16295. 'vrworkshop',
  16296. 'tag_links',
  16297. 'ws_img_multi_dl',
  16298. 'mattertag_links',
  16299. 'billing_tab_hidden',
  16300. 'static_cloud_ui',
  16301. 'metrics',
  16302. 'mattertag_media',
  16303. 'img_size_download',
  16304. 'show_360snapshots',
  16305. 'floorplan',
  16306. 'sc_tilegen_0',
  16307. 'showcase_webvr',
  16308. 'sc_mixpanel_0',
  16309. 'show_clickbait',
  16310. 'zooming',
  16311. 'showcase_tiling',
  16312. 'list_signed_urls_default_3',
  16313. 'fastly_image_opto'
  16314. ]
  16315. }
  16316. try {
  16317. //处理一下导览数据
  16318. data.model.images = data.model.images.filter(e => {
  16319. if (!e.locations && !e.thumbnail_signed_src) return //旧的曾有导览数据是错误的,将它删除
  16320. if (e.locations && e.locations.length == 0) return
  16321. return e
  16322. })
  16323. } catch (e) {
  16324. console.log(e)
  16325. }
  16326. window.DATA = data
  16327. data.model.summary = data.summary
  16328. data.model.name = data.name
  16329. for (let i in data) {
  16330. data[i] == 'false' && (data[i] = false)
  16331. }
  16332. progressUpdate(0.7)
  16333. StartLoad() //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  16334. if (data.weixinDesc) {
  16335. g_weixinObj.desc = data.weixinDesc
  16336. }
  16337. if (data.shareImgUrl) {
  16338. g_weixinObj.imgUrl = data.shareImgUrl
  16339. }
  16340. window.wx && manage.weixinShare()
  16341. //初始画面
  16342. data.camera_start &&
  16343. data.camera_start.thumbImg &&
  16344. E(manage.dealURL(data.camera_start.thumbImg))
  16345. function E(e) {
  16346. $('<img/>')
  16347. .attr('src', e)
  16348. .on('load', function () {
  16349. $('#gui-thumb')
  16350. .css('backgroundImage', 'url(' + e + ')')
  16351. .fadeIn(500),
  16352. $(this).remove()
  16353. })
  16354. }
  16355. //背景
  16356. ;(settings.transparentBg = settings.transparentBg || data.transparentBg || false),
  16357. (settings.bgImg = settings.bgImg || data.bgImg || null)
  16358. if (settings.bgImg) {
  16359. $('#player').css({
  16360. 'background-image': 'url(' + settings.bgImg + ')',
  16361. 'background-position': 'center center'
  16362. })
  16363. }
  16364. {
  16365. //初始化导览时间
  16366. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100
  16367. window._settings.warp.teleportTime =
  16368. (settings.teleportTime / DATA.tourBlackSpeed) * 100
  16369. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100
  16370. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  16371. DATA.tourRotTime = settings.tourRotTime //默认停留2秒
  16372. }
  16373. }
  16374. {
  16375. //其他
  16376. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  16377. }
  16378. })
  16379. .fail(e => {
  16380. alert('缺少someData文件,请检查场景码是否正确。')
  16381. })
  16382. function StartLoad() {
  16383. //当加载完data后
  16384. function i() {
  16385. var e = window.number //Y.getModelIDFromQueryString();
  16386. if (!e) return b(null, 'loading-failed')
  16387. var t = Y.parseSidUrl(e),
  16388. i = l(),
  16389. a = c(),
  16390. s = o(),
  16391. u = V.quickstart.enabled,
  16392. g = null,
  16393. m = null,
  16394. v = null,
  16395. w = null,
  16396. T = null,
  16397. x = null,
  16398. S = null,
  16399. M = null,
  16400. R = null,
  16401. P = null,
  16402. O = null,
  16403. L = null,
  16404. N = new ue()
  16405. r(s)
  16406. h({
  16407. //MP开头写法
  16408. urlBase: t.urlBase
  16409. })
  16410. .then(function () {
  16411. return re.init(), d(t, e) //getModel and load
  16412. })
  16413. .then(function (e) {
  16414. progressUpdate(0.9)
  16415. return (
  16416. (P = e),
  16417. p(
  16418. P,
  16419. V.appConfig.segment_key,
  16420. V.appConfig.keen_write_key,
  16421. V.appConfig.keen_project_id,
  16422. {
  16423. startSource: i,
  16424. autoplay: V.autoplay,
  16425. quickstart: u
  16426. }
  16427. ),
  16428. P.urls.init()
  16429. )
  16430. })
  16431. .then(function () {
  16432. return P.loadPanos()
  16433. })
  16434. .then(function () {
  16435. ;(m = X.getStartCameraOptions(P, P.panos)),
  16436. (S = A(P)),
  16437. (O = y(u, m.mode)),
  16438. (v = O.controls),
  16439. (w = O.player),
  16440. (T = O.director),
  16441. (x = O.tagManager),
  16442. (M = O.tileDownloader),
  16443. (R = O.qualityManager),
  16444. (L = O.panoRenderer),
  16445. C(P, S, O, s),
  16446. (w.director = T), //xzw add
  16447. P.supportsTiles && M.start(),
  16448. !u ||
  16449. (m.mode === D.PANORAMA && m.pano) ||
  16450. (de.warn(
  16451. 'Tried to quickstart, but failed as we are not starting in inside mode.'
  16452. ),
  16453. (u = !1))
  16454. var e = null
  16455. if (u) {
  16456. de.warn('Quickstart engaged. Hold on to your knickers.')
  16457. var t = v.controls[D.PANORAMA]
  16458. ;(g = new ie(R, S.scene, S.camera, t, s)),
  16459. _(S, s, P),
  16460. (e = g.load(m).then(function () {
  16461. S.addComponent(g),
  16462. S.once(le.AfterRender, function () {
  16463. de.warn('First render after quickstart load finished.')
  16464. })
  16465. }))
  16466. }
  16467. window.flyToFirst = function () {
  16468. //xzw add
  16469. var pano = w.model.panos.get('8d778e19657f433fb9cf8947d823bb70')
  16470. var q = new _x.Quaternion(
  16471. 0.7099827027821568,
  16472. -0.07708150183830938,
  16473. 0.6958985789714591,
  16474. 0.07555241737970636
  16475. )
  16476. var lookAtPoint = new _x.Vector3(0, 0, -1).applyQuaternion(q).add(pano.position)
  16477. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint })
  16478. }
  16479. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  16480. })
  16481. .then(function () {
  16482. return f(P, U.onProgress, i, !u, a)
  16483. })
  16484. .then(function () {
  16485. if (
  16486. ((m.quickstart = u),
  16487. I(P, S, O, s),
  16488. S.started || _(S, s, P),
  16489. H.modelLoaded(P, w, v, V.autoplay),
  16490. E(w, P, m, V.autoplay).done(function () {
  16491. T.autoTour()
  16492. }),
  16493. !P.supportsTiles)
  16494. ) {
  16495. var e = new Z(P, w)
  16496. e.start()
  16497. }
  16498. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  16499. U.init(P, T, w, v, S, m, H.getSessionId()),
  16500. U.endLoading(P, T, x),
  16501. S.once(le.AfterRender, function () {
  16502. N.setAppReadyTime()
  16503. var e = N.calcFullLoadingTime()
  16504. de.warn('Total load time: ' + e / 1e3),
  16505. H.loadComplete(e),
  16506. de.warn('First render after model load finished.')
  16507. try {
  16508. window.evt && window.dispatchEvent(window.evt)
  16509. parent.postMessage(
  16510. {
  16511. cmd: 'loaded'
  16512. },
  16513. '*'
  16514. )
  16515. } catch (err) {}
  16516. }),
  16517. S.on(le.MemoryUsageUpdated, n)
  16518. })
  16519. .fail(b.bind(this, e))
  16520. }
  16521. function n(e) {
  16522. ce.update(e)
  16523. }
  16524. function r(e) {
  16525. de.info('Version', '2.25.6-0-gd87e5b1'), (q.defaultMaxListeners = 1e3), a(e), s()
  16526. }
  16527. function o() {
  16528. return document.getElementById('player')
  16529. }
  16530. function a(e) {
  16531. e.addEventListener('dragenter', T, !1), e.addEventListener('dragover', T, !1)
  16532. }
  16533. function s() {
  16534. F.valueFromHash('title', !0) ||
  16535. $(document).ready(function () {
  16536. var e = $('.model-title')
  16537. e.hide()
  16538. })
  16539. }
  16540. function l() {
  16541. return F.valueFromHash('play', !1) ? 'autoplay' : F.inIframe() ? 'click' : 'fullpage'
  16542. }
  16543. function c() {
  16544. return {
  16545. panoElementsToLoad: 6,
  16546. modelElementsToLoad: 0,
  16547. totalElementsLoaded: 0,
  16548. totalElementsToLoad: 0,
  16549. totalPercentageLoaded: 0,
  16550. progressCallback: null
  16551. }
  16552. }
  16553. function h(e) {
  16554. return K.loadFeatureFlags(e).done(function (e) {
  16555. K.updateDependentSettings(e, V)
  16556. })
  16557. }
  16558. // function u(e) {
  16559. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  16560. // responseType: "json",
  16561. // prefetchFrom: "config"
  16562. // }).then(function(e) {
  16563. // return e ? void j.extendObject(V.appConfig, e) : {}
  16564. // }, function(e) {
  16565. // return de.warn("Failed loading runtime config, using defaults."),
  16566. // $.when({})
  16567. // })
  16568. // }
  16569. function d(e, t) {
  16570. var i = B.getModel({
  16571. url: t,
  16572. floors: F.valueFromHash('f', !0),
  16573. autoload: !1
  16574. })
  16575. return $.when(i, n).then(null, function (e) {
  16576. return this
  16577. })
  16578. }
  16579. function p(e, t, i, n, r) {
  16580. de.info('Model data loaded'),
  16581. de.debug('UUID: ' + e.data.job.uuid),
  16582. J.init(K.getFlags()),
  16583. i &&
  16584. H.initKeen({
  16585. token: i,
  16586. appId: n
  16587. }),
  16588. H.initSegment({
  16589. model: e.sid,
  16590. version: '2.25.6-0-gd87e5b1',
  16591. startSource: r.startSource,
  16592. token: t,
  16593. autoplay: r.autoplay,
  16594. quickstart: r.quickstart
  16595. })
  16596. }
  16597. function f(e, t, i, n, r) {
  16598. return (r.progressCallback = t), H.sessionStart(), e.load(n).progress(g.bind(this, r))
  16599. }
  16600. function g(e, t) {
  16601. ;(e.modelElementsToLoad = t[1]), v(e), m(e)
  16602. }
  16603. function m(e) {
  16604. e.totalElementsLoaded++,
  16605. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  16606. //----许钟文-----------------模型进度条向后调整
  16607. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0)
  16608. e.totalPercentageLoaded =
  16609. modelProgressBase + (1 - modelProgressBase) * e.totalPercentageLoaded
  16610. //console.log('pro:'+e.totalPercentageLoaded)
  16611. //---------------------------
  16612. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  16613. }
  16614. function v(e) {
  16615. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  16616. }
  16617. function A(e) {
  16618. var t = new x.PerspectiveCamera()
  16619. t.layers.enable(he.PANOMARKERS), t.layers.enable(he.RETICULE), t.layers.enable(he.TAG)
  16620. var i = new x.Scene(),
  16621. n = new x.AmbientLight(16777215)
  16622. i.add(n),
  16623. (i.plane = new x.Mesh(
  16624. new x.PlaneBufferGeometry(1e5, 1e5),
  16625. new x.RawShaderMaterial({
  16626. side: x.DoubleSide
  16627. })
  16628. )),
  16629. (i.plane.position.y = 0),
  16630. i.plane.rotateX(-Math.PI / 2),
  16631. (i.plane.material.visible = !1),
  16632. i.add(i.plane),
  16633. i.updateMatrixWorld(),
  16634. V.showScreenshotLocations &&
  16635. e.data.images.forEach(function (e) {
  16636. if (e.metadata && e.metadata.camera_position) {
  16637. var t = e.metadata.camera_position,
  16638. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3))
  16639. ;(n.position = t.clone()), i.add(n)
  16640. var r = e.metadata.camera_quaternion,
  16641. o = new x.Vector3(0, 0, -1).applyQuaternion(r)
  16642. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680))
  16643. }
  16644. }),
  16645. V.showAxis &&
  16646. (i.add(new x.ArrowHelper(new x.Vector3(0, 1, 0), new x.Vector3(0, 0, 0), 1, 255)),
  16647. i.add(
  16648. new x.ArrowHelper(new x.Vector3(0, 0, 1), new x.Vector3(0, 0, 0), 1, 16711680)
  16649. ),
  16650. i.add(
  16651. new x.ArrowHelper(new x.Vector3(1, 0, 0), new x.Vector3(0, 0, 0), 1, 65280)
  16652. ))
  16653. //背景
  16654. if (!settings.transparentBg && !settings.bgImg) {
  16655. i.skybox = new W()
  16656. i.add(i.skybox)
  16657. }
  16658. var r = new te(i, t, z)
  16659. return r
  16660. }
  16661. function y(e, t) {
  16662. var i = e ? 1 : 1e3,
  16663. n = J.tilegen || J.imgopt ? 6 : 2
  16664. n = F.valueFromHash('tileconc', n)
  16665. var r = new ne(),
  16666. o = new ae({
  16667. concurrentDownloads: n
  16668. }),
  16669. a = new se(),
  16670. s = new P(),
  16671. l = new M(),
  16672. c = new S(t),
  16673. h = new R(),
  16674. u = new O(i),
  16675. d = new L(),
  16676. p = new oe()
  16677. return {
  16678. qualityManager: r,
  16679. panoRenderer: a,
  16680. tileDownloader: o,
  16681. player: c,
  16682. director: l,
  16683. modelManager: s,
  16684. tagManager: p,
  16685. displayController: u,
  16686. labelDisplayController: d,
  16687. controls: h
  16688. }
  16689. }
  16690. function C(e, t, i, n) {
  16691. var r = i.controls,
  16692. o = i.qualityManager,
  16693. a = i.panoRenderer,
  16694. s = i.tileDownloader,
  16695. l = i.modelManager
  16696. r.init(n, l),
  16697. ee.init(i.director, r, i.player, l, t),
  16698. o.init(l),
  16699. s.init(o),
  16700. a.init(t, s, o),
  16701. l.init(s, a, o),
  16702. l.addModel(e),
  16703. t.addComponent(G)
  16704. }
  16705. function I(e, t, i, n) {
  16706. var r = i.qualityManager,
  16707. o = i.panoRenderer,
  16708. a = i.tileDownloader,
  16709. s = i.modelManager,
  16710. l = i.player,
  16711. c = i.director,
  16712. h = i.tagManager,
  16713. u = i.displayController,
  16714. d = i.labelDisplayController,
  16715. p = i.controls
  16716. t.scene.add(e), (t.qualityManager = r)
  16717. var f = {
  16718. camera: t.camera,
  16719. director: c,
  16720. modelManager: s,
  16721. tileDownloader: a,
  16722. panoRenderer: o,
  16723. qualityManager: r,
  16724. tagManager: h,
  16725. container: n,
  16726. controls: p
  16727. }
  16728. l.init(f),
  16729. l.setScene(t.scene),
  16730. h.init(s, l),
  16731. c.init(l, s),
  16732. u.init(c, l, s, h, n),
  16733. d.init(l, s, n),
  16734. z.bindEvents(l),
  16735. t.addComponent(h),
  16736. t.addComponent(l),
  16737. t.addComponent(o),
  16738. (l.sceneRenderer = t) //xzw add 方便resize
  16739. }
  16740. function E(e, t, i, n) {
  16741. return (
  16742. de.info('Starting player in ' + i.mode),
  16743. H.report(t.sid, 'started-playing', n, i.quickstart),
  16744. e.start(i)
  16745. )
  16746. }
  16747. function b(e, t) {
  16748. de.error(t), k.error(t), H.report(e, 'error-' + t)
  16749. }
  16750. function w(e) {
  16751. var t = F.details()
  16752. t && 'Safari' === t.name && t.version > 500 && t.version < 600
  16753. ? (k.error('webgl-safari'), H.report(e, 'error-webgl-safari'))
  16754. : (k.error('webgl-generic'), H.report(e, 'error-webgl-generic'))
  16755. }
  16756. function _(e, t, i) {
  16757. try {
  16758. e.start(t)
  16759. } catch (e) {
  16760. throw (de.warn(e.message), w(i.sid), e)
  16761. }
  16762. }
  16763. function T(e) {
  16764. e.stopPropagation(), e.preventDefault()
  16765. }
  16766. //czj 判断someData 有没有hoticon字段 修改热点的样式
  16767. if (window.DATA.hoticon) {
  16768. g_HotImage = {
  16769. point:
  16770. window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  16771. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png'
  16772. }
  16773. }
  16774. //czj 判断someData 有没有backgroundMusic 添加音乐
  16775. if (window.DATA.backgroundMusic) {
  16776. if (window.isLocal) {
  16777. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  16778. } else {
  16779. SoundManager.setSrc('bgm', window.DATA.backgroundMusic)
  16780. }
  16781. $('#volume').show()
  16782. } else if (g_version === 'one') {
  16783. SoundManager.setSrc(
  16784. 'bgm',
  16785. manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3')
  16786. )
  16787. $('#volume').show()
  16788. }
  16789. //隐藏公司logo
  16790. if (window.DATA.loadlogo) {
  16791. showLogo()
  16792. }
  16793. e('./lib/three75-shim'),
  16794. e('./lib/array-polyfill'),
  16795. e('./lib/performance-polyfill'),
  16796. e('./lib/shaders/CopyShader.js'),
  16797. e('./lib/shaders/HorizontalBlurShader.js'),
  16798. e('./lib/shaders/VerticalBlurShader.js'),
  16799. e('./lib/postprocessing/EffectComposer.js'),
  16800. e('./lib/postprocessing/RenderPass.js'),
  16801. e('./lib/postprocessing/MaskPass.js'),
  16802. e('./lib/postprocessing/ShaderPass.js'),
  16803. window.Promise || (window.Promise = e('promise-polyfill'))
  16804. var x = e('three'),
  16805. _x = e('three'),
  16806. S = (e('./util/sentry'), e('./player')),
  16807. M = e('./director'),
  16808. R = e('./controls/CameraControls'),
  16809. P = e('./model/ModelManager'),
  16810. O = e('./DisplayController'),
  16811. L = e('./label/LabelDisplayController'),
  16812. D = e('./enum/Viewmode'),
  16813. N = e('./util/logger'),
  16814. B = e('./showcase'),
  16815. F = e('./util/browser'),
  16816. V = e('./settings'),
  16817. U = e('./gui/gui'),
  16818. k = e('./gui/error'),
  16819. H = e('./analytics'),
  16820. G = e('./util/transitions'),
  16821. z = e('./effects'),
  16822. W = e('./objects/Skybox'),
  16823. j = e('./util/common'),
  16824. Y = (e('./util/PanoramaCollection'), e('./util/math'), e('./util/showcase')),
  16825. X = e('./util/camera'),
  16826. Z = (e('./objects/Panorama'), e('./cameras/PanoramaCamera'), e('./preloaders')),
  16827. q = e('events').EventEmitter,
  16828. K = e('./featureflags'),
  16829. Q = (e('./util/lerp'), e('./util/ajax')),
  16830. J = e('./ab'),
  16831. ee = e('./sdk/automation.js'),
  16832. te = e('./scene/SceneRenderer'),
  16833. ie = e('./scene/QuickstartManager'),
  16834. ne = e('./tile/QualityManager.js'),
  16835. re = e('./localization/localize'),
  16836. oe = e('./tag/tagManager'),
  16837. ae = e('./tile/TileDownloader'),
  16838. se = e('./tile/PanoRenderer'),
  16839. le =
  16840. (e('./enum/PanoSizeClass'),
  16841. e('./enum/PanoramaEvents'),
  16842. e('./enum/SceneRendererEvents')),
  16843. ce = e('./gui/memoryUsage'),
  16844. he = e('./enum/RenderLayers'),
  16845. ue = e('./TimingData'),
  16846. de = new N(t)
  16847. ;(N.level = V.logLevel), (N.consoleEnabled = V.console), i()
  16848. }
  16849. }).call(this, '/js/main.js')
  16850. },
  16851. {
  16852. './DisplayController': 1,
  16853. './TimingData': 2,
  16854. './ab': 3,
  16855. './analytics': 4,
  16856. './cameras/PanoramaCamera': 7,
  16857. './controls/CameraControls': 9,
  16858. './director': 15,
  16859. './effects': 16,
  16860. './enum/PanoSizeClass': 36,
  16861. './enum/PanoramaEvents': 37,
  16862. './enum/RenderLayers': 41,
  16863. './enum/SceneRendererEvents': 43,
  16864. './enum/Viewmode': 51,
  16865. './featureflags': 59,
  16866. './gui/error': 64,
  16867. './gui/gui': 65,
  16868. './gui/memoryUsage': 73,
  16869. './label/LabelDisplayController': 91,
  16870. './lib/array-polyfill': 92,
  16871. './lib/performance-polyfill': 95,
  16872. './lib/postprocessing/EffectComposer.js': 96,
  16873. './lib/postprocessing/MaskPass.js': 97,
  16874. './lib/postprocessing/RenderPass.js': 98,
  16875. './lib/postprocessing/ShaderPass.js': 99,
  16876. './lib/shaders/CopyShader.js': 100,
  16877. './lib/shaders/HorizontalBlurShader.js': 101,
  16878. './lib/shaders/VerticalBlurShader.js': 102,
  16879. './lib/three75-shim': 103,
  16880. './localization/localize': 108,
  16881. './tag/tagManager': 124,
  16882. './model/ModelManager': 140,
  16883. './objects/Panorama': 148,
  16884. './objects/Skybox': 152,
  16885. './player': 155,
  16886. './preloaders': 156,
  16887. './scene/QuickstartManager': 157,
  16888. './scene/SceneRenderer': 158,
  16889. './sdk/automation.js': 164,
  16890. './settings': 166,
  16891. './showcase': 168,
  16892. './tile/PanoRenderer': 169,
  16893. './tile/QualityManager.js': 170,
  16894. './tile/TileDownloader': 171,
  16895. './util/PanoramaCollection': 178,
  16896. './util/ajax': 181,
  16897. './util/browser': 182,
  16898. './util/camera': 183,
  16899. './util/common': 185,
  16900. './util/lerp': 188,
  16901. './util/logger': 189,
  16902. './util/math': 190,
  16903. './util/sentry': 192,
  16904. './util/showcase': 193,
  16905. './util/transitions': 195,
  16906. events: 202,
  16907. 'promise-polyfill': 213,
  16908. three: 217
  16909. }
  16910. ],
  16911. 117: [
  16912. function (e, t, i) {
  16913. 'use strict'
  16914. function n(e) {
  16915. e = e || {}
  16916. r.RawShaderMaterial.call(
  16917. this,
  16918. a.extendObject(
  16919. {
  16920. fragmentShader: o.cube.fragmentShader,
  16921. vertexShader: o.cube.vertexShader,
  16922. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  16923. name: 'CubemapMaterial'
  16924. },
  16925. e
  16926. )
  16927. )
  16928. }
  16929. var r = e('three'),
  16930. o = e('../shaders'),
  16931. a = e('../util/common')
  16932. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16933. (n.prototype.constructor = n),
  16934. (t.exports = n)
  16935. },
  16936. {
  16937. '../shaders': 167,
  16938. '../util/common': 185,
  16939. three: 217
  16940. }
  16941. ],
  16942. 118: [
  16943. function (e, t, i) {
  16944. 'use strict'
  16945. function n(e) {
  16946. e = e || {}
  16947. r.RawShaderMaterial.call(
  16948. this,
  16949. a.extendObject(
  16950. {
  16951. fragmentShader: o.model.fragmentShader,
  16952. vertexShader: o.model.vertexShader,
  16953. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  16954. name: 'ModelTextureMaterial'
  16955. },
  16956. e
  16957. )
  16958. )
  16959. }
  16960. var r = e('three'),
  16961. o = e('../shaders'),
  16962. a = e('../util/common')
  16963. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16964. (n.prototype.constructor = n),
  16965. (n.prototype.setProjectedPanos = function (e, t, i) {
  16966. i && (this.uniforms.progress.value = 0),
  16967. e.ensureSkyboxReadyForRender(),
  16968. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  16969. this.uniforms.pano0Position.value.copy(e.position),
  16970. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  16971. t.ensureSkyboxReadyForRender(),
  16972. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  16973. this.uniforms.pano1Position.value.copy(t.position),
  16974. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  16975. }),
  16976. /* n.prototype.setEyeDir = function(dir, pos) {//加
  16977. this.uniforms.eyeDir.value.copy(dir)
  16978. this.uniforms.eyePos.value.copy(pos)
  16979. }
  16980. n.prototype.setBendCameraQua = function(matrix) {//加
  16981. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  16982. } */
  16983. (t.exports = n)
  16984. },
  16985. {
  16986. '../shaders': 167,
  16987. '../util/common': 185,
  16988. three: 217
  16989. }
  16990. ],
  16991. 119: [
  16992. function (e, t, i) {
  16993. ;(function (i) {
  16994. 'use strict'
  16995. function n(e, t, i, n) {
  16996. ;(this.div = null),
  16997. (this.body = null),
  16998. (this.label = e),
  16999. (this.description = t),
  17000. (this.parsedDescription = []),
  17001. (this.media = i || {
  17002. type: null
  17003. }),
  17004. (this.loadingSpinner = null),
  17005. (this.parser = new r({
  17006. supportLinks: !u.valueFromHash('mls'),
  17007. keepLinkLabels: !0
  17008. })),
  17009. (this.state = I.CLOSED),
  17010. (this.orientation = ''),
  17011. (this.initialTransform = ''),
  17012. (this.hovering = !1),
  17013. (this.openTransition = null),
  17014. (this.closeTransition = null),
  17015. (this.openPromise = null),
  17016. (this.closePromise = null),
  17017. (this.animationTransition = null),
  17018. (this.animationScale = 0)
  17019. }
  17020. var r = e('../Parser/DescriptionParser'),
  17021. o = e('../Media/Link'),
  17022. a = e('../Media/Image'),
  17023. s = e('../Media/EmbedlyPlayer'),
  17024. l = e('../Media/EmbedlyEmbed'),
  17025. c = e('../../util/transitions'),
  17026. h = e('../../util/lerp'),
  17027. u = e('../../util/browser'),
  17028. d = e('./BillboardEvent'),
  17029. p = e('../Media/MediaEvent'),
  17030. f = e('../Parser/DescriptionChunkType'),
  17031. g = e('events').EventEmitter,
  17032. m = e('./billboardSettings'),
  17033. v = e('./overlaySettings'),
  17034. A = e('../../util/logger'),
  17035. y = new A(i),
  17036. C = document.getElementById('tag-billboards')
  17037. C.addEventListener('touchend', function (e) {
  17038. C.style.pointerEvents = 'none'
  17039. }),
  17040. C.addEventListener('touchcancel', function (e) {
  17041. C.style.pointerEvents = 'none'
  17042. })
  17043. var I = {
  17044. CLOSED: 'closed',
  17045. OPENING: 'opening',
  17046. OPEN: 'open',
  17047. CLOSING: 'closing',
  17048. ACTIVE: 'active'
  17049. }
  17050. ;(n.prototype = Object.create(g.prototype)),
  17051. (n.prototype.build = function (e) {
  17052. this.parsedDescription = this.parser.parse(this.description)
  17053. var t = document.createElement('div')
  17054. ;(t.className = 'tag-container has-hotzone'),
  17055. (this.div = t),
  17056. (this.body = document.createElement('div')),
  17057. (this.body.className = 'tag-body')
  17058. var i = document.createElement('div')
  17059. i.classList.add('tag-content')
  17060. var n = document.createElement('div')
  17061. n.classList.add('tag-text-content')
  17062. var r = document.createElement('div')
  17063. ;(r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r)
  17064. var o = document.createElement('div')
  17065. ;(o.className = 'tag-desc'),
  17066. n.appendChild(o),
  17067. i.appendChild(n),
  17068. this.body.appendChild(i),
  17069. this.appendDescriptionElements(this.parsedDescription, o),
  17070. this.appendMedia(),
  17071. t.appendChild(this.body),
  17072. C.appendChild(t),
  17073. this.bindEvents(t, this.body)
  17074. }),
  17075. (n.prototype.bindEvents = function (e, t) {
  17076. var i = function (e) {
  17077. return function (t) {
  17078. if (!this.div.classList.contains('overlay')) {
  17079. var i,
  17080. n = document.getElementById('player')
  17081. try {
  17082. i = new MouseEvent(e, t)
  17083. } catch (n) {
  17084. ;(i = document.createEvent('MouseEvents')),
  17085. i.initMouseEvent(
  17086. e,
  17087. t.bubbles,
  17088. t.cancelable,
  17089. t.view,
  17090. t.detail,
  17091. t.screenX,
  17092. t.screenY,
  17093. t.clientX,
  17094. t.clientY,
  17095. t.ctrlKey,
  17096. t.altKey,
  17097. t.shiftKey,
  17098. t.metaKey,
  17099. t.button,
  17100. t.relatedTarget
  17101. )
  17102. }
  17103. n.dispatchEvent(i)
  17104. }
  17105. }
  17106. }
  17107. t.addEventListener('mousedown', function (e) {
  17108. e.stopPropagation()
  17109. }),
  17110. t.addEventListener('mouseup', function (e) {
  17111. e.stopPropagation()
  17112. }),
  17113. e.addEventListener('touchstart', function (e) {
  17114. C.style.pointerEvents = 'auto'
  17115. }),
  17116. e.addEventListener('mousedown', i('mousedown').bind(this)),
  17117. e.addEventListener('mouseup', i('mouseup').bind(this)),
  17118. t.addEventListener(
  17119. 'mouseover',
  17120. function (t) {
  17121. this.state === I.OPEN && e.classList.remove('has-hotzone')
  17122. }.bind(this)
  17123. ),
  17124. e.addEventListener(
  17125. 'mouseenter',
  17126. function (e) {
  17127. this.state !== I.CLOSING && ((this.hovering = !0), this.emit(d.ENTER))
  17128. }.bind(this)
  17129. ),
  17130. e.addEventListener(
  17131. 'mouseleave',
  17132. function (e) {
  17133. ;(this.hovering = !1), this.emit(d.LEAVE)
  17134. }.bind(this)
  17135. ),
  17136. e.addEventListener('gesturestart', function (e) {
  17137. e.preventDefault()
  17138. })
  17139. var n = e.querySelector('.tag-text-content'),
  17140. r = 0
  17141. n.addEventListener('touchstart', function (e) {
  17142. r = e.changedTouches[0].clientY
  17143. }),
  17144. n.addEventListener('touchmove', function (t) {
  17145. function i(e) {
  17146. e &&
  17147. ((0 === e.scrollTop && t.changedTouches[0].clientY > r) ||
  17148. (e.scrollTop + e.clientHeight - e.scrollHeight === 0 &&
  17149. t.changedTouches[0].clientY < r)) &&
  17150. t.preventDefault()
  17151. }
  17152. return e.classList.contains('overlay')
  17153. ? i(this.querySelector('.tag-desc'))
  17154. : void i(this)
  17155. }),
  17156. e.addEventListener('touchmove', function (e) {
  17157. 0 ===
  17158. (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) &&
  17159. e.preventDefault()
  17160. })
  17161. }),
  17162. (n.prototype.appendDescriptionElements = function (e, t) {
  17163. e.length > 0 && this.div.classList.add('has-text'),
  17164. e.forEach(
  17165. function (e, i) {
  17166. switch (e.type) {
  17167. case f.TEXT:
  17168. t.appendChild(this.createTextElement(e.text))
  17169. break
  17170. case f.LINK:
  17171. t.appendChild(this.createLinkElement(e.link))
  17172. }
  17173. }.bind(this)
  17174. )
  17175. }),
  17176. (n.prototype.appendLoadingSpinner = function () {
  17177. ;(this.loadingSpinner = document.createElement('div')),
  17178. this.loadingSpinner.classList.add('loading-spinner')
  17179. var e = document.createElement('div')
  17180. e.classList.add('gui-spinner-icon'),
  17181. this.loadingSpinner.appendChild(e),
  17182. this.body.appendChild(this.loadingSpinner)
  17183. }),
  17184. (n.prototype.onMediaLoadFinished = function () {
  17185. this.loadingSpinner &&
  17186. (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  17187. this.applyOrientation(this.orientation),
  17188. (this.loadingSpinner = null))
  17189. }),
  17190. (n.prototype.appendMedia = function () {
  17191. if (
  17192. this.media &&
  17193. this.media.type &&
  17194. 'error' !== this.media.type &&
  17195. (!u.valueFromHash('mls', 0) || this.media.type === f.IMAGE)
  17196. ) {
  17197. this.appendLoadingSpinner()
  17198. var e = document.createElement('div')
  17199. e.classList.add('tag-media-content')
  17200. var t = document.createElement('i')
  17201. switch (
  17202. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  17203. t.classList.add(e)
  17204. }),
  17205. this.body.appendChild(t),
  17206. this.body.appendChild(e),
  17207. this.media.type)
  17208. ) {
  17209. case f.IMAGE:
  17210. e.appendChild(this.createImageElement(this.media, this.body))
  17211. break
  17212. case f.VIDEO:
  17213. e.appendChild(this.createVideoElement(this.media, this.body))
  17214. break
  17215. case f.RICH:
  17216. e.appendChild(this.createEmbedElement(this.media, this.body))
  17217. }
  17218. }
  17219. }),
  17220. (n.prototype.createTextElement = function (e) {
  17221. var t = document.createElement('span')
  17222. return (t.textContent = e), t
  17223. })
  17224. ;(n.prototype.createLinkElement = function (e) {
  17225. var t = new o(e)
  17226. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)), t.createDomElement()
  17227. }),
  17228. (n.prototype.createImageElement = function (e, t) {
  17229. function i() {
  17230. function e() {
  17231. m ||
  17232. (r.classList.remove('view-image'),
  17233. c.classList.add('overlay'),
  17234. i(),
  17235. window.addEventListener('resize', b),
  17236. c.addEventListener('click', a),
  17237. g.addEventListener('click', l),
  17238. f.addEventListener('click', s),
  17239. (m = !0),
  17240. o.emit(p.IMAGE_OPENED))
  17241. }
  17242. function i() {
  17243. t.classList.add('show-info'),
  17244. h.classList.remove('collapsible'),
  17245. (h.style.height = '')
  17246. var e = parseFloat(getComputedStyle(I).lineHeight),
  17247. i = y + e,
  17248. r = c.clientWidth - 2 * v.boundaryWidth - C,
  17249. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  17250. s = a,
  17251. l = s * n.aspect
  17252. l > r && ((l = r), (s = l / n.aspect)),
  17253. s > a && ((s = a), (l = s * n.aspect)),
  17254. (l += C),
  17255. (s += C + i),
  17256. (t.style.width = l + 'px'),
  17257. (t.style.height = s + 'px'),
  17258. (u.style.paddingTop = e + C + 'px'),
  17259. o.description.length > 0 &&
  17260. (h.classList.add('collapsible'),
  17261. (h.style.height = h.clientHeight + 12 + 'px'),
  17262. (E.style.height = 'calc(100% - ' + I.clientHeight + 'px)'))
  17263. }
  17264. function a(e) {
  17265. e.target === c && s()
  17266. }
  17267. function s() {
  17268. m &&
  17269. ((m = !1),
  17270. r.classList.add('view-image'),
  17271. c.classList.remove('overlay'),
  17272. (h.style.height = ''),
  17273. (u.style.paddingTop = ''),
  17274. (t.style.width = ''),
  17275. (t.style.height = ''),
  17276. window.removeEventListener('resize', b),
  17277. c.removeEventListener('click', a),
  17278. g.removeEventListener('click', l),
  17279. f.removeEventListener('click', s),
  17280. o.emit(p.IMAGE_CLOSED),
  17281. o.close(!0))
  17282. }
  17283. function l(e) {
  17284. t.classList.toggle('show-info')
  17285. }
  17286. var c = o.div,
  17287. h = c.getElementsByClassName('tag-content')[0],
  17288. u = c.getElementsByClassName('tag-media-content')[0],
  17289. f = t.getElementsByClassName('close')[0],
  17290. g = h.getElementsByClassName('tag-label')[0]
  17291. c.classList.add('has-image'),
  17292. r.classList.add('view-image'),
  17293. c.classList.add(n.aspect >= 1 ? 'image-landscape' : 'image-portrait'),
  17294. o.applyOrientation(o.orientation)
  17295. var m = !1,
  17296. A = getComputedStyle(h),
  17297. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  17298. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  17299. I = h.querySelector('.tag-label'),
  17300. E = h.querySelector('.tag-desc'),
  17301. b = (function () {
  17302. var e,
  17303. t,
  17304. n = 0
  17305. return function () {
  17306. clearInterval(e),
  17307. clearTimeout(t),
  17308. (e = setInterval(function () {
  17309. var e = c.clientHeight
  17310. n !== e && (i(), (n = e))
  17311. }, 100)),
  17312. (t = setTimeout(clearInterval.bind(this, e), 1e3))
  17313. }
  17314. })()
  17315. n.on(p.IMAGE_OPENING, e),
  17316. o.on(d.ACTIVATE, e),
  17317. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  17318. o.on(d.CLOSING, s)
  17319. }
  17320. var n = new a(),
  17321. r = n.createDomElement()
  17322. this.once(d.OPENED, function () {
  17323. n.load(e.src)
  17324. .then(i)
  17325. .catch(function (t) {
  17326. y.warn('Failed to load image:', e.src), y.warn('with error:', t)
  17327. })
  17328. .then(this.onMediaLoadFinished.bind(this))
  17329. })
  17330. var o = this
  17331. return r
  17332. }),
  17333. (n.prototype.createVideoElement = function (e, t) {
  17334. var i = new s({
  17335. autoPlay: !0,
  17336. autoResume: !0,
  17337. startMuted: !1,
  17338. loop: !1
  17339. }),
  17340. n = i.createDomElement()
  17341. return (
  17342. this.once(
  17343. d.OPENED,
  17344. function () {
  17345. i.load(e.src)
  17346. .then(
  17347. function () {
  17348. this.div.classList.add('has-video'),
  17349. (this.state !== I.OPEN && this.state !== I.ACTIVE) ||
  17350. (i.show(), i.play()),
  17351. this.on(d.OPENING, i.show.bind(i)),
  17352. this.on(d.OPENED, i.play.bind(i)),
  17353. this.on(d.CLOSING, i.pause.bind(i)),
  17354. this.on(d.CLOSED, i.hide.bind(i))
  17355. }.bind(this)
  17356. )
  17357. .catch(function (t) {
  17358. y.warn('Failed to embed video:', e.src), y.warn('with error:', t)
  17359. })
  17360. .then(this.onMediaLoadFinished.bind(this))
  17361. }.bind(this)
  17362. ),
  17363. n
  17364. )
  17365. }),
  17366. (n.prototype.createEmbedElement = function (e, t) {
  17367. var i = new l(),
  17368. n = i.createDomElement()
  17369. return (
  17370. this.once(
  17371. d.OPENED,
  17372. function () {
  17373. i.load(e.src)
  17374. .then(
  17375. function () {
  17376. this.div.classList.add('has-embed'),
  17377. (this.state !== I.OPEN && this.state !== I.ACTIVE) || i.show(),
  17378. this.applyOrientation(this.orientation),
  17379. this.on(d.OPENING, i.show.bind(i)),
  17380. this.on(d.CLOSED, i.hide.bind(i))
  17381. }.bind(this)
  17382. )
  17383. .catch(function (t) {
  17384. y.warn('Failed to embed:', e.src), y.warn('with error:', t)
  17385. })
  17386. .then(this.onMediaLoadFinished.bind(this))
  17387. }.bind(this)
  17388. ),
  17389. n
  17390. )
  17391. }),
  17392. (n.prototype.open = function (e) {
  17393. return (
  17394. (this.openPromise = $.Deferred()),
  17395. this.state === I.ACTIVE
  17396. ? this.openPromise.resolve().promise()
  17397. : (this.hovering || this.div.classList.add('has-hotzone'),
  17398. this.openTransition
  17399. ? e && this.setActiveState()
  17400. : (this.openTransition = c.setTimeout(
  17401. function () {
  17402. this.state !== I.OPEN &&
  17403. (this.emit(d.OPENING),
  17404. e && this.emit(d.ACTIVATING),
  17405. (this.state = I.OPENING),
  17406. this.animateOpen(
  17407. function () {
  17408. e && this.setActiveState(), this.openPromise.resolve()
  17409. }.bind(this)
  17410. ))
  17411. }.bind(this),
  17412. m.animation.openDelay
  17413. )),
  17414. c.cancel(this.closeTransition),
  17415. this.closePromise && this.closePromise.reject(),
  17416. (this.closeTransition = void 0),
  17417. this.openPromise.promise())
  17418. )
  17419. }),
  17420. (n.prototype.close = function (e) {
  17421. return (
  17422. (this.closePromise = $.Deferred()),
  17423. !e && this.hovering
  17424. ? this.closePromise.reject().promise()
  17425. : (this.closeTransition ||
  17426. (this.closeTransition = c.setTimeout(
  17427. function () {
  17428. this.state !== I.CLOSED &&
  17429. (this.emit(d.CLOSING), (this.state = I.CLOSING), this.animateClose())
  17430. }.bind(this),
  17431. m.animation.closeDelay
  17432. )),
  17433. c.cancel(this.openTransition),
  17434. this.openPromise && this.openPromise.reject(),
  17435. (this.openTransition = void 0),
  17436. this.closePromise.resolve(),
  17437. this.closePromise.promise())
  17438. )
  17439. }),
  17440. (n.prototype.setActiveState = function () {
  17441. this.state !== I.CLOSED &&
  17442. ((this.state = I.ACTIVE),
  17443. this.emit(d.ACTIVATE),
  17444. this.div.classList.remove('has-hotzone'))
  17445. }),
  17446. (n.prototype.animateOpen = function (e) {
  17447. if (this.state === I.OPENING) {
  17448. if ((c.cancel(this.animationTransition), u.detectSamsungNative()))
  17449. return (
  17450. (this.boardOrientation = null),
  17451. (this.div.style.visibility = 'visible'),
  17452. this.emit(d.OPENED),
  17453. (this.state = I.OPEN),
  17454. void (e && e())
  17455. )
  17456. ;(this.div.style.webkitTransform = 'scale(0)'),
  17457. (this.div.style.transform = 'scale(0)'),
  17458. (this.div.style.visibility = 'visible'),
  17459. (this.animationTransition = c.start(
  17460. h.property(this, 'animationScale', 1),
  17461. m.animation.openDuration,
  17462. function () {
  17463. this.emit(d.OPENED), (this.state = I.OPEN), e && e()
  17464. }.bind(this)
  17465. ))
  17466. }
  17467. }),
  17468. (n.prototype.animateClose = function (e) {
  17469. this.state === I.CLOSING &&
  17470. (c.cancel(this.animationTransition),
  17471. (this.animationTransition = c.start(
  17472. h.property(this, 'animationScale', 0),
  17473. m.animation.closeDuration,
  17474. function () {
  17475. this.emit(d.CLOSED),
  17476. (this.state = I.CLOSED),
  17477. (this.div.style.visibility = 'hidden'),
  17478. this.div.classList.contains('has-hotzone') ||
  17479. this.div.classList.add('has-hotzone'),
  17480. e && e()
  17481. }.bind(this)
  17482. )))
  17483. }),
  17484. (n.prototype.needsUpdate = function () {
  17485. return this.state !== I.CLOSED
  17486. }),
  17487. (n.prototype.update = function (e, t) {
  17488. if (this.needsUpdate()) {
  17489. var i = (this.updateOrientation(e), this.calcScale(t)),
  17490. n = {
  17491. x: ((e.x + 1) * $('#player').width()) / 2,
  17492. y: ((e.y + 1) * $('#player').height()) / 2
  17493. }
  17494. ;(this.div.screenTransform =
  17495. this.initialTransform +
  17496. ' translate(' +
  17497. n.x +
  17498. 'px, ' +
  17499. n.y +
  17500. 'px) scale(' +
  17501. i * this.animationScale +
  17502. ')'),
  17503. (this.div.style.webkitTransform = this.div.screenTransform),
  17504. (this.div.style.transform = this.div.screenTransform)
  17505. }
  17506. }),
  17507. (n.prototype.getDimensions = function () {
  17508. return this.div.getBoundingClientRect()
  17509. }),
  17510. (n.prototype.calcScale = function (e) {
  17511. return Math.sqrt(e / 40) * m.boardToDiscRatio
  17512. }),
  17513. (n.prototype.updateOrientation = function (e) {
  17514. if (this.state !== I.ACTIVE) {
  17515. var t = 1 / 3,
  17516. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  17517. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  17518. r = ''
  17519. ;(r += 0 === n ? 'right' : 2 === n ? 'left' : ''),
  17520. (r += 0 === i ? '-down' : 2 === i ? '-up' : ''),
  17521. 1 === n &&
  17522. ((r = 0 === i ? 'bottom' : 2 === i ? 'top' : ''),
  17523. 1 === i &&
  17524. (r =
  17525. $('#player').width() > $('#player').height()
  17526. ? e.x < 0
  17527. ? 'right'
  17528. : 'left'
  17529. : e.y < 0
  17530. ? 'bottom'
  17531. : 'top')),
  17532. (1 === n && 1 === i && r === this.orientation) || this.applyOrientation(r)
  17533. }
  17534. }),
  17535. (n.prototype.applyOrientation = function (e) {
  17536. ;(this.div.style.transform = this.div.style.webkitTransform = ''),
  17537. this.div.classList.remove('tag-container-' + this.orientation),
  17538. this.div.classList.add('tag-container-' + e)
  17539. var t = window.getComputedStyle(this.div)
  17540. ;(this.initialTransform = t.transform || t.webkitTransform),
  17541. 'none' === this.initialTransform && (this.initialTransform = '')
  17542. var i = t.transform.slice(7, -1).split(','),
  17543. n = -i[4],
  17544. r = -i[5]
  17545. ;(this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'),
  17546. (this.div.style.transformOrigin = n + 'px ' + r + 'px'),
  17547. (this.orientation = e)
  17548. }),
  17549. (t.exports = n)
  17550. }).call(this, '/js/tag/Billboard/Billboard.js')
  17551. },
  17552. {
  17553. '../../util/browser': 182,
  17554. '../../util/lerp': 188,
  17555. '../../util/logger': 189,
  17556. '../../util/transitions': 195,
  17557. '../Media/EmbedlyEmbed': 125,
  17558. '../Media/EmbedlyPlayer': 126,
  17559. '../Media/Image': 128,
  17560. '../Media/Link': 129,
  17561. '../Media/MediaEvent': 131,
  17562. '../Parser/DescriptionChunkType': 133,
  17563. '../Parser/DescriptionParser': 134,
  17564. './BillboardEvent': 120,
  17565. './billboardSettings': 121,
  17566. './overlaySettings': 122,
  17567. events: 202
  17568. }
  17569. ],
  17570. 120: [
  17571. function (e, t, i) {
  17572. 'use strict'
  17573. t.exports = Object.freeze({
  17574. ENTER: 'billboard.enter',
  17575. LEAVE: 'billboard.leave',
  17576. OPENING: 'billboard.opening',
  17577. OPENED: 'billboard.open',
  17578. CLOSING: 'billboard.closing',
  17579. CLOSED: 'billboard.closed',
  17580. ACTIVATING: 'billboard.activating',
  17581. ACTIVATE: 'billboard.activate'
  17582. })
  17583. },
  17584. {}
  17585. ],
  17586. 121: [
  17587. function (e, t, i) {
  17588. 'use strict'
  17589. t.exports = Object.freeze({
  17590. animation: Object.freeze({
  17591. hoverOnClosing: !1,
  17592. openDelay: 100,
  17593. closeDelay: 50,
  17594. openDuration: 200,
  17595. closeDuration: 100
  17596. }),
  17597. boardToDiscRatio: 1.2
  17598. })
  17599. },
  17600. {}
  17601. ],
  17602. 122: [
  17603. function (e, t, i) {
  17604. 'use strict'
  17605. t.exports = Object.freeze({
  17606. boundaryWidth: 30,
  17607. boundaryHeight: 0
  17608. })
  17609. },
  17610. {}
  17611. ],
  17612. 123: [
  17613. function (e, t, i) {
  17614. //tag
  17615. ;(function (i) {
  17616. 'use strict'
  17617. function n(e, t, i) {
  17618. var n = i.version || '0'
  17619. '0' !== n && I.info('tag defined using version ' + n),
  17620. (this.model = e),
  17621. (this.sid = t),
  17622. (this.color = new r.Color().set(i.color || l.tagDefault)),
  17623. (this.hoverColor = l._darken(this.color, 0.2)),
  17624. (this.floor = null),
  17625. (this.floorIndex = i.floor),
  17626. (this.mode = s.PANORAMA),
  17627. i.preferred_camera &&
  17628. i.preferred_camera.mode &&
  17629. (this.mode = i.preferred_camera.mode),
  17630. (this.obj3d = null),
  17631. (this.disc = null),
  17632. (this.materials = {
  17633. disc: null,
  17634. pole: null
  17635. }),
  17636. (this.position = new r.Vector3().copy(i.position)),
  17637. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  17638. (this.discWorldPosition = null),
  17639. (this.discScale = 0.05),
  17640. (this.poleEnabled = i.stem.enabled),
  17641. (this.billboard = new o(i.label, i.description, i.media, this)),
  17642. (this.visibleTransition = null),
  17643. (this.hoveringDisc = !1)
  17644. }
  17645. var r = e('three'),
  17646. o = e('./Billboard/Billboard'),
  17647. a = e('../settings'),
  17648. s = e('../enum/Viewmode'),
  17649. l = e('../enum/Colors'),
  17650. c = e('../enum/RenderLayers'),
  17651. h = e('../enum/RenderOrder'),
  17652. u = (e('../util/common'), e('../util/math')),
  17653. d = e('../util/texture'),
  17654. p = e('../objects/Panorama'),
  17655. f = e('../shaders'),
  17656. g = e('../util/transitions'),
  17657. m = e('../util/lerp'),
  17658. v = e('../util/easing'),
  17659. A = e('./Billboard/BillboardEvent'),
  17660. y = e('events').EventEmitter,
  17661. C = e('../util/logger'),
  17662. I = new C(i),
  17663. E = d.loadBase64(
  17664. '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=='
  17665. ),
  17666. b = d.loadBase64(
  17667. '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'
  17668. ),
  17669. w = new r.PlaneBufferGeometry(1, 1)
  17670. ;(n.prototype = Object.create(y.prototype)),
  17671. (n.raycaster = new r.Raycaster()),
  17672. (n.prototype.bindEvents = function () {
  17673. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  17674. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  17675. }),
  17676. (n.prototype.build = function () {
  17677. return (
  17678. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  17679. this.floor &&
  17680. (this.billboard.build(this.model.sid),
  17681. (this.obj3d = this.buildObject3D()),
  17682. this.floor.add(this.obj3d)),
  17683. this
  17684. )
  17685. }),
  17686. (n.prototype.buildObject3D = function () {
  17687. var e = new r.Object3D()
  17688. e.position.copy(this.position)
  17689. var t = r.UniformsUtils.clone(f.tagDisc.uniforms)
  17690. ;(t.bg.value = b),
  17691. (t.mask.value = E),
  17692. t.color.value.copy(this.color),
  17693. (this.materials.disc = new r.RawShaderMaterial({
  17694. transparent: !0,
  17695. vertexShader: f.tagDisc.vertexShader,
  17696. fragmentShader: f.tagDisc.fragmentShader,
  17697. uniforms: t
  17698. })),
  17699. (this.disc = new r.Mesh(w, this.materials.disc)),
  17700. this.disc.layers.set(c.TAG),
  17701. this.disc.position.copy(this.discPosition),
  17702. (this.disc.renderOrder = h.tagDisc),
  17703. (this.disc.tag = this)
  17704. var i = this.buildPole()
  17705. return (
  17706. i.layers.set(c.TAG),
  17707. (i.renderOrder = h.tagStem),
  17708. e.add(i),
  17709. e.layers.set(c.TAG),
  17710. e.add(this.disc)
  17711. )
  17712. }),
  17713. (n.prototype.buildPole = function () {
  17714. var e = new r.BufferGeometry(),
  17715. t = new Float32Array(6)
  17716. return (
  17717. (t[0] = t[1] = t[2] = 0),
  17718. (t[3] = this.discPosition.x),
  17719. (t[4] = this.discPosition.y),
  17720. (t[5] = this.discPosition.z),
  17721. e.addAttribute('position', new r.BufferAttribute(t, 3)),
  17722. (this.materials.pole = new r.LineBasicMaterial({
  17723. linewidth: a.tags.pole.width,
  17724. color: a.tags.pole.color,
  17725. opacity: 0,
  17726. visible: this.poleEnabled,
  17727. transparent: !0,
  17728. depthWrite: !1
  17729. })),
  17730. new r.Line(e, this.materials.pole)
  17731. )
  17732. }),
  17733. (n.prototype.setFreeState = function (e) {
  17734. ;(!e && this.hoveringDisc) ||
  17735. this.billboard.close(e).then(
  17736. function () {
  17737. this.materials.disc.uniforms.color.value = this.color
  17738. }.bind(this)
  17739. )
  17740. }),
  17741. (n.prototype.setHoverState = function (e) {
  17742. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor)
  17743. }),
  17744. (n.prototype.hide = function (e, t) {
  17745. var i = $.Deferred()
  17746. if (
  17747. 0 === this.materials.disc.uniforms.opacity.value &&
  17748. !g.isRunning(this.visibleTransition)
  17749. )
  17750. return i.resolve().promise()
  17751. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  17752. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity,
  17753. r = t + e,
  17754. o = t / r
  17755. return (
  17756. (this.visibleTransition = g.start(
  17757. (function (e) {
  17758. var t = m.property(e.materials.disc.uniforms.opacity, 'value', 0),
  17759. i = m.property(e.materials.pole, 'opacity', 0)
  17760. return function (n) {
  17761. t(n), e.materials.pole && i(n)
  17762. }
  17763. })(this),
  17764. r * n,
  17765. function () {
  17766. i.resolve()
  17767. },
  17768. o,
  17769. v[a.warp.blendEasing]
  17770. )),
  17771. i.promise()
  17772. )
  17773. }),
  17774. (n.prototype.show = function (e, t) {
  17775. var i = $.Deferred()
  17776. if (
  17777. this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity &&
  17778. !g.isRunning(this.visibleTransition)
  17779. )
  17780. return i.resolve().promise()
  17781. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  17782. var n =
  17783. (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) /
  17784. a.tags.disc.opacity,
  17785. r = t + e,
  17786. o = t / r
  17787. return (
  17788. (this.visibleTransition = g.start(
  17789. (function (e) {
  17790. var t = m.property(
  17791. e.materials.disc.uniforms.opacity,
  17792. 'value',
  17793. a.tags.disc.opacity
  17794. ),
  17795. i = m.property(e.materials.pole, 'opacity', a.tags.pole.opacity)
  17796. return function (n) {
  17797. t(n), e.materials.pole && i(n)
  17798. }
  17799. })(this),
  17800. r * n,
  17801. function () {
  17802. i.resolve()
  17803. },
  17804. o,
  17805. v[a.warp.blendEasing]
  17806. )),
  17807. i.promise()
  17808. )
  17809. }),
  17810. (n.prototype.closestPanoTowardTag = function (e, t) {
  17811. var i = [],
  17812. o = [],
  17813. l = this.disc.getWorldPosition()
  17814. if (e === s.PANORAMA) {
  17815. var c = 0.5,
  17816. h = t.position.clone().sub(l).normalize()
  17817. i.push(p.filters.isPanoAligned()),
  17818. i.push(p.filters.isNeighbourPanoTo(t)),
  17819. i.push(p.filters.inPanoDirection(l, h, c)),
  17820. o.push(p.scoreFunctions.direction(l, h))
  17821. }
  17822. var u = new r.Vector3(),
  17823. d = function (e) {
  17824. u.copy(l).sub(e.position)
  17825. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))),
  17826. i = a.tags.navigate.tiltTolerance
  17827. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  17828. },
  17829. f = function (e) {
  17830. return (
  17831. Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance ||
  17832. Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  17833. )
  17834. }
  17835. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2))
  17836. var g = this.model.panos.sortByScore(i, o)
  17837. if (a.tags.navigate.lineOfSight) {
  17838. for (var m = 0; m < g.length; m++) {
  17839. var v = g[m].item,
  17840. A = v.position.distanceTo(l)
  17841. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  17842. return null
  17843. n.raycaster.set(v.position, l.clone().sub(v.position).normalize())
  17844. var y = n.raycaster.intersectObjects(this.model.colliders)
  17845. if (0 === y.length || y[0].distance > A) return v
  17846. }
  17847. return null
  17848. }
  17849. return g.length > 0 && g[0].item
  17850. }),
  17851. (n.prototype.examine = function (e) {
  17852. var t = e.mode,
  17853. i =
  17854. (a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano)) ||
  17855. e.currentPano,
  17856. n = this.disc.getWorldPosition()
  17857. this.billboard.setActiveState()
  17858. var o = function () {
  17859. var t = this.billboard.getDimensions(),
  17860. n = new r.Vector3()
  17861. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  17862. n.unproject(e.camera),
  17863. e.flyToPano({
  17864. pano: i,
  17865. lookAtPoint: n
  17866. })
  17867. }.bind(this)
  17868. if (t === s.PANORAMA)
  17869. if (i !== e.currentPano) {
  17870. var l = {
  17871. pano: i,
  17872. lookAtPoint: n,
  17873. duration: null,
  17874. maxDistanceOverride: null,
  17875. skipWarpingCheck: !1
  17876. }
  17877. e.flyToPano(l, o)
  17878. } else
  17879. setTimeout(
  17880. function () {
  17881. this.billboard.open().then(function () {
  17882. o()
  17883. })
  17884. }.bind(this),
  17885. 0
  17886. )
  17887. else {
  17888. var c = {
  17889. pano: i
  17890. }
  17891. if (n) {
  17892. var h = new r.Matrix4().lookAt(i.position, n, new r.Vector3(0, 1, 0))
  17893. c.quaternion = new r.Quaternion().setFromRotationMatrix(h)
  17894. }
  17895. ;(c.callback = o), (c.duration = 1500), (c.mode = s.PANORAMA), e.flyToNewMode(c)
  17896. }
  17897. }),
  17898. (n.prototype.update = (function (e, t) {
  17899. var i = new r.Vector3()
  17900. return function (e, t) {
  17901. ;(this.discWorldPosition = this.disc.getWorldPosition()),
  17902. this.updateDisc(e, t),
  17903. this.billboard.needsUpdate() &&
  17904. (i.copy(this.discWorldPosition).project(t),
  17905. i.z < 1 && ((i.y *= -1), this.billboard.update(i, this.getDiscRadius(i, t))))
  17906. }
  17907. })()),
  17908. (n.prototype.updateDisc = (function (e, t) {
  17909. var i = new r.Vector3(),
  17910. o = new r.Vector3(),
  17911. l = new r.Vector3(),
  17912. c = new r.Vector3(),
  17913. h = new r.Vector3()
  17914. return function (e, t) {
  17915. var u = a.tags.visibility,
  17916. d = a.tags.disc.scale,
  17917. p =
  17918. e === s.DOLLHOUSE || e === s.FLOORPLAN
  17919. ? a.tags.visibility.visibleDistance
  17920. : t.position.distanceTo(this.discWorldPosition)
  17921. if (
  17922. ((this.obj3d.visible =
  17923. 0 !== this.disc.material.opacity &&
  17924. (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) &&
  17925. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  17926. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  17927. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  17928. this.obj3d.visible)
  17929. ) {
  17930. this.disc.quaternion.copy(t.quaternion)
  17931. var f =
  17932. d.maxSize -
  17933. (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound)
  17934. i.copy(this.discWorldPosition).project(t),
  17935. o.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(i),
  17936. l.set(f / 2, 0, 0).add(o),
  17937. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  17938. h.copy(c).unproject(t)
  17939. var g = h.distanceTo(this.discWorldPosition),
  17940. m = 1 + (a.tags.disc.scale.responsiveness / 100) * (n.viewportScale() - 1)
  17941. ;(this.discScale = g * m),
  17942. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  17943. }
  17944. }
  17945. })()),
  17946. (n.prototype.getDiscRadius = (function (e, t) {
  17947. var i = new r.Vector3()
  17948. return function (e, t) {
  17949. return (
  17950. i
  17951. .set(-this.discScale / 2, 0, 0)
  17952. .applyQuaternion(t.quaternion)
  17953. .add(this.discWorldPosition)
  17954. .project(t),
  17955. Math.abs(e.x - i.x) * $('#player').width()
  17956. )
  17957. }
  17958. })()),
  17959. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  17960. return (
  17961. !(e === s.DOLLHOUSE || e === s.FLOORPLAN) ||
  17962. this.model.allFloorsVisible ||
  17963. !this.floor.hidden
  17964. )
  17965. }),
  17966. (n.prototype.offScreen = function (e, t) {
  17967. var i = e.getWorldPosition().project(t)
  17968. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  17969. }),
  17970. (n.viewportScale = function () {
  17971. return (
  17972. (n.viewportWidth === $('#player').width() &&
  17973. n.viewportHeight === $('#player').height()) ||
  17974. ((n.viewportWidth = $('#player').width()),
  17975. (n.viewportHeight = $('#player').height()),
  17976. (n.currentViewportScale = Math.sqrt(
  17977. Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize
  17978. ))),
  17979. n.currentViewportScale
  17980. )
  17981. }),
  17982. (t.exports = n)
  17983. }).call(this, '/js/tag/tag.js')
  17984. },
  17985. {
  17986. '../enum/Colors': 19,
  17987. '../enum/RenderLayers': 41,
  17988. '../enum/RenderOrder': 42,
  17989. '../enum/Viewmode': 51,
  17990. '../objects/Panorama': 148,
  17991. '../settings': 166,
  17992. '../shaders': 167,
  17993. '../util/common': 185,
  17994. '../util/easing': 186,
  17995. '../util/lerp': 188,
  17996. '../util/logger': 189,
  17997. '../util/math': 190,
  17998. '../util/texture': 194,
  17999. '../util/transitions': 195,
  18000. './Billboard/Billboard': 119,
  18001. './Billboard/BillboardEvent': 120,
  18002. events: 202,
  18003. three: 217
  18004. }
  18005. ],
  18006. 124: [
  18007. function (e, t, i) {
  18008. ;(function (i) {
  18009. 'use strict'
  18010. function n() {
  18011. ;(this.tagState = y.IDLE),
  18012. (this.intersectTag = null),
  18013. (this.hoveredTag = null),
  18014. (this.activeTag = null),
  18015. (this.tagDiscs = []),
  18016. (this.raycaster = new r.Raycaster()),
  18017. (this.modelManager = null),
  18018. (this.player = null),
  18019. (this.totaltags = 0),
  18020. (this.navigatingViaTag = !1),
  18021. (this.enabled = !1)
  18022. }
  18023. var r = e('three'),
  18024. o = e('../util/logger'),
  18025. a = e('../util/common'),
  18026. s = e('../controls/serializer'),
  18027. l = e('../objects/Snapshot'),
  18028. c = e('../settings'),
  18029. h = e('./Billboard/BillboardEvent'),
  18030. u = e('./Media/MediaEvent'),
  18031. d = e('./Media/LinkType'),
  18032. p = e('../enum/Viewmode'),
  18033. f = e('../enum/WarpStyle'),
  18034. g = e('../enum/BlackoutStyle'),
  18035. m = e('../enum/ModelManagerEvents'),
  18036. v = e('../enum/tagEvents'),
  18037. A = e('../enum/PlayerEvents'),
  18038. y = (e('../util/lerp'), e('../enum/TagStates')),
  18039. C = e('events').EventEmitter,
  18040. I = new o(i)
  18041. a.extend(n, C),
  18042. (n.prototype.init = function (e, t) {
  18043. ;(this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents()
  18044. }),
  18045. (n.prototype.update = function (e) {
  18046. this.updateTags(
  18047. this.player.mode,
  18048. this.player.camera,
  18049. this.player.currentPano,
  18050. this.player.flying
  18051. )
  18052. }),
  18053. (n.prototype.updateTags = function (e, t, i, n) {
  18054. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n)
  18055. }),
  18056. (n.prototype.updateModel = function () {
  18057. ;(this.model = this.modelManager.getActiveModel()),
  18058. this.gettagsFromModel(),
  18059. (this.totaltags = Object.keys(this.model.tags).length)
  18060. }),
  18061. (n.prototype.gettagsFromModel = function () {
  18062. this.tagDiscs = []
  18063. for (var e in this.model.tags) {
  18064. var t = this.model.tags[e].disc
  18065. t && this.tagDiscs.push(t)
  18066. }
  18067. }),
  18068. (n.prototype.bindEvents = function () {
  18069. function e() {
  18070. Object.keys(this.model.tags).forEach(
  18071. function (e) {
  18072. var t = this.model.tags[e]
  18073. t.bindEvents(),
  18074. t.billboard.on(
  18075. u.LINK_CLICK,
  18076. function (e) {
  18077. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  18078. }.bind(this)
  18079. ),
  18080. t.billboard.on(
  18081. u.IMAGE_OPENED,
  18082. function () {
  18083. ;(this.tagState = y.EXAMINE), this.emit(u.IMAGE_OPENED)
  18084. }.bind(this)
  18085. ),
  18086. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  18087. }.bind(this)
  18088. )
  18089. }
  18090. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  18091. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  18092. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  18093. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  18094. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  18095. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  18096. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  18097. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  18098. e.call(this)
  18099. }),
  18100. (n.prototype.navigateViaLink = function (e) {
  18101. var t = s.deserialize(e)
  18102. if (t)
  18103. if (t.mode === p.PANORAMA) {
  18104. try {
  18105. this.player.model.panos.get(t.panoId)
  18106. } catch (e) {
  18107. return void I.warn('Unable to find panorama location', t.panoId)
  18108. }
  18109. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  18110. } else {
  18111. var i = {
  18112. cameraMode: t.mode,
  18113. position: t.position,
  18114. quaternion: t.quaternion,
  18115. scanId: t.panoId,
  18116. orthoZoom: t.zoom,
  18117. floorVisibility: t.floorVisibility,
  18118. thumbUrl: null,
  18119. name: null
  18120. }
  18121. this.player.flyToNewMode({
  18122. mode: t.mode,
  18123. duration: c.warp.outsideTime,
  18124. warpDest: new l(i),
  18125. force: !0
  18126. })
  18127. }
  18128. }),
  18129. (n.prototype.handleWarpStart = function (e, t, i, n) {
  18130. this.dismissExaminedTag(),
  18131. t === f.BLACK &&
  18132. ((null !== n && void 0 !== n) || (n = c.warp.teleportTime),
  18133. e && (i = g.END),
  18134. this.hideShowTagsForBlackoutStyle(i, n))
  18135. }),
  18136. (n.prototype.handleWarpInterruption = function (e, t, i) {
  18137. ;(null !== i && void 0 !== i) || (i = c.warp.teleportTime),
  18138. this.hideShowTagsForBlackoutStyle(t, i)
  18139. }),
  18140. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  18141. var i = 0,
  18142. n = 0,
  18143. r = t / 2
  18144. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  18145. case g.END:
  18146. this.hideAlltags(r)
  18147. break
  18148. case g.BEGINNING:
  18149. this.hideAlltags().done(this.showAlltags.bind(this, r))
  18150. break
  18151. case g.NONE:
  18152. break
  18153. case g.MIDDLE:
  18154. ;(i = r),
  18155. (n = r),
  18156. this.hideAlltags(n),
  18157. setTimeout(
  18158. function () {
  18159. this.showAlltags(i)
  18160. }.bind(this),
  18161. n
  18162. )
  18163. break
  18164. case g.FADEIN:
  18165. setTimeout(
  18166. function () {
  18167. this.showAlltags(r)
  18168. }.bind(this),
  18169. r
  18170. )
  18171. }
  18172. }),
  18173. (n.prototype.onPlayerModeChanging = function (e, t) {
  18174. t !== p.PANORAMA && this.dismissExaminedTag(),
  18175. t === p.PANORAMA &&
  18176. player.currentPano &&
  18177. !player.currentPano.isAligned() &&
  18178. (t = p.OUTDOOR)
  18179. var i = t !== p.OUTDOOR
  18180. i !== this.model.tagsShown &&
  18181. (i
  18182. ? this.showAlltags(c.tags.startup.fadeInDuration)
  18183. : this.hideAlltags(c.tags.startup.fadeInDuration))
  18184. }),
  18185. (n.prototype.onPanoChange = function (e, t) {
  18186. var i = this.navigatingViaTag
  18187. if (((this.navigatingViaTag = !1), !i)) {
  18188. this.dismissExaminedTag()
  18189. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  18190. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA
  18191. n !== r &&
  18192. (r === p.PANORAMA
  18193. ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0)
  18194. : this.hideAlltags(c.tags.startup.fadeInDuration))
  18195. }
  18196. }),
  18197. (n.prototype.onPlayerReady = function (e, t, i) {
  18198. this.startAlltags(e, t ? i : null)
  18199. }),
  18200. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  18201. this.updateClosestTags(e)
  18202. }),
  18203. (n.prototype.dismissExaminedTag = function () {
  18204. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  18205. this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null))
  18206. }),
  18207. (n.prototype.startAlltags = function (e, t) {
  18208. ;(this.model.shouldShowtags = c.tags.enabled),
  18209. (this.enabled = !0),
  18210. e ||
  18211. (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  18212. t &&
  18213. setTimeout(
  18214. function () {
  18215. this.activateTag(this.model.getTagBySid(t))
  18216. }.bind(this),
  18217. c.tags.startup.fadeInDuration / 2
  18218. ))
  18219. }),
  18220. (n.prototype.showAlltags = function (e, t, i) {
  18221. function n() {
  18222. o++, o === this.totaltags && ((this.model.tagsShown = !0), r.resolve())
  18223. }
  18224. var r = $.Deferred()
  18225. if (
  18226. (!i &&
  18227. this.player.mode === p.PANORAMA &&
  18228. this.player.currentPano &&
  18229. !this.player.currentPano.isAligned()) ||
  18230. !this.model.shouldShowtags
  18231. )
  18232. return r.resolve().promise()
  18233. var o = 0
  18234. for (var a in this.model.tags) {
  18235. var s = this.model.tags[a]
  18236. s.show(e, t).done(n.bind(this))
  18237. }
  18238. return r.promise()
  18239. }),
  18240. (n.prototype.hideAlltags = function (e, t) {
  18241. function i() {
  18242. r++, r === this.totaltags && ((this.model.tagsShown = !1), n.resolve())
  18243. }
  18244. var n = $.Deferred(),
  18245. r = 0
  18246. for (var o in this.model.tags) {
  18247. var a = this.model.tags[o]
  18248. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag()
  18249. }
  18250. return n.promise()
  18251. }),
  18252. (n.prototype.enableHovering = function () {
  18253. this.enabled = !0
  18254. }),
  18255. (n.prototype.disableHovering = function () {
  18256. this.enabled = !1
  18257. }),
  18258. (n.prototype.activateTag = function (e, t) {
  18259. ;(t = t || y.EXAMINE),
  18260. (this.activeTag = e),
  18261. (this.activeTag.hoveringDisc = !0),
  18262. this.activeTag.setHoverState(t === y.EXAMINE),
  18263. (this.tagState = t),
  18264. this.emit(v.TagActivated, e)
  18265. }),
  18266. (n.prototype.dismissActiveTag = function () {
  18267. ;(this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0)
  18268. var e = this.activeTag
  18269. ;(this.activeTag = null), (this.tagState = y.IDLE), this.emit(v.TagDismissed, e)
  18270. }),
  18271. (n.prototype.clickedOnTag = function (e) {
  18272. var t = function () {
  18273. ;(this.navigatingViaTag = !0),
  18274. this.activeTag.examine(this.player),
  18275. this.emit(v.TagNavigation, this.activeTag)
  18276. }.bind(this)
  18277. return this.tagState !== y.EXAMINE
  18278. ? (this.activateTag(this.intersectTag, y.EXAMINE),
  18279. (this.activeTag = this.intersectTag),
  18280. t(),
  18281. !0)
  18282. : (this.dismissActiveTag(), !1)
  18283. }),
  18284. (n.prototype.intersecttag = (function () {
  18285. var e = new r.Vector3(),
  18286. t = new r.Vector3(),
  18287. i = new r.Vector3()
  18288. return function (n, r, o) {
  18289. if (!this.enabled) return null
  18290. var a = null,
  18291. s = this.tagDiscs.filter(function (e) {
  18292. return e.parent.visible
  18293. })
  18294. if (s.length > 0) {
  18295. var l = this.model.floors.reduce(function (e, t) {
  18296. return t.hidden ? e : e.concat(t.collider.children)
  18297. }, s)
  18298. e.set(n.x, n.y, -1).unproject(o),
  18299. t.set(n.x, n.y, 1).unproject(o),
  18300. i.copy(t).sub(e).normalize(),
  18301. this.raycaster.set(e, i)
  18302. var c = this.raycaster.intersectObjects(l)
  18303. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  18304. }
  18305. return (
  18306. (this.intersectTag = a),
  18307. r &&
  18308. (this.activeTag &&
  18309. a !== this.activeTag &&
  18310. (this.tagState === y.BROWSE || (this.tagState === y.EXAMINE && a)) &&
  18311. this.dismissActiveTag(),
  18312. a &&
  18313. a !== this.activeTag &&
  18314. (a.listeners(h.ENTER).length < 1 &&
  18315. (a.billboard.on(
  18316. h.ENTER,
  18317. function () {
  18318. this.hoveredTag = a
  18319. }.bind(this)
  18320. ),
  18321. a.billboard.on(
  18322. h.LEAVE,
  18323. function () {
  18324. this.hoveredTag = null
  18325. }.bind(this)
  18326. )),
  18327. this.activateTag(a, y.BROWSE))),
  18328. a
  18329. )
  18330. }
  18331. })()),
  18332. (n.prototype.rankedtagInDirection = (function () {
  18333. var e = [],
  18334. t = [],
  18335. i = new r.Vector3(),
  18336. n = new r.Vector3(),
  18337. o = new r.Vector3()
  18338. return function (r, a, s, l) {
  18339. var c = 0
  18340. t.length = 0
  18341. for (var h = 0; h < this.closesttags.length; h++) {
  18342. var u = this.closesttags[h]
  18343. n.copy(u.position),
  18344. n.add(u.discPosition),
  18345. i.copy(a),
  18346. i.sub(n).negate(),
  18347. i.normalize()
  18348. var d = i.dot(l)
  18349. if (d >= 0) {
  18350. o.copy(n), o.project(s)
  18351. var p = this.intersecttag(o, !1, s)
  18352. if (p) {
  18353. if (c >= e.length)
  18354. for (var f = 0; f < 64; f++)
  18355. e.push({
  18356. tag: u,
  18357. dot: d
  18358. })
  18359. var g = e[c]
  18360. ;(g.tag = u),
  18361. (g.dot = d),
  18362. (g.position = math.projectPositionToCanvas(n, s)),
  18363. t.push(g),
  18364. c++
  18365. }
  18366. }
  18367. }
  18368. return (
  18369. t.sort(function (e, t) {
  18370. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  18371. }),
  18372. r < t.length ? t[r].tag : null
  18373. )
  18374. }
  18375. })()),
  18376. (n.prototype.updateClosestTags = (function () {
  18377. var e = new r.Vector3(),
  18378. t = 30
  18379. return function (i) {
  18380. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0)
  18381. var n = this.model.tags
  18382. if (n)
  18383. for (var r in n)
  18384. if (n.hasOwnProperty(r)) {
  18385. var o = n[r],
  18386. a = o.position
  18387. e.copy(i), e.sub(a).negate()
  18388. var s = e.lengthSq()
  18389. s < t && this.closesttags.push(o)
  18390. }
  18391. }
  18392. })()),
  18393. (t.exports = n)
  18394. }).call(this, '/js/tag/tagManager.js')
  18395. },
  18396. {
  18397. '../controls/serializer': 14,
  18398. '../enum/BlackoutStyle': 18,
  18399. '../enum/tagEvents': 32,
  18400. '../enum/ModelManagerEvents': 33,
  18401. '../enum/PlayerEvents': 40,
  18402. '../enum/TagStates': 44,
  18403. '../enum/Viewmode': 51,
  18404. '../enum/WarpStyle': 52,
  18405. '../objects/Snapshot': 153,
  18406. '../settings': 166,
  18407. '../util/common': 185,
  18408. '../util/lerp': 188,
  18409. '../util/logger': 189,
  18410. './Billboard/BillboardEvent': 120,
  18411. './Media/LinkType': 130,
  18412. './Media/MediaEvent': 131,
  18413. events: 202,
  18414. three: 217
  18415. }
  18416. ],
  18417. 125: [
  18418. function (e, t, i) {
  18419. ;(function (i) {
  18420. 'use strict'
  18421. function n() {
  18422. ;(this.embedWrapper = null), (this.embedElement = null)
  18423. }
  18424. var r = e('../../util/ajax'),
  18425. o = e('./mediaSettings'),
  18426. a = e('../../settings'),
  18427. s = e('../../util/logger'),
  18428. l = new s(i)
  18429. ;(n.prototype.createDomElement = function () {
  18430. return (
  18431. (this.embedWrapper = document.createElement('div')),
  18432. this.embedWrapper.classList.add('tag-embed'),
  18433. this.embedWrapper.classList.add('hidden'),
  18434. this.embedWrapper
  18435. )
  18436. }),
  18437. (n.prototype.load = function (e) {
  18438. var t =
  18439. 'https://api.embedly.com/1/oembed?key=' +
  18440. a.appConfig.embedly_key +
  18441. '&url=' +
  18442. encodeURIComponent(e) +
  18443. '&maxwidth=' +
  18444. o.maxEmbedWidth
  18445. return new Promise(
  18446. function (e, i) {
  18447. r.get(t).then(
  18448. function (t) {
  18449. if (((t = JSON.parse(t)), t.html && t.html.indexOf('<script') === -1)) {
  18450. this.embedWrapper.innerHTML = t.html
  18451. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth
  18452. if (((this.embedWrapper.style.width = n + 'px'), t.height)) {
  18453. var r = t.height / t.width
  18454. this.embedWrapper.style.height = n * r + 'px'
  18455. }
  18456. this.embedElement = this.embedWrapper.firstChild
  18457. var a = []
  18458. try {
  18459. a = [].slice.call(this.embedElement.querySelectorAll('a'))
  18460. } catch (e) {
  18461. l.debug('Error getting `a` elements for embed; was it an iframe?')
  18462. }
  18463. a.forEach(function (e) {
  18464. e.setAttribute('target', '_blank')
  18465. }),
  18466. this.embedElement.classList.add('hidden'),
  18467. this.embedWrapper.classList.remove('hidden'),
  18468. e()
  18469. } else i('Not a valid embed')
  18470. }.bind(this),
  18471. function (e) {
  18472. i(e.response)
  18473. }
  18474. )
  18475. }.bind(this)
  18476. )
  18477. }),
  18478. (n.prototype.show = function () {
  18479. this.embedElement && this.embedElement.classList.remove('hidden')
  18480. }),
  18481. (n.prototype.hide = function () {
  18482. this.embedElement && this.embedElement.classList.add('hidden')
  18483. }),
  18484. (t.exports = n)
  18485. }).call(this, '/js/tag/Media/EmbedlyEmbed.js')
  18486. },
  18487. {
  18488. '../../settings': 166,
  18489. '../../util/ajax': 181,
  18490. '../../util/logger': 189,
  18491. './mediaSettings': 132
  18492. }
  18493. ],
  18494. 126: [
  18495. function (e, t, i) {
  18496. ;(function (i) {
  18497. 'use strict'
  18498. function n(e) {
  18499. o.call(this),
  18500. (this.options = e),
  18501. (this.playerControls = null),
  18502. (this.state = s.NOT_READY)
  18503. }
  18504. var r = e('../../util/browser'),
  18505. o = e('./EmbedlyEmbed'),
  18506. a = e('../../util/logger'),
  18507. s =
  18508. (new a(i),
  18509. Object.freeze({
  18510. NOT_READY: 'player.not.ready',
  18511. CUED: 'player.cued',
  18512. PLAYING: 'player.playing',
  18513. PAUSED: 'player.paused'
  18514. }))
  18515. ;(n.prototype = Object.create(o.prototype)),
  18516. (n.prototype.createDomElement = function () {
  18517. return (
  18518. (this.embedWrapper = document.createElement('div')),
  18519. this.embedWrapper.classList.add('tag-video'),
  18520. this.embedWrapper.classList.add('hidden'),
  18521. this.embedWrapper
  18522. )
  18523. }),
  18524. (n.prototype.load = function (e) {
  18525. var t = function () {
  18526. function e(e) {
  18527. ;(this.playerState = s.CUED),
  18528. this.options.startMuted && this.playerControls.mute()
  18529. }
  18530. function t(e) {
  18531. this.playerState = e
  18532. }
  18533. function i(e) {
  18534. this.playerControls.setCurrentTime(0),
  18535. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  18536. }
  18537. ;(this.playerControls = new playerjs.Player(this.embedElement)),
  18538. this.playerControls.on('ready', e.bind(this)),
  18539. this.playerControls.on('play', t.bind(this, s.PLAYING)),
  18540. this.playerControls.on('pause', t.bind(this, s.PAUSED)),
  18541. this.playerControls.on('ended', i.bind(this))
  18542. }.bind(this)
  18543. return o.prototype.load.call(this, e).then(t.bind(this))
  18544. }),
  18545. (n.prototype.play = (function () {
  18546. var e = r.isMobile()
  18547. return function () {
  18548. this.playerState !== s.NOT_READY &&
  18549. this.playerControls &&
  18550. !e &&
  18551. ((this.state === s.CUED && this.options.autoPlay) || this.options.autoResume) &&
  18552. this.playerControls.play()
  18553. }
  18554. })()),
  18555. (n.prototype.pause = function () {
  18556. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  18557. }),
  18558. (t.exports = n)
  18559. }).call(this, '/js/tag/Media/EmbedlyPlayer.js')
  18560. },
  18561. {
  18562. '../../util/browser': 182,
  18563. '../../util/logger': 189,
  18564. './EmbedlyEmbed': 125
  18565. }
  18566. ],
  18567. 127: [
  18568. function (e, t, i) {
  18569. ;(function (i) {
  18570. 'use strict'
  18571. function n(e) {
  18572. function t() {
  18573. return (
  18574. a.debug('requesting file from embedly:', e.href),
  18575. r
  18576. .get(e.href, {
  18577. responseType: e.responseType
  18578. })
  18579. .then(function (t) {
  18580. return a.debug('requesting file finished:', e.href), t
  18581. })
  18582. )
  18583. }
  18584. function i() {}
  18585. return (s = new Promise(function (e, n) {
  18586. s.catch(i).then(function () {
  18587. t().then(e, n)
  18588. })
  18589. }))
  18590. }
  18591. var r = e('../../util/ajax'),
  18592. o = (e('./mediaSettings'), e('../../util/logger')),
  18593. a = new o(i),
  18594. s = Promise.resolve()
  18595. t.exports.enqueue = n
  18596. }).call(this, '/js/tag/Media/EmbedlyQueue.js')
  18597. },
  18598. {
  18599. '../../util/ajax': 181,
  18600. '../../util/logger': 189,
  18601. './mediaSettings': 132
  18602. }
  18603. ],
  18604. 128: [
  18605. function (e, t, i) {
  18606. ;(function (i) {
  18607. 'use strict'
  18608. function n() {
  18609. ;(this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1)
  18610. }
  18611. var r = e('./MediaEvent'),
  18612. o = e('./EmbedlyQueue'),
  18613. a = e('events').EventEmitter,
  18614. s = e('../../util/logger'),
  18615. l = e('../../settings')
  18616. new s(i)
  18617. ;(n.prototype = Object.create(a.prototype)),
  18618. (n.prototype.createDomElement = function () {
  18619. return (
  18620. (this.imageWrapper = document.createElement('div')),
  18621. this.imageWrapper.classList.add('tag-image'),
  18622. this.imageWrapper.classList.add('hidden'),
  18623. this.imageWrapper.addEventListener(
  18624. 'click',
  18625. function (e) {
  18626. e.stopPropagation(),
  18627. this.emit(r.IMAGE_OPENING),
  18628. (this.imageWrapper.style.pointerEvents = 'none')
  18629. }.bind(this)
  18630. ),
  18631. this.imageWrapper
  18632. )
  18633. }),
  18634. (n.prototype.onClosed = function () {
  18635. this.imageWrapper.style.pointerEvents = 'auto'
  18636. }),
  18637. (n.prototype.load = function (e) {
  18638. var t = Math.max(window.screen.height, window.screen.width),
  18639. i =
  18640. 'https://i.embed.ly/1/display/resize?key=' +
  18641. l.appConfig.embedly_key +
  18642. '&url=' +
  18643. encodeURIComponent(e) +
  18644. '&width=' +
  18645. t +
  18646. '&height=' +
  18647. t
  18648. return new Promise(
  18649. function (e, t) {
  18650. function n(t) {
  18651. var i = t.target
  18652. ;(this.width = i.naturalWidth),
  18653. (this.height = i.naturalHeight),
  18654. (this.aspect = this.width / this.height)
  18655. var n = t.target.src
  18656. ;(this.imageWrapper.style.backgroundImage = 'url("' + n + '")'),
  18657. (this.imageWrapper.style.width = this.width + 'px'),
  18658. (this.imageWrapper.style.height = this.height + 'px'),
  18659. this.imageWrapper.classList.remove('hidden'),
  18660. e()
  18661. }
  18662. o.enqueue({
  18663. href: i,
  18664. responseType: 'arraybuffer'
  18665. }).then(
  18666. function (e) {
  18667. var t = new Uint8Array(e),
  18668. i = new Blob([t]),
  18669. r = new window.Image()
  18670. r.addEventListener('load', n.bind(this))
  18671. var o = URL.createObjectURL(i)
  18672. r.src = o
  18673. }.bind(this),
  18674. t
  18675. )
  18676. }.bind(this)
  18677. )
  18678. }),
  18679. (t.exports = n)
  18680. }).call(this, '/js/tag/Media/Image.js')
  18681. },
  18682. {
  18683. '../../settings': 166,
  18684. '../../util/logger': 189,
  18685. './EmbedlyQueue': 127,
  18686. './MediaEvent': 131,
  18687. events: 202
  18688. }
  18689. ],
  18690. 129: [
  18691. function (e, t, i) {
  18692. 'use strict'
  18693. function n(e) {
  18694. ;(this.label = e.label),
  18695. (this.href = e.url),
  18696. (this.type = this.updateLinkForType()),
  18697. (this.domElement = null),
  18698. (this.id = c++)
  18699. }
  18700. var r = e('./LinkType'),
  18701. o = e('./MediaEvent'),
  18702. a = e('../../util/browser'),
  18703. s = e('../../analytics'),
  18704. l = e('events').EventEmitter,
  18705. c = 0
  18706. ;(n.prototype = Object.create(l.prototype)),
  18707. (n.prototype.updateLinkForType = function () {
  18708. function e(e) {
  18709. var t = new RegExp('[#&?]start=([^#&?]*)'),
  18710. i = t.exec(e)
  18711. return i[1]
  18712. }
  18713. function t(e) {
  18714. return e + '&play=1'
  18715. }
  18716. var i = a.valueFromHash('m') || a.valueFromHash('model')
  18717. return this.href.indexOf('port.com/show') !== -1 ||
  18718. this.href.indexOf(window.location.host + '/show') !== -1
  18719. ? this.href.indexOf(i) !== -1 && this.href.indexOf('start=') !== -1
  18720. ? ((this.href = e(this.href)), r.NAVIGATION)
  18721. : ((this.href = t(this.href)), r.MODEL)
  18722. : r.EXT_LINK
  18723. })
  18724. var h = {}
  18725. ;(n.prototype.createDomElement = function () {
  18726. function e(e) {
  18727. switch (
  18728. (e.stopPropagation(),
  18729. (h[this.id] = !0),
  18730. s.trackAlways('click_tag_link', {
  18731. link_type: this.type,
  18732. link_count: c,
  18733. links_clicked: Object.keys(h).length
  18734. }),
  18735. this.type)
  18736. ) {
  18737. case r.MODEL:
  18738. window.location.replace(this.href)
  18739. break
  18740. case r.EXT_LINK:
  18741. window.open(this.href, '_blank')
  18742. }
  18743. this.emit(o.LINK_CLICK, {
  18744. type: this.type,
  18745. url: this.href
  18746. })
  18747. }
  18748. if (
  18749. ((this.domElement = document.createElement('a')),
  18750. this.domElement.classList.add('tag-link'),
  18751. (this.domElement.textContent = this.label),
  18752. this.type === r.EXT_LINK)
  18753. ) {
  18754. this.domElement.textContent += ' '
  18755. var t = document.createElement('i')
  18756. t.classList.add('icon-ext-link'),
  18757. (t.title = 'Link to external web site'),
  18758. this.domElement.appendChild(t)
  18759. }
  18760. return this.domElement.addEventListener('click', e.bind(this)), this.domElement
  18761. }),
  18762. (t.exports = n)
  18763. },
  18764. {
  18765. '../../analytics': 4,
  18766. '../../util/browser': 182,
  18767. './LinkType': 130,
  18768. './MediaEvent': 131,
  18769. events: 202
  18770. }
  18771. ],
  18772. 130: [
  18773. function (e, t, i) {
  18774. 'use strict'
  18775. t.exports = {
  18776. NAVIGATION: 'navigation',
  18777. MODEL: 'model',
  18778. EXT_LINK: 'ext-link'
  18779. }
  18780. },
  18781. {}
  18782. ],
  18783. 131: [
  18784. function (e, t, i) {
  18785. 'use strict'
  18786. t.exports = Object.freeze({
  18787. LINK_CLICK: 'mtmedia.link',
  18788. IMAGE_LOADED: 'mtmedia.image.loaded',
  18789. IMAGE_OPENING: 'mtmedia.image.opening',
  18790. IMAGE_OPENED: 'mtmedia.image.opened',
  18791. IMAGE_CLOSING: 'mtmedia.image.closing',
  18792. IMAGE_CLOSED: 'mtmedia.image.closed',
  18793. VIDEO_START: 'mtmedia.video.start',
  18794. VIDEO_PAUSE: 'mtmedia.video.pause',
  18795. VIDEO_ENDED: 'mtmedia.video.end'
  18796. })
  18797. },
  18798. {}
  18799. ],
  18800. 132: [
  18801. function (e, t, i) {
  18802. 'use strict'
  18803. t.exports = Object.freeze({
  18804. maxEmbedWidth: 350,
  18805. defaultAspectRatio: 0.75
  18806. })
  18807. },
  18808. {}
  18809. ],
  18810. 133: [
  18811. function (e, t, i) {
  18812. 'use strict'
  18813. t.exports = Object.freeze({
  18814. TEXT: 'text',
  18815. LINK: 'link',
  18816. IMAGE: 'photo',
  18817. VIDEO: 'video',
  18818. RICH: 'rich'
  18819. })
  18820. },
  18821. {}
  18822. ],
  18823. 134: [
  18824. function (e, t, i) {
  18825. 'use strict'
  18826. function n(e) {
  18827. this.capabilities = {
  18828. links: {
  18829. enable: e.supportLinks,
  18830. keepLabels: e.keepLinkLabels
  18831. }
  18832. }
  18833. }
  18834. var r = e('./DescriptionChunkType')
  18835. ;(n.prototype.parse = function (e, t) {
  18836. var i = [],
  18837. n = e.split('[').map(function (e, t) {
  18838. return 0 === t ? e : '[' + e
  18839. })
  18840. return (
  18841. n.forEach(
  18842. function (e) {
  18843. var n = this.findMarkdown(e)
  18844. if (n) {
  18845. if (n.url.indexOf('javascript:') !== -1) return
  18846. this.addLinkChunk(i, n, t), this.addTextChunk(i, e.slice(n.markdown.length))
  18847. } else this.addTextChunk(i, e)
  18848. }.bind(this)
  18849. ),
  18850. i
  18851. )
  18852. }),
  18853. (n.prototype.findMarkdown = function (e) {
  18854. var t = /\[([^\]]*)\]\((.*)\)/,
  18855. i = e.match(t)
  18856. if (i) {
  18857. for (
  18858. var n = i[2], r = 1, o = 0;
  18859. o < n.length && ('(' === n[o] ? r++ : ')' === n[o] && r--, 0 !== r);
  18860. )
  18861. o++
  18862. var a = n.length - o
  18863. return {
  18864. markdown: i[0].substring(0, i[0].length - a),
  18865. label: i[1],
  18866. url: i[2].substring(0, o)
  18867. }
  18868. }
  18869. }),
  18870. (n.prototype.addTextChunk = function (e, t) {
  18871. 0 !== t.length &&
  18872. e.push({
  18873. type: r.TEXT,
  18874. text: t
  18875. })
  18876. }),
  18877. (n.prototype.addLinkChunk = function (e, t) {
  18878. if (!this.capabilities.links.enable)
  18879. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label))
  18880. var i = {
  18881. label: t.label,
  18882. url: t.url
  18883. }
  18884. i.url.indexOf('://') === -1 && (i.url = 'http://' + i.url),
  18885. e.push({
  18886. type: r.LINK,
  18887. link: i
  18888. })
  18889. }),
  18890. (t.exports = n)
  18891. },
  18892. {
  18893. './DescriptionChunkType': 133
  18894. }
  18895. ],
  18896. 135: [
  18897. function (e, t, i) {
  18898. ;(function (i) {
  18899. 'use strict'
  18900. var n = e('../util/logger'),
  18901. r = new n(i),
  18902. o = {
  18903. parseIdsFromChunkName: function (e, t) {
  18904. ;(t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e))
  18905. },
  18906. parseFloor: function (e) {
  18907. var t = e.match(/_group([0-9]+)/)
  18908. if (!t) return 0
  18909. try {
  18910. return parseInt(t[1], 10)
  18911. } catch (e) {
  18912. return (
  18913. r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  18914. )
  18915. }
  18916. },
  18917. parseRoom: function (e) {
  18918. var t = e.match(/_sub([0-9]+)/)
  18919. if (!t) return -1
  18920. try {
  18921. return parseInt(t[1], 10)
  18922. } catch (e) {
  18923. return (
  18924. r.warn(
  18925. 'Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'
  18926. ),
  18927. 0
  18928. )
  18929. }
  18930. }
  18931. }
  18932. t.exports = o
  18933. }).call(this, '/js/model/Chunks.js')
  18934. },
  18935. {
  18936. '../util/logger': 189
  18937. }
  18938. ],
  18939. 136: [
  18940. function (e, t, i) {
  18941. ;(function (i) {
  18942. 'use strict'
  18943. function n(e) {
  18944. s.call(this), (this.model = e), (this.exploded = !1)
  18945. }
  18946. var r = e('../objects/Floor'),
  18947. o = (e('../settings'), e('../util/logger')),
  18948. a = e('../util/transitions'),
  18949. s = e('../util/IndexedCollection'),
  18950. l = e('../util/common'),
  18951. c = e('../util/easing')
  18952. new o(i)
  18953. l.inherit(n, s),
  18954. (n.prototype.add = function (e) {
  18955. s.prototype.add.call(this, e), this.model.add(e)
  18956. }),
  18957. (n.prototype.getIndex = function (e) {
  18958. return e.floorIndex
  18959. }),
  18960. (n.prototype.build = function () {
  18961. this.list.forEach(function (e) {
  18962. e.build()
  18963. })
  18964. }),
  18965. (n.prototype.size = function () {
  18966. return this.length
  18967. }),
  18968. (n.prototype.sort = function () {
  18969. s.prototype.sort.call(this, function (e, t) {
  18970. return e.floorIndex - t.floorIndex
  18971. })
  18972. }),
  18973. (n.prototype.nextFloor = function (e, t) {
  18974. return this.index[e.floorIndex + t] || null
  18975. }),
  18976. (n.prototype.getFloorAtPoint = function (e) {
  18977. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  18978. var r = this.list[n],
  18979. o = r.distanceToPoint(e)
  18980. ;(!t || i > o) && ((i = o), (t = r))
  18981. }
  18982. return t
  18983. }),
  18984. (n.prototype.getOrMakeFloor = function (e) {
  18985. var t = this.index[e]
  18986. return t || ((t = new r(this.model, e)), this.add(t)), t
  18987. }),
  18988. (n.prototype.hide = function () {
  18989. this.list.forEach(function (e) {
  18990. e.hide()
  18991. })
  18992. }),
  18993. (n.prototype.show = function () {
  18994. this.list.forEach(function (e) {
  18995. e.show()
  18996. })
  18997. }),
  18998. (n.prototype.names = function () {
  18999. return this.list.reduce(function (e, t) {
  19000. return e.concat(t.name)
  19001. }, [])
  19002. }),
  19003. (n.prototype.toggleExplodeHorizontal = function () {
  19004. function e(e, t) {
  19005. r.copy(e.position),
  19006. (e.position.x = i[e.floorIndex] * t),
  19007. (e.position.y = 1 * e.floorIndex * t),
  19008. r.sub(e.position).multiplyScalar(-1),
  19009. e.panos.forEach(function (e) {
  19010. e.translate(r)
  19011. })
  19012. }
  19013. var t,
  19014. i = [],
  19015. n = 0
  19016. this.list.forEach(function (e, r, o) {
  19017. ;(t =
  19018. r > 0
  19019. ? Math.max(
  19020. o[r - 1].boundingBox.max.x - e.boundingBox.min.x,
  19021. e.boundingBox.size().x / 2
  19022. )
  19023. : 0),
  19024. (n += t),
  19025. (i[r] = n)
  19026. }),
  19027. (i = i.map(function (e) {
  19028. return e - n / 2
  19029. }))
  19030. var r = this.list[0].position.clone()
  19031. this.exploded
  19032. ? this.list.forEach(function (t) {
  19033. a.start(
  19034. function (i) {
  19035. e(t, 1 - i)
  19036. },
  19037. 1500,
  19038. null,
  19039. 0,
  19040. c.easeOutExpo
  19041. )
  19042. })
  19043. : this.list.forEach(function (t) {
  19044. a.start(
  19045. function (i) {
  19046. e(t, i)
  19047. },
  19048. 1500,
  19049. null,
  19050. 0,
  19051. c.easeOutExpo
  19052. )
  19053. }),
  19054. (this.exploded = !this.exploded)
  19055. }),
  19056. (n.prototype.toggleExplodeVertical = function () {
  19057. function e(e, i) {
  19058. var n = n.copy(e.position)
  19059. ;(e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  19060. n.sub(e.position).multiplyScalar(-1),
  19061. e.panos.forEach(function (e) {
  19062. e.translate(n)
  19063. })
  19064. }
  19065. var t = this.model.size
  19066. this.list[0].position.clone()
  19067. this.exploded
  19068. ? this.list.forEach(function (t) {
  19069. a.start(
  19070. function (i) {
  19071. e(t, 1 - i)
  19072. },
  19073. 1500,
  19074. null,
  19075. 0,
  19076. c.easeOutExpo
  19077. )
  19078. })
  19079. : this.list.forEach(function (t) {
  19080. a.start(
  19081. function (i) {
  19082. e(t, i)
  19083. },
  19084. 1500,
  19085. null,
  19086. 0,
  19087. c.easeOutExpo
  19088. )
  19089. }),
  19090. (this.exploded = !this.exploded)
  19091. }),
  19092. (t.exports = n)
  19093. }).call(this, '/js/model/FloorCollection.js')
  19094. },
  19095. {
  19096. '../objects/Floor': 146,
  19097. '../settings': 166,
  19098. '../util/IndexedCollection': 175,
  19099. '../util/common': 185,
  19100. '../util/easing': 186,
  19101. '../util/logger': 189,
  19102. '../util/transitions': 195
  19103. }
  19104. ],
  19105. 137: [
  19106. function (e, t, i) {
  19107. ;(function (i) {
  19108. 'use strict'
  19109. function n() {
  19110. c.call(this)
  19111. }
  19112. var r = e('../settings'),
  19113. o = e('../util/logger'),
  19114. a = e('../enum/Viewmode'),
  19115. s = e('../objects/Snapshot'),
  19116. l = (e('../util/math'), e('../util/common')),
  19117. c = e('../util/IndexedCollection'),
  19118. h = new o(i)
  19119. l.inherit(n, c),
  19120. (n.prototype.getImage = function (e) {
  19121. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  19122. }),
  19123. (n.prototype.filterByModesAndReel = function (e, t) {
  19124. for (var i = [], n = 0; n < t.length; n += 1) {
  19125. var r = t[n],
  19126. o = this.index[r.sid]
  19127. o && i.push(o)
  19128. }
  19129. var s = e[a.DOLLHOUSE],
  19130. l = e[a.FLOORPLAN]
  19131. ;(i = i.filter(function (e) {
  19132. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0
  19133. var t
  19134. try {
  19135. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  19136. } catch (e) {
  19137. return h.debug(e.message), !1
  19138. }
  19139. return t === a.PANORAMA || (t === a.FLOORPLAN && l) || (t === a.DOLLHOUSE && s)
  19140. })),
  19141. i.length !== this.list.length &&
  19142. h.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  19143. (this.list = i),
  19144. this.reIndex()
  19145. }),
  19146. (n.prototype.getHeroLocations = function (panos) {
  19147. //改 增加二级location
  19148. if (0 === this.list.length) return []
  19149. var locations = []
  19150. var deal = (info, container) => {
  19151. var src = info.thumbnail_signed_src,
  19152. o = info.name || ''
  19153. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  19154. if (!r.show360Views.enabled && info.metadata.scan_id) {
  19155. let a = panos.get(info.metadata.scan_id)
  19156. if (a && !a.isAligned()) return
  19157. }
  19158. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode)
  19159. if (cameraMode === a.MESH) return
  19160. if (window.isLocal) src = manage.dealURL(src)
  19161. else
  19162. src =
  19163. 'one' === g_version
  19164. ? g_Prefix + src + '?' + randomTime().getTime()
  19165. : src + '?' + randomTime().getTime()
  19166. var l = {
  19167. cameraMode: cameraMode,
  19168. position: info.metadata.camera_position,
  19169. quaternion: info.metadata.camera_quaternion,
  19170. zoom: info.metadata.zoom,
  19171. panoId: info.metadata.scan_id,
  19172. orthoZoom: info.metadata.ortho_zoom,
  19173. floorVisibility:
  19174. void 0 !== info.metadata.floor_visibility
  19175. ? info.metadata.floor_visibility.slice(0)
  19176. : [],
  19177. thumbUrl: src,
  19178. name: n.filterImageName(o),
  19179. sid: info.sid
  19180. }
  19181. var item = new s(l)
  19182. item.momentTour = info.momentTour
  19183. item.dontRot = info.dontRot
  19184. item.rotTime = info.rotTime
  19185. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {} //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  19186. container.push(item)
  19187. return item
  19188. }
  19189. }
  19190. this.list.forEach(image => {
  19191. if (image.images) {
  19192. var folder = $.extend({}, image)
  19193. folder.heroLocations = []
  19194. image.images.list.forEach(child => {
  19195. deal(child, folder.heroLocations)
  19196. })
  19197. folder.musicInfo = folder.musicInfo || {}
  19198. locations.push(folder)
  19199. delete folder.images
  19200. delete folder.locations
  19201. } else {
  19202. var item = deal(image, locations)
  19203. }
  19204. })
  19205. return locations
  19206. }),
  19207. (n.prototype.getIndex = function (e) {
  19208. return e.sid
  19209. }),
  19210. (n.filterImageName = function (e) {
  19211. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  19212. }),
  19213. (t.exports = n)
  19214. }).call(this, '/js/model/ImageCollection.js')
  19215. },
  19216. {
  19217. '../enum/Viewmode': 51,
  19218. '../objects/Snapshot': 153,
  19219. '../settings': 166,
  19220. '../util/IndexedCollection': 175,
  19221. '../util/common': 185,
  19222. '../util/logger': 189,
  19223. '../util/math': 190
  19224. }
  19225. ],
  19226. 138: [
  19227. function (e, t, i) {
  19228. ;(function (i) {
  19229. 'use strict'
  19230. function n() {
  19231. u.call(this)
  19232. }
  19233. var r = e('../label/Label'),
  19234. o = e('../settings'),
  19235. a = e('../util/logger'),
  19236. s = e('../util/math'),
  19237. l = e('../util/ajax'),
  19238. c = e('./RoomCollection'),
  19239. h = e('../util/common'),
  19240. u = e('../util/IndexedCollection')
  19241. new a(i)
  19242. h.inherit(n, u),
  19243. (n.prototype.getIndex = function (e) {
  19244. return e.labelId
  19245. }),
  19246. (n.prototype.associateWithRooms = function (e) {
  19247. this.forEach(function (t) {
  19248. e.forEach(function (e) {
  19249. e.roomId === t.roomId && (t.room = e)
  19250. })
  19251. })
  19252. }),
  19253. (n.prototype.createFromLabelData = function (e) {
  19254. e.forEach(
  19255. function (e) {
  19256. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId)
  19257. t = c.generateRoomId(e.floorId, t)
  19258. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t)
  19259. ;(i.position = s.convertWorkshopVector(i.position)), this.add(i), i.build()
  19260. }.bind(this)
  19261. )
  19262. }),
  19263. (n.prototype.load = function (e, t) {
  19264. return l
  19265. .get(e, {
  19266. responseType: 'json',
  19267. auth: t ? o.authorizationHeader : null
  19268. })
  19269. .done(
  19270. function (e) {
  19271. var t = []
  19272. for (var i in e) {
  19273. var n = e[i]
  19274. t.push(n)
  19275. }
  19276. this.createFromLabelData(t)
  19277. }.bind(this)
  19278. )
  19279. }),
  19280. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  19281. var t = -1
  19282. if (e) {
  19283. if (typeof e == 'number') {
  19284. //add
  19285. t = parseInt(e)
  19286. } else {
  19287. var i = e.split('_')
  19288. t = parseInt(i[0])
  19289. }
  19290. }
  19291. return t
  19292. }),
  19293. (t.exports = n)
  19294. }).call(this, '/js/model/LabelCollection.js')
  19295. },
  19296. {
  19297. '../label/Label': 90,
  19298. '../settings': 166,
  19299. '../util/IndexedCollection': 175,
  19300. '../util/ajax': 181,
  19301. '../util/common': 185,
  19302. '../util/logger': 189,
  19303. '../util/math': 190,
  19304. './RoomCollection': 141
  19305. }
  19306. ],
  19307. 139: [
  19308. function (e, t, i) {
  19309. ;(function (i) {
  19310. 'use strict'
  19311. function n(e, t) {
  19312. o.Object3D.call(this)
  19313. this.sid = window.number //t.sid,
  19314. ;(this.data = t),
  19315. (this.options = e),
  19316. (this.urls = new s(e.urlFiles)),
  19317. (this.isPublic = void 0 !== t.is_public && t.is_public),
  19318. //创建heroLocations
  19319. (this.images = new _(this)),
  19320. this.images.extend(t.images),
  19321. this.images.forEach(info => {
  19322. if (info.locations) {
  19323. info.images = new _(this)
  19324. info.images.extend(info.locations)
  19325. }
  19326. })
  19327. this.heroLocations = []
  19328. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  19329. ;(this.outdoorPanoLocations = []),
  19330. (this.floors = new d(this)),
  19331. (this.floorsEnabled = void 0 === e.floors || e.floors),
  19332. (this.changingFloor = !1),
  19333. (this.chunks = []),
  19334. (this.panos = new A()),
  19335. (this.colliders = []),
  19336. (this.loadPanosPromise = null),
  19337. (this.loadMeshTexturesPromise = null),
  19338. (this.auxDataPromise = null),
  19339. (this.meshTexturesLoaded = !1),
  19340. (this.meshTextures = []),
  19341. (this.tags = {}),
  19342. (this.tagsShown = !1),
  19343. (this.shouldShowtags = !1),
  19344. (this.has360Views = !1),
  19345. (this.showingLabels = f.labels.enabled && t.player_options.labels),
  19346. (this.supportedModes = {}),
  19347. (this.supportedModes[c.PANORAMA] = !0),
  19348. (this.supportedModes[c.DOLLHOUSE] =
  19349. !t.player_options || (t.player_options.dollhouse && w.valueFromHash('dh', 1))),
  19350. (this.supportedModes[c.FLOORPLAN] =
  19351. !t.player_options || (t.player_options.floor_plan && w.valueFromHash('dh', 1))),
  19352. (this.supportedModes[c.TRANSITIONING] = !0),
  19353. (this.supportsTiles = this.configureTiling()),
  19354. // this.supportsVR = t.is_vr,
  19355. (this.supportsVR = window.DATA.supportsVR || false) //true; // 方奕卓 VR功能可配置
  19356. ;(this.mode = c.DOLLHOUSE),
  19357. (this.size = null),
  19358. (this.center = null),
  19359. (this.boundingBox = new o.Box3()),
  19360. (this.currentFloor = null),
  19361. (this.allFloorsVisible = !0),
  19362. (this.projectedPano0 = null),
  19363. (this.projectedPano1 = null),
  19364. this.floorsEnabled &&
  19365. t.floors &&
  19366. t.floors.indexOf(',') !== -1 &&
  19367. t.floors.split(',').forEach(
  19368. function (e, t) {
  19369. this.addFloor(new u(this, t, e.trim()))
  19370. }.bind(this)
  19371. ),
  19372. (this.waitQueue = []),
  19373. this.on(
  19374. 'load',
  19375. function (e) {
  19376. 0 !== this.waitQueue.length &&
  19377. ((this.waitQueue = this.waitQueue.filter(function (e) {
  19378. return !e.isLoadedCallback()
  19379. })),
  19380. 0 === this.waitQueue.length && this.emit('waiting-done'))
  19381. }.bind(this)
  19382. ),
  19383. this.setupCustomProperties()
  19384. this.hots = {}
  19385. }
  19386. function r() {
  19387. try {
  19388. var e = document.createElement('canvas'),
  19389. t = e.getContext('webgl')
  19390. t || (t = e.getContext('experimental-webgl'))
  19391. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  19392. return i
  19393. } catch (e) {
  19394. return 0
  19395. }
  19396. }
  19397. var o = e('three'),
  19398. a = e('../util/ajax'),
  19399. s = e('../util/ModelUrls'),
  19400. l = e('../objects/BoundingTextureSkybox'),
  19401. c = e('../enum/Viewmode'),
  19402. h = e('../enum/RenderOrder'),
  19403. u = (e('../enum/AlignmentType'), e('../objects/Floor')),
  19404. d = e('./FloorCollection'),
  19405. p = e('../objects/Chunk'),
  19406. f =
  19407. (e('../objects/Room'),
  19408. e('../objects/Snapshot'),
  19409. e('../label/Label'),
  19410. e('../util/math'),
  19411. e('../settings')),
  19412. ss = e('../shaders'),
  19413. g = e('../util/logger'),
  19414. m = e('../tag/tag'),
  19415. v = (e('../tag/tagManager'), e('../objects/Panorama')),
  19416. A = e('../util/PanoramaCollection'),
  19417. y = e('../loaders/ModelLoader'),
  19418. C = e('../loaders/ModelTextureLoader'),
  19419. I = e('../loaders/SweepDataLoader'),
  19420. E = e('../util/transitions'),
  19421. b = e('../util/common'),
  19422. es = e('../util/easing'),
  19423. lerp = e('../util/lerp'),
  19424. tex = e('../util/texture'),
  19425. w = e('./../util/browser'),
  19426. _ = e('./ImageCollection'),
  19427. T = e('./RoomCollection'),
  19428. x = e('./LabelCollection'),
  19429. S = e('./Chunks'),
  19430. cameraLight = e('./util/cameraLight'),
  19431. M = e('./../util/showcase'),
  19432. R = e('../exception/BasicException'),
  19433. P = (e('../constants'), e('events').EventEmitter),
  19434. GLCubeFaces = e('../enum/GLCubeFaces'),
  19435. //,Hot = e("hot")
  19436. O = new g(i)
  19437. ;(n.prototype = Object.create(o.Object3D.prototype)),
  19438. b.extend(n, P),
  19439. (n.prototype.setupCustomProperties = function () {
  19440. var e = f.modelAlpha
  19441. Object.defineProperty(this, 'alpha', {
  19442. get: function () {
  19443. return e
  19444. },
  19445. set: function (t) {
  19446. e = t
  19447. //console.log(t)
  19448. this.chunks.forEach(function (chunk) {
  19449. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  19450. chunk.material.uniforms.modelAlpha.value = e
  19451. //修改一下defines,为了在不需要map时不加载map。 by xzw
  19452. /* if (e>0) {
  19453. if (!('useModelMap' in chunk.material.defines)) {
  19454. chunk.material.defines.useModelMap = ''
  19455. chunk.material.needsUpdate = true
  19456. console.log('add useModelMap')
  19457. }
  19458. } else {
  19459. if ('useModelMap' in chunk.material.defines) {
  19460. delete chunk.material.defines.useModelMap
  19461. chunk.material.needsUpdate = true
  19462. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  19463. console.log('delete useModelMap')
  19464. }
  19465. } */
  19466. }
  19467. })
  19468. }
  19469. })
  19470. }),
  19471. (n.prototype.configureTiling = function () {
  19472. var e = r()
  19473. if (e < 2048) return !1
  19474. O.warn('Max cube texture size: ' + e)
  19475. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  19476. var i = f.tiling.tilingFlagNames[t]
  19477. if ('1' === w.valueFromHash(i, null)) return !0
  19478. if ('0' === w.valueFromHash(i, null)) return !1
  19479. }
  19480. //--------------------------------------------许钟文-------------------------------------------
  19481. //return true;
  19482. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  19483. //--------------------------------------------e n d -------------------------------------------
  19484. }),
  19485. (n.prototype.toggleAlpha = function () {
  19486. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0)
  19487. }),
  19488. (n.prototype.load = function (e) {
  19489. var t = function () {
  19490. return $.when(this.loadPanos(), this.loadMesh())
  19491. },
  19492. i = this.urls.init().then(t.bind(this))
  19493. return (
  19494. e
  19495. ? (i = i.then(this.loadMeshTextures.bind(this)))
  19496. : i.then(this.loadMeshTextures.bind(this)),
  19497. (this.auxDataPromise = $.when(
  19498. /*this.loadHighlightReel(), this.loadtags() */ this.loadhots(),
  19499. this.loadLabels()
  19500. )),
  19501. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  19502. ) //不要另外使用active_reel文件
  19503. }),
  19504. (n.prototype.loadMesh = function () {
  19505. function e(e) {
  19506. O.error(e), n.reject('loading-failed')
  19507. }
  19508. function t(e, t) {
  19509. n.notify(e, t)
  19510. }
  19511. function i(e, t) {
  19512. if (0 === e.length) {
  19513. O.warn(
  19514. 'No geometry found for model, loading faux geometry, disabling outside mode'
  19515. ),
  19516. (r.supportedModes[c.DOLLHOUSE] = !1),
  19517. (r.supportedModes[c.FLOORPLAN] = !1)
  19518. var i = new p({
  19519. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1)
  19520. })
  19521. ;(i.material.visible = !1),
  19522. i.rotateX(-Math.PI / 2),
  19523. i.geometry.computeBoundingBox(),
  19524. (e = [i])
  19525. }
  19526. e.forEach(function (e) {
  19527. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0
  19528. r.addChunk(t, e)
  19529. }),
  19530. r.floors.sort(),
  19531. n.resolve(r)
  19532. }
  19533. var n = $.Deferred(),
  19534. r = this
  19535. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise()
  19536. }),
  19537. (n.prototype.loadMeshTextures = function () {
  19538. return this.loadTexturesPromise
  19539. ? this.loadTexturesPromise
  19540. : ((this.loadTexturesPromise = C.load(this, this.meshTextures).then(
  19541. function () {
  19542. this.meshTexturesLoaded = !0
  19543. }.bind(this)
  19544. )),
  19545. this.loadTexturesPromise)
  19546. }),
  19547. /* n.prototype.loadtags = function() {//xzw改
  19548. var e = $.Deferred();
  19549. if (!f.tags.enabled)
  19550. return e.resolve();
  19551. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  19552. t = "data/" + this.sid + "/tags.json"
  19553. return a.get(t, {
  19554. responseType: "json",
  19555. auth: this.isPublic ? null : f.authorizationHeader
  19556. }).done(function(t) {
  19557. var i = 0
  19558. , n = 0;
  19559. for (var r in t) {
  19560. var o = t[r];
  19561. o.enabled && (n++,
  19562. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  19563. i++))
  19564. }
  19565. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  19566. e.resolve()
  19567. }
  19568. .bind(this)).fail(function() {
  19569. O.warn("Getting tags failed, not displaying tags."),
  19570. e.resolve()
  19571. }),
  19572. e
  19573. } */
  19574. (n.prototype.shineHots = function () {
  19575. //xzw
  19576. E.trigger({
  19577. func: function (e) {
  19578. var opa = e <= 0.5 ? 2 * e : -2 * e + 2
  19579. for (var i in this.hots) {
  19580. this.hots[i].mesh.material.uniforms.opac.value = opa
  19581. }
  19582. }.bind(this),
  19583. cycling: true,
  19584. duration: 3000,
  19585. //easing: "easeInOutQuad",
  19586. name: 'hotShine'
  19587. })
  19588. }),
  19589. /* n.prototype.loadOverlays = function(overlays){
  19590. var overlays = window.data2 && window.data2.overlays
  19591. overlays && overlays.forEach((info)=>{
  19592. new Overlay(info)
  19593. })
  19594. Overlay.load()
  19595. }
  19596. */
  19597. (n.prototype.loadhots = function () {
  19598. //xzw
  19599. initHot(this)
  19600. var r = $.Deferred()
  19601. var t = g_Prefix + 'data/' + this.sid + '/data2.js' + '?' + randomTime().getTime()
  19602. return (
  19603. a
  19604. .get(t, {
  19605. responseType: 'json',
  19606. auth: this.isPublic ? null : f.authorizationHeader
  19607. })
  19608. .done(
  19609. function (e) {
  19610. window.data2 = e
  19611. this.roomLabels = []
  19612. if (!e) {
  19613. console.error('data2 is null')
  19614. } else {
  19615. g_data2 = hotMatcher(e)
  19616. this.hotsCount = 0
  19617. let create = () => {
  19618. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  19619. if (e.hots) {
  19620. var sids = Object.keys(e.hots).sort((a, b) => {
  19621. return e.hots[a].order - e.hots[b].order
  19622. })
  19623. sids.forEach(sid => {
  19624. e.hots[sid].sid = sid
  19625. //if(e.hots[sid].texType == "shine" || e.hots[sid].texType == "photo" ){
  19626. //e.hots[sid].styleImg = []
  19627. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot')
  19628. //}
  19629. })
  19630. }
  19631. if (e.overlays) {
  19632. e.overlays.forEach(info => {
  19633. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  19634. new Hot(info, 'byOverlay')
  19635. })
  19636. }
  19637. Hot.createHotList()
  19638. Hot.startLoad()
  19639. if (DATA.roomLabels) {
  19640. DATA.roomLabels.forEach(data => {
  19641. this.roomLabels.push(new RoomLabel(data))
  19642. })
  19643. }
  19644. }
  19645. if (player.currentPano) {
  19646. create()
  19647. } else {
  19648. let f = () => {
  19649. window.bus.removeEventListener('playerAndModelReady', f)
  19650. create()
  19651. }
  19652. window.bus.addEventListener('playerAndModelReady', f)
  19653. }
  19654. g_index = w.valueFromHash('m')
  19655. }
  19656. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  19657. /* var dataJsPromise = $.Deferred();
  19658. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  19659. a.get(dataJsUrl,{
  19660. responseType: "json",
  19661. auth: this.isPublic ? null : f.authorizationHeader
  19662. }).done(function(data) {
  19663. window.hotData = data;
  19664. this.createHotItem(data, this.hots);
  19665. for(let i in this.hots){//add
  19666. data[i] && this.hots[i].initStyleImg(data[i]);
  19667. }
  19668. dataJsPromise.resolve();
  19669. }.bind(this)).fail(function(){
  19670. console.log('Data.js is empty');
  19671. dataJsPromise.resolve();
  19672. }) */
  19673. r.resolve()
  19674. }.bind(this)
  19675. )
  19676. .fail(function () {
  19677. console.log('没有热点')
  19678. r.resolve()
  19679. }),
  19680. r
  19681. )
  19682. }),
  19683. (n.prototype.loadPanos = function () {
  19684. if (this.loadPanosPromise) return this.loadPanosPromise
  19685. var e = new I(this)
  19686. return (
  19687. (this.loadPanosPromise = e.load().then(
  19688. function (e) {
  19689. return (
  19690. this.data.sweeps &&
  19691. Object.keys(this.data.sweeps).length > 0 &&
  19692. (e = e.filter(
  19693. function (e) {
  19694. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled
  19695. else console.log(e.uuid)
  19696. }.bind(this)
  19697. )),
  19698. this.panos.extend(
  19699. e.map(
  19700. function (e) {
  19701. return new v(this, e.uuid, e, this.supportsTiles)
  19702. }.bind(this)
  19703. )
  19704. ),
  19705. this.panos.forEach(
  19706. function (e) {
  19707. e.neighbourUUIDs &&
  19708. (e.neighbourUUIDs.forEach(
  19709. function (t) {
  19710. var i = this.panos.get(t)
  19711. i && this.panos.setNeighbour(e, i, !0)
  19712. }.bind(this)
  19713. ),
  19714. (e.neighbourPanos =
  19715. this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0)))
  19716. }.bind(this)
  19717. ),
  19718. 0 === this.panos.length &&
  19719. (O.warn('Model has no panos, turning off inside mode'),
  19720. (this.supportedModes[c.PANORAMA] = !1)),
  19721. $.when(this)
  19722. )
  19723. }.bind(this)
  19724. )),
  19725. this.loadPanosPromise
  19726. )
  19727. }),
  19728. (n.prototype.loadHighlightReel = function () {
  19729. //xzw
  19730. var e = $.Deferred(),
  19731. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  19732. t = this.options.urlBase + 'data/' + this.sid + '/active_reel.json'
  19733. return (
  19734. a
  19735. .get(t, {
  19736. responseType: 'json',
  19737. auth: this.isPublic ? null : f.authorizationHeader
  19738. })
  19739. .done(
  19740. function (t) {
  19741. t.reel
  19742. ? (O.info('Got highlight reel with ' + t.reel.length + ' items'),
  19743. this.images.filterByModesAndReel(this.supportedModes, t.reel))
  19744. : O.info('No highlight reel found'),
  19745. e.resolve()
  19746. }.bind(this)
  19747. )
  19748. .fail(function () {
  19749. O.warn('Getting highlight reel failed, no highlights available'), e.resolve()
  19750. }),
  19751. e
  19752. )
  19753. }),
  19754. (n.prototype.waitForLoad = function (e, t) {
  19755. t() ||
  19756. (this.waitQueue.push({
  19757. object: e,
  19758. isLoadedCallback: t
  19759. }),
  19760. 1 === this.waitQueue.length && this.emit('waiting'))
  19761. }),
  19762. (n.prototype.hide = function () {
  19763. this.floors.hide()
  19764. }),
  19765. (n.prototype.show = function () {
  19766. this.floors.show()
  19767. }),
  19768. (n.prototype.floorNames = function () {
  19769. return this.floors.names()
  19770. }),
  19771. (n.prototype.warpDestFloors = function (e, t) {
  19772. if (!e || this.floors.length !== e.length) return void this.toggleAllFloors(!0)
  19773. var i = e.findIndex(
  19774. function (e) {
  19775. return e
  19776. }.bind(this)
  19777. )
  19778. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  19779. }),
  19780. (n.prototype.setFloor = function (e, t, i) {
  19781. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor),
  19782. (this.allFloorsVisible = !1),
  19783. this._setFloor(e, t, i)
  19784. }),
  19785. (n.prototype.toggleAllFloors = function (e) {
  19786. ;(this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible),
  19787. this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor),
  19788. this._setFloor(this.currentFloor)
  19789. }),
  19790. (n.prototype._setFloor = function (e, t, i) {
  19791. ;(t = t || this.mode),
  19792. this.emit('floor.changed', e, t, this.currentFloor),
  19793. (this.currentFloor = e)
  19794. var n
  19795. if (t === c.PANORAMA) {
  19796. if ((this.show(), this.shouldShowtags && this.tagsShown))
  19797. for (n in this.tags) this.tags[n].show(f.showFloorDuration)
  19798. } else if (
  19799. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  19800. (this.floors.list.forEach(
  19801. function (e, t) {
  19802. e.toggle(
  19803. e === this.currentFloor || this.allFloorsVisible,
  19804. i || this.allFloorsVisible
  19805. )
  19806. }.bind(this)
  19807. ),
  19808. this.shouldShowtags && this.tagsShown)
  19809. )
  19810. for (n in this.tags) {
  19811. var r = this.tags[n]
  19812. this.allFloorsVisible
  19813. ? r.show(f.showFloorDuration)
  19814. : r.floor === this.currentFloor
  19815. ? r.show(f.showFloorDuration, f.showFloorDelay)
  19816. : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  19817. }
  19818. var o = this,
  19819. a = e
  19820. E.start(
  19821. function () {},
  19822. f.showFloorDelay,
  19823. function () {
  19824. o.floors.forEach(function (e) {
  19825. e.chunks.forEach(function (t) {
  19826. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  19827. })
  19828. })
  19829. }.bind(this)
  19830. )
  19831. }),
  19832. (n.prototype.toggleExplode = function () {
  19833. this.floors.toggleExplodeHorizontal()
  19834. }),
  19835. (n.prototype.toggleExplodeUp = function () {
  19836. this.floors.toggleExplodeVertical()
  19837. }),
  19838. (n.prototype.nextFloor = function (e) {
  19839. return this.floors.nextFloor(this.currentFloor, e)
  19840. }),
  19841. (n.prototype.addFloor = function (e) {
  19842. this.floors.add(e)
  19843. }),
  19844. (n.prototype.getFloorAtPoint = function (e) {
  19845. return this.floors.getFloorAtPoint(e)
  19846. }),
  19847. (n.prototype.getTagBySid = function (e) {
  19848. return this.tags[e]
  19849. }),
  19850. (n.prototype.addChunk = function (e, t) {
  19851. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t)
  19852. }),
  19853. (n.prototype.setMode = function (e) {
  19854. if (!this.supportedModes[e]) throw new R('Mode not supported for this model: ' + e)
  19855. this.mode = e
  19856. this.skybox.material.transparent = e == 'panorama' ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  19857. this.chunks.forEach(function (t) {
  19858. t.setMode(e)
  19859. })
  19860. }),
  19861. (n.prototype.build = function () {
  19862. this.heroLocations = this.images.getHeroLocations(this.panos)
  19863. var e = function () {
  19864. return (
  19865. !!(
  19866. this.heroImage &&
  19867. this.heroImage.metadata &&
  19868. this.heroImage.metadata.scan_id &&
  19869. this.panos.get(this.heroImage.metadata.scan_id)
  19870. ) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  19871. )
  19872. }.bind(this)()
  19873. ;(this.has360Views =
  19874. (f.show360Views.enabled &&
  19875. this.heroLocations.some(
  19876. function (e) {
  19877. return (
  19878. e.cameraMode === c.PANORAMA &&
  19879. this.panos.get(e.panoId) &&
  19880. !this.panos.get(e.panoId).isAligned()
  19881. )
  19882. }.bind(this)
  19883. )) ||
  19884. e),
  19885. null === this.heroImage && O.warn('No hero image defined.'),
  19886. (this.currentFloor = this.floors.last()),
  19887. this.floors.build(),
  19888. (this.colliders = this.floors.reduce(function (e, t) {
  19889. return e.concat(t.collider.children)
  19890. }, [])),
  19891. this.panos.forEach(
  19892. function (e) {
  19893. e.build1(),
  19894. e.on(
  19895. 'enter',
  19896. function () {
  19897. e.floor !== this.currentFloor && this.setFloor(e.floor)
  19898. }.bind(this)
  19899. )
  19900. }.bind(this)
  19901. )
  19902. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  19903. let time1 = performance.now()
  19904. let downVec = new THREE.Vector3(0, -1, 0)
  19905. this.panos.forEach(pano => {
  19906. player.raycaster.set(pano.position, downVec)
  19907. let collider = pano.floor.collider.children
  19908. let n = player.raycaster.intersectObjects(collider, true) //add true
  19909. if (n && n[0]) {
  19910. if (n[0].point.y - pano.floorPosition.y > 0.03) {
  19911. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  19912. pano.originFloorY = pano.floorPosition.y
  19913. pano.floorPosition.y = n[0].point.y
  19914. }
  19915. }
  19916. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  19917. })
  19918. let time2 = performance.now()
  19919. console.log('探测时间', time2 - time1)
  19920. this.panos.forEach(function (e) {
  19921. e.build2()
  19922. }),
  19923. this.floors.forEach(
  19924. function (e) {
  19925. this.boundingBox.union(e.boundingBox)
  19926. }.bind(this)
  19927. ),
  19928. (this.size = this.boundingBox.size()),
  19929. (this.center = this.boundingBox.center()),
  19930. this.floors.forEach(
  19931. function (e) {
  19932. O.info(
  19933. 'Floor ' +
  19934. e +
  19935. ': ' +
  19936. e.children.length +
  19937. ' chunks, ' +
  19938. e.panos.length +
  19939. ' panos.'
  19940. )
  19941. }.bind(this)
  19942. ),
  19943. this.panos.populate_path_graph(),
  19944. (this.skybox = new l(this.boundingBox)),
  19945. (this.skybox.matrixWorldNeedsUpdate = !0),
  19946. this.add(this.skybox)
  19947. /* setTimeout(function() {
  19948. //this.hotsCount && this.shineHots()
  19949. Hot.beginShineHot()
  19950. }
  19951. .bind(this), 1300) */
  19952. //add-----
  19953. {
  19954. let maxCount = browser.isMobile() ? 200000 : 400000
  19955. let noVisiHots = this.hotGroup.children.filter(
  19956. e => !e.info.visiblePanos && e.info.texType != 'shine'
  19957. ) //只看非热点的,否则数据太多
  19958. let visiHots = this.hotGroup.children.filter(e => e.info.visiblePanos)
  19959. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  19960. if (c > maxCount) {
  19961. //防止加载时间过长,分批计算
  19962. console.log('hot分批setVisiblePanos')
  19963. Hot.visiPanosCountSlice = Math.ceil(
  19964. maxCount / this.colliders.length / noVisiHots.length
  19965. )
  19966. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16
  19967. let dur =
  19968. Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) *
  19969. Hot.visiEveryDurSlice
  19970. console.log(
  19971. Hot.visiPanosCountSlice,
  19972. Hot.visiEveryDurSlice,
  19973. dur,
  19974. Math.round(dur * noVisiHots.length)
  19975. )
  19976. if (noVisiHots.length) {
  19977. let i = 0
  19978. let hotVisiInterval = setInterval(() => {
  19979. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos)
  19980. i++
  19981. if (i >= noVisiHots.length) {
  19982. clearInterval(hotVisiInterval)
  19983. }
  19984. }, dur)
  19985. }
  19986. }
  19987. }
  19988. //---------
  19989. this.createFloorLogo()
  19990. return (
  19991. O.debug('Done building model'),
  19992. v.raycastsDone > 0 &&
  19993. (O.warn('raycasts: ' + v.raycastsDone),
  19994. O.warn('raycasts skipped: ' + v.raycastsSkipped)),
  19995. this.buildRooms(),
  19996. this.labels.associateWithRooms(this.rooms),
  19997. $.when(this)
  19998. )
  19999. }),
  20000. (n.prototype.createFloorLogo = function () {
  20001. console.log('createFloorLogo')
  20002. if (this.floorLogos || !settings.floorlogoURL) return
  20003. var url = settings.floorlogoURL
  20004. var map = tex.load(url) //可以追加done
  20005. this.floorLogos = []
  20006. for (var i = 0; i < 2; i++) {
  20007. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  20008. var material = new o.MeshBasicMaterial({
  20009. opacity: 0,
  20010. map: map,
  20011. side: o.DoubleSide,
  20012. transparent: !0,
  20013. depthWrite: !1,
  20014. depthTest: false //改 在chunk\skybox外也可看到
  20015. })
  20016. var logo = new o.Mesh(new o.PlaneGeometry(2, 2, 1, 1), material)
  20017. //var s = (Store.metadata.floorLogoSize || 100)/100;
  20018. //logo.scale.set(s,s,s);
  20019. logo.position.set(0, -1.5, 0)
  20020. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)))
  20021. logo.renderOrder = 100 //cover the videoSkybox
  20022. //logo.layers.set(0)
  20023. this.add(logo)
  20024. this.floorLogos.push(logo)
  20025. }
  20026. this.floorLogos[1].visible = false
  20027. })
  20028. ;(n.prototype.adjustfloorLogoHeight = function (o) {
  20029. var h = player.currentPano.floorPosition.y + 0.01
  20030. this.floorLogos[1].position.setY(h)
  20031. this.floorLogos[0].position.setY(h)
  20032. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  20033. }),
  20034. (n.prototype.changefloorLogoOpa = function (o) {
  20035. //改 i, opacity, time, delay
  20036. if (!this.floorLogos) return
  20037. E.cancelById('flOpa_' + o.index) //先停止之前该logo的透明度变化
  20038. if (o.from != void 0) this.floorLogos[o.index].material.opacity = o.from //初始透明度
  20039. if (!o.dur) {
  20040. //立刻
  20041. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  20042. this.floorLogos[o.index].material.opacity = o.opa
  20043. } else {
  20044. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  20045. E.start(
  20046. lerp.property(this.floorLogos[o.index].material, 'opacity', o.opa),
  20047. o.dur || 0,
  20048. null,
  20049. o.delay || 0,
  20050. es['easeInQuad'],
  20051. 'changefloorLogoOpa',
  20052. 'flOpa_' + o.index
  20053. )
  20054. }
  20055. }),
  20056. (n.prototype.updateFloorlogo = (function () {
  20057. //xzw add 更新地标的旋转
  20058. var lastQ, lastP
  20059. var equals = function (v1, v2, min) {
  20060. return Math.abs(v1 - v2) < min
  20061. }
  20062. var isSame = function (now, last, k) {
  20063. //如果和上次相同就不改变
  20064. if (!last) return false
  20065. var R = k.sceneRenderer
  20066. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  20067. //暂时:
  20068. var min = 0.0008
  20069. var same =
  20070. equals(now.x, last.x, min) &&
  20071. equals(now.y, last.y, min) &&
  20072. equals(now.z, last.z, min) &&
  20073. (now.w != void 0 ? equals(now.w, last.w, min) : true)
  20074. return same
  20075. }
  20076. return function (Q, k) {
  20077. if (!Q) return
  20078. /* if(Config.ifFish && window.lowFPS){
  20079. this.fLCompute++;
  20080. if(R.AFPS < 38){
  20081. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  20082. else if(k.flying && k.fLCompute%2 !=1) return;
  20083. k.fLCompute %= 4;
  20084. }else if(R.AFPS < 45){
  20085. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  20086. else if(k.flying && k.fLCompute%2 !=1) return;
  20087. k.fLCompute %= 6;
  20088. }else{
  20089. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  20090. //else if(k.flying && k.fLCompute%2 !=1) return;
  20091. k.fLCompute %= 2;
  20092. }
  20093. } */
  20094. var sameQ, sameP, quaternion, visible
  20095. for (var i = 0; i < 2; i++) {
  20096. var logo = this.floorLogos[i]
  20097. if (!logo.visible || logo.material.uniforms.opacity.value == 0) continue
  20098. visible = true
  20099. }
  20100. if (!visible) return //如果两个都不可见,就不更改,如果有一个可见,就都改
  20101. var c = k.cameraControls.activeControl
  20102. var sameQ = c
  20103. ? c.lat < 10
  20104. ? equals(c.lon, lastQ, 0.1)
  20105. : equals(c.lon, lastQ, 1)
  20106. : false
  20107. sameQ || (lastQ = c ? c.lon : null) //相机旋转是否改变了
  20108. for (var i = 0; i < 2; i++) {
  20109. var logo = this.floorLogos[i]
  20110. if (!sameQ) {
  20111. if (!quaternion) {
  20112. var a = new THREE.Vector3(0, 0, -1)
  20113. a.applyQuaternion(Q)
  20114. a.setY(0)
  20115. var _ = new THREE.Matrix4().lookAt(
  20116. a,
  20117. new THREE.Vector3(),
  20118. new THREE.Vector3(0, 1, 0)
  20119. )
  20120. quaternion = new THREE.Quaternion().setFromRotationMatrix(_)
  20121. var a = new THREE.Quaternion(0, 0.7071067811865476, 0.7071067811865476, 0) //计算得
  20122. quaternion.multiply(a)
  20123. }
  20124. logo.quaternion.copy(quaternion)
  20125. }
  20126. }
  20127. }
  20128. })())
  20129. ;(n.prototype.loadLabels = function () {
  20130. //xzw
  20131. this.labels = new x(this)
  20132. var e = $.Deferred()
  20133. //加载俯视图的标签 注释这个备注就会加载
  20134. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  20135. window.DATA.showingLabels ? (this.showingLabels = true) : ''
  20136. if (!this.showingLabels) return e.resolve()
  20137. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  20138. var t = g_Prefix + 'data/' + this.sid + '/labels.json'
  20139. return (
  20140. this.labels
  20141. .load(t, !this.isPublic)
  20142. .done(e.resolve.bind(e))
  20143. .fail(function () {
  20144. O.warn('Getting labels failed, not displaying labels.'), e.resolve()
  20145. }),
  20146. e
  20147. )
  20148. }),
  20149. (n.prototype.buildRooms = function () {
  20150. ;(this.rooms = new T(this)),
  20151. this.rooms.createFromChunks(this.chunks),
  20152. this.rooms.calcRoomBoundaries()
  20153. }),
  20154. (n.prototype.updateProjectedPanos = function () {
  20155. this.projectedPano0 &&
  20156. this.projectedPano1 &&
  20157. this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  20158. }),
  20159. (n.prototype.setProjectedPanos = function (e, t, i) {
  20160. ;(void 0 !== i && null !== i) || (i = !0),
  20161. (i = !!i),
  20162. (this.projectedPano0 = e),
  20163. (this.projectedPano1 = t),
  20164. this.skybox.material.setProjectedPanos(e, t, i),
  20165. this.chunks.forEach(function (n) {
  20166. n.materialInside.setProjectedPanos(e, t, i)
  20167. })
  20168. }),
  20169. (n.prototype.setSide = function (e) {
  20170. this.floors.forEach(function (t) {
  20171. t.collider.material.side = e
  20172. })
  20173. }),
  20174. (n.prototype.heroCount = function () {
  20175. return this.heroLocations ? this.heroLocations.length : 0
  20176. }),
  20177. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  20178. //改 因增加了二级目录
  20179. if (e[0] < 0)
  20180. return (
  20181. O.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  20182. )
  20183. if (this.heroCount() < 1)
  20184. return (
  20185. O.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'),
  20186. null
  20187. )
  20188. var t = this.heroLocations[e[0]]
  20189. if (t.heroLocations && e[1] != void 0) {
  20190. t = t.heroLocations[e[1]]
  20191. }
  20192. return void 0 === t
  20193. ? (O.warn(
  20194. 'Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'
  20195. ),
  20196. null)
  20197. : t
  20198. }),
  20199. (n.prototype.findPanoramicHero = function () {
  20200. for (var e in this.heroLocations)
  20201. if (this.heroLocations[e].cameraMode === c.PANORAMA) return this.heroLocations[e]
  20202. return null
  20203. }),
  20204. (n.prototype.listImagePanos = function () {
  20205. var e = [],
  20206. t = this
  20207. return (
  20208. this.images.forEach(function (i) {
  20209. if (i.metadata && i.metadata.scan_id) {
  20210. var n = t.panos.get(i.metadata.scan_id)
  20211. n && (t.supportsTiles || n.isLoaded('high') || e.push(n))
  20212. }
  20213. }),
  20214. e
  20215. )
  20216. }),
  20217. (n.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  20218. //改
  20219. //this.panos.fadeMarkerOpacity(e, t)
  20220. if (window.DATA.hideFloorMarker) return
  20221. var currentPano = player.currentPano
  20222. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  20223. var hideWhenFlyOut = () => {
  20224. var shows = [],
  20225. hides = []
  20226. player.model.panos.forEach(pano => {
  20227. hides.push(pano)
  20228. })
  20229. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  20230. }
  20231. if (opacity == 0) {
  20232. hideWhenFlyOut()
  20233. } else {
  20234. if (player.mode == 'panorama' && currentPano) {
  20235. var shows = [],
  20236. hides = []
  20237. player.model.panos.forEach(pano => {
  20238. //是邻近点就显示否则隐藏
  20239. if (currentPano.neighbourPanos[pano.id]) {
  20240. shows.push(pano)
  20241. } else {
  20242. hides.push(pano)
  20243. }
  20244. })
  20245. this.panos.fadeMarkerOpacity(opacity, dur, [
  20246. { toOp: opacity, member: shows },
  20247. { toOp: 0, member: hides }
  20248. ])
  20249. } else if (player.modeTran.split('-')[1] != 'panorama') {
  20250. //飞出后marker隐藏
  20251. hideWhenFlyOut()
  20252. }
  20253. }
  20254. }),
  20255. (n.prototype.setSweepVisibility = function (e) {
  20256. this.panos.forEach(function (t) {
  20257. t.marker && (t.marker.visible = e)
  20258. })
  20259. }),
  20260. (n.prototype.outsideAllowed = function () {
  20261. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  20262. }),
  20263. (n.prototype.addHighMapCube = function () {
  20264. //创建8*8的tile cube
  20265. if (
  20266. player.qualityManager.getMaxZoomClass() == '4k' &&
  20267. player.qualityManager.maxRenderTargetSize == 2048
  20268. ) {
  20269. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  20270. var cube = new THREE.Object3D()
  20271. cube.tiles = []
  20272. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  20273. var face = new THREE.Object3D()
  20274. for (var i = 0; i < 8; i++) {
  20275. for (var j = 0; j < 8; j++) {
  20276. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  20277. tile.position.set(i - 3.5, j - 3.5, -4)
  20278. if (highMapAddColor) {
  20279. tile.material.opacity = 0.4
  20280. var colorHue = Math.random()
  20281. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  20282. }
  20283. tile.material.transparent = true
  20284. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  20285. tile.visible = false
  20286. tile.tileX = i
  20287. tile.tileY = j
  20288. tile.cubeFace = cubeIndex
  20289. tile.renderOrder = 2 //RenderOrder.highTileCube
  20290. cube.tiles.push(tile)
  20291. face.add(tile)
  20292. }
  20293. }
  20294. switch (cubeIndex) {
  20295. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  20296. face.rotation.set(0, Math.PI / 2, 0)
  20297. break
  20298. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  20299. face.rotation.set(0, -Math.PI / 2, 0)
  20300. break
  20301. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  20302. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20303. new THREE.Vector3(0, 1, 0),
  20304. Math.PI
  20305. )
  20306. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20307. new THREE.Vector3(1, 0, 0),
  20308. Math.PI / 2
  20309. )
  20310. face.quaternion.copy(rot1).multiply(rot2)
  20311. //face.rotation.set(Math.PI/2,0,0);
  20312. break
  20313. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  20314. //face.rotation.set(-Math.PI/2,0,0);
  20315. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20316. new THREE.Vector3(0, 1, 0),
  20317. Math.PI
  20318. )
  20319. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20320. new THREE.Vector3(1, 0, 0),
  20321. -Math.PI / 2
  20322. )
  20323. face.quaternion.copy(rot1).multiply(rot2)
  20324. break
  20325. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  20326. face.rotation.set(0, Math.PI, 0)
  20327. break
  20328. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  20329. face.rotation.set(0, 0, 0)
  20330. }
  20331. face.scale.set(1, -1, 1)
  20332. cube.add(face)
  20333. }
  20334. cube.name = 'highMapCube'
  20335. this.highMapCube = cube
  20336. this.add(cube)
  20337. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  20338. this.highMapCube.visible = false
  20339. this.highMapCube.texLoadedCount = 0
  20340. player.once('pano.chosen', () => {
  20341. //wait sceneRenderer
  20342. player.sceneRenderer.on('after-render', e => {
  20343. if (this.highMapCube.visibleTiles) {
  20344. this.updateTiles()
  20345. }
  20346. if (player && player.lastFrameChanged) {
  20347. common.intervalTool.isWaiting(
  20348. 'update4kTiles',
  20349. () => {
  20350. let vectorForward = player.getDirection()
  20351. this.updateTiles(vectorForward)
  20352. },
  20353. 500
  20354. )
  20355. }
  20356. })
  20357. })
  20358. }
  20359. })
  20360. /*
  20361. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  20362. */
  20363. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  20364. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  20365. return !!tile.material.map
  20366. }
  20367. n.prototype.updateTiles = function (direction) {
  20368. if (!this.highMapCube || !this.highMapCube.visible) return
  20369. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  20370. //performance.mark('updateTiles-start')
  20371. if (direction) {
  20372. let camera = player.cameraControls.cameras.panorama
  20373. let hfov =
  20374. THREE.Math.degToRad(
  20375. cameraLight.getHFOVForCamera(camera, $('#player').width(), $('#player').height())
  20376. ) / 2
  20377. let vfov = THREE.Math.degToRad(camera.fov) / 2
  20378. /* let hcos = Math.cos(hfov / 2)
  20379. let vcos = Math.cos(vfov / 2) */
  20380. let list = this.highMapCube.tiles
  20381. list.forEach(e => {
  20382. //屏幕外的不显示
  20383. let pos = e.getWorldPosition(new THREE.Vector3())
  20384. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  20385. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  20386. let hRad = Math.acos(hcos_)
  20387. let vRad = -200
  20388. if (hRad > hfov + 0.08) {
  20389. e.score = -100
  20390. } else {
  20391. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  20392. if (vRad > vfov + 0.08) {
  20393. e.score = -100
  20394. } else {
  20395. e.score = -(hRad / hfov + vRad / vfov)
  20396. }
  20397. }
  20398. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  20399. if (e.score == -100) {
  20400. this.resetTile(e)
  20401. }
  20402. })
  20403. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  20404. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  20405. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  20406. */
  20407. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  20408. }
  20409. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  20410. if (needRecover.length) {
  20411. let maxCount = 1 //common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  20412. let count = 0
  20413. needRecover.forEach((e, i) => {
  20414. //只更新若干个,因为太耗时了, 其余的等下帧更新
  20415. if (count >= maxCount) return
  20416. let r = this.recoverTile(e)
  20417. if (r) count++
  20418. })
  20419. }
  20420. }
  20421. n.prototype.getHighImage = function (image, cubeFace, tileX, tileY) {
  20422. this.gotSomeHighImg = true //标记,需要马上updateTiles
  20423. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  20424. tile.image = image //先记录下来
  20425. }
  20426. n.prototype.updateHighMap = function (image, cubeFace, tileX, tileY) {
  20427. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  20428. if (image) tile.image = image //先记录下来
  20429. if (tile.material.map) return
  20430. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile)) {
  20431. return
  20432. }
  20433. //简易创建贴图
  20434. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  20435. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  20436. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  20437. */
  20438. var tex = new THREE.Texture()
  20439. tex.image = image
  20440. tex.flipY = false
  20441. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  20442. tex.generateMipmaps = false
  20443. tex.minFilter = THREE.LinearFilter
  20444. tex.needsUpdate = true
  20445. tile.material.map = tex
  20446. if (highMapAddColor) {
  20447. tile.material.opacity = 1
  20448. }
  20449. tile.visible = true
  20450. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  20451. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  20452. }
  20453. n.prototype.recoverTile = function (tile) {
  20454. if (tile.material.map) return
  20455. if (tile.image) {
  20456. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  20457. return true
  20458. } else {
  20459. //console.log('no image')
  20460. }
  20461. }
  20462. n.prototype.resetTile = function (tile, kill) {
  20463. if (kill) {
  20464. //完全消灭
  20465. tile.image = null
  20466. }
  20467. let map = tile.material.map
  20468. if (map) {
  20469. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  20470. map.loaded = !1
  20471. map.version = 0
  20472. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  20473. var h = player.sceneRenderer.renderer.properties.get(map)
  20474. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  20475. tile.material.map = null
  20476. if (highMapAddColor) {
  20477. tile.material.opacity = 0.4
  20478. }
  20479. tile.material.needsUpdate = true
  20480. tile.visible = false
  20481. //this.highMapCube.texLoadedCount --
  20482. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  20483. }
  20484. }
  20485. n.prototype.resetHighMap = function () {
  20486. if (!this.highMapCube) return
  20487. this.highMapCube.children.forEach(e =>
  20488. e.children.forEach(tile => {
  20489. this.resetTile(tile, true)
  20490. })
  20491. )
  20492. //this.highMapCube.texLoadedCount = 0
  20493. this.highMapCube.visibleTiles = null
  20494. this.hideHighMap()
  20495. }
  20496. n.prototype.setHighMap = function (pano) {
  20497. if (!this.highMapCube) return
  20498. this.highMapCube.position.copy(pano.position)
  20499. this.highMapCube.quaternion.copy(pano.quaternion)
  20500. }
  20501. n.prototype.showHighMap = function () {
  20502. if (!this.highMapCube) return
  20503. this.highMapCube.visible = true
  20504. }
  20505. n.prototype.hideHighMap = function () {
  20506. if (!this.highMapCube) return
  20507. this.highMapCube.visible = false
  20508. }
  20509. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  20510. t.exports = n
  20511. }).call(this, '/js/model/Model.js')
  20512. },
  20513. {
  20514. '../constants': 8,
  20515. '../enum/AlignmentType': 17,
  20516. '../enum/RenderOrder': 42,
  20517. '../enum/Viewmode': 51,
  20518. '../exception/BasicException': 55,
  20519. '../label/Label': 90,
  20520. '../loaders/ModelLoader': 105,
  20521. '../loaders/ModelTextureLoader': 106,
  20522. '../loaders/SweepDataLoader': 107,
  20523. '../tag/tag': 123,
  20524. './util/cameraLight': 184,
  20525. '../tag/tagManager': 124,
  20526. '../objects/BoundingTextureSkybox': 143,
  20527. '../objects/Chunk': 144,
  20528. '../objects/Floor': 146,
  20529. '../objects/Panorama': 148,
  20530. '../objects/Room': 150,
  20531. '../objects/Snapshot': 153,
  20532. '../settings': 166,
  20533. '../shaders': 167,
  20534. '../util/ModelUrls': 177,
  20535. '../util/PanoramaCollection': 178,
  20536. '../util/ajax': 181,
  20537. '../util/common': 185,
  20538. '../util/easing': 186,
  20539. '../util/lerp': 188,
  20540. '../util/logger': 189,
  20541. '../util/math': 190,
  20542. '../util/texture': 194,
  20543. '../util/transitions': 195,
  20544. './../util/browser': 182,
  20545. './../util/showcase': 193,
  20546. './Chunks': 135,
  20547. './FloorCollection': 136,
  20548. './ImageCollection': 137,
  20549. './LabelCollection': 138,
  20550. './RoomCollection': 141,
  20551. events: 202,
  20552. three: 217,
  20553. hot: 'hot',
  20554. '../enum/GLCubeFaces': 25
  20555. }
  20556. ],
  20557. 140: [
  20558. function (e, t, i) {
  20559. 'use strict'
  20560. function n() {
  20561. ;(this.modelMap = {}),
  20562. (this.activeModel = null),
  20563. (this.modelCount = 0),
  20564. (this.tileDownloader = null),
  20565. (this.panoRenderer = null)
  20566. }
  20567. var r = (e('three'), e('../util/common')),
  20568. o = e('../exception/BasicException'),
  20569. a = e('../enum/ModelManagerEvents'),
  20570. s = e('../enum/PanoRendererEvents'),
  20571. l = e('events').EventEmitter
  20572. ;(n.prototype.init = function (e, t, i) {
  20573. ;(this.tileDownloader = e),
  20574. (this.panoRenderer = t),
  20575. (this.qualityManager = i),
  20576. this.bindEvents()
  20577. }),
  20578. (n.prototype.bindEvents = function () {
  20579. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  20580. }),
  20581. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  20582. (n.prototype.addModel = function (e) {
  20583. ;(this.modelMap[e.sid] = e),
  20584. 0 === this.modelCount && this.activateModel(e.sid),
  20585. this.modelCount++,
  20586. this.emit(a.ModelAdded)
  20587. }),
  20588. (n.prototype.getModel = function (e) {
  20589. return this.modelMap[e]
  20590. }),
  20591. (n.prototype.activateModel = function (e) {
  20592. var t = this.modelMap[e]
  20593. if (!t) throw new o('Tried to activate invalid model!')
  20594. var i = this.activeModel
  20595. ;(this.activeModel = t),
  20596. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  20597. this.tileDownloader.setUrls(t.urls),
  20598. t.panos.forEach(
  20599. function (e) {
  20600. e.attachToPanoRenderer(this.panoRenderer),
  20601. (e.tileDownloader = this.tileDownloader),
  20602. (e.qualityManager = this.qualityManager)
  20603. }.bind(this)
  20604. ),
  20605. this.emit(a.ActiveModelChanged, {
  20606. oldModel: i,
  20607. model: t
  20608. })
  20609. }),
  20610. (n.prototype.getActiveModel = function () {
  20611. return this.activeModel
  20612. }),
  20613. r.extend(n, l),
  20614. (t.exports = n)
  20615. },
  20616. {
  20617. '../enum/ModelManagerEvents': 33,
  20618. '../enum/PanoRendererEvents': 35,
  20619. '../exception/BasicException': 55,
  20620. '../util/common': 185,
  20621. events: 202,
  20622. three: 217
  20623. }
  20624. ],
  20625. 141: [
  20626. function (e, t, i) {
  20627. ;(function (i) {
  20628. 'use strict'
  20629. function n() {
  20630. s.call(this)
  20631. }
  20632. var r = e('../objects/Room'),
  20633. o = (e('../settings'), e('../util/logger')),
  20634. a = (e('../util/transitions'), e('../util/easing'), e('../util/common')),
  20635. s = e('../util/IndexedCollection'),
  20636. l = e('./Chunks')
  20637. new o(i)
  20638. a.inherit(n, s),
  20639. (n.prototype.getIndex = function (e) {
  20640. return e.roomId
  20641. }),
  20642. (n.prototype.calcRoomBoundaries = function () {
  20643. this.forEach(function (e) {
  20644. e.calcBoundaries()
  20645. })
  20646. }),
  20647. (n.prototype.createFromChunks = function (e) {
  20648. var t = {
  20649. floorId: -1,
  20650. roomId: -1
  20651. },
  20652. i = {}
  20653. e.forEach(
  20654. function (e) {
  20655. l.parseIdsFromChunkName(e.name, t)
  20656. var o = i[t.roomId]
  20657. if (!o) {
  20658. var a = n.generateRoomId(t.floorId, t.roomId)
  20659. ;(o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o)
  20660. }
  20661. o.addChunk(e)
  20662. }.bind(this)
  20663. ),
  20664. this.calcRoomBoundaries()
  20665. }),
  20666. (n.generateRoomId = function (e, t) {
  20667. return e + '_' + t
  20668. }),
  20669. (t.exports = n)
  20670. }).call(this, '/js/model/RoomCollection.js')
  20671. },
  20672. {
  20673. '../objects/Room': 150,
  20674. '../settings': 166,
  20675. '../util/IndexedCollection': 175,
  20676. '../util/common': 185,
  20677. '../util/easing': 186,
  20678. '../util/logger': 189,
  20679. '../util/transitions': 195,
  20680. './Chunks': 135
  20681. }
  20682. ],
  20683. 142: [
  20684. function (e, t, i) {
  20685. 'use strict'
  20686. function n(e, t, i) {
  20687. e = e.clone().expandByScalar(0.01) //改
  20688. var n = e.size(),
  20689. o = new r.BoxGeometry(n.x, n.y, n.z)
  20690. ;(o.boundingBox = e),
  20691. r.Mesh.call(this, o, t),
  20692. this.position.copy(e.center()),
  20693. (this.frustumCulled = !1),
  20694. i && this.add(new r.WireframeHelper(this))
  20695. }
  20696. var r = e('three')
  20697. ;(n.prototype = Object.create(r.Mesh.prototype)),
  20698. (n.prototype.constructor = n),
  20699. (t.exports = n)
  20700. },
  20701. {
  20702. three: 217
  20703. }
  20704. ],
  20705. 143: [
  20706. function (e, t, i) {
  20707. ;(function (i) {
  20708. 'use strict'
  20709. function n(e) {
  20710. h.time('Computing a nice bounding cubemap')
  20711. var t = new a({
  20712. side: r.BackSide,
  20713. transparent: !0
  20714. })
  20715. ;(t.uniforms.modelAlpha.value = 0),
  20716. (t.uniforms.opacity.value = 1 - s.modelAlpha),
  20717. (this.renderOrder = l.boundingSkybox),
  20718. o.call(this, e, t),
  20719. h.timeEnd('Computing a nice bounding cubemap')
  20720. }
  20721. var r = e('three'),
  20722. o = (e('../enum/Viewmode'), e('../shaders'), e('./BoundingMesh')),
  20723. a = e('../materials/ModelTextureMaterial'),
  20724. s = e('../settings'),
  20725. l = e('../enum/RenderOrder'),
  20726. c = e('../util/logger'),
  20727. h = new c(i)
  20728. ;(n.prototype = Object.create(o.prototype)),
  20729. (n.prototype.constructor = n),
  20730. (t.exports = n)
  20731. }).call(this, '/js/objects/BoundingTextureSkybox.js')
  20732. },
  20733. {
  20734. '../enum/RenderOrder': 42,
  20735. '../enum/Viewmode': 51,
  20736. '../materials/ModelTextureMaterial': 118,
  20737. '../settings': 166,
  20738. '../shaders': 167,
  20739. '../util/logger': 189,
  20740. './BoundingMesh': 142,
  20741. three: 217
  20742. }
  20743. ],
  20744. 144: [
  20745. function (e, t, i) {
  20746. 'use strict'
  20747. function n(e) {
  20748. this.materialInside = new s({
  20749. side: r.DoubleSide
  20750. })
  20751. var t = r.UniformsUtils.clone(o.modelOutside.uniforms)
  20752. ;(this.materialOutside = new r.RawShaderMaterial({
  20753. fragmentShader: o.modelOutside.fragmentShader,
  20754. vertexShader: o.modelOutside.vertexShader,
  20755. uniforms: t,
  20756. side: r.FrontSide,
  20757. name: 'chunkOut'
  20758. })),
  20759. r.Mesh.call(this, e.geometry, this.materialInside),
  20760. (this.name = e.name || ''),
  20761. (this.textureName = e.textureName),
  20762. (this.meshUrl = e.meshUrl)
  20763. }
  20764. var r = e('three'),
  20765. o = e('../shaders'),
  20766. a = e('../enum/Viewmode'),
  20767. s = e('../materials/ModelTextureMaterial')
  20768. ;(n.prototype = Object.create(r.Mesh.prototype)),
  20769. (n.prototype.setTextureMap = function (e) {
  20770. ;(this.materialInside.uniforms.map.value = e),
  20771. (this.materialOutside.uniforms.map.value = e)
  20772. }),
  20773. (n.prototype.setMode = function (e) {
  20774. var t =
  20775. e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside
  20776. ;(t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  20777. (t.transparent = this.material.transparent),
  20778. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  20779. (this.material = t)
  20780. }),
  20781. (t.exports = n)
  20782. },
  20783. {
  20784. '../enum/Viewmode': 51,
  20785. '../materials/ModelTextureMaterial': 118,
  20786. '../shaders': 167,
  20787. three: 217
  20788. }
  20789. ],
  20790. 145: [
  20791. function (e, t, i) {
  20792. 'use strict'
  20793. function n(e) {
  20794. ;(this.chunksize = e || 10),
  20795. (this.chunks = {}),
  20796. (this.boundingBoxes = {}),
  20797. (this.children = []),
  20798. (this.offset = new r.Vector3(0, 0.5, 0)),
  20799. (this.material = new r.MeshBasicMaterial({
  20800. color: 16777215 * Math.random(),
  20801. side: r.DoubleSide
  20802. }))
  20803. }
  20804. var r = e('three')
  20805. e('../enum/Viewmode')
  20806. ;(n.prototype.add = function (e) {
  20807. var t,
  20808. i,
  20809. n,
  20810. o,
  20811. a,
  20812. s,
  20813. l,
  20814. c,
  20815. h,
  20816. u,
  20817. d,
  20818. p,
  20819. f,
  20820. g,
  20821. m = e.attributes
  20822. m
  20823. ? ((t = m.position.array), (i = void 0 !== e.index ? e.index.array : void 0))
  20824. : ((t = e.vertices), (n = e.faces))
  20825. var v = new r.Vector3()
  20826. if (i)
  20827. for (o = 0, a = i.length; o < a; o += 3) {
  20828. var A = 3 * i[o],
  20829. y = 3 * i[o + 1],
  20830. C = 3 * i[o + 2]
  20831. ;(s = (t[A] + t[y] + t[C]) / 3),
  20832. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  20833. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  20834. (h = Math.floor(s / this.chunksize)),
  20835. (u = Math.floor(l / this.chunksize)),
  20836. (d = Math.floor(c / this.chunksize)),
  20837. (p = h + '.' + u + '.' + d),
  20838. p in this.chunks
  20839. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20840. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20841. g.push(
  20842. t[A],
  20843. t[A + 1],
  20844. t[A + 2],
  20845. t[y],
  20846. t[y + 1],
  20847. t[y + 2],
  20848. t[C],
  20849. t[C + 1],
  20850. t[C + 2]
  20851. ),
  20852. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  20853. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  20854. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  20855. }
  20856. else
  20857. for (o = 0, a = t.length; o < a; o += 9)
  20858. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  20859. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  20860. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  20861. (h = Math.floor(s / this.chunksize)),
  20862. (u = Math.floor(l / this.chunksize)),
  20863. (d = Math.floor(c / this.chunksize)),
  20864. (p = h + '.' + u + '.' + d),
  20865. p in this.chunks
  20866. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20867. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20868. g.push(
  20869. t[o],
  20870. t[o + 1],
  20871. t[o + 2],
  20872. t[o + 3],
  20873. t[o + 4],
  20874. t[o + 5],
  20875. t[o + 6],
  20876. t[o + 7],
  20877. t[o + 8]
  20878. ),
  20879. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  20880. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  20881. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  20882. }),
  20883. (n.prototype.build = function () {
  20884. var e = new r.Object3D()
  20885. e.material = this.material
  20886. for (var t in this.chunks) {
  20887. var i = this.chunks[t],
  20888. n = new r.BufferGeometry()
  20889. n.addAttribute('position', new r.BufferAttribute(new Float32Array(i), 3)),
  20890. (n.boundingBox = this.boundingBoxes[t])
  20891. var o = new r.Mesh(n, this.material)
  20892. ;(o.material.visible = !1), e.add(o), (this.chunks[t] = [])
  20893. }
  20894. return e
  20895. }),
  20896. (t.exports = n)
  20897. },
  20898. {
  20899. '../enum/Viewmode': 51,
  20900. three: 217
  20901. }
  20902. ],
  20903. 146: [
  20904. function (e, t, i) {
  20905. 'use strict'
  20906. var r = e('three'),
  20907. o = e('../settings'),
  20908. a = e('../util/common'),
  20909. s = e('../util/lerp'),
  20910. l = e('./ChunkedCollider'),
  20911. c = e('../util/transitions'),
  20912. h = e('../util/easing'),
  20913. u = (e('../objects/Panorama'), e('../enum/RenderOrder')),
  20914. d = e('../localization/localize')
  20915. function n(e, t, i) {
  20916. r.Object3D.call(this),
  20917. (this.model = e),
  20918. (this.floorIndex = t),
  20919. (this.lang = o.languageTag),
  20920. (this.name =
  20921. i || o.languageTag === 'cn' ? 'Floor ' + (t + 1) + '' : '第' + (t + 1) + '层'),
  20922. (this.panos = []),
  20923. (this.chunks = []),
  20924. (this.colliderBuilder = new l(3)),
  20925. (this.collider = null),
  20926. (this.center = null),
  20927. (this.boundingBox = new r.Box3()),
  20928. (this.size = null),
  20929. (this.hidden = !1),
  20930. (this.conservativeBoundingBox = new r.Box3()),
  20931. (this.debugColor = 16777215 * Math.random()),
  20932. (this.transition = null)
  20933. }
  20934. ;(n.prototype = Object.create(r.Object3D.prototype)),
  20935. (n.prototype.enter = function (e) {
  20936. this.model.setFloor(this, e)
  20937. }),
  20938. (n.prototype.hide = function (e) {
  20939. if (!this.hidden || this.transition) {
  20940. this.chunks.forEach(function (e) {
  20941. e.material.transparent = !0
  20942. }),
  20943. c.cancel(this.transition)
  20944. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  20945. i = e ? 0 : o.hideFloorDelay / t
  20946. this.transition = c.start(
  20947. s.allUniforms(this.chunks, 'opacity', 0.08),
  20948. t,
  20949. function () {
  20950. this.hidden = !0
  20951. }.bind(this),
  20952. i,
  20953. h.easeInOutQuad
  20954. )
  20955. }
  20956. }),
  20957. (n.prototype.show = function (e) {
  20958. if (this.hidden || this.transition) {
  20959. ;(this.hidden = !1), c.cancel(this.transition)
  20960. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay,
  20961. i = e ? 0 : o.showFloorDelay / t
  20962. this.transition = c.start(
  20963. s.allUniforms(this.chunks, 'opacity', 1),
  20964. t,
  20965. function () {
  20966. this.hidden ||
  20967. this.chunks.forEach(function (e) {
  20968. e.material.transparent = !1
  20969. })
  20970. }.bind(this),
  20971. i,
  20972. h.easeInOutQuad
  20973. )
  20974. }
  20975. }),
  20976. (n.prototype.toggle = function (e, t) {
  20977. ;(e = void 0 === e ? this.hidden : e), e ? this.show(t) : this.hide(t)
  20978. }),
  20979. (n.prototype.containsPoint = function (e) {
  20980. return this.collider.children.some(function (t) {
  20981. return (
  20982. t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  20983. t.geometry.boundingBox.containsPoint(e)
  20984. )
  20985. })
  20986. }),
  20987. (n.prototype.distanceToPoint = function (e) {
  20988. var t = null,
  20989. i = 1 / 0
  20990. return (
  20991. this.collider.children.forEach(function (n) {
  20992. n.geometry.boundingBox || n.geometry.computeBoundingBox()
  20993. var r = n.geometry.boundingBox.distanceToPoint(e)
  20994. ;(!t || i > r) && ((i = r), (t = n))
  20995. }),
  20996. i
  20997. )
  20998. }),
  20999. (n.prototype.addChunk = function (e) {
  21000. ;(e.renderOrder = u.ghostFloor),
  21001. this.add(e),
  21002. this.chunks.push(e),
  21003. this.boundingBox.union(e.geometry.boundingBox),
  21004. (this.size = this.boundingBox.size()),
  21005. this.colliderBuilder.add(e.geometry)
  21006. }),
  21007. (n.prototype.addPano = function (e) {
  21008. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker)
  21009. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  21010. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  21011. var t = new r.Vector3(1, 1, 1),
  21012. i = new r.Box3().setFromCenterAndSize(e.position, t)
  21013. this.boundingBox.union(i)
  21014. }
  21015. }),
  21016. (n.prototype.build = function () {
  21017. ;(this.collider = this.colliderBuilder.build(!0)),
  21018. this.add(this.collider),
  21019. (this.center = this.boundingBox.center()),
  21020. this.conservativeBoundingBox.copy(this.boundingBox),
  21021. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  21022. this.collider.children.map(function (e) {
  21023. return e.geometry.boundingBox.min.y
  21024. }),
  21025. 5
  21026. )),
  21027. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  21028. this.collider.children.map(function (e) {
  21029. return e.geometry.boundingBox.max.y
  21030. }),
  21031. 5
  21032. ))
  21033. this.colliderBuilder = null
  21034. }),
  21035. (n.prototype.toShortString = function () {
  21036. return a.nth(this.floorIndex + 1)
  21037. }),
  21038. (n.prototype.toString = function () {
  21039. return this.name
  21040. }),
  21041. (n.prototype.constructor = n), //add
  21042. (t.exports = n)
  21043. },
  21044. {
  21045. '../enum/RenderOrder': 42,
  21046. '../localization/localize': 108,
  21047. './strings-cn-CN': 109,
  21048. '../objects/Panorama': 148,
  21049. '../settings': 166,
  21050. '../util/common': 185,
  21051. '../util/easing': 186,
  21052. '../util/lerp': 188,
  21053. '../util/transitions': 195,
  21054. './ChunkedCollider': 145,
  21055. three: 217
  21056. }
  21057. ],
  21058. 147: [
  21059. function (e, t, i) {
  21060. 'use strict'
  21061. function n(e) {
  21062. ;(this.player = e), (this.obj3d = null), (this.UP = new r.Vector3(0, 1, 0))
  21063. }
  21064. var r = e('three'),
  21065. o = e('../settings')
  21066. ;(n.prototype.prefs = {
  21067. linewidth: 3,
  21068. height: 0.07,
  21069. opacity: 0.45,
  21070. endScale: 0.05
  21071. }),
  21072. (n.prototype.discard = function () {
  21073. if (this.obj3d) {
  21074. var e = this.obj3d.parent
  21075. e && e.remove(this.obj3d)
  21076. }
  21077. this.obj3d = null
  21078. }),
  21079. (n.prototype.draw = function () {
  21080. if ((this.discard(), o.showNeighbors)) {
  21081. var e = this.player.currentPano.floor
  21082. this.obj3d = new r.Object3D()
  21083. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  21084. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position)
  21085. i.y += this.prefs.height
  21086. var n = 0.1525,
  21087. a = 0.127,
  21088. s = 0.0127,
  21089. l = 0.1,
  21090. c = 0.19,
  21091. h = 0.2032,
  21092. u = 0.2286,
  21093. d = 0.255,
  21094. p = new r.Matrix4()
  21095. for (var f in t)
  21096. if (t[f]) {
  21097. var g = this.player.model.panos.get(f),
  21098. m =
  21099. (g.position.clone().sub(this.player.model.position),
  21100. g.position.clone().sub(g.floorPosition)),
  21101. v = g.floorPosition.clone().sub(this.player.model.position)
  21102. v.y += this.prefs.height
  21103. var A = new r.Geometry()
  21104. A.vertices.push(
  21105. new r.Vector3(0, -s, 0),
  21106. new r.Vector3(-s, 0, 0),
  21107. new r.Vector3(0, s, 0),
  21108. new r.Vector3(s, 0, 0),
  21109. new r.Vector3(0, -s, 0)
  21110. ),
  21111. A.vertices.push(
  21112. new r.Vector3(0, -d, 0),
  21113. new r.Vector3(d, -d, 0),
  21114. new r.Vector3(d, n, 0),
  21115. new r.Vector3(-n, n, 0),
  21116. new r.Vector3(-n, a, 0),
  21117. new r.Vector3(-c, l, 0),
  21118. new r.Vector3(-c, -h, 0),
  21119. new r.Vector3(-n, -u, 0),
  21120. new r.Vector3(-n, -d, 0),
  21121. new r.Vector3(0, -d, 0)
  21122. ),
  21123. p.identity().setPosition(m),
  21124. A.applyMatrix(p),
  21125. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  21126. A.vertices.push(
  21127. new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  21128. new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  21129. new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  21130. new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  21131. ),
  21132. p.lookAt(v, i, this.UP).setPosition(v),
  21133. A.applyMatrix(p),
  21134. A.vertices.push(v, i)
  21135. var y = new r.Line(
  21136. A,
  21137. new r.LineBasicMaterial({
  21138. color: g.debugColor.getHex(),
  21139. transparent: !0,
  21140. opacity: this.prefs.opacity,
  21141. depthWrite: !1,
  21142. name: 'sLine' + f,
  21143. linewidth: this.prefs.linewidth
  21144. })
  21145. )
  21146. this.obj3d.add(y)
  21147. }
  21148. e.add(this.obj3d)
  21149. }
  21150. }),
  21151. (n.prototype.update = function () {
  21152. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  21153. }),
  21154. (t.exports = n)
  21155. },
  21156. {
  21157. '../settings': 166,
  21158. three: 217
  21159. }
  21160. ],
  21161. 148: [
  21162. function (e, t, i) {
  21163. ;(function (i) {
  21164. 'use strict'
  21165. function n(e, t, i, n) {
  21166. ;(this.model = e),
  21167. (this.id = t),
  21168. (this.alignmentType = i.alignmentType || l.ALIGNED),
  21169. (this.neighbourUUIDs = i.neighbours || null),
  21170. (this.neighbourPanos = null),
  21171. (this.floor = null),
  21172. (this.floorIndex = i.floor),
  21173. (this.failedLoadingAt = 0),
  21174. (this.maxLoadRetries = 4),
  21175. (this.origin = i.position.clone()),
  21176. (this.position =
  21177. this.alignmentType === l.UNALIGNED ? new r.Vector3(0, -5, 0) : i.position.clone()),
  21178. (this.quaternion = i.quaternion.clone()),
  21179. (this.skyboxMesh = new r.Mesh(E)),
  21180. this.skyboxMesh.position.copy(this.position),
  21181. this.skyboxMesh.quaternion.copy(this.quaternion),
  21182. (this.skyboxMesh.name = 'skybox'),
  21183. (this.skyboxMesh.visible = !1),
  21184. this.skyboxMesh.updateMatrix(),
  21185. this.skyboxMesh.updateMatrixWorld(),
  21186. (this.marker = null),
  21187. (this.showFloorMarker = !window.DATA.hideFloorMarker)
  21188. if (this.isAligned()) {
  21189. ;(this.marker = new r.Mesh(
  21190. b,
  21191. new r.MeshBasicMaterial({
  21192. map: w,
  21193. side: r.DoubleSide,
  21194. opacity: 0,
  21195. transparent: !0,
  21196. depthWrite: !1
  21197. })
  21198. )),
  21199. (this.marker.visible = false) //改:先不显示,之后根据opacity显示
  21200. ;(this.marker.renderOrder = s.panoMarker),
  21201. (this.marker.name = 'marker'),
  21202. (this.marker.pano = this),
  21203. this.marker.layers.set(v.PANOMARKERS),
  21204. this.marker.updateMatrixWorld()
  21205. if (!window.DATA.hideFloorMarker) {
  21206. //xzw
  21207. let opa = this.marker.material.opacity
  21208. Object.defineProperty(this.marker.material, 'opacity', {
  21209. get: function () {
  21210. return opa
  21211. },
  21212. set: o => {
  21213. opa = o
  21214. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  21215. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  21216. //console.log(o,this.id,this.marker.visible)
  21217. }
  21218. })
  21219. }
  21220. a.colorMarkerOnLoad &&
  21221. this.on('load', function () {
  21222. this.marker.material.color.set(65280)
  21223. })
  21224. }
  21225. ;(this.debugColor = new r.Color().setHSL(
  21226. 0.06 + 0.53 * Math.random(),
  21227. 0.8 + 0.2 * Math.random(),
  21228. 0.5 + 0.2 * Math.random()
  21229. )),
  21230. (this.floorPosition = i.puck ? i.puck.clone() : null),
  21231. (this.tiled = n),
  21232. this.tiled
  21233. ? (this.solidSkybox = null)
  21234. : ((this.solidSkybox = new r.Texture([null, null, null, null, null, null])),
  21235. (this.solidSkybox.flipY = !1),
  21236. a.minimalMemoryMode &&
  21237. ((this.solidSkybox.minFilter = r.LinearFilter),
  21238. (this.solidSkybox.magFilter = r.LinearFilter),
  21239. (this.solidSkybox.generateMipmaps = !1))),
  21240. (this.zoomed = !1),
  21241. (this.panoRenderer = null),
  21242. (this.qualityManager = null),
  21243. (this.tileDownloader = null),
  21244. (this.tiledPanoRenderTarget = null),
  21245. (this.minimumTiledPanoLoaded = !1),
  21246. (this.highestPartialTileRenderOpCompleted = 0),
  21247. (this.highestFullTileRenderOpCompleted = 0),
  21248. (this.shouldRedrawOnBaseLoaded = !1),
  21249. (this.lockUntilRenderingComplete = !1),
  21250. a.colorMarkerOnLoad &&
  21251. this.on('load', function () {
  21252. this.marker.material.color.set(65280)
  21253. })
  21254. /********************************************************************fyz改vr from徐世廷*************************************************************/
  21255. var e = new r.TextureLoader()
  21256. e.setCrossOrigin(!0)
  21257. var g = e.load('images/texture.jpg')
  21258. if (
  21259. ((this.vrMarker = new r.Mesh(
  21260. new r.OctahedronGeometry(0.1, 0),
  21261. new r.MeshLambertMaterial({
  21262. color: 16777215,
  21263. transparent: !0,
  21264. opacity: 0.75,
  21265. map: g
  21266. })
  21267. )),
  21268. (this.vrMarker.boluoType = 'vr'),
  21269. (this.vrMarker.position.z = 1),
  21270. (this.vrMarker.enabled = !0),
  21271. (this.vrMarker.visible = !1),
  21272. (window.vrMarkers = window.vrMarkers || []),
  21273. window.vrMarkers.push(this.vrMarker),
  21274. this.marker && this.marker.add(this.vrMarker),
  21275. a.showAxis &&
  21276. (this.skyboxMesh.add(
  21277. new r.ArrowHelper(new r.Vector3(0, 1, 0), new r.Vector3(0, 0, 0), 1, 255)
  21278. ),
  21279. this.skyboxMesh.add(
  21280. new r.ArrowHelper(new r.Vector3(0, 0, 1), new r.Vector3(0, 0, 0), 1, 16711680)
  21281. ),
  21282. this.skyboxMesh.add(
  21283. new r.ArrowHelper(new r.Vector3(1, 0, 0), new r.Vector3(0, 0, 0), 1, 65280)
  21284. )),
  21285. this.adjustAngleEnable)
  21286. ) {
  21287. var i = new r.Quaternion()
  21288. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX),
  21289. this.skyboxMesh.quaternion.multiply(i)
  21290. var m = new r.Quaternion()
  21291. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY),
  21292. this.skyboxMesh.quaternion.multiply(m)
  21293. var n = new r.Quaternion()
  21294. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  21295. this.skyboxMesh.quaternion.multiply(n),
  21296. this.skyboxMesh.updateMatrix(),
  21297. this.skyboxMesh.updateMatrixWorld(),
  21298. this.model.updateProjectedPanos()
  21299. }
  21300. /**************************************************************************************************************************************/
  21301. }
  21302. var r = e('three'),
  21303. o = e('../util/logger'),
  21304. a = e('../settings'),
  21305. s = (e('../enum/Viewmode'), e('../enum/RenderOrder')),
  21306. l = e('../enum/AlignmentType'),
  21307. c = (e('../util/common'), e('../util/transitions')),
  21308. h = e('../util/lerp'),
  21309. u = e('../util/ajax'),
  21310. d = e('../util/texture'),
  21311. p = e('../util/panorama'),
  21312. f = (e('../enum/TileDownloaderEvents'), e('../enum/PanoramaEvents')),
  21313. g = e('../enum/PanoRendererEvents'),
  21314. m = e('../enum/PanoSizeClass'),
  21315. v = e('../enum/RenderLayers'),
  21316. A =
  21317. (e('../scene/SceneRenderer'),
  21318. e('../enum/GLCubeFaces'),
  21319. e('../exception/BasicException')),
  21320. y = e('../tile/TileUtils'),
  21321. C = e('events').EventEmitter,
  21322. I = new o(i),
  21323. E = new r.SphereBufferGeometry(0.1),
  21324. b = new r.PlaneBufferGeometry(0.35, 0.35, 1, 1),
  21325. w = d.load('images/marker.png')
  21326. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  21327. ;(n.prototype = Object.create(C.prototype)),
  21328. (n.prototype.enter = (function () {
  21329. var e = null
  21330. return function () {
  21331. this.setZoomed(!1),
  21332. this.emit('enter', {
  21333. oldPano: e,
  21334. newPano: this
  21335. }),
  21336. (e = this)
  21337. this.model.setHighMap(this) //add
  21338. }
  21339. })()),
  21340. (n.prototype.exit = function () {
  21341. this.tiled
  21342. ? (this.clearWaitDeferreds(),
  21343. (this.minimumTiledPanoLoaded = !1),
  21344. (this.tiledPanoRenderTarget = null),
  21345. this.setZoomed(!1),
  21346. this.panoRenderer.deactivateTiledPano(this),
  21347. (this.highestPartialTileRenderOpCompleted = 0),
  21348. (this.highestFullTileRenderOpCompleted = 0))
  21349. : (this.solidSkybox.dispose(),
  21350. (this.solidSkybox.loaded = !1),
  21351. (this.solidSkybox.version = 0)),
  21352. this.emit('exit')
  21353. }),
  21354. (n.prototype.hoverOn = function (e) {
  21355. this.marker &&
  21356. (c.start(
  21357. h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover),
  21358. 250
  21359. ),
  21360. a.navigation.panoScores & a.navigation.mouseDirection &&
  21361. this.addTextSprite('HIT', 12525854))
  21362. }),
  21363. (n.prototype.hoverOff = function (e) {
  21364. this.marker &&
  21365. c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250)
  21366. }),
  21367. (n.prototype.build1 = function () {
  21368. ;(this.floor =
  21369. this.floor ||
  21370. this.model.floors.get(this.floorIndex) ||
  21371. (this.model.floors.list.length == 1
  21372. ? this.model.floors.list[0]
  21373. : this.raycastToFindFloor()) ||
  21374. this.model.getFloorAtPoint(this.position)),
  21375. this.floor.addPano(this),
  21376. (this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  21377. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  21378. a.colorMarkerByFloor &&
  21379. this.marker &&
  21380. this.marker.material.color.set(this.floor.debugColor)
  21381. }),
  21382. (n.prototype.build2 = function () {
  21383. ;(this.floorPosition = this.floorPosition || this.interpolateFloorPosition()),
  21384. (this.height = this.position.distanceTo(this.floorPosition)),
  21385. this.placeMarker()
  21386. }),
  21387. (n.prototype.interpolateFloorPosition = function () {
  21388. var e = this.model.panos
  21389. .filter(n.filters.isNeighbourPanoTo(this))
  21390. .filter(function (e) {
  21391. return !!e.floorPosition
  21392. })
  21393. .sort(
  21394. function (e, t) {
  21395. return (
  21396. e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  21397. )
  21398. }.bind(this)
  21399. ),
  21400. t = this.position.clone()
  21401. return (
  21402. e.length >= 2
  21403. ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2)
  21404. : t.add(a.noMeshFloorPositionOffset),
  21405. t
  21406. )
  21407. }),
  21408. (n.prototype.raycastFloorPosition = function () {
  21409. I.warn('Performance warning: Raycasting to find floor position')
  21410. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  21411. t = e.intersectObjects(this.model.colliders)
  21412. return t.length ? t[0].point : null
  21413. }),
  21414. (n.prototype.raycastToFindFloor = (function () {
  21415. var e = [
  21416. new r.Vector3(0, -1, 0),
  21417. new r.Vector3(1, -1, 0),
  21418. new r.Vector3(0, -1, 1),
  21419. new r.Vector3(-1, -1, 0),
  21420. new r.Vector3(0, -1, -1),
  21421. new r.Vector3(1, 0, 0),
  21422. new r.Vector3(0, 0, 1),
  21423. new r.Vector3(-1, 0, 0),
  21424. new r.Vector3(0, 0, -1)
  21425. ]
  21426. return function () {
  21427. I.warn('Performance warning: Raycasting to find floor index')
  21428. for (var t = 0; t < e.length; t++) {
  21429. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  21430. n = i.intersectObjects(this.model.colliders)
  21431. if (n.length) return n[0].object.parent.parent
  21432. }
  21433. return null
  21434. }
  21435. })()),
  21436. (n.prototype.placeMarker = function () {
  21437. this.marker &&
  21438. (this.marker.position.copy(this.floorPosition),
  21439. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  21440. (this.marker.position.y += settings.markerHeight),
  21441. this.marker.lookAt(new r.Vector3(0, 1, 0).add(this.marker.position)))
  21442. }),
  21443. (n.prototype.translate = function (e) {
  21444. this.position.add(e), this.floorPosition.add(e)
  21445. }),
  21446. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  21447. new r.Vector3().addVectors(this.position, e.position).divideScalar(2)
  21448. return this.model.panos.find(
  21449. [n.filters.notIn([this, e])],
  21450. [n.sortFunctions.distanceToPoint(point)]
  21451. )
  21452. }),
  21453. (n.prototype.attachToPanoRenderer = function (e) {
  21454. ;(this.panoRenderer = e),
  21455. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  21456. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  21457. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  21458. this.panoRenderer.on(
  21459. g.UploadAttemptedForAllTiles,
  21460. this.onUploadAttemptedForAllTiles.bind(this)
  21461. )
  21462. })
  21463. var _ = {}
  21464. ;(n.prototype.getWaitDeferred = function (e) {
  21465. var t = _[this.id]
  21466. t || ((t = {}), (_[this.id] = t))
  21467. var i = t[e]
  21468. return (
  21469. i ||
  21470. ((i = {
  21471. deferred: $.Deferred(),
  21472. active: !1
  21473. }),
  21474. (t[e] = i)),
  21475. i
  21476. )
  21477. }),
  21478. (n.prototype.resetWaitDeferred = function (e) {
  21479. var t = this.getWaitDeferred(e)
  21480. ;(t.active = !1), (t.deferred = $.Deferred())
  21481. }),
  21482. (n.prototype.clearWaitDeferreds = function () {
  21483. var e = _[this.id]
  21484. e || ((e = {}), (_[this.id] = e))
  21485. for (var t in e)
  21486. if (e.hasOwnProperty(t)) {
  21487. var i = e[t]
  21488. ;(i.active = !1), (i.deferred = $.Deferred())
  21489. }
  21490. }),
  21491. (n.prototype.loadTiledPano = (function () {
  21492. var e = (new r.Vector3(), []),
  21493. t = []
  21494. return function (i, n, r, o, a, s) {
  21495. ;(null !== o && void 0 !== o) || (o = !0), (null !== a && void 0 !== a) || (a = !0)
  21496. var l = this.getWaitDeferred(i),
  21497. c = l.deferred,
  21498. h = null,
  21499. u = null
  21500. if (
  21501. (r && ('number' == typeof r ? (h = r) : ((h = r.hFov), (u = r.vFov))),
  21502. !this.isLoaded(i))
  21503. ) {
  21504. if (!l.active) {
  21505. if (((l.active = !0), r)) {
  21506. var d = y.matchingTilesInDirection(this, i, n, h, u)
  21507. ;(e[this.id + ':' + i] = {
  21508. tileCount: 0,
  21509. targetTileCount: d
  21510. }),
  21511. I.info('Loading partial pano: ' + this.id + ' with ' + d + ' tiles')
  21512. }
  21513. t[this.id] ||
  21514. ((t[this.id] = !0),
  21515. this.on(
  21516. f.LoadComplete,
  21517. function (e, t) {
  21518. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  21519. var i = this.getWaitDeferred(e).deferred
  21520. i &&
  21521. 'pending' === i.state() &&
  21522. this.highestPartialTileRenderOpCompleted >= e &&
  21523. (i.resolve(e, t), this.resetWaitDeferred(e))
  21524. }.bind(this)
  21525. ),
  21526. this.on(
  21527. f.LoadFailed,
  21528. function (e) {
  21529. var t = this.getWaitDeferred(e).deferred
  21530. t &&
  21531. 'pending' === t.state() &&
  21532. this.highestPartialTileRenderOpCompleted >= e &&
  21533. (t.reject(e), this.resetWaitDeferred(e))
  21534. }.bind(this)
  21535. ),
  21536. this.on(
  21537. f.TileLoaded,
  21538. function (t, i, n) {
  21539. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  21540. var r = this.getWaitDeferred(t).deferred
  21541. if (r && 'pending' === r.state()) {
  21542. r.notify(t, i, n)
  21543. var o = e[this.id + ':' + t]
  21544. o &&
  21545. (o.tileCount++,
  21546. o.tileCount === o.targetTileCount &&
  21547. (this.onPanoRendered(this.id, t, n, !0),
  21548. r.resolve(t, n),
  21549. this.resetWaitDeferred(t)))
  21550. }
  21551. }.bind(this)
  21552. ))
  21553. }
  21554. this.tileDownloader.clearForceQueue(),
  21555. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  21556. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(
  21557. this,
  21558. Math.min(2048, this.qualityManager.getMaxNavPanoSize()),
  21559. o
  21560. )), //不要超过2048否则漫游到下一个点时卡顿
  21561. this.panoRenderer.renderPanoTiles(this.id, n, a)
  21562. }
  21563. return c.promise()
  21564. }
  21565. })()),
  21566. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  21567. if (e === this.id) {
  21568. var n = this.qualityManager.getPanoSize(m.BASE)
  21569. t === n &&
  21570. this.shouldRedrawOnBaseLoaded &&
  21571. ((this.shouldRedrawOnBaseLoaded = !1),
  21572. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  21573. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  21574. }
  21575. }),
  21576. (n.prototype.onTileRendered = function (e, t, i, n) {
  21577. e === this.id && this.emit(f.TileLoaded, t, i, n)
  21578. }),
  21579. (n.prototype.onPanoRendered = function (e, t, i, n) {
  21580. e === this.id &&
  21581. ((this.minimumTiledPanoLoaded = !0),
  21582. this.updateSkyboxForZoomLevel(),
  21583. t > this.highestPartialTileRenderOpCompleted &&
  21584. (this.highestPartialTileRenderOpCompleted = t),
  21585. !n &&
  21586. t > this.highestFullTileRenderOpCompleted &&
  21587. (this.highestFullTileRenderOpCompleted = t),
  21588. this.emit('load', t),
  21589. this.model.emit('load', this),
  21590. this.emit(f.LoadComplete, t, i))
  21591. }),
  21592. (n.prototype.setZoomed = function (e) {
  21593. ;(this.zoomed = e), this.updateSkyboxForZoomLevel()
  21594. if (e) {
  21595. //add
  21596. if (player.qualityManager.getNavZoomClass() != '1k') {
  21597. this.model.showHighMap()
  21598. }
  21599. } else {
  21600. this.model.hideHighMap()
  21601. }
  21602. }),
  21603. (n.prototype.ensureSkyboxReadyForRender = function () {
  21604. this.tiled ||
  21605. (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  21606. (this.solidSkybox.loaded = !0))
  21607. }),
  21608. (n.prototype.updateSkyboxForZoomLevel = function () {
  21609. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  21610. }),
  21611. (n.prototype.getSkyboxTexture = function () {
  21612. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  21613. if (!this.tiled) {
  21614. return this.solidSkybox
  21615. }
  21616. if (this.minimumTiledPanoLoaded) {
  21617. if (
  21618. this.zoomed &&
  21619. (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize ||
  21620. player.qualityManager.getNavZoomClass() == '4k')
  21621. ) {
  21622. //change 如果放大后和不放大都是2k就不用这个
  21623. return this.panoRenderer.zoomRenderTarget.texture
  21624. } else {
  21625. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping //add
  21626. return this.tiledPanoRenderTarget.texture
  21627. }
  21628. } else {
  21629. return null
  21630. }
  21631. }),
  21632. (n.prototype.onTileRenderFail = function (e, t, i) {
  21633. e === this.id && this.emit(f.LoadFailed, t)
  21634. }),
  21635. (n.prototype.isLoaded = function (e) {
  21636. if (this.tiled) {
  21637. if (e && 'string' == typeof e)
  21638. throw new A(
  21639. 'Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass'
  21640. )
  21641. return (
  21642. !!this.minimumTiledPanoLoaded &&
  21643. (!e || this.highestPartialTileRenderOpCompleted >= e)
  21644. )
  21645. }
  21646. if (e && 'number' == typeof e)
  21647. throw new A(
  21648. 'Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.'
  21649. )
  21650. return !!this.solidSkybox.high || e in this.solidSkybox
  21651. }),
  21652. (n.prototype.loadCube = function (e) {
  21653. if (this.isLoaded(e)) return I.info('Skipping load of pano, already loaded'), $.when()
  21654. this.emit('loading', e), this.model.emit('loading', this)
  21655. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  21656. i = t.filter(function (e) {
  21657. return !e
  21658. })
  21659. 'low' === e &&
  21660. i.length > 0 &&
  21661. (I.info('Pano', this.id, 'not available in low res, loading high res right away'),
  21662. (e = 'high'),
  21663. (t = p.getCubemapUrls(this.model.urls, this.id, e)))
  21664. var n = 0,
  21665. r = [0, 1, 2, 3, 4, 5].map(
  21666. function (e, i, n) {
  21667. return u.getImage(t[i])
  21668. }.bind(this)
  21669. )
  21670. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  21671. function (t, i, n, r, o, a) {
  21672. return (
  21673. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  21674. ('high' !== e && this.solidSkybox.high) ||
  21675. ((this.solidSkybox.image = this.solidSkybox[e]),
  21676. (this.solidSkybox.low = null)),
  21677. (this.solidSkybox.needsUpdate = !0),
  21678. this.emit('load', e),
  21679. this.model.emit('load', this),
  21680. this
  21681. )
  21682. }.bind(this),
  21683. function () {
  21684. I.error('Downloading cubemap for pano', this.id, 'failed'),
  21685. (this.failedLoadingAt = Date.now())
  21686. }.bind(this),
  21687. function () {
  21688. return $.when(++n, 6)
  21689. }
  21690. )
  21691. }),
  21692. (n.raycastsSkipped = 0),
  21693. (n.raycastsDone = 0),
  21694. (n.prototype.findNeighourPanos = function () {
  21695. return (
  21696. this.model.panos.setNeighbour(this.id, this.id, !1),
  21697. this.model.panos.forEach(
  21698. function (e) {
  21699. if (
  21700. e !== this &&
  21701. (!this.model.panos.neighbourMap[this.id] ||
  21702. void 0 === this.model.panos.neighbourMap[this.id][e.id])
  21703. ) {
  21704. var t = this.position.distanceTo(e.position)
  21705. if (t > a.panoramaNeighbourMaxDistance)
  21706. return this.model.panos.setNeighbour(this, e, !1), void n.raycastsSkipped++
  21707. var i = e.position.clone().sub(this.position).normalize(),
  21708. o = new r.Raycaster(this.position, i.clone(), 0, t),
  21709. s = o.intersectObjects(this.model.colliders)
  21710. n.raycastsDone++,
  21711. this.model.panos.setNeighbour(this, e, 0 === s.length),
  21712. a.showNeighbourRaycasts &&
  21713. (s.length
  21714. ? this.floor.model.add(
  21715. new r.ArrowHelper(i, this.position, s[0].distance, 16711680)
  21716. )
  21717. : this.floor.model.add(
  21718. new r.ArrowHelper(i, this.position, t, 16777215, 0, 0)
  21719. ))
  21720. }
  21721. }.bind(this)
  21722. ),
  21723. this.model.panos.neighbourMap[this.id]
  21724. )
  21725. }),
  21726. (n.prototype.worldPosition = function () {
  21727. return this.position
  21728. }),
  21729. (n.prototype.addLabel = function () {
  21730. this.removeLabel()
  21731. this.label = new TextSprite({
  21732. sizeInfo: {
  21733. minSize: 100,
  21734. maxSize: 200,
  21735. nearBound: 0.7,
  21736. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  21737. farBoundPlan: 100
  21738. },
  21739. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  21740. textColor: { r: 0, g: 0, b: 0, a: 1 },
  21741. borderRadius: 15,
  21742. renderOrder: 5,
  21743. text: this.id //`${this.id}-f${this.floorIndex}`
  21744. })
  21745. let position = this.floorPosition.clone()
  21746. position.y += 0.2
  21747. this.label.position.copy(position)
  21748. this.floor.add(this.label)
  21749. }),
  21750. (n.prototype.removeLabel = function () {
  21751. this.label &&
  21752. (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  21753. }),
  21754. /* n.prototype.addTextSprite = function(e, t) {
  21755. this.removeTextSprite();
  21756. var i = document.createElement("canvas")
  21757. , n = i.getContext("2d");
  21758. i.width = 256,
  21759. i.height = 256;
  21760. var o = "Arial"
  21761. , a = 60;
  21762. n.font = "bold " + a + "px " + o,
  21763. n.fillStyle = "white";
  21764. var s = n.measureText(e).width;
  21765. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  21766. var l = new r.Texture(i);
  21767. l.needsUpdate = !0;
  21768. var c = new r.SpriteMaterial({
  21769. map: l,
  21770. color: t || 16428055
  21771. });
  21772. this.text3d = new r.Sprite(c),
  21773. this.text3d.position.copy(this.skyboxMesh.position),
  21774. this.floor.add(this.text3d)
  21775. }
  21776. ,
  21777. n.prototype.removeTextSprite = function() {
  21778. this.text3d && (this.floor.remove(this.text3d),
  21779. this.text3d = null)
  21780. }*/
  21781. (n.prototype.isAligned = function () {
  21782. return this.alignmentType === l.ALIGNED
  21783. }),
  21784. (n.filters = {
  21785. inDirection: function (e, t, i) {
  21786. return function (n) {
  21787. var r = n.position.clone().sub(e).normalize()
  21788. return r.dot(t) > i
  21789. }
  21790. },
  21791. inFloorDirection: function (e, t, i) {
  21792. return function (n) {
  21793. var r = n.floorPosition.clone().sub(e).normalize()
  21794. return r.dot(t) > i
  21795. }
  21796. },
  21797. inPanoDirection: function (e, t, i) {
  21798. return (
  21799. (i = a.navigation.panoScores ? a.navigation.filterStrictness : i),
  21800. function (n) {
  21801. var r = n.floorPosition.clone().sub(e).normalize(),
  21802. o = n.position.clone().sub(e).normalize()
  21803. return r.dot(t) > i || o.dot(t) > i
  21804. }
  21805. )
  21806. },
  21807. atFloor: function (e) {
  21808. return function (t) {
  21809. return !e || t.floor === e
  21810. }
  21811. },
  21812. not: function (e) {
  21813. return function (t) {
  21814. return t !== e
  21815. }
  21816. },
  21817. notIn: function (e) {
  21818. return function (t) {
  21819. return e.indexOf(t) === -1
  21820. }
  21821. },
  21822. isLoaded: function () {
  21823. return function (e) {
  21824. return e.isLoaded()
  21825. }
  21826. },
  21827. isNotLoaded: function () {
  21828. return function (e) {
  21829. return !e.isLoaded()
  21830. }
  21831. },
  21832. isCloseEnoughTo: function (e, t) {
  21833. return function (i) {
  21834. return e.distanceTo(i.floorPosition) < t
  21835. }
  21836. },
  21837. hasMinimumHeightDifferenceTo: function (e, t) {
  21838. return function (i) {
  21839. return Math.abs(i.position.y - e.y) > t
  21840. }
  21841. },
  21842. isNotBehindNormal: function (e, t) {
  21843. var i = new r.Vector3()
  21844. return (
  21845. (t = t.clone()),
  21846. function (n) {
  21847. var r = i.copy(n.position).sub(e).normalize()
  21848. return r.dot(t) > 0
  21849. }
  21850. )
  21851. },
  21852. isNeighbourPanoTo: function (e) {
  21853. return function (t) {
  21854. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  21855. }
  21856. },
  21857. isNeighbourOfNeighbourTo: function (e) {
  21858. return function (t) {
  21859. return (
  21860. !!e.neighbourPanos[t.id] ||
  21861. e.neighbourUUIDs.some(function (i) {
  21862. var n = e.model.panos.get(i)
  21863. return !!n && n.neighbourPanos[t.id]
  21864. })
  21865. )
  21866. }
  21867. },
  21868. isNotRecentlyFailed: function (e) {
  21869. return function (t) {
  21870. return Date.now() - t.failedLoadingAt > e
  21871. }
  21872. },
  21873. isOnVisibleFloor: function () {
  21874. return function (e) {
  21875. return !e.floor.hidden
  21876. }
  21877. },
  21878. isPanoAligned: function () {
  21879. return function (e) {
  21880. return e.isAligned()
  21881. }
  21882. }
  21883. }),
  21884. (n.sortFunctions = {
  21885. distanceToPoint: function (e) {
  21886. return function (t, i) {
  21887. return t.position.distanceTo(e) - i.position.distanceTo(e)
  21888. }
  21889. },
  21890. floorDistanceToPoint: function (e) {
  21891. return function (t, i) {
  21892. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  21893. }
  21894. },
  21895. choose: function (e) {
  21896. return function (t, i) {
  21897. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  21898. }
  21899. }
  21900. }),
  21901. (n.scoreFunctions = {
  21902. distance: function (e, t) {
  21903. return (
  21904. (t = t || a.navigation.distanceFactor),
  21905. function (i) {
  21906. return e ? e.position.distanceTo(i.position) * t : 0
  21907. }
  21908. )
  21909. },
  21910. distanceSquared: function (e, t) {
  21911. return (
  21912. (t = t || a.navigation.distanceFactor),
  21913. function (i) {
  21914. return e ? e.position.distanceToSquared(i.position) * t : 0
  21915. }
  21916. )
  21917. },
  21918. direction: function (e, t) {
  21919. return function (i) {
  21920. var n = i.position.clone().sub(e).normalize()
  21921. return n.dot(t) * a.navigation.directionFactor
  21922. }
  21923. },
  21924. angle: function (e, t) {
  21925. return function (i) {
  21926. var n = i.position.clone().sub(e).normalize()
  21927. return n.angleTo(t) * a.navigation.angleFactor
  21928. }
  21929. },
  21930. inFieldOfView: function (e, t) {
  21931. return function (i) {
  21932. var n = i.position.clone().sub(e).normalize()
  21933. return n.dot(t) > 0.75 ? 10 : -1
  21934. }
  21935. },
  21936. optionality: function (e) {
  21937. return function (t) {
  21938. var i = t.neighbourUUIDs.filter(function (t) {
  21939. return !(t in e.neighbourUUIDs) && t !== e.id
  21940. })
  21941. return i.length * a.navigation.optionalityFactor
  21942. }
  21943. },
  21944. penalizeHeightDifferenceUnder: function (e, t) {
  21945. return function (i) {
  21946. return e.y - i.position.y < t ? -20 : 0
  21947. }
  21948. }
  21949. }),
  21950. (t.exports = n)
  21951. }).call(this, '/js/objects/Panorama.js')
  21952. },
  21953. {
  21954. '../enum/AlignmentType': 17,
  21955. '../enum/GLCubeFaces': 25,
  21956. '../enum/PanoRendererEvents': 35,
  21957. '../enum/PanoSizeClass': 36,
  21958. '../enum/PanoramaEvents': 37,
  21959. '../enum/RenderLayers': 41,
  21960. '../enum/RenderOrder': 42,
  21961. '../enum/TileDownloaderEvents': 45,
  21962. '../enum/Viewmode': 51,
  21963. '../exception/BasicException': 55,
  21964. '../scene/SceneRenderer': 158,
  21965. '../settings': 166,
  21966. '../tile/TileUtils': 174,
  21967. '../util/ajax': 181,
  21968. '../util/common': 185,
  21969. '../util/lerp': 188,
  21970. '../util/logger': 189,
  21971. '../util/panorama': 191,
  21972. '../util/texture': 194,
  21973. '../util/transitions': 195,
  21974. events: 202,
  21975. three: 217
  21976. }
  21977. ],
  21978. 149: [
  21979. function (e, t, i) {
  21980. 'use strict'
  21981. function n(e) {
  21982. var t = r.UniformsUtils.clone(c.waypoint.uniforms)
  21983. ;(t.map.value = d),
  21984. (t.opacity.value = 0),
  21985. t.color.value.set(o.reticuleColor),
  21986. (t.showMouseMarker = !window.DATA.hideMouseMarker)
  21987. r.Mesh.call(
  21988. this,
  21989. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  21990. new r.RawShaderMaterial({
  21991. side: r.DoubleSide,
  21992. depthWrite: !1,
  21993. depthTest: !1,
  21994. transparent: !0,
  21995. vertexShader: c.waypoint.vertexShader,
  21996. fragmentShader: c.waypoint.fragmentShader,
  21997. uniforms: t,
  21998. name: 'waypoint',
  21999. opacity: 0,
  22000. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  22001. })
  22002. ),
  22003. this.layers.set(h.RETICULE),
  22004. (this.renderOrder = u.reticule),
  22005. (this.player = e),
  22006. (this.direction = new r.Vector3()),
  22007. (this.hidden = !0),
  22008. (this.mouseLastMoveTime = Date.now())
  22009. }
  22010. var r = e('three'),
  22011. o = e('../settings'),
  22012. a = e('../util/transitions'),
  22013. s = e('../util/texture'),
  22014. l = e('../util/lerp'),
  22015. c = e('../shaders'),
  22016. h = e('../enum/RenderLayers'),
  22017. u = e('../enum/RenderOrder'),
  22018. d = s.load('images/reticule.png')
  22019. d.anisotropy = browser.isMobile() ? 1 : 4 //各向异性
  22020. ;(n.prototype = Object.create(r.Mesh.prototype)),
  22021. (n.prototype.move = function (e, t, i) {
  22022. ;(this.hidden = i), (this.mouseLastMoveTime = Date.now())
  22023. }),
  22024. (n.prototype.hide = function () {
  22025. this.hidden ||
  22026. ((this.hidden = !0),
  22027. a.start(
  22028. l.property(this.material.uniforms.opacity, 'value', 0),
  22029. o.reticuleOpacityTransitionTime
  22030. ))
  22031. }),
  22032. (n.prototype.show = function () {
  22033. ;(this.hidden = !1),
  22034. this.material.opacity <= 0 &&
  22035. a.start(
  22036. l.property(
  22037. this.material.uniforms.opacity,
  22038. 'value',
  22039. o[this.player.mode].reticuleOpacity
  22040. ),
  22041. o.reticuleOpacityTransitionTime
  22042. )
  22043. }),
  22044. (n.prototype.update = function () {
  22045. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout &&
  22046. !this.hidden &&
  22047. this.hide()
  22048. }),
  22049. (n.prototype.updatePosition = function (e, t) {
  22050. if (!this.hidden) {
  22051. if (!t) return this.hide()
  22052. var i = t.point,
  22053. n = e.distanceTo(i),
  22054. r = 1 + 0.01 * n
  22055. n < 1 && (r -= 1 - n),
  22056. this.show(),
  22057. this.scale.set(r, r, r),
  22058. (this.direction = this.direction.multiplyScalar(0.8)),
  22059. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  22060. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  22061. this.lookAt(this.position.clone().add(this.direction))
  22062. }
  22063. }),
  22064. (n.prototype.writeAstag = function () {
  22065. var e =
  22066. Math.floor(4294967296 * (1 + Math.random())).toString(16) +
  22067. Math.floor(16 * (1 + Math.random())).toString(16),
  22068. t = new Date()
  22069. this.tagCount = 'undefined' == typeof this.tagCount ? 1 : this.tagCount + 1
  22070. var i = {
  22071. enabled: !0,
  22072. version: '0',
  22073. created: t.toISOString(),
  22074. created_by: 'APITest',
  22075. position: this.position.clone(),
  22076. stem: {
  22077. enabled: o.tags.pole.enabled,
  22078. direction: this.direction.multiplyScalar(o.tags.pole.height)
  22079. },
  22080. label: 'tag ' + this.tagCount,
  22081. description: 'Description ' + e,
  22082. floor: (function (e) {
  22083. if (e.currentFloor) {
  22084. var t = e.floors.indexOf(e.currentFloor)
  22085. return t > -1 ? t : void 0
  22086. }
  22087. })(this.player.model),
  22088. type: 'info',
  22089. metadata: {
  22090. preferred_camera: {
  22091. mode: this.player.mode
  22092. }
  22093. }
  22094. }
  22095. console.log('--------------------------'), console.log(JSON.stringify(i))
  22096. var n = this.player.model.addtag(e, i).build()
  22097. n &&
  22098. (n.disc && this.player.tagDiscs.push(n.disc),
  22099. n.visible || n.show(o.tags.startup.fadeInDuration))
  22100. }),
  22101. (t.exports = n)
  22102. },
  22103. {
  22104. '../enum/RenderLayers': 41,
  22105. '../enum/RenderOrder': 42,
  22106. '../settings': 166,
  22107. '../shaders': 167,
  22108. '../util/lerp': 188,
  22109. '../util/texture': 194,
  22110. '../util/transitions': 195,
  22111. three: 217
  22112. }
  22113. ],
  22114. 150: [
  22115. function (e, t, i) {
  22116. 'use strict'
  22117. function n(e, t) {
  22118. ;(this.chunks = []),
  22119. (this.floorId = e),
  22120. (this.roomId = t),
  22121. (this.position = new r.Vector3())
  22122. }
  22123. var r = e('three')
  22124. ;(n.prototype.addChunk = function (e) {
  22125. this.chunks.push(e)
  22126. }),
  22127. (n.prototype.calcBoundaries = function () {
  22128. for (
  22129. var e = new r.Vector3(),
  22130. t = new r.Vector3(0, 0, 0),
  22131. i = new r.Vector3(0, 0, 0),
  22132. n = new r.Vector3(0, 0, 0),
  22133. o = 0,
  22134. a = 0;
  22135. a < this.chunks.length;
  22136. a++
  22137. ) {
  22138. var s = this.chunks[a],
  22139. l = s.geometry.attributes.position
  22140. if (l)
  22141. for (var c = 0; c < l.array.length; c += 3)
  22142. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  22143. t.add(e),
  22144. 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)),
  22145. o++
  22146. }
  22147. o > 0 ? (t.multiplyScalar(1 / o), (this.average = t)) : (this.average = null),
  22148. (this.boundsMax = i),
  22149. (this.boundsMin = n),
  22150. (this.center = new r.Vector3()),
  22151. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n)
  22152. }),
  22153. (t.exports = n)
  22154. },
  22155. {
  22156. three: 217
  22157. }
  22158. ],
  22159. 151: [
  22160. function (e, t, i) {
  22161. ;(function (i) {
  22162. 'use strict'
  22163. function n(e, t, i) {
  22164. ;(this.obj3d = null),
  22165. (this.nodes = []),
  22166. (this.colorHull = []),
  22167. (this.shortPaths = {}),
  22168. (this.floorHull = null),
  22169. (this.cameraHull = null),
  22170. (this.floorPathDistance = 0),
  22171. (this.floorCurvePoints = null),
  22172. (this.floorCurveColors = null),
  22173. (this.camCurvePoints = null),
  22174. (this.warpDestHeroLoc = null),
  22175. (this.warpDestPano = null),
  22176. (this.warpPathPoints = null),
  22177. (this.warpPathLengths = [0]),
  22178. (this.warpLength = 0),
  22179. (this.closeWarpDistance = 4),
  22180. (this.UP = A.UP.clone()),
  22181. (this.longestStep = 0),
  22182. (this.upcomingTransType = null),
  22183. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  22184. (this.prevNextDist = 0),
  22185. (this.nextI = 0),
  22186. (this.activeTransType = null),
  22187. (this.lastTransType = null),
  22188. (this.bunnyObj = null),
  22189. (this.director = e),
  22190. (this.player = t),
  22191. (this.playerControls = i),
  22192. (this.modelManager = t.modelManager),
  22193. this.updateModel(),
  22194. this.updateDefaultsFromModelData(),
  22195. this.bindEvents(),
  22196. (this.warping = !1),
  22197. (this.waitingToWarp = !1),
  22198. (this.warpInterrupted = !1),
  22199. (this.warpInterruptionBlackoutStyle = null),
  22200. (this.warpInterruptionTravelTime = null)
  22201. }
  22202. var r = e('three'),
  22203. o = e('../util/logger'),
  22204. a = e('../enum/Viewmode'),
  22205. s = e('../enum/RenderOrder'),
  22206. l = e('../enum/WarpStyle'),
  22207. c = e('../settings'),
  22208. h = e('../util/math'),
  22209. u = e('../util/lerp'),
  22210. d = e('../util/easing'),
  22211. p = e('../util/transitions'),
  22212. f = e('../objects/Snapshot'),
  22213. g = e('../effects'),
  22214. m = e('../shaders'),
  22215. v = (e('../gui/gui'), e('../util/texture')),
  22216. A = e('../enum/Vectors'),
  22217. y = (e('../model/ModelManager'), new o(i)),
  22218. C = e('../enum/PlayerEvents'),
  22219. I = e('../enum/BlackoutStyle'),
  22220. E = e('../enum/ModelManagerEvents'),
  22221. b = e('../constants'),
  22222. w = {
  22223. path: v.loadBase64(
  22224. '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'
  22225. ),
  22226. pathEnd: v.load('images/End.png'),
  22227. pathStart: v.loadBase64(
  22228. '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=='
  22229. )
  22230. }
  22231. ;(n.prototype.setScene = function (e) {
  22232. this.createCpm(e), this.createBunnyObj(e)
  22233. }),
  22234. (n.prototype.updateModel = function () {
  22235. this.model = this.modelManager.getActiveModel()
  22236. }),
  22237. (n.prototype.bindEvents = function () {
  22238. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  22239. }),
  22240. (n.prototype.updateDefaultsFromModelData = function () {
  22241. this.model.data
  22242. }),
  22243. (n.prototype.pointPathDistance = function (e) {
  22244. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i])
  22245. return t
  22246. }),
  22247. (n.prototype.pointPathLengths = function (e) {
  22248. for (var t = [0], i = 1; i < e.length; i += 1)
  22249. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]))
  22250. return t
  22251. }),
  22252. (n.prototype.interpAlongPath = function (e, t, i) {
  22253. var n,
  22254. o = new r.Vector3(),
  22255. a = t[t.length - 1]
  22256. if (i < 1) {
  22257. n = i * a
  22258. for (var s = 1; s < t.length; s += 1)
  22259. if (t[s] > n) {
  22260. var l = (n - t[s - 1]) / (t[s] - t[s - 1])
  22261. return o.copy(e[s]), o.sub(e[s - 1]), o.multiplyScalar(l), o.add(e[s - 1]), o
  22262. }
  22263. } else o.copy(e[e.length - 1])
  22264. return o
  22265. }),
  22266. (n.prototype.pathHeight = function () {
  22267. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  22268. }),
  22269. (n.prototype.createBunnyObj = function (e) {
  22270. this.bunnyObj ||
  22271. ((this.bunnyObj = new r.AxisHelper(0.1)),
  22272. (this.bunnyObj.visible = c.warp.showBunny)),
  22273. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  22274. e.add(this.bunnyObj)
  22275. }),
  22276. (n.prototype.createCpm = function (e) {
  22277. if (!this.currentPanoMarker) {
  22278. var t = this.makeWaypointObj(w.pathEnd, 'Current')
  22279. ;(t.material.uniforms.opacity.value = 0),
  22280. (this.currentPanoMarker = {
  22281. mesh: t,
  22282. placed: !1
  22283. })
  22284. }
  22285. this.currentPanoMarker.mesh.parent &&
  22286. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22287. this.placeCpm(),
  22288. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  22289. }),
  22290. (n.prototype.placeCpm = function () {
  22291. if (
  22292. c.path.mapGuides &&
  22293. this.player.currentPano &&
  22294. this.player.currentPano.isAligned()
  22295. ) {
  22296. var e = this.player.currentPano.floor
  22297. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  22298. (this.currentPanoMarker.mesh.parent &&
  22299. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22300. e.add(this.currentPanoMarker.mesh)),
  22301. this.currentPanoMarker.mesh.position
  22302. .copy(this.player.currentPano.floorPosition)
  22303. .sub(e.position),
  22304. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  22305. (this.currentPanoMarker.placed = !0)
  22306. } else this.popOutCpm()
  22307. }),
  22308. (n.prototype.fadeInCpm = function (e) {
  22309. ;(this.player.mode === a.PANORAMA &&
  22310. this.player.currentPano &&
  22311. !this.player.currentPano.isAligned()) ||
  22312. (c.path.mapGuides &&
  22313. this.currentPanoMarker.placed &&
  22314. p.start(
  22315. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1),
  22316. e
  22317. ))
  22318. }),
  22319. (n.prototype.fadeOutCpm = function (e) {
  22320. p.start(
  22321. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0),
  22322. e
  22323. )
  22324. }),
  22325. (n.prototype.popInCpm = function () {
  22326. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  22327. }),
  22328. (n.prototype.popOutCpm = function () {
  22329. this.fadeOutCpm(2)
  22330. }),
  22331. (n.prototype.brushPrefs = {
  22332. linewidth: 7,
  22333. strokeWidth: 15,
  22334. cvSegments: 48,
  22335. paveStep: 0.1,
  22336. paveWidth: 0.2,
  22337. lookBlendDist: 3,
  22338. maxTurn: r.Math.degToRad(2)
  22339. }),
  22340. (n.prototype.panoPathDistance = function (e) {
  22341. var t = this.model.panos
  22342. if (!e || e.length < 2) return 0
  22343. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition)
  22344. return this.pointPathDistance(i)
  22345. }),
  22346. (n.prototype.loadTileTexture = function (e) {
  22347. var t = v.load(
  22348. e,
  22349. function (t) {
  22350. ;(t.wrapS = r.RepeatWrapping),
  22351. (t.wrapT = r.RepeatWrapping),
  22352. (t.needsUpdate = !0),
  22353. y.debug('path texture "' + e + '" is ready')
  22354. },
  22355. function () {
  22356. y.error('path texture "' + e + '" failed')
  22357. }
  22358. )
  22359. return (t.mapping = r.UVMapping), t
  22360. }),
  22361. (n.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  22362. var a = {
  22363. cameraMode: n,
  22364. position: e,
  22365. quaternion: t,
  22366. panoId: i,
  22367. orthoZoom: o,
  22368. floorVisibility: r,
  22369. thumbUrl: null,
  22370. name: null
  22371. }
  22372. return new f(a)
  22373. }),
  22374. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  22375. return this.buildWarpDestinationDescriptor(
  22376. e.position,
  22377. e.quaternion,
  22378. this.getHeroId(e),
  22379. e.cameraMode,
  22380. e.floorVisibility,
  22381. e.orthoZoom
  22382. )
  22383. }),
  22384. (n.prototype.setWarpDestination = function (e) {
  22385. this.warpDestHeroLoc = e
  22386. }),
  22387. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  22388. var t = this.getHeroDescriptorByHeroIndex(e)
  22389. return null !== t && (this.setWarpDestination(t), !0)
  22390. }),
  22391. (n.prototype.setWarpDestinationByPano = function (e, t) {
  22392. var i = this.model.panos.get(e.id)
  22393. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  22394. }),
  22395. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  22396. var i = this.model.panos.get(e)
  22397. if (i) {
  22398. t = t || new r.Quaternion()
  22399. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, 'panorama', [], -1)
  22400. return this.setWarpDestination(n), !0
  22401. }
  22402. return !1
  22403. }),
  22404. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  22405. var t = this.model.heroCount()
  22406. /* if (null !== this.warpDestHeroLoc && t < 2)
  22407. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  22408. this.model.getHeroDescriptorByIndex(0); */
  22409. var i = this.model.getHeroDescriptorByIndex(e)
  22410. if (i) {
  22411. var n = i.isPano() ? i.panoId : i.cameraMode
  22412. y.debug(
  22413. 'ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' +
  22414. n +
  22415. '" out of ' +
  22416. t +
  22417. ' choices.'
  22418. )
  22419. }
  22420. return i
  22421. }),
  22422. (n.prototype.getHeroDescriptorByPano = function (e) {
  22423. var t = this.model.panos.get(e.id)
  22424. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  22425. }),
  22426. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  22427. var t = this.getHeroIndexFromPanoId(e)
  22428. return this.getHeroDescriptorByHeroIndex(t)
  22429. }),
  22430. (n.prototype.getHeroIndexFromPanoId = function (e) {
  22431. for (var t = 0; t < this.model.heroLocations.length; t++) {
  22432. var i = this.model.heroLocations[t],
  22433. n = this.getHeroId(i)
  22434. if (n && n === e) return t
  22435. }
  22436. return -1
  22437. }),
  22438. (n.prototype.getHeroPano = function (e) {
  22439. if (null === e) return y.warn('getHeroPano(): no destination'), null
  22440. var t = this.getHeroId(e),
  22441. i = this.model.panos.get(t)
  22442. return (
  22443. void 0 === i &&
  22444. ((i = null), '' !== t && y.debug('unable to find pano "' + t + '"')),
  22445. i
  22446. )
  22447. }),
  22448. (n.prototype.getHeroId = function (e) {
  22449. return e.panoId
  22450. }),
  22451. (n.prototype.setWarpDestPano = function () {
  22452. return (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  22453. }),
  22454. (n.prototype.brushToWarpPano = function (e, t) {
  22455. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1
  22456. if (
  22457. (this.warpDestHeroLoc.cameraMode !== a.PANORAMA &&
  22458. y.warn('Can only brush from pano to pano'),
  22459. !this.warpDestPano)
  22460. )
  22461. return y.info('No brush'), !1
  22462. if (!this.player.currentPano)
  22463. return y.debug('No current pano, visibility undefined'), !1
  22464. if (!this.warpDestPano) return y.info('No wPano, visibility undefined'), !1
  22465. if (!this.warpDestPano.isAligned())
  22466. return y.debug('Cannot brush to unaligned pano'), !1
  22467. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  22468. n = !0
  22469. if (this.player.currentPano.id === this.warpDestPano.id)
  22470. y.debug('Already at destination pano')
  22471. else {
  22472. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22473. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  22474. (this.obj3d = new r.Object3D()),
  22475. y.debug(
  22476. 'Brushing from "' +
  22477. this.player.currentPano.id +
  22478. '" to "' +
  22479. this.warpDestPano.id +
  22480. '" (' +
  22481. (this.nodes ? this.nodes.length : 0) +
  22482. ')'
  22483. ),
  22484. n
  22485. ? (y.info('No "walkable" route, using fall-back warp style transition'),
  22486. (e = t))
  22487. : (this.setPathHulls(this.nodes),
  22488. this.setFloorCurves(),
  22489. i &&
  22490. ('chevron' === c.path.style
  22491. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  22492. : 'ribbon' === c.path.style &&
  22493. this.obj3d.add(
  22494. this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)
  22495. ))),
  22496. this.player.currentPano.floor.add(this.obj3d)
  22497. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN,
  22498. s = e === l.STD
  22499. if (!n && (i || s)) {
  22500. if (o) {
  22501. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints)
  22502. this.obj3d.add(h)
  22503. }
  22504. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1])
  22505. this.obj3d.add(u)
  22506. }
  22507. this.appearSlow()
  22508. }
  22509. return (this.upcomingTransType = e), !n
  22510. }),
  22511. (n.prototype.findShortestPath = function (e, t) {
  22512. if (!e || !t) return null
  22513. var i = c.warp.walkExtraPanosDistance,
  22514. n = e.id + ':' + t.id + ':' + i
  22515. if (this.shortPaths.hasOwnProperty(n))
  22516. return this.shortPaths[n] ? this.shortPaths[n].slice() : null
  22517. var r = t.id + ':' + e.id + ':' + i
  22518. if (this.shortPaths.hasOwnProperty(r))
  22519. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null
  22520. var o = this.model.panos.aStarSearch(e, t)
  22521. return (
  22522. this.model.panos.includeNodesNearPath(o, i),
  22523. (this.shortPaths[n] = o ? o.slice() : null),
  22524. o
  22525. )
  22526. }),
  22527. (n.prototype.makePathHulls = function (e) {
  22528. var t,
  22529. i,
  22530. n,
  22531. r,
  22532. o,
  22533. a = 0,
  22534. s = [],
  22535. l = [],
  22536. h = [],
  22537. u = this.model.panos
  22538. ;(t = u.get(e[0])), (r = t.floor.floorIndex)
  22539. for (var d = 0; d < e.length; d += 1)
  22540. (t = u.get(e[d])),
  22541. (i = t.floorPosition.clone().sub(this.model.position)),
  22542. (i.y += this.pathHeight()),
  22543. s.push(i),
  22544. l.push(t.position.clone()),
  22545. (n = t.floor.floorIndex),
  22546. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  22547. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o))
  22548. return (
  22549. a > this.longestStep &&
  22550. ((this.longestStep = a), y.debug('path contains ' + a + ' meter segment')),
  22551. {
  22552. floor: s,
  22553. camera: l,
  22554. color: h
  22555. }
  22556. )
  22557. }),
  22558. (n.prototype.makeFloorCurves = function (e, t, i) {
  22559. var n =
  22560. this.player.mode === a.PANORAMA
  22561. ? c.path.waypointIndoorRadius
  22562. : c.path.waypointRadius,
  22563. o = this.pointPathDistance(e) - 2 * n,
  22564. s = e.slice(0),
  22565. l = s[1].clone().sub(s[0])
  22566. ;(l.y = 0),
  22567. l.normalize().multiplyScalar(n),
  22568. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  22569. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  22570. (l.y = 0),
  22571. l.normalize().multiplyScalar(n),
  22572. (s[s.length - 1] = new r.Vector3().copy(s[s.length - 1]).add(l))
  22573. var h = new r.CatmullRomCurve3(s),
  22574. u = Math.floor(o / i)
  22575. ;(u = 4 * Math.floor(u / 4)), (u = Math.max(4, u))
  22576. for (
  22577. var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3(), A = 0;
  22578. A < g.length;
  22579. A += 1
  22580. ) {
  22581. ;(f = 0), (d = g[A].distanceTo(e[0]))
  22582. for (var y = 1; y < e.length; y += 1)
  22583. v.copy(g[A]).sub(e[y]), (v.y *= 4), (p = v.length()), p < d && (f = y)
  22584. m.push(t[f])
  22585. }
  22586. return {
  22587. distance: o,
  22588. points: g,
  22589. colors: m
  22590. }
  22591. }),
  22592. (n.prototype.makeCameraCurvePoints = function (e, t) {
  22593. var i = this.pointPathDistance(e),
  22594. n = new r.CatmullRomCurve3(e)
  22595. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  22596. }),
  22597. (n.prototype.makeCameraCurveTangents = function (e, t) {
  22598. var i = this.pointPathDistance(e),
  22599. n = new r.CatmullRomCurve3(e),
  22600. o = Math.max(2, Math.floor(i / t))
  22601. o || (o = 5)
  22602. for (var a = [], s = 0; s <= o; s++) a.push(n.getTangentAt(s / o))
  22603. return a
  22604. }),
  22605. (n.prototype.setPathHulls = function (e) {
  22606. var t = this.makePathHulls(e)
  22607. ;(this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color)
  22608. }),
  22609. (n.prototype.setFloorCurves = function () {
  22610. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep)
  22611. ;(this.floorPathDistance = e.distance),
  22612. (this.floorCurvePoints = e.points),
  22613. (this.floorCurveColors = e.colors)
  22614. }),
  22615. (n.prototype.setCameraCurvePoints = function () {
  22616. this.camCurvePoints = this.makeCameraCurvePoints(
  22617. this.cameraHull,
  22618. c.warp.stepFactor * this.brushPrefs.paveStep
  22619. )
  22620. }),
  22621. (n.prototype.chooseWarpPath = function (e) {
  22622. var t,
  22623. i,
  22624. n,
  22625. o = this.playerControls.cameras[a.PANORAMA]
  22626. if (this.player.currentPano === this.warpDestPano || !e)
  22627. return (this.warpPathPoints = null), (this.warpLength = 0), !1
  22628. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22629. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  22630. ? (y.debug('warp path to unreachable node'),
  22631. (t = this.warpDestPano.position.clone().sub(o.position)),
  22632. (i = t.clone().negate()),
  22633. t.multiplyScalar(0.15).add(o.position),
  22634. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  22635. (t.y = o.position.y),
  22636. (i.y = this.warpDestPano.position.y),
  22637. (n = new r.CubicBezierCurve3(
  22638. o.position.clone(),
  22639. t,
  22640. i,
  22641. this.warpDestPano.position.clone()
  22642. )),
  22643. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  22644. : (y.debug(
  22645. 'follow warp path (path distance was ' +
  22646. this.nodes.length +
  22647. ' nodes, ' +
  22648. this.floorPathDistance +
  22649. ')'
  22650. ),
  22651. this.setCameraCurvePoints(),
  22652. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  22653. (this.warpLength = 0),
  22654. (this.warpPathLengths = [0])
  22655. for (
  22656. var s = new r.Vector3(),
  22657. l = new r.Vector3(),
  22658. h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  22659. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)),
  22660. d = 1;
  22661. d < this.warpPathPoints.length;
  22662. d += 1
  22663. ) {
  22664. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d])
  22665. var p = s.length()
  22666. s.y *= c.warp.climbEffort
  22667. var f = s.length() / p
  22668. if (d > 1) {
  22669. s.setY(0).normalize(),
  22670. l
  22671. .copy(this.warpPathPoints[d - 2])
  22672. .sub(this.warpPathPoints[d - 1])
  22673. .setY(0)
  22674. .normalize()
  22675. var g = Math.min(1, s.dot(l)),
  22676. m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h))
  22677. f = Math.max(m, f)
  22678. }
  22679. ;(this.warpLength += p * f), (this.warpPathLengths[d] = this.warpLength)
  22680. }
  22681. return !0
  22682. }),
  22683. (n.prototype.drawPathRibbon = function (e, t) {
  22684. this.bunnyObj.visible = c.warp.showBunny
  22685. for (
  22686. var i = 0.6 * c.path.ribbonWidth * 0.5,
  22687. n = new r.Vector3(),
  22688. o = new r.Vector3(0, this.pathHeight(), 0),
  22689. l = new r.Geometry(),
  22690. h = new r.Vector3(),
  22691. u = 0;
  22692. u < e.length;
  22693. u += 1
  22694. ) {
  22695. h.copy(e[u]),
  22696. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  22697. h.normalize(),
  22698. n.crossVectors(h, A.UP),
  22699. n.multiplyScalar(i)
  22700. var d = new r.Vector3().copy(e[u]).add(o)
  22701. d.sub(n),
  22702. l.vertices.push(d),
  22703. (d = new r.Vector3().copy(e[u]).add(o)),
  22704. d.add(n),
  22705. l.vertices.push(d)
  22706. }
  22707. var p,
  22708. f = 0
  22709. for (u = 0; u < e.length - 1; u += 1) {
  22710. var g = 2 * u,
  22711. v = f
  22712. f += e[u + 1].distanceTo(e[u])
  22713. var y = f,
  22714. C = t[u],
  22715. I = t[u + 1]
  22716. ;(p = new r.Face3(g, g + 1, g + 2)),
  22717. (p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)]),
  22718. l.faces.push(p),
  22719. l.faceVertexUvs[0].push([
  22720. new r.Vector2(0, v),
  22721. new r.Vector2(1, v),
  22722. new r.Vector2(0, y)
  22723. ]),
  22724. (p = new r.Face3(g + 2, g + 1, g + 3)),
  22725. (p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)]),
  22726. l.faces.push(p),
  22727. l.faceVertexUvs[0].push([
  22728. new r.Vector2(0, y),
  22729. new r.Vector2(1, v),
  22730. new r.Vector2(1, y)
  22731. ])
  22732. }
  22733. l.computeFaceNormals(), l.computeVertexNormals()
  22734. var E, b
  22735. this.player.mode === a.PANORAMA
  22736. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  22737. (b.map.value = w.path),
  22738. (b.opacity.value = 0),
  22739. b.color.value.set(c.path.color),
  22740. (E = new r.RawShaderMaterial({
  22741. side: r.DoubleSide,
  22742. depthWrite: !1,
  22743. transparent: !0,
  22744. vertexShader: m.ribbon.vertexShader,
  22745. fragmentShader: m.ribbon.fragmentShader,
  22746. uniforms: b,
  22747. name: 'ribbonT',
  22748. opacity: 0
  22749. })))
  22750. : (E = new r.MeshBasicMaterial({
  22751. color: 16777215,
  22752. side: r.DoubleSide,
  22753. name: 'ribbonOut',
  22754. vertexColors: r.VertexColors
  22755. }))
  22756. var _ = new r.Mesh(l, E)
  22757. return (
  22758. (_.name = 'ribbon'),
  22759. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  22760. _
  22761. )
  22762. }),
  22763. (n.prototype.drawPathPavement = function (e) {
  22764. for (
  22765. var t,
  22766. i = 0.25,
  22767. n = new r.Vector3(),
  22768. o = new r.Geometry(),
  22769. s = new r.Vector3(),
  22770. l = 0;
  22771. l < e.length;
  22772. l += 1
  22773. )
  22774. s.copy(e[l]),
  22775. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  22776. s.normalize(),
  22777. n.crossVectors(s, A.UP),
  22778. n.multiplyScalar(this.brushPrefs.paveWidth),
  22779. (t = new r.Vector3().copy(e[l])),
  22780. t.sub(n),
  22781. o.vertices.push(t),
  22782. o.vertices.push(new r.Vector3().copy(e[l])),
  22783. (t = new r.Vector3().copy(e[l])),
  22784. t.add(n),
  22785. o.vertices.push(t)
  22786. var h, u, d
  22787. for (l = 0; l < e.length - 1; l += 1)
  22788. (h = 3 * l + 1),
  22789. (u = l * i),
  22790. (d = u + i),
  22791. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  22792. o.faceVertexUvs[0].push([
  22793. new r.Vector2(0, u),
  22794. new r.Vector2(0.5, u),
  22795. new r.Vector2(0.5, d)
  22796. ]),
  22797. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  22798. o.faceVertexUvs[0].push([
  22799. new r.Vector2(0.5, d),
  22800. new r.Vector2(0, d),
  22801. new r.Vector2(0, u)
  22802. ]),
  22803. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  22804. o.faceVertexUvs[0].push([
  22805. new r.Vector2(0.5, d),
  22806. new r.Vector2(0.5, u),
  22807. new r.Vector2(1, u)
  22808. ]),
  22809. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  22810. o.faceVertexUvs[0].push([
  22811. new r.Vector2(0.5, d),
  22812. new r.Vector2(1, u),
  22813. new r.Vector2(1, d)
  22814. ])
  22815. var p =
  22816. this.player.mode === a.PANORAMA
  22817. ? new r.MeshBasicMaterial({
  22818. color: c.path.color,
  22819. side: r.DoubleSide,
  22820. transparent: !0,
  22821. depthWrite: !1,
  22822. opacity: 0,
  22823. name: 'paveT',
  22824. map: w.path
  22825. })
  22826. : new r.MeshBasicMaterial({
  22827. color: c.path.color,
  22828. side: r.DoubleSide,
  22829. transparent: !0,
  22830. depthWrite: !1,
  22831. opacity: 1,
  22832. name: 'paveO',
  22833. map: w.path
  22834. })
  22835. return new r.Mesh(o, p)
  22836. }),
  22837. (n.prototype.hintPrefs = {
  22838. rad: 0.18,
  22839. width: 0.0125,
  22840. depth: 0.0625,
  22841. setBack: -0.04,
  22842. markRad: 0.25,
  22843. markInnerRad: 0.16
  22844. }),
  22845. (n.prototype.makeWaypointObj = function (e, t) {
  22846. var i = new r.Geometry(),
  22847. n =
  22848. this.player.mode === a.PANORAMA
  22849. ? c.path.waypointIndoorRadius
  22850. : c.path.waypointRadius,
  22851. o = this.pathHeight()
  22852. i.vertices.push(
  22853. new r.Vector3(-n, o, n),
  22854. new r.Vector3(-n, o, -n),
  22855. new r.Vector3(n, o, -n),
  22856. new r.Vector3(n, o, n)
  22857. ),
  22858. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  22859. i.faceVertexUvs[0].push([
  22860. new r.Vector2(0, 0),
  22861. new r.Vector2(1, 0),
  22862. new r.Vector2(1, 1)
  22863. ]),
  22864. i.faceVertexUvs[0].push([
  22865. new r.Vector2(1, 1),
  22866. new r.Vector2(0, 1),
  22867. new r.Vector2(0, 0)
  22868. ])
  22869. var s = r.UniformsUtils.clone(m.waypoint.uniforms)
  22870. ;(s.map.value = e), (s.opacity.value = 0), s.color.value.set(c.path.color)
  22871. var l = {
  22872. side: r.DoubleSide,
  22873. depthWrite: !1,
  22874. transparent: !0,
  22875. vertexShader: m.waypoint.vertexShader,
  22876. fragmentShader: m.waypoint.fragmentShader,
  22877. uniforms: s,
  22878. name: 'waypoint',
  22879. opacity: 0
  22880. }
  22881. this.player.mode !== a.PANORAMA && ((l.depthTest = !1), (l.name = 'wayPtOut'))
  22882. var h = new r.RawShaderMaterial(l),
  22883. u = new r.Mesh(i, h)
  22884. return (u.name = t), u
  22885. }),
  22886. (n.prototype.makeStartMarker = function (e, t) {
  22887. var i = new r.Vector3().copy(t[1]).sub(t[0])
  22888. ;(i.y = 0), i.normalize()
  22889. var n = Math.acos(i.x),
  22890. o = this.makeWaypointObj(w.pathStart, 'Start')
  22891. return o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o
  22892. }),
  22893. (n.prototype.makeEndMarker = function (e) {
  22894. var t = this.makeWaypointObj(w.pathEnd, 'End'),
  22895. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  22896. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex
  22897. return (
  22898. i < n
  22899. ? t.material.uniforms.color.value.set(c.path.colorUp)
  22900. : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  22901. t.position.copy(e),
  22902. t
  22903. )
  22904. }),
  22905. (n.prototype.pathClean = function (e) {
  22906. if (e) {
  22907. for (var t in e.children) this.pathClean(e.children[t])
  22908. e.geometry && e.geometry.dispose(), e.material && e.material.dispose()
  22909. }
  22910. }),
  22911. (n.prototype.discardPathObject = function () {
  22912. if (this.obj3d) {
  22913. var e = this.obj3d.parent
  22914. e && e.remove(this.obj3d), this.pathClean(this.obj3d)
  22915. }
  22916. ;(this.obj3d = null), this.popInCpm()
  22917. }),
  22918. (n.prototype.discardSlow = function () {
  22919. if (this.obj3d) {
  22920. if (this.player.mode !== a.PANORAMA) return void this.discardPathObject()
  22921. for (
  22922. var e,
  22923. t = this,
  22924. i = 0,
  22925. n = function () {
  22926. this.discardPathObject()
  22927. }.bind(this),
  22928. r = 0;
  22929. r < t.obj3d.children.length;
  22930. r += 1
  22931. )
  22932. (e = t.obj3d.children[r]),
  22933. void 0 !== e.material &&
  22934. e.material.transparent === !0 &&
  22935. (void 0 !== e.material.uniforms
  22936. ? p.start(
  22937. u.property(e.material.uniforms.opacity, 'value', 0),
  22938. c.path.fadeOutTime,
  22939. n,
  22940. 0,
  22941. d[c.warp.blendEasing]
  22942. )
  22943. : p.start(
  22944. u.property(e.material, 'opacity', 0),
  22945. c.path.fadeOutTime,
  22946. n,
  22947. 0,
  22948. d[c.warp.blendEasing]
  22949. ),
  22950. (i += 1),
  22951. (n = null))
  22952. 0 === i && this.discardPathObject(),
  22953. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  22954. }
  22955. }),
  22956. (n.prototype.appearSlow = function () {
  22957. var e,
  22958. t = this
  22959. this.fadeOutCpm(c.path.fadeInTime)
  22960. for (
  22961. var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0;
  22962. n < t.obj3d.children.length;
  22963. n += 1
  22964. )
  22965. (e = t.obj3d.children[n]),
  22966. void 0 !== e.material &&
  22967. e.material.transparent === !0 &&
  22968. (void 0 !== e.material.uniforms
  22969. ? p.start(
  22970. u.property(e.material.uniforms.opacity, 'value', i),
  22971. c.path.fadeInTime,
  22972. null,
  22973. 0,
  22974. d[c.warp.blendEasing]
  22975. )
  22976. : p.start(
  22977. u.property(e.material, 'opacity', i),
  22978. c.path.fadeInTime,
  22979. null,
  22980. 0,
  22981. d[c.warp.blendEasing]
  22982. ))
  22983. }),
  22984. (n.prototype.update = function () {
  22985. this.obj3d && this.obj3d.updateMatrixWorld()
  22986. }),
  22987. (n.prototype.calcBurnsAmount = function (e) {
  22988. //计算导览点旋转角
  22989. var t = r.Math.degToRad(c.warp.burnsAngle)
  22990. if (this.player.mode === a.PANORAMA) {
  22991. var i = this.burnsDir * t
  22992. if (this.upcomingTransType === l.BLACK) return i
  22993. var n = e
  22994. if (null === n) return y.warn('Transition request for non-highlight'), i
  22995. var o = this.getHeroDescriptorByHeroIndex(n)
  22996. if (null === o) return i
  22997. if (!o.isPano()) return i
  22998. var s = this.getHeroPano(o),
  22999. h = this.playerControls.cameras[a.PANORAMA],
  23000. u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize(),
  23001. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  23002. p = function (e) {
  23003. var i = Math.acos(Math.min(1, e.dot(u))),
  23004. n = new r.Vector3().crossVectors(u, e)
  23005. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  23006. }
  23007. if (s === this.player.currentPano)
  23008. return (i = p(
  23009. A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize()
  23010. ))
  23011. var f = this.findShortestPath(this.player.currentPano, s)
  23012. if (void 0 === f || null === f || f.length < 1)
  23013. return y.debug('Empty path ahead...'), i
  23014. var g = this.makePathHulls(f),
  23015. m = new r.CatmullRomCurve3(g.camera),
  23016. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength())
  23017. return (i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize()))
  23018. }
  23019. return this.player.mode === a.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir
  23020. }),
  23021. (n.prototype.waitNextStep = function (e, t, time) {
  23022. //xzw 改时间
  23023. var i = time == void 0 ? c.warp.tourStepDelay : time
  23024. i == void 0 &&
  23025. (i =
  23026. this.lastTransType === l.BLACK
  23027. ? b.tourStepDelaySlideShow
  23028. : b.tourStepDelayDefault)
  23029. var n = new r.Euler(),
  23030. o = new r.Vector3()
  23031. y.debug('Starting wait: ' + (void 0 !== t))
  23032. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem) //this.model.heroLocations[this.director.currentItem[0]]
  23033. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  23034. h = function () {
  23035. this.endWarpState(),
  23036. this.player.mode === a.DOLLHOUSE &&
  23037. (this.playerControls.cameras[
  23038. a.DOLLHOUSE
  23039. ].controls.rotationAcceleration.x = 0),
  23040. t && t()
  23041. }.bind(this),
  23042. u = function (e, t) {
  23043. if (this.warpInterrupted) return h(), !0
  23044. var r = t || 1e3 / 60
  23045. if (c.warp.doBurns && !currentLocation.dontRot)
  23046. if (this.player.mode === a.PANORAMA) {
  23047. var l = this.playerControls.cameras[a.PANORAMA]
  23048. n.setFromQuaternion(l.quaternion, c.warp.eOrder)
  23049. var u = i == 0 ? s : (r * s) / i
  23050. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  23051. ;(n.y += u),
  23052. o.set(0, 0, -1),
  23053. o.applyEuler(n),
  23054. o.add(l.position),
  23055. l.controls.lookAt(o),
  23056. l.controls.lookVector.copy(o),
  23057. l.lookAt(o)
  23058. } else
  23059. this.player.mode === a.DOLLHOUSE
  23060. ? (this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s)
  23061. : (this.playerControls.controls[a.FLOORPLAN].absoluteScale *= 0.9996)
  23062. }.bind(this)
  23063. this.startWarpState(), p.start(u, i, h, 0, d.easeInOutQuad, 'wait')
  23064. }),
  23065. (n.prototype.warpToNonPano = function (e) {
  23066. if (
  23067. (this.discardPathObject(),
  23068. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE ||
  23069. this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)
  23070. ) {
  23071. var t = function () {
  23072. e && e()
  23073. }.bind(this)
  23074. this.player.flyToNewMode({
  23075. mode: this.warpDestHeroLoc.cameraMode,
  23076. duration: c.warp.outsideTime,
  23077. warpDest: this.warpDestHeroLoc,
  23078. callback: t,
  23079. force: !0
  23080. })
  23081. } else y.warn('no warp destination!!!'), e && e()
  23082. }),
  23083. (n.prototype._resetWarpShaderParams = function (e) {
  23084. //
  23085. this.player.mode === a.PANORAMA &&
  23086. (void 0 !== e.material.uniforms.blackout &&
  23087. (e.material.uniforms.blackout.value = 0),
  23088. void 0 !== e.material.uniforms.modelAlpha &&
  23089. (e.material.uniforms.modelAlpha.value = 0))
  23090. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  23091. delete e.material.defines.newBlack;
  23092. e.material.needsUpdate = true
  23093. } */
  23094. }),
  23095. (n.prototype._clearWarpShading = function () {
  23096. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  23097. this._resetWarpShaderParams(e[t]), (e[t].visible = !0)
  23098. this._resetWarpShaderParams(this.model.skybox)
  23099. }),
  23100. (n.prototype._warpStopFlying = function () {
  23101. ;(this.activeTransType = null), this.placeCpm()
  23102. }),
  23103. (n.prototype._wrapupTravelOnlyBits = function () {
  23104. this._warpStopFlying(),
  23105. this.warpPathPoints &&
  23106. (this.player.currentPano.exit(),
  23107. this.warpDestPano.enter(),
  23108. (this.player.currentPano = this.warpDestPano)),
  23109. this.player.spider.draw(),
  23110. this.placeCpm()
  23111. }),
  23112. (n.prototype._wrapupTravel = function (e) {
  23113. this._wrapupTravelOnlyBits(), this.warpCameraAim(e)
  23114. }),
  23115. (n.prototype._wrapupWarpShading = function (e) {
  23116. this._clearWarpShading(), this._wrapupTravel(e)
  23117. }),
  23118. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  23119. t !== I.END && this._clearWarpShading(),
  23120. this._wrapupTravelOnlyBits(),
  23121. (this.upcomingTransType = null),
  23122. e && e()
  23123. }),
  23124. (n.prototype._warpCameraAim = function (e, t) {
  23125. //到每个片段终点时转向终点朝向。
  23126. var i = this.warpDestHeroLoc.quaternion,
  23127. n = this.playerControls.cameras[a.PANORAMA],
  23128. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  23129. s = new r.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize(),
  23130. l = s.dot(o),
  23131. u = r.Math.radToDeg(Math.acos(l)),
  23132. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder),
  23133. g = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23134. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder)
  23135. ;(m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y))
  23136. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  23137. A = new r.Vector3(),
  23138. C = function (e, t) {
  23139. return (
  23140. !!this.warpInterrupted ||
  23141. ((v.x = g.x + e * m.x),
  23142. (v.y = g.y + e * m.y),
  23143. (v.z = g.z + e * m.z),
  23144. A.set(0, 0, -1),
  23145. A.applyEuler(v),
  23146. A.add(n.position),
  23147. n.controls.lookAt(A),
  23148. n.controls.lookVector.copy(A),
  23149. void n.lookAt(A))
  23150. )
  23151. }.bind(this)
  23152. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  23153. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  23154. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  23155. ):
  23156. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  23157. ,void (t && t())
  23158. ) */
  23159. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  23160. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e)
  23161. return u > c.warp.minRotation
  23162. ? p.start(C, e, t, 0, d[c.warp.movementEasing])
  23163. : (y.info(
  23164. 'Aim angle only is ' + u.toPrecision(3) + ' degrees, skipping explicit re-aim'
  23165. ),
  23166. void (t && t()))
  23167. }),
  23168. (n.prototype._warpBendAim = function (e, t, i, n) {
  23169. var o = n || 0,
  23170. s = this.playerControls.cameras[a.PANORAMA],
  23171. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23172. this.warpDestHeroLoc.quaternion,
  23173. c.warp.eOrder
  23174. ),
  23175. u = new r.Euler().setFromQuaternion(s.quaternion, c.warp.eOrder),
  23176. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder)
  23177. f.y = h.constrainedTurn(f.y)
  23178. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x))
  23179. ;(f.x = g * Math.sign(f.x)),
  23180. (g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g)),
  23181. (this.burnsDir = Math.sign(f.y)),
  23182. (g *= Math.sign(f.y)),
  23183. (f.y = g)
  23184. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  23185. v = new r.Vector3(),
  23186. A = function (e, t) {
  23187. if (e < 0.5) (m.x = u.x + e * f.x), (m.y = u.y + e * f.y), (m.z = u.z + e * f.z)
  23188. else {
  23189. var i = (1 - e) * c.warp.softBendEnd
  23190. ;(m.x = l.x - i * f.x), (m.y = l.y - i * f.y), (m.z = l.z - i * f.z)
  23191. }
  23192. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position)
  23193. s.controls.lookAt(v), s.controls.lookVector.copy(v), s.lookAt(v)
  23194. }.bind(this)
  23195. if (window.DATA.momentTourBlackNewType) {
  23196. A(1)
  23197. } else return p.start(A, t, i, o, d[c.warp.movementEasing])
  23198. }),
  23199. (n.prototype._warpStepCameraAim = function (e, t, i) {
  23200. var n = this.playerControls.cameras[a.PANORAMA],
  23201. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23202. this.warpDestHeroLoc.quaternion,
  23203. c.warp.eOrder
  23204. ),
  23205. s = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23206. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder)
  23207. ;(l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y))
  23208. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  23209. f = new r.Vector3(),
  23210. g = function (e, t) {
  23211. e < 0.5 ? u.copy(s) : u.copy(o),
  23212. f.set(0, 0, -1),
  23213. f.applyEuler(u),
  23214. f.add(n.position),
  23215. n.controls.lookAt(f),
  23216. n.controls.lookVector.copy(f),
  23217. n.lookAt(f)
  23218. }.bind(this)
  23219. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  23220. }),
  23221. (n.prototype.setBurnsDir = function () {
  23222. var e = this.playerControls.cameras[a.PANORAMA],
  23223. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23224. this.warpDestHeroLoc.quaternion,
  23225. c.warp.eOrder
  23226. ),
  23227. i = new r.Euler().setFromQuaternion(e.quaternion, c.warp.eOrder),
  23228. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder)
  23229. ;(n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y))
  23230. }),
  23231. (n.prototype.stepWarpPath = function (firstPos, e) {
  23232. var i = this.playerControls.cameras[a.PANORAMA]
  23233. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  23234. if (!n) {
  23235. return i.position.copy(this.warpDestPano.position), !0
  23236. }
  23237. /* if (!this.warpPathPoints)
  23238. return i.position.copy(this.warpDestPano.position),
  23239. !0;
  23240. var n = this.warpPathPoints[0] */
  23241. var o = this.warpDestPano.position
  23242. /* console.log(firstPos)
  23243. console.log(o) */
  23244. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  23245. var s = new r.Vector3()
  23246. e < 0.5
  23247. ? s
  23248. .copy(this.cameraHull[1])
  23249. .sub(n)
  23250. .normalize()
  23251. .multiplyScalar(c.warp.softPushDist * e)
  23252. .add(n)
  23253. : s
  23254. .copy(this.cameraHull[this.cameraHull.length - 2])
  23255. .sub(o)
  23256. .normalize()
  23257. .multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e))
  23258. .add(o),
  23259. i.position.copy(s)
  23260. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o)
  23261. }),
  23262. (n.prototype.interruptAndFastForward = function (e, t) {
  23263. this.warping &&
  23264. ((this.warpInterrupted = !0),
  23265. (this.warpInterruptionBlackoutStyle = e),
  23266. (this.warpInterruptionTravelTime = t),
  23267. (null !== this.warpInterruptionBlackoutStyle &&
  23268. void 0 !== this.warpInterruptionBlackoutStyle) ||
  23269. (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  23270. (null !== this.warpInterruptionTravelTime &&
  23271. void 0 !== this.warpInterruptionTravelTime) ||
  23272. (this.warpInterruptionTravelTime = c.minWarpTime))
  23273. }),
  23274. (n.prototype.warpCameraAim = function (e) {
  23275. var t = c.warp.minWarpTime
  23276. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime
  23277. else {
  23278. var i = this.playerControls.cameras[a.PANORAMA],
  23279. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23280. this.warpDestHeroLoc.quaternion,
  23281. c.warp.eOrder
  23282. ),
  23283. o = new r.Euler().setFromQuaternion(i.quaternion, c.warp.eOrder),
  23284. s = new r.Euler(n.x - o.x, n.y - o.y, n.z - o.z, c.warp.eOrder)
  23285. s.y = h.constrainedTurn(s.y)
  23286. var u = (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec)
  23287. t = Math.max(t, u)
  23288. }
  23289. var d = function () {
  23290. this._warpStopFlying(), this.discardSlow(), e && e()
  23291. }.bind(this)
  23292. this._warpCameraAim(t, d)
  23293. }),
  23294. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  23295. this.model.skybox.material.uniforms.blackout.value = n
  23296. var r = u.uniform(this.model.skybox, 'progress', 1),
  23297. o = u.allUniforms(this.model.chunks, 'progress', 1),
  23298. a = !1,
  23299. s = function () {
  23300. if (this.warpInterrupted) return (a = !0), !0
  23301. }.bind(this),
  23302. l = function (e, t) {
  23303. return i && a
  23304. ? ((this.model.skybox.material.uniforms.progress.value = 0), !0)
  23305. : void r(e, t)
  23306. }.bind(this),
  23307. h = function (e, t) {
  23308. return i && a ? (o(0), !0) : void o(e, t)
  23309. }.bind(this)
  23310. p.start(s, e, null, t, null, 'safeHaltWatch'),
  23311. p.start(l, e, null, t, d[c.warp.blendEasing], 'skyboxProgress'),
  23312. p.start(h, e, null, t, d[c.warp.blendEasing], 'chunkProgress')
  23313. }),
  23314. (n.prototype.warpTravel_STD = function (e) {
  23315. var t,
  23316. i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength),
  23317. n = this.playerControls.cameras[a.PANORAMA],
  23318. o = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  23319. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  23320. f = new r.Vector3(),
  23321. m = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23322. v = new r.Euler().copy(m),
  23323. C = n.position.clone(),
  23324. E = new r.Matrix4(),
  23325. b = new r.Euler(),
  23326. w = c.warp.minWarpTime
  23327. ;(w += this.warpLength * c.warp.timePerMeter),
  23328. c.warp.flySpeed > 0.01 && (w = (1e3 * this.warpLength) / c.warp.flySpeed)
  23329. var _ = !1,
  23330. T = this.warpDestHeroLoc.quaternion,
  23331. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  23332. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  23333. .clone()
  23334. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  23335. .normalize(),
  23336. M = S.dot(x),
  23337. R = r.Math.radToDeg(Math.acos(M)),
  23338. P = function (e) {
  23339. var t = o,
  23340. i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1))
  23341. return i
  23342. },
  23343. O = function () {
  23344. return (
  23345. E.lookAt(C, t, A.UP),
  23346. s.setFromRotationMatrix(E, c.warp.eOrder),
  23347. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23348. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23349. h.constrainedTurn(b.y)
  23350. )
  23351. }.bind(this),
  23352. L = function (e, t) {
  23353. if (this.warpInterrupted) return (_ = !0), !0
  23354. }.bind(this),
  23355. D = function (e, t) {
  23356. return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(e)
  23357. }.bind(this),
  23358. N = u.allUniforms(this.model.chunks, 'modelAlpha', 1),
  23359. B = function (e, t) {
  23360. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t)
  23361. }.bind(this),
  23362. F = function (e, t) {
  23363. if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0
  23364. if (_) return !0
  23365. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e)
  23366. n.position.copy(i),
  23367. (C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e))
  23368. }.bind(this),
  23369. V = function (e, n) {
  23370. return this.warpPathPoints
  23371. ? !!_ ||
  23372. void (t = this.interpAlongPath(
  23373. this.warpPathPoints,
  23374. this.warpPathLengths,
  23375. Math.min(e + i, 1)
  23376. ))
  23377. : (y.debug('Lost bunny.'), !0)
  23378. }.bind(this),
  23379. U = function (e, o) {
  23380. if (_) return y.debug('>>>> Walkthrough interupted at t=' + e), !0
  23381. if (!this.warpPathPoints) return !0
  23382. var a = this.warpLength * e,
  23383. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  23384. u = r.Math.smoothstep(
  23385. a,
  23386. this.warpLength - this.brushPrefs.lookBlendDist,
  23387. this.warpLength
  23388. )
  23389. c.warp.matchCam && (l *= 1 - u),
  23390. E.lookAt(C, t, A.UP),
  23391. s.setFromRotationMatrix(E, c.warp.eOrder),
  23392. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23393. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23394. (b.y = h.constrainedTurn(b.y)),
  23395. (s.x = m.x + l * b.x),
  23396. (s.y = m.y + l * b.y),
  23397. (s.z = m.z + l * b.z),
  23398. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  23399. (b.y = h.constrainedTurn(b.y))
  23400. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3
  23401. ;(b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  23402. (v.x = v.x + b.x * c.warp.turnFriction),
  23403. (v.y = v.y + b.y * c.warp.turnFriction),
  23404. (v.z = v.z + b.z * c.warp.turnFriction),
  23405. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x))
  23406. var p = t.clone().sub(C).normalize()
  23407. if (R < c.warp.maxAimRotation && u > 0) {
  23408. var g = 1 - u
  23409. ;(p.x = p.x * g + u * S.x),
  23410. (p.y = p.y * g + u * S.y),
  23411. (p.z = p.z * g + u * S.z),
  23412. p.normalize()
  23413. }
  23414. this.bunnyObj.position.copy(n.position).add(p),
  23415. f.set(0, 0, -1).applyEuler(v).normalize(),
  23416. f.multiplyScalar(8),
  23417. f.add(n.position),
  23418. (e > 1 - i && c.warp.matchCam) ||
  23419. (n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f))
  23420. }.bind(this),
  23421. k = function () {
  23422. _
  23423. ? (this.discardSlow(),
  23424. (this.upcomingTransType = l.BLACK),
  23425. this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, I.BEGINNING, e))
  23426. : this._wrapupWarpShading(e)
  23427. }.bind(this)
  23428. V(0)
  23429. var H =
  23430. c.warp.motionLeadTime +
  23431. (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec)
  23432. w += H
  23433. var G = H / w
  23434. this.warpCommonParameters(w, G, !0, I.NONE),
  23435. p.start(L, w, null, 0, null, '_haltWatcher'),
  23436. c.warp.blur > 0 &&
  23437. ((g.blurStrength = c.warp.blur), p.start(D, w, null, G, P, 'blurring')),
  23438. p.start(B, w, null, G, P, 'modelAlpha'),
  23439. p.start(F, w, null, G, d[c.warp.blendEasing], 'followPath'),
  23440. p.start(V, w, null, G, d[c.warp.blendEasing], 'goBunny'),
  23441. p.start(U, w, k, 0, d[c.warp.blendEasing], 'lookAtBunny')
  23442. }),
  23443. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  23444. var r = e || 0
  23445. ;(void 0 !== t && null !== t) || (t = c.warp.teleportTime)
  23446. //add
  23447. var done = () => {
  23448. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  23449. this.player.transitionPos({
  23450. type: 'beforeFlytopano',
  23451. pano: this.player.currentPano,
  23452. dur: 100
  23453. }) //add
  23454. }
  23455. if (window.DATA.momentTourBlackNewType) {
  23456. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  23457. var camera = this.playerControls.cameras[a.PANORAMA]
  23458. var end = this.warpDestHeroLoc.position
  23459. camera.position.copy(end)
  23460. setTimeout(() => {
  23461. player.sceneRenderer.effects.fastTranMaskPass.stop()
  23462. this.wrapupWarpShadingOnly(n, i)
  23463. done()
  23464. }, t)
  23465. } else {
  23466. var o = function () {
  23467. this.wrapupWarpShadingOnly(n, i)
  23468. done()
  23469. }.bind(this)
  23470. var firstPos = this.player.position.clone() //add
  23471. p.start(
  23472. this.stepWarpPath.bind(this, firstPos),
  23473. t,
  23474. o,
  23475. r,
  23476. d[c.warp.blendEasing],
  23477. 'stepMotion'
  23478. )
  23479. }
  23480. this.warpCommonParameters(t, r, !1, i)
  23481. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  23482. // 改
  23483. if (window.DATA.momentTourBlackNewType) {
  23484. e.material.uniforms.blackout.value = 5 //i 改
  23485. //e.material.defines.newBlack = ''
  23486. //e.material.needsUpdate = true
  23487. } else {
  23488. e.material.uniforms.blackout.value = i
  23489. }
  23490. }),
  23491. this._warpBendAim(null, t, null, r)
  23492. }),
  23493. (n.prototype.flightStepWalk = (function (e, t, i) {
  23494. var n = 0.001,
  23495. o = 1,
  23496. a = 1.2,
  23497. s = new r.Vector3(),
  23498. h = new r.Vector3(),
  23499. u = function (e, t) {
  23500. //导览速度
  23501. var i = Math.min(
  23502. this.player.position.distanceTo(e.position),
  23503. c.transition.flytimeMaxDistanceThreshold
  23504. ),
  23505. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  23506. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime
  23507. h.copy(A.FORWARD),
  23508. this.player.getDirection(h),
  23509. s.copy(t).sub(e.position).normalize()
  23510. var l = s.dot(h),
  23511. u = Math.acos(l),
  23512. d = u / r
  23513. d > n && ((r *= d / n), u < o && (r *= a))
  23514. return (r / DATA.tourWalkSpeed) * 100 // 改
  23515. }
  23516. return function (e, t, i) {
  23517. if (this.warpInterrupted) i && i()
  23518. else if (this.activeTransType !== l.WALK)
  23519. this._clearWarpShading(),
  23520. this._warpStopFlying(),
  23521. this.player.spider.draw(),
  23522. this.placeCpm(),
  23523. i && i()
  23524. else if (this.player.currentPano !== e) {
  23525. var n = {
  23526. pano: e,
  23527. lookAtPoint: t,
  23528. duration: null,
  23529. maxDistanceOverride: c.warp.walkMaxDist,
  23530. skipWarpingCheck: !1,
  23531. constantMoveSpeed: !0
  23532. }
  23533. if (e == this.warpDestPano) {
  23534. //到达终点前,放大到终点的zoom
  23535. n.zoomLevel = this.warpDestHeroLoc.zoom
  23536. }
  23537. ;(n.duration = u.call(this, e, t)), this.player.nonInterruptingFlyToPano(n, i)
  23538. } else i && i()
  23539. }
  23540. })()),
  23541. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  23542. return this.flightStepWalk.bind(this, e, t, i)
  23543. }),
  23544. (n.prototype.warpTravel_WALK = (function () {
  23545. var e = []
  23546. return function (t) {
  23547. var i = this.player.model.panos
  23548. e.length = 0
  23549. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  23550. var s = this.nodes[a],
  23551. l = i.get(s)
  23552. a === this.nodes.length - 1
  23553. ;(o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist),
  23554. (n && o) || (e.push(s), (n = l))
  23555. }
  23556. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1])
  23557. var h = e.length,
  23558. u = i.get(e[h - 1]),
  23559. d = new Array(h + 1)
  23560. d[d.length - 1] = function () {
  23561. t && t()
  23562. }.bind(this)
  23563. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  23564. var g = e[p]
  23565. u = i.get(g)
  23566. var m = new r.Vector3()
  23567. this.getLookAtForWalkingTourNode(e, p, m),
  23568. (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])),
  23569. p--
  23570. }
  23571. d[0]()
  23572. }
  23573. })()),
  23574. (n.prototype.getLookAtForWalkingTourNode = (function () {
  23575. var e = new r.Vector3(),
  23576. t = new r.Vector3(),
  23577. i = new r.Vector3(),
  23578. n = new r.Vector3(),
  23579. o = new r.Vector3(),
  23580. a = 0.65,
  23581. s = 0.75,
  23582. l = 0.2,
  23583. c = 0.4,
  23584. h = 0.2,
  23585. u = 3
  23586. return function (r, d, p) {
  23587. var f = r.length
  23588. if (d >= f) return !1
  23589. var g = 1,
  23590. m = 1
  23591. t.set(0, 0, 0), o.set(0, 0, 0)
  23592. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  23593. if (
  23594. ((v = this.player.model.panos.get(r[A])),
  23595. this.getOrientationForWalkingTourNode(r, A, i),
  23596. A === d && e.copy(i),
  23597. n.copy(i),
  23598. A > d)
  23599. ) {
  23600. var y = n.dot(e) < a
  23601. ;(g *= y ? l : s), (m *= y ? h : c)
  23602. }
  23603. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m)
  23604. }
  23605. return t.normalize(), p.copy(o), p.add(t), !0
  23606. }
  23607. })()),
  23608. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  23609. var n = e.length
  23610. if (t >= n) return !1
  23611. if (t === n - 1) i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion)
  23612. else {
  23613. var r = this.player.model.panos.get(e[t]),
  23614. o = this.player.model.panos.get(e[t + 1])
  23615. i.copy(o.position).sub(r.position)
  23616. }
  23617. return i.normalize(), !0
  23618. }),
  23619. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  23620. if (
  23621. ((this.activeTransType = this.upcomingTransType),
  23622. (this.lastTransType = this.activeTransType),
  23623. (this.upcomingTransType = null),
  23624. !e)
  23625. ) {
  23626. var r = function () {
  23627. this._wrapupTravel(n)
  23628. }.bind(this),
  23629. o = {
  23630. pano: this.warpDestPano,
  23631. lookAtPoint: null,
  23632. duration: null,
  23633. maxDistanceOverride: null,
  23634. skipWarpingCheck: !1
  23635. }
  23636. return void this.player.flyToPano(o, r)
  23637. }
  23638. this.activeTransType === l.BLACK
  23639. ? this.warpTravel_BLACK(null, i, t, n)
  23640. : this.activeTransType === l.WALK
  23641. ? this.warpTravel_WALK(
  23642. function () {
  23643. this._clearWarpShading(),
  23644. this._warpStopFlying(),
  23645. this.player.spider.draw(),
  23646. this.placeCpm(),
  23647. n && n()
  23648. }.bind(this)
  23649. )
  23650. : this.warpTravel_STD(n)
  23651. }),
  23652. (n.prototype.startWarpState = function () {
  23653. ;(this.warping = !0),
  23654. (this.warpInterrupted = !1),
  23655. (this.warpInterruptionBlackoutStyle = null),
  23656. (this.warpInterruptionTravelTime = null)
  23657. }),
  23658. (n.prototype.endWarpState = function () {
  23659. this.warping = !1
  23660. }),
  23661. (n.prototype.warpToPano = function (e, t, i, n) {
  23662. if (this.warping) return void y.warn('Cannot warp when already warping')
  23663. if (
  23664. ((this.upcomingTransType = e),
  23665. (this.activeTransType = null),
  23666. !this.setWarpDestPano())
  23667. )
  23668. return (this.upcomingTransType = null), void this.warpToNonPano(n)
  23669. if (this.player.mode !== a.PANORAMA)
  23670. return (
  23671. (this.upcomingTransType = null),
  23672. this.discardSlow(),
  23673. void this.player.flyToNewMode({
  23674. mode: a.PANORAMA,
  23675. pano: this.warpDestPano,
  23676. duration: c.warp.outsideTime,
  23677. warpDest: this.warpDestHeroLoc,
  23678. callback: n,
  23679. force: !0
  23680. })
  23681. )
  23682. if (!this.warpDestPano)
  23683. return (
  23684. y.warn('no warp destination, callback dropped'),
  23685. void (this.upcomingTransType = null)
  23686. )
  23687. var r = !(
  23688. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  23689. this.warpDestPano !== this.player.currentPano &&
  23690. this.warpDestPano.position.distanceTo(this.player.currentPano.position) <
  23691. c.warp.nearPanoDist
  23692. ),
  23693. o = this.chooseWarpPath(r)
  23694. if (o && this.upcomingTransType !== l.WALK) {
  23695. var s = function () {
  23696. ;(this.waitingToWarp = !1), this.warpToPano(e, t, i, n)
  23697. }.bind(this)
  23698. if (
  23699. this.player.checkAndWaitForPanoLoad(
  23700. this.warpDestPano,
  23701. 'high',
  23702. 'low',
  23703. this.player.basePanoSize,
  23704. s
  23705. )
  23706. )
  23707. return void (this.waitingToWarp = !0)
  23708. }
  23709. this.player.currentPano ||
  23710. (y.warn('Arrived at a very strange spot!'),
  23711. (this.player.currentPano = this.warpDestPano),
  23712. this.placeCpm(),
  23713. this.fadeOutCpm(c.path.fadeOutTime),
  23714. this.player.spider.draw()),
  23715. y.debug('Warping to pano ', this.warpDestPano.position),
  23716. this.upcomingTransType !== l.WALK &&
  23717. this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  23718. this.startWarpState()
  23719. var h = function () {
  23720. this.endWarpState(), n && n()
  23721. }.bind(this)
  23722. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  23723. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  23724. }),
  23725. (t.exports = n)
  23726. }).call(this, '/js/objects/ShowPath.js')
  23727. },
  23728. {
  23729. '../constants': 8,
  23730. '../effects': 16,
  23731. '../enum/BlackoutStyle': 18,
  23732. '../enum/ModelManagerEvents': 33,
  23733. '../enum/PlayerEvents': 40,
  23734. '../enum/RenderOrder': 42,
  23735. '../enum/Vectors': 50,
  23736. '../enum/Viewmode': 51,
  23737. '../enum/WarpStyle': 52,
  23738. '../gui/gui': 65,
  23739. '../model/ModelManager': 140,
  23740. '../objects/Snapshot': 153,
  23741. '../settings': 166,
  23742. '../shaders': 167,
  23743. '../util/easing': 186,
  23744. '../util/lerp': 188,
  23745. '../util/logger': 189,
  23746. '../util/math': 190,
  23747. '../util/texture': 194,
  23748. '../util/transitions': 195,
  23749. three: 217
  23750. }
  23751. ],
  23752. 152: [
  23753. function (e, t, i) {
  23754. 'use strict'
  23755. function n() {
  23756. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  23757. t = new r.RawShaderMaterial({
  23758. fragmentShader: o.skysphere.fragmentShader,
  23759. vertexShader: o.skysphere.vertexShader,
  23760. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  23761. side: r.BackSide,
  23762. name: 'skysphere'
  23763. })
  23764. ;(t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t)
  23765. }
  23766. var r = e('three'),
  23767. o = e('../shaders'),
  23768. a = e('../settings')
  23769. ;(n.prototype = Object.create(r.Mesh.prototype)),
  23770. (n.prototype.constructor = n),
  23771. (t.exports = n)
  23772. },
  23773. {
  23774. '../settings': 166,
  23775. '../shaders': 167,
  23776. three: 217
  23777. }
  23778. ],
  23779. 153: [
  23780. function (e, t, i) {
  23781. ;(function (i) {
  23782. 'use strict'
  23783. function n(e) {
  23784. o.call(this, e),
  23785. (this.sid = e.sid), //xzw add
  23786. (this.panoId = e.panoId),
  23787. (this.orthoZoom = e.orthoZoom),
  23788. (this.floorVisibility = e.floorVisibility),
  23789. (this.thumbUrl = e.thumbUrl),
  23790. (this.name = e.name),
  23791. (this.zoom = e.zoom)
  23792. }
  23793. var r = (e('three'), e('../util/logger')),
  23794. o =
  23795. (e('../settings'),
  23796. e('../enum/Viewmode'),
  23797. e('../util/common'),
  23798. e('../util/transitions'),
  23799. e('../util/lerp'),
  23800. e('../util/ajax'),
  23801. e('../util/texture'),
  23802. e('./View'))
  23803. e('events').EventEmitter, new r(i)
  23804. ;(n.prototype = Object.create(o.prototype)),
  23805. (n.prototype.isPano = function () {
  23806. return this.panoId && '' !== this.panoId && this.panoId != 'outside'
  23807. }),
  23808. (t.exports = n)
  23809. }).call(this, '/js/objects/Snapshot.js')
  23810. },
  23811. {
  23812. '../enum/Viewmode': 51,
  23813. '../settings': 166,
  23814. '../util/ajax': 181,
  23815. '../util/common': 185,
  23816. '../util/lerp': 188,
  23817. '../util/logger': 189,
  23818. '../util/texture': 194,
  23819. '../util/transitions': 195,
  23820. './View': 154,
  23821. events: 202,
  23822. three: 217
  23823. }
  23824. ],
  23825. 154: [
  23826. function (e, t, i) {
  23827. ;(function (i) {
  23828. 'use strict'
  23829. function n(e) {
  23830. ;(e = e || {}),
  23831. (this.position = new r.Vector3()),
  23832. (this.quaternion = new r.Quaternion()),
  23833. this.update(e)
  23834. }
  23835. var r = e('three'),
  23836. o = e('../util/logger'),
  23837. a =
  23838. (e('../settings'),
  23839. e('../enum/Viewmode'),
  23840. e('../util/common'),
  23841. e('../util/transitions'),
  23842. e('../util/lerp'),
  23843. e('../util/ajax'),
  23844. e('../util/texture'),
  23845. e('events').EventEmitter)
  23846. new o(i)
  23847. ;(n.prototype = Object.create(a.prototype)),
  23848. (n.prototype.isValid = function () {
  23849. return !!this.cameraMode
  23850. }),
  23851. (n.prototype.update = function (e) {
  23852. return (
  23853. (this.cameraMode = e.cameraMode || this.cameraMode),
  23854. (this.pano = e.pano || this.pano),
  23855. e.position && this.position.copy(e.position),
  23856. e.quaternion && this.quaternion.copy(e.quaternion),
  23857. this
  23858. )
  23859. }),
  23860. (t.exports = n)
  23861. }).call(this, '/js/objects/View.js')
  23862. },
  23863. {
  23864. '../enum/Viewmode': 51,
  23865. '../settings': 166,
  23866. '../util/ajax': 181,
  23867. '../util/common': 185,
  23868. '../util/lerp': 188,
  23869. '../util/logger': 189,
  23870. '../util/texture': 194,
  23871. '../util/transitions': 195,
  23872. events: 202,
  23873. three: 217
  23874. }
  23875. ],
  23876. 155: [
  23877. function (e, t, i) {
  23878. //player.js
  23879. ;(function (i) {
  23880. 'use strict'
  23881. function n(e) {
  23882. ;(this.currentPano = null),
  23883. (this.nextPano = null),
  23884. (this.camera = null),
  23885. (this.paused = !1),
  23886. (this.flying = !1),
  23887. (this.sceneIntersectionPlane = null),
  23888. (this.target = new r.Vector3()),
  23889. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  23890. (this.mouseAtMouseDown = new r.Vector2()),
  23891. (this.mouseCouldBeClickToMove = !1),
  23892. (this.mouseLastMoveTime = Date.now()),
  23893. (this.mouseDown = !1),
  23894. (this.mouseDownTimer = null),
  23895. (this.couldBeLongTap = !1),
  23896. (this.containsMouse = !1), //
  23897. (this.isTouchEvent = !1),
  23898. (this.isPanoHover = !1),
  23899. (this.reticule = new a(this)),
  23900. (this.panoMarkers = []),
  23901. (this.spider = new h(this)),
  23902. (this.quaternion = new r.Quaternion()),
  23903. (this.position = new r.Vector3(15, 10, 15)),
  23904. (this.previousState = null),
  23905. (this.lastInsideView = new c()),
  23906. (this.last360View = new c()),
  23907. (this.raycaster = new r.Raycaster()),
  23908. (this.intersect = null),
  23909. (this.lastChangeTime = Date.now()),
  23910. (this.history = new I()),
  23911. (this.cameraControls = null),
  23912. (this.path = null),
  23913. (this.model = null),
  23914. (this.domElement = null),
  23915. (this.cachedPanoCandidates = null),
  23916. (this.basePanoSize = 0),
  23917. (this.standardPanoSize = 0),
  23918. (this.highPanoSize = 0),
  23919. (this.ultraHighPanoSize = 0),
  23920. (this.zoomLevel = 1),
  23921. (this.zooming = 0),
  23922. (this.zoomSpeed = 0.5),
  23923. (this.scrollZoomSpeed = 0.06),
  23924. (this.zoomSpeedAdjust = 0.05),
  23925. (this.defaultZoomIncrement = 0.2),
  23926. (this.baseFov = f.insideFOV),
  23927. (this.zoomFov = this.baseFov),
  23928. (this.zoomEnabled = !0),
  23929. (this.preRenderingEnabled = !1),
  23930. this.setupCustomProperties(e),
  23931. (this.zoomStats = new L())
  23932. window.player = this
  23933. this.modeTran = ''
  23934. }
  23935. var r = e('three'),
  23936. o = e('./util/logger'),
  23937. a = e('./objects/Reticule'),
  23938. s = e('./objects/Panorama'),
  23939. l = e('./objects/ShowPath'),
  23940. c = e('./objects/View'),
  23941. h = (e('./objects/Snapshot'), e('./objects/NSpider')),
  23942. u = e('./enum/Viewmode'),
  23943. d = (e('./enum/TagStates'), e('./enum/Vectors')),
  23944. p = e('./enum/Keys'),
  23945. f = (e('./enum/AlignmentType'), e('./settings')),
  23946. g = e('./util/common'),
  23947. m = (e('./util/browser'), e('./util/math')),
  23948. v = e('./util/lerp'),
  23949. A = e('./util/easing'),
  23950. y = e('./util/transitions'),
  23951. C = e('events').EventEmitter,
  23952. I = (e('./shaders'), e('./util/history')),
  23953. E = (e('./util/camera'), e('./model/ModelManager'), e('./enum/PathDiscardMode')),
  23954. b = e('./enum/PathDisplayMode'),
  23955. w = e('./enum/PlayerEvents'),
  23956. _ = e('./enum/ControlEvents'),
  23957. T = e('./enum/ModelManagerEvents'),
  23958. x = e('./enum/WarpStyle'),
  23959. S = e('./enum/BlackoutStyle'),
  23960. M = e('./exception/BasicException'),
  23961. R = e('./enum/PanoSizeClass'),
  23962. P = (e('./tile/TileDownloader'), e('./tile/TilePrioritizer')),
  23963. O = (e('./enum/PanoramaEvents'), e('./enum/ZoomEvents')),
  23964. L = e('./util/ZoomStats'),
  23965. D = e('./constants'),
  23966. N = e('./util/common'),
  23967. B = e('./util/cameraLight'),
  23968. //, Hot = e('hot')
  23969. F = new o(i),
  23970. V = Object.freeze({
  23971. FlyToPano: y.getUniqueId(),
  23972. FlyToNewMode: y.getUniqueId(),
  23973. FlyToSameMode: y.getUniqueId(),
  23974. FlyToViewFloor: y.getUniqueId(),
  23975. LookTransition: y.getUniqueId(),
  23976. ZoomTransition: y.getUniqueId()
  23977. })
  23978. ;(n.prototype = Object.create(C.prototype)),
  23979. (n.prototype.init = function (e) {
  23980. ;(this.modelManager = e.modelManager),
  23981. (this.tileDownloader = e.tileDownloader),
  23982. (this.panoRenderer = e.panoRenderer),
  23983. (this.qualityManager = e.qualityManager),
  23984. (this.domElement = e.container),
  23985. (this.camera = e.camera),
  23986. (this.tagManager = e.tagManager),
  23987. (this.cameraControls = e.controls),
  23988. (this.path = new l(e.director, this, e.controls)),
  23989. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  23990. (this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD)),
  23991. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  23992. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH)),
  23993. (this.tileDownloader.processPriorityQueue = !1),
  23994. (this.tileDownloader.tilePrioritizer = new P(
  23995. this.qualityManager,
  23996. this.basePanoSize,
  23997. this.standardPanoSize,
  23998. this.highPanoSize,
  23999. this.ultraHighPanoSize
  24000. )),
  24001. this.bindEvents(e.container),
  24002. this.updateModel()
  24003. })
  24004. //xzw add: 截图
  24005. function dataURLtoBlob(dataurl) {
  24006. var arr = dataurl.split(','),
  24007. mime = arr[0].match(/:(.*?);/)[1],
  24008. bstr = atob(arr[1]),
  24009. n = bstr.length,
  24010. u8arr = new Uint8Array(n)
  24011. while (n--) {
  24012. u8arr[n] = bstr.charCodeAt(n)
  24013. }
  24014. return new Blob([u8arr], { type: mime })
  24015. }
  24016. n.prototype.screenShot = function (o) {
  24017. if (this.flying || this.flyingToTag) return
  24018. var R = this.sceneRenderer
  24019. R.updateScreenSize(o)
  24020. for (var i in this.model.panos.index) {
  24021. if (!this.model.panos.index[i].marker) continue
  24022. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible
  24023. this.model.panos.index[i].marker.visible = false
  24024. }
  24025. for (var i in this.model.hots) {
  24026. this.model.hots[i].mesh.visible = false
  24027. }
  24028. this.reticule.visible = false
  24029. this.reticule.forceUnvisible = true
  24030. this.path.currentPanoMarker.mesh.visible = false
  24031. setTimeout(
  24032. function () {
  24033. //因resize效用没办法立即生效(原因未知),故而延后
  24034. R.renderer.clear(true, true, true)
  24035. R.renderer.render(R.scene, R.camera)
  24036. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9)
  24037. o.f && o.f(imgData)
  24038. R.updateScreenSize({ resize: true })
  24039. this.reticule.visible = true
  24040. for (var i in this.model.hots) {
  24041. this.model.hots[i].mesh.visible = true
  24042. }
  24043. for (var i in this.model.panos.index) {
  24044. this.model.panos.index[i].marker.visible =
  24045. this.model.panos.index[i].marker.forceHide
  24046. }
  24047. this.path.currentPanoMarker.mesh.visible = true
  24048. R.renderer.render(R.scene, R.camera)
  24049. }.bind(this),
  24050. 30
  24051. ) //这个数字不能太小
  24052. }
  24053. var scaleImg = e('scaleImg')
  24054. var ResizeImg = function (img, option) {
  24055. var img2 //不能直接改img 否则可能触发第二次img.onload
  24056. var compress = function (ratio, type) {
  24057. var image = img2 || img
  24058. var c = document.createElement('canvas')
  24059. c.width = image.width
  24060. c.height = image.height
  24061. var ctx = c.getContext('2d')
  24062. ctx.drawImage(image, 0, 0, image.width, image.height)
  24063. img2 = scaleImg(ratio /* option.maxSize/oldSize */, c, type /* option.type||"png" */) //最大不能超过0.8M
  24064. }
  24065. var reCom = function () {
  24066. //如果有了img2 就只需要img2 否则创造新的img2
  24067. var image = img2 || img
  24068. var blob = dataURLtoBlob(image.src)
  24069. if (option.maxWeight && blob.size > option.maxWeight) {
  24070. compress(option.maxWeight / blob.size, 'jpeg')
  24071. blob = dataURLtoBlob(image.src)
  24072. }
  24073. if (!img2) {
  24074. img2 = new Image()
  24075. }
  24076. img2.base64Src = image.src
  24077. img2.src = window.URL.createObjectURL(blob)
  24078. }
  24079. var oldSize = Math.max(img.width, img.height)
  24080. if (option.toType != 'png') {
  24081. //不是非要png的话
  24082. if (option.oldType == 'jpeg') {
  24083. //jpeg先判断尺寸,然后是尺寸
  24084. if (oldSize > option.maxSize) {
  24085. compress(option.maxSize / oldSize, 'jpeg')
  24086. }
  24087. reCom()
  24088. } else if (option.oldType == 'png') {
  24089. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  24090. if (option.maxWeight && option.weight > option.maxWeight) {
  24091. //如果一开始大小不大就不压缩 还是png
  24092. compress(oldSize > option.maxSize ? option.maxSize / oldSize : 1, 'jpeg')
  24093. reCom()
  24094. }
  24095. }
  24096. } else {
  24097. //?貌似png会越压缩越大?
  24098. }
  24099. return img2 || img
  24100. }
  24101. var _fixType = function (type) {
  24102. type = type.toLowerCase().replace(/jpg/i, 'jpeg')
  24103. var r = type.match(/png|jpeg|bmp|gif/)[0]
  24104. return 'image/' + r
  24105. }
  24106. var saveFile = function (data, filename) {
  24107. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
  24108. save_link.href = data
  24109. save_link.download = filename
  24110. var event = document.createEvent('MouseEvents')
  24111. event.initMouseEvent(
  24112. 'click',
  24113. true,
  24114. false,
  24115. window,
  24116. 0,
  24117. 0,
  24118. 0,
  24119. 0,
  24120. 0,
  24121. false,
  24122. false,
  24123. false,
  24124. false,
  24125. 0,
  24126. null
  24127. )
  24128. save_link.dispatchEvent(event)
  24129. }
  24130. ;(n.prototype.getWrapShot = function () {
  24131. //获取导览点截图/初始画面和信息
  24132. var info = this.getSnapAngleInfo()
  24133. var str = ',{\r\t' + info
  24134. var arg = arguments[0]
  24135. this.screenShot({
  24136. width: g_snapShotWidth * 4,
  24137. height: g_snapShotHeight * 4,
  24138. type: 'image/jpeg',
  24139. f: function (imgData) {
  24140. if (arg && arg.__callback) {
  24141. return arg.__callback(imgData, info)
  24142. }
  24143. var img = new Image()
  24144. img.src = imgData
  24145. img.onload = function () {
  24146. var img2 = ResizeImg(this, { maxSize: g_snapShotWidth, oldType: 'jpeg' }) //暂定缩略图大小
  24147. img2.src.replace(_fixType('image/jpeg'), 'image/octet-stream')
  24148. var filename = 'snap' + new Date().getTime()
  24149. saveFile(img2.src, filename + '.jpg')
  24150. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",'
  24151. str += '\r\t"sid":"' + filename + '",'
  24152. str += '\r\t"name":"' + filename + '"\r}'
  24153. logData(str)
  24154. }
  24155. }
  24156. })
  24157. }),
  24158. (n.prototype.getSnapAngleInfo = function () {
  24159. var info = {}
  24160. var str = '"metadata":{'
  24161. var q = this.camera.quaternion.clone()
  24162. switch (this.mode) {
  24163. case 'panorama':
  24164. info.scan_id = this.currentPano.id
  24165. str += '"scan_id":"' + this.currentPano.id + '",'
  24166. break
  24167. case 'floorplan':
  24168. info.camera_mode = 1
  24169. q = new r.Quaternion().setFromAxisAngle(
  24170. new r.Vector3(0, 1, 0),
  24171. r.Math.degToRad(90)
  24172. )
  24173. q.multiply(this.camera.quaternion)
  24174. str += '"camera_mode":1,'
  24175. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  24176. str +=
  24177. '"ortho_zoom":' +
  24178. m.toPrecision(this.cameraControls.activeControl.currentScale, 4) +
  24179. ','
  24180. break
  24181. case 'dollhouse':
  24182. info.camera_mode = 2
  24183. str += '"camera_mode":2,'
  24184. break
  24185. }
  24186. info.camera_position = m.toPrecision(this.camera.position.toArray(), 4)
  24187. console.log(info.camera_position)
  24188. if (window.screenSta === 'tour') {
  24189. // fyz 导览截屏需要做额外的
  24190. /**fyz 对相机截屏的角度进行校对 */
  24191. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  24192. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  24193. out.x *= -1
  24194. out.w *= -1
  24195. info.camera_quaternion = m.toPrecision(out.toArray(), 4)
  24196. } else {
  24197. info.camera_quaternion = m.toPrecision(q.toArray(), 4)
  24198. }
  24199. info.zoom = this.zoomLevel
  24200. console.log(info.camera_quaternion)
  24201. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  24202. // fyz 扩展编辑页面, 加上导览点缩放值
  24203. str +=
  24204. '"camera_position":[' +
  24205. info.camera_position +
  24206. '],"camera_quaternion":[' +
  24207. info.camera_quaternion +
  24208. '], "zoom":' +
  24209. info.zoom +
  24210. '}'
  24211. return str
  24212. })
  24213. //------end
  24214. ;(n.prototype.setupCustomProperties = function (e) {
  24215. var t = e || u.PANORAMA
  24216. Object.defineProperty(this, 'mode', {
  24217. get: function () {
  24218. return t
  24219. },
  24220. set: function (e) {
  24221. var i = t
  24222. ;(t = e), this.onModeUpdated(i, t)
  24223. }
  24224. })
  24225. }),
  24226. (n.prototype.isInMode = function () {
  24227. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0
  24228. return !1
  24229. }),
  24230. (n.prototype.isOutsideMode = function (e) {
  24231. return (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN
  24232. }),
  24233. (n.prototype.is360View = function (e, t) {
  24234. return e === u.PANORAMA && t && !t.isAligned()
  24235. }),
  24236. (n.prototype.setScene = function (e) {
  24237. ;(this.sceneIntersectionPlane = e.plane),
  24238. this.path.setScene(e),
  24239. this.moveReticuleToScene(e)
  24240. }),
  24241. (n.prototype.moveReticuleToScene = function (e) {
  24242. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  24243. e.add(this.reticule)
  24244. }),
  24245. (n.prototype.updateModel = function () {
  24246. function e(e, t, n) {
  24247. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  24248. }
  24249. function t(e, t) {
  24250. if (this.mode === u.DOLLHOUSE) {
  24251. var n = e ? this.model.center.y : (n = t.center.y)
  24252. i.call(this, n)
  24253. }
  24254. }
  24255. function i(e) {
  24256. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  24257. i = this.cameraControls.controls[u.DOLLHOUSE],
  24258. n = t.position.y + (e - i.target.y),
  24259. r = f.showFloorDuration + f.showFloorDelay
  24260. y.start(
  24261. v.property(i.target, 'y', e),
  24262. r,
  24263. null,
  24264. f.flydown.movementDelay,
  24265. A[f.flydown.movementEasing],
  24266. null,
  24267. V.FlyToViewFloor
  24268. ),
  24269. y.start(
  24270. v.property(t.position, 'y', n),
  24271. r,
  24272. null,
  24273. f.flydown.movementDelay,
  24274. A[f.flydown.movementEasing],
  24275. null,
  24276. V.FlyToViewFloor
  24277. )
  24278. }
  24279. ;(this.model = this.modelManager.getActiveModel()),
  24280. this.model.on('floor.changed', e.bind(this)),
  24281. this.model.on('allfloors.toggled', t.bind(this)),
  24282. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  24283. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  24284. var e2 = this
  24285. this.model.panos.list.forEach(function (a) {
  24286. a.vrMarker.addEventListener('click', function () {
  24287. e2.flyToPano({
  24288. pano: a
  24289. })
  24290. })
  24291. })
  24292. /********************************************************************************************************************************************/
  24293. this.model.addHighMapCube() //add
  24294. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  24295. }),
  24296. (n.prototype.updateModelDependentData = function () {
  24297. this.cameraControls.setModelForControls(this.model),
  24298. this.getPanoMarkersFromModel(this.model)
  24299. }),
  24300. (n.prototype.onModelChanged = function () {
  24301. this.updateModel(), this.updateModelDependentData()
  24302. }),
  24303. (n.prototype.getPanoMarkersFromModel = function (e) {
  24304. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  24305. return t.marker ? e.concat(t.marker) : e
  24306. }, [])
  24307. }),
  24308. (n.prototype.handleControlMove = function (e) {
  24309. this.emit(w.Move, e)
  24310. }),
  24311. (n.prototype.handleControlInputStart = function (e) {
  24312. this.emit(w.InputStart, e)
  24313. }),
  24314. (n.prototype.onModeUpdated = function (e, t) {
  24315. this.cameraControls.activateControls(t), this.emit(w.ModeChanged, e, t)
  24316. }),
  24317. (n.prototype.isWarping = function () {
  24318. //是否导览缓慢走向某个点
  24319. return this.path.warping
  24320. }),
  24321. (n.prototype.isWaitingToWarp = function () {
  24322. return this.path.waitingToWarp
  24323. }),
  24324. (n.prototype.getLabelScaleFactor = function () {
  24325. if (this.isOutsideMode()) {
  24326. var e = 10,
  24327. t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e)
  24328. return t
  24329. }
  24330. return 0.5
  24331. }),
  24332. /* n.prototype.changeMusic = function() {//xzw add
  24333. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  24334. } */
  24335. (n.prototype.bindEvents = function (e) {
  24336. e !== document && e.setAttribute('tabindex', -1),
  24337. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  24338. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  24339. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  24340. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  24341. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  24342. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  24343. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  24344. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  24345. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  24346. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  24347. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  24348. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  24349. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  24350. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  24351. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  24352. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  24353. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  24354. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  24355. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  24356. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)), //xzw add
  24357. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  24358. // lzb
  24359. window.getSeft && getSeft(this)
  24360. }),
  24361. (n.prototype.onMouseDown = function (e) {
  24362. e.currentTarget !== document && e.currentTarget.focus(),
  24363. 0 === e.button &&
  24364. (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  24365. this.updateIntersect())
  24366. }),
  24367. (n.prototype.onMouseMove = function (e) {
  24368. ;(this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  24369. }),
  24370. (n.prototype.onMouseOver = function (e) {
  24371. ;(this.containsMouse = !0),
  24372. !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1)
  24373. }),
  24374. (n.prototype.onMouseOut = function (e) {
  24375. this.containsMouse = !1
  24376. }),
  24377. (n.prototype.onMouseUp = function (e) {
  24378. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  24379. }),
  24380. (n.prototype.onTouchStart = function (e) {
  24381. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  24382. this.couldBeLongTap = !0
  24383. var t = g.average(e.changedTouches, 'clientX'),
  24384. i = g.average(e.changedTouches, 'clientY')
  24385. this.handleInputStart.call(this, t, i, !0),
  24386. (this.mouseDownTimer = setTimeout(
  24387. function () {
  24388. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0)
  24389. }.bind(this),
  24390. f.input.longTapThreshold
  24391. ))
  24392. }
  24393. }),
  24394. (n.prototype.onTouchMove = function (e) {
  24395. var t = g.average(e.changedTouches, 'clientX'),
  24396. i = g.average(e.changedTouches, 'clientY')
  24397. this.handleInputMove.call(this, t, i, !0)
  24398. }),
  24399. (n.prototype.onTouchEnd = function (e) {
  24400. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  24401. ;(this.couldBeLongTap = !1), this.updateIntersect()
  24402. var t = g.average(e.changedTouches, 'clientX'),
  24403. i = g.average(e.changedTouches, 'clientY')
  24404. this.handleInputEnd.call(this, t, i, !0)
  24405. }
  24406. //add
  24407. if (this.intersectHot) this.intersectHot.setHoverState(false)
  24408. this.intersectHot = null
  24409. Hot.mobileAutoPlay(this)
  24410. }),
  24411. (n.prototype.onPointerDown = function (e) {
  24412. return (
  24413. e.currentTarget !== document && e.currentTarget.focus(),
  24414. this.mouseDown || 'mouse' === e.pointerType
  24415. ? this.onMouseDown(e)
  24416. : ((this.couldBeLongTap = !0),
  24417. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  24418. void (this.mouseDownTimer = setTimeout(
  24419. function () {
  24420. this.updateIntersect(),
  24421. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  24422. }.bind(this),
  24423. f.input.longTapThreshold
  24424. )))
  24425. )
  24426. }),
  24427. (n.prototype.onPointerMove = function (e) {
  24428. 'mouse' !== e.pointerType
  24429. ? this.handleInputMove.call(this, e.clientX, e.clientY, !0)
  24430. : this.onMouseMove(e)
  24431. }),
  24432. (n.prototype.onPointerUp = function (e) {
  24433. return this.mouseDown && 'mouse' !== e.pointerType
  24434. ? (clearTimeout(this.mouseDownTimer),
  24435. (this.couldBeLongTap = !1),
  24436. this.updateIntersect(),
  24437. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  24438. : this.onMouseUp(e)
  24439. }),
  24440. (n.prototype.onPointerOut = function (e) {
  24441. this.mouseDown = !1
  24442. }),
  24443. (n.prototype.onPointerCancel = function (e) {
  24444. this.mouseDown = !1
  24445. }),
  24446. (n.prototype.onKeyDown = function (e) {
  24447. var t = function () {
  24448. this.cameraControls.activeControl &&
  24449. this.cameraControls.activeControl.emit(_.Move, 'key')
  24450. }.bind(this),
  24451. i = e.which
  24452. switch (i) {
  24453. case p.F:
  24454. t(), this.changeFloor(-1)
  24455. break
  24456. case p.R:
  24457. t(), this.changeFloor(1)
  24458. }
  24459. if (this.mode === u.PANORAMA)
  24460. switch (i) {
  24461. case p.UPARROW:
  24462. case p.W:
  24463. this.flyLocalDirection(d.FORWARD.clone())
  24464. break
  24465. case p.DOWNARROW:
  24466. case p.S:
  24467. this.flyLocalDirection(d.BACK.clone())
  24468. break
  24469. case p.A:
  24470. this.flyLocalDirection(d.LEFT.clone())
  24471. break
  24472. case p.D:
  24473. this.flyLocalDirection(d.RIGHT.clone())
  24474. }
  24475. }),
  24476. (n.prototype.handleScrollPinchZoom = (function () {
  24477. return function (e) {
  24478. var t = e,
  24479. i = this.zoomLevel
  24480. this.zoomBy(t),
  24481. this.currentPano &&
  24482. this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  24483. }
  24484. })()),
  24485. (n.prototype.handleControlPinch = function (e) {
  24486. f.zoom.enabled
  24487. ? this.handleScrollPinchZoom(1 - e)
  24488. : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize())
  24489. }),
  24490. (n.prototype.handleControlScroll = function (e) {
  24491. f.zoom.enabled
  24492. ? (e > 0 ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed),
  24493. 0 !== e && this.handleScrollPinchZoom(e))
  24494. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize())
  24495. }),
  24496. (n.prototype.handleInputStart = function (e, t, i) {
  24497. //许钟文加
  24498. var pad = this.handelPadding(e, t)
  24499. e = pad.x
  24500. t = pad.y
  24501. ;(this.isTouchEvent = i),
  24502. m.convertScreenPositionToNDC(e, t, this.mouse),
  24503. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  24504. (this.mouseCouldBeClickToMove = !0),
  24505. (this.mouseDown = !0)
  24506. Hot.mobileAutoPlay(this)
  24507. }),
  24508. (n.prototype.handelPadding = function (x, y) {
  24509. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  24510. if (!this.pad)
  24511. this.pad = {
  24512. //可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  24513. x: dom.getOffset('left', $('#player')[0]),
  24514. y: dom.getOffset('top', $('#player')[0])
  24515. }
  24516. return {
  24517. x: x - this.pad.x,
  24518. y: y - this.pad.y
  24519. }
  24520. })
  24521. ;(n.prototype.handleInputMove = function (e, t, i) {
  24522. //许钟文加
  24523. var pad = this.handelPadding(e, t)
  24524. e = pad.x
  24525. t = pad.y
  24526. ;(this.isTouchEvent = i),
  24527. m.convertScreenPositionToNDC(e, t, this.mouse),
  24528. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC &&
  24529. ((this.mouseCouldBeClickToMove = !1),
  24530. (this.couldBeLongTap = !1),
  24531. clearTimeout(this.mouseDownTimer)),
  24532. (this.mouseLastMoveTime = Date.now()),
  24533. this.reticule.move(e, t, i)
  24534. }),
  24535. (n.prototype.handleInputEnd = function (e, t, i) {
  24536. //xzw
  24537. if (
  24538. ((this.isTouchEvent = i),
  24539. (this.mouseDown = !1),
  24540. this.cameraControls.controls[u.PANORAMA].emit('interaction.direct'),
  24541. !i && this.couldBeLongTap)
  24542. )
  24543. return !0
  24544. if (this.handleLongTap()) return !0
  24545. /* if(this.director.tourIsPlaying){
  24546. return !0;
  24547. } */
  24548. if (this.mouseCouldBeClickToMove) {
  24549. if (this.flying)
  24550. return (
  24551. this.path.activeTransType === x.WALK &&
  24552. this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  24553. !0
  24554. )
  24555. //add----
  24556. if (this.checkHotClick())
  24557. //add
  24558. return !0
  24559. if (this.hoveringPlane) {
  24560. this.clickOverlay(this.hoveringPlane)
  24561. return
  24562. }
  24563. if (
  24564. (this.cameraControls.activeControl &&
  24565. this.cameraControls.activeControl.emit(
  24566. _.Move,
  24567. this.isTouchEvent ? 'touch' : 'mouse'
  24568. ),
  24569. this.history.invalidate(),
  24570. this.intersect)
  24571. )
  24572. return this.flyToPanoClosestToMouse()
  24573. if (this.mode === u.PANORAMA) {
  24574. var n = this.closestPanoInDirection(this.getMouseDirection())
  24575. return n
  24576. ? this.flyToPano({
  24577. pano: n
  24578. })
  24579. : this.bump(this.getMouseDirection())
  24580. }
  24581. }
  24582. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  24583. }),
  24584. (n.prototype.handleLongTap = function () {
  24585. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  24586. return (
  24587. this.cameraControls.activeControl &&
  24588. this.cameraControls.activeControl.emit(_.LongTap, 'touch'),
  24589. !0
  24590. )
  24591. }),
  24592. (n.prototype.checktagClick = function () {
  24593. if (this.tagManager.intersectTag) {
  24594. var e = this.isTouchEvent,
  24595. t = this.tagManager.clickedOnTag(e, this)
  24596. return e || t || y.cancelById(V.LookTransition), !0
  24597. }
  24598. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1
  24599. }),
  24600. (n.prototype.rankedtagInDirection = function (e, t) {
  24601. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  24602. }),
  24603. (n.prototype.start = function (e) {
  24604. //-------------------
  24605. //-------------------
  24606. var t = e.mode,
  24607. i = e.pano,
  24608. n = e.position,
  24609. rr = e.quaternion,
  24610. o = e.tag,
  24611. a = e.quickstart,
  24612. s = $.Deferred()
  24613. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews()
  24614. var l = this.is360View(t, i)
  24615. return (
  24616. !this.model.outsideAllowed() || l || a
  24617. ? this.startInside(i, n, rr, o, s)
  24618. : this.startOutside(e, s),
  24619. s.done(
  24620. function (e) {
  24621. this.emit(w.Ready, l, e, o)
  24622. }.bind(this)
  24623. ),
  24624. s.promise()
  24625. )
  24626. }),
  24627. (n.prototype.startOutside = function (e, t) {
  24628. var i = e.mode,
  24629. n = e.pano,
  24630. r = e.position,
  24631. o = e.quaternion,
  24632. a = e.zoom,
  24633. s = e.floorVisibility,
  24634. l = e.tag
  24635. this.emit(w.StartOutside, f[i].transitionTime),
  24636. this.isOutsideMode(i)
  24637. ? (this.model.warpDestFloors(s, !0),
  24638. y.cancelById(V.FlyToViewFloor),
  24639. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  24640. t.resolve(!1))
  24641. : this.startInsideWithFlyin(n, r, o, l, t)
  24642. }),
  24643. (n.prototype.startInside = function (e, t, i, n, r) {
  24644. ;(r = r || $.Deferred()), (this.currentPano = e)
  24645. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  24646. this.ready = true
  24647. var o = e && !e.isAligned()
  24648. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  24649. var a = this.startInside.bind(this, e, t, i, n, r)
  24650. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return
  24651. }
  24652. //add
  24653. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 })
  24654. //this.updateHotVisible()
  24655. Hot.updateVisibles([this.currentPano])
  24656. this.modeTran = 'panorama-panorama'
  24657. return (
  24658. (this.mode = u.PANORAMA),
  24659. e.floor.enter(this.mode),
  24660. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  24661. this.switchCameraMode(this.mode, i),
  24662. this.emit(w.StartInside, o),
  24663. r.resolve(!0),
  24664. r
  24665. )
  24666. }),
  24667. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  24668. if (((r = r || $.Deferred()), this.dollhouseMode(), !e))
  24669. return (
  24670. F.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'),
  24671. r.resolve(!1),
  24672. r
  24673. )
  24674. t = t || e.position
  24675. var o = i || this.cameraControls.activeControl.camera.quaternion,
  24676. a = e.position
  24677. return (
  24678. this.fitDollhouse(a, t, o),
  24679. setTimeout(
  24680. function (t) {
  24681. this.cameraControls.activeControl &&
  24682. (this.cameraControls.activeControl.maxDistance = t)
  24683. var n = {
  24684. mode: u.PANORAMA,
  24685. pano: e,
  24686. quaternion: i,
  24687. callback: function () {
  24688. this.emit(w.FlyinFinished), r.resolve(!0)
  24689. }.bind(this)
  24690. }
  24691. this.flyToNewMode(n)
  24692. }.bind(this, this.cameraControls.activeControl.maxDistance),
  24693. f.startupFlyinDelay
  24694. ),
  24695. r
  24696. )
  24697. }),
  24698. (n.prototype.checkAndWaitForPanoLoad = (function () {
  24699. var e = {},
  24700. t = {},
  24701. i = 5e3,
  24702. n = function () {
  24703. for (var n in e)
  24704. if (e.hasOwnProperty(n) && e[n]) {
  24705. var r = performance.now() - t[n]
  24706. if (r < i) return !0
  24707. }
  24708. return !1
  24709. }
  24710. return function (r, o, a, s, l, c, h, u, d, p) {
  24711. if (n()) return !0
  24712. var f = function (t, i, n) {
  24713. N.delayOneFrame(
  24714. function () {
  24715. ;(e[t] = !1), l && l(i, n)
  24716. }.bind(this)
  24717. )
  24718. }.bind(this, r.id),
  24719. g = function (t, i) {
  24720. N.delayOneFrame(
  24721. function () {
  24722. ;(e[t] = !1), c && c(i)
  24723. }.bind(this)
  24724. )
  24725. }.bind(this, r.id)
  24726. try {
  24727. return (
  24728. (null !== u && void 0 !== u) || (u = !0),
  24729. this.model.supportsTiles
  24730. ? (e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p))
  24731. : (e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u)),
  24732. e[r.id] && (t[r.id] = performance.now()),
  24733. e[r.id]
  24734. )
  24735. } catch (n) {
  24736. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n)
  24737. }
  24738. }
  24739. })()),
  24740. (n.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  24741. if (!e)
  24742. throw new M(
  24743. 'Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.'
  24744. )
  24745. return (
  24746. r &&
  24747. this.model.waitForLoad(e, function () {
  24748. return e.isLoaded(i)
  24749. }),
  24750. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  24751. )
  24752. }),
  24753. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  24754. var e = new r.Vector3()
  24755. return function (t, i, n, r, o, a, s, l) {
  24756. if (!t)
  24757. throw new M(
  24758. 'Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.'
  24759. )
  24760. return (
  24761. e.copy(d.FORWARD),
  24762. this.getDirection(e),
  24763. !t.isLoaded(i) &&
  24764. (a &&
  24765. this.model.waitForLoad(t, function () {
  24766. return t.isLoaded(i)
  24767. }),
  24768. t
  24769. .loadTiledPano(i, e, null, s, l)
  24770. .done(
  24771. function (e, t) {
  24772. n && n(e, t)
  24773. }.bind(this)
  24774. )
  24775. .fail(
  24776. function (e) {
  24777. r && r(e)
  24778. }.bind(this)
  24779. )
  24780. .progress(
  24781. function (e, t, i) {
  24782. o && o(e, t, i)
  24783. }.bind(this)
  24784. ),
  24785. !0)
  24786. )
  24787. }
  24788. })()),
  24789. (n.prototype.switchCameraMode = function (e, t) {
  24790. var i = this.cameraControls.controls[e],
  24791. n = i.camera
  24792. switch (e) {
  24793. case u.PANORAMA:
  24794. n.position.copy(this.currentPano.position)
  24795. var o = t
  24796. ? d.FORWARD.clone().applyQuaternion(t)
  24797. : this.getDirection().setY(0).normalize()
  24798. i.lookAt(o.add(n.position))
  24799. break
  24800. case u.DOLLHOUSE:
  24801. /* var a = this.position.clone();
  24802. 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),
  24803. n.position.copy(a),
  24804. i.target.copy(this.target.clone().setY(this.model.center.y));
  24805. break; */
  24806. //for多楼层 且 让模型刚好适应屏幕
  24807. var box = this.model.boundingBox.clone()
  24808. box.applyMatrix4(this.camera.matrixWorld) //将 boundingbox、也就是模型, 转换到当前相机朝向
  24809. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  24810. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1) //获得在当前窗口的横向的fov
  24811. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2)) //根据上面获得的参数得到target到相机的距离
  24812. //console.log(boxSize.x,distance, boxSize.length() / 2)
  24813. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  24814. if (this.mode === u.PANORAMA) {
  24815. i.target.copy(this.model.center)
  24816. var vec = this.getDirection().negate().setY(1).normalize() //获得朝向
  24817. } else {
  24818. i.target.copy(this.target.clone().setY(this.model.center.y))
  24819. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  24820. }
  24821. vec.multiplyScalar(distance)
  24822. n.position.copy(i.target.clone().add(vec))
  24823. break
  24824. case u.FLOORPLAN:
  24825. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  24826. i.target.copy(this.model.center).setY(0),
  24827. i.zoomToContain(this.model.size),
  24828. i.rotateToView(this.model.size, this.getDirection())
  24829. }
  24830. i.update(0)
  24831. }),
  24832. (n.prototype.update = (function () {
  24833. var e = (new r.Vector3(), {}),
  24834. t = []
  24835. return function (i) {
  24836. this.updatePersistentZooming(i),
  24837. this.updateFromControls(i),
  24838. this.getCurrentNodePanos(t)
  24839. this.lastFrameChanged = false
  24840. if (this.hasChanged(e)) {
  24841. this.lastFrameChanged = e.cameraChanged3
  24842. ? 'level3'
  24843. : e.cameraChanged2
  24844. ? 'level2'
  24845. : e.cameraChanged
  24846. ? 'level1'
  24847. : false
  24848. ;(this.lastChangeTime = Date.now()),
  24849. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  24850. this.emit(w.ViewChanged, e),
  24851. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  24852. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  24853. }
  24854. if (e.cameraChanged2) {
  24855. //变化要更大些
  24856. }
  24857. if (e.cameraChanged) {
  24858. this.mode == 'panorama' &&
  24859. window.cad &&
  24860. cad.setSign(
  24861. { x: this.position.x, y: this.position.z },
  24862. this.cameraControls.controls.panorama.lon
  24863. )
  24864. /* for(var i in this.model.hots){
  24865. this.model.hots[i].updateTitle(this)
  24866. } */
  24867. Hot.updateHots()
  24868. }
  24869. this.model.supportsTiles &&
  24870. (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  24871. this.updatePreRendering(t),
  24872. this.reticule.update(),
  24873. this.path.update(),
  24874. this.spider.update(),
  24875. this.cachedPanoCandidates &&
  24876. f.navigation.panoScores &&
  24877. this.model.panos.showPanoScores(this.cachedPanoCandidates),
  24878. this.updateControlLocks(),
  24879. this.model.supportsTiles && this.updateZoomPano()
  24880. }
  24881. })()),
  24882. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  24883. var lastMode, lastPano;
  24884. return function(){
  24885. var mode = this.mode;
  24886. var pano = mode == "panorama" ? this.currentPano : "";
  24887. if(mode != "panorama" || pano != lastPano){
  24888. overlay.noBlock = null
  24889. }
  24890. this.overlayGroup.children.forEach((overlay)=>{
  24891. if(overlay.overlayType == "video" ){
  24892. var matrix = overlay.plane.matrixWorld;
  24893. var inSight = false;
  24894. var cameraDir = this.getDirection();
  24895. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  24896. var vertexes = []
  24897. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  24898. for(let i=0; i<4; i++){
  24899. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  24900. vertexes.push(vertex)
  24901. if(overlay.noBlock == null){
  24902. if(!m.ifShelter(vertex)){
  24903. overlay.noBlock = true
  24904. }
  24905. inSight = true; break;
  24906. }else{
  24907. overlay.noBlock = true
  24908. }
  24909. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  24910. inSight = true; break;
  24911. }
  24912. }
  24913. }
  24914. overlay.inSight = inSight
  24915. if(!inSight)overlay.plane.material.map.image.pause()
  24916. else overlay.plane.material.map.image.play()//maybe fail
  24917. }
  24918. })
  24919. lastMode = mode, lastPano = pano
  24920. }
  24921. }() */
  24922. (n.prototype.updatePersistentZooming = function (e) {
  24923. 1 === this.zooming
  24924. ? this.zoomBy(1 + this.zoomSpeed * e)
  24925. : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  24926. }),
  24927. (n.prototype.updateControlLocks = function () {
  24928. this.currentPano &&
  24929. this.model.supportsTiles &&
  24930. (this.cameraControls.controls[u.PANORAMA].locked =
  24931. !this.currentPano.highestFullTileRenderOpCompleted &&
  24932. this.currentPano.lockUntilRenderingComplete)
  24933. }),
  24934. (n.prototype.updatePanoRenderer = (function () {
  24935. var e = new r.Vector3()
  24936. return function (t) {
  24937. var i = this.nextPano || this.currentPano
  24938. this.panoRenderer.hasQueuedTiles() &&
  24939. i &&
  24940. (e.copy(d.FORWARD), this.getDirection(e), this.panoRenderer.updateDirection(e))
  24941. }
  24942. })()),
  24943. (n.prototype.cleanupInactivePanos = (function () {
  24944. var e = [],
  24945. t = []
  24946. return function () {
  24947. ;(e.length = 0),
  24948. e.push(this.currentPano),
  24949. this.nextPano && e.push(this.nextPano),
  24950. (t.length = 0)
  24951. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  24952. t.push(this.panoRenderer.activePanos[i])
  24953. for (var n = 0; n < t.length; n++) {
  24954. for (var r = t[n], o = !0, a = 0; a < e.length; a++) r.id === e[a].id && (o = !1)
  24955. o && r.exit()
  24956. }
  24957. }
  24958. })()),
  24959. (n.prototype.updatePreRendering = (function () {
  24960. var e = {}
  24961. return function (t) {
  24962. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  24963. var i = this.nextPano || this.currentPano
  24964. if (i && t && t.length > 1) {
  24965. var n = t.findIndex(function (e) {
  24966. if (e.id === i.id) return !0
  24967. })
  24968. if (n >= 0 && n + 1 < t.length) {
  24969. var r = t[n + 1]
  24970. r.isLoaded(this.basePanoSize) ||
  24971. e[r.id] ||
  24972. (window.setTimeout(
  24973. function (t) {
  24974. this.checkAndWaitForPanoLoad(
  24975. t,
  24976. 'high',
  24977. 'low',
  24978. this.basePanoSize,
  24979. null,
  24980. null,
  24981. null,
  24982. !1,
  24983. !1,
  24984. !1
  24985. ),
  24986. window.setTimeout(
  24987. function (t) {
  24988. e[t.id] = !1
  24989. }.bind(this, t),
  24990. f.tiling.panoPreRenderRepeatDelay
  24991. )
  24992. }.bind(this, r),
  24993. f.tiling.panoPreRenderDelay
  24994. ),
  24995. (e[r.id] = !0))
  24996. }
  24997. }
  24998. }
  24999. }
  25000. })()),
  25001. (n.prototype.enablePreRendering = function () {
  25002. this.preRenderingEnabled = !0
  25003. }),
  25004. (n.prototype.disablePreRendering = function () {
  25005. ;(this.preRenderingEnabled = !1), this.cleanupInactivePanos()
  25006. }),
  25007. (n.prototype.updateTileDownloader = (function () {
  25008. var e = new r.Vector3()
  25009. return function (t) {
  25010. var i = this.nextPano || this.currentPano
  25011. i &&
  25012. (e.copy(d.FORWARD),
  25013. this.getDirection(e),
  25014. this.tileDownloader.tilePrioritizer.updateCriteria(
  25015. i,
  25016. this.position,
  25017. e,
  25018. t.length > 0 ? t : null
  25019. ),
  25020. (this.tileDownloader.processPriorityQueue = !0))
  25021. }
  25022. })()),
  25023. (n.prototype.updateFromControls = function (e) {
  25024. ;(null !== e && void 0 !== e) || (e = 0),
  25025. this.cameraControls.activeControl &&
  25026. (this.cameraControls.activeControl.update(e),
  25027. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  25028. this.position.copy(this.cameraControls.activeControl.camera.position),
  25029. this.target.copy(this.cameraControls.activeControl.target),
  25030. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  25031. this.camera.projectionMatrix.copy(
  25032. this.cameraControls.activeControl.camera.projectionMatrix
  25033. )),
  25034. this.camera.position.copy(this.position),
  25035. this.camera.quaternion.copy(this.quaternion),
  25036. this.camera.updateMatrix(),
  25037. this.camera.updateMatrixWorld()
  25038. }),
  25039. (n.prototype.hasChanged = function (e) {
  25040. if (!this.previousState) {
  25041. this.previousState = {
  25042. allFloorsVisible: this.model.allFloorsVisible,
  25043. position: this.position.clone(),
  25044. quaternion: this.quaternion.clone(),
  25045. mouse: this.mouse.clone(),
  25046. //labelScaleFactor: this.getLabelScaleFactor(),
  25047. currentFloor: this.model.currentFloor,
  25048. projectionMatrix: this.camera.projectionMatrix.clone(),
  25049. worldMatrix: this.camera.matrixWorld.clone(),
  25050. mode: this.mode,
  25051. modelPosition: this.model.position.clone(),
  25052. modelCenter: this.model.center.clone(),
  25053. zoomLevel: this.zoomLevel
  25054. }
  25055. e.cameraChanged = e.cameraChanged2 = true
  25056. return !0
  25057. }
  25058. //许钟文改 分成相机是否改变cameraChanged 和其他
  25059. var a =
  25060. this.position.equals(this.previousState.position) &&
  25061. this.quaternion.equals(this.previousState.quaternion) &&
  25062. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  25063. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  25064. this.mode === this.previousState.mode &&
  25065. this.zoomLevel === this.previousState.zoomLevel &&
  25066. this.model.center.equals(this.previousState.modelCenter) &&
  25067. this.model.position.equals(this.previousState.modelPosition)
  25068. var t =
  25069. a &&
  25070. this.mouse.equals(this.previousState.mouse) &&
  25071. this.model.allFloorsVisible ===
  25072. this.previousState
  25073. .allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  25074. this.model.currentFloor === this.previousState.currentFloor &&
  25075. null === this.nextPano
  25076. e.cameraChanged = !a
  25077. ;(e.allFloorsVisible =
  25078. this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  25079. (e.moved = !this.position.equals(this.previousState.position)),
  25080. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  25081. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  25082. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  25083. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  25084. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(
  25085. this.previousState.projectionMatrix
  25086. )),
  25087. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(
  25088. this.previousState.worldMatrix
  25089. )),
  25090. (e.modeChanged = this.mode !== this.previousState.mode),
  25091. (e.modelPositionChanged = !this.model.position.equals(
  25092. this.previousState.modelPosition
  25093. )),
  25094. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  25095. (e.nextPanoActive = null !== this.nextPano),
  25096. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel)
  25097. /* if(e.cameraChanged){//
  25098. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
  25099. }else e.cameraChanged2 = false */
  25100. if (e.cameraChanged) {
  25101. e.cameraChanged2 =
  25102. e.cameraProjectionChanged ||
  25103. !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) ||
  25104. !MathLight.closeTo(this.position, this.previousState.position, 4)
  25105. e.cameraChanged3 =
  25106. e.cameraProjectionChanged ||
  25107. !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) ||
  25108. !MathLight.closeTo(this.position, this.previousState.position, 3)
  25109. } else {
  25110. e.cameraChanged2 = false
  25111. e.cameraChanged3 = false
  25112. }
  25113. ;(this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  25114. this.previousState.position.copy(this.position),
  25115. this.previousState.quaternion.copy(this.quaternion),
  25116. this.previousState.mouse.copy(this.mouse),
  25117. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  25118. (this.previousState.currentFloor = this.model.currentFloor),
  25119. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  25120. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  25121. (this.previousState.mode = this.mode),
  25122. this.previousState.modelPosition.copy(this.model.position),
  25123. this.previousState.modelCenter.copy(this.model.center),
  25124. (this.previousState.zoomLevel = this.zoomLevel)
  25125. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  25126. return !t
  25127. }),
  25128. (n.prototype.updateIntersect = function () {
  25129. var e = this.flying || this.isWarping(),
  25130. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  25131. i = y.getById(V.LookTransition),
  25132. n = !(e || t || this.isTouchEvent || (i.length && i[0].running))
  25133. {
  25134. //clear:
  25135. if (this.intersectHot) this.intersectHot.setHoverState(false)
  25136. this.intersectHot = null
  25137. CursorDeal.remove('hoverHot')
  25138. }
  25139. var deal = () => {
  25140. if (this.intersect && this.intersect.object.visible) {
  25141. if ('hotSprite' == this.intersect.object.type) {
  25142. this.intersectHot = this.intersect.object
  25143. while (!(this.intersectHot instanceof Hot)) {
  25144. this.intersectHot = this.intersectHot.parent
  25145. }
  25146. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass(
  25147. 'active'
  25148. )
  25149. this.intersectHot.setHoverState(true)
  25150. }
  25151. }
  25152. }
  25153. if (this.model.hotGroup) {
  25154. var hots = this.model.hotGroup.children.filter(
  25155. e =>
  25156. e.info.actionType.examine ||
  25157. e.info.actionType.fastTran ||
  25158. e.info.actionType.openHot ||
  25159. e.info.actionType.playAndPause
  25160. )
  25161. let colliders = this.model.floors.reduce(
  25162. function (e, t) {
  25163. return t.hidden ? e : e.concat(t.collider.children)
  25164. },
  25165. this.mode === 'panorama' ? this.panoMarkers : []
  25166. )
  25167. this.intersect = this.getMouseIntersect(
  25168. null,
  25169. hots.concat(colliders /* this.model.colliders */)
  25170. )
  25171. if (this.intersect) {
  25172. deal()
  25173. let intersect = this.intersect
  25174. if (this.intersectHot) {
  25175. this.intersect = null
  25176. CursorDeal.add('hoverHot')
  25177. } else {
  25178. if (intersect.object.parent.parent.hidden) {
  25179. //楼层已隐藏
  25180. this.intersect = null
  25181. }
  25182. }
  25183. }
  25184. } else {
  25185. this.intersect = this.getMouseIntersect()
  25186. }
  25187. this.intersect && this.updateClosestPano(this.intersect),
  25188. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  25189. ? (this.reticule.updatePosition(this.position, this.intersect),
  25190. f.navigation.panoScores &&
  25191. !f.navigation.mouseDirection &&
  25192. this.closestPanoInDirection(this.getDirection()))
  25193. : this.reticule.hide()
  25194. }),
  25195. (n.prototype.checkHotClick = function () {
  25196. if (this.intersectHot) {
  25197. if (
  25198. this.intersectHot.texType == 'video' &&
  25199. this.intersectHot.info.actionType.playAndPause
  25200. ) {
  25201. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  25202. }
  25203. this.intersectHot.examine(this)
  25204. return true
  25205. }
  25206. }),
  25207. (n.prototype.getMouseDirection = function (e) {
  25208. e = e || this.mouse
  25209. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  25210. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera)
  25211. return i.sub(t).normalize()
  25212. }),
  25213. (n.prototype.hoverOverlay = function (mesh) {
  25214. if (!mesh) {
  25215. this.hoveringPlane = null
  25216. $('#player').css('cursor', this.currentCursor || '')
  25217. } else {
  25218. var overlay = mesh.parent
  25219. $('#player').css('cursor', 'pointer')
  25220. this.hoveringPlane = overlay
  25221. return true
  25222. }
  25223. }),
  25224. (n.prototype.clickOverlay = function (overlay) {
  25225. if (this.openOverlay && !overlay) return
  25226. var plane = overlay.plane
  25227. /* if(overlay.overlayType == "video"){
  25228. if(plane.material.map.image.paused) plane.material.map.image.play()
  25229. else plane.material.map.image.pause()
  25230. } */
  25231. if (overlay.overlayType == 'video') {
  25232. overlay.switchPlay(!!overlay.pausedByUser)
  25233. }
  25234. /* if(window.EditOverlay &&EditOverlay.editing){
  25235. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  25236. $('#overlayProp').removeClass('atRight').removeClass('hide')
  25237. EditOverlay.endAddPlane();
  25238. EditOverlay.updateOverlayPanel(overlay)
  25239. EditOverlay.controlSelectOverlay(overlay)
  25240. return;
  25241. } */
  25242. }),
  25243. (n.prototype.getMouseIntersect = function (e, t) {
  25244. //xzw change
  25245. ;(e = e || this.mouse.clone()),
  25246. (t =
  25247. t ||
  25248. this.model.floors.reduce(
  25249. function (e, t) {
  25250. return t.hidden ? e : e.concat(t.collider.children)
  25251. },
  25252. this.mode === u.PANORAMA ? this.panoMarkers : []
  25253. ))
  25254. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera)
  25255. this.raycaster.set(i, this.getMouseDirection(e))
  25256. var n = this.raycaster.intersectObjects(t, true) //add true
  25257. var o = n[0]
  25258. if (o) {
  25259. o.face &&
  25260. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  25261. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  25262. this.currentPano
  25263. ? (o.onFloor = o.point.y < this.position.y - 0.5 * this.currentPano.height)
  25264. : (o.onFloor = o.point.y < this.position.y - 0.5),
  25265. (o.horizontal = 0.8 < o.normal.y))
  25266. return o
  25267. }
  25268. }),
  25269. (n.prototype.updateClosestPano = function (e) {
  25270. var t = [s.filters.isPanoAligned()]
  25271. if (this.mode === u.PANORAMA) {
  25272. if (!this.currentPano) return
  25273. t.push(s.filters.not(this.currentPano)),
  25274. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  25275. t.push(
  25276. s.filters.inFloorDirection(
  25277. this.currentPano.floorPosition,
  25278. this.getDirection(),
  25279. 0.25
  25280. )
  25281. ),
  25282. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  25283. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  25284. } else {
  25285. t.push(s.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor) //add
  25286. this.mode !== u.FLOORPLAN &&
  25287. t.push(s.filters.inDirection(this.position, this.getDirection(), 0.25))
  25288. }
  25289. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)])
  25290. i !== this.closestPano
  25291. ? (i && (this.isPanoHover = !0),
  25292. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  25293. (this.closestPano = i),
  25294. this.closestPano && this.mode == 'panorama'
  25295. ? CursorDeal.add('hoverPano')
  25296. : CursorDeal.remove('hoverPano')) //add
  25297. : (this.isPanoHover = !1)
  25298. }),
  25299. (n.prototype.dollhouseMode = function (e, t) {
  25300. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  25301. (this.mode = u.DOLLHOUSE),
  25302. this.cameraControls.controls[u.DOLLHOUSE].reset()
  25303. var i = new r.Vector3(this.model.center.x, 0, this.model.center.z),
  25304. n = new r.Vector3(15, 10, 15)
  25305. if (e && t) {
  25306. var o = d.FORWARD.clone().applyQuaternion(t),
  25307. a = this.model.center.clone().sub(e),
  25308. s = a.dot(o)
  25309. s > 0
  25310. ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e))
  25311. : F.warn(
  25312. "Tried to initiate dollhouse mode that wasn't looking at the model",
  25313. e,
  25314. t
  25315. )
  25316. }
  25317. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  25318. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  25319. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  25320. this.updateFromControls(),
  25321. (this.model.alpha = 1),
  25322. (this.model.skybox.material.uniforms.opacity.value = 0)
  25323. }),
  25324. (n.prototype.insideMode = function (e, t) {
  25325. var i = $.Deferred(),
  25326. n = t || null
  25327. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  25328. var r = [s.filters.isPanoAligned()]
  25329. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  25330. (e =
  25331. e ||
  25332. this.currentPano ||
  25333. this.model.panos.find(r, [
  25334. s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)
  25335. ])),
  25336. this.flyToNewMode({
  25337. mode: u.PANORAMA,
  25338. pano: e,
  25339. callback: n
  25340. })
  25341. .done(i.resolve.bind(i))
  25342. .fail(i.reject.bind(i))
  25343. } else {
  25344. var o =
  25345. this.mode === u.PANORAMA
  25346. ? 'Already in panorama mode'
  25347. : 'Cannot change mode during mode transition'
  25348. i.reject(o)
  25349. }
  25350. return i.promise()
  25351. }),
  25352. (n.prototype.fitDollhouse = function (e, t, i) {
  25353. //许钟文改 飞入前寻找和初始视角最合适的位置
  25354. //if(urlHasValue('oldEntry')){
  25355. //搬自一代。
  25356. var maxY = this.model.boundingBox.max.y
  25357. var n = d.FORWARD.clone().applyQuaternion(i),
  25358. i = n.clone().add(e)
  25359. this.cameraControls.activeControl.target.copy(i),
  25360. this.cameraControls.activeControl.camera.position
  25361. .set(0, maxY * 2.4, 0)
  25362. .add(e)
  25363. .add(n.multiplyScalar(-10))
  25364. //return;
  25365. /* //this.camera.position.copy(this.model.center);
  25366. //this.camera.updateMatrixWorld()
  25367. this.switchCameraMode("dollhouse", i) */
  25368. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  25369. //直接用一代的这个 效果和二代几乎一样,且不会甩
  25370. /* var n = d.FORWARD.clone().applyQuaternion(i);
  25371. this.cameraControls.activeControl.target.copy(n).add(e);
  25372. var o = d.RIGHT.clone().applyQuaternion(i)
  25373. , a = d.UP.clone()
  25374. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  25375. , l = this.model.boundingBox.max.clone()
  25376. , c = this.model.boundingBox.min.clone()
  25377. , 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)]
  25378. , u = 0
  25379. , p = 0
  25380. , g = 0;
  25381. h.forEach(function(e, t, i) {
  25382. var n = Math.abs(e.dot(o))
  25383. , r = e.dot(s);
  25384. n > u && (u = n,
  25385. p = r),
  25386. r > g && (g = r)
  25387. });
  25388. 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)))
  25389. , v = s.clone().multiplyScalar(p).add(t)
  25390. , A = s.clone().multiplyScalar(g).add(t);
  25391. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  25392. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  25393. p = Math.max(p, 10),
  25394. g = Math.max(g, 10);
  25395. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  25396. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  25397. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  25398. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  25399. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  25400. */
  25401. }),
  25402. (n.prototype.floorplanMode = function (e, t, i) {
  25403. this.mode = u.FLOORPLAN
  25404. var n = this.cameraControls.controls[u.FLOORPLAN]
  25405. n.reset()
  25406. var r = e ? e : this.model.center
  25407. if (
  25408. (n.target.copy(r).setY(0),
  25409. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  25410. i
  25411. ? ((n.currentScale = i / ($('#player').width() / $('#player').height())),
  25412. (n.absoluteScale = n.currentScale))
  25413. : n.zoomToContain(this.model.size),
  25414. t)
  25415. ) {
  25416. var o = d.LEFT.clone().applyQuaternion(t)
  25417. n.rotateLeft(-Math.atan2(o.x, o.z))
  25418. } else n.rotateToView(this.model.size, this.getDirection())
  25419. n.update(0)
  25420. }),
  25421. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  25422. return (e.skipWarpingCheck = !0), this.flyToPano(e, t)
  25423. }),
  25424. (n.prototype.updateMarkerVisi = function () {
  25425. //加
  25426. if (this.mode != 'panorama') return
  25427. this.model.panos.list.forEach(pano => {
  25428. if (!pano.marker) return
  25429. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id]
  25430. })
  25431. }),
  25432. /* n.prototype.updateHotVisible = function(pano){
  25433. var hots = this.model.hots;
  25434. pano = pano || this.currentPano;
  25435. for (var index in hots){
  25436. var visible;
  25437. if(this.mode != "panorama"){
  25438. visible = true;
  25439. }else{
  25440. //hots[index].mesh.material.depthTest = false;
  25441. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  25442. }
  25443. hots[index].mesh.visible = visible;
  25444. }
  25445. } */
  25446. (n.prototype.flyToPano = function (e, t) {
  25447. var i = e.pano,
  25448. aim = e.lookAtPoint,
  25449. aimQua = e.quaternion, //ADD
  25450. o = e.duration,
  25451. a = e.aimDuration,
  25452. s = e.maxDistanceOverride,
  25453. l = e.skipWarpingCheck,
  25454. c = e.constantMoveSpeed,
  25455. h = null,
  25456. p = null
  25457. if (aim) {
  25458. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP)
  25459. aimQua = new r.Quaternion().setFromRotationMatrix(_)
  25460. } else aimQua = aimQua
  25461. var zoomLevel = e.zoomLevel || 1 //add
  25462. if (this.flying) return t && t(e)
  25463. window.specialScene &&
  25464. specialScene.special().specifySpot &&
  25465. specialScene.special().specifySpot(i)
  25466. if (
  25467. this.isWarping() &&
  25468. !l &&
  25469. (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD)
  25470. )
  25471. return F.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1
  25472. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  25473. var m
  25474. void this.flyToNewMode({
  25475. mode: u.PANORAMA,
  25476. pano: i,
  25477. duration: o,
  25478. quaternion: aimQua,
  25479. callback: t
  25480. })
  25481. }
  25482. if (
  25483. !i ||
  25484. ((h = g.deepExtend(e)),
  25485. (p = function () {
  25486. N.delayOneFrame(
  25487. function () {
  25488. this.flyToPano(h, t)
  25489. }.bind(this)
  25490. )
  25491. }.bind(this)),
  25492. !this.checkAndWaitForPanoLoad(i, 'high', 'low', this.basePanoSize, p))
  25493. ) {
  25494. var C = function (e) {
  25495. t && t(e)
  25496. }.bind(this)
  25497. this.currentPano ||
  25498. ((this.currentPano = i),
  25499. this.path.placeCpm(),
  25500. this.path.fadeOutCpm(f.path.fadeOutTime),
  25501. this.spider.draw())
  25502. var I = o
  25503. if ('number' != typeof o) {
  25504. var E = s || f.transition.flytimeMaxDistanceThreshold
  25505. I =
  25506. Math.min(this.currentPano.position.distanceTo(i.position), E) *
  25507. f.transition.flytimeDistanceMultiplier +
  25508. f.transition.flyTime
  25509. }
  25510. if (
  25511. (f.transition.flySpeed > 0.01 &&
  25512. (I =
  25513. (1e3 * this.currentPano.position.distanceTo(i.position)) /
  25514. f.transition.flySpeed),
  25515. zoomLevel !== this.zoomLevel)
  25516. )
  25517. switch (f.zoom.transitionStyle) {
  25518. case 1:
  25519. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I) //改
  25520. break
  25521. case 2:
  25522. return (
  25523. (h = g.deepExtend(e)),
  25524. (p = this.flyToPano.bind(this, h, t)),
  25525. void this.smoothZoomFovTo(
  25526. null,
  25527. zoomLevel,
  25528. f.zoom.restoreTime * (this.zoomLevel - 1),
  25529. p
  25530. )
  25531. )
  25532. }
  25533. if (aimQua) {
  25534. y.cancelById(V.LookTransition), (I *= f.transition.aimSlowFactor)
  25535. var b = this.cameraControls.activeControl.camera.quaternion.clone(),
  25536. S = b.clone(),
  25537. M = new r.Vector3()
  25538. if (i === this.currentPano) {
  25539. var R = d.FORWARD.clone().applyQuaternion(b),
  25540. P = d.FORWARD.clone().applyQuaternion(aimQua),
  25541. O = R.angleTo(P)
  25542. return (
  25543. (void 0 !== a && null !== a) ||
  25544. (a = ((1 * Math.sqrt(O)) / f.tags.navigate.rotateSpeedFactor) * 1e3),
  25545. void y.start(
  25546. function (e) {
  25547. S.copy(b),
  25548. v.quaternion(S, aimQua)(e),
  25549. M.copy(d.FORWARD)
  25550. .applyQuaternion(S)
  25551. .add(this.cameraControls.activeControl.camera.position),
  25552. this.cameraControls.activeControl.lookAt(M)
  25553. }.bind(this),
  25554. a,
  25555. C,
  25556. 0,
  25557. A[f.transition.movementEasing],
  25558. null,
  25559. V.LookTransition
  25560. )
  25561. )
  25562. }
  25563. }
  25564. if (i === this.currentPano) return void C()
  25565. this.flying = !0
  25566. var L = this.position.clone(),
  25567. D = this.currentPano
  25568. F.debug('Flying to pano ', i.position),
  25569. this.emit(w.PanoChosen, this.currentPano, i),
  25570. this.emit(w.FlyingStarted, i.position, L, i, D)
  25571. //---------before fly--------------- add
  25572. this.transitionPos({ type: 'beforeFlytopano', pano: i, dur: I }) //add
  25573. Hot.updateVisibles([this.currentPano, i], 'every')
  25574. //地标变化
  25575. if (this.model.floorLogos) {
  25576. this.model.changefloorLogoOpa({ index: 0, opa: 0, dur: p, delay: 0.7 }) //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  25577. this.model.floorLogos[1].position.copy(
  25578. i.floorPosition.clone().sub(this.model.position)
  25579. )
  25580. //this.model.adjustfloorLogoHeight();
  25581. this.model.floorLogos[1].material.opacity = 0 //uniforms.opacity.value = 0;
  25582. this.model.floorLogos[1].visible = true
  25583. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }) //this.model.floorLogoShow(1,250);
  25584. }
  25585. //=======================================
  25586. this.nextPano = i
  25587. let beginTran = () => {
  25588. aimQua &&
  25589. y.start(
  25590. function (e) {
  25591. S.copy(b),
  25592. v.quaternion(S, aimQua)(e),
  25593. M.copy(d.FORWARD)
  25594. .applyQuaternion(S)
  25595. .add(this.cameraControls.activeControl.camera.position),
  25596. this.cameraControls.activeControl.lookAt(M)
  25597. }.bind(this),
  25598. I,
  25599. null,
  25600. 0,
  25601. A[f.transition.movementEasing],
  25602. null,
  25603. V.LookTransition
  25604. )
  25605. var B = c ? null : A[f.transition.movementEasing]
  25606. y.start(
  25607. v.uniform(this.model.skybox, 'progress', 1),
  25608. I,
  25609. null,
  25610. 0,
  25611. A[f.transition.blendEasing],
  25612. 'skyFly',
  25613. V.FlyToPano
  25614. ),
  25615. y.start(
  25616. v.allUniforms(this.model.chunks, 'progress', 1),
  25617. I,
  25618. null,
  25619. 0,
  25620. A[f.transition.blendEasing],
  25621. 'chunkFly',
  25622. V.FlyToPano
  25623. ),
  25624. y.start(
  25625. v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position),
  25626. I,
  25627. function (e) {
  25628. ;(this.flying = !1),
  25629. this.currentPano !== i && this.currentPano.exit(),
  25630. i.enter(),
  25631. (this.currentPano = i),
  25632. (this.nextPano = null),
  25633. this.path.placeCpm(),
  25634. this.path.fadeOutCpm(f.path.fadeOutTime),
  25635. this.spider.draw(),
  25636. this.emit(w.FlyingEnded, i.position, L, i, D),
  25637. this.updateMarkerVisi(), //add
  25638. C(e)
  25639. //add:
  25640. if (this.mode == 'panorama') {
  25641. if (this.model.floorLogos) {
  25642. this.model.floorLogos[0].position.copy(
  25643. this.model.floorLogos[1].position
  25644. )
  25645. //this.model.adjustfloorLogoHeight()
  25646. this.model.changefloorLogoOpa({ index: 0, opa: 1, dur: 0 }) //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  25647. this.model.floorLogos[1].visible = false
  25648. }
  25649. this.model.fadePanoMarkers() //add
  25650. Hot.updateVisibles([this.currentPano]) //add
  25651. }
  25652. }.bind(this),
  25653. 0,
  25654. B,
  25655. 'camFly',
  25656. V.FlyToPano
  25657. )
  25658. }
  25659. if (
  25660. !this.model.supportsTiles &&
  25661. i.getSkyboxTexture().image[0].width >
  25662. 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */
  25663. ) {
  25664. setTimeout(() => {
  25665. beginTran()
  25666. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  25667. } else {
  25668. beginTran()
  25669. }
  25670. }
  25671. }),
  25672. (n.prototype.warpToPano = function (o = {}) {})
  25673. n.prototype.blackToPano = function (o = {}) {
  25674. //add 瞬间过渡
  25675. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  25676. if (this.flying || this.isWarping()) return
  25677. let pano = o.pano || this.model.panos.index[o.panoId]
  25678. if (this.mode !== u.PANORAMA) {
  25679. var m
  25680. void this.flyToNewMode({
  25681. mode: u.PANORAMA,
  25682. pano,
  25683. duration: o.duration,
  25684. quaternion: o.quaternion
  25685. //callback: t
  25686. })
  25687. }
  25688. let oldPos = this.position.clone()
  25689. let oldPano = this.currentPano
  25690. this.path.warpDestPano = pano
  25691. var retry = () => {
  25692. ;(this.waitingToWarp = !1), this.blackToPano(o)
  25693. }
  25694. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry))
  25695. return void (this.waitingToWarp = !0)
  25696. this.emit('pano.chosen', oldPano, pano)
  25697. this.flying = true
  25698. this.nextPano = pano //提前加载高清图片
  25699. this.path.warpDestHeroLoc = {
  25700. panoId: o.panoId,
  25701. position: pano.position,
  25702. quaternion: o.quaternion || this.quaternion.clone()
  25703. }
  25704. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  25705. pano != this.currentPano && this.currentPano.exit()
  25706. pano.enter()
  25707. this.currentPano = pano
  25708. this.emit('flying.ended', pano.position, oldPos, pano, oldPano)
  25709. this.flying = false
  25710. this.nextPano = null
  25711. this.updateMarkerVisi() //add
  25712. })
  25713. }
  25714. window._transitionPosId = 9999
  25715. n.prototype.transitionPos = function (o = {}) {
  25716. //渐变overlay和热点的位置
  25717. y.cancelById(_transitionPosId)
  25718. var begin = function (object, pos, qua, scale) {
  25719. if (pos) {
  25720. if (!same(object.position, pos, 0.01)) {
  25721. y.start(
  25722. v.vector(object.position, pos),
  25723. o.dur,
  25724. e => {},
  25725. 0,
  25726. A[f.transition.movementEasing],
  25727. 'transitionPos',
  25728. _transitionPosId
  25729. )
  25730. }
  25731. if (qua && !same(object.quaternion, qua, 1e-6)) {
  25732. y.start(
  25733. v.quaternion(object.quaternion, qua),
  25734. o.dur,
  25735. e => {},
  25736. 0,
  25737. A[f.transition.movementEasing],
  25738. 'transitionPos',
  25739. _transitionPosId
  25740. )
  25741. }
  25742. if (scale && !same(object.scale, scale, 0.001)) {
  25743. y.start(
  25744. v.vector(object.scale, scale),
  25745. o.dur,
  25746. e => {},
  25747. 0,
  25748. A[f.transition.movementEasing],
  25749. 'transitionPos',
  25750. _transitionPosId
  25751. )
  25752. }
  25753. }
  25754. }
  25755. var same = function (vec1, vec2, diff) {
  25756. var s =
  25757. Math.abs(vec1.x - vec2.x) < diff &&
  25758. Math.abs(vec1.y - vec2.y) < diff &&
  25759. Math.abs(vec1.z - vec2.z) < diff
  25760. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff
  25761. return s
  25762. }
  25763. var sid = o.pano != void 0 ? o.pano.id : 'outside'
  25764. for (let i in this.model.hots) {
  25765. //是否判断visible?
  25766. var hot = this.model.hots[i]
  25767. var panoData = hot.info.transformAtPanos[sid]
  25768. var useCustom = !panoData
  25769. //if(hot.usingTransformData || !useCustom){
  25770. var pos = useCustom ? hot.info.position : panoData.pos
  25771. var qua = hot.isSprite ? null : useCustom ? hot.info.quaternion : panoData.qua
  25772. var scale = useCustom ? hot.info.scale : panoData.scale
  25773. begin(hot, pos, qua, scale)
  25774. //}
  25775. //hot.usingTransformData = !useCustom;
  25776. }
  25777. }
  25778. window._tranOutsideFocus = 4399
  25779. n.prototype.focusPoint = function (o = {}) {
  25780. //当在外时,聚焦相机到这一点
  25781. console.log('focusPoint')
  25782. if (this.mode == 'floorplan') {
  25783. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8) //可视范围
  25784. var control = this.cameraControls.controls.floorplan
  25785. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  25786. var currentScale = control.absoluteScale
  25787. var currentTarget = control.target.clone()
  25788. y.cancelById(window._tranOutsideFocus, true)
  25789. y.start(
  25790. function (progress) {
  25791. control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress)
  25792. control.target = o.aim
  25793. .clone()
  25794. .multiplyScalar(progress)
  25795. .add(currentTarget.clone().multiplyScalar(1 - progress))
  25796. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  25797. }.bind(this),
  25798. o.dur || 600,
  25799. null /* cancelFuc */,
  25800. 0,
  25801. A[f.transition.movementEasing],
  25802. 'outsideFocus',
  25803. window._tranOutsideFocus,
  25804. null /* cancelFuc */
  25805. )
  25806. } else if (player.mode == 'dollhouse') {
  25807. var control = player.cameraControls.controls.dollhouse
  25808. var radius = o.radius || 8
  25809. var currentTarget = control.target.clone()
  25810. var dir = control.offset.clone().normalize()
  25811. var currentRadius = control.offset.length()
  25812. y.cancelById(window._tranOutsideFocus, true)
  25813. y.start(
  25814. function (progress) {
  25815. control.target = o.aim
  25816. .clone()
  25817. .multiplyScalar(progress)
  25818. .add(currentTarget.clone().multiplyScalar(1 - progress))
  25819. let radius_ = radius * progress + currentRadius * (1 - progress)
  25820. control.camera.position.copy(
  25821. control.target.clone().add(dir.clone().multiplyScalar(radius_))
  25822. )
  25823. }.bind(this),
  25824. o.dur || 600,
  25825. null /* cancelFuc */,
  25826. 0,
  25827. A[f.transition.movementEasing],
  25828. 'outsideFocus',
  25829. window._tranOutsideFocus,
  25830. null /* cancelFuc */
  25831. )
  25832. } else if (this.mode == 'panorama') {
  25833. this.flyToPano({
  25834. lookAtPoint: o.aim.clone(),
  25835. pano: this.currentPano,
  25836. aimDuration: o.dur || 600
  25837. })
  25838. }
  25839. }
  25840. /*
  25841. 切换到某个模式后再执行函数
  25842. */
  25843. n.prototype.FlyToMode = function (mode, f1, duration) {
  25844. var f2
  25845. if (this.mode == mode) {
  25846. f1 && f1()
  25847. } else {
  25848. f2 = f1
  25849. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  25850. //正飞向其他模式,就要先飞完再飞进来然后执行
  25851. this.afterCModeFuc = function () {
  25852. /* objects.gui.modeChange[mode](null, {
  25853. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  25854. }); */
  25855. this.afterCModeFuc = f2
  25856. this.flyToNewMode({
  25857. mode: mode,
  25858. pano: mode == 'panorama' && this.currentPano
  25859. //callback : f2
  25860. })
  25861. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  25862. }.bind(this)
  25863. } else {
  25864. if (this.afterCModeFuc)
  25865. console.log('已经有afterCModeFuc了!!!!!!!!!!!!!!!')
  25866. this.afterCModeFuc = f2 //飞入后执行
  25867. try {
  25868. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  25869. this.flyToNewMode({
  25870. mode: mode,
  25871. pano: mode == 'panorama' && this.currentPano,
  25872. duration: duration
  25873. })
  25874. } catch (e) {
  25875. console.log('FlyToMode遇到问题?')
  25876. }
  25877. }
  25878. }
  25879. }
  25880. ;(n.prototype.fastForwardActivePanoFlight = function (e) {
  25881. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1
  25882. y.adjustSpeed(V.FlyToPano, e)
  25883. y.adjustSpeed(V.LookTransition, e)
  25884. }),
  25885. (n.prototype.flyToPanoClosestToMouse = function () {
  25886. if (
  25887. (Date.now() - this.mouseLastMoveTime > 50 &&
  25888. ((this.intersect = this.getMouseIntersect()),
  25889. this.intersect && this.updateClosestPano(this.intersect)),
  25890. this.closestPano)
  25891. )
  25892. return this.flyToPano({
  25893. pano: this.closestPano
  25894. })
  25895. var e = this.getMouseDirection()
  25896. this.flyDirection(e) ||
  25897. this.flyToPano({
  25898. pano: this.currentPano
  25899. })
  25900. }),
  25901. (n.prototype.flyLocalDirection = function (e) {
  25902. var t = this.getDirection(e),
  25903. i = 1 === e.z ? 0.4 : 0.75,
  25904. n = 1 === Math.abs(e.x)
  25905. return this.flyDirection(t, i, n)
  25906. }),
  25907. (n.prototype.flyDirection = function (e, t, i) {
  25908. Hot.closePopup() //xzw add
  25909. var n = $.Deferred()
  25910. this.history.invalidate()
  25911. var r = this.closestPanoInDirection(e, t, i)
  25912. return (
  25913. r
  25914. ? this.flyToPano(
  25915. {
  25916. pano: r
  25917. },
  25918. n.resolve.bind(n, !0)
  25919. )
  25920. : (this.bump(e), n.resolve(!1)),
  25921. n.promise()
  25922. )
  25923. }),
  25924. (n.prototype.closestPanoInDirection = function (e, t, i) {
  25925. return this.rankedPanoInDirection(0, e, t, i)
  25926. }),
  25927. (n.prototype.rankedPanoInDirection = (function () {
  25928. var e = {
  25929. pano: null,
  25930. candidates: []
  25931. }
  25932. return function (t, i, n, r) {
  25933. t || (t = 0), (n = void 0 !== n ? n : 0.75)
  25934. var o = r ? 'angle' : 'direction'
  25935. return (
  25936. this.model.panos.findRankedByScore(
  25937. t,
  25938. [
  25939. s.filters.isPanoAligned(),
  25940. s.filters.not(this.currentPano),
  25941. s.filters.isNeighbourPanoTo(this.currentPano),
  25942. s.filters.inPanoDirection(this.position, i, n)
  25943. ],
  25944. [
  25945. s.scoreFunctions.distanceSquared(this.currentPano),
  25946. s.scoreFunctions[o](this.position, i)
  25947. ],
  25948. e
  25949. ),
  25950. (this.cachedPanoCandidates = e.candidates),
  25951. e.pano
  25952. )
  25953. }
  25954. })()),
  25955. (n.prototype.bump = function (e) {
  25956. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  25957. var t,
  25958. i,
  25959. n,
  25960. r = f.transition,
  25961. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  25962. a = this.camera.getWorldDirection().dot(e),
  25963. s = Math.abs(a) > 0.5
  25964. if (s)
  25965. (t = function () {
  25966. y.start(
  25967. v.property(
  25968. this.cameraControls.cameras[u.PANORAMA],
  25969. 'zoom',
  25970. a > 0 ? 1.04 : 0.96
  25971. ),
  25972. o,
  25973. i,
  25974. 0,
  25975. A.easeInOutSine,
  25976. 'bumpZStart'
  25977. )
  25978. }.bind(this)),
  25979. (i = function () {
  25980. y.start(
  25981. v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', 1),
  25982. 5 * o,
  25983. n,
  25984. 0,
  25985. A.easeInOutSine,
  25986. 'bumpZRelax'
  25987. )
  25988. }.bind(this))
  25989. else {
  25990. var l = this.camera.position.clone(),
  25991. c = e.clone()
  25992. this.raycaster.set(l, c)
  25993. var h = this.model.floors.reduce(function (e, t) {
  25994. return e.concat(t.collider.children)
  25995. }, []),
  25996. d = this.raycaster.intersectObjects(h),
  25997. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  25998. g = l.clone().add(c.multiplyScalar(p))
  25999. ;(t = function () {
  26000. y.start(
  26001. v.vector(this.cameraControls.cameras[u.PANORAMA].position, g),
  26002. o,
  26003. i,
  26004. 0,
  26005. A.easeInOutSine,
  26006. 'bumpTStart'
  26007. )
  26008. }.bind(this)),
  26009. (i = function () {
  26010. y.start(
  26011. v.vector(this.cameraControls.cameras[u.PANORAMA].position, l),
  26012. 5 * o,
  26013. n,
  26014. 0,
  26015. A.easeInOutSine,
  26016. 'bumpTRelax'
  26017. )
  26018. }.bind(this))
  26019. }
  26020. ;(n = function () {
  26021. this.flying = !1
  26022. }.bind(this)),
  26023. (this.flying = !0),
  26024. t()
  26025. }
  26026. }),
  26027. (n.prototype.changeFloor = function (e) {
  26028. if (!this.is360View(this.mode, this.currentPano))
  26029. if (this.mode === u.PANORAMA) {
  26030. var t = this.history.reversePano(e)
  26031. t && t.isAligned()
  26032. ? this.flyToPano({
  26033. pano: t
  26034. })
  26035. : this.changeFloorByScore(e)
  26036. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  26037. }),
  26038. (n.prototype.changeFloorByScore = (function () {
  26039. var e = {
  26040. pano: null,
  26041. candidates: []
  26042. }
  26043. return function (t) {
  26044. var i = this.model.nextFloor(t)
  26045. return i
  26046. ? (this.model.panos.lowestByScore(
  26047. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  26048. [
  26049. s.scoreFunctions.distance(this.currentPano),
  26050. s.scoreFunctions.direction(this.position, new r.Vector3(0, t, 0)),
  26051. s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5)
  26052. ],
  26053. e
  26054. ),
  26055. void (e.pano
  26056. ? ((this.cachedPanoCandidates = e.candidates),
  26057. this.history.push(t, this.currentPano),
  26058. this.flyToPano({
  26059. pano: e.pano
  26060. }))
  26061. : F.warn('No pano found on selected floor, not moving there.')))
  26062. : void F.debug('player.changeFloor(' + t + '): no such floor')
  26063. }
  26064. })()),
  26065. (n.prototype.gotoFloor = function (e) {
  26066. var t = e - this.model.currentFloor.floorIndex
  26067. this.changeFloor(t)
  26068. }),
  26069. (n.prototype.getDirection = function (e) {
  26070. return (
  26071. (e = e ? e : new r.Vector3().copy(d.FORWARD)),
  26072. e.applyQuaternion(this.camera.quaternion)
  26073. )
  26074. }),
  26075. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  26076. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING))
  26077. return F.warn('should not be transitioning here'), n && n(!1), o.reject().promise()
  26078. var a = i || !1,
  26079. s = i ? i.position : this.position,
  26080. l = this.position.clone(),
  26081. c = this.currentPano
  26082. if (
  26083. (F.debug('New pose in mode ' + this.mode),
  26084. !e ||
  26085. ((retryCallback = function () {
  26086. N.delayOneFrame(
  26087. function () {
  26088. this.flyToSameMode(e, t, i, n, o)
  26089. }.bind(this)
  26090. )
  26091. }.bind(this)),
  26092. !this.checkAndWaitForPanoLoad(
  26093. e,
  26094. 'high',
  26095. 'low',
  26096. this.basePanoSize,
  26097. retryCallback
  26098. )))
  26099. ) {
  26100. var h = function () {
  26101. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0)
  26102. }.bind(this),
  26103. d = f[this.mode],
  26104. p = void 0 !== t ? t : d.transitionTime,
  26105. g = new r.Vector3(),
  26106. C = new r.Vector3()
  26107. if ((this.emit(w.FlyingStarted, s, l, e, c), this.mode === u.PANORAMA))
  26108. F.warn('we should not be here for panorama views')
  26109. else if (this.mode === u.DOLLHOUSE)
  26110. if (a) {
  26111. var I = new r.Vector3(0, 1, 0)
  26112. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  26113. this.model.warpDestFloors(i.floorVisibility),
  26114. C.copy(i.position)
  26115. var E = new r.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  26116. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  26117. _ = b.intersectObjects(this.model.colliders),
  26118. T = 3
  26119. _.length
  26120. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  26121. : (g.copy(E).multiplyScalar(3).add(C),
  26122. F.debug(
  26123. 'Tried to restore dollhouse mode that did not intersect...',
  26124. i.position,
  26125. i.quaternion
  26126. ))
  26127. var x = new r.Matrix4().lookAt(C, g, I),
  26128. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  26129. M = g.distanceTo(C),
  26130. R = new r.Matrix4().lookAt(
  26131. this.cameraControls.cameras[u.DOLLHOUSE].position,
  26132. this.cameraControls.controls[u.DOLLHOUSE].target,
  26133. I
  26134. ),
  26135. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  26136. O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(
  26137. this.cameraControls.controls[u.DOLLHOUSE].target
  26138. )
  26139. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0)
  26140. var L = new r.Euler(S.x - P.x, S.y - P.y, S.z - P.z, f.warp.eOrder)
  26141. ;(L.y =
  26142. L.y > Math.PI
  26143. ? (L.y -= 2 * Math.PI)
  26144. : L.y < -Math.PI
  26145. ? (L.y += 2 * Math.PI)
  26146. : L.y),
  26147. (this.path.burnsDir = Math.sign(L.y))
  26148. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  26149. B = new r.Vector3()
  26150. y.start(
  26151. v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g),
  26152. p,
  26153. null,
  26154. f.flydown.movementDelay,
  26155. A[f.flydown.movementEasing],
  26156. null,
  26157. V.FlyToSameMode
  26158. ),
  26159. y.start(
  26160. function (e, t) {
  26161. ;(D.x = P.x + e * L.x), (D.y = P.y + e * L.y), (D.z = P.z + e * L.z)
  26162. var i = O + e * (M - O)
  26163. B.set(0, 0, i)
  26164. .applyEuler(D)
  26165. .add(this.cameraControls.controls[u.DOLLHOUSE].target),
  26166. this.cameraControls.cameras[u.DOLLHOUSE].position
  26167. .copy(B)
  26168. .add(this.model.position)
  26169. }.bind(this),
  26170. p,
  26171. null,
  26172. f.flydown.movementDelay,
  26173. A[f.flydown.movementEasing],
  26174. null,
  26175. V.FlyToSameMode
  26176. ),
  26177. y.start(
  26178. function (e, t) {
  26179. this.cameraControls.controls[u.DOLLHOUSE].update(),
  26180. this.quaternion.copy(
  26181. this.cameraControls.cameras[u.DOLLHOUSE].quaternion
  26182. ),
  26183. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  26184. }.bind(this),
  26185. p,
  26186. null,
  26187. f.flydown.movementDelay,
  26188. A[f.flydown.movementEasing],
  26189. null,
  26190. V.FlyToSameMode
  26191. )
  26192. } else F.warn('invalid warp destination in flyToSameMode()? ignore it then')
  26193. else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), i)) {
  26194. this.model.warpDestFloors(i.floorVisibility)
  26195. var U = this.cameraControls.cameras[u.FLOORPLAN],
  26196. k = this.cameraControls.controls[u.FLOORPLAN],
  26197. H = k.target.clone(),
  26198. G = i.position.clone().sub(H),
  26199. z = U.position.clone().sub(k.target),
  26200. W = z.length(),
  26201. j = new r.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  26202. Y = Math.atan2(k.offset.x, k.offset.z),
  26203. X = Math.atan2(j.x, j.z),
  26204. Z = k.absoluteScale,
  26205. q = m.convertWorkshopOrthoZoom(i.orthoZoom)
  26206. y.start(
  26207. function (e, t) {
  26208. k.target.copy(G).multiplyScalar(e).add(H)
  26209. var i = Y + (X - Y) * e
  26210. ;(k.offset.x = W * Math.sin(i)),
  26211. (k.offset.z = W * Math.cos(i)),
  26212. U.position.copy(k.target).add(k.offset),
  26213. (k.absoluteScale = Z + e * (q - Z)),
  26214. k.update(),
  26215. this.quaternion.copy(U.quaternion),
  26216. this.position.copy(U.position),
  26217. this.target.copy(k.target),
  26218. this.camera.projectionMatrix.copy(U.projectionMatrix)
  26219. }.bind(this),
  26220. p,
  26221. null,
  26222. 0,
  26223. A[f.flydown.movementEasing],
  26224. null,
  26225. V.FlyToSameMode
  26226. )
  26227. } else F.info('flyToSameMode() funny floorplan view? skipping')
  26228. return (
  26229. y.setTimeout(
  26230. function (e) {
  26231. ;(this.mode = e), h(), o.resolve(!0)
  26232. }.bind(this, this.mode),
  26233. p,
  26234. V.FlyToSameMode
  26235. ),
  26236. (this.mode = u.TRANSITIONING),
  26237. o.promise()
  26238. )
  26239. }
  26240. }),
  26241. (n.prototype.flyToNewMode = function (e, t) {
  26242. Hot.closePopup() //xzw add
  26243. e = e || {}
  26244. var i = e.mode,
  26245. n = e.pano,
  26246. o = e.duration,
  26247. a = e.warpDest,
  26248. s = e.callback,
  26249. l = e.force,
  26250. c = e.quaternion
  26251. if (((t = t || $.Deferred()), this.isWarping()))
  26252. return (
  26253. F.warn('Player.flyToNewMode() -> Cannot fly when warping'),
  26254. s && s(!1),
  26255. t.reject('Cannot change mode during tour transition').promise()
  26256. )
  26257. if (this.mode === u.TRANSITIONING)
  26258. return s && s(!1), t.reject('Cannot change mode during mode transition').promise()
  26259. if (i === this.mode)
  26260. return l
  26261. ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  26262. t.promise())
  26263. : (s && s(!1), t.reject('Already in ' + i + ' mode').promise())
  26264. var h = a || !1
  26265. F.debug('Switching mode to ' + i)
  26266. if (window.vrEnabled && i != 'panorama') {
  26267. return s && s(!1), t.reject('vr不允许飞出').promise()
  26268. }
  26269. var d = function () {
  26270. N.delayOneFrame(
  26271. function () {
  26272. this.flyToNewMode(e, t)
  26273. }.bind(this)
  26274. )
  26275. }.bind(this)
  26276. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, d))
  26277. return t.promise()
  26278. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  26279. return (
  26280. F.info('Waiting for model textures to be loaded before going out to dollhouse'),
  26281. this.model.waitForLoad(
  26282. this.model,
  26283. function () {
  26284. return this.model.meshTexturesLoaded
  26285. }.bind(this)
  26286. ),
  26287. this.model.loadMeshTextures().done(d),
  26288. t.promise()
  26289. )
  26290. this.history.invalidate(), this.updateLastView()
  26291. var p = this.mode,
  26292. C = this.cameraControls.cameras[i]
  26293. e = g.deepExtend({}, f[i], f[p + '-' + i])
  26294. var I = void 0 !== o ? o : e.transitionTime
  26295. this.emit(w.ModeChanging, p, i, n, I),
  26296. n && (this.currentPano = n),
  26297. this.switchCameraMode(i, c),
  26298. y.cancelById(V.LookTransition)
  26299. //before fly---------------------
  26300. this.modeTran = p + '-' + i //add
  26301. if (this.mode == 'panorama') {
  26302. if (this.model.floorLogos) {
  26303. this.model.floorLogos[0].visible = false
  26304. this.model.floorLogos[1].visible = false
  26305. }
  26306. }
  26307. if (i == 'panorama') {
  26308. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: I }) //add
  26309. } else {
  26310. this.transitionPos({ type: 'beforeFlyOut', dur: I / 2 }) //add
  26311. }
  26312. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  26313. this.ready = true
  26314. //------------------------------------
  26315. var beginTran = () => {
  26316. var _ = new r.Vector3().copy(this.position)
  26317. if (i === u.PANORAMA) {
  26318. this.emit(w.PanoChosen, n, n),
  26319. setTimeout(
  26320. function () {
  26321. n.floor.enter(i)
  26322. }.bind(this),
  26323. I / 2
  26324. ),
  26325. this.path.fadeOutCpm(f.path.fadeOutTime)
  26326. if (this.model.floorLogos) {
  26327. this.model.floorLogos[0].position.copy(
  26328. n.floorPosition.clone().sub(this.model.position)
  26329. ) //改
  26330. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position) //for floorIcon position
  26331. }
  26332. } else if (i === u.DOLLHOUSE) {
  26333. if (
  26334. (h && (this.model.stayPut = !0),
  26335. a
  26336. ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  26337. this.model.warpDestFloors(a.floorVisibility))
  26338. : this.model.toggleAllFloors(!0),
  26339. this.path.placeCpm(),
  26340. this.path.fadeInCpm(f.path.fadeInTime),
  26341. h)
  26342. ) {
  26343. var T = new r.Vector3(this.model.center.x, 0, this.model.center.z)
  26344. _.set(15, 10, 15)
  26345. var M = new r.Vector3(0, 0, -1).applyQuaternion(a.quaternion),
  26346. R = new r.Raycaster(a.position.clone(), M.clone(), 0, 1 / 0),
  26347. P = R.intersectObjects([this.sceneIntersectionPlane])
  26348. P.length
  26349. ? (T.copy(P[0].point),
  26350. _.copy(a.position),
  26351. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  26352. 0.75 * _.distanceTo(T),
  26353. !0
  26354. ))
  26355. : (F.warn(
  26356. 'Tried to restore dollhouse mode that did not intersect...',
  26357. a.position,
  26358. a.quaternion
  26359. ),
  26360. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  26361. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  26362. _.add(this.model.position),
  26363. C.position.copy(_),
  26364. this.cameraControls.controls[u.DOLLHOUSE].update()
  26365. }
  26366. } else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), a)) {
  26367. this.model.warpDestFloors(a.floorVisibility)
  26368. var O = this.cameraControls.cameras[u.FLOORPLAN],
  26369. L = this.cameraControls.controls[u.FLOORPLAN],
  26370. D = O.position.clone().sub(L.target),
  26371. B = new r.Vector3(-1, 0, 0).applyQuaternion(a.quaternion).normalize(),
  26372. U = Math.atan2(B.x, B.z)
  26373. L.target.copy(a.position)
  26374. var k = D.length()
  26375. ;(L.offset.x = k * Math.sin(U)),
  26376. (L.offset.y = 0),
  26377. (L.offset.z = k * Math.cos(U)),
  26378. O.position.copy(L.target).add(L.offset)
  26379. L.target.clone().sub(C.position)
  26380. C.quaternion.copy(a.quaternion),
  26381. (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)),
  26382. (L.absoluteScale = L.currentScale),
  26383. L.update()
  26384. } else this.model.currentFloor.enter(i)
  26385. var H = this.currentPano,
  26386. G = this.position.clone()
  26387. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  26388. (this.flying = !0),
  26389. this.isOutsideMode(i) && this.is360View(p, H)
  26390. ? (h ||
  26391. i !== u.DOLLHOUSE ||
  26392. (C.position.set(15, 10, 15),
  26393. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  26394. C.controls.update()),
  26395. (e.blackoutStyle = S.FADEIN),
  26396. (I = f.show360Views.transitionTime),
  26397. this.fade360View(I, C, e))
  26398. : this.isOutsideMode(p) && this.is360View(i, n)
  26399. ? (h && this.switchCameraMode(i, h.quaternion),
  26400. (this.mode = i),
  26401. this.path && this.path.popOutCpm(),
  26402. (e.blackoutStyle = S.END),
  26403. (I = f.show360Views.transitionTime),
  26404. this.fade360View(I, C, e))
  26405. : (y.start(
  26406. v.property(this.model, 'alpha', e.modelAlpha, null),
  26407. I * e.modelAlphaLength,
  26408. null,
  26409. e.modelAlphaDelay,
  26410. null,
  26411. V.FlyToNewMode
  26412. ),
  26413. y.start(
  26414. v.vector(this.position, C.position),
  26415. I,
  26416. null,
  26417. f.flydown.movementDelay,
  26418. A[f.flydown.movementEasing],
  26419. null,
  26420. V.FlyToNewMode
  26421. ),
  26422. y.start(
  26423. v.quaternion(this.quaternion, C.quaternion),
  26424. I * e.rotationDuration,
  26425. null,
  26426. e.rotationDelay,
  26427. A[f.flydown.rotationEasing],
  26428. null,
  26429. V.FlyToNewMode
  26430. ),
  26431. y.start(
  26432. v.matrix4(this.camera.projectionMatrix, C.projectionMatrix),
  26433. I * e.cameraMatrixDuration,
  26434. null,
  26435. e.cameraMatrixDelay,
  26436. e.cameraMatrixEase,
  26437. null,
  26438. V.FlyToNewMode
  26439. ),
  26440. y.start(
  26441. v.uniform(this.model.skybox, 'opacity', e.skyboxOpacity),
  26442. I * e.skyboxOpacityLength,
  26443. null,
  26444. e.skyboxOpacityDelay,
  26445. null,
  26446. V.FlyToNewMode
  26447. ),
  26448. y.start(
  26449. v.property(this.reticule.material.uniforms.opacity, 'value', 0),
  26450. I,
  26451. null,
  26452. V.FlyToNewMode
  26453. )),
  26454. y.setTimeout(
  26455. function () {
  26456. ;(this.flying = !1),
  26457. p === u.PANORAMA && i !== u.PANORAMA
  26458. ? this.currentPano.exit()
  26459. : p !== u.PANORAMA &&
  26460. i === u.PANORAMA &&
  26461. (this.currentPano !== H && H.exit(),
  26462. this.currentPano.enter(),
  26463. this.path.placeCpm(),
  26464. this.path.fadeOutCpm(f.path.fadeOutTime),
  26465. this.spider.draw()),
  26466. p === u.DOLLHOUSE &&
  26467. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  26468. (this.mode = i),
  26469. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  26470. //add:
  26471. this.updateMarkerVisi()
  26472. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  26473. this.mode == u.PANORAMA &&
  26474. this.model.floorLogos &&
  26475. (this.model.changefloorLogoOpa({ index: 0, from: 0, opa: 1, dur: 150 }), //this.model.floorLogoShow(0,150);
  26476. (this.model.floorLogos[0].visible = true))
  26477. if (this.afterCModeFuc) {
  26478. //手动加的函数
  26479. var cf = this.afterCModeFuc
  26480. this.afterCModeFuc = null //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  26481. cf()
  26482. }
  26483. if (this.mode == u.PANORAMA) {
  26484. Hot.updateVisibles([this.currentPano])
  26485. this.model.fadePanoMarkers()
  26486. } else {
  26487. Hot.updateVisibles(true)
  26488. this.model.hotGroup.children.forEach(overlay => {
  26489. if (overlay.animateInfo) {
  26490. GifTexDeal.start(overlay.animation)
  26491. }
  26492. })
  26493. }
  26494. h && p !== u.PANORAMA && i === u.PANORAMA
  26495. ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s)
  26496. : (s && s(), t.resolve())
  26497. }.bind(this),
  26498. I,
  26499. V.FlyToNewMode
  26500. )
  26501. }
  26502. if (
  26503. i == 'panorama' &&
  26504. !this.model.supportsTiles &&
  26505. n.getSkyboxTexture().image[0].width > 1024
  26506. ) {
  26507. setTimeout(() => {
  26508. beginTran()
  26509. }, 16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  26510. } else {
  26511. beginTran()
  26512. }
  26513. this.mode = u.TRANSITIONING
  26514. //p == "panorama" && this.updateHotVisible(),
  26515. return t.promise()
  26516. }),
  26517. (n.prototype.fade360View = function (e, t, i) {
  26518. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  26519. $(this.domElement).fadeOut(
  26520. 0.5 * e,
  26521. function () {
  26522. ;(this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  26523. (this.model.alpha = i.modelAlpha),
  26524. this.position.copy(t.position),
  26525. this.quaternion.copy(t.quaternion),
  26526. this.camera.projectionMatrix.copy(t.projectionMatrix),
  26527. $(this.domElement).fadeIn(0.5 * e)
  26528. }.bind(this)
  26529. )
  26530. }),
  26531. (n.prototype.findDefaultViews = function () {
  26532. this.findDefaultView(this.lastInsideView, !0),
  26533. this.findDefaultView(this.last360View, !1)
  26534. }),
  26535. (n.prototype.findDefaultView = function (e, t) {
  26536. var i,
  26537. n = this.model.heroLocations,
  26538. r = this.model.panos,
  26539. o = n.findIndex(function (e) {
  26540. if (e.cameraMode !== u.PANORAMA) return !1
  26541. var i = r.get(e.panoId)
  26542. return i && i.isAligned() === t
  26543. })
  26544. o >= 0
  26545. ? ((i = r.get(n[o].panoId)),
  26546. e.update({
  26547. cameraMode: u.PANORAMA,
  26548. pano: i,
  26549. position: n[o].position,
  26550. quaternion: n[o].quaternion
  26551. }))
  26552. : ((o = r.list.findIndex(function (e) {
  26553. return e.isAligned() === t
  26554. })),
  26555. o >= 0
  26556. ? ((i = r.list[o]),
  26557. e.update({
  26558. cameraMode: u.PANORAMA,
  26559. pano: i,
  26560. position: i.position
  26561. }))
  26562. : F.warn('There are no', t ? 'inside' : '360º', 'views in this model'))
  26563. }),
  26564. (n.prototype.updateLastView = function () {
  26565. if (this.mode === u.PANORAMA) {
  26566. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View
  26567. e.update({
  26568. pano: this.currentPano,
  26569. position: this.position,
  26570. quaternion: this.quaternion
  26571. })
  26572. }
  26573. }),
  26574. (n.prototype.goToLastView = function (e, t) {
  26575. var i = $.Deferred(),
  26576. n = i.resolve.bind(i),
  26577. r = i.reject.bind(i),
  26578. o = e ? this.lastInsideView : this.last360View
  26579. return (
  26580. this.isInMode(u.PANORAMA) &&
  26581. this.currentPano.isAligned() !== e &&
  26582. this.updateLastView(),
  26583. this.isInMode(u.PANORAMA)
  26584. ? (this.path && this.path.popOutCpm(),
  26585. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r))
  26586. : this.isOutsideMode() &&
  26587. this.flyToNewMode({
  26588. mode: o.cameraMode,
  26589. pano: o.pano,
  26590. quaternion: o.quaternion,
  26591. callback: t
  26592. })
  26593. .done(n)
  26594. .fail(r),
  26595. i.promise()
  26596. )
  26597. }),
  26598. (n.prototype.fadeToView = function (e, t, i, n) {
  26599. var r = $.Deferred(),
  26600. o = r.resolve.bind(r),
  26601. a = r.reject.bind(r)
  26602. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano))
  26603. return (
  26604. F.warn('Tried to fade to an illegal view', t.cameraMode),
  26605. a('Cannot go to illegal view'),
  26606. r.promise()
  26607. )
  26608. var s =
  26609. (f[t.cameraMode],
  26610. function () {
  26611. $(this.domElement).fadeIn(0.5 * i), n && n(), o()
  26612. }.bind(this)),
  26613. l = e ? S.FADEIN : S.END
  26614. return (
  26615. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  26616. $(this.domElement).fadeOut(
  26617. 0.5 * i,
  26618. function () {
  26619. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  26620. t.cameraMode === u.PANORAMA
  26621. ? this.flyToPano(
  26622. {
  26623. pano: t.pano,
  26624. lookAtPoint: d.FORWARD.clone()
  26625. .applyQuaternion(t.quaternion)
  26626. .add(t.pano.position),
  26627. duration: 0
  26628. },
  26629. s
  26630. )
  26631. : this.flyToNewMode({
  26632. mode: t.cameraMode,
  26633. quaternion: t.quaternion,
  26634. duration: 0,
  26635. callback: s
  26636. })
  26637. }.bind(this)
  26638. ),
  26639. r.promise()
  26640. )
  26641. }),
  26642. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  26643. if (
  26644. (this.cameraControls.activeControl &&
  26645. (this.cameraControls.activeControl.enabled = !1),
  26646. this.flying)
  26647. )
  26648. return F.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1
  26649. ;(null !== e && void 0 !== e) || (e = b.Show), this.history.invalidate()
  26650. e !== b.Retain
  26651. ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK)
  26652. : (i = this.path.upcomingTransType)
  26653. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned()
  26654. return (
  26655. this.emit(w.WarpStarted, a, i, n, r),
  26656. (n = n || S.MIDDLE),
  26657. this.path.warpToPano(
  26658. i,
  26659. n,
  26660. r,
  26661. function () {
  26662. t === E.Slow
  26663. ? this.path.discardSlow()
  26664. : t === E.Standard && this.path.discardPathObject(),
  26665. this.emit(w.WarpEnded, i),
  26666. this.cameraControls.activeControl &&
  26667. (this.cameraControls.activeControl.enabled = !0),
  26668. o && o()
  26669. }.bind(this)
  26670. ),
  26671. e === b.Hide && this.path.discardPathObject(),
  26672. !0
  26673. )
  26674. }),
  26675. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  26676. return this.path.setWarpDestinationByPanoId(e, t)
  26677. ? this.startWarp(i, n, r, o, a, s)
  26678. : (F.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'),
  26679. s && s(),
  26680. !1)
  26681. }),
  26682. (n.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  26683. return this.path.setWarpDestinationByHeroIndex(e)
  26684. ? this.startWarp(t, i, n, r, o, a)
  26685. : (F.warn(
  26686. 'Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26687. ),
  26688. a && a(),
  26689. !1)
  26690. }),
  26691. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  26692. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  26693. }),
  26694. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  26695. return this.path.setWarpDestinationByHeroIndex(e)
  26696. ? (this.path.warpToNonPano(t), !0)
  26697. : (F.warn(
  26698. 'Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26699. ),
  26700. t && t(),
  26701. !1)
  26702. }),
  26703. (n.prototype.aimTourCamera = function (e, t, i, n) {
  26704. return (
  26705. F.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'),
  26706. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  26707. )
  26708. }),
  26709. (n.prototype.showPathToHeroLocation = function (e) {
  26710. this.path.setWarpDestinationByHeroIndex(e) &&
  26711. this.path.brushToWarpPano(x.STD, x.BLACK)
  26712. }),
  26713. (n.prototype.tourInterlude = function (e, t) {
  26714. this.history.invalidate()
  26715. this.path.discardSlow()
  26716. //xzw:
  26717. var defaultRotTime = DATA.tourRotTime * 1000
  26718. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  26719. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  26720. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  26721. //zeg 标注一下
  26722. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  26723. var rotTime
  26724. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  26725. var restChildCount = currentLocation0.heroLocations
  26726. ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1
  26727. : 0
  26728. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  26729. if (hasMusic) {
  26730. var audioObj = SoundManager.list.find(e => e.name == 'tour')
  26731. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  26732. rotTime = currentLocation0.musicInfo.time - current
  26733. if (restChildCount) {
  26734. //如果当前folder中还有剩下的item,平分一下时间
  26735. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1)
  26736. }
  26737. } else {
  26738. rotTime = defaultRotTime
  26739. }
  26740. rotTime = Math.max(0, rotTime)
  26741. Log(
  26742. 'rotTime ' +
  26743. rotTime +
  26744. ' at item ' +
  26745. this.director.currentItem +
  26746. (hasMusic
  26747. ? ',musicCurrentTime:' +
  26748. current +
  26749. '音乐总长:' +
  26750. currentLocation0.musicInfo.time
  26751. : ''),
  26752. '#E8E'
  26753. )
  26754. } else {
  26755. rotTime = currentLocation.rotTime * 1000
  26756. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem, '#E8E')
  26757. }
  26758. this.path.waitNextStep(
  26759. e,
  26760. function () {
  26761. t && t()
  26762. }.bind(this),
  26763. rotTime
  26764. )
  26765. }),
  26766. (n.prototype.stopInterlude = function () {
  26767. this.interruptAndFastForward(null, 0)
  26768. }),
  26769. (n.prototype.interruptAndFastForward = function (e, t) {
  26770. //Log('interruptAndFastForward' , '#f00')
  26771. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  26772. this.flying && this.emit(w.FlyingInterrupted),
  26773. this.path.interruptAndFastForward(e, t)
  26774. }),
  26775. (n.prototype.setSize = function (e, t) {
  26776. var i = e / t
  26777. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t)
  26778. var n = B.getHFOVFromVFOV(f.insideFOV, e, t)
  26779. n > f.insideFOVMax
  26780. ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t))
  26781. : (this.baseFov = f.insideFOV)
  26782. for (var r in this.cameraControls.cameras) {
  26783. var o = this.cameraControls.cameras[r]
  26784. ;(o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i)
  26785. }
  26786. }),
  26787. (n.prototype.toJSON = function () {
  26788. var e = {}
  26789. return this.cameraControls.activeControl
  26790. ? ((e = this.cameraControls.activeControl.toJSON()),
  26791. (e.camera_mode = u.toInt(this.mode)),
  26792. this.isOutsideMode()
  26793. ? this.model.allFloorsVisible
  26794. ? (e.floor_visibility = [])
  26795. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  26796. return e.hidden ? 0 : 1
  26797. }))
  26798. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  26799. e)
  26800. : e
  26801. }),
  26802. (n.prototype.getCurrentNodePanos = function (e) {
  26803. this.model.panos.map
  26804. if (((e.length = 0), this.path.nodes)) {
  26805. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  26806. if (momentTour == 'black') {
  26807. //改 upcomingPanos如果是black的只需要起点和终点
  26808. if (this.path.nodes.length) {
  26809. e.push(this.model.panos.get(this.path.nodes[0]))
  26810. }
  26811. if (this.path.nodes.length > 1) {
  26812. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length - 1]))
  26813. }
  26814. } else {
  26815. for (var t = 0; t < this.path.nodes.length; t++) {
  26816. var i = this.path.nodes[t]
  26817. e.push(this.model.panos.get(i))
  26818. }
  26819. }
  26820. }
  26821. }),
  26822. (n.prototype.zoomIncrementally = function (e) {
  26823. var t = this.zoomLevel
  26824. this.zoomTo(this.zoomLevel + e),
  26825. t !== this.zoomLevel &&
  26826. this.currentPano &&
  26827. this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  26828. }),
  26829. (n.prototype.zoomInIncrementally = function (e) {
  26830. ;(e = e || this.defaultZoomIncrement), this.zoomIncrementally(e)
  26831. }),
  26832. (n.prototype.zoomOutIncrementally = function (e) {
  26833. ;(e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e)
  26834. }),
  26835. (n.prototype.zoomBy = function (e) {
  26836. this.zoomTo(this.zoomLevel * e)
  26837. }),
  26838. (n.prototype.zoomIn = function () {
  26839. this.zoomBy(1 + this.zoomSpeed)
  26840. }),
  26841. (n.prototype.zoomOut = function () {
  26842. this.zoomBy(1 - this.zoomSpeed)
  26843. }),
  26844. (n.prototype.zoomTo = function (e, t) {
  26845. if (t || (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)) {
  26846. if (
  26847. (e < f.zoom.min && (e = f.zoom.min),
  26848. e > f.zoom.max && (e = f.zoom.max),
  26849. e > this.zoomLevel
  26850. ? (this.emit(O.ZoomIn), e === f.zoom.max && this.emit(O.ZoomMax))
  26851. : e < this.zoomLevel &&
  26852. (this.emit(O.ZoomOut), e === f.zoom.min && this.emit(O.ZoomMin)),
  26853. this.cameraControls.activeControl)
  26854. ) {
  26855. var i = this.cameraControls.activeControl.camera
  26856. ;(this.zoomLevel = e),
  26857. (i.fov = this.baseFov * (1 / this.zoomLevel)),
  26858. i.updateProjectionMatrix(),
  26859. (this.zoomFov = i.fov)
  26860. }
  26861. }
  26862. }),
  26863. (n.prototype.increaseZoomSpeed = function () {
  26864. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  26865. }),
  26866. (n.prototype.decreaseZoomSpeed = function () {
  26867. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  26868. }),
  26869. (n.prototype.clampZoomSpeed = function (e) {
  26870. return e < 0 ? 0 : e
  26871. }),
  26872. (n.prototype.activatePersistentZooming = function (e) {
  26873. this.zooming = e ? 1 : -1
  26874. }),
  26875. (n.prototype.deactivatePersistentZooming = function () {
  26876. this.zooming = 0
  26877. }),
  26878. (n.prototype.zoomDefault = function () {
  26879. this.zoomTo(1, !0)
  26880. }),
  26881. (window.fovTranId = 333) //add
  26882. n.prototype.smoothZoomToDefault = function (e, t) {
  26883. y.cancelById(window.fovTranId)
  26884. var i,
  26885. n = this.zoomLevel,
  26886. r = function (e) {
  26887. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0)
  26888. }.bind(this),
  26889. o = function () {
  26890. this.zoomDefault(), t && window.setTimeout(t, 50)
  26891. }.bind(this)
  26892. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  26893. }
  26894. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  26895. //add
  26896. y.cancelById(window.fovTranId)
  26897. console.log('smoothZoomFovTo ' + zoomLevel)
  26898. var i,
  26899. n = this.zoomLevel,
  26900. aimLevel = zoomLevel || this.baseFov / fov
  26901. if (n == aimLevel) return
  26902. var fun = function (e) {
  26903. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  26904. }.bind(this)
  26905. y.start(
  26906. fun,
  26907. dur,
  26908. callback,
  26909. null,
  26910. 0,
  26911. A[f.transition.blendEasing],
  26912. null,
  26913. window.fovTranId
  26914. )
  26915. }
  26916. n.prototype.updateZoomPano = function () {
  26917. if (
  26918. !this.panoRenderer.zoomPanoRenderingDisabled &&
  26919. this.mode === u.PANORAMA &&
  26920. this.currentPano
  26921. ) {
  26922. let navTileClass = this.qualityManager.getNavZoomClass()
  26923. let tileClass = this.qualityManager.getMaxZoomClass()
  26924. if (navTileClass == '4k') {
  26925. var r = true
  26926. } else {
  26927. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5,
  26928. levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  26929. var t = this.zoomLevel > levelThreshold1,
  26930. i = this.flying && this.nextPano && this.nextPano !== this.currentPano,
  26931. n = !i && !this.isWarping(),
  26932. r = t //&& n ; // 允许flying状态下加载4K图
  26933. }
  26934. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  26935. this.panoRenderer.setZoomingActive(r, this.currentPano, !0)
  26936. var o = function (pano, ifZoom) {
  26937. this.panoRenderer.resetRenderStatus(
  26938. pano.id,
  26939. !1,
  26940. !0,
  26941. this.qualityManager.getMaxNavPanoSize()
  26942. ),
  26943. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  26944. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  26945. pano.setZoomed(ifZoom)
  26946. }.bind(this)
  26947. if (navTileClass == '4k') {
  26948. if (!this.currentPano.zoomed) {
  26949. o(this.currentPano, !0)
  26950. this.panoRenderer.enableUltraHighQualityMode(
  26951. function () {
  26952. //开启4k getMaxZoomPanoSize
  26953. this.qualityManager.useUltraHighResolutionPanos &&
  26954. (f.zoom.max = D.ultraHighQualityMaxZoom)
  26955. o(this.currentPano, !0)
  26956. }.bind(this)
  26957. )
  26958. }
  26959. } else {
  26960. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  26961. if (r && (!this.currentPano.zoomed || (zoomLevelRes && zoomLevelRes != '4k'))) {
  26962. //needZoom
  26963. this.currentPano.zoomed || o(this.currentPano, !0)
  26964. if (
  26965. navTileClass == '1k' &&
  26966. tileClass != '1k' &&
  26967. this.zoomLevel < levelThreshold2
  26968. ) {
  26969. this.panoRenderer.enableHighQuality(
  26970. function () {
  26971. //开启2k
  26972. if (tileClass != '4k') {
  26973. o(this.currentPano, !0)
  26974. }
  26975. }.bind(this)
  26976. )
  26977. } else {
  26978. this.panoRenderer.enableUltraHighQualityMode(
  26979. function () {
  26980. //开启4k getMaxZoomPanoSize
  26981. this.qualityManager.useUltraHighResolutionPanos &&
  26982. !f.zoom.overridemax &&
  26983. (f.zoom.max = D.ultraHighQualityMaxZoom)
  26984. o(this.currentPano, !0)
  26985. }.bind(this)
  26986. )
  26987. }
  26988. } else {
  26989. !t && this.currentPano.zoomed && o(this.currentPano, !1)
  26990. }
  26991. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  26992. if (r && navTileClass == '1k' && tileClass == '4k') {
  26993. //目前只有手机端navTileClass == '1k'
  26994. var change = zoomedFlag => {
  26995. this.qualityManager.updateMaximums() //更新maxZoomPanoSize
  26996. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  26997. //this.currentPano.setZoomed(t);//更新uniforms贴图
  26998. if (this.qualityManager.zoomLevelResolution == '4k') {
  26999. this.model.showHighMap()
  27000. } else {
  27001. this.model.hideHighMap()
  27002. }
  27003. }
  27004. this.qualityManager.zoomLevelResolution =
  27005. this.zoomLevel >= levelThreshold2
  27006. ? '4k'
  27007. : this.zoomLevel > levelThreshold1
  27008. ? '2k'
  27009. : '1k'
  27010. if (this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2) {
  27011. //1k/2k-4k
  27012. change()
  27013. o(this.currentPano, t)
  27014. } else if (
  27015. this.oldZoomLevel <= levelThreshold1 &&
  27016. this.zoomLevel > levelThreshold1
  27017. ) {
  27018. //1k-2k
  27019. change()
  27020. } else if (
  27021. this.oldZoomLevel > levelThreshold2 &&
  27022. this.zoomLevel <= levelThreshold2
  27023. ) {
  27024. //4k-2k/1k
  27025. change()
  27026. o(this.currentPano, t)
  27027. } else if (
  27028. this.oldZoomLevel > levelThreshold1 &&
  27029. this.zoomLevel <= levelThreshold1
  27030. ) {
  27031. //2k-1k
  27032. change()
  27033. }
  27034. this.oldZoomLevel = this.zoomLevel
  27035. }
  27036. }
  27037. }
  27038. }
  27039. ;(n.prototype.checkHasNeighbor = function (pano) {
  27040. //add
  27041. for (var i in pano.neighbourPanos) {
  27042. if (i == pano.id) continue
  27043. if (pano.neighbourPanos[i]) {
  27044. return true
  27045. }
  27046. }
  27047. }),
  27048. (t.exports = n)
  27049. }).call(this, '/js/player.js')
  27050. },
  27051. {
  27052. './constants': 8,
  27053. './enum/AlignmentType': 17,
  27054. './enum/BlackoutStyle': 18,
  27055. './enum/ControlEvents': 21,
  27056. './enum/Keys': 30,
  27057. './enum/ModelManagerEvents': 33,
  27058. './enum/PanoSizeClass': 36,
  27059. './enum/PanoramaEvents': 37,
  27060. './enum/PathDiscardMode': 38,
  27061. './enum/PathDisplayMode': 39,
  27062. './enum/PlayerEvents': 40,
  27063. './enum/TagStates': 44,
  27064. './enum/Vectors': 50,
  27065. './enum/Viewmode': 51,
  27066. './enum/WarpStyle': 52,
  27067. './enum/ZoomEvents': 53,
  27068. './exception/BasicException': 55,
  27069. './model/ModelManager': 140,
  27070. './objects/NSpider': 147,
  27071. './objects/Panorama': 148,
  27072. './objects/Reticule': 149,
  27073. './objects/ShowPath': 151,
  27074. './objects/Snapshot': 153,
  27075. './objects/View': 154,
  27076. './settings': 166,
  27077. './shaders': 167,
  27078. './tile/TileDownloader': 171,
  27079. './tile/TilePrioritizer': 172,
  27080. './util/ZoomStats': 179,
  27081. './util/browser': 182,
  27082. './util/camera': 183,
  27083. './util/cameraLight': 184,
  27084. './util/common': 185,
  27085. './util/easing': 186,
  27086. './util/history': 187,
  27087. './util/lerp': 188,
  27088. './util/logger': 189,
  27089. './util/math': 190,
  27090. './util/transitions': 195,
  27091. hot: 'hot',
  27092. scaleImg: 'scaleImg',
  27093. events: 202,
  27094. three: 217
  27095. }
  27096. ],
  27097. scaleImg: [
  27098. function (t, e) {
  27099. // xzw
  27100. var OUTPUT = e
  27101. ;(function () {
  27102. function t(t, a, i, r) {
  27103. function h() {
  27104. ;(B = 'object' == typeof i ? i : a.src || r ? u : document.createElement('canvas')),
  27105. (B.width = s),
  27106. (B.height = f),
  27107. (G = B.getContext('2d'))
  27108. }
  27109. function n(t) {
  27110. if (t) {
  27111. var e,
  27112. a = G.getImageData(0, 0, s, f),
  27113. i = a.data
  27114. for (e = 0; at > e; e += 4)
  27115. (i[e] = (t[e] * it) | 0),
  27116. (i[e + 1] = (t[e + 1] * it) | 0),
  27117. (i[e + 2] = (t[e + 2] * it) | 0),
  27118. (i[e + 3] = (t[e + 3] * it) | 0)
  27119. return delete t, a
  27120. }
  27121. return G.getImageData(0, 0, s, f)
  27122. }
  27123. function o(t, e, a, i, r) {
  27124. return (
  27125. 0.5 * (i - e + (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) * t) * t + a
  27126. )
  27127. }
  27128. a || ((a = t.input), (i = t.output), (r = t.inputRemovable), t.scale && (t = t.scale))
  27129. var u, d
  27130. if (a.src)
  27131. if (((u = document.createElement('canvas')), null != a.naturalWidth))
  27132. (u.width = a.naturalWidth), (u.height = a.naturalHeight)
  27133. else if (null != a.runtimeStyle) {
  27134. var l = a.runtimeStyle,
  27135. c = l.width,
  27136. g = l.height
  27137. ;(l.width = 'auto'),
  27138. (l.height = 'auto'),
  27139. (u.width = a.width),
  27140. (u.height = a.height),
  27141. (l.width = c),
  27142. (l.height = g)
  27143. } else {
  27144. var c = a.width,
  27145. g = a.height
  27146. a.removeAttribute && (a.removeAttribute('width'), a.removeAttribute('height')),
  27147. (u.width = a.width),
  27148. (u.height = a.height),
  27149. (a.width = c),
  27150. (a.height = g)
  27151. }
  27152. else u = a
  27153. ;(d = u.getContext('2d')), a.src && d.drawImage(a, 0, 0)
  27154. var s,
  27155. f,
  27156. m = u.width,
  27157. w = u.height,
  27158. p = d.getImageData(0, 0, m, w).data
  27159. if (!m || !w) return !1
  27160. ;(a.src || r) && u.clearRect(0, 0, m, w),
  27161. 'object' == typeof t
  27162. ? t.width
  27163. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  27164. : ((s = (m * t.scaleX + 0.5) | 0), (f = (w * t.scaleY + 0.5) | 0))
  27165. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0))
  27166. var v,
  27167. b,
  27168. y,
  27169. x,
  27170. D,
  27171. I,
  27172. A,
  27173. j,
  27174. R,
  27175. k,
  27176. C,
  27177. E,
  27178. F,
  27179. L,
  27180. S,
  27181. U,
  27182. W,
  27183. H,
  27184. alpha,
  27185. X,
  27186. Y,
  27187. q,
  27188. z,
  27189. B,
  27190. G,
  27191. J,
  27192. K,
  27193. M,
  27194. N,
  27195. O,
  27196. P,
  27197. Q,
  27198. T,
  27199. V,
  27200. Z,
  27201. $ = s << 2,
  27202. _ = m << 2,
  27203. tt = 0,
  27204. et = 0,
  27205. at = $ * f,
  27206. it = 255.99 / 255,
  27207. rt = s / m,
  27208. ht = f / w,
  27209. nt = rt * ht
  27210. if (rt > 1 || ht > 1)
  27211. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  27212. for (
  27213. b = x / ht,
  27214. R = 0 | b,
  27215. q = b - R,
  27216. N = R * _,
  27217. M = 1 > R ? N : N - _,
  27218. w - 2 > R ? ((O = N + _), (P = (R + 2) * _)) : (O = P = R > w - 2 ? N : N + _),
  27219. y = 0;
  27220. s > y;
  27221. y++, et += 4
  27222. )
  27223. (v = y / rt),
  27224. (j = 0 | v),
  27225. (z = v - j),
  27226. (T = j << 2),
  27227. (Q = 1 > j ? T : T - 4),
  27228. m - 2 > j ? ((V = T + 4), (Z = T + 8)) : (V = Z = j > m - 2 ? T : T + 4),
  27229. (H =
  27230. (o(
  27231. q,
  27232. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27233. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27234. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27235. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27236. ) *
  27237. it) |
  27238. 0),
  27239. ++Q,
  27240. ++T,
  27241. ++V,
  27242. ++Z,
  27243. (X =
  27244. (o(
  27245. q,
  27246. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27247. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27248. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27249. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27250. ) *
  27251. it) |
  27252. 0),
  27253. ++Q,
  27254. ++T,
  27255. ++V,
  27256. ++Z,
  27257. (Y =
  27258. (o(
  27259. q,
  27260. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27261. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27262. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27263. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27264. ) *
  27265. it) |
  27266. 0),
  27267. ++Q,
  27268. ++T,
  27269. ++V,
  27270. ++Z,
  27271. (alpha =
  27272. (o(
  27273. q,
  27274. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27275. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27276. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27277. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27278. ) *
  27279. it) |
  27280. 0),
  27281. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  27282. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  27283. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  27284. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0)
  27285. else {
  27286. if (e.Float32Array) W = new Float32Array(at)
  27287. else for (W = [], et = 0; at > et; ++et) W[et] = 0
  27288. for (b = 0; w > b; b++)
  27289. for (
  27290. x = b * ht,
  27291. A = 0 | x,
  27292. D = A * $,
  27293. U = !!((A - ((x + ht) | 0)) * (w - 1 - b)) << 1,
  27294. U && ((F = A + 1 - x), (L = x + ht - A - 1)),
  27295. v = 0;
  27296. m > v;
  27297. v++, tt += 4
  27298. )
  27299. switch (
  27300. ((y = v * rt),
  27301. (I = 0 | y),
  27302. (et = D + (I << 2)),
  27303. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  27304. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  27305. (H = p[tt]),
  27306. (X = p[tt + 1]),
  27307. (Y = p[tt + 2]),
  27308. (alpha = p[tt + 3]),
  27309. S + U)
  27310. ) {
  27311. case 0:
  27312. ;(W[et] += H * nt),
  27313. (W[et + 1] += X * nt),
  27314. (W[et + 2] += Y * nt),
  27315. (W[et + 3] += alpha * nt)
  27316. break
  27317. case 1:
  27318. ;(k = C * ht),
  27319. (W[et] += H * k),
  27320. (W[et + 1] += X * k),
  27321. (W[et + 2] += Y * k),
  27322. (W[et + 3] += alpha * k),
  27323. (k = E * ht),
  27324. (W[et + 4] += H * k),
  27325. (W[et + 5] += X * k),
  27326. (W[et + 6] += Y * k),
  27327. (W[et + 7] += alpha * k)
  27328. break
  27329. case 2:
  27330. ;(k = rt * F),
  27331. (W[et] += H * k),
  27332. (W[et + 1] += X * k),
  27333. (W[et + 2] += Y * k),
  27334. (W[et + 3] += alpha * k),
  27335. (k = rt * L),
  27336. (et += $),
  27337. (W[et] += H * k),
  27338. (W[et + 1] += X * k),
  27339. (W[et + 2] += Y * k),
  27340. (W[et + 3] += alpha * k)
  27341. break
  27342. default:
  27343. ;(k = C * F),
  27344. (W[et] += H * k),
  27345. (W[et + 1] += X * k),
  27346. (W[et + 2] += Y * k),
  27347. (W[et + 3] += alpha * k),
  27348. (k = E * F),
  27349. (W[et + 4] += H * k),
  27350. (W[et + 5] += X * k),
  27351. (W[et + 6] += Y * k),
  27352. (W[et + 7] += alpha * k),
  27353. (k = C * L),
  27354. (et += $),
  27355. (W[et] += H * k),
  27356. (W[et + 1] += X * k),
  27357. (W[et + 2] += Y * k),
  27358. (W[et + 3] += alpha * k),
  27359. (k = E * L),
  27360. (W[et + 4] += H * k),
  27361. (W[et + 5] += X * k),
  27362. (W[et + 6] += Y * k),
  27363. (W[et + 7] += alpha * k)
  27364. }
  27365. delete p, h(), (J = n(W))
  27366. }
  27367. if ((G.putImageData(J, 0, 0), 'string' == typeof i)) {
  27368. if ('png' === i || 'jpeg' === i) {
  27369. var ot
  27370. return (
  27371. (ot = r && a.src ? a : new Image()),
  27372. (ot.width = s),
  27373. (ot.height = f),
  27374. (ot.src = B.toDataURL('image/' + i, 0.85)),
  27375. ot
  27376. )
  27377. }
  27378. if ('png-src' === i || 'jpeg-src' === i)
  27379. return B.toDataURL('image/' + i.split('-')[0], 0.85)
  27380. }
  27381. return B
  27382. }
  27383. var e = this
  27384. 'undefined' != typeof exports
  27385. ? ('undefined' != typeof module && module.exports && (exports = module.exports = t),
  27386. (exports.scale = t))
  27387. : (c = t)
  27388. }).call(this)
  27389. OUTPUT.exports = c
  27390. },
  27391. {}
  27392. ],
  27393. 156: [
  27394. function (e, t, i) {
  27395. ;(function (i) {
  27396. 'use strict'
  27397. function n(e, t) {
  27398. ;(this.model = e),
  27399. (this.panos = e.panos),
  27400. (this.player = t),
  27401. (this.imagePanos = this.listImagePanos()),
  27402. (this.retryMinimumTime = 1e4)
  27403. }
  27404. var r = (e('three'), e('./enum/Viewmode')),
  27405. o = (e('./settings'), e('./objects/Panorama')),
  27406. a = e('./util/logger'),
  27407. s = new a(i)
  27408. ;(n.prototype.start = function () {
  27409. this.loadNextPano(
  27410. function (e) {
  27411. e
  27412. ? this.start()
  27413. : (s.debug(
  27414. 'No suitable pano loaded, waiting a little while before looking again'
  27415. ),
  27416. setTimeout(
  27417. function () {
  27418. this.start()
  27419. }.bind(this),
  27420. 1e3
  27421. ))
  27422. }.bind(this)
  27423. )
  27424. }),
  27425. (n.prototype.validLoadTarget = function (e) {
  27426. return (
  27427. e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  27428. )
  27429. }),
  27430. (n.prototype.listImagePanos = function () {
  27431. var e = [],
  27432. t = this
  27433. return (
  27434. this.model.images.forEach(function (i) {
  27435. if (i.metadata && i.metadata.scan_id) {
  27436. var n = t.model.panos.get(i.metadata.scan_id)
  27437. n && !n.isLoaded('high') && e.push(n)
  27438. }
  27439. }),
  27440. e
  27441. )
  27442. }),
  27443. (n.prototype.nextNotLoadedImage = function () {
  27444. for (; this.imagePanos.length > 0; ) {
  27445. var e = this.imagePanos[0]
  27446. if (!e.isLoaded('high')) return e
  27447. this.imagePanos.shift()
  27448. }
  27449. return null
  27450. }),
  27451. (n.prototype.loadNextPano = function (e) {
  27452. var t,
  27453. i,
  27454. n = this.model.waitQueue.filter(function (e) {
  27455. return e.object instanceof o
  27456. })
  27457. n.length > 0
  27458. ? ((t = n[0].object),
  27459. s.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  27460. : this.validLoadTarget(this.player.currentPano)
  27461. ? ((t = this.player.currentPano),
  27462. s.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  27463. : this.validLoadTarget(this.player.closestPano)
  27464. ? ((t = this.player.closestPano),
  27465. s.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  27466. : this.validLoadTarget(this.nextNotLoadedImage())
  27467. ? ((i = 'high'),
  27468. (t = this.imagePanos[0]),
  27469. s.debug('Overrode pano selection: Highlight image ' + t.id))
  27470. : this.player.mode === r.PANORAMA &&
  27471. ((t = this.panos.lowestByScore(
  27472. [
  27473. this.validLoadTarget.bind(this),
  27474. o.filters.isNeighbourPanoTo(this.player.currentPano)
  27475. ],
  27476. [
  27477. o.scoreFunctions.distance(this.player.currentPano),
  27478. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  27479. o.scoreFunctions.inFieldOfView(
  27480. this.player.position,
  27481. this.player.getDirection()
  27482. )
  27483. ]
  27484. )),
  27485. t && s.debug('Normal pano selection: neighbor ' + t.id)),
  27486. t
  27487. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  27488. s.debug('Preloading ' + i + '-res pano ' + t.id),
  27489. t
  27490. .loadCube(i)
  27491. .done(e)
  27492. .fail(function () {
  27493. s.warn(
  27494. 'Failed preloading pano',
  27495. t.id,
  27496. ', marking it as failed and forgetting it for a while'
  27497. ),
  27498. e()
  27499. }))
  27500. : e && e(null)
  27501. }),
  27502. (t.exports = n)
  27503. }).call(this, '/js/preloaders.js')
  27504. },
  27505. {
  27506. './enum/Viewmode': 51,
  27507. './objects/Panorama': 148,
  27508. './settings': 166,
  27509. './util/logger': 189,
  27510. three: 217
  27511. }
  27512. ],
  27513. 157: [
  27514. function (e, t, i) {
  27515. ;(function (i) {
  27516. 'use strict'
  27517. function n(e, t, i, n, r) {
  27518. ;(this.qualityManager = e),
  27519. (this.scene = t),
  27520. (this.camera = i),
  27521. (this.container = r),
  27522. (this.controls = n),
  27523. (this.controls.enabled = !0),
  27524. (this.controls.locked = !0),
  27525. (this.quickstartCamera = n.camera),
  27526. (this.quickstartCamera.fov = h.clampVFOV(
  27527. a.insideFOV,
  27528. a.insideFOVMax,
  27529. $('#player').width(),
  27530. $('#player').height()
  27531. )),
  27532. (this.skybox = null)
  27533. }
  27534. var r = e('three'),
  27535. o = e('../util/logger'),
  27536. a = e('../constants'),
  27537. s =
  27538. (e('../util/transitions'),
  27539. e('../util/lerp'),
  27540. e('../util/easing'),
  27541. e('../enum/Vectors')),
  27542. l = e('../enum/PanoSizeClass'),
  27543. c = (e('../materials/ModelTextureMaterial'), e('../materials/CubemapMaterial')),
  27544. h =
  27545. (e('../cameras/PanoramaCamera'),
  27546. e('../controls/PanoramaControls'),
  27547. e('../tile/TileUtils'),
  27548. e('../util/camera'),
  27549. e('../util/cameraLight')),
  27550. u = (e('../util/browser'), e('../settings'), e('../gui/helpManager'), new o(i))
  27551. ;(n.prototype.load = function (e) {
  27552. e.pano.shouldRedrawOnBaseLoaded = !0
  27553. var t,
  27554. i,
  27555. n = this,
  27556. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  27557. o = r.clone().negate()
  27558. this.controls.lookAt(r.add(this.quickstartCamera.position))
  27559. var a = this.qualityManager.getPanoSize(l.BASE),
  27560. c = this.qualityManager.getPanoSize(l.STANDARD)
  27561. if (e.pano.tiled) {
  27562. u.warn('Loading startPano, TILED', e.pano.id)
  27563. var d = h.getHFOVForCamera(
  27564. this.quickstartCamera,
  27565. $('#player').width(),
  27566. $('#player').height()
  27567. ),
  27568. p = this.quickstartCamera.fov
  27569. u.warn(
  27570. 'Quickstart loading tiles in frustum: [horizontal FOV: ' +
  27571. d +
  27572. ', vertical FOV: ' +
  27573. p +
  27574. ']'
  27575. ),
  27576. (t = e.pano.loadTiledPano(
  27577. c,
  27578. r,
  27579. {
  27580. hFov: d,
  27581. vFov: p
  27582. },
  27583. !1,
  27584. !1,
  27585. !0
  27586. )),
  27587. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0))
  27588. } else u.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'))
  27589. return $.when(t).then(
  27590. function () {
  27591. n.init(e.pano, e.quaternion),
  27592. e.pano.tiled
  27593. ? i.done(
  27594. function () {
  27595. ;(e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1)
  27596. }.bind(this)
  27597. )
  27598. : (this.controls.locked = !1)
  27599. }.bind(this)
  27600. )
  27601. }),
  27602. (n.prototype.init = function (e, t) {
  27603. u.info('Quickstart done loading, adding scene objects'),
  27604. (e.lockUntilRenderingComplete = !0),
  27605. (this.skybox = new r.Mesh(
  27606. new r.CubeGeometry(1, 1, 1),
  27607. new c({
  27608. side: r.BackSide
  27609. })
  27610. )),
  27611. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  27612. this.skybox.quaternion.copy(e.quaternion),
  27613. this.scene.add(this.skybox),
  27614. $(this.container).show()
  27615. }),
  27616. (n.prototype.update = function (e) {
  27617. this.controls.update(e), this.camera.copy(this.quickstartCamera)
  27618. }),
  27619. (n.prototype.setSize = function (e, t) {
  27620. this.quickstartCamera.updateAspect(e / t)
  27621. }),
  27622. (n.prototype.destroy = function () {
  27623. this.scene.remove(this.skybox)
  27624. }),
  27625. (t.exports = n)
  27626. }).call(this, '/js/scene/QuickstartManager.js')
  27627. },
  27628. {
  27629. '../cameras/PanoramaCamera': 7,
  27630. '../constants': 8,
  27631. '../controls/PanoramaControls': 13,
  27632. '../enum/PanoSizeClass': 36,
  27633. '../enum/Vectors': 50,
  27634. '../gui/helpManager': 68,
  27635. '../materials/CubemapMaterial': 117,
  27636. '../materials/ModelTextureMaterial': 118,
  27637. '../settings': 166,
  27638. '../tile/TileUtils': 174,
  27639. '../util/browser': 182,
  27640. '../util/camera': 183,
  27641. '../util/cameraLight': 184,
  27642. '../util/easing': 186,
  27643. '../util/lerp': 188,
  27644. '../util/logger': 189,
  27645. '../util/transitions': 195,
  27646. three: 217
  27647. }
  27648. ],
  27649. 158: [
  27650. function (e, t, i) {
  27651. 'use strict'
  27652. function n(e, t, i) {
  27653. ;(this.scene = e),
  27654. (this.camera = t),
  27655. (this.renderer = null),
  27656. (this.effects = i),
  27657. (this.animateCallback = null),
  27658. (this.composer = null),
  27659. (this.qualityManager = null),
  27660. (e.renderWidth = 0),
  27661. (e.renderHeight = 0),
  27662. (this.updateClock = new r.Clock()),
  27663. (this.components = []),
  27664. (this.updateListeners = []),
  27665. (this.resizeListeners = []),
  27666. (this.forceUpdateSize = !1),
  27667. (this.started = !1),
  27668. (this.textures = {}),
  27669. (this.suspendedObjects = [])
  27670. }
  27671. var r = e('three'),
  27672. o = e('../shaders'),
  27673. a = e('../enum/SceneRendererEvents'),
  27674. s = e('../enum/GLTextureType'),
  27675. l = e('../enum/GLCubeFaces'),
  27676. c = e('../exception/BasicException'),
  27677. h = e('../exception/RendererCreationException'),
  27678. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  27679. m = e('../util/browser'),
  27680. /**************************************************************************************************************************************************/
  27681. u = e('../settings'),
  27682. d = e('events').EventEmitter
  27683. ;(window.requestAnimationFrame =
  27684. window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  27685. (n.prototype = Object.create(d.prototype)),
  27686. (n.prototype.addComponent = function (e) {
  27687. this.components.push(e),
  27688. e.update && this.updateListeners.push(e),
  27689. e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0))
  27690. }),
  27691. (n.prototype.removeComponent = function (e) {
  27692. var t = function (t) {
  27693. return t !== e
  27694. }
  27695. ;(this.components = this.components.filter(t)),
  27696. (this.updateListeners = this.updateListeners.filter(t)),
  27697. (this.resizeListeners = this.resizeListeners.filter(t))
  27698. }),
  27699. (n.prototype.start = function (e) {
  27700. if (this.started) throw new c("Can't start SceneRenderer, already started")
  27701. this.createContext(e),
  27702. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  27703. m.isMobile() && this.boluoVrInit(),
  27704. /*******************************************************************************************************************************/
  27705. this.initComposer(),
  27706. (this.started = !0),
  27707. (p = p.bind(this))()
  27708. }),
  27709. (n.prototype.createContext = function (e) {
  27710. var transparent = !!(settings.transparentBg || settings.bgImg)
  27711. try {
  27712. ;(this.renderer = new r.WebGLRenderer({
  27713. antialias: !m.isMobile(),
  27714. alpha: transparent
  27715. })),
  27716. (this.renderer.autoClear = !0),
  27717. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  27718. this.renderer.setSize($('#player').width(), $('#player').height(), false), //改
  27719. transparent && this.renderer.setClearColor(0x000000, 0) //透明
  27720. this.emit(a.ContextCreated)
  27721. } catch (e) {
  27722. throw new h('Unable to create a WebGL rendering context')
  27723. }
  27724. u.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement)
  27725. /* window.stats = new Stats();
  27726. e.appendChild( stats.dom ); */
  27727. }),
  27728. (n.prototype.overrideTextures = function () {
  27729. var e = this.renderer.context,
  27730. t = 0,
  27731. i = e.createTexture
  27732. e.createTexture = function () {
  27733. var n = i.call(e)
  27734. return (n.id = t++), (this.textures[n.id] = n), n
  27735. }.bind(this)
  27736. var n = e.texImage2D
  27737. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  27738. var d,
  27739. p = this.getTextureTypeFromTarget(e, t)
  27740. ;(d =
  27741. p === s.TextureCube
  27742. ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP)
  27743. : e.getParameter(e.TEXTURE_BINDING_2D)),
  27744. void 0 !== c
  27745. ? n.call(e, t, i, r, o, a, l, c, h, u)
  27746. : ((c = o),
  27747. (h = a),
  27748. (u = l),
  27749. (o = u.naturalWidth),
  27750. (a = u.naturalHeight),
  27751. n.call(e, t, i, r, c, h, u))
  27752. var f = this.textures[d.id]
  27753. ;(f.width = p === s.TextureCube ? 6 * o : o), (f.height = a)
  27754. }.bind(this)
  27755. var r = e.deleteTexture
  27756. e.deleteTexture = function (t) {
  27757. delete this.textures[t.id], r.call(e, t)
  27758. }.bind(this)
  27759. }),
  27760. (n.prototype.updateTextureMemory = (function () {
  27761. var e = null
  27762. return function () {
  27763. var t = 0
  27764. for (var i in this.textures) {
  27765. var n = this.textures[i]
  27766. n.width && n.height && (t += n.width * n.height * 4)
  27767. }
  27768. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t)
  27769. }
  27770. })()),
  27771. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  27772. switch (t) {
  27773. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  27774. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  27775. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  27776. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27777. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  27778. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27779. return s.TextureCube
  27780. case e.TEXTURE_2D:
  27781. return s.Texture2D
  27782. default:
  27783. return null
  27784. }
  27785. }),
  27786. (n.prototype.initComposer = function () {
  27787. ;(this.composer = new r.EffectComposer(this.renderer)),
  27788. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  27789. //this.composer.addPass(this.effects.hblurPass),
  27790. //this.composer.addPass(this.effects.vblurPass)
  27791. this.composer.addPass(this.effects.fastTranMaskPass) //add
  27792. }),
  27793. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  27794. ;(this.renderWidth = e),
  27795. (this.renderHeight = t),
  27796. (this.effects.aspect = e / t),
  27797. /* this.renderer.setSize(e, t), -----MP */
  27798. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  27799. this.composer.setSize(e, t)
  27800. for (var i = 0; i < this.resizeListeners.length; i++)
  27801. this.resizeListeners[i].setSize(e, t)
  27802. }),
  27803. (n.prototype.render = function () {
  27804. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  27805. this.effects.fastTranMaskPass.enabled
  27806. ? this.composer.render()
  27807. : this.renderer.render(this.scene, this.camera)
  27808. })
  27809. /******************************************************************************************************徐世廷**********************************************************************/
  27810. var vrPermission = {}
  27811. var vrPermissionCallBack = function (info1, info2) {
  27812. if (info1 == 'reset') {
  27813. vrPermission = {}
  27814. } else {
  27815. vrPermission[info1] = info2
  27816. if (
  27817. Object.keys(vrPermission).length == 2 &&
  27818. (vrPermission.deviceMotion != 'granted' ||
  27819. vrPermission.deviceOrientation != 'granted')
  27820. ) {
  27821. alert(
  27822. '运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。'
  27823. )
  27824. }
  27825. }
  27826. }
  27827. ;(n.prototype.boluoVrInit = function () {
  27828. console.log('boluoVrInit')
  27829. //webxr.init(this.renderer)
  27830. ;(this.isHuawei5X = m.detectHUAWEI5X()),
  27831. (this.oldRenderer = this.renderer),
  27832. (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera))
  27833. window.panoCamera = this.camera
  27834. var a = this
  27835. ;(window._vrEnabled = !1),
  27836. Object.defineProperty(window, 'vrEnabled', {
  27837. get: function () {
  27838. return window._vrEnabled
  27839. },
  27840. set: function (b) {
  27841. //if(webxr.xrType)return webxr.enterVR()
  27842. b = !!b
  27843. b
  27844. ? ((a.renderer = a.newRenderer),
  27845. window.vrMarkers.forEach(function (a) {
  27846. a.visible = !0
  27847. }))
  27848. : ((a.renderer = a.oldRenderer),
  27849. window.vrMarkers.forEach(function (a) {
  27850. a.visible = !1
  27851. })),
  27852. (a.cursor.visible = b),
  27853. a.setSize(window.innerWidth, window.innerHeight),
  27854. (window._vrEnabled = b)
  27855. $('.cad').css('visibility', b ? 'hidden' : '')
  27856. if (b) {
  27857. setTimeout(function () {
  27858. console.log('orientEnable' + window.orientEnable)
  27859. if (window.vrEnabled && !window.orientEnable) {
  27860. //很可能没能触发陀螺仪事件
  27861. if (m.detectIOS() /* && m.detectSafari() */) {
  27862. var b = m.iosVersion() //{major: 10, minor: 3, patch: 1}
  27863. console.log('开始获取权限 major' + b.major)
  27864. if (b.major == 12 && b.minor >= 2) {
  27865. if (browser.detectSafari())
  27866. alert(
  27867. '浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。'
  27868. )
  27869. else {
  27870. //app??
  27871. alert(
  27872. '浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。'
  27873. )
  27874. }
  27875. } else if (b.major >= 13) {
  27876. if (!window.location.href.includes('https://')) {
  27877. console.log('需要https')
  27878. alert('当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。')
  27879. return
  27880. }
  27881. var hasFailed =
  27882. window.vrPermission &&
  27883. (window.vrPermission.deviceMotion != 'granted' ||
  27884. window.vrPermission.deviceOrientation != 'granted')
  27885. setTimeout(
  27886. () => {
  27887. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  27888. if (!window.vrEnabled || window.orientEnable) return
  27889. vrPermissionCallBack('reset')
  27890. console.log(window.DeviceMotionEvent)
  27891. if (
  27892. window.DeviceMotionEvent &&
  27893. window.DeviceMotionEvent.requestPermission &&
  27894. typeof window.DeviceMotionEvent.requestPermission === 'function'
  27895. ) {
  27896. console.log('开始获取权限1')
  27897. ///注意:需要https 本地服务器permissionState会得到denied
  27898. window.DeviceMotionEvent.requestPermission()
  27899. .then(permissionState => {
  27900. console.log('permissionState1: ' + permissionState)
  27901. vrPermissionCallBack('deviceMotion', permissionState)
  27902. })
  27903. .catch(function (e) {
  27904. vrPermissionCallBack('deviceMotion', false)
  27905. console.log(e)
  27906. })
  27907. } else {
  27908. console.log('window.DeviceMotionEvent undefined')
  27909. vrPermissionCallBack('deviceMotion', false)
  27910. }
  27911. if (
  27912. window.DeviceOrientationEvent &&
  27913. window.DeviceOrientationEvent.requestPermission &&
  27914. typeof window.DeviceOrientationEvent.requestPermission ===
  27915. 'function'
  27916. ) {
  27917. console.log('开始获取权限2')
  27918. window.DeviceOrientationEvent.requestPermission()
  27919. .then(permissionState => {
  27920. console.log('permissionState2: ' + permissionState)
  27921. vrPermissionCallBack('deviceOrientation', permissionState)
  27922. })
  27923. .catch(function (e) {
  27924. vrPermissionCallBack('deviceOrientation', false)
  27925. console.log(e)
  27926. })
  27927. } else {
  27928. console.log('window.DeviceOrientationEvent undefined')
  27929. vrPermissionCallBack('deviceOrientation', false)
  27930. }
  27931. },
  27932. hasFailed ? 0 : 150
  27933. )
  27934. /* /* setTimeout(function(){
  27935. if(settings.vrEnabled && !window.orientEnable){
  27936. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  27937. }
  27938. },4000) */
  27939. } else console.log('陀螺仪未能启用 ios ' + b.major + '.' + b.minor)
  27940. } else {
  27941. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  27942. }
  27943. } else {
  27944. //已经触发了
  27945. }
  27946. }, 200)
  27947. }
  27948. }
  27949. }),
  27950. this.createCursor(0.5, !1, 1, 16777215, 0)
  27951. var b = {
  27952. setSize: function (b, c) {
  27953. a.camera.aspect = b / c
  27954. }
  27955. }
  27956. this.resizeListeners.push(b), this.vrLoadingInit()
  27957. }),
  27958. (n.prototype.vrLoadingInit = function () {
  27959. var a = function (camera) {
  27960. var a = this,
  27961. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  27962. c = new r.MeshBasicMaterial({
  27963. color: 4967932,
  27964. side: r.DoubleSide
  27965. }),
  27966. d = new r.Mesh(b, c)
  27967. ;(this.mesh = d),
  27968. (d.position.z = -2),
  27969. d.scale.set(0.08, 0.08, 0.08),
  27970. (d.visible = !1),
  27971. camera.add(d),
  27972. //window.player.camera.add(d),
  27973. (a.enabled = !1),
  27974. (this.update = function (b) {
  27975. 1 == a.enabled && (d.rotation.z += 15 * b)
  27976. })
  27977. },
  27978. a = new a(this.camera)
  27979. ;(window.Loading = a), this.updateListeners.push(a)
  27980. }),
  27981. (n.prototype.createCursor = function (a, b, c, d, e) {
  27982. var g,
  27983. h = new r.SpriteMaterial({
  27984. opacity: c,
  27985. color: d,
  27986. transparent: b,
  27987. map: this.boluoGetTexture('images/cursor.png'),
  27988. needsUpdate: !0,
  27989. side: r.DoubleSide
  27990. })
  27991. ;(h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  27992. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  27993. (h.depthTest = !1),
  27994. (h.blending = r.AdditiveBlending),
  27995. (g = new r.Sprite(h)),
  27996. // g.scale.set(a, a, a),
  27997. g.scale.set(0.3, 0.3, 0.3)
  27998. ;(g.position.z = -2),
  27999. (g.visible = !1),
  28000. (g.name = 'cursor'),
  28001. this.camera.add(g),
  28002. this.scene.add(this.camera),
  28003. (this.cursor = g)
  28004. var i = new this.CursorAnimation(this.scene, g, this.camera)
  28005. ;(this.cursor.triggerTargetEvent = i.triggerTargetEvent), this.updateListeners.push(i)
  28006. }),
  28007. (window.orientEnable = 0) //是否能触发deviceorientation
  28008. ;(n.prototype.CursorAnimation = function (a, b, c) {
  28009. function d() {
  28010. g.orient = r.Math.degToRad(window.orientation || 0)
  28011. }
  28012. function e(a) {
  28013. if (!window.vrEnabled && window.orientEnable) return
  28014. window.orientEnable || (window.orientEnable = 1)
  28015. var b = r.Math.degToRad(a.alpha),
  28016. c = r.Math.degToRad(a.beta),
  28017. d = r.Math.degToRad(a.gamma)
  28018. if (
  28019. (this.isHuawei5X
  28020. ? (-1e3 === g.alpha && (g.alpha = b),
  28021. -1e3 === g.beta && (g.beta = c),
  28022. -1e3 === g.gamma && (g.gamma = d),
  28023. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  28024. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  28025. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  28026. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  28027. n.vrDebug)
  28028. ) {
  28029. $('#info-device-orientation').css('display', 'block')
  28030. var e = ''
  28031. ;(e += 'alpha=(' + g.alpha + ')<BR/>'),
  28032. (e += 'beta=(' + g.beta + ')<BR/>'),
  28033. (e += 'gamma=' + g.gamma + '<BR/>'),
  28034. (document.getElementById('info-device-orientation').innerHTML = e)
  28035. }
  28036. }
  28037. ;(this.cursor = b),
  28038. (this.raycaster = new r.Raycaster()),
  28039. (this.targetEventObj = {}),
  28040. (this.type = 1),
  28041. (this.tweenFlag = !0)
  28042. var g = this
  28043. ;(this.target = c),
  28044. console.log(c.uuid),
  28045. (this.euler = new r.Euler()),
  28046. (this.q0 = new r.Quaternion()),
  28047. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  28048. (this.zee = new r.Vector3(0, 0, 1)),
  28049. (this.alpha = -1e3),
  28050. (this.beta = -1e3),
  28051. (this.gamma = -1e3),
  28052. (this.orient = r.Math.degToRad(window.orientation || 0)),
  28053. window.addEventListener('orientationchange', d),
  28054. window.addEventListener('deviceorientation', e),
  28055. (this.setObjectQuaternion = function (a, b, d, e, f) {
  28056. g.euler.set(d, b, -e, 'YXZ'),
  28057. a.setFromEuler(g.euler),
  28058. a.multiply(g.q1),
  28059. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  28060. c.updateMatrixWorld()
  28061. }),
  28062. parent !== window &&
  28063. window.addEventListener('message', function (a) {
  28064. var b = JSON.parse(a.data),
  28065. c = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  28066. b &&
  28067. b.alpha &&
  28068. b.beta &&
  28069. b.gamma &&
  28070. (function (a) {
  28071. var c = r.Math.degToRad(b.alpha),
  28072. d = r.Math.degToRad(b.beta),
  28073. e = r.Math.degToRad(b.gamma)
  28074. a
  28075. ? (-1e3 === g.alpha && (g.alpha = c),
  28076. -1e3 === g.beta && (g.beta = d),
  28077. -1e3 === g.gamma && (g.gamma = e),
  28078. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  28079. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  28080. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  28081. : ((g.alpha = c), (g.beta = d), (g.gamma = e))
  28082. })(c)
  28083. }),
  28084. (this.update = function (a) {
  28085. TWEEN.update()
  28086. if (window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  28087. else
  28088. window.vrEnabled &&
  28089. (this.setObjectQuaternion(
  28090. this.target.quaternion,
  28091. this.alpha,
  28092. this.beta,
  28093. this.gamma,
  28094. this.orient
  28095. ),
  28096. this.triggerTargetEvent())
  28097. }),
  28098. (this.triggerTargetEvent = function () {
  28099. var a = this.choseObj(),
  28100. b = a ? a.object : void 0
  28101. ;(this.targetEventObj.currentObj = b),
  28102. b !== this.targetEventObj.lastObj &&
  28103. (b && this.autoCursorPosition(a),
  28104. 1 === this.type
  28105. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  28106. b &&
  28107. b.enabled &&
  28108. this.startAnimate(
  28109. function () {
  28110. this.clickCallback(b)
  28111. }.bind(this)
  28112. ))
  28113. : this.type,
  28114. (this.targetEventObj.lastObj = b))
  28115. }),
  28116. (this.choseObj = function () {
  28117. this.raycaster.setFromCamera(
  28118. {
  28119. x: 0,
  28120. y: 0
  28121. },
  28122. c
  28123. )
  28124. var a = (this.raycaster.ray, window.vrMarkers),
  28125. b = this.raycaster.intersectObjects(a)
  28126. if (b.length > 0) return b[0]
  28127. }),
  28128. (this.clickCallback = function (a) {
  28129. this.runTHREEAction(a, 'onclick')
  28130. }),
  28131. (this.runTHREEAction = function (a, b) {
  28132. switch (b) {
  28133. case 'onclick':
  28134. a._listeners &&
  28135. a._listeners.click &&
  28136. a._listeners.click.forEach(function (a) {
  28137. a()
  28138. })
  28139. break
  28140. case 'onhover':
  28141. a._listeners &&
  28142. a._listeners.hover &&
  28143. a._listeners.hover.forEach(function (a) {
  28144. a()
  28145. })
  28146. break
  28147. case 'onout':
  28148. a._listeners &&
  28149. a._listeners.out &&
  28150. a._listeners.out.forEach(function (a) {
  28151. a()
  28152. })
  28153. }
  28154. }),
  28155. (this.startAnimate = function (a) {
  28156. this.tweenFlag && this.initAnimation(a)
  28157. }),
  28158. (this.initAnimation = function (a) {
  28159. var b = this,
  28160. c = this.cursor.material.map.offset,
  28161. d = function (a) {
  28162. return Math.floor(17 * a) / 17
  28163. }
  28164. ;(b.tweenFlag = !1),
  28165. (this.cursorAnimate = new TWEEN.Tween(c)
  28166. .to(
  28167. {
  28168. x: 1
  28169. },
  28170. 1e3
  28171. )
  28172. .onStart(function () {
  28173. b.tweenFlag = !1
  28174. })
  28175. .onStop(function () {
  28176. ;(b.tweenFlag = !0), (this.x = 0), (c.x = 0)
  28177. })
  28178. .onUpdate(function () {})
  28179. .onComplete(function () {
  28180. a(),
  28181. (c.x = 0),
  28182. setTimeout(function () {
  28183. b.tweenFlag = !0
  28184. }, 1500)
  28185. })),
  28186. this.cursorAnimate.easing(d),
  28187. this.cursorAnimate.start()
  28188. }),
  28189. (this.autoCursorPosition = function (a) {
  28190. // var b = Math.abs(a.distance - 10);
  28191. // this.cursor.position.z = -b,
  28192. // b /= 10;
  28193. // alert(b);
  28194. // this.cursor.scale.set(b, b, b)
  28195. this.cursor.scale.set(0.3, 0.3, 0.3)
  28196. })
  28197. }),
  28198. (n.prototype.vrRenderer = function (a, b, c) {
  28199. var d = new b.vrCamera(c)
  28200. ;(d.bananaAspect = 0.8), this.width, this.height
  28201. var b = this
  28202. ;(this.setSize = function (c, d) {
  28203. a.setSize.call(this, c, d), (b.width = c), (b.height = d)
  28204. }),
  28205. (this.render = function (b, c, e, f) {
  28206. window.cameraQua = c.quaternion.clone()
  28207. var g, h
  28208. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f)
  28209. if ('PerspectiveCamera' === c.type)
  28210. (g = d.cameraL),
  28211. (h = d.cameraR),
  28212. b.updateMatrixWorld(),
  28213. null === c.parent && c.updateMatrixWorld(),
  28214. d.vrCameraUpdate(c)
  28215. else {
  28216. if ('OrthographicCamera' !== c.type)
  28217. return DEBUG && console.error('Unsupported renderer: ', c.type)
  28218. g = h = c
  28219. }
  28220. a.setScissorTest(!0),
  28221. a.setScissor(0, 0, this.width / 2, this.height),
  28222. a.setViewport(0, 0, this.width / 2, this.height),
  28223. a.render.call(this, b, g, e, f),
  28224. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  28225. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  28226. a.render.call(this, b, h, e, f),
  28227. a.setScissorTest(!1)
  28228. }),
  28229. (this.__proto__ = {
  28230. __proto__: a
  28231. })
  28232. }),
  28233. (n.prototype.vrCamera = function (a) {
  28234. ;(this.type = 'StereoCamera'),
  28235. (this._aspect = 1),
  28236. (this._overlap = 0.064),
  28237. (this.cameraL = new r.PerspectiveCamera()),
  28238. this.cameraL.layers.enable(1),
  28239. (this.cameraL.near = 0.01), //xzw add
  28240. (this.cameraL.matrixAutoUpdate = !1),
  28241. (this.cameraR = new r.PerspectiveCamera()),
  28242. this.cameraR.layers.enable(2),
  28243. (this.cameraR.near = 0.01), //xzw add
  28244. (this.cameraR.matrixAutoUpdate = !1),
  28245. (this.eyeRight = new r.Matrix4()),
  28246. (this.eyeLeft = new r.Matrix4()),
  28247. (this.vrCameraNeedsUpdate = !0),
  28248. (window.vrCameraL = this.cameraL) // fyz 记录vr相机
  28249. Object.defineProperty(this, 'bananaAspect', {
  28250. get: function () {
  28251. return this._aspect
  28252. },
  28253. set: function (a) {
  28254. this._aspect !== a && (this.vrCameraNeedsUpdate = !0), (this._aspect = a)
  28255. }
  28256. }),
  28257. Object.defineProperty(this, 'overlap', {
  28258. get: function () {
  28259. return this._overlap
  28260. },
  28261. set: function (a) {
  28262. this._overlap !== a && (this.vrCameraNeedsUpdate = !0), (this._overlap = a)
  28263. }
  28264. }),
  28265. (this.vrCameraUpdate = function (a) {
  28266. this.vrCameraNeedsUpdate = true
  28267. if (
  28268. ((this.vrCameraNeedsUpdate =
  28269. this.vrCameraNeedsUpdate ||
  28270. this.bananaFov !== a.fov ||
  28271. this.bananaReal_aspect !== a.aspect * this.bananaAspect ||
  28272. this.bananaNear !== a.near ||
  28273. this.bananaFar !== a.far),
  28274. this.vrCameraNeedsUpdate)
  28275. ) {
  28276. ;(this.vrCameraNeedsUpdate = !1),
  28277. //console.debug("vrCameraUpdate"),
  28278. (this.bananaFocus = a.focus),
  28279. (this.bananaFov = a.fov),
  28280. (this.bananaReal_aspect = a.aspect * this.bananaAspect),
  28281. (this.bananaNear = a.near),
  28282. (this.bananaFar = a.far),
  28283. //console.debug(a.aspect),
  28284. (this.bananaFocus = 10)
  28285. var b,
  28286. c,
  28287. d = a.projectionMatrix.clone(),
  28288. e = this.overlap / 2,
  28289. f = (e * this.bananaNear) / this.bananaFocus,
  28290. g = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5)
  28291. ;(this.eyeLeft.elements[12] = -e),
  28292. (this.eyeRight.elements[12] = e),
  28293. (b = -g * this.bananaReal_aspect + f),
  28294. (c = g * this.bananaReal_aspect + f),
  28295. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28296. (d.elements[8] = (c + b) / (c - b)),
  28297. this.cameraL.projectionMatrix.copy(d),
  28298. (b = -g * this.bananaReal_aspect - f),
  28299. (c = g * this.bananaReal_aspect - f),
  28300. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28301. (d.elements[8] = (c + b) / (c - b)),
  28302. this.cameraR.projectionMatrix.copy(d)
  28303. }
  28304. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  28305. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  28306. })
  28307. }),
  28308. (n.prototype.boluoGetTexture = function (a) {
  28309. var b = new r.TextureLoader()
  28310. return (b.crossOrigin = 'anonymous'), b.load(a)
  28311. })
  28312. /* let webxr = {
  28313. init(renderer) {
  28314. this.renderer = renderer
  28315. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  28316. renderer.xr.enabled = true
  28317. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  28318. //pico firefox
  28319. var mode = 'immersive-vr'
  28320. navigator.xr
  28321. .isSessionSupported(mode)
  28322. .then(supported => {
  28323. if (!supported) {
  28324. this.xrNotFound('isSessionSupported not supported')
  28325. } else {
  28326. this.xrType = 'xr' //showEnterXR();
  28327. }
  28328. })
  28329. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  28330. } else if ('getVRDisplays' in navigator) {
  28331. //pico 的vr browser是这个
  28332. console.log('getVRDisplays')
  28333. let setDevice = device => {
  28334. this.xrType = 'vr'
  28335. this.device = device
  28336. this.renderer.xr.setDevice(device) //新版是renderer.vr
  28337. }
  28338. window.addEventListener(
  28339. 'vrdisplayconnect',
  28340. function (event) {
  28341. setDevice(event.display)
  28342. },
  28343. false
  28344. )
  28345. window.addEventListener(
  28346. 'vrdisplaydisconnect',
  28347. function ( ) {
  28348. console.log('vrdisplaydisconnect')
  28349. window.bus.dispatchEvent({type:'exitWebXR'})
  28350. },
  28351. false
  28352. )
  28353. window.addEventListener(
  28354. 'vrdisplaypresentchange',
  28355. function (event) {
  28356. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  28357. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  28358. },
  28359. false
  28360. )
  28361. window.addEventListener(
  28362. 'vrdisplayactivate',
  28363. function (event) {
  28364. event.display.requestPresent([{ source: this.renderer.domElement }])
  28365. },
  28366. false
  28367. )
  28368. navigator
  28369. .getVRDisplays()
  28370. .then(function (displays) {
  28371. if (displays.length > 0) {
  28372. setDevice(displays[0])
  28373. } else {
  28374. this.xrNotFound('no displays')
  28375. }
  28376. })
  28377. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  28378. } else {
  28379. this.xrNotFound('xr not supported')
  28380. }
  28381. },
  28382. enterVR() {
  28383. if (!this.xrType) return //不支持
  28384. console.log('enterVR', this.xrType)
  28385. if (this.xrType == 'vr') {
  28386. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  28387. } else if (this.xrType == 'xr') {
  28388. if (this.currentSession == void 0) {
  28389. console.log('this.currentSession == void 0 ')
  28390. function getXRSessionInit(mode, options) {
  28391. var space = (options || {}).referenceSpaceType || 'local-floor'
  28392. var sessionInit = (options && options.sessionInit) || {}
  28393. // Nothing to do for default features.
  28394. if (space == 'viewer') return sessionInit
  28395. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  28396. // If the user already specified the space as an optional or required feature, don't do anything.
  28397. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  28398. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  28399. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  28400. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  28401. // request it later.
  28402. var newInit = Object.assign({}, sessionInit)
  28403. newInit.requiredFeatures = [space]
  28404. if (sessionInit.requiredFeatures) {
  28405. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  28406. }
  28407. return newInit
  28408. }
  28409. let onSessionEnded = ( ) => {
  28410. console.log('onSessionEnded')
  28411. this.currentSession.removeEventListener('end', onSessionEnded)
  28412. setTimeout(()=>{
  28413. this.renderer.xr.setSession(null)
  28414. this.currentSession = null
  28415. window.bus.dispatchEvent({type:'exitWebXR'})
  28416. },1)//延迟原因:先使THREE里的onSessionEnded执行
  28417. }
  28418. let onSessionStarted = session => {
  28419. console.log('onSessionStarted')
  28420. session.addEventListener('end', onSessionEnded)
  28421. this.renderer.xr.setSession(session)
  28422. this.currentSession = session
  28423. }
  28424. var mode = 'immersive-vr'
  28425. var sessionInit = getXRSessionInit(mode)
  28426. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  28427. } else {
  28428. console.log('this.currentSession.end()', this.currentSession)
  28429. this.currentSession.end()
  28430. }
  28431. }
  28432. },
  28433. xrNotFound(text) {
  28434. console.log('xrNotFound:', text)
  28435. },
  28436. } */
  28437. /***********************************************************************************************************************************************************************************/
  28438. ;(n.prototype.updateScreenSize = (function () {
  28439. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  28440. var W, H //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  28441. return function (o) {
  28442. var render = false
  28443. var ratio
  28444. var w, h //记录应当render的大小
  28445. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  28446. ;(w = o.width), (h = o.height), (render = true), (ratio = 1)
  28447. } else {
  28448. w = $('#player').width()
  28449. h = $('#player').height()
  28450. o && o.resize && ((W = this.renderWidth), (H = this.renderHeight))
  28451. ;(w !== W || h !== H || this.forceUpdateSize) &&
  28452. ((W = w), (H = h), (render = true), (ratio = window.devicePixelRatio))
  28453. }
  28454. if (render) {
  28455. this.setSize(w, h, ratio)
  28456. this.forceUpdateSize = !1
  28457. }
  28458. }
  28459. })()),
  28460. (n.prototype.updateComponents = function () {
  28461. for (
  28462. var e = Math.min(1, this.updateClock.getDelta()), t = 0;
  28463. t < this.updateListeners.length;
  28464. t++
  28465. )
  28466. this.updateListeners[t].update(e)
  28467. }),
  28468. (n.prototype.suspend = function () {
  28469. ;(this.started = !1),
  28470. (this.suspendedObjects = this.scene.children.map(
  28471. function (e) {
  28472. return this.scene.remove(e), e
  28473. }.bind(this)
  28474. )),
  28475. this.render()
  28476. }),
  28477. (n.prototype.resume = function () {
  28478. this.suspendedObjects.forEach(
  28479. function (e) {
  28480. this.scene.add(e)
  28481. }.bind(this)
  28482. ),
  28483. (this.suspendedObjects = []),
  28484. (this.started = !0),
  28485. p()
  28486. })
  28487. var p = function () {
  28488. this.started &&
  28489. (window.requestAnimationFrame(p),
  28490. this.updateScreenSize(), // fyz resize
  28491. this.updateComponents(),
  28492. this.updateTextureMemory(),
  28493. this.render(),
  28494. window.stats && (window.fps = stats.update()),
  28495. this.emit(a.AfterRender))
  28496. }
  28497. ;(n.prototype.getImageData = (function () {
  28498. var e = document.createElement('canvas'),
  28499. t = e.getContext('2d')
  28500. return function (i, n, r) {
  28501. return (
  28502. (e.width === n && e.height === r) || ((e.width = n), (e.height = r)),
  28503. t.drawImage(i, 0, 0, n, r),
  28504. t.getImageData(0, 0, n, r)
  28505. )
  28506. }
  28507. })()),
  28508. (n.prototype.initSizedTexture2D = function (e, t, i) {
  28509. var n = this.renderer,
  28510. o = n.context,
  28511. a = n.state,
  28512. s = new r.Texture(null)
  28513. ;(s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i)
  28514. var l = n.paramThreeToGL(s.format),
  28515. c = n.paramThreeToGL(s.type),
  28516. h = n.properties.get(s),
  28517. u = o.createTexture()
  28518. a.bindTexture(o.TEXTURE_2D, u),
  28519. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  28520. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  28521. (s.wrapS = t),
  28522. (s.wrapT = t)
  28523. var d = n.paramThreeToGL(t)
  28524. return (
  28525. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  28526. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  28527. i
  28528. ? ((s.magFilter = r.LinearFilter),
  28529. (s.minFilter = r.LinearMipMapLinearFilter),
  28530. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28531. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  28532. o.generateMipmap(o.TEXTURE_2D))
  28533. : ((s.magFilter = r.LinearFilter),
  28534. (s.minFilter = r.LinearFilter),
  28535. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28536. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  28537. a.bindTexture(o.TEXTURE_2D, null),
  28538. (h.__webglTexture = u),
  28539. s
  28540. )
  28541. }),
  28542. (n.prototype.initSizedCubeMap = function (e, t) {
  28543. var i = this.renderer,
  28544. n = i.context,
  28545. o = i.state,
  28546. a = new r.CubeTexture([null, null, null, null, null, null])
  28547. ;(a.flipY = !1), (a.generateMipmaps = t)
  28548. var s = i.paramThreeToGL(a.format),
  28549. l = i.paramThreeToGL(a.type),
  28550. c = i.properties.get(a),
  28551. h = n.createTexture()
  28552. o.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY)
  28553. for (var u = 0; u < 6; u++)
  28554. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null)
  28555. return (
  28556. t
  28557. ? ((a.magFilter = r.LinearFilter),
  28558. (a.minFilter = r.LinearMipMapLinearFilter),
  28559. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28560. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  28561. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  28562. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  28563. : ((a.magFilter = r.LinearFilter),
  28564. (a.minFilter = r.LinearFilter),
  28565. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28566. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  28567. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  28568. (c.__image__webglTextureCube = h),
  28569. a
  28570. )
  28571. }),
  28572. (n.prototype.deallocateCubeTexture = function (e) {
  28573. var t = this.renderer,
  28574. i = t.context,
  28575. n = t.properties.get(e)
  28576. i.deleteTexture(n.__image__webglTextureCube)
  28577. }),
  28578. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  28579. var a = this.renderer,
  28580. s = a.context,
  28581. l = a.state,
  28582. c = a.properties.get(t)
  28583. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  28584. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28585. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  28586. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  28587. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  28588. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  28589. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  28590. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  28591. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  28592. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  28593. l.bindTexture(s.TEXTURE_2D, null)
  28594. }),
  28595. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  28596. var s = this.renderer,
  28597. l = s.context,
  28598. c = s.state,
  28599. h = s.properties.get(t)
  28600. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  28601. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28602. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  28603. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  28604. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  28605. }),
  28606. (n.prototype.rebuildMipMaps2D = function (e) {
  28607. var t = this.renderer,
  28608. i = t.context,
  28609. n = t.state
  28610. t.properties.get(e)
  28611. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  28612. }),
  28613. (n.prototype.rebuildMipMaps3D = function (e) {
  28614. var t = this.renderer,
  28615. i = t.context,
  28616. n = t.state,
  28617. r = t.properties.get(e)
  28618. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  28619. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  28620. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  28621. }),
  28622. (n.prototype.renderToCubeMap = (function () {
  28623. var e = !1,
  28624. t = null,
  28625. i = null,
  28626. n = null,
  28627. a = null,
  28628. s = null,
  28629. l = 1
  28630. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  28631. var _ = this.renderer
  28632. _.context
  28633. e ||
  28634. ((i = new r.OrthographicCamera(l / -2, l / 2, l / 2, l / -2, -200, 200)),
  28635. (i.position.z = 150),
  28636. (t = new r.Scene()),
  28637. t.add(i),
  28638. (n = new r.ShaderMaterial({
  28639. uniforms: {
  28640. tDiffuse: {
  28641. type: 't',
  28642. value: null
  28643. },
  28644. alpha: {
  28645. type: 'f',
  28646. value: 1
  28647. }
  28648. },
  28649. vertexShader: o.basicTextured.vertexShader,
  28650. fragmentShader: o.basicTextured.fragmentShader,
  28651. depthWrite: !1,
  28652. depthTest: !1,
  28653. side: r.DoubleSide
  28654. })),
  28655. (a = new r.PlaneBufferGeometry(l, l)),
  28656. (s = new r.Mesh(a, n)),
  28657. (s.position.z = 0),
  28658. t.add(s),
  28659. (e = !0))
  28660. var T = a.getAttribute('uv')
  28661. T.setDynamic(!0), (T.needsUpdate = !0)
  28662. var x = T.array,
  28663. S = p / u,
  28664. M = f / d,
  28665. R = g / u,
  28666. P = m / d
  28667. ;(x[0] = S),
  28668. (x[1] = M + P),
  28669. (x[2] = S + R),
  28670. (x[3] = M + P),
  28671. (x[4] = S),
  28672. (x[5] = M),
  28673. (x[6] = S + R),
  28674. (x[7] = M)
  28675. var O = a.getAttribute('position')
  28676. O.setDynamic(!0), (O.needsUpdate = !0)
  28677. var L = O.array,
  28678. D = v / h.width - l / 2,
  28679. N = A / h.height - l / 2,
  28680. B = y / h.width,
  28681. F = C / h.height
  28682. ;(L[0] = D),
  28683. (L[1] = N + F),
  28684. (L[3] = D + B),
  28685. (L[4] = N + F),
  28686. (L[6] = D),
  28687. (L[7] = N),
  28688. (L[9] = D + B),
  28689. (L[10] = N)
  28690. this.renderer.properties.get(c)
  28691. ;(n.uniforms.tDiffuse.value = c),
  28692. (n.blending = E || r.NoBlending),
  28693. (n.transparent = !!b),
  28694. (void 0 !== w && null !== w) || (w = 1),
  28695. (n.uniforms.alpha.value = w),
  28696. (n.needUpdate = !0),
  28697. (h.activeCubeFace = I),
  28698. h.viewport.set(0, 0, h.width, h.height)
  28699. var V = this.renderer.autoClear
  28700. ;(this.renderer.autoClear = !1),
  28701. this.renderer.render(t, i, h, !1),
  28702. (this.renderer.autoClear = V)
  28703. }
  28704. })()),
  28705. (n.prototype.copyCubeMap = (function () {
  28706. var e = !1,
  28707. t = null,
  28708. i = null,
  28709. a = null,
  28710. s = null,
  28711. l = null,
  28712. c = new r.Euler()
  28713. new r.Vector3()
  28714. return function (h, u, d, p, f, g, m, v, A) {
  28715. if (f > this.qualityManager.maxRenderTargetSize) return //add
  28716. this.renderer
  28717. if (!e) {
  28718. var y = 2
  28719. ;(i = new r.OrthographicCamera(y / -2, y / 2, y / 2, y / -2, 0, 200)),
  28720. i.position.set(0, 0, 0),
  28721. (t = new r.Scene()),
  28722. t.add(i),
  28723. (a = new r.ShaderMaterial({
  28724. uniforms: {
  28725. tDiffuse: {
  28726. type: 't',
  28727. value: null
  28728. },
  28729. alpha: {
  28730. type: 'f',
  28731. value: 1
  28732. }
  28733. },
  28734. vertexShader: o.copyCubeMap.vertexShader,
  28735. fragmentShader: o.copyCubeMap.fragmentShader,
  28736. depthWrite: !1,
  28737. depthTest: !1,
  28738. side: r.DoubleSide
  28739. })),
  28740. (s = new r.BoxGeometry(y, y, y)),
  28741. (l = new r.Mesh(s, a)),
  28742. t.add(l),
  28743. (e = !0)
  28744. }
  28745. for (var C = 0; C < 6; C++)
  28746. n.getCubeOrientationForCubeFace(C, c),
  28747. l.rotation.copy(c),
  28748. (l.matrixWorldNeedsUpdate = !0),
  28749. l.updateMatrixWorld(),
  28750. (a.uniforms.tDiffuse.value = h),
  28751. (a.blending = m || r.NoBlending),
  28752. (a.transparent = !!v),
  28753. (void 0 !== A && null !== A) || (A = 1),
  28754. (a.uniforms.alpha.value = A),
  28755. (a.needUpdate = !0),
  28756. (u.activeCubeFace = C),
  28757. u.viewport.set(0, 0, f, g),
  28758. this.renderer.render(t, i, u, !1)
  28759. }
  28760. })()),
  28761. (n.getLookAtForCubeFace = function (e, t) {
  28762. switch (e) {
  28763. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28764. t.set(1, 0, 0)
  28765. break
  28766. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28767. t.set(-1, 0, 0)
  28768. break
  28769. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28770. t.set(0, 1, 0)
  28771. break
  28772. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28773. t.set(0, -1, 0)
  28774. break
  28775. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28776. t.set(0, 0, 1)
  28777. break
  28778. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28779. t.set(0, 0, -1)
  28780. }
  28781. }),
  28782. (n.getCubeOrientationForCubeFace = function (e, t) {
  28783. switch (e) {
  28784. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28785. t.set(0, -Math.PI / 2, 0)
  28786. break
  28787. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28788. t.set(0, Math.PI / 2, 0)
  28789. break
  28790. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28791. t.set(Math.PI / 2, Math.PI, 0)
  28792. break
  28793. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28794. t.set(-Math.PI / 2, Math.PI, 0)
  28795. break
  28796. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28797. t.set(0, -Math.PI, 0)
  28798. break
  28799. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28800. t.set(0, 0, 0)
  28801. }
  28802. }),
  28803. (t.exports = n)
  28804. },
  28805. {
  28806. '../enum/GLCubeFaces': 25,
  28807. '../enum/GLTextureType': 26,
  28808. '../enum/SceneRendererEvents': 43,
  28809. '../exception/BasicException': 55,
  28810. '../exception/RendererCreationException': 57,
  28811. '../settings': 166,
  28812. '../shaders': 167,
  28813. /********************************************************************fyz改 from徐世廷**********************************************************************/
  28814. '../util/browser': 182,
  28815. /************************************************************************************************************************************************/
  28816. events: 202,
  28817. three: 217
  28818. }
  28819. ],
  28820. 159: [
  28821. function (e, t, i) {
  28822. 'use strict'
  28823. function n(e) {
  28824. ;(this.messenger = new a(e)), (this.clientKey = null)
  28825. }
  28826. var r = e('../util/ajax'),
  28827. o = e('./PostMessageType'),
  28828. a = e('./postmessage'),
  28829. s = e('./VersionInfo'),
  28830. l = e('events').EventEmitter,
  28831. c = window.location.origin + '/api/v1/user/'
  28832. ;(n.prototype = Object.create(l.prototype)),
  28833. (n.prototype.bindEvents = function () {
  28834. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  28835. }),
  28836. (n.prototype.waitForConnection = function () {
  28837. var e = new Promise(
  28838. function (e, t) {
  28839. this.messenger.on(
  28840. o.CONNECT,
  28841. function (i) {
  28842. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  28843. }.bind(this)
  28844. )
  28845. }.bind(this)
  28846. )
  28847. return e
  28848. }),
  28849. (n.prototype.onConnectionReceived = function (e) {
  28850. return (
  28851. this.messenger.setTarget(e.source, e.origin),
  28852. this.verifyConnection(e).then(
  28853. function (t, i) {
  28854. this.messenger.send({
  28855. type: o.ACCEPT,
  28856. toId: e.fromId,
  28857. warning: i
  28858. }),
  28859. (this.clientKey = t),
  28860. this.messenger.removeAllListeners(o.CONNECT),
  28861. this.bindEvents()
  28862. }.bind(this),
  28863. function (t) {
  28864. this.messenger.send({
  28865. type: o.REJECT,
  28866. toId: e.fromId,
  28867. reason: t
  28868. }),
  28869. this.messenger.setTarget()
  28870. }.bind(this)
  28871. )
  28872. )
  28873. }),
  28874. (n.prototype.verifyConnection = function (e) {
  28875. return new Promise(function (t, i) {
  28876. var n
  28877. if (s.isDeprecated(e.sdkVersion)) n = '这个版本正在被弃用'
  28878. else if (!s.isSupported(e.sdkVersion)) return i('不支持此版本的SDK')
  28879. var o = {
  28880. cache: !1,
  28881. headers: {
  28882. 'X-port-Application-Key': e.applicationKey,
  28883. 'X-port-Referrer': e.origin
  28884. }
  28885. }
  28886. r.get(c, o)
  28887. .done(t.bind(this, e.applicationKey, n))
  28888. .fail(i.bind(this, 'key/referrer mismatch'))
  28889. })
  28890. }),
  28891. (n.prototype.onMessageReceived = function (e) {
  28892. if (this.validateClientApplicationKey(e.applicationKey)) {
  28893. var t = this
  28894. ;(e.onDone = function (i) {
  28895. ;(i.toId = e.fromId), (i.uid = e.uid), (i.type = o.RESPONSE), t.messenger.send(i)
  28896. }),
  28897. this.emit(o.ACTION, e)
  28898. }
  28899. }),
  28900. (n.prototype.validateClientApplicationKey = function (e) {
  28901. return this.clientKey === e
  28902. }),
  28903. (n.prototype.sendEvent = function (e, t) {
  28904. this.messenger.send({
  28905. type: o.EVENT,
  28906. eventType: e,
  28907. eventData: t
  28908. })
  28909. }),
  28910. (t.exports = n)
  28911. },
  28912. {
  28913. '../util/ajax': 181,
  28914. './PostMessageType': 160,
  28915. './VersionInfo': 163,
  28916. './postmessage': 165,
  28917. events: 202
  28918. }
  28919. ],
  28920. 160: [
  28921. function (e, t, i) {
  28922. 'use strict'
  28923. t.exports = Object.freeze({
  28924. CONNECT: 'postmessage.connect',
  28925. ACCEPT: 'postmessage.accept',
  28926. REJECT: 'postmessage.reject',
  28927. ACTION: 'postmessage.action',
  28928. RESPONSE: 'postmessage.response',
  28929. EVENT: 'postmessage.event'
  28930. })
  28931. },
  28932. {}
  28933. ],
  28934. 161: [
  28935. function (e, t, i) {
  28936. 'use strict'
  28937. t.exports = Object.freeze({
  28938. MOVE: 'sdk.move',
  28939. ENTER_PANO: 'sdk.enterpano',
  28940. MODEL_LOADED: 'sdk.modelloaded'
  28941. })
  28942. },
  28943. {}
  28944. ],
  28945. 162: [
  28946. function (e, t, i) {
  28947. 'use strict'
  28948. t.exports = Object.freeze({
  28949. FLY: 'transition.fly',
  28950. FADEOUT: 'transition.fade',
  28951. INSTANT: 'transition.instant'
  28952. })
  28953. },
  28954. {}
  28955. ],
  28956. 163: [
  28957. function (e, t, i) {
  28958. 'use strict'
  28959. t.exports = {
  28960. current: '1.0',
  28961. supported: ['1.0'],
  28962. deprecated: [],
  28963. isSupported: function (e) {
  28964. return this.supported.indexOf(e) !== -1
  28965. },
  28966. isDeprecated: function (e) {
  28967. return this.deprecated.indexOf(e) !== -1
  28968. },
  28969. isValid: function (e) {
  28970. return this.isSupported(e) || this.isDeprecated(e)
  28971. }
  28972. }
  28973. },
  28974. {}
  28975. ],
  28976. 164: [
  28977. function (e, t, i) {
  28978. ;(function (i) {
  28979. 'use strict'
  28980. function n(e, t, i) {
  28981. e && (e = e.toLowerCase().trim())
  28982. var n = new I.UP.clone(),
  28983. r = Math.PI / 3,
  28984. o = Math.PI / 2
  28985. switch (e) {
  28986. case 'left':
  28987. i.copy(t), i.applyAxisAngle(n, o)
  28988. break
  28989. case 'right':
  28990. i.copy(t), i.applyAxisAngle(n, -o)
  28991. break
  28992. case 'forwardleft':
  28993. i.copy(t), i.applyAxisAngle(n, r)
  28994. break
  28995. case 'forwardright':
  28996. i.copy(t), i.applyAxisAngle(n, -r)
  28997. break
  28998. case 'forward':
  28999. default:
  29000. i.copy(t)
  29001. }
  29002. return i
  29003. }
  29004. function r(e, t) {
  29005. if (e) {
  29006. var i = {
  29007. pano: e,
  29008. lookAtPoint: null,
  29009. duration: null,
  29010. maxDistanceOverride: null,
  29011. skipWarpingCheck: !1
  29012. }
  29013. this.player.flyToPano(i, function () {
  29014. t &&
  29015. t({
  29016. success: !0,
  29017. message: 'Transition complete.'
  29018. })
  29019. })
  29020. } else
  29021. R.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  29022. t &&
  29023. t({
  29024. success: !1,
  29025. error: 'Unable to find pano.'
  29026. })
  29027. }
  29028. function o(e, t) {
  29029. var i = this.findRankedPano(e, t)
  29030. return i >= 0
  29031. ? this.handleToObject[i]
  29032. : (R.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null)
  29033. }
  29034. function a(e, t) {
  29035. var i = this.findRankedtag(e, t)
  29036. return i >= 0
  29037. ? this.handleToObject[i]
  29038. : (R.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null)
  29039. }
  29040. function s(e, t) {
  29041. t.copy(I.FORWARD), e.getDirection(t)
  29042. }
  29043. function l(e) {
  29044. function t(e) {
  29045. var t = new c.Euler().setFromQuaternion(e.quaternion, 'YXZ')
  29046. return {
  29047. x: c.Math.radToDeg(t._x),
  29048. y: c.Math.radToDeg(t._y),
  29049. z: c.Math.radToDeg(t._z)
  29050. }
  29051. }
  29052. var i = function (e) {
  29053. return e.alignmentType !== m.ALIGNED
  29054. ? null
  29055. : {
  29056. x: e.position.x,
  29057. y: e.position.y,
  29058. z: e.position.z
  29059. }
  29060. }
  29061. return {
  29062. panos: e.panos.list.map(function (n) {
  29063. var r = y.getCubemapUrls(e.urls, n.id, 'high')[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z]
  29064. return {
  29065. uuid: n.id,
  29066. aligned: n.alignmentType === m.ALIGNED,
  29067. neighbourUUIDs: n.neighbourUUIDs.slice(),
  29068. position: i(n),
  29069. rotation: t(n),
  29070. thumbnail: r
  29071. }
  29072. })
  29073. }
  29074. }
  29075. var c = e('three'),
  29076. h = e('./ApiHost'),
  29077. u = e('../util/logger'),
  29078. d = e('../util/common'),
  29079. p = e('../util/math'),
  29080. f = e('../enum/ModelManagerEvents'),
  29081. g = e('./PostMessageType'),
  29082. m = e('../enum/AlignmentType'),
  29083. v = e('../enum/Direction'),
  29084. A = e('./TransitionStyles'),
  29085. y = e('../util/panorama'),
  29086. C = e('../enum/GLCubeFaces'),
  29087. I = e('../enum/Vectors'),
  29088. E = e('../enum/Viewmode'),
  29089. b = e('../enum/WarpStyle'),
  29090. w = (e('../enum/Keys'), e('../enum/PlayerEvents')),
  29091. _ = e('../sdk/SdkEvents'),
  29092. I = e('../enum/Vectors'),
  29093. T = e('../enum/ControlEvents'),
  29094. x = e('../enum/RenderLayers'),
  29095. S = (e('../constants'), e('../settings')),
  29096. M = e('../lib/jpeg_encoder'),
  29097. R = new u(i),
  29098. P = (function () {
  29099. var e = function e() {
  29100. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29101. e.player.getDirection(e.playerDirection),
  29102. e.projectVectors()
  29103. var t = e.playerDirection.angleTo(e.lastFacingDirection)
  29104. if (((e.angleTravelled += Math.abs(t)), e.angleTravelled >= Math.abs(e.angle))) {
  29105. if (((e.active = !1), e.onDone)) {
  29106. var i = e.onDone
  29107. i()
  29108. }
  29109. } else e.lastFacingDirection.copy(e.playerDirection), window.setTimeout(e, 4)
  29110. }
  29111. return (
  29112. (e.active = !1),
  29113. (e.angle = 0),
  29114. (e.angleTravelled = 0),
  29115. (e.playerDirection = new c.Vector3()),
  29116. (e.lastFacingDirection = new c.Vector3()),
  29117. (e.onDone = null),
  29118. (e.player = null),
  29119. (e.start = function (t, i, n, r) {
  29120. ;(e.active = !0),
  29121. t && i && (i = 0),
  29122. (e.angle = t || i),
  29123. (e.xAngle = t),
  29124. (e.yAngle = i),
  29125. (e.angleTravelled = 0),
  29126. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29127. n.getDirection(e.playerDirection),
  29128. e.lastFacingDirection.copy(e.playerDirection),
  29129. e.projectVectors(),
  29130. (e.onDone = r),
  29131. (e.player = n),
  29132. e()
  29133. }),
  29134. (e.projectVectors = function () {
  29135. e.xAngle &&
  29136. (e.playerDirection.projectOnPlane(I.UP),
  29137. e.lastFacingDirection.projectOnPlane(I.UP))
  29138. }),
  29139. e
  29140. )
  29141. })(),
  29142. O = (function () {
  29143. var e = new c.Vector3()
  29144. return function (t) {
  29145. t
  29146. ? (e.copy(t.position),
  29147. e.add(t.discPosition),
  29148. p.projectPositionToCanvas(e, this.player.camera, e),
  29149. this.click(e.x, e.y))
  29150. : R.warn('Showcase -> clicktagObject: Unable to find tag.')
  29151. }
  29152. })(),
  29153. L = function () {
  29154. return this.player.mode === E.PANORAMA
  29155. ? S.insideLookLimitUp
  29156. : this.player.mode === E.DOLLHOUSE
  29157. ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle)
  29158. : null
  29159. },
  29160. D = function () {
  29161. return this.player.mode === E.PANORAMA
  29162. ? S.insideLookLimitDown
  29163. : this.player.mode === E.DOLLHOUSE
  29164. ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle)
  29165. : null
  29166. },
  29167. N = (function (e) {
  29168. var t = new c.Vector3()
  29169. return function (e) {
  29170. var i = this.player.getDirection()
  29171. t.copy(i)
  29172. var n = t.y
  29173. ;(t.y = 0), t.normalize()
  29174. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1)
  29175. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  29176. return (
  29177. 0 !== e &&
  29178. R.warn('Cannot rotate in y direction when in ' + this.player.mode + ' mode'),
  29179. 0
  29180. )
  29181. this.player.mode === E.DOLLHOUSE && (r = -r)
  29182. var o = L.call(this) - 0.1,
  29183. a = D.call(this) + 0.1,
  29184. s = r + e
  29185. s > o ? (s = o) : s < a && (s = a)
  29186. var l = s - r
  29187. return e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l
  29188. }
  29189. })(),
  29190. B = (function () {
  29191. var e = new c.Euler()
  29192. return function (t) {
  29193. return (
  29194. e.setFromQuaternion(t.quaternion, 'YXZ'),
  29195. {
  29196. position: {
  29197. x: t.position.x,
  29198. y: t.position.y,
  29199. z: t.position.z
  29200. },
  29201. rotation: {
  29202. x: c.Math.radToDeg(e.x),
  29203. y: c.Math.radToDeg(e.y),
  29204. z: 0
  29205. },
  29206. pano: t.currentPano ? t.currentPano.id : null,
  29207. mode: t.mode
  29208. }
  29209. )
  29210. }
  29211. })(),
  29212. F = null
  29213. t.exports = {
  29214. init: function (e, t, i, n, r) {
  29215. V.init(e, t, i, r),
  29216. (F = new Promise(
  29217. function (e, t) {
  29218. i.on(w.Ready, function () {
  29219. e()
  29220. })
  29221. }.bind(this)
  29222. ))
  29223. var o = new h(window),
  29224. a = o.waitForConnection()
  29225. a.then(function (e) {
  29226. o.on(g.ACTION, V.onMessageReceive.bind(V))
  29227. })
  29228. var s = (function () {
  29229. var e = Date.now()
  29230. return function () {
  29231. if (!(Date.now() - e < 100)) {
  29232. var t = B(i)
  29233. o.sendEvent(_.MOVE, {
  29234. state: t
  29235. }),
  29236. (e = Date.now())
  29237. }
  29238. }
  29239. })()
  29240. i.on(w.Move, s),
  29241. i.on(w.ViewChanged, s),
  29242. n.on(f.ActiveModelChanged, function (e) {
  29243. function t(e) {
  29244. var t,
  29245. i = e.newPano.id
  29246. e.oldPano && (t = e.oldPano.id),
  29247. i !== t &&
  29248. o.sendEvent(_.ENTER_PANO, {
  29249. oldPano: t,
  29250. newPano: i
  29251. })
  29252. }
  29253. var i = e.model,
  29254. n = e.oldModel
  29255. ;(V.model = i),
  29256. a.then(function () {
  29257. o.sendEvent(_.MODEL_LOADED, {
  29258. metadata: l(i)
  29259. })
  29260. }),
  29261. n &&
  29262. n.panos.forEach(function (e) {
  29263. e.removeEventListener('enter', t)
  29264. }),
  29265. i.panos.forEach(function (e) {
  29266. e.on('enter', t)
  29267. })
  29268. })
  29269. }
  29270. }
  29271. var V = {
  29272. director: null,
  29273. player: null,
  29274. controls: null,
  29275. sceneRenderer: null,
  29276. model: null,
  29277. init: function (e, t, i, n) {
  29278. ;(this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n)
  29279. },
  29280. handleToObject: {},
  29281. objectToHandle: {},
  29282. handleCount: 0,
  29283. onMessageReceive: function (e) {
  29284. if (e) {
  29285. var t = e.targetFunction,
  29286. i = e.params,
  29287. n = e.onDone
  29288. t && this[t] && this[t](i, n)
  29289. }
  29290. },
  29291. waitForInit: function (e, t) {
  29292. F.then(
  29293. t.bind({
  29294. success: !0,
  29295. message: 'Init complete.'
  29296. })
  29297. )
  29298. },
  29299. moveToPano: (function (e, t) {
  29300. var i = new c.Euler(0, 0, 0, 'YXZ'),
  29301. n = new c.Quaternion()
  29302. return function (e, t) {
  29303. var r = e.pano,
  29304. o = e.rotation,
  29305. a = e.transition
  29306. if (!this.model)
  29307. return t({
  29308. success: !1,
  29309. error: 'The model has not been loaded yet'
  29310. })
  29311. var s = this.model.panos.get(r)
  29312. if (!s)
  29313. return t({
  29314. success: !1,
  29315. error: r + ' does not exist in this model'
  29316. })
  29317. if (!o)
  29318. return t({
  29319. sucess: !1,
  29320. erorr: o + ' is not a valid rotation'
  29321. })
  29322. i.set(
  29323. c.Math.degToRad(o.x || 0),
  29324. c.Math.degToRad(o.y || 0),
  29325. c.Math.degToRad(o.z || 0),
  29326. 'YXZ'
  29327. ),
  29328. console.log(o.z)
  29329. var l = {
  29330. success: !0,
  29331. message: r
  29332. }
  29333. if (a === A.FADEOUT)
  29334. n.setFromEuler(i),
  29335. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l))
  29336. else {
  29337. var h, u
  29338. a === A.INSTANT && ((h = 0), (u = 0))
  29339. var d = I.FORWARD.clone().applyEuler(i).add(s.position)
  29340. this.player.flyToPano(
  29341. {
  29342. pano: s,
  29343. lookAtPoint: d,
  29344. duration: h,
  29345. aimDuration: u
  29346. },
  29347. t.bind(this, l)
  29348. )
  29349. }
  29350. }
  29351. })(),
  29352. moveInDirection: function (e, t) {
  29353. var i = e.direction
  29354. return 'undefined' == typeof v[i]
  29355. ? (R.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  29356. void (
  29357. t &&
  29358. t({
  29359. success: !1,
  29360. error: 'Invalid direction.'
  29361. })
  29362. ))
  29363. : void this.player.flyLocalDirection(I[i].clone()).then(function (e) {
  29364. t(
  29365. e
  29366. ? {
  29367. success: !0,
  29368. message: 'moved ' + i
  29369. }
  29370. : {
  29371. success: !1,
  29372. error: 'Cannot move in direction: ' + i
  29373. }
  29374. )
  29375. })
  29376. },
  29377. getPose: function (e, t) {
  29378. this.player.camera.position,
  29379. new c.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ')
  29380. return t({
  29381. success: !0,
  29382. message: B(this.player)
  29383. })
  29384. },
  29385. takeScreenShot: (function () {
  29386. var e = new c.PerspectiveCamera(),
  29387. t = new c.WebGLRenderTarget()
  29388. return function (i, n) {
  29389. if (!i.resolution)
  29390. return n({
  29391. success: !1,
  29392. error: 'An invalid resolution was specified'
  29393. })
  29394. if (i.resolution.width === -1 || i.resolution.height === -1) {
  29395. var r = this.sceneRenderer.renderer.getSize()
  29396. ;(i.resolution.width = r.width), (i.resolution.height = r.height)
  29397. }
  29398. e.layers.set(x.DEFAULT),
  29399. i.visibleObjects &&
  29400. (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  29401. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  29402. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE))
  29403. var o = i.resolution.width,
  29404. a = i.resolution.height,
  29405. s = o / a
  29406. e.position.copy(this.sceneRenderer.camera.position),
  29407. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  29408. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  29409. (e.projectionMatrix.elements[0] =
  29410. this.player.camera.projectionMatrix.elements[5] / s),
  29411. t.setSize(o, a),
  29412. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t)
  29413. var l = new Uint8Array(o * a * 4)
  29414. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l)
  29415. var c = M.encode(
  29416. {
  29417. data: l,
  29418. width: o,
  29419. height: a,
  29420. heading: 180,
  29421. pitch: 0
  29422. },
  29423. {
  29424. quality: 75,
  29425. flipY: !0
  29426. }
  29427. ),
  29428. h = 'data:image/jpg;base64,' + d.uint8ToBase64(c.data)
  29429. n({
  29430. success: !0,
  29431. message: h
  29432. })
  29433. }
  29434. })(),
  29435. findRankedPano: (function (e, t) {
  29436. var i = new c.Vector3(),
  29437. r = new c.Vector3()
  29438. return function (e, t) {
  29439. s(this.player, r), n(t, r, i)
  29440. var o = this.player.rankedPanoInDirection(e, i)
  29441. if (o) {
  29442. var a = this.objectToHandle[o.id]
  29443. return (
  29444. a ||
  29445. ((this.objectToHandle[o.id] = a = this.handleCount++),
  29446. (this.handleToObject[a] = o)),
  29447. a
  29448. )
  29449. }
  29450. return R.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1
  29451. }
  29452. })(),
  29453. findRankedtag: (function (e, t) {
  29454. var i = new c.Vector3(),
  29455. r = new c.Vector3()
  29456. return function (e, t) {
  29457. s(this.player, r), n(t, r, i)
  29458. var o = this.player.rankedtagInDirection(e, i)
  29459. if (o) {
  29460. var a = this.objectToHandle[o.sid]
  29461. return (
  29462. a ||
  29463. ((this.objectToHandle[o.sid] = a = this.handleCount++),
  29464. (this.handleToObject[a] = o)),
  29465. a
  29466. )
  29467. }
  29468. return R.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1
  29469. }
  29470. })(),
  29471. clickNearesttag: function (e) {
  29472. this.clickRankedtag(0, e)
  29473. },
  29474. clickRankedtag: function (e, t) {
  29475. var i = a.call(this, e, t)
  29476. i && O.call(this, i)
  29477. },
  29478. clickNearestPano: function (e, t) {
  29479. this.clickRankedPano(0, e, t)
  29480. },
  29481. clickRankedPano: function (e, t, i) {
  29482. var n = o.call(this, e, t)
  29483. n ? r.call(this, n, i) : i(null)
  29484. },
  29485. clickPano: function (e, t) {
  29486. var i = this.handleTable[e]
  29487. i ? r.call(this, i, t) : t(null)
  29488. },
  29489. rotateDirection: (function () {
  29490. return function (e, t) {
  29491. var i = e.direction,
  29492. n = e.angle
  29493. if (!P.active) {
  29494. var r = 0,
  29495. o = 0,
  29496. a = 0,
  29497. s = 0
  29498. if (!n || isNaN(n))
  29499. return (
  29500. R.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  29501. void (
  29502. t &&
  29503. t({
  29504. success: !1,
  29505. error: 'Invalid rotation angle.'
  29506. })
  29507. )
  29508. )
  29509. if (this.player.mode === E.TRANSITIONING)
  29510. return (
  29511. R.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  29512. void (
  29513. t &&
  29514. t({
  29515. success: !1,
  29516. error: 'Cannot rotate while transitioning'
  29517. })
  29518. )
  29519. )
  29520. if (i === v.RIGHT || i === v.LEFT)
  29521. i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n)
  29522. else {
  29523. if (i !== v.UP && i !== v.DOWN)
  29524. return (
  29525. R.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  29526. void (
  29527. t &&
  29528. t({
  29529. success: !1,
  29530. error: 'Invalid direction for rotation.'
  29531. })
  29532. )
  29533. )
  29534. if (this.player.mode === E.FLOORPLAN)
  29535. return (
  29536. R.warn(
  29537. 'Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'
  29538. ),
  29539. void (
  29540. t &&
  29541. t({
  29542. success: !1,
  29543. error: 'Cannot rotate ' + i + ' in floorplan mode'
  29544. })
  29545. )
  29546. )
  29547. if ((i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n))
  29548. return (
  29549. R.warn(
  29550. 'Showcase -> rotateDirection: Already at maximum rotation in direction: ' +
  29551. i
  29552. ),
  29553. void (
  29554. t &&
  29555. t({
  29556. success: !1,
  29557. error: 'Already at maximum rotation in direction: ' + i
  29558. })
  29559. )
  29560. )
  29561. ;(o = n > 0 ? 1 : -1), (s = n)
  29562. }
  29563. var l = n
  29564. ;(n = c.Math.degToRad(n)), (a = c.Math.degToRad(a)), (s = c.Math.degToRad(s))
  29565. var h = this.controls.activeControl,
  29566. u = function () {
  29567. h.stopRotating(!0),
  29568. t &&
  29569. t({
  29570. success: !0,
  29571. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction
  29572. })
  29573. }
  29574. h.startRotating(r, o), P.start(a, s, this.player, u)
  29575. }
  29576. }
  29577. })(),
  29578. rotate: (function () {
  29579. var e = new c.Vector3(),
  29580. t = new c.Vector3()
  29581. return function (i, n) {
  29582. var r = i.xAngle,
  29583. o = i.yAngle
  29584. if (!P.active) {
  29585. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  29586. return (
  29587. R.warn('Showcase -> rotate: Invalid rotation angle.'),
  29588. void (
  29589. n &&
  29590. n({
  29591. success: !1,
  29592. error: 'Invalid rotation angle.'
  29593. })
  29594. )
  29595. )
  29596. if (this.player.mode === E.TRANSITIONING)
  29597. return (
  29598. R.warn('Automation -> rotate: Cannot rotate while transitioning'),
  29599. void (
  29600. n &&
  29601. n({
  29602. success: !1,
  29603. error: 'Cannot rotate while transitioning'
  29604. })
  29605. )
  29606. )
  29607. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0)
  29608. var a = o
  29609. ;(o = N.call(this, o)), (r = -r)
  29610. var s = a > 0 ? 'UP' : 'DOWN'
  29611. if (!r && a && !o)
  29612. return (
  29613. R.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + s),
  29614. void (
  29615. n &&
  29616. n({
  29617. success: !1,
  29618. error: 'Already at maximum rotation in direction: ' + s
  29619. })
  29620. )
  29621. )
  29622. a > o && R.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + s)
  29623. var l = o
  29624. ;(o = c.Math.degToRad(o)),
  29625. (r = c.Math.degToRad(r)),
  29626. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29627. this.player.getDirection(e),
  29628. t.copy(e).applyAxisAngle(I.UP, r),
  29629. t.applyAxisAngle(I.RIGHT, o)
  29630. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  29631. u = o > 0 ? 1 : o < 0 ? -1 : 0
  29632. Math.abs(r) > Math.abs(o)
  29633. ? (u *= Math.abs(o / r))
  29634. : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o))
  29635. var d = this.controls.activeControl,
  29636. p = function () {
  29637. d.stopRotating(!0),
  29638. n &&
  29639. n({
  29640. success: !0,
  29641. message:
  29642. 'Rotated ' +
  29643. i.xAngle.toFixed(2) +
  29644. '° horizontally, ' +
  29645. l.toFixed(2) +
  29646. '° vertically'
  29647. })
  29648. }
  29649. d.startRotating(h, u), P.start(r, o, this.player, p)
  29650. }
  29651. }
  29652. })(),
  29653. panCamera: function (e, t) {
  29654. function i(e) {
  29655. switch (
  29656. (r.removeAllListeners(T.AutoPanComplete),
  29657. r.removeAllListeners(T.AutoPanInterrupt),
  29658. r.removeAllListeners(T.AutoPanClamped),
  29659. e)
  29660. ) {
  29661. case T.AutoPanInterrupt:
  29662. t({
  29663. success: !0,
  29664. message: 'Camera panning interrupted.'
  29665. })
  29666. break
  29667. case T.AutoPanClamped:
  29668. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  29669. if (
  29670. Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 &&
  29671. Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01
  29672. )
  29673. return void t({
  29674. success: !1,
  29675. error: 'Already at edge of current model bounds.'
  29676. })
  29677. var i = 'The view point is outside the bounds for the current model. '
  29678. ;(i += 'The view point was clamped to ' + o(r.target.x, r.target.z)),
  29679. console.warn(i)
  29680. }
  29681. case T.AutoPanComplete:
  29682. t({
  29683. success: !0,
  29684. message:
  29685. 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z)
  29686. })
  29687. }
  29688. }
  29689. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  29690. return t({
  29691. success: !1,
  29692. error: 'Camera panning is not available in the current mode: ' + this.player.mode
  29693. })
  29694. var n = e.position,
  29695. r = this.player.control
  29696. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0)
  29697. var o = function (e, t) {
  29698. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')'
  29699. }
  29700. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  29701. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  29702. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  29703. },
  29704. click: function (e, t) {
  29705. var i = e.x,
  29706. n = e.y,
  29707. r = e.percentage
  29708. r === !0 &&
  29709. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29710. this.player.handleInputStart(i, n),
  29711. this.player.updateIntersect(),
  29712. this.player.handleInputEnd(i, n)
  29713. },
  29714. mouseOver: function (e, t) {
  29715. var i = e.x,
  29716. n = e.y,
  29717. r = e.percentage
  29718. r === !0 &&
  29719. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29720. this.player.handleInputMove(i, n),
  29721. this.player.updateIntersect()
  29722. },
  29723. moveToMode: function (e, t) {
  29724. function i(e) {
  29725. t(
  29726. e
  29727. ? {
  29728. success: !1,
  29729. error: 'Failed to load new mode: ' + e
  29730. }
  29731. : {
  29732. success: !0,
  29733. message: 'Moved to new mode: ' + n
  29734. }
  29735. )
  29736. }
  29737. var n = e.mode
  29738. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  29739. ? this.director.changeMode(n).then(
  29740. function () {
  29741. i()
  29742. },
  29743. function (e) {
  29744. i(e)
  29745. }
  29746. )
  29747. : t({
  29748. success: !1,
  29749. error: 'Invalid mode selection'
  29750. })
  29751. }
  29752. }
  29753. }).call(this, '/js/sdk/automation.js')
  29754. },
  29755. {
  29756. '../constants': 8,
  29757. '../enum/AlignmentType': 17,
  29758. '../enum/ControlEvents': 21,
  29759. '../enum/Direction': 22,
  29760. '../enum/GLCubeFaces': 25,
  29761. '../enum/Keys': 30,
  29762. '../enum/ModelManagerEvents': 33,
  29763. '../enum/PlayerEvents': 40,
  29764. '../enum/RenderLayers': 41,
  29765. '../enum/Vectors': 50,
  29766. '../enum/Viewmode': 51,
  29767. '../enum/WarpStyle': 52,
  29768. '../lib/jpeg_encoder': 94,
  29769. '../sdk/SdkEvents': 161,
  29770. '../settings': 166,
  29771. '../util/common': 185,
  29772. '../util/logger': 189,
  29773. '../util/math': 190,
  29774. '../util/panorama': 191,
  29775. './ApiHost': 159,
  29776. './PostMessageType': 160,
  29777. './TransitionStyles': 162,
  29778. three: 217
  29779. }
  29780. ],
  29781. 165: [
  29782. function (e, t, i) {
  29783. 'use strict'
  29784. function n(e) {
  29785. ;(this.sourceWindow = e),
  29786. (this.targetWindow = null),
  29787. (this.targetOrigin = null),
  29788. (this.id = Math.floor(1e5 * Math.random())),
  29789. this.bindEvents()
  29790. }
  29791. var r = e('./PostMessageType'),
  29792. o = e('events').EventEmitter
  29793. ;(n.prototype = Object.create(o.prototype)),
  29794. (n.prototype.bindEvents = function () {
  29795. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this))
  29796. }),
  29797. (n.prototype.setTarget = function (e, t) {
  29798. ;(this.targetWindow = e), (this.targetOrigin = t)
  29799. }),
  29800. (n.prototype.onPostmessageReceived = function (e) {
  29801. var t = e.origin || e.originalEvent.origin,
  29802. i = e.source
  29803. switch (e.data.type) {
  29804. case r.CONNECT:
  29805. break
  29806. case r.RESPONSE:
  29807. if (this.id !== e.data.toId) return
  29808. default:
  29809. if (!this.validateMessageOrigin(t)) return
  29810. }
  29811. var n = e.data
  29812. ;(n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n)
  29813. }),
  29814. (n.prototype.validateMessageOrigin = function (e) {
  29815. return '*' === this.targetOrigin || e === this.targetOrigin
  29816. }),
  29817. (n.prototype.send = function (e) {
  29818. this.targetWindow &&
  29819. this.targetOrigin &&
  29820. ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin))
  29821. }),
  29822. (t.exports = n)
  29823. },
  29824. {
  29825. './PostMessageType': 160,
  29826. events: 202
  29827. }
  29828. ],
  29829. 166: [
  29830. function (e, t, i) {
  29831. 'use strict'
  29832. var n = e('three'),
  29833. r = e('./util/browser'),
  29834. o = e('./enum/Viewmode'),
  29835. a = e('./enum/VROption'),
  29836. s = e('./enum/Colors'),
  29837. l = e('./enum/WarpStyle'),
  29838. c = e('./util/easing'),
  29839. h = e('./util/common'),
  29840. u = e('./util/showcase'),
  29841. d = e('./constants'),
  29842. p = {
  29843. debug: !1,
  29844. version: '2.25.6-0-gd87e5b1',
  29845. languageTag: r.valueFromHash('lang', null),
  29846. pageTitle: '四维虚拟漫游',
  29847. authorizationHeader: u.getAuthorizationHeader(),
  29848. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  29849. logLevel: r.valueFromHash('log', 2),
  29850. skyboxRadius: 2500,
  29851. modelBoundsPadding: 5,
  29852. showNeighbors: !1,
  29853. brand: r.valueFromHash('brand', !0),
  29854. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  29855. startHighlights: r.valueFromHash('hl', -1),
  29856. specialEdition: r.valueFromHash('bn', 0),
  29857. useWheel: r.valueFromHash('wh', !0),
  29858. crossOrigin: 'anonymous',
  29859. fancierTransition: !1,
  29860. wireframe: !1,
  29861. skyboxWireframe: !1,
  29862. modelAlpha: 1,
  29863. highlightPanoSelection: !1,
  29864. showSweeps: !0,
  29865. showSkyboxes: !1,
  29866. showMesh: !0,
  29867. showFloors: !1,
  29868. showFloorDuration: 300,
  29869. showFloorDelay: 300,
  29870. hideFloorDuration: 300,
  29871. hideFloorDelay: 0,
  29872. reticuleOpacityTransitionTime: 250,
  29873. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  29874. markerOpacityTransitionTime: 500,
  29875. guiAnimationSpeed: 250,
  29876. highlightAnimationDuration: 500,
  29877. modelComponentLoadSpinnerDelay: 150,
  29878. captureErrors: !1,
  29879. maxMobileTextures: 6,
  29880. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  29881. startupFlyinDelay: 3e3,
  29882. dollhouseDefault: {
  29883. minDistance: 15,
  29884. maxDistance: 50,
  29885. minPolarAngle: n.Math.degToRad(10),
  29886. maxPolarAngle: n.Math.degToRad(90)
  29887. },
  29888. hideReticuleTimeout: 1e3,
  29889. analytics: {
  29890. inactivityThreshold: 30,
  29891. sessionTrackingRate: 0.15,
  29892. maxTrackedErrors: 20,
  29893. sessionDurationPingFrequency: 10,
  29894. sessionDurationTimeout: 15
  29895. },
  29896. flydown: {
  29897. movementEasing: 'easeInOutQuad',
  29898. movementDelay: 0.001,
  29899. rotationEasing: 'easeInOutQuad',
  29900. rotationDelay: 0.5,
  29901. modelTextureDelay: 0.75,
  29902. skyboxDelay: 0.75
  29903. },
  29904. transition: {
  29905. flySpeed: 0.001,
  29906. flyTime: 750,
  29907. flytimeMaxDistanceThreshold: 5,
  29908. flytimeDistanceMultiplier: 150,
  29909. aimTime: 1500,
  29910. aimSlowFactor: 1.5,
  29911. blur: 0.8,
  29912. movementEasing: 'easeInOutQuad',
  29913. blendEasing: 'easeInOutQuad',
  29914. fastForwardFactor: 4 //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  29915. },
  29916. show360Views: {
  29917. enabled: !0,
  29918. transitionTime: 1e3
  29919. },
  29920. quickstart: {
  29921. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  29922. animation: 1400,
  29923. showTextDelay: 500,
  29924. fadeOutDelay: 3e3,
  29925. fovChange: 10
  29926. },
  29927. appConfig: {
  29928. webvr_version: null,
  29929. segment_key: null,
  29930. embedly_key: null,
  29931. branch_key: null,
  29932. keen_write_key: null,
  29933. keen_project_id: null
  29934. },
  29935. vr: {
  29936. enabled: !0,
  29937. allowWebVR: !1,
  29938. option: r.valueFromHash('vr', a.CONTEXTUAL)
  29939. },
  29940. share: {
  29941. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0)
  29942. },
  29943. input: {
  29944. longTapThreshold: 200,
  29945. moveToleranceNDC: 0.01, //.08,
  29946. touchMoveThreshold: 25
  29947. },
  29948. help: {
  29949. modalStayDuration: 600
  29950. },
  29951. immersive: {
  29952. timeToShowAgain: 1250,
  29953. uiStayDuration: 600
  29954. },
  29955. tourInteraction: {
  29956. disabled: '0' === r.valueFromHash('tourcta', null),
  29957. showPauseButton: 1e3,
  29958. showModal: 1500,
  29959. allowNextClick: 200,
  29960. largeModal: '1' === r.valueFromHash('tourcta', null),
  29961. smallModal: '2' === r.valueFromHash('tourcta', null)
  29962. },
  29963. labels: {
  29964. enabled: !1,
  29965. hideUntilStart: !0,
  29966. fadeInDuration: 250,
  29967. fadeInDelay: 250,
  29968. fadeOutDuration: 250,
  29969. fadeOutDelay: 0,
  29970. zoomHideThreshhold: {
  29971. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  29972. desktop: 2
  29973. },
  29974. zoomTruncateThreshhold: {
  29975. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  29976. desktop: 0.85
  29977. },
  29978. minLengthForTruncate: 16,
  29979. truncateLength: 12,
  29980. truncateSuffix: '...'
  29981. },
  29982. tags: {
  29983. enabled: r.valueFromHash('mt', 1),
  29984. startup: {
  29985. hideUntilStart: !0,
  29986. fadeInDuration: 500,
  29987. fadeInDelay: 100
  29988. },
  29989. visibility: {
  29990. anyDistance: !0,
  29991. visibleDistance: 8,
  29992. cameraClearance: 0.1,
  29993. alphaTestLevel: 0.05,
  29994. hideViaFloor: !0,
  29995. hideOffScreenDisc: !1,
  29996. hideOffScreenObject: !1
  29997. },
  29998. disc: {
  29999. opacity: 1,
  30000. disabledOpacity: 0.5,
  30001. scale: {
  30002. nearBound: 1.5,
  30003. farBound: 4.8,
  30004. linkFarBound: !1,
  30005. linkPercent: 40,
  30006. maxSize: 80,
  30007. minSize: 40,
  30008. baseViewportSize: 800,
  30009. responsiveness: 100
  30010. }
  30011. },
  30012. pole: {
  30013. enabled: !0,
  30014. height: 0.5,
  30015. width: 2,
  30016. opacity: 0.5,
  30017. color: 'white'
  30018. },
  30019. navigate: {
  30020. nearestPano: !0,
  30021. lineOfSight: !0,
  30022. reactivate: !0,
  30023. aimAt: 'disc',
  30024. tiltTolerance: 25,
  30025. rotateSpeedFactor: 0.6
  30026. }
  30027. },
  30028. path: {
  30029. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  30030. colorUp: s._desat(s.newBlue, 0.5),
  30031. colorDown: s._darken(s.newBlue, 0.35),
  30032. opacity: 0.5,
  30033. style: 'ribbon',
  30034. height: 0.025,
  30035. ribbonWidth: 0.24,
  30036. outsideHeight: 0.5,
  30037. waypointRadius: 0.5,
  30038. waypointIndoorRadius: 0.24,
  30039. waypointPulse: 1e3,
  30040. typ: l.BLACK,
  30041. meshFree: r.valueFromHash('mf', 1),
  30042. mapGuides: r.valueFromHash('guides', !0),
  30043. fadeInTime: 400,
  30044. fadeOutTime: 300
  30045. },
  30046. warp: {
  30047. nearPanoDist: 0.1,
  30048. matchCam: !1,
  30049. blur: 0.33,
  30050. fastTime: 1500,
  30051. teleportTime: 1500, //瞬间过渡的时间
  30052. flytimeDistanceMultiplier: 150, //add
  30053. flyTime: 750, //add
  30054. outsideTime: 2e3,
  30055. lookAheadMax: 0.3,
  30056. lookAheadDist: 2.5,
  30057. softPushDist: 0.37,
  30058. softPushEnd: 0.3,
  30059. softBendAngle: 8,
  30060. softBendTilt: 4,
  30061. softBendEnd: 0.3,
  30062. doBurns: true, //r.valueFromHash("kb", !0),
  30063. burnsAngle: 8, //导览在每个点停留时的旋转角度
  30064. minBurnsAngle: 35,
  30065. minDownAngle: -35,
  30066. maxTurnPerSec: 280,
  30067. maxAimPerSec: 35,
  30068. minRotation: 12,
  30069. maxAimRotation: 33.2,
  30070. turnFriction: 0.2,
  30071. flySpeed: 0.01,
  30072. minWarpTime: 1200,
  30073. warpInterruptionRedirectTime: 500,
  30074. tourStepDelay: r.valueFromHash('st', 0),
  30075. walkDelay: 0,
  30076. walkMaxDist: 50,
  30077. walkMinDist: 0.8,
  30078. walkSlideShowThreshhold: 3000,
  30079. walkExtraPanosDistance: 0.4,
  30080. timePerMeter: 1200,
  30081. motionLeadTime: 5000,
  30082. movementEasing: 'easeInOutQuad',
  30083. blendEasing: 'easeInOutQuad',
  30084. showBunny: !1,
  30085. loop: r.valueFromHash('lp', !1),
  30086. auto: r.valueFromHash('ts', -1),
  30087. eOrder: 'YXZ', //"YXZ",
  30088. stepFactor: 0.25,
  30089. brakeStrength: 2,
  30090. minBrakeAngle: 0.1,
  30091. maxBrakeAngle: 1.8,
  30092. climbEffort: 4
  30093. },
  30094. rotationFriction: 0.05,
  30095. rotationAccelerationInside: 4.5,
  30096. rotationAccelerationOutside: 0.15,
  30097. rotationAfterMoveMultiplier: 40,
  30098. rotationAfterMoveHistoryCount: 5,
  30099. panFriction: 0.09,
  30100. panAccelerationOutside: 60,
  30101. onload: r.valueFromHash('onload', o.PANORAMA),
  30102. zoomNearLimit: 0.1,
  30103. zoomFarLimit: 50,
  30104. navigation: {
  30105. panoScores: !1,
  30106. mouseDirection: !0,
  30107. filterStrictness: 0.75,
  30108. angleFactor: -30,
  30109. directionFactor: 10,
  30110. distanceFactor: -1,
  30111. optionalityFactor: 3
  30112. },
  30113. sdkInit: !1,
  30114. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  30115. console: r.valueFromHash('console', !1),
  30116. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  30117. panoramaNeighbourMaxDistance: 5,
  30118. panoFloorClickRadius: 0.35,
  30119. showScreenshotLocations: !1,
  30120. showAxis: !1,
  30121. showNeighbourRaycasts: !1,
  30122. colorMarkerOnLoad: !1,
  30123. colorMarkerByFloor: !1,
  30124. tiling: {
  30125. panoPreRenderRepeatDelay: 2500,
  30126. panoPreRenderDelay: 500,
  30127. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  30128. tilingFlagNames: ['usetiles', 'tiles'],
  30129. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  30130. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  30131. overlayStyle: r.valueFromHash('tileoverlay', 0),
  30132. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  30133. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  30134. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 1 /* 2 */),
  30135. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  30136. customCompression: r.valueFromHash('tilecustcomp', 0),
  30137. // mobileHighQualityOverride: !1,
  30138. mobileHighQualityOverride: 1,
  30139. allowUltraHighResolution: true
  30140. },
  30141. zoom: {
  30142. enabled: true,
  30143. forceOff: r.valueFromHash('nozoom', 0),
  30144. overridemax: r.valueFromHash('maxzoom', null),
  30145. overridemin: r.valueFromHash('minzoom', null),
  30146. max: d.highQualityMaxZoom,
  30147. min: 1,
  30148. transitionStyle: r.valueFromHash('zoomtrans', 1),
  30149. activationThreshold: 1.1,
  30150. restoreTime: 500
  30151. },
  30152. profiling: {
  30153. enabled: r.valueFromHash('mem', !1)
  30154. }
  30155. }
  30156. ;(p = h.deepExtend(p, d, {
  30157. insideFOV: r.valueFromHash('fov', d.insideFOV),
  30158. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  30159. panorama: {
  30160. transitionTime: 1e3,
  30161. modelAlpha: 0,
  30162. modelAlphaDelay: p.flydown.modelTextureDelay,
  30163. modelAlphaLength: 1,
  30164. skyboxOpacity: 1,
  30165. skyboxOpacityDelay: p.flydown.skyboxDelay,
  30166. skyboxOpacityLength: 0.9,
  30167. fovLength: 1,
  30168. fovDelay: 0,
  30169. cameraMatrixDuration: 0.8,
  30170. cameraMatrixDelay: 0,
  30171. cameraMatrixEase: c.easeInCubic,
  30172. reticuleOpacity: 1,
  30173. markerOpacity: 0.3,
  30174. markerOpacityOnHover: 1
  30175. },
  30176. dollhouse: {
  30177. transitionTime: 1e3,
  30178. modelAlpha: 1,
  30179. modelAlphaDelay: 0,
  30180. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30181. skyboxOpacity: 0,
  30182. skyboxOpacityDelay: 0,
  30183. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30184. fovLength: 1,
  30185. fovDelay: 0,
  30186. cameraMatrixDuration: 0.8,
  30187. cameraMatrixDelay: 0.3,
  30188. cameraMatrixEase: c.easeInCubic,
  30189. reticuleOpacity: 1,
  30190. markerOpacity: 0,
  30191. markerOpacityOnHover: 0
  30192. },
  30193. floorplan: {
  30194. transitionTime: 1e3,
  30195. modelAlpha: 1,
  30196. modelAlphaDelay: 0,
  30197. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30198. skyboxOpacity: 0,
  30199. skyboxOpacityDelay: 0,
  30200. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30201. fovLength: 1,
  30202. fovDelay: 0,
  30203. cameraMatrixDuration: 0.5,
  30204. cameraMatrixDelay: 0,
  30205. cameraMatrixEase: c.easeOutCubic,
  30206. reticuleOpacity: 1,
  30207. markerOpacity: 0,
  30208. markerOpacityOnHover: 0,
  30209. cameraHeight: 50
  30210. },
  30211. transitioning: {
  30212. reticuleOpacity: 0,
  30213. markerOpacity: 0.3,
  30214. markerOpacityOnHover: 1
  30215. },
  30216. 'floorplan-dollhouse': {
  30217. rotationDelay: 0,
  30218. rotationDuration: 1
  30219. },
  30220. 'floorplan-panorama': {
  30221. rotationDelay: 0.5,
  30222. rotationDuration: 1
  30223. },
  30224. 'dollhouse-panorama': {
  30225. rotationDelay: 0.5,
  30226. rotationDuration: 1
  30227. },
  30228. 'dollhouse-floorplan': {
  30229. rotationDelay: 0,
  30230. rotationDuration: 1,
  30231. cameraMatrixDuration: 1.05,
  30232. cameraMatrixDelay: 0.5
  30233. },
  30234. 'panorama-dollhouse': {
  30235. rotationDelay: 0,
  30236. rotationDuration: 0.5
  30237. },
  30238. 'panorama-floorplan': {
  30239. transitionTime: 1500,
  30240. rotationDelay: 0,
  30241. rotationDuration: 0.5
  30242. }
  30243. })),
  30244. p.path.meshFree && (p.path.typ = l.WALK),
  30245. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  30246. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  30247. (window._settings = t.exports = p)
  30248. },
  30249. {
  30250. './constants': 8,
  30251. './enum/Colors': 19,
  30252. './enum/VROption': 47,
  30253. './enum/Viewmode': 51,
  30254. './enum/WarpStyle': 52,
  30255. './util/browser': 182,
  30256. './util/common': 185,
  30257. './util/easing': 186,
  30258. './util/showcase': 193,
  30259. three: 217
  30260. }
  30261. ],
  30262. 167: [
  30263. function (e, t, i) {
  30264. 'use strict'
  30265. var n = e('three'),
  30266. r = e('./settings'),
  30267. o =
  30268. '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',
  30269. a =
  30270. 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n'
  30271. t.exports = {
  30272. basicTextured: {
  30273. uniforms: {
  30274. tDiffuse: {
  30275. type: 't',
  30276. value: null
  30277. },
  30278. alpha: {
  30279. type: 'f',
  30280. value: 1
  30281. }
  30282. },
  30283. vertexShader:
  30284. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30285. fragmentShader:
  30286. '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}'
  30287. },
  30288. copyCubeMap: {
  30289. uniforms: {
  30290. tDiffuse: {
  30291. type: 't',
  30292. value: null
  30293. },
  30294. alpha: {
  30295. type: 'f',
  30296. value: 1
  30297. }
  30298. },
  30299. vertexShader:
  30300. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30301. fragmentShader:
  30302. '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}'
  30303. },
  30304. cube: {
  30305. uniforms: {
  30306. map: {
  30307. type: 't',
  30308. value: null
  30309. },
  30310. opacity: {
  30311. type: 'f',
  30312. value: 1
  30313. }
  30314. },
  30315. vertexShader:
  30316. o +
  30317. 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  30318. fragmentShader:
  30319. a +
  30320. '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'
  30321. },
  30322. model: {
  30323. uniforms: {
  30324. map: {
  30325. type: 't',
  30326. value: null
  30327. },
  30328. modelAlpha: {
  30329. type: 'f',
  30330. value: r.modelAlpha
  30331. },
  30332. opacity: {
  30333. type: 'f',
  30334. value: 1
  30335. },
  30336. progress: {
  30337. type: 'f',
  30338. value: 0
  30339. },
  30340. blackout: {
  30341. type: 'i',
  30342. value: 0
  30343. },
  30344. pano0Map: {
  30345. type: 't',
  30346. value: null
  30347. },
  30348. pano0Position: {
  30349. type: 'v3',
  30350. value: new n.Vector3()
  30351. },
  30352. pano0Matrix: {
  30353. type: 'm4',
  30354. value: new n.Matrix4()
  30355. },
  30356. pano1Map: {
  30357. type: 't',
  30358. value: null
  30359. },
  30360. pano1Position: {
  30361. type: 'v3',
  30362. value: new n.Vector3()
  30363. },
  30364. pano1Matrix: {
  30365. type: 'm4',
  30366. value: new n.Matrix4()
  30367. }
  30368. },
  30369. vertexShader:
  30370. o +
  30371. `uniform vec3 pano0Position;
  30372. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  30373. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  30374. varying vec3 vWorldPosition0;
  30375. varying vec3 vWorldPosition1;
  30376. uniform int blackout;
  30377. void main() {
  30378. vUv = uv;
  30379. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  30380. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  30381. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  30382. vWorldPosition0.x *= -1.0;
  30383. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  30384. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  30385. vWorldPosition1.x *= -1.0;
  30386. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  30387. }`,
  30388. fragmentShader:
  30389. a +
  30390. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  30391. uniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\n
  30392. void main() {
  30393. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  30394. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  30395. vec4 colorFromPanos;
  30396. if (blackout == 5){//add for TransitionPass
  30397. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  30398. }else{
  30399. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  30400. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  30401. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  30402. else if (blackout == 1) {
  30403. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  30404. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  30405. }
  30406. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  30407. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  30408. }
  30409. //#ifdef useModelMap //起不了作用为啥
  30410. if(modelAlpha>0.0){
  30411. vec4 colorFromTexture = texture2D( map, vUv );
  30412. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  30413. }
  30414. //#endif
  30415. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  30416. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  30417. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  30418. }`
  30419. },
  30420. hot: {
  30421. uniforms: {
  30422. color: {
  30423. type: 'c',
  30424. value: new n.Color(0xff2200)
  30425. },
  30426. opac: {
  30427. type: 'f',
  30428. value: 0
  30429. },
  30430. texture1: {
  30431. type: 't',
  30432. value: null
  30433. },
  30434. texture2: {
  30435. type: 't',
  30436. value: null
  30437. }
  30438. },
  30439. vertexShader:
  30440. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30441. fragmentShader:
  30442. 'varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n'
  30443. },
  30444. modelOutside: {
  30445. uniforms: {
  30446. map: {
  30447. type: 't',
  30448. value: null
  30449. },
  30450. opacity: {
  30451. type: 'f',
  30452. value: 1
  30453. }
  30454. },
  30455. vertexShader:
  30456. o +
  30457. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30458. fragmentShader:
  30459. a +
  30460. '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'
  30461. },
  30462. ribbon: {
  30463. uniforms: {
  30464. map: {
  30465. type: 't',
  30466. value: null
  30467. },
  30468. opacity: {
  30469. type: 'f',
  30470. value: 1
  30471. },
  30472. color: {
  30473. type: 'c',
  30474. value: new n.Color(r.path.color)
  30475. }
  30476. },
  30477. vertexShader:
  30478. o +
  30479. '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',
  30480. fragmentShader:
  30481. a +
  30482. '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'
  30483. },
  30484. waypoint: {
  30485. uniforms: {
  30486. map: {
  30487. type: 't',
  30488. value: null
  30489. },
  30490. opacity: {
  30491. type: 'f',
  30492. value: 1
  30493. },
  30494. pulse: {
  30495. type: 'f',
  30496. value: 1
  30497. },
  30498. nearFade: {
  30499. type: 'v2',
  30500. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  30501. },
  30502. color: {
  30503. type: 'c',
  30504. value: new n.Color(r.reticuleColor)
  30505. }
  30506. },
  30507. vertexShader:
  30508. o +
  30509. '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',
  30510. fragmentShader:
  30511. a +
  30512. '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'
  30513. },
  30514. modelDebug: {
  30515. uniforms: {
  30516. map: {
  30517. type: 't',
  30518. value: null
  30519. },
  30520. modelAlpha: {
  30521. type: 'f',
  30522. value: r.modelAlpha
  30523. },
  30524. depthmapRatio: {
  30525. type: 'f',
  30526. value: 0
  30527. },
  30528. opacity: {
  30529. type: 'f',
  30530. value: 1
  30531. },
  30532. progress: {
  30533. type: 'f',
  30534. value: 0
  30535. },
  30536. considerOcclusion: {
  30537. type: 'i',
  30538. value: r.fancierTransition
  30539. },
  30540. highlightPanoSelection: {
  30541. type: 'i',
  30542. value: 0
  30543. },
  30544. useThirdPano: {
  30545. type: 'i',
  30546. value: r.useThirdPano
  30547. },
  30548. pano0Map: {
  30549. type: 't',
  30550. value: null
  30551. },
  30552. pano0Depth: {
  30553. type: 't',
  30554. value: null
  30555. },
  30556. pano0Position: {
  30557. type: 'v3',
  30558. value: new n.Vector3()
  30559. },
  30560. pano0Matrix: {
  30561. type: 'm4',
  30562. value: new n.Matrix4()
  30563. },
  30564. pano0Weight: {
  30565. type: 'f',
  30566. value: r.transition.pano0Weight
  30567. },
  30568. pano1Map: {
  30569. type: 't',
  30570. value: null
  30571. },
  30572. pano1Depth: {
  30573. type: 't',
  30574. value: null
  30575. },
  30576. pano1Position: {
  30577. type: 'v3',
  30578. value: new n.Vector3()
  30579. },
  30580. pano1Matrix: {
  30581. type: 'm4',
  30582. value: new n.Matrix4()
  30583. },
  30584. pano1Weight: {
  30585. type: 'f',
  30586. value: r.transition.pano1Weight
  30587. },
  30588. pano2Map: {
  30589. type: 't',
  30590. value: null
  30591. },
  30592. pano2Depth: {
  30593. type: 't',
  30594. value: null
  30595. },
  30596. pano2Position: {
  30597. type: 'v3',
  30598. value: new n.Vector3()
  30599. },
  30600. pano2Matrix: {
  30601. type: 'm4',
  30602. value: new n.Matrix4()
  30603. },
  30604. pano2Weight: {
  30605. type: 'f',
  30606. value: r.transition.pano2Weight
  30607. }
  30608. },
  30609. vertexShader:
  30610. o +
  30611. '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',
  30612. fragmentShader:
  30613. a +
  30614. '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'
  30615. },
  30616. customDepth: {
  30617. uniforms: {
  30618. panoPosition: {
  30619. type: 'v3',
  30620. value: new n.Vector3()
  30621. }
  30622. },
  30623. vertexShader:
  30624. o +
  30625. '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',
  30626. fragmentShader:
  30627. a +
  30628. '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'
  30629. },
  30630. skysphere: {
  30631. uniforms: {
  30632. radius: {
  30633. type: 'f',
  30634. value: 0
  30635. }
  30636. },
  30637. vertexShader:
  30638. o +
  30639. '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',
  30640. fragmentShader:
  30641. a +
  30642. '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'
  30643. },
  30644. tagDisc: {
  30645. uniforms: {
  30646. opacity: {
  30647. type: 'f',
  30648. value: 0
  30649. },
  30650. color: {
  30651. type: 'c',
  30652. value: new n.Color()
  30653. },
  30654. bg: {
  30655. type: 't',
  30656. value: null
  30657. },
  30658. mask: {
  30659. type: 't',
  30660. value: null
  30661. }
  30662. },
  30663. vertexShader:
  30664. o +
  30665. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30666. fragmentShader:
  30667. a +
  30668. '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'
  30669. }
  30670. }
  30671. },
  30672. {
  30673. './settings': 166,
  30674. three: 217
  30675. }
  30676. ],
  30677. 168: [
  30678. function (e, t, i) {
  30679. ;(function (i) {
  30680. 'use strict'
  30681. var n = e('three'),
  30682. r = (e('url'), e('./util/ajax')),
  30683. o = e('./settings'),
  30684. a = e('./util/logger'),
  30685. s = e('./util/math'),
  30686. l = e('./util/showcase'),
  30687. c = e('./objects/Panorama'),
  30688. h = new a(i),
  30689. u = e('./model/Model'),
  30690. d = e('./shaders'),
  30691. p = e('./util/transitions'),
  30692. f = e('./objects/Chunk'),
  30693. g = e('./objects/Reticule'),
  30694. m = e('./objects/Skybox'),
  30695. v = e('./objects/Floor'),
  30696. A = e('./cameras/DollhouseCamera'),
  30697. y = e('./cameras/FloorplanCamera'),
  30698. C = e('./cameras/PanoramaCamera'),
  30699. I = e('./controls/DollhouseControls'),
  30700. E = e('./controls/FloorplanControls'),
  30701. b = e('./controls/PanoramaControls')
  30702. ;(n.ImageUtils.crossOrigin = o.crossOrigin),
  30703. (t.exports = {
  30704. shaders: d,
  30705. transitions: p,
  30706. Model: u,
  30707. Chunk: f,
  30708. Floor: v,
  30709. Skybox: m,
  30710. Reticule: g,
  30711. Panorama: c,
  30712. DollhouseCamera: A,
  30713. FloorplanCamera: y,
  30714. PanoramaCamera: C,
  30715. DollhouseControls: I,
  30716. FloorplanControls: E,
  30717. PanoramaControls: b,
  30718. getModel: function (e) {
  30719. if (!e.url) throw 'getModel(): missing parameter "url"'
  30720. e.autoload = void 0 === e.autoload || e.autoload
  30721. var t = l.parseSidUrl(e.url)
  30722. ;(e.urlBase = t.urlBase), (e.urlModel = t.urlModel), (e.urlFiles = t.urlFiles)
  30723. var i = this._getPlatformError()
  30724. return i
  30725. ? $.Deferred().reject(i).promise()
  30726. : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)))
  30727. },
  30728. _getPlatformError: function () {
  30729. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  30730. ? 'webgl-unsupported'
  30731. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  30732. ? 'webgl-ios'
  30733. : Modernizr.webgl
  30734. ? null
  30735. : 'webgl-unsupported'
  30736. },
  30737. _loadModel: function () {
  30738. return r
  30739. .get(this.options.urlModel, {
  30740. responseType: 'json',
  30741. prefetchFrom: 'model',
  30742. auth: l.getAuthorizationHeader()
  30743. })
  30744. .then(null, function () {
  30745. return h.warn('Model loading failed at initial metadata load'), 'loading-failed'
  30746. })
  30747. },
  30748. _buildModel: function (e) {
  30749. e = l.normalizeModeldata(e, s)
  30750. var t = new u(this.options, e)
  30751. return this.options.autoload ? t.load(!0) : $.when(t)
  30752. }
  30753. })
  30754. }).call(this, '/js/showcase.js')
  30755. },
  30756. {
  30757. './cameras/DollhouseCamera': 5,
  30758. './cameras/FloorplanCamera': 6,
  30759. './cameras/PanoramaCamera': 7,
  30760. './controls/DollhouseControls': 10,
  30761. './controls/FloorplanControls': 11,
  30762. './controls/PanoramaControls': 13,
  30763. './model/Model': 139,
  30764. './objects/Chunk': 144,
  30765. './objects/Floor': 146,
  30766. './objects/Panorama': 148,
  30767. './objects/Reticule': 149,
  30768. './objects/Skybox': 152,
  30769. './settings': 166,
  30770. './shaders': 167,
  30771. './util/ajax': 181,
  30772. './util/logger': 189,
  30773. './util/math': 190,
  30774. './util/showcase': 193,
  30775. './util/transitions': 195,
  30776. three: 217,
  30777. url: 208
  30778. }
  30779. ],
  30780. 169: [
  30781. function (e, t, i) {
  30782. 'use strict'
  30783. function n() {
  30784. var e = {
  30785. renderTarget: null,
  30786. inUse: !1,
  30787. size: -1,
  30788. pano: null
  30789. }
  30790. return e
  30791. }
  30792. function r(e) {
  30793. M.push(e)
  30794. }
  30795. function o(e) {
  30796. var t = n()
  30797. return (t.inUse = !0), (t.size = e), r(t), t
  30798. }
  30799. function a(e) {
  30800. for (var t = 0; t < M.length; t++) {
  30801. var i = M[t]
  30802. if (!i.inUse && i.size === e) return (i.inUse = !0), i
  30803. }
  30804. return null
  30805. }
  30806. function s(e) {
  30807. for (var t = 0; t < M.length; t++) {
  30808. var i = M[t]
  30809. if (i.renderTarget === e) return (i.inUse = !1), !0
  30810. }
  30811. return !1
  30812. }
  30813. function l() {
  30814. ;(this.tileDirectory = {}),
  30815. (this.activeRenderTargetDescriptors = {}),
  30816. (this.activePanos = []),
  30817. (this.panoLODDescriptors = {}),
  30818. (this.panoDescriptors = {}),
  30819. (this.tileTrees = {}),
  30820. (this.sceneRenderer = null),
  30821. (this.tileDownloader = null),
  30822. (this.forceQueue = []),
  30823. (this.uploadQueues = {}),
  30824. (this.uploadInterval = null),
  30825. (this.uploadIntervalCancelled = !1),
  30826. (this.usingTileOverlay = !1),
  30827. (this.overlayTilesLoaded = !1),
  30828. (this.overlayTileBase = null),
  30829. (this.overlayTilesBasic = {}),
  30830. (this.overlayTilesEnhanced = {}),
  30831. (this.zoomRenderTarget = null),
  30832. (this.zoomPano = null),
  30833. (this.zoomingActive = !1),
  30834. (this.zoomPanoId = null),
  30835. (this.zoomPanoRenderingDisabled = !1),
  30836. (this.direction = new h.Vector3()),
  30837. (this.initTime = -1),
  30838. (this.maxBaseUploadsPerFrame = x),
  30839. (this.maxNonBaseUploadsPerFrame = T)
  30840. }
  30841. function c() {
  30842. this.uploadIntervalCancelled ||
  30843. (this.overlayTilesLoaded || !this.usingTileOverlay
  30844. ? ((b = !0),
  30845. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  30846. this.peekNextFromUploadQueue()
  30847. ? this.refreshUploadInterval(w)
  30848. : (this.uploadInterval = null))
  30849. : this.refreshUploadInterval(this.uploadIntervalDelay))
  30850. }
  30851. /* function c() {
  30852. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  30853. this.updateUploadQueue(1, 2),
  30854. w = 18,
  30855. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  30856. } */
  30857. var h = e('three'),
  30858. u = e('../exception/BasicException'),
  30859. d = e('../settings'),
  30860. p = e('../enum/PanoSizeClass'),
  30861. f = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  30862. g = e('../enum/SceneRendererEvents'),
  30863. m = e('../enum/TileDownloaderEvents'),
  30864. v = e('../enum/Vectors'),
  30865. A = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  30866. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  30867. C = e('./TileUtils'),
  30868. p = e('../enum/PanoSizeClass'),
  30869. I = (e('../util/browser'), e('../util/panorama')),
  30870. E = e('events').EventEmitter,
  30871. b = !1,
  30872. w = d.tiling.uploadIntervalDelay,
  30873. _ = d.tiling.initialIntervalDelay,
  30874. T = d.tiling.maxNonBaseUploadsPerFrame,
  30875. x = d.tiling.maxBaseUploadsPerFrame,
  30876. S = {
  30877. Base: 0,
  30878. Remaining: 1
  30879. },
  30880. M = []
  30881. window.targetList = M
  30882. ;(l.prototype = Object.create(E.prototype)),
  30883. (l.prototype.init = function (e, t, i) {
  30884. ;(this.sceneRenderer = e),
  30885. (this.tileDownloader = t),
  30886. (this.qualityManager = i),
  30887. this.bindEvents(),
  30888. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  30889. (this.initTime = performance.now())
  30890. }),
  30891. (l.prototype.getActivePanoTextures = function (e) {
  30892. e = e || []
  30893. for (var t = 0; t < M.length; t++) {
  30894. var i = M[t]
  30895. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  30896. }
  30897. }),
  30898. (l.prototype.hasQueuedTiles = function () {
  30899. var e = this.peekNextFromUploadQueue()
  30900. return null !== e && void 0 !== e
  30901. }),
  30902. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  30903. return this.activeRenderTargetDescriptors[e]
  30904. }),
  30905. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  30906. this.activeRenderTargetDescriptors[e] = t
  30907. }),
  30908. (l.prototype.loadOverlayTiles = function () {
  30909. if (0 !== d.tiling.overlayStyle) {
  30910. var e = 0,
  30911. t = function (t, n, r) {
  30912. ;(t = n
  30913. ? (t[n] = this.sceneRenderer.initSizedTexture2D(
  30914. C.TILE_SIZE,
  30915. h.ClampToEdgeWrapping
  30916. ))
  30917. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(
  30918. C.TILE_SIZE,
  30919. h.ClampToEdgeWrapping
  30920. ))),
  30921. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  30922. e++,
  30923. e === i.length && (this.overlayTilesLoaded = !0)
  30924. }.bind(this),
  30925. i = [
  30926. ['images/outlineBase.png', t.bind(this, this.overlayTileBase, null)],
  30927. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 256)],
  30928. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 512)],
  30929. ['images/outlineBasic1024.png', t.bind(this, this.overlayTilesBasic, 1024)],
  30930. ['images/outlineBasic2048.png', t.bind(this, this.overlayTilesBasic, 2048)],
  30931. ['images/outlineBasic4096.png', t.bind(this, this.overlayTilesBasic, 4096)],
  30932. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 256)],
  30933. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 512)],
  30934. ['images/outlineEnhanced1024.png', t.bind(this, this.overlayTilesEnhanced, 1024)],
  30935. ['images/outlineEnhanced2048.png', t.bind(this, this.overlayTilesEnhanced, 2048)],
  30936. ['images/outlineEnhanced4096.png', t.bind(this, this.overlayTilesEnhanced, 4096)]
  30937. ]
  30938. i.forEach(
  30939. function (e) {
  30940. this.tileDownloader.loadImage(e[0], 0, e[1])
  30941. }.bind(this)
  30942. ),
  30943. (this.usingTileOverlay = !0)
  30944. } else this.usingTileOverlay = !1
  30945. }),
  30946. (l.prototype.bindEvents = function () {
  30947. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  30948. }),
  30949. (l.prototype.setupZoomRenderTarget = (function () {
  30950. var targets = {}
  30951. return function () {
  30952. if (
  30953. this.qualityManager.maxRenderTargetSize == '2k' &&
  30954. this.qualityManager.getMaxNavPanoSize() == '2k'
  30955. )
  30956. return //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  30957. if (
  30958. this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()
  30959. ) {
  30960. if (
  30961. this.zoomRenderTarget &&
  30962. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()
  30963. )
  30964. return
  30965. var e = this.zoomRenderTarget
  30966. var size = this.qualityManager.getMaxZoomPanoSize()
  30967. if (size > this.qualityManager.maxRenderTargetSize) {
  30968. return
  30969. }
  30970. if (targets[size]) {
  30971. this.zoomRenderTarget = targets[size]
  30972. } else {
  30973. this.zoomRenderTarget = this.initTiledPano(size, true) //放大后不使用抗锯齿,否则消耗更多内存
  30974. targets[size] = this.zoomRenderTarget
  30975. }
  30976. if (e) {
  30977. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  30978. var t = e.width,
  30979. i = this.zoomRenderTarget.width
  30980. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  30981. e.texture.dispose(),
  30982. (e.texture.loaded = !1),
  30983. (e.texture.version = 0),
  30984. this.sceneRenderer.deallocateCubeTexture(e.texture),
  30985. (e.texture = null)
  30986. }
  30987. this.zoomPanoRenderingDisabled = !1
  30988. } else this.zoomPanoRenderingDisabled = !0
  30989. }
  30990. })()),
  30991. (l.prototype.enableHighQuality = function (e) {
  30992. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  30993. if (!this.qualityManager.highQualityModeStarted) {
  30994. this.setupZoomRenderTarget()
  30995. e()
  30996. this.qualityManager.highQualityModeStarted = true
  30997. }
  30998. }),
  30999. (l.prototype.enableUltraHighQualityMode = function (e) {
  31000. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  31001. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH)
  31002. this.tileDownloader.testDownload(
  31003. t,
  31004. C.TILE_SIZE,
  31005. function (t) {
  31006. t &&
  31007. (this.qualityManager.enableUltraHighQualityMode(),
  31008. this.setupZoomRenderTarget(),
  31009. e())
  31010. }.bind(this)
  31011. )
  31012. }
  31013. }),
  31014. (l.prototype.activateTiledPano = function (e, t, i) {
  31015. i && this.clearAllQueuedUploads()
  31016. for (var n = 0; n < C.FACES_PER_PANO; n++)
  31017. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize())
  31018. this.linkAllTilesAndNodes(e)
  31019. var r = this.getActiveRenderTargetDescriptor(e.id),
  31020. l = t
  31021. if (
  31022. (l > this.qualityManager.getMaxNavPanoSize() &&
  31023. (l = this.qualityManager.getMaxNavPanoSize()),
  31024. !r || l !== r.size)
  31025. ) {
  31026. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  31027. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */)
  31028. ;(r = o(c.width)), (r.renderTarget = c)
  31029. }
  31030. ;(r.pano = e),
  31031. this.resetPanoDescriptor(e.id),
  31032. this.resetPanoLODDescriptors(e.id),
  31033. this.resetRenderStatus(e.id, !0, !0)
  31034. }
  31035. this.setActiveRenderTargetDescriptor(e.id, r)
  31036. var h = i ? 0 : 1
  31037. return this.updateActivePanos(e, h), r.renderTarget
  31038. }),
  31039. (l.prototype.deactivateTiledPano = function (e) {
  31040. var t = this.getActiveRenderTargetDescriptor(e.id)
  31041. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  31042. this.setActiveRenderTargetDescriptor(e.id, null)
  31043. var i = this.getUploadQueueForPano(e.id)
  31044. this.clearUploadQueue(i), this.updateActivePanos()
  31045. }),
  31046. (l.prototype.updateActivePanos = (function () {
  31047. var e = []
  31048. return function (t, i) {
  31049. e.length = 0
  31050. for (var n = 0; n < this.activePanos.length; n++) {
  31051. t && e.length === i && e.push(t)
  31052. var r = this.activePanos[n],
  31053. o = this.getActiveRenderTargetDescriptor(r.id)
  31054. ;(t && r.id === t.id) || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  31055. }
  31056. t && i >= e.length && e.push(t),
  31057. (this.activePanos.length = 0),
  31058. this.activePanos.push.apply(this.activePanos, e)
  31059. }
  31060. })()),
  31061. (l.prototype.getActivePanoCount = function () {
  31062. return this.activePanos.length
  31063. }),
  31064. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  31065. var r = null
  31066. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1)
  31067. for (
  31068. var o = function (e, n, r, o) {
  31069. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1)
  31070. },
  31071. a = 0;
  31072. a < C.FACES_PER_PANO;
  31073. a++
  31074. ) {
  31075. var s = this.getTileTree(e, a)
  31076. s.breadthFirst({
  31077. callback: o.bind(this, a),
  31078. minLevel: r
  31079. })
  31080. }
  31081. }),
  31082. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  31083. for (
  31084. var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  31085. i = function (e, t, i, n) {
  31086. ;(t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered)
  31087. },
  31088. n = 0;
  31089. n < C.FACES_PER_PANO;
  31090. n++
  31091. ) {
  31092. var r = this.getTileTree(e, n)
  31093. r.breadthFirst({
  31094. callback: i.bind(this, n),
  31095. maxLevel: t
  31096. })
  31097. }
  31098. }),
  31099. (l.prototype.renderPanoTiles = (function () {
  31100. var e = []
  31101. return function (t, i, n, r) {
  31102. ;(this.zoomRenderTarget &&
  31103. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) ||
  31104. this.zoomPanoRenderingDisabled ||
  31105. this.setupZoomRenderTarget(),
  31106. (i = i || this.direction || v.FORWARD)
  31107. var o = this.getActiveRenderTargetDescriptor(t)
  31108. if (!this.isRenderTargetDescriptorValid(o))
  31109. throw new u(
  31110. 'PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.'
  31111. )
  31112. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  31113. var s = this.getTileTree(t, a)
  31114. ;(e.length = 0),
  31115. s.breadthFirst({
  31116. saveVisited: e
  31117. })
  31118. for (var l = 0; l < e.length; l++) {
  31119. var c = e[l]
  31120. this.queueTileUpload(c.tile, !1, r || (0 === l && n))
  31121. }
  31122. }
  31123. this.updateDirection(i)
  31124. }
  31125. })()),
  31126. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  31127. return e && e.renderTarget
  31128. }),
  31129. (l.prototype.isPanoActive = function (e) {
  31130. var t = this.getActiveRenderTargetDescriptor(e)
  31131. return this.isRenderTargetDescriptorValid(t)
  31132. }),
  31133. (l.prototype.isPanoZoomed = function (e) {
  31134. return this.zoomingActive && this.zoomPanoId === e
  31135. }),
  31136. (l.prototype.initTileTree = function (e, t, i) {
  31137. var n = this.tileTrees[e]
  31138. n || ((n = []), (this.tileTrees[e] = n))
  31139. var r = n[t]
  31140. if (!r) {
  31141. var o = A.getLevelCountForSize(C.TILE_SIZE, i)
  31142. ;(r = new A(C.TILE_SIZE, o)), (n[t] = r)
  31143. }
  31144. }),
  31145. (l.prototype.getTileTree = function (e, t) {
  31146. var i = this.tileTrees[e]
  31147. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!')
  31148. var n = i[t]
  31149. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!')
  31150. return n
  31151. }),
  31152. (l.prototype.initTiledPano = function (e, antialias) {
  31153. var i = this.sceneRenderer.renderer,
  31154. n =
  31155. (i.context,
  31156. new h.WebGLRenderTargetCube(e, e, {
  31157. stencilBuffer: !1
  31158. })),
  31159. r = new h.CubeTexture([])
  31160. ;(n.texture = r),
  31161. (r.image = [null, null, null, null, null, null]),
  31162. (r.flipY = !0),
  31163. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  31164. antialias
  31165. ? ((r.generateMipmaps = !0),
  31166. (r.magFilter = h.LinearFilter),
  31167. (r.minFilter = h.LinearMipMapLinearFilter))
  31168. : ((r.generateMipmaps = !1),
  31169. (r.magFilter = h.LinearFilter),
  31170. (r.minFilter = h.LinearFilter)),
  31171. (r.format = h.RGBAFormat),
  31172. i.setRenderTarget(n),
  31173. i.setRenderTarget(null)
  31174. var o = i.properties.get(r)
  31175. return (o.__image__webglTextureCube = o.__webglTexture), n
  31176. }),
  31177. (l.prototype.getUploadQueueForPano = function (e) {
  31178. var t = this.uploadQueues[e]
  31179. return t || ((t = []), (this.uploadQueues[e] = t)), t
  31180. }),
  31181. (l.prototype.isTileUploaded = function (e) {
  31182. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  31183. }),
  31184. (l.prototype.setUploaded = function (e, t) {
  31185. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t)
  31186. }),
  31187. (l.prototype.queueTileUpload = function (e, t, i) {
  31188. var n = this.getActiveRenderTargetDescriptor(e.panoId)
  31189. if (
  31190. this.isRenderTargetDescriptorValid(n) &&
  31191. e.downloaded &&
  31192. !this.isTileUploaded(e) &&
  31193. (!e.uploadQueued || i) &&
  31194. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31195. ) {
  31196. var r = this.getUploadQueueForPano(e.panoId)
  31197. i
  31198. ? this.uploadTile(e, !1)
  31199. : (this.shoulPushToFrontOfQueue(e)
  31200. ? this.forceQueue.push(e)
  31201. : t && this.direction
  31202. ? y.insertSortedPanoTile(r, e, n.pano, this.direction)
  31203. : r.push(e),
  31204. (e.uploadQueued = !0),
  31205. this.uploadInterval ||
  31206. this.uploadIntervalCancelled ||
  31207. this.refreshUploadInterval(0))
  31208. }
  31209. }),
  31210. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  31211. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  31212. }),
  31213. (l.prototype.getTopUploadQueue = function () {
  31214. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  31215. for (var n = 0; n < this.activePanos.length; n++)
  31216. if (
  31217. ((e = this.activePanos[n]), (t = this.getUploadQueueForPano(e.id)), t.length > 0)
  31218. )
  31219. switch (i) {
  31220. case S.Base:
  31221. if (0 === t[0].level) return t
  31222. break
  31223. case S.Remaining:
  31224. return t
  31225. }
  31226. return null
  31227. }),
  31228. (l.prototype.getNextFromUploadQueue = (function () {
  31229. var e = function (e) {
  31230. var t = e.shift()
  31231. return (t.uploadQueued = !1), t
  31232. }
  31233. return function () {
  31234. if (this.forceQueue.length > 0) return e(this.forceQueue)
  31235. var t = this.getTopUploadQueue()
  31236. return t && t.length > 0 ? e(t) : null
  31237. }
  31238. })()),
  31239. (l.prototype.peekNextFromUploadQueue = function () {
  31240. if (this.forceQueue.length > 0) return this.forceQueue[0]
  31241. var e = this.getTopUploadQueue()
  31242. return e && e.length > 0 ? e[0] : null
  31243. }),
  31244. (l.prototype.clearAllQueuedUploads = function () {
  31245. this.clearAllUploadQueues(null, 0)
  31246. }),
  31247. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  31248. this.clearAllUploadQueues(e, 0)
  31249. }),
  31250. (l.prototype.clearAllUploadQueues = function (e, t) {
  31251. if (e)
  31252. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  31253. this.clearUploadQueue(this.forceQueue, t, e)
  31254. else {
  31255. for (var i = 0; i < this.activePanos.length; i++) {
  31256. var n = this.activePanos[i]
  31257. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  31258. }
  31259. this.clearUploadQueue(this.forceQueue, t)
  31260. }
  31261. }),
  31262. (l.prototype.clearUploadQueue = function (e, t, i) {
  31263. ;(void 0 !== t && null !== t) || (t = 0)
  31264. for (var n = 0; n < e.length; ) {
  31265. var r = e[n]
  31266. ;(!i || (i && i === r.tile.panoId)) && r.level >= t
  31267. ? ((r.uploadQueued = !1), e.splice(n, 1))
  31268. : n++
  31269. }
  31270. }),
  31271. (l.prototype.refreshUploadInterval = (function () {
  31272. var e = null
  31273. return function (t) {
  31274. this.uploadIntervalCancelled ||
  31275. (e || (e = c.bind(this)),
  31276. (null !== t && void 0 !== t) || (t = w),
  31277. b || (t = _),
  31278. (this.uploadInterval = window.setTimeout(e, t)),
  31279. (this.uploadIntervalDelay = t))
  31280. }
  31281. })()),
  31282. (l.prototype.update = (function () {
  31283. var e = performance.now(),
  31284. t = 0
  31285. return function () {
  31286. ;(this.uploadIntervalCancelled = !0),
  31287. window.clearTimeout(this.uploadInterval),
  31288. (this.uploadInterval = null)
  31289. var i = performance.now() - e
  31290. !(i > w || 0 === t) ||
  31291. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  31292. (this.updateUploadQueue(
  31293. this.maxNonBaseUploadsPerFrame,
  31294. this.maxBaseUploadsPerFrame
  31295. ),
  31296. (e = performance.now())),
  31297. t++
  31298. }
  31299. })()),
  31300. (l.prototype.updateUploadQueue = function (e, t) {
  31301. e || (e = 1)
  31302. for (var i = 0, n = 0; ; ) {
  31303. if (n >= t || i >= e) break
  31304. var r = this.getNextFromUploadQueue()
  31305. if (!r) break
  31306. if (
  31307. (0 !== r.level ? i++ : n++,
  31308. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31309. ) {
  31310. var o = this.getActiveRenderTargetDescriptor(r.panoId)
  31311. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  31312. }
  31313. }
  31314. }),
  31315. (l.prototype.updateDirection = function (e) {
  31316. if ((e = e || this.direction)) {
  31317. this.direction = e
  31318. for (var t = 0; t < this.activePanos.length; t++) {
  31319. var i = this.activePanos[t],
  31320. n = this.getUploadQueueForPano(i.id)
  31321. y.sortPanoTiles(n, i, this.direction)
  31322. }
  31323. }
  31324. }),
  31325. (l.prototype.uploadTile = (function () {
  31326. var e = {},
  31327. t = (new h.Vector4(), d.tiling.overlayStyle)
  31328. //var failHistory = {};
  31329. return function (i, n) {
  31330. var r = i.panoId,
  31331. o = i.image,
  31332. a = i.tileSize,
  31333. s = i.panoSize,
  31334. l = i.tileIndex,
  31335. c = (i.faceTileIndex, i.totalTiles),
  31336. u = (i.face, i.tileX),
  31337. d = i.tileY,
  31338. p = !0,
  31339. g = !1,
  31340. m = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  31341. v = this.getActiveRenderTargetDescriptor(r),
  31342. A = v.renderTarget,
  31343. y = v.size
  31344. if (
  31345. (this.isPanoZoomed(r) && ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  31346. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  31347. n ||
  31348. (this.anyUploaded(i.node) && ((p = !1), (g = !0)),
  31349. this.isTileUploaded(i) && ((p = !1), (g = !1))),
  31350. p)
  31351. ) {
  31352. /* if(failHistory[''+r+s+l]){
  31353. console.log('uploadTile retry', r, s, l)
  31354. }
  31355. console.log('uploadTile 成功', r, s, l)
  31356. */
  31357. var C = u * a,
  31358. I = d * a,
  31359. E = (a / s) * y,
  31360. b = (C / s) * y,
  31361. w = (I / s) * y
  31362. if (s > this.qualityManager.maxRenderTargetSize) {
  31363. player.model.getHighImage(o, i.cubeFace, u, d)
  31364. } else {
  31365. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping))
  31366. var _ = e[a]
  31367. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  31368. if (1 === t || 2 === t) {
  31369. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced
  31370. this.sceneRenderer.renderToCubeMap(
  31371. _,
  31372. A,
  31373. a,
  31374. a,
  31375. 0,
  31376. 0,
  31377. a,
  31378. a,
  31379. b,
  31380. w,
  31381. E,
  31382. E,
  31383. i.cubeFace
  31384. ),
  31385. this.sceneRenderer.renderToCubeMap(
  31386. T[s],
  31387. A,
  31388. a,
  31389. a,
  31390. 0,
  31391. 0,
  31392. a,
  31393. a,
  31394. b,
  31395. w,
  31396. E,
  31397. E,
  31398. i.cubeFace,
  31399. h.NormalBlending,
  31400. !0,
  31401. 0.5
  31402. )
  31403. } else
  31404. this.sceneRenderer.renderToCubeMap(
  31405. _,
  31406. A,
  31407. a,
  31408. a,
  31409. 0,
  31410. 0,
  31411. a,
  31412. a,
  31413. b,
  31414. w,
  31415. E,
  31416. E,
  31417. i.cubeFace
  31418. )
  31419. }
  31420. m.uploadCount++,
  31421. this.emit(f.TileRenderSuccess, r, s, l, c),
  31422. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  31423. this.setUploaded(i, !0),
  31424. this.addCoverageForNode(i.node)
  31425. } else {
  31426. this.setUploaded(i, !1)
  31427. //console.log('uploadTile 失败', r, s, l)
  31428. //failHistory[''+r+s+l] = true;
  31429. }
  31430. return (
  31431. i.uploadAttempted ||
  31432. (m.uploadAttempts++, this.emit(f.TileUploadAttempted, r, s, l, c)),
  31433. (i.uploadAttempted = !0),
  31434. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  31435. g
  31436. )
  31437. }
  31438. })()),
  31439. (l.prototype.linkTileAndNode = function (e, t) {
  31440. ;(t.tile = e), (e.node = t)
  31441. }),
  31442. (l.prototype.linkAllTilesAndNodes = function (e) {
  31443. for (
  31444. var t = function (t, i, n, r, o) {
  31445. var a = this.getTileDirectoryEntry(e.id, i, r, o)
  31446. this.linkTileAndNode(a, n)
  31447. },
  31448. i = 0;
  31449. i < C.FACES_PER_PANO;
  31450. i++
  31451. ) {
  31452. var n = this.getTileTree(e.id, i)
  31453. n.breadthFirst({
  31454. callback: t.bind(this, n, i)
  31455. })
  31456. }
  31457. }),
  31458. (l.prototype.anyUploaded = function (e) {
  31459. if (!e) return !1
  31460. if (e.tile && this.isTileUploaded(e.tile)) return !0
  31461. if (e.children)
  31462. for (var t = 0; t < e.children.length; t++) {
  31463. var i = e.children[t]
  31464. if (this.anyUploaded(i)) return !0
  31465. }
  31466. return !1
  31467. }),
  31468. (l.prototype.setNodeCovered = function (e, t) {
  31469. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t)
  31470. }),
  31471. (l.prototype.isNodeCovered = function (e) {
  31472. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  31473. }),
  31474. (l.prototype.addCoverageForNode = function (e) {
  31475. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  31476. var t = e.parent
  31477. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  31478. }
  31479. }),
  31480. (l.prototype.calcFullCoverage = function (e) {
  31481. var t = !1
  31482. if (e.children)
  31483. for (var i = 0; i < e.children.length; i++) {
  31484. var n = e.children[i]
  31485. t = t || this.calcFullCoverage(n)
  31486. }
  31487. e.covered = e.tile.uploaded || t
  31488. }),
  31489. (l.prototype.nodeSubcovered = function (e) {
  31490. if (!e.children) return !1
  31491. for (var t = 0; t < e.children.length; t++)
  31492. if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1
  31493. return !0
  31494. }),
  31495. (l.prototype.resetPanoDescriptor = function (e) {
  31496. this.getPanoDescriptor(e)
  31497. }),
  31498. (l.prototype.getPanoDescriptor = function (e) {
  31499. var t = this.panoDescriptors[e]
  31500. return t || ((t = {}), (this.panoDescriptors[e] = t)), t
  31501. }),
  31502. (l.prototype.resetPanoLODDescriptors = function (e) {
  31503. var t = this.getPanoLODDescriptors(e)
  31504. for (var i in t)
  31505. if (t.hasOwnProperty(i)) {
  31506. var n = t[i]
  31507. ;(n.uploadCount = 0), (n.uploadAttempts = 0)
  31508. }
  31509. }),
  31510. (l.prototype.getPanoLODDescriptor = function (e, t) {
  31511. var i = this.getPanoLODDescriptors(e),
  31512. n = i[t]
  31513. return (
  31514. n ||
  31515. ((n = {
  31516. uploadCount: 0,
  31517. uploadAttempts: 0
  31518. }),
  31519. (i[t] = n)),
  31520. n
  31521. )
  31522. }),
  31523. (l.prototype.getPanoLODDescriptors = function (e) {
  31524. var t = this.panoLODDescriptors[e]
  31525. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t
  31526. }),
  31527. (l.prototype.onTileDownloaded = function (e) {
  31528. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  31529. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex)
  31530. if (
  31531. ((i.downloaded = !0),
  31532. (i.image = e.image),
  31533. (i.panoSize = e.panoSize),
  31534. (i.tileX = e.tileX),
  31535. (i.tileY = e.tileY),
  31536. (i.totalTiles = e.totalTiles),
  31537. (i.tileIndex = e.tileIndex),
  31538. (i.faceTileIndex = e.faceTileIndex),
  31539. (i.face = e.face),
  31540. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  31541. (i.panoId = e.panoId),
  31542. (i.tileSize = e.tileSize),
  31543. (i.direction = new h.Vector3().copy(e.direction)),
  31544. (i.node = null),
  31545. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  31546. this.isPanoActive(i.panoId))
  31547. ) {
  31548. var n = this.getTileTree(i.panoId, i.face),
  31549. r = n.getSubNode(i.panoSize, i.tileX, i.tileY)
  31550. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0)
  31551. }
  31552. }),
  31553. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  31554. var r = this.tileDirectory[e]
  31555. r || ((r = {}), (this.tileDirectory[e] = r))
  31556. var o = 16384 * t + 1024 * i + n,
  31557. a = r[o]
  31558. return (
  31559. a ||
  31560. ((a = {
  31561. downloaded: !1,
  31562. uploaded: !1,
  31563. zoomUploaded: !1
  31564. }),
  31565. (r[o] = a)),
  31566. (a._key = e + ':' + t + ':' + i + ':' + n),
  31567. (a._tileKey = o),
  31568. a
  31569. )
  31570. }),
  31571. (l.prototype.setZoomingActive = function (e, t, i) {
  31572. this.zoomPanoRenderingDisabled ||
  31573. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  31574. ((this.zoomingActive = e),
  31575. (this.zoomPanoId = t.id),
  31576. this.zoomingActive &&
  31577. (this.zoomPanoId !== t.id || i) &&
  31578. this.updateZoomedPanoFromBase(t))
  31579. }),
  31580. (l.prototype.updateZoomedPanoFromBase = function (e) {
  31581. if (!this.zoomPanoRenderingDisabled) {
  31582. var t = this.getActiveRenderTargetDescriptor(e.id)
  31583. if (t && t.renderTarget) {
  31584. var i = Math.min(
  31585. this.qualityManager.maxRenderTargetSize,
  31586. this.qualityManager.getMaxZoomPanoSize()
  31587. ), //this.qualityManager.getMaxZoomPanoSize()
  31588. n = t.renderTarget,
  31589. r = t.size
  31590. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  31591. this.copyBaseRenderStatusToZoomed(e.id)
  31592. }
  31593. }
  31594. }),
  31595. (t.exports = l)
  31596. },
  31597. {
  31598. '../enum/GLCubeFaces': 25,
  31599. '../enum/PanoRendererEvents': 35,
  31600. '../enum/PanoSizeClass': 36,
  31601. '../enum/SceneRendererEvents': 43,
  31602. '../enum/TileDownloaderEvents': 45,
  31603. '../enum/Vectors': 50,
  31604. '../exception/BasicException': 55,
  31605. '../objects/Panorama': 148,
  31606. '../settings': 166,
  31607. '../util/browser': 182,
  31608. '../util/panorama': 191,
  31609. './TileDownloader': 171,
  31610. './TilePrioritizer': 172,
  31611. './TileTree': 173,
  31612. './TileUtils': 174,
  31613. events: 202,
  31614. three: 217
  31615. }
  31616. ],
  31617. 170: [
  31618. function (e, t, i) {
  31619. 'use strict'
  31620. function n(e, t, i) {
  31621. ;(this.maxNavPanoSize = -1),
  31622. (this.maxZoomPanoSize = -1),
  31623. (this.devicePixelDensity = e),
  31624. (this.deviceScreenSize = t),
  31625. (this.clientBandwidth = i),
  31626. (this.panoSizeClassMap = {}),
  31627. (this.useHighResolutionPanos = !0),
  31628. (this.useUltraHighResolutionPanos = !1),
  31629. (this.modelHasUltraHighPanos = !1)
  31630. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  31631. }
  31632. var r = e('../enum/PanoSizeClass'),
  31633. o = e('../settings'),
  31634. a = e('../util/browser'),
  31635. s = e('../constants'),
  31636. l = e('../util/showcase'),
  31637. c = e('../enum/ModelManagerEvents')
  31638. ;(n.prototype.init = function (e) {
  31639. this.buildPanoSizeClassMap(
  31640. this.devicePixelDensity,
  31641. this.deviceScreenSize,
  31642. this.clientBandwidth
  31643. ),
  31644. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  31645. (this.highSize = this.getPanoSize(r.HIGH)),
  31646. (this.standardSize = this.getPanoSize(r.STANDARD)),
  31647. (this.baseSize = this.getPanoSize(r.BASE)),
  31648. o.tiling.maxZoomPanoQuality &&
  31649. this.ultraHighSize <= o.tiling.maxZoomPanoQuality &&
  31650. (o.tiling.allowUltraHighResolution = !0),
  31651. (this.highQualityThreshold = a.valueFromHash(
  31652. 'threshold2k',
  31653. s.windowHeightHighQualityThreshold
  31654. )),
  31655. this.updateMaximums(),
  31656. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  31657. }),
  31658. (n.prototype.updateFromModel = function (e) {
  31659. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e)
  31660. }),
  31661. (n.prototype.updateHighResolutionSettings = function (e) {
  31662. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  31663. l.modelDataPromisesTiles(e.data)
  31664. ? (this.useHighResolutionPanos = !0)
  31665. : (this.useHighResolutionPanos = !1),
  31666. //this.useHighResolutionPanos = !0;
  31667. //----------------------e n d -----------------------------------------------------------------
  31668. this.updateMaximums()
  31669. }),
  31670. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  31671. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos
  31672. ? (this.useUltraHighResolutionPanos = !0)
  31673. : (this.useUltraHighResolutionPanos = !1),
  31674. this.updateMaximums()
  31675. }),
  31676. (n.prototype.enableUltraHighQualityMode = function () {
  31677. ;(this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null)
  31678. }),
  31679. (n.prototype.ultraHighQualityModeEnabled = function () {
  31680. return this.modelHasUltraHighPanos
  31681. }),
  31682. (n.prototype.onModelChanged = function (e) {
  31683. this.updateFromModel(e.model), this.updateMaximums()
  31684. }),
  31685. (n.prototype.updateMaximums = function () {
  31686. ;(this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  31687. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  31688. this.maxZoomPanoSize < this.maxNavPanoSize &&
  31689. (this.maxNavPanoSize = this.maxZoomPanoSize)
  31690. }),
  31691. (n.prototype.buildPanoSizeClassMap = function () {
  31692. ;(this.panoSizeClassMap[r.BASE] = 512),
  31693. (this.panoSizeClassMap[r.STANDARD] = 1024),
  31694. (this.panoSizeClassMap[r.HIGH] = 2048),
  31695. (this.panoSizeClassMap[r.ULTRAHIGH] = 4096)
  31696. }),
  31697. (n.prototype.getPanoSize = function (e) {
  31698. return this.panoSizeClassMap[e]
  31699. }),
  31700. (n.prototype.getMaxPossiblePanoSize = function () {
  31701. return this.getPanoSize(r.ULTRAHIGH)
  31702. }),
  31703. (n.prototype.getMaxPanoSize = function () {
  31704. return this.maxZoomPanoSize
  31705. }),
  31706. (n.prototype.getMaxNavPanoSize = function () {
  31707. return this.maxNavPanoSize
  31708. }),
  31709. (n.prototype.getMaxZoomPanoSize = function () {
  31710. return this.maxZoomPanoSize
  31711. }),
  31712. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  31713. if(settings.mobileNavHigh)return r.HIGH //改
  31714. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  31715. } */
  31716. (n.prototype.detectDevice = function () {
  31717. //add
  31718. if (a.isMobile()) {
  31719. let area = $('#player').width() * $('#player').height()
  31720. if (area < 768 * 1024) {
  31721. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  31722. return 'mobile'
  31723. } else {
  31724. return 'bigMobile'
  31725. }
  31726. } else {
  31727. return 'pc'
  31728. }
  31729. })
  31730. ;(n.prototype.detectMaxNavPanoSizeClass = function () {
  31731. //xzw 改
  31732. switch (this.getNavZoomClass()) {
  31733. case '1k':
  31734. return r.STANDARD
  31735. break
  31736. case '2k':
  31737. default:
  31738. return r.HIGH
  31739. case '4k':
  31740. return r.ULTRAHIGH
  31741. }
  31742. }),
  31743. (n.prototype.detectMaxNavPanoSize = function () {
  31744. var e = this.detectMaxNavPanoSizeClass()
  31745. return this.getPanoSize(e)
  31746. }),
  31747. (n.prototype.getMaxZoomClass = function () {
  31748. //add
  31749. let type = this.detectDevice()
  31750. let setting = settings.tileClass[type] //见manage.js的settings
  31751. return setting.max
  31752. })
  31753. ;(n.prototype.getNavZoomClass = function () {
  31754. //add
  31755. let type = this.detectDevice()
  31756. let setting = settings.tileClass[type]
  31757. return setting.nav
  31758. }),
  31759. (n.prototype.detectMaxZoomPanoSize = function () {
  31760. //获取当前zoomRenderTarget应下载的最高级别
  31761. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  31762. if (this.zoomLevelResolution) {
  31763. //有三个级别
  31764. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  31765. return this.getPanoSize(r.ULTRAHIGH)
  31766. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  31767. return this.getPanoSize(r.STANDARD)
  31768. } else {
  31769. return this.getPanoSize(r.HIGH)
  31770. }
  31771. } else {
  31772. let tileClass = this.getMaxZoomClass()
  31773. if (tileClass == '1k') return this.getPanoSize(r.STANDARD)
  31774. if (tileClass == '4k' && this.useUltraHighResolutionPanos) {
  31775. return this.getPanoSize(r.ULTRAHIGH)
  31776. } else {
  31777. //'2k'
  31778. return this.getPanoSize(r.HIGH)
  31779. }
  31780. }
  31781. }),
  31782. /* n.prototype.detectMaxZoomPanoSize = function() {
  31783. 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)
  31784. } */
  31785. (t.exports = n)
  31786. },
  31787. {
  31788. '../constants': 8,
  31789. '../enum/ModelManagerEvents': 33,
  31790. '../enum/PanoSizeClass': 36,
  31791. '../settings': 166,
  31792. '../util/browser': 182,
  31793. '../util/showcase': 193
  31794. }
  31795. ],
  31796. 171: [
  31797. function (e, t, i) {
  31798. ;(function (i) {
  31799. 'use strict'
  31800. function n(e) {
  31801. ;(this.panos = null),
  31802. (this.retryMinimumTime = 1e4),
  31803. (this.urls = null),
  31804. (this.panoLoadCallbacks = {}),
  31805. (this.downloadDescriptors = {}),
  31806. (this.priorityQueue = []),
  31807. (this.forceQueue = []),
  31808. (this.activeDownloads = []),
  31809. (this.qualityManager = null),
  31810. (this.tilePrioritizer = null),
  31811. (this.refreshInterval = null),
  31812. (this.processPriorityQueue = !1),
  31813. (this.concurrentDownloads = e.concurrentDownloads || 1),
  31814. (this.downloadTestResults = {})
  31815. }
  31816. var r = e('three'),
  31817. o = (e('../enum/Viewmode'), e('../settings')),
  31818. a = (e('../objects/Panorama'), e('../util/logger')),
  31819. s =
  31820. (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/TileDownloaderEvents')),
  31821. l = e('./TilePrioritizer'),
  31822. c = e('./TileUtils'),
  31823. h = (e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  31824. u = e('../util/panorama'),
  31825. d = e('../util/ajax'),
  31826. p = e('../ab'),
  31827. f = e('events').EventEmitter,
  31828. g =
  31829. (new a(i),
  31830. Object.freeze({
  31831. Testing: 1,
  31832. Success: 2,
  31833. Fail: 3
  31834. }))
  31835. ;(n.prototype = Object.create(f.prototype)),
  31836. (n.IDLE_REFRESH_DELAY = 500),
  31837. (n.ACTIVE_REFRESH_DELAY = 16),
  31838. (n.DOWNLOAD_RETRIES = 4),
  31839. (n.prototype.init = function (e) {
  31840. this.qualityManager = e
  31841. }),
  31842. (n.prototype.setUrls = function (e) {
  31843. this.urls = e
  31844. }),
  31845. (n.prototype.setPanoData = function (e, t, i) {
  31846. ;(this.panos = e), (this.imagePanos = t), (this.panoGroupId = i)
  31847. }),
  31848. (n.prototype.start = function () {
  31849. this.refreshUpdateInterval(0)
  31850. }),
  31851. (n.prototype.stop = function () {
  31852. window.cancel(this.refreshInterval)
  31853. }),
  31854. (n.prototype.refreshUpdateInterval = function (e) {
  31855. e || (e = 0),
  31856. (this.refreshInterval = window.setTimeout(
  31857. function () {
  31858. var e = this.update()
  31859. e
  31860. ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY)
  31861. : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  31862. }.bind(this),
  31863. e
  31864. ))
  31865. }),
  31866. (n.prototype.update = function () {
  31867. var e = this.forceQueue.length > 0
  31868. return (
  31869. this.processQueueForDownloading(this.forceQueue),
  31870. this.processPriorityQueue &&
  31871. (this.queuePrioritizedTilesForPanos(this.panos),
  31872. this.priorityQueue.length > 0 && (e = !0),
  31873. this.processQueueForDownloading(this.priorityQueue)),
  31874. e
  31875. )
  31876. }),
  31877. (n.prototype.forceQueueTilesForPano = (function () {
  31878. var e = [],
  31879. t = []
  31880. return function (i, n, r, o, a, s) {
  31881. e.length = 0
  31882. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  31883. var p = u[d]
  31884. ;(p.status !== h.None && p.status !== h.Queued) || e.push(p)
  31885. }
  31886. if (r && e.length > 0) {
  31887. l.sortPanoTiles(e, i, r),
  31888. (t.length = 0),
  31889. c.matchingTilesInDirection(i, n, r, o, a, t)
  31890. for (
  31891. var f = 0,
  31892. g = function (e) {
  31893. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  31894. };
  31895. f < e.length;
  31896. ) {
  31897. var m = e[f],
  31898. v = t.findIndex(g)
  31899. v < 0 ? e.splice(f, 1) : f++
  31900. }
  31901. }
  31902. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A])
  31903. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  31904. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  31905. s && this.processQueueForDownloading(this.forceQueue, !0)
  31906. }
  31907. })()),
  31908. (n.prototype.clearForceQueue = function () {
  31909. this.clearQueue(this.forceQueue)
  31910. }),
  31911. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  31912. this.tilePrioritizer &&
  31913. (this.clearQueue(this.priorityQueue),
  31914. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  31915. this.clearFromQueue(this.priorityQueue, h.None, !0),
  31916. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  31917. }),
  31918. (n.prototype.clearQueue = function (e) {
  31919. this.setStatusForAllDescriptors(e, h.None), (e.length = 0)
  31920. }),
  31921. (n.prototype.clearFromQueue = function (e, t, i) {
  31922. for (var n = 0; n < e.length; n++) {
  31923. var r = e[n]
  31924. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null)
  31925. }
  31926. }),
  31927. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  31928. for (var i = 0; i < e.length; i++) {
  31929. var n = e[i]
  31930. n && (n.status = t)
  31931. }
  31932. }),
  31933. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  31934. for (var i = 0; i < e.length; i++) {
  31935. var n = e[i]
  31936. n && (n.status !== t ? (n.status = t) : (e[i] = null))
  31937. }
  31938. }),
  31939. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  31940. var i = this.getAllTileDownloadDescriptorsForPano(e),
  31941. n = i[t]
  31942. return (
  31943. n ||
  31944. ((n = this.buildDownloadDescriptorArray(t)),
  31945. (i[t] = n),
  31946. this.initTileDownloadDescriptors(n, e, t)),
  31947. n
  31948. )
  31949. }),
  31950. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  31951. var t = this.downloadDescriptors[e.id]
  31952. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t
  31953. }),
  31954. (n.prototype.processQueueForDownloading = function (e, t) {
  31955. if (
  31956. (this.cleanupActiveDownloads(),
  31957. this.activeDownloads.length < this.concurrentDownloads || t)
  31958. )
  31959. for (
  31960. var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length,
  31961. n = 0,
  31962. r = 0;
  31963. n < i && e.length > 0;
  31964. r++
  31965. ) {
  31966. var o = e.shift()
  31967. o && (this.startDownload(o), n++)
  31968. }
  31969. }),
  31970. (n.prototype.testDownload = function (e, t, i) {
  31971. var n = this.downloadTestResults[e]
  31972. if (n) return void (n === g.Success ? i(!0) : n === g.Fail && i(!1))
  31973. this.downloadTestResults[e] = g.Testing
  31974. var r = this.panos.list[0],
  31975. o = this.getTileUrl(r.id, e, t, 0),
  31976. a = function (t) {
  31977. ;(this.downloadTestResults[e] = g.Success), i(!0)
  31978. }.bind(this),
  31979. s = function () {
  31980. ;(this.downloadTestResults[e] = g.Fail), i(!1)
  31981. }.bind(this)
  31982. this.loadImage(o, 0, a, s)
  31983. }),
  31984. (n.prototype.startDownload = function (e) {
  31985. e.status = h.Downloading
  31986. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex)
  31987. this.activeDownloads.push(e),
  31988. this.loadImage(
  31989. t,
  31990. n.DOWNLOAD_RETRIES,
  31991. this.downloadComplete.bind(this, e),
  31992. this.downloadFailed.bind(this, e)
  31993. )
  31994. }),
  31995. (n.prototype.downloadFailed = function (e, t) {}),
  31996. (n.prototype.downloadComplete = function (e, t) {
  31997. if (e.panoGroupId === this.panoGroupId) {
  31998. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize)
  31999. ;(e.status = h.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize)
  32000. var n = {
  32001. panoId: e.pano.id,
  32002. image: t,
  32003. tileSize: e.tileSize,
  32004. panoSize: e.panoSize,
  32005. tileIndex: e.tileIndex,
  32006. faceTileIndex: e.faceTileIndex,
  32007. totalTiles: e.totalTiles,
  32008. face: e.face,
  32009. tileX: e.tileX,
  32010. tileY: e.tileY,
  32011. direction: e.direction
  32012. }
  32013. ;(e.image = t),
  32014. this.emit(s.TileDownloadSuccess, n),
  32015. this.isPanoDownloaded(e.pano, e.panoSize) &&
  32016. ((n = {
  32017. panoId: e.pano.id,
  32018. tileSize: e.tileSize,
  32019. panoSize: e.panoSize
  32020. }),
  32021. this.emit(s.PanoDownloadComplete, n),
  32022. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  32023. }
  32024. }),
  32025. (n.prototype.cleanupActiveDownloads = (function () {
  32026. var e = []
  32027. return function () {
  32028. e.length = 0
  32029. for (var t = 0; t < this.activeDownloads.length; t++) {
  32030. var i = this.activeDownloads[t]
  32031. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  32032. }
  32033. ;(this.activeDownloads.length = 0),
  32034. this.activeDownloads.push.apply(this.activeDownloads, e)
  32035. }
  32036. })()),
  32037. (n.prototype.isPanoDownloaded = function (e, t) {
  32038. var i = this.getTileDownloadDescriptors(e, t)
  32039. if (i.length <= 0) return !1
  32040. for (var n = 0; n < i.length; n++) {
  32041. var r = i[n]
  32042. if (r.status !== h.Downloaded) return !1
  32043. }
  32044. return !0
  32045. }),
  32046. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  32047. var o = e.id + ':' + this.qualityManager.getPanoSize(t)
  32048. this.panoLoadCallbacks[o] = {
  32049. onLoad: i,
  32050. onFail: n,
  32051. onProgress: r
  32052. }
  32053. }),
  32054. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  32055. var i = e.id + ':' + t
  32056. return this.panoLoadCallbacks[i]
  32057. }),
  32058. (n.prototype.buildDownloadDescriptorArray = function (e) {
  32059. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  32060. var r = this.buildDownloadDescriptor()
  32061. i.push(r)
  32062. }
  32063. return i
  32064. }),
  32065. (n.prototype.buildDownloadDescriptor = function () {
  32066. var e = {
  32067. panoGroupId: null,
  32068. pano: null,
  32069. panoSize: -1,
  32070. tileSize: -1,
  32071. tileIndex: -1,
  32072. totalTiles: -1,
  32073. faceTileIndex: -1,
  32074. status: h.None,
  32075. url: null,
  32076. image: null,
  32077. direction: new r.Vector3(),
  32078. face: -1,
  32079. cubeFace: -1,
  32080. tileX: -1,
  32081. tileY: -1
  32082. }
  32083. return e
  32084. }),
  32085. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  32086. for (var n = 0; n < e.length; n++) {
  32087. var r = e[n]
  32088. this.initTileDownloadDescriptor(r, t, i, n)
  32089. }
  32090. }),
  32091. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  32092. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i
  32093. ;(e.face = c.getFaceForTile(i, n)),
  32094. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  32095. (e.panoGroupId = this.panoGroupId),
  32096. (e.pano = t),
  32097. (e.panoSize = i),
  32098. (e.tileSize = r),
  32099. (e.tileIndex = n),
  32100. (e.totalTiles = c.getTileCountForSize(i)),
  32101. (e.status = h.None),
  32102. (e.image = null),
  32103. c.getTileLocation(e.panoSize, e.tileIndex, e),
  32104. c.getTileVector(
  32105. e.panoSize,
  32106. e.tileSize,
  32107. e.cubeFace,
  32108. e.tileX,
  32109. e.tileY,
  32110. c.LocationOnTile.Center,
  32111. 0,
  32112. e.direction
  32113. )
  32114. }),
  32115. (n.prototype.getTileUrl = (function () {
  32116. var e = {
  32117. 256: '256',
  32118. 512: '512',
  32119. 1024: '1k',
  32120. 2048: '2k',
  32121. 4096: '4k'
  32122. },
  32123. t = {
  32124. face: -1,
  32125. faceTileIndex: -1,
  32126. tileX: -1,
  32127. tileY: -1
  32128. }
  32129. return function (i, n, r, a) {
  32130. c.getTileLocation(n, a, t)
  32131. var s = Math.floor(n / r),
  32132. l = s * s,
  32133. h = Math.floor(a / l),
  32134. u = ''
  32135. 1 === o.tiling.customCompression && (u = '_' + o.tiling['q' + e[n]])
  32136. var d = this.urls.get(
  32137. 'tiles/' +
  32138. i +
  32139. '/' +
  32140. e[n] +
  32141. u +
  32142. '_face' +
  32143. h +
  32144. '_' +
  32145. t.tileX +
  32146. '_' +
  32147. t.tileY +
  32148. '.jpg'
  32149. )
  32150. return (d = p.changeIfTileGenerating(d))
  32151. }
  32152. })()),
  32153. (n.prototype.loadImage = function (e, t, i, n) {
  32154. d.getImage(e, t)
  32155. .then(function (e) {
  32156. i(e)
  32157. })
  32158. .fail(n)
  32159. }),
  32160. (t.exports = n)
  32161. }).call(this, '/js/tile/TileDownloader.js')
  32162. },
  32163. {
  32164. '../ab': 3,
  32165. '../enum/DownloadStatus': 24,
  32166. '../enum/GLCubeFaces': 25,
  32167. '../enum/PanoSizeClass': 36,
  32168. '../enum/TileDownloaderEvents': 45,
  32169. '../enum/Vectors': 50,
  32170. '../enum/Viewmode': 51,
  32171. '../objects/Panorama': 148,
  32172. '../settings': 166,
  32173. '../util/ajax': 181,
  32174. '../util/logger': 189,
  32175. '../util/panorama': 191,
  32176. './TilePrioritizer': 172,
  32177. './TileUtils': 174,
  32178. events: 202,
  32179. three: 217
  32180. }
  32181. ],
  32182. 172: [
  32183. function (e, t, i) {
  32184. ;(function (i) {
  32185. 'use strict'
  32186. function n(e, t, i, o, a) {
  32187. ;(this.qualityManager = e),
  32188. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  32189. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  32190. (this.baseSize = t),
  32191. (this.standardSize = i),
  32192. (this.highSize = o),
  32193. (this.ultraHighSize = a),
  32194. (this.priorityCriteria = new n.PriorityCriteria(
  32195. null,
  32196. new r.Vector3(0, 0, 0),
  32197. new r.Vector3(0, 0, -1),
  32198. new r.Vector3(0, 0, -1)
  32199. ))
  32200. }
  32201. var r = e('three'),
  32202. o =
  32203. (e('../enum/Viewmode'), e('../settings'), e('../settings'), e('../objects/Panorama')),
  32204. a = e('../util/logger'),
  32205. s =
  32206. (e('../enum/Vectors'),
  32207. e('../enum/PanoSizeClass'),
  32208. e('../enum/ModelManagerEvents'),
  32209. e('../enum/GLCubeFaces'),
  32210. e('../enum/DownloadStatus')),
  32211. l = (e('../util/browser'), e('./TileUtils')),
  32212. c = e('../util/math'),
  32213. h =
  32214. (e('events').EventEmitter,
  32215. new a(i),
  32216. Object.freeze({
  32217. None: 0,
  32218. DirectionalFOV: 1
  32219. }))
  32220. ;(n.PriorityCriteria = function (e, t, i, n, o) {
  32221. ;(this.pano = e),
  32222. (this.cameraPosition = new r.Vector3().copy(t)),
  32223. (this.cameraDir = new r.Vector3().copy(i)),
  32224. (this.panoSpaceDir = new r.Vector3().copy(n)),
  32225. (this.upcomingPanos = o),
  32226. (this.copy = function (e) {
  32227. ;(this.pano = e.pano),
  32228. this.cameraPosition.copy(e.cameraPosition),
  32229. this.cameraDir.copy(e.cameraDir),
  32230. this.panoSpaceDir.copy(e.panoSpaceDir),
  32231. (this.upcomingPanos = o)
  32232. }),
  32233. (this.zoomingActive = !1)
  32234. }),
  32235. (n.DIRECTIONAL_FOV = 180),
  32236. (n.DIRECTIONAL_FOV_NARROW = 120),
  32237. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  32238. (n.MAX_SCORED_PANOS_TOADD = 2),
  32239. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  32240. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  32241. (n.appendQueue = function (e, t) {
  32242. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i])
  32243. }),
  32244. (n.prototype.updateCriteria = function (e, t, i, n) {
  32245. ;(this.priorityCriteria.pano = e),
  32246. this.priorityCriteria.cameraPosition.copy(t),
  32247. this.priorityCriteria.cameraDir.copy(i),
  32248. (this.priorityCriteria.upcomingPanos = n),
  32249. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize())
  32250. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  32251. if (!player.panoRenderer.isPanoZoomed(e.id)) {
  32252. //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  32253. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  32254. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  32255. }
  32256. }),
  32257. (n.prototype.filterAndPrioritize = (function () {
  32258. var e = [],
  32259. t = [],
  32260. i = []
  32261. return function (r, o, a) {
  32262. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  32263. this.populateScoredPanos(
  32264. this.priorityCriteria.pano,
  32265. o,
  32266. t,
  32267. this.priorityCriteria.cameraDir,
  32268. n.MAX_SCORED_PANOS_TOCONSIDER
  32269. )
  32270. var s = this.baseSize,
  32271. l = this.standardSize,
  32272. c = this.highSize,
  32273. h = this.ultraHighSize
  32274. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  32275. this.priorityCriteria.upcomingPanos &&
  32276. this.queueTilesForPanos(
  32277. r,
  32278. this.priorityCriteria.upcomingPanos,
  32279. a,
  32280. s,
  32281. n.MAX_UPCOMING_PANOS_TOADD
  32282. ),
  32283. this.priorityCriteria.upcomingPanos &&
  32284. this.queueTilesForPanos(
  32285. r,
  32286. this.priorityCriteria.upcomingPanos,
  32287. a,
  32288. 1024,
  32289. n.MAX_UPCOMING_PANOS_TOADD
  32290. ), //更清晰些
  32291. (i.length = 0),
  32292. this.canDownloadSize(l) &&
  32293. this.queueTilesInDirectionForPano(
  32294. i,
  32295. a,
  32296. this.priorityCriteria.pano,
  32297. l,
  32298. this.priorityCriteria.cameraPosition,
  32299. this.priorityCriteria.cameraDir,
  32300. n.DIRECTIONAL_FOV_NARROW
  32301. ),
  32302. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32303. n.appendQueue(r, i),
  32304. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  32305. (i.length = 0),
  32306. this.canDownloadSize(c) &&
  32307. this.queueTilesInDirectionForPano(
  32308. i,
  32309. a,
  32310. this.priorityCriteria.pano,
  32311. c,
  32312. this.priorityCriteria.cameraPosition,
  32313. this.priorityCriteria.cameraDir,
  32314. n.DIRECTIONAL_FOV_NARROW
  32315. ),
  32316. this.canDownloadSize(h) &&
  32317. this.queueTilesInDirectionForPano(
  32318. i,
  32319. a,
  32320. this.priorityCriteria.pano,
  32321. h,
  32322. this.priorityCriteria.cameraPosition,
  32323. this.priorityCriteria.cameraDir,
  32324. n.DIRECTIONAL_FOV_NARROW
  32325. ),
  32326. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32327. n.appendQueue(r, i),
  32328. (i.length = 0),
  32329. this.canDownloadSize(l) &&
  32330. this.queueTilesInDirectionForPano(
  32331. i,
  32332. a,
  32333. this.priorityCriteria.pano,
  32334. l,
  32335. this.priorityCriteria.cameraPosition,
  32336. this.priorityCriteria.cameraDir,
  32337. n.DIRECTIONAL_FOV
  32338. ),
  32339. this.canDownloadSize(c) &&
  32340. this.queueTilesInDirectionForPano(
  32341. i,
  32342. a,
  32343. this.priorityCriteria.pano,
  32344. c,
  32345. this.priorityCriteria.cameraPosition,
  32346. this.priorityCriteria.cameraDir,
  32347. n.DIRECTIONAL_FOV
  32348. ),
  32349. this.canDownloadSize(h) &&
  32350. this.queueTilesInDirectionForPano(
  32351. i,
  32352. a,
  32353. this.priorityCriteria.pano,
  32354. h,
  32355. this.priorityCriteria.cameraPosition,
  32356. this.priorityCriteria.cameraDir,
  32357. n.DIRECTIONAL_FOV
  32358. ),
  32359. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32360. n.appendQueue(r, i),
  32361. this.queueTilesForPanos(r, e, a, s)
  32362. }
  32363. })()),
  32364. (n.prototype.canDownloadSize = function (e) {
  32365. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive)
  32366. }),
  32367. (n.prototype.populateNeighborPanos = function (e, t, i) {
  32368. ;(i = i || []), (i.length = 0)
  32369. var n = t.getNeighbours(e)
  32370. for (var r in n)
  32371. if (n.hasOwnProperty(r)) {
  32372. var o = t.get(r)
  32373. i.push(o)
  32374. }
  32375. return i
  32376. }),
  32377. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  32378. ;(i = i || []), (i.length = 0)
  32379. var s = [
  32380. o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS),
  32381. o.filters.not(e)
  32382. ],
  32383. l = [
  32384. o.scoreFunctions.distanceSquared(e),
  32385. o.scoreFunctions.direction(e.position, r)
  32386. ],
  32387. c = t.sortByScore(s, l)
  32388. if (c)
  32389. for (var h = 0; h < c.length && h < a; h++) {
  32390. var u = c[h].item
  32391. i.push(u)
  32392. }
  32393. return i
  32394. }),
  32395. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  32396. for (var o = 0, a = 0; a < t.length; a++) {
  32397. var s = t[a],
  32398. l = this.queueTilesForPano(e, i, s, n)
  32399. if (((o += l > 0 ? 1 : 0), r && o >= r)) break
  32400. }
  32401. return o
  32402. }),
  32403. (n.prototype.queueTilesForPano = (function () {
  32404. var e = {
  32405. filter: h.None
  32406. }
  32407. return function (t, i, n, r) {
  32408. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  32409. }
  32410. })()),
  32411. (n.prototype.queueTilesForPanosInDirection = (function () {
  32412. var e = new r.Vector3()
  32413. return function (t, i, n, r, o, a, s, l) {
  32414. for (var h = 0, u = 0; u < n.length; u++) {
  32415. var d = n[u]
  32416. e.copy(d.position), e.sub(o), e.normalize()
  32417. var p = Math.max(Math.min(a.dot(e), 1), -1),
  32418. f = c.getFOVDotThreshold(s)
  32419. if (p >= f) {
  32420. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s)
  32421. if (((h += g > 0 ? 1 : 0), l && h >= l)) break
  32422. }
  32423. }
  32424. return h
  32425. }
  32426. })()),
  32427. (n.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  32428. for (var l = 0, c = 0; c < i.length; c++) {
  32429. var h = i[c],
  32430. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a)
  32431. if (((l += u > 0 ? 1 : 0), s && l >= s)) break
  32432. }
  32433. return l
  32434. }),
  32435. (n.prototype.queueTilesInDirectionForPano = (function () {
  32436. var e = {
  32437. filter: h.DirectionalFOV,
  32438. direction: new r.Vector3(),
  32439. fov: 60
  32440. },
  32441. t = new r.Vector3()
  32442. return function (i, n, r, o, a, s, c) {
  32443. return (
  32444. t.copy(s),
  32445. l.getRelativeDirection(r.quaternion, t),
  32446. e.direction.copy(t),
  32447. (e.fov = c),
  32448. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  32449. )
  32450. }
  32451. })()),
  32452. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  32453. var e = []
  32454. return function (t, i, n, r, o) {
  32455. var a = i.getTileDownloadDescriptors(n, r)
  32456. ;(e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o)
  32457. for (var s = 0, l = 0; l < e.length; l++) {
  32458. var c = e[l]
  32459. c && (t.push(c), s++)
  32460. }
  32461. return s
  32462. }
  32463. })()),
  32464. (n.prototype.filterTileDownloadDescriptors = (function () {
  32465. new r.Vector3()
  32466. return function (e, t, i, n) {
  32467. var r, o
  32468. switch (n.filter) {
  32469. case h.DirectionalFOV:
  32470. for (r = 0; r < t.length; r++)
  32471. (o = t[r]),
  32472. l.isTileWithinFOV(
  32473. o.panoSize,
  32474. o.tileSize,
  32475. o.face,
  32476. o.tileX,
  32477. o.tileY,
  32478. n.direction,
  32479. n.fov
  32480. ) && i.push(o)
  32481. break
  32482. default:
  32483. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o)
  32484. }
  32485. for (r = 0; r < i.length; r++)
  32486. (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null)
  32487. }
  32488. })()),
  32489. (n.prototype.canIncludeDescriptor = function (e) {
  32490. return e.status !== s.Downloading && e.status !== s.Downloaded
  32491. }),
  32492. (n.prototype.canIncludePano = function (e, t) {
  32493. return !e.isLoaded(t)
  32494. }),
  32495. (n.getFOVDotThreshold = function (e) {
  32496. return Math.cos(r.Math.degToRad(e / 2))
  32497. })
  32498. var u = (function () {
  32499. var e = function e(t, i) {
  32500. var n = e._panoSpaceDir,
  32501. r = e._fovThreshold,
  32502. o = e._fovThresholdNarrow,
  32503. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  32504. s = Math.max(Math.min(n.dot(i.direction), 1), -1)
  32505. return (
  32506. (t._dot = a),
  32507. (i._dot = s),
  32508. a >= r && s < r
  32509. ? -1
  32510. : a < r && s >= r
  32511. ? 1
  32512. : a >= o && s < o
  32513. ? -1
  32514. : a < o && s >= o
  32515. ? 1
  32516. : t.panoSize > i.panoSize
  32517. ? 1
  32518. : i.panoSize > t.panoSize
  32519. ? -1
  32520. : -(a - s)
  32521. )
  32522. }
  32523. return (
  32524. (e._panoSpaceDir = new r.Vector3()),
  32525. (e._fovThreshold = -1),
  32526. (e._fovThresholdNarrow = -1),
  32527. e
  32528. )
  32529. })()
  32530. ;(n.sortPanoTiles = function (e, t, i) {
  32531. u._panoSpaceDir.copy(i),
  32532. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  32533. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32534. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  32535. e.sort(u)
  32536. }),
  32537. (n.insertSortedPanoTile = function (e, t, i, r) {
  32538. u._panoSpaceDir.copy(r),
  32539. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  32540. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32541. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV))
  32542. for (var o = -1, a = 0; a < e.length; a++) {
  32543. var s = u(t, e[a])
  32544. if (s <= 0) {
  32545. o = a
  32546. break
  32547. }
  32548. }
  32549. if (o === -1) e[e.length] = t
  32550. else {
  32551. for (var h = e.length; h > o; h--) e[h] = e[h - 1]
  32552. e[o] = t
  32553. }
  32554. }),
  32555. (n.prototype.setZoomingActive = function (e) {
  32556. e !== this.zoomingActive && (this.zoomingActive = e)
  32557. }),
  32558. (t.exports = n)
  32559. }).call(this, '/js/tile/TilePrioritizer.js')
  32560. },
  32561. {
  32562. '../enum/DownloadStatus': 24,
  32563. '../enum/GLCubeFaces': 25,
  32564. '../enum/ModelManagerEvents': 33,
  32565. '../enum/PanoSizeClass': 36,
  32566. '../enum/Vectors': 50,
  32567. '../enum/Viewmode': 51,
  32568. '../objects/Panorama': 148,
  32569. '../settings': 166,
  32570. '../util/browser': 182,
  32571. '../util/logger': 189,
  32572. '../util/math': 190,
  32573. './TileUtils': 174,
  32574. events: 202,
  32575. three: 217
  32576. }
  32577. ],
  32578. 173: [
  32579. function (e, t, i) {
  32580. 'use strict'
  32581. function n(e, t) {
  32582. ;(this.levels = t), (this.tileSize = e), (this.root = null), (this.allNodes = []), a(this)
  32583. }
  32584. function r(e, t) {
  32585. ;(this.tree = e), (this.parent = t), (this.children = []), (this.id = ++u)
  32586. }
  32587. function o(e, t, i, r, a, s, l, h) {
  32588. if (e) {
  32589. l = l || n.TraversalType.PreOrder
  32590. var u = r * c + i
  32591. if (
  32592. (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r), s && s.push(e)),
  32593. e.children && 0 !== e.children.length)
  32594. ) {
  32595. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  32596. for (var g = 0; g < c; g++)
  32597. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h)
  32598. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r), s && s.push(e))
  32599. }
  32600. }
  32601. }
  32602. function a(e) {
  32603. e.root = s(e, null, 0)
  32604. }
  32605. function s(e, t, i) {
  32606. if (i > e.levels) return null
  32607. var n = new r(e, t)
  32608. e.allNodes.push(n)
  32609. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1)
  32610. return n
  32611. }
  32612. function l(e, t, i, n, r) {
  32613. if (!e) return null
  32614. if (0 === i) return e
  32615. if (!e.children || 0 === e.children.length) return null
  32616. var o = Math.pow(c, i),
  32617. a = o / c,
  32618. s = n % a,
  32619. h = r % a,
  32620. u = Math.floor(r / a),
  32621. d = Math.floor(n / a),
  32622. p = u * c + d,
  32623. f = e.children[p]
  32624. return l(f, t + 1, i - 1, s, h)
  32625. }
  32626. var c =
  32627. (e('three'),
  32628. e('./TileUtils'),
  32629. e('../objects/Panorama'),
  32630. e('../util/panorama'),
  32631. e('events').EventEmitter,
  32632. 2),
  32633. h = c * c
  32634. n.TraversalType = Object.freeze({
  32635. PreOrder: 0,
  32636. PostOrder: 1
  32637. })
  32638. var u = 0
  32639. ;(n.getLevelCountForSize = function (e, t) {
  32640. var i = 0
  32641. for (t < e && (t = e); ; ) {
  32642. if (((t /= c), t < e)) break
  32643. i++
  32644. }
  32645. return i
  32646. }),
  32647. (n.getSizeForLevel = function (e, t) {
  32648. return Math.pow(c, t) * e
  32649. }),
  32650. (n.prototype.getSubNode = function (e, t, i) {
  32651. ;(!t || e < this.tileSize) && (t = 0),
  32652. (!i || e < this.tileSize) && (i = 0),
  32653. e < this.tileSize && (e = this.tileSize)
  32654. var r = n.getLevelCountForSize(this.tileSize, e),
  32655. o = l(this.root, 0, r, t, i)
  32656. return o
  32657. }),
  32658. (n.prototype.breadthFirst = function (e) {
  32659. e = e || {}
  32660. var t = !!e.nullLevelEnd,
  32661. i = e.maxLevel,
  32662. n = e.minLevel,
  32663. r = e.callback,
  32664. o = e.saveVisited,
  32665. a = [],
  32666. s = {},
  32667. l = 0,
  32668. c = 0
  32669. for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i); ) {
  32670. var h = a.shift()
  32671. if (h === s)
  32672. (!n || l >= n) && (r && t && r(null), o && t && o.push(null)),
  32673. a.length > 0 && a.push(s),
  32674. l++,
  32675. (c = 0)
  32676. else {
  32677. if (h.children)
  32678. for (var u = 0; u < h.children.length; u++) {
  32679. var d = h.children[u]
  32680. d && a.push(h.children[u])
  32681. }
  32682. var p = this.getFaceIndexFromNode(h)
  32683. ;(!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++
  32684. }
  32685. }
  32686. }),
  32687. (n.prototype.getFaceIndexFromNode = function (e) {
  32688. if (!e) return -1
  32689. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  32690. var o = i.parent
  32691. if (!o) break
  32692. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s)
  32693. var l = a % c,
  32694. h = Math.floor(a / c)
  32695. ;(n = l * t + n), (r = h * t + r), (t *= c), (i = o)
  32696. }
  32697. return r * t + n
  32698. }),
  32699. (n.prototype.depthFirst = function (e, t, i) {
  32700. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  32701. }),
  32702. (t.exports = n)
  32703. },
  32704. {
  32705. '../objects/Panorama': 148,
  32706. '../util/panorama': 191,
  32707. './TileUtils': 174,
  32708. events: 202,
  32709. three: 217
  32710. }
  32711. ],
  32712. 174: [
  32713. function (e, t, i) {
  32714. 'use strict'
  32715. var n = e('../enum/GLCubeFaces'),
  32716. r = e('../util/MathLight'),
  32717. o = {}
  32718. ;(o.TILE_SIZE = 512),
  32719. (o.FACES_PER_PANO = 6),
  32720. (o.LocationOnTile = {
  32721. Center: 0,
  32722. UpperLeft: 1,
  32723. UpperRight: 2,
  32724. LowerRight: 3,
  32725. LowerLeft: 4
  32726. }),
  32727. (o.getTileVector = (function () {
  32728. return function (e, t, i, a, s, l, c, h) {
  32729. l = l || o.LocationOnTile.Center
  32730. var u = e / t,
  32731. d = a / u
  32732. s = -s + (u - 1)
  32733. var p = s / u,
  32734. f = t / e,
  32735. g = 2 * f,
  32736. m = g / 2,
  32737. v = 2 * d - 1 + m,
  32738. A = 2 * p - 1 + m
  32739. switch (l) {
  32740. case o.LocationOnTile.UpperLeft:
  32741. ;(v -= m), (A += m), (v += c * g)
  32742. break
  32743. case o.LocationOnTile.UpperRight:
  32744. ;(v += m), (A += m), (A -= c * g)
  32745. break
  32746. case o.LocationOnTile.LowerRight:
  32747. ;(v += m), (A -= m), (v -= c * g)
  32748. break
  32749. case o.LocationOnTile.LowerLeft:
  32750. ;(v -= m), (A -= m), (A += c * g)
  32751. break
  32752. case o.LocationOnTile.Center:
  32753. }
  32754. switch (i) {
  32755. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  32756. r.setVector(h, -1, A, -v)
  32757. break
  32758. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  32759. r.setVector(h, 1, A, v)
  32760. break
  32761. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  32762. r.setVector(h, -v, 1, -A)
  32763. break
  32764. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  32765. r.setVector(h, -v, -1, A)
  32766. break
  32767. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  32768. r.setVector(h, -v, A, 1)
  32769. break
  32770. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  32771. r.setVector(h, v, A, -1)
  32772. }
  32773. r.normalize(h)
  32774. }
  32775. })()),
  32776. (o.getFaceForTile = function (e, t) {
  32777. var i = o.TILE_SIZE
  32778. e < o.TILE_SIZE && (i = e)
  32779. var n = Math.floor(e / i),
  32780. r = n * n
  32781. return Math.floor(t / r)
  32782. }),
  32783. (o.getTileLocation = function (e, t, i) {
  32784. var n = o.TILE_SIZE
  32785. e < o.TILE_SIZE && (n = e)
  32786. var r = o.getFaceForTile(e, t),
  32787. a = Math.floor(e / n),
  32788. s = a * a,
  32789. l = t - r * s
  32790. ;(i.tileX = l % a), (i.tileY = Math.floor(l / a)), (i.face = r), (i.faceTileIndex = l)
  32791. }),
  32792. (o.getTileCountForSize = function (e) {
  32793. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO
  32794. var t = Math.floor(e / o.TILE_SIZE),
  32795. i = t * t,
  32796. n = i * o.FACES_PER_PANO
  32797. return n
  32798. }),
  32799. (o.getRelativeDirection = (function () {
  32800. var e = new r.Matrix4(),
  32801. t = new r.Quaternion()
  32802. return function (i, n) {
  32803. t.copy(i),
  32804. t.inverse(),
  32805. e.makeRotationFromQuaternion(t),
  32806. e.applyToVector3(n),
  32807. r.normalize(n)
  32808. }
  32809. })()),
  32810. (o.matchingTilesInDirection = (function () {
  32811. var e = new r.Vector3(),
  32812. t = new r.Vector3(0, 0, -1),
  32813. i = new r.Quaternion(),
  32814. n = function (e, t) {
  32815. e.push({
  32816. face: t.face,
  32817. faceTileIndex: t.faceTileIndex,
  32818. tileX: t.tileX,
  32819. tileY: t.tileY
  32820. })
  32821. },
  32822. a = (function () {
  32823. var e = {
  32824. face: -1,
  32825. faceTileIndex: -1,
  32826. tileX: -1,
  32827. tileY: -1
  32828. }
  32829. return function (t, i, r) {
  32830. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  32831. o.getTileLocation(t, l, e), (i && !i(e)) || (s++, r && n(r, e))
  32832. return s
  32833. }
  32834. })()
  32835. return function (n, s, l, c, h, u) {
  32836. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE
  32837. o.getTileCountForSize(s)
  32838. if (!c && !h) return a(s, null, u)
  32839. var p = !!h
  32840. if (
  32841. ((h = h || c),
  32842. (h = Math.max(0, Math.min(h, 360))),
  32843. (c = Math.max(0, Math.min(c, 360))),
  32844. r.copyVector(l, e),
  32845. o.getRelativeDirection(n.quaternion, e),
  32846. p)
  32847. ) {
  32848. i.setFromUnitVectors(e, t)
  32849. var f = function (e) {
  32850. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  32851. }
  32852. return a(s, f, u)
  32853. }
  32854. var g = function (t) {
  32855. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  32856. }
  32857. return a(s, g, u)
  32858. }
  32859. })()),
  32860. (o.isTileWithinFrustum = (function () {
  32861. var e = new r.Vector3(),
  32862. t = 1e-5
  32863. return function (i, n, a, s, l, c, h, u) {
  32864. for (
  32865. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  32866. p = -d,
  32867. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  32868. g = -f,
  32869. m = o.mapFaceToCubemapFace(a),
  32870. v = 0,
  32871. A = 0,
  32872. y = 0,
  32873. C = 0,
  32874. I = 0,
  32875. E = 0,
  32876. b = o.LocationOnTile.Center;
  32877. b <= o.LocationOnTile.LowerLeft;
  32878. b++
  32879. )
  32880. if (
  32881. (o.getTileVector(i, n, m, s, l, b, 0, e),
  32882. r.applyQuaternionToVector(c, e),
  32883. e.z >= -t)
  32884. )
  32885. I++
  32886. else {
  32887. var w = -1 / e.z,
  32888. _ = e.x * w,
  32889. T = e.y * w
  32890. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++
  32891. }
  32892. return A !== E && v !== E && y !== E && C !== E
  32893. }
  32894. })()),
  32895. (o.isTileWithinFOV = (function () {
  32896. var e = new r.Vector3(),
  32897. t = new r.Vector3(0, 1, 0),
  32898. i = new r.Vector3(1, 0, 0)
  32899. return function (n, a, s, l, c, h, u) {
  32900. var d = o.mapFaceToCubemapFace(s)
  32901. if (
  32902. (r.cross(h, t, i),
  32903. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  32904. o.isWithinFOV(e, h, u, null))
  32905. )
  32906. return !0
  32907. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  32908. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  32909. if ((o.getTileVector(n, a, d, l, c, v, g, e), o.isWithinFOV(e, h, u, null)))
  32910. return !0
  32911. g += p
  32912. }
  32913. return !1
  32914. }
  32915. })()),
  32916. (o.isWithinFOV = (function () {
  32917. var e = new r.Vector3(),
  32918. t = new r.Vector3()
  32919. return function (i, n, o, a) {
  32920. if ((r.copyVector(i, t), a)) {
  32921. r.copyVector(a, e), r.normalize(e)
  32922. var s = r.dot(e, i)
  32923. ;(e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e)
  32924. }
  32925. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  32926. c = Math.cos(l),
  32927. h = r.dot(t, n)
  32928. return h >= c
  32929. }
  32930. })()),
  32931. (o.mapFaceToCubemapFace = (function () {
  32932. var e = {
  32933. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  32934. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  32935. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  32936. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  32937. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  32938. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  32939. }
  32940. return function (t) {
  32941. return e[t]
  32942. }
  32943. })()),
  32944. (t.exports = o)
  32945. },
  32946. {
  32947. '../enum/GLCubeFaces': 25,
  32948. '../util/MathLight': 176
  32949. }
  32950. ],
  32951. 175: [
  32952. function (e, t, i) {
  32953. ;(function (i) {
  32954. 'use strict'
  32955. function n() {
  32956. ;(this.list = []),
  32957. (this.index = {}),
  32958. Object.defineProperty(this, 'length', {
  32959. get: function () {
  32960. return this.list.length
  32961. }
  32962. })
  32963. }
  32964. var r = (e('./common'), e('./logger'))
  32965. new r(i)
  32966. ;(n.prototype.forEach = function (e) {
  32967. this.list.forEach(e)
  32968. }),
  32969. (n.prototype.add = function (e) {
  32970. this.list.push(e), (this.index[this.getIndex(e)] = e)
  32971. }),
  32972. (n.prototype.getIndex = function (e) {
  32973. throw new Error('IndexedCollection.getIndex not implemented in subclass.')
  32974. }),
  32975. (n.prototype.extend = function (e) {
  32976. for (var t = 0; t < e.length; t++) this.add(e[t])
  32977. }),
  32978. (n.prototype.get = function (e) {
  32979. return this.index[e]
  32980. }),
  32981. (n.prototype.first = function () {
  32982. return this.list[0]
  32983. }),
  32984. (n.prototype.last = function () {
  32985. return this.list[this.list.length - 1]
  32986. }),
  32987. (n.prototype.reIndex = function () {
  32988. this.index = {}
  32989. var e = this
  32990. this.forEach(function (t) {
  32991. e.index[e.getIndex(t)] = t
  32992. })
  32993. }),
  32994. (n.prototype.filter = function (e) {
  32995. var t = this.list.filter(e)
  32996. return this.reIndex(), t
  32997. }),
  32998. (n.prototype.reduce = function (e, t) {
  32999. return this.list.reduce(e, t)
  33000. }),
  33001. (n.prototype.sort = function (e) {
  33002. return this.list.sort(e)
  33003. }),
  33004. (n.prototype.indexOf = function (e) {
  33005. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t
  33006. return -1
  33007. }),
  33008. (t.exports = n)
  33009. }).call(this, '/js/util/IndexedCollection.js')
  33010. },
  33011. {
  33012. './common': 185,
  33013. './logger': 189
  33014. }
  33015. ],
  33016. 176: [
  33017. function (e, t, i) {
  33018. 'use strict'
  33019. var n = e('../constants'),
  33020. r = {}
  33021. ;(r.RADIANS_PER_DEGREE = Math.PI / 180),
  33022. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  33023. (r.Vector3 = function (e, t, i) {
  33024. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  33025. }),
  33026. (r.Matrix4 = function () {
  33027. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  33028. arguments.length > 0 &&
  33029. console.error(
  33030. 'MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  33031. )
  33032. }),
  33033. (r.Matrix4.prototype = {
  33034. identity: function () {
  33035. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  33036. },
  33037. copy: function (e) {
  33038. return this.elements.set(e.elements), this
  33039. },
  33040. applyToVector3: function (e) {
  33041. var t = e.x,
  33042. i = e.y,
  33043. n = e.z,
  33044. r = this.elements
  33045. return (
  33046. (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  33047. (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  33048. (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  33049. this
  33050. )
  33051. },
  33052. getInverse: function (e, t) {
  33053. var i = this.elements,
  33054. n = e.elements,
  33055. r = n[0],
  33056. o = n[1],
  33057. a = n[2],
  33058. s = n[3],
  33059. l = n[4],
  33060. c = n[5],
  33061. h = n[6],
  33062. u = n[7],
  33063. d = n[8],
  33064. p = n[9],
  33065. f = n[10],
  33066. g = n[11],
  33067. m = n[12],
  33068. v = n[13],
  33069. A = n[14],
  33070. y = n[15],
  33071. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  33072. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  33073. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  33074. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  33075. w = r * C + o * I + a * E + s * b
  33076. if (0 === w) {
  33077. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  33078. if (t) throw new Error(_)
  33079. return console.warn(_), this.identity()
  33080. }
  33081. var T = 1 / w
  33082. return (
  33083. (i[0] = C * T),
  33084. (i[1] =
  33085. (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T),
  33086. (i[2] =
  33087. (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T),
  33088. (i[3] =
  33089. (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  33090. (i[4] = I * T),
  33091. (i[5] =
  33092. (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T),
  33093. (i[6] =
  33094. (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T),
  33095. (i[7] =
  33096. (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  33097. (i[8] = E * T),
  33098. (i[9] =
  33099. (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T),
  33100. (i[10] =
  33101. (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T),
  33102. (i[11] =
  33103. (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  33104. (i[12] = b * T),
  33105. (i[13] =
  33106. (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T),
  33107. (i[14] =
  33108. (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T),
  33109. (i[15] =
  33110. (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  33111. this
  33112. )
  33113. },
  33114. makeRotationFromQuaternion: function (e) {
  33115. var t = this.elements,
  33116. i = e.x,
  33117. n = e.y,
  33118. r = e.z,
  33119. o = e.w,
  33120. a = i + i,
  33121. s = n + n,
  33122. l = r + r,
  33123. c = i * a,
  33124. h = i * s,
  33125. u = i * l,
  33126. d = n * s,
  33127. p = n * l,
  33128. f = r * l,
  33129. g = o * a,
  33130. m = o * s,
  33131. v = o * l
  33132. return (
  33133. (t[0] = 1 - (d + f)),
  33134. (t[4] = h - v),
  33135. (t[8] = u + m),
  33136. (t[1] = h + v),
  33137. (t[5] = 1 - (c + f)),
  33138. (t[9] = p - g),
  33139. (t[2] = u - m),
  33140. (t[6] = p + g),
  33141. (t[10] = 1 - (c + d)),
  33142. (t[3] = 0),
  33143. (t[7] = 0),
  33144. (t[11] = 0),
  33145. (t[12] = 0),
  33146. (t[13] = 0),
  33147. (t[14] = 0),
  33148. (t[15] = 1),
  33149. this
  33150. )
  33151. }
  33152. }),
  33153. (r.Quaternion = function (e, t, i, n) {
  33154. ;(this._x = e || 0),
  33155. (this._y = t || 0),
  33156. (this._z = i || 0),
  33157. (this._w = void 0 !== n ? n : 1)
  33158. }),
  33159. (r.Quaternion.prototype = {
  33160. get x() {
  33161. return this._x
  33162. },
  33163. set x(e) {
  33164. this._x = e
  33165. },
  33166. get y() {
  33167. return this._y
  33168. },
  33169. set y(e) {
  33170. this._y = e
  33171. },
  33172. get z() {
  33173. return this._z
  33174. },
  33175. set z(e) {
  33176. this._z = e
  33177. },
  33178. get w() {
  33179. return this._w
  33180. },
  33181. set w(e) {
  33182. this._w = e
  33183. },
  33184. copy: function (e) {
  33185. ;(this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w)
  33186. },
  33187. inverse: function () {
  33188. return this.conjugate().normalize()
  33189. },
  33190. conjugate: function () {
  33191. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this
  33192. },
  33193. length: function () {
  33194. return Math.sqrt(
  33195. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  33196. )
  33197. },
  33198. normalize: function () {
  33199. var e = this.length()
  33200. return (
  33201. 0 === e
  33202. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  33203. : ((e = 1 / e),
  33204. (this._x = this._x * e),
  33205. (this._y = this._y * e),
  33206. (this._z = this._z * e),
  33207. (this._w = this._w * e)),
  33208. this
  33209. )
  33210. },
  33211. setFromAxisAngle: function (e, t) {
  33212. var i = t / 2,
  33213. n = Math.sin(i)
  33214. return (
  33215. (this._x = e.x * n),
  33216. (this._y = e.y * n),
  33217. (this._z = e.z * n),
  33218. (this._w = Math.cos(i)),
  33219. this
  33220. )
  33221. },
  33222. setFromUnitVectors: (function () {
  33223. var e,
  33224. t,
  33225. i = 1e-6
  33226. return function (n, o) {
  33227. return (
  33228. void 0 === e && (e = new r.Vector3()),
  33229. (t = r.dot(n, o) + 1),
  33230. t < i
  33231. ? ((t = 0),
  33232. Math.abs(n.x) > Math.abs(n.z)
  33233. ? r.setVector(e, -n.y, n.x, 0)
  33234. : r.setVector(e, 0, -n.z, n.y))
  33235. : r.cross(n, o, e),
  33236. (this._x = e.x),
  33237. (this._y = e.y),
  33238. (this._z = e.z),
  33239. (this._w = t),
  33240. this.normalize()
  33241. )
  33242. }
  33243. })(),
  33244. multiply: function (e) {
  33245. return this.multiplyQuaternions(this, e)
  33246. },
  33247. premultiply: function (e) {
  33248. return this.multiplyQuaternions(e, this)
  33249. },
  33250. multiplyQuaternions: function (e, t) {
  33251. var i = e._x,
  33252. n = e._y,
  33253. r = e._z,
  33254. o = e._w,
  33255. a = t._x,
  33256. s = t._y,
  33257. l = t._z,
  33258. c = t._w
  33259. return (
  33260. (this._x = i * c + o * a + n * l - r * s),
  33261. (this._y = n * c + o * s + r * a - i * l),
  33262. (this._z = r * c + o * l + i * s - n * a),
  33263. (this._w = o * c - i * a - n * s - r * l),
  33264. this
  33265. )
  33266. }
  33267. }),
  33268. (r.convertWorkshopVector = function (e) {
  33269. return new r.Vector3(-e.x, e.y, e.z)
  33270. }),
  33271. (r.convertWorkshopQuaternion = function (e) {
  33272. return new r.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  33273. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  33274. )
  33275. })
  33276. ;(r.convertWorkshopOrthoZoom = function (e) {
  33277. //xzw
  33278. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  33279. return e === -1
  33280. ? -1
  33281. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  33282. g_snapShotHeight
  33283. }),
  33284. (r.convertWorkshopPanoramaQuaternion = function (e) {
  33285. return new r.Quaternion(e.x, -e.y, -e.z, e.w)
  33286. .normalize()
  33287. .multiply(
  33288. new r.Quaternion().setFromAxisAngle(
  33289. new r.Vector3(0, 1, 0),
  33290. 270 * r.RADIANS_PER_DEGREE
  33291. )
  33292. )
  33293. }),
  33294. (r.normalize = function (e) {
  33295. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  33296. i = Math.sqrt(t)
  33297. ;(e.x /= i), (e.y /= i), (e.z /= i)
  33298. }),
  33299. (r.dot = function (e, t) {
  33300. return e.x * t.x + e.y * t.y + e.z * t.z
  33301. }),
  33302. (r.cross = function (e, t, i) {
  33303. var n = e.x,
  33304. r = e.y,
  33305. o = e.z
  33306. ;(i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x)
  33307. }),
  33308. (r.setVector = function (e, t, i, n) {
  33309. ;(e.x = t), (e.y = i), (e.z = n)
  33310. }),
  33311. (r.copyVector = function (e, t) {
  33312. ;(t.x = e.x), (t.y = e.y), (t.z = e.z)
  33313. }),
  33314. (r.addVector = function (e, t) {
  33315. ;(e.x += t.x), (e.y += t.y), (e.z += t.z)
  33316. }),
  33317. (r.subVector = function (e, t) {
  33318. ;(e.x -= t.x), (e.y -= t.y), (e.z -= t.z)
  33319. }),
  33320. (r.applyQuaternionToVector = function (e, t) {
  33321. var i = t.x,
  33322. n = t.y,
  33323. r = t.z,
  33324. o = e.x,
  33325. a = e.y,
  33326. s = e.z,
  33327. l = e.w,
  33328. c = l * i + a * r - s * n,
  33329. h = l * n + s * i - o * r,
  33330. u = l * r + o * n - a * i,
  33331. d = -o * i - a * n - s * r
  33332. ;(t.x = c * l + d * -o + h * -s - u * -a),
  33333. (t.y = h * l + d * -a + u * -o - c * -s),
  33334. (t.z = u * l + d * -s + c * -a - h * -o)
  33335. }),
  33336. (r.angleBetweenVectors = function (e, t) {
  33337. return Math.acos(r.dot(e, t))
  33338. }),
  33339. (t.exports = r)
  33340. },
  33341. {
  33342. '../constants': 8
  33343. }
  33344. ],
  33345. 177: [
  33346. function (e, t, i) {
  33347. ;(function (i) {
  33348. 'use strict'
  33349. function n(e) {
  33350. ;(this.cache = null), (this.expires = 0)
  33351. }
  33352. function r() {
  33353. ;(this.baseUrl = null), (this.cache = null), (this.expires = 0)
  33354. }
  33355. function o() {
  33356. ;(this.baseUrl = null), (this.expires = 0)
  33357. }
  33358. function a(e) {
  33359. ;(this.initialLoadingPromise = null),
  33360. (this.endpoint = e + '?type=3'),
  33361. (this.urlContainer = null),
  33362. (this.authorizationHeader = h.getAuthorizationHeader()),
  33363. (this.containerClasses = [o, r, n])
  33364. }
  33365. var s = e('./ajax'),
  33366. l = e('./logger'),
  33367. c = e('../constants'),
  33368. h = e('./showcase'),
  33369. u = (e('../ab'), new l(i))
  33370. ;(n.prototype = {
  33371. version: 1,
  33372. validate: function (e) {
  33373. return 'catalog.json' in e && Object.keys(e).length > 0
  33374. },
  33375. update: function (e) {
  33376. return (
  33377. (this.cache = e),
  33378. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33379. $.when()
  33380. )
  33381. },
  33382. get: function (e) {
  33383. return this.cache[e]
  33384. }
  33385. }),
  33386. (r.prototype = {
  33387. version: 2,
  33388. validate: function (e) {
  33389. return 'catalog.json' in e && 'base.url' in e && Object.keys(e).length > 1
  33390. },
  33391. update: function (e) {
  33392. return (
  33393. (this.baseUrl = e['base.url']),
  33394. (this.cache = e),
  33395. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33396. $.when()
  33397. )
  33398. },
  33399. get: function (e) {
  33400. var t = this.cache[e]
  33401. return t ? this.baseUrl.replace('{{filename}}', e) + t : null
  33402. }
  33403. }),
  33404. (o.prototype = {
  33405. version: 3,
  33406. validate: function (e) {
  33407. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  33408. },
  33409. update: function (e) {
  33410. return (
  33411. (this.baseUrl = e.templates[0]),
  33412. e.expires
  33413. ? (this.expires = 1e3 * e.expires)
  33414. : (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33415. $.when()
  33416. )
  33417. },
  33418. get: function (e) {
  33419. return this.baseUrl.replace('{{filename}}', e)
  33420. }
  33421. }),
  33422. (a.prototype = {
  33423. init: function () {
  33424. return this.initialLoadingPromise
  33425. ? this.initialLoadingPromise
  33426. : (setInterval(
  33427. function () {
  33428. var e = this.urlContainer ? this.urlContainer.expires : Date.now()
  33429. Date.now() + c.signedUrlRefreshBuffer > e &&
  33430. (u.debug('Refreshing urls...'),
  33431. this.refresh()
  33432. .done(function () {
  33433. u.debug('Refreshed')
  33434. })
  33435. .fail(function () {
  33436. u.error('Failed url refresh, urls might go stale soon')
  33437. }))
  33438. }.bind(this),
  33439. c.signedUrlCheckInterval
  33440. ),
  33441. (this.initialLoadingPromise = this.refresh()),
  33442. this.initialLoadingPromise)
  33443. },
  33444. refresh: function (e) {
  33445. //已经在someData.js里加载过了 不用再加载file了吧
  33446. e = e || {}
  33447. /*var t = void 0 === e.cache || e.cache;
  33448. return s.get( this.endpoint , { //file
  33449. responseType: "json",
  33450. prefetchFrom: t ? "files" : null,
  33451. cache: t,
  33452. auth: this.authorizationHeader
  33453. }).then(function(e) {
  33454. if (this.urlContainer && this.urlContainer.validate(e))
  33455. return this.urlContainer.update(e);
  33456. for (var i = 0; i < this.containerClasses.length; i++) {
  33457. var n = this.containerClasses[i]
  33458. , r = new n;
  33459. if (r.validate(e))
  33460. return u.info("Using urls version " + r.version),
  33461. this.urlContainer = r,
  33462. this.urlContainer.update(e)
  33463. }
  33464. return t ? this.refresh({
  33465. cache: !1
  33466. }) : $.Deferred().reject("missing-urls")
  33467. }
  33468. .bind(this), function(e) {
  33469. return "loading-failed"
  33470. }) */
  33471. return $.Deferred().resolve()
  33472. },
  33473. get: function (e) {
  33474. //return this.urlContainer.get(e)
  33475. return window.DATA.files.templates[0].replace('{{filename}}', e)
  33476. }
  33477. }),
  33478. (t.exports = a)
  33479. }).call(this, '/js/util/ModelUrls.js')
  33480. },
  33481. {
  33482. '../ab': 3,
  33483. '../constants': 8,
  33484. './ajax': 181,
  33485. './logger': 189,
  33486. './showcase': 193
  33487. }
  33488. ],
  33489. 178: [
  33490. function (e, t, i) {
  33491. ;(function (i) {
  33492. 'use strict'
  33493. function n() {
  33494. u.call(this), (this.neighbourMap = {}), (this.map = null)
  33495. }
  33496. var r = e('three'),
  33497. o = e('./common'),
  33498. a = e('../settings'),
  33499. s = e('../objects/Panorama'),
  33500. a = e('../settings'),
  33501. l = e('./aStar'),
  33502. c = e('./logger'),
  33503. h = new c(i),
  33504. u = e('./IndexedCollection'),
  33505. d = e('./transitions')
  33506. o.inherit(n, u),
  33507. (n.prototype.getIndex = function (e) {
  33508. return e.id
  33509. }),
  33510. (n.prototype.find = function (e, t) {
  33511. var i = o.filterAll(this.list, e)
  33512. return 0 === i.length
  33513. ? null
  33514. : (t &&
  33515. t.forEach(function (e) {
  33516. i = o.stableSort(i, e)
  33517. }),
  33518. i[0])
  33519. }),
  33520. /* n.prototype.sortByScore = function(e, t) {
  33521. var i = o.filterAll(this.list, e);
  33522. return 0 === i.length ? null : i = i.map(function(e) {
  33523. return {
  33524. pano: e,
  33525. score: t.reduce(function(t, i) {
  33526. return t + i(e)
  33527. }, 0)
  33528. }
  33529. }).sort(function(e, t) {
  33530. return t.score - e.score;
  33531. })
  33532. } */
  33533. (n.prototype.sortByScore = function (request, rank) {
  33534. return common.sortByScore(this.list, request, rank)
  33535. }),
  33536. (n.prototype.lowestByScore = function (e, t, i) {
  33537. return this.findRankedByScore(0, e, t, i)
  33538. }),
  33539. (n.prototype.findRankedByScore = function (e, t, i, n) {
  33540. n && ((n.candidates = null), (n.pano = null)), e || (e = 0)
  33541. var r = this.sortByScore(t, i)
  33542. return !r || 0 === r.length || e >= r.length
  33543. ? null
  33544. : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item)
  33545. }),
  33546. (n.prototype.showPanoScores = function (e) {
  33547. this.list.forEach(function (e) {
  33548. e.removeTextSprite()
  33549. })
  33550. var t = 6344768
  33551. e.forEach(function (e) {
  33552. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055)
  33553. })
  33554. }),
  33555. (n.prototype.isNeighbour = function (e, t) {
  33556. return this.neighbourMap[e.id][t.id]
  33557. }),
  33558. (n.prototype.getNeighbours = function (e) {
  33559. return this.neighbourMap[e.id]
  33560. }),
  33561. (n.prototype.setNeighbour = function (e, t, i) {
  33562. return (
  33563. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  33564. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  33565. (this.neighbourMap[e.id][e.id] = !0),
  33566. (this.neighbourMap[t.id][t.id] = !0),
  33567. (this.neighbourMap[e.id][t.id] = i),
  33568. (this.neighbourMap[t.id][e.id] = i),
  33569. this.neighbourMap[e.id]
  33570. )
  33571. }),
  33572. (n.prototype.findClosest = function (e, t) {
  33573. var i = [s.filters.isPanoAligned()]
  33574. return (
  33575. t && i.push(s.filters.inDirection(e, t, 0.75)),
  33576. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  33577. )
  33578. }),
  33579. (n.prototype.dualNeighbors = function (e, t) {
  33580. var i,
  33581. n = []
  33582. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i)
  33583. return n
  33584. }),
  33585. (n.prototype.populate_path_graph = function () {
  33586. var e,
  33587. t,
  33588. i,
  33589. n,
  33590. o,
  33591. a,
  33592. s,
  33593. l,
  33594. c = Date.now(),
  33595. u = {},
  33596. d = 0,
  33597. p = new r.Vector3(0, 0, 0),
  33598. f = 0,
  33599. g = 0
  33600. for (e = 0; e < this.list.length; e += 1) {
  33601. ;(o = this.list[e]),
  33602. (s = {}),
  33603. (l = !1),
  33604. (i = o.neighbourPanos || o.findNeighourPanos())
  33605. for (t in i)
  33606. if (i[t]) {
  33607. ;(a = this.index[t]), p.copy(o.floorPosition), p.sub(a.floorPosition)
  33608. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  33609. v = (Math.abs(p.y) / Math.max(m, 0.01), Math.max(0, Math.abs(p.y) - 0.2))
  33610. v > 0
  33611. ? ((f += 1),
  33612. (v = Math.pow(4 * v, 2)),
  33613. (m = Math.pow(m, 2)),
  33614. (n = Math.sqrt(v * v + m * m)))
  33615. : ((g += 1), (n = p.length())),
  33616. (s[a.id] = n),
  33617. (l = !0)
  33618. }
  33619. l ? (u[o.id] = s) : (d += 1)
  33620. }
  33621. ;(this.map = u),
  33622. h.info('graph ready in ' + (Date.now() - c) + 'ms, ' + d + ' had no neighbors')
  33623. }),
  33624. (n.prototype.aStarSearch = function (e, t) {
  33625. var i = Date.now(),
  33626. n = new l({
  33627. start: e,
  33628. isEnd: function (e) {
  33629. return e === t
  33630. },
  33631. neighbor: function (e) {
  33632. var t = e.neighbourPanos || e.findNeighourPanos(),
  33633. i = []
  33634. for (var n in t) t[n] && i.push(this.index[n]) //add: t[n] &&
  33635. return i
  33636. }.bind(this),
  33637. distance: function (e, t) {
  33638. var i = this.map[e.id],
  33639. n = i[t.id]
  33640. return n
  33641. }.bind(this),
  33642. heuristic: function (e, t) {
  33643. return 1
  33644. }.bind(this),
  33645. hash: function (e) {
  33646. return e.id
  33647. },
  33648. timeout: 5e3
  33649. })
  33650. if ((h.debug('A* search in ' + (Date.now() - i) + 'ms'), 'success' !== n.status))
  33651. return h.debug('Did not find A* path from ' + e + ' to ' + t), null
  33652. h.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps')
  33653. var r = []
  33654. return (
  33655. n.path.forEach(function (e) {
  33656. r.push(e.id)
  33657. }),
  33658. r
  33659. )
  33660. }),
  33661. (n.prototype.includeNodesNearPath = (function () {
  33662. var e = new r.Vector3(),
  33663. t = new r.Vector3(),
  33664. i = new r.Vector3(),
  33665. n = new r.Vector3(),
  33666. o = new r.Vector3(),
  33667. a = new r.Vector3(),
  33668. s = new r.Vector3(),
  33669. l = new r.Vector3(),
  33670. c = [],
  33671. h = new r.Vector3(),
  33672. u = new r.Vector3()
  33673. return function (r, d) {
  33674. if (r)
  33675. for (
  33676. var p = function (e, t, i) {
  33677. return o.copy(t).sub(e), o.dot(i)
  33678. },
  33679. f = function (e, t) {
  33680. return p(h, e.position, i) - p(h, t.position, i)
  33681. },
  33682. g = 0;
  33683. g < r.length - 1;
  33684. ) {
  33685. var m = r[g],
  33686. v = r[g + 1],
  33687. A = this.index[m],
  33688. y = this.index[v]
  33689. h.copy(A.position),
  33690. u.copy(y.position),
  33691. (c.length = 0),
  33692. e.copy(u).sub(h),
  33693. i.copy(e).normalize()
  33694. for (var C = 0; C < this.list.length; C++) {
  33695. var I = this.list[C]
  33696. o.copy(I.position).sub(h)
  33697. var E = o.dot(i)
  33698. if (E > 0) {
  33699. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s)
  33700. var b = a.length()
  33701. if (b < d) {
  33702. t.copy(e).negate(), n.copy(t).normalize(), l.copy(I.position).sub(u)
  33703. var w = l.dot(n)
  33704. w > 0 && c.push(I)
  33705. }
  33706. }
  33707. }
  33708. if (c.length > 0) {
  33709. c.sort(f)
  33710. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  33711. r[_] = r[_ - c.length]
  33712. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id
  33713. }
  33714. g += c.length + 1
  33715. }
  33716. }
  33717. })()),
  33718. /* n.prototype. = function(e, t) {
  33719. var i = void 0 === e ? a.panorama.markerOpacity : e
  33720. , n = this.list.findIndex(function(e) {
  33721. return e.marker
  33722. });
  33723. if (!(n < 0)) {
  33724. var r = this.list[n].marker.material.opacity;
  33725. if (r !== e) {
  33726. var o = i - r;
  33727. d.trigger({
  33728. func: function(e, t) {
  33729. var i = r + e * o;
  33730. this.forEach(function(e) {
  33731. e.marker && (e.marker.material.opacity = i)
  33732. })
  33733. }
  33734. .bind(this),
  33735. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  33736. name: "_fpm"
  33737. })
  33738. }
  33739. }
  33740. } */
  33741. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  33742. d.cancelById('fadeMarkerOpacity')
  33743. var n = this.list.findIndex(function (e) {
  33744. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  33745. return e.marker
  33746. })
  33747. if (n < 0) {
  33748. //logger.info('marker findIndex<0')
  33749. return
  33750. }
  33751. var group
  33752. var tran = function (list, index) {
  33753. list.member = list.member.filter(function (m) {
  33754. return m.marker && m.marker.material.opacity != list.toOp
  33755. })
  33756. transitions.trigger({
  33757. func: function (e, t) {
  33758. //e:0-1
  33759. list.member.forEach(function (m) {
  33760. var o = m.marker.oldOpacity
  33761. var i = o + e * (list.toOp - o)
  33762. m.marker && (m.marker.material.opacity = i)
  33763. })
  33764. }.bind(this),
  33765. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  33766. name: '_fpm_' + index,
  33767. id: 'fadeMarkerOpacity'
  33768. })
  33769. }
  33770. this.forEach(function (e) {
  33771. //先记录旧的opacity
  33772. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  33773. })
  33774. group = gr
  33775. /* if (e > 0 && gr) {
  33776. group = gr
  33777. } else {
  33778. group = [
  33779. {
  33780. member: this.list,
  33781. toOp: 0,
  33782. },
  33783. ]
  33784. } */
  33785. for (var i = 0; i < group.length; i++) {
  33786. tran(group[i], i)
  33787. }
  33788. }),
  33789. (t.exports = n)
  33790. }).call(this, '/js/util/PanoramaCollection.js')
  33791. },
  33792. {
  33793. '../objects/Panorama': 148,
  33794. '../settings': 166,
  33795. './IndexedCollection': 175,
  33796. './aStar': 180,
  33797. './common': 185,
  33798. './logger': 189,
  33799. './transitions': 195,
  33800. three: 217
  33801. }
  33802. ],
  33803. 179: [
  33804. function (e, t, i) {
  33805. 'use strict'
  33806. function n() {
  33807. ;(this.actionSequence = []), (this.actionSequenceInProgress = !1)
  33808. }
  33809. function r(e, t, i, n) {
  33810. s.trackAlways('zoom_' + e, {
  33811. from: t,
  33812. to: i,
  33813. pano: n
  33814. })
  33815. }
  33816. function o(e, t) {
  33817. r('initial', 1, e, t)
  33818. }
  33819. function a(e, t, i) {
  33820. r('followup', e, t, i)
  33821. }
  33822. var s = e('../analytics')
  33823. ;(n.prototype.reset = function (e) {
  33824. ;(this.actionSequenceInProgress = !1), (this.actionSequence.length = 0)
  33825. }),
  33826. (n.prototype.addZoomAction = (function () {
  33827. var e = null,
  33828. t = null,
  33829. i = !1,
  33830. n = function () {
  33831. if (((e = null), this.actionSequence.length > 0)) {
  33832. var i = this.actionSequence[0].start,
  33833. n = this.actionSequence[this.actionSequence.length - 1].end
  33834. 1 === i ? o(n, t) : a(i, n, t)
  33835. }
  33836. this.reset()
  33837. }
  33838. return function (r, o, a) {
  33839. if (r !== o) {
  33840. i || ((n = n.bind(this)), (i = !0)),
  33841. e && (window.clearTimeout(e), (e = null)),
  33842. (a === t && this.actionSequenceInProgress) || (this.reset(), (t = a)),
  33843. (this.actionSequenceInProgress = !0)
  33844. var s = {
  33845. start: r,
  33846. end: o
  33847. }
  33848. this.actionSequence.push(s), (e = window.setTimeout(n, 150))
  33849. }
  33850. }
  33851. })()),
  33852. (t.exports = n)
  33853. },
  33854. {
  33855. '../analytics': 4
  33856. }
  33857. ],
  33858. 180: [
  33859. function (e, t, i) {
  33860. 'use strict'
  33861. function n(e) {
  33862. void 0 === e.timeout && (e.timeout = 1 / 0)
  33863. var t = e.hash || o,
  33864. i = {
  33865. data: e.start,
  33866. g: 0,
  33867. h: e.heuristic(e.start)
  33868. },
  33869. n = i
  33870. i.f = i.h
  33871. var h = new s(),
  33872. u = new l(a),
  33873. d = c()
  33874. u.push(i), d.set(t(i.data), i)
  33875. for (var p = new Date(); u.size(); ) {
  33876. if (new Date() - p > e.timeout)
  33877. return {
  33878. status: 'timeout',
  33879. cost: n.g,
  33880. path: r(n)
  33881. }
  33882. var f = u.pop()
  33883. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  33884. return {
  33885. status: 'success',
  33886. cost: f.g,
  33887. path: r(f)
  33888. }
  33889. h.add(t(f.data))
  33890. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  33891. var v = g[m]
  33892. if (!h.contains(t(v))) {
  33893. var A = f.g + e.distance(f.data, v),
  33894. y = d.get(t(v)),
  33895. C = !1
  33896. if (void 0 === y)
  33897. (y = {
  33898. data: v
  33899. }),
  33900. d.set(t(v), y)
  33901. else {
  33902. if (y.g < A) continue
  33903. C = !0
  33904. }
  33905. ;(y.parent = f),
  33906. (y.g = A),
  33907. (y.h = e.heuristic(v)),
  33908. (y.f = A + y.h),
  33909. y.h < n.h && (n = y),
  33910. C ? u.heapify() : u.push(y)
  33911. }
  33912. }
  33913. }
  33914. return {
  33915. status: 'noPath',
  33916. cost: n.g,
  33917. path: r(n)
  33918. }
  33919. }
  33920. function r(e) {
  33921. if (void 0 !== e.parent) {
  33922. var t = r(e.parent)
  33923. return t.push(e.data), t
  33924. }
  33925. return [e.data]
  33926. }
  33927. function o(e) {
  33928. return e.toString()
  33929. }
  33930. function a(e, t) {
  33931. return e.f - t.f
  33932. }
  33933. var s = e('Set'),
  33934. l = e('heap'),
  33935. c = e('dict')
  33936. t.exports = n
  33937. },
  33938. {
  33939. Set: 196,
  33940. dict: 210,
  33941. heap: 211
  33942. }
  33943. ],
  33944. 181: [
  33945. function (e, t, i) {
  33946. ;(function (i) {
  33947. 'use strict'
  33948. function n(e, t, i) {
  33949. var n = new XMLHttpRequest()
  33950. if (i && 'withCredentials' in n) n.open(e, t, i)
  33951. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()), n.open(e, t)
  33952. else {
  33953. if (i) throw 'Browser does not support CORS!'
  33954. n.open(e, t)
  33955. }
  33956. return n
  33957. }
  33958. function r(e, t, i) {
  33959. function o() {
  33960. u.warn('Retrying ', t),
  33961. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  33962. }
  33963. function a(e, t) {
  33964. var i = e.response
  33965. if ('json' === t && 'object' != typeof i)
  33966. try {
  33967. i = JSON.parse(e.responseText)
  33968. } catch (e) {
  33969. return void c.reject({
  33970. error: 'Failed parsing JSON'
  33971. })
  33972. }
  33973. else if ('image/jpeg' === t) {
  33974. var n = new Uint8Array(e.response),
  33975. r = new Blob([n], {
  33976. type: 'image/jpeg'
  33977. }),
  33978. o = URL.createObjectURL(r)
  33979. ;(i = new Image()),
  33980. (i.src = o),
  33981. (i.crossOrigin = 'Anonymous'),
  33982. (i.onload = function () {
  33983. URL.revokeObjectURL(o)
  33984. })
  33985. }
  33986. return i
  33987. }
  33988. var s = n(e, t, !1)
  33989. if (
  33990. ((i = i || {}),
  33991. (i.retries = void 0 !== i.retries ? i.retries : 0),
  33992. (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()),
  33993. i.responseType)
  33994. )
  33995. if (['arraybuffer', 'text', 'json'].indexOf(i.responseType) > -1)
  33996. s.responseType = i.responseType
  33997. else {
  33998. if ('image/jpeg' !== i.responseType)
  33999. throw new Error(
  34000. 'reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"'
  34001. )
  34002. s.responseType = 'arraybuffer'
  34003. }
  34004. if (
  34005. ('json' === i.responseType && s.setRequestHeader('Accept', 'application/json'),
  34006. i.auth && s.setRequestHeader('Authorization', i.auth),
  34007. 'object' == typeof i.data &&
  34008. ((i.data = JSON.stringify(i.data)),
  34009. s.setRequestHeader('Content-Type', 'application/json')),
  34010. 'object' == typeof i.headers)
  34011. )
  34012. for (var l in i.headers) s.setRequestHeader(l, i.headers[l])
  34013. var c = $.Deferred()
  34014. return (
  34015. (s.onreadystatechange = function (e) {
  34016. if (4 === this.readyState)
  34017. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  34018. i.retries++, setTimeout(o, 1e3)
  34019. else if (200 === this.status) {
  34020. var t = a(this, i.responseType)
  34021. c.resolve(t)
  34022. } else c.reject(this)
  34023. }),
  34024. (s.onprogress = function (e) {
  34025. c.notify(e)
  34026. }),
  34027. s.send(i.data),
  34028. c.promise()
  34029. )
  34030. }
  34031. function o(e) {
  34032. return Object.keys(e)
  34033. .sort()
  34034. .map(function (t) {
  34035. return {
  34036. key: t,
  34037. value: e[t]
  34038. }
  34039. })
  34040. }
  34041. function a(e, t) {
  34042. var i = t.responseType || null,
  34043. n = t.auth || null,
  34044. r = t.prefetchFrom || null,
  34045. a = e + '__' + i + '__' + n + '__' + r
  34046. return (
  34047. t.headers &&
  34048. o(t.headers).forEach(function (e) {
  34049. a += '__' + e.key + ':' + e.value
  34050. }),
  34051. a
  34052. )
  34053. }
  34054. function s(e, t) {
  34055. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  34056. }
  34057. function l(e, t, i) {
  34058. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  34059. }
  34060. var c = e('./logger'),
  34061. h = e('../ab'),
  34062. u = new c(i)
  34063. ;(window.URL = window.URL || window.webkitURL),
  34064. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  34065. (window.DATA = window.DATA || {}),
  34066. /* setTimeout(function() {//MP-- xzw delete
  34067. window.MP_REQUEST_CACHE = null,
  34068. window.DATA = {}
  34069. }, 6e4),
  34070. window.onpageshow = function(e) {
  34071. e.persisted && (window.MP_REQUEST_CACHE = null,
  34072. window.DATA = {})
  34073. } */
  34074. (t.exports = {
  34075. get: function (e, t) {
  34076. t = t || {}
  34077. var i = void 0 === t.cache || t.cache
  34078. if (i) {
  34079. var n = s(e, t)
  34080. if (n) return n
  34081. }
  34082. var o
  34083. return (
  34084. (o =
  34085. t.prefetchFrom && window.DATA[t.prefetchFrom]
  34086. ? $.when(window.DATA[t.prefetchFrom])
  34087. : r('GET', e, t)),
  34088. i && l(e, t, o),
  34089. o
  34090. )
  34091. },
  34092. post: function (e, t) {
  34093. return r('POST', e, t)
  34094. },
  34095. patch: function (e, t) {
  34096. return r('PATCH', e, t)
  34097. },
  34098. getImage: function (e, t) {
  34099. function i() {
  34100. u.warn('Retrying ', e),
  34101. o
  34102. .getImage(e, t - 1)
  34103. .done(n.resolve.bind(n))
  34104. .progress(n.notify.bind(n))
  34105. .fail(n.reject.bind(n))
  34106. }
  34107. var n = $.Deferred(),
  34108. r = new Image(),
  34109. o = this
  34110. return (
  34111. (e = h.changeIfImageOptimzing(e)),
  34112. (null !== t && void 0 !== t) || (t = 3),
  34113. (r.onerror = function () {
  34114. t > 0 ? setTimeout(i, 1e3) : n.reject()
  34115. }),
  34116. (r.onload = function () {
  34117. n.resolve(r)
  34118. }),
  34119. (r.crossOrigin = 'anonymous'),
  34120. (r.src = e),
  34121. n
  34122. )
  34123. }
  34124. })
  34125. }).call(this, '/js/util/ajax.js')
  34126. },
  34127. {
  34128. '../ab': 3,
  34129. './logger': 189
  34130. }
  34131. ],
  34132. 182: [
  34133. function (e, t, i) {
  34134. 'use strict'
  34135. function n(e, t) {
  34136. var i = window.navigator.userAgent,
  34137. n = i.match(e)
  34138. return (
  34139. (n = n ? n[1].split(t) : []),
  34140. {
  34141. major: parseInt(n[0]) || 0,
  34142. minor: parseInt(n[1]) || 0,
  34143. patch: parseInt(n[2]) || 0
  34144. }
  34145. )
  34146. }
  34147. var r = e('../exception/DeviceMismatchException')
  34148. t.exports = {
  34149. supportsFullscreen: function () {
  34150. return (
  34151. document.fullscreenEnabled ||
  34152. document.mozFullscreenEnabled ||
  34153. document.mozFullScreenEnabled ||
  34154. document.webkitFullscreenEnabled ||
  34155. document.msFullscreenEnabled
  34156. )
  34157. },
  34158. isPointerLocked: function () {
  34159. return (
  34160. document.pointerLockElement ||
  34161. document.mozPointerLockElement ||
  34162. document.webkitPointerLockElement
  34163. )
  34164. },
  34165. requestFullscreen: function (e, t) {
  34166. e.requestFullscreen
  34167. ? e.requestFullscreen()
  34168. : e.mozRequestFullScreen
  34169. ? e.mozRequestFullScreen()
  34170. : e.webkitRequestFullscreen
  34171. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  34172. : e.msRequestFullscreen && e.msRequestFullscreen(),
  34173. t &&
  34174. $(document).on(
  34175. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34176. browser.requestPointerLock
  34177. )
  34178. },
  34179. requestPointerLock: function () {
  34180. var e
  34181. if (document.fullscreenElement) e = document.fullscreenElement()
  34182. else if (document.mozFullscreenElement) e = document.mozFullscreenElement()
  34183. else if (document.mozFullScreenElement) e = document.mozFullScreenElement()
  34184. else {
  34185. if (!document.webkitFullscreenElement) return
  34186. e = document.webkitFullscreenElement()
  34187. }
  34188. ;(e.requestPointerLock =
  34189. e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  34190. e.requestPointerLock(),
  34191. $(document).off(
  34192. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34193. this
  34194. )
  34195. },
  34196. exitPointerLock: function () {
  34197. ;(document.exitPointerLock =
  34198. document.exitPointerLock ||
  34199. document.mozExitPointerLock ||
  34200. document.webkitExitPointerLock),
  34201. document.exitPointerLock()
  34202. },
  34203. exitFullscreen: function () {
  34204. document.exitFullscreen
  34205. ? document.exitFullscreen()
  34206. : document.msExitFullscreen
  34207. ? document.msExitFullscreen()
  34208. : document.mozCancelFullScreen
  34209. ? document.mozCancelFullScreen()
  34210. : document.webkitExitFullscreen && document.webkitExitFullscreen()
  34211. },
  34212. details: function () {
  34213. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)')
  34214. return e
  34215. ? {
  34216. name: e[1],
  34217. version: parseInt(e[2]),
  34218. platform: navigator.platform
  34219. }
  34220. : {}
  34221. },
  34222. is: function (e) {
  34223. return this.details() && this.details().name === e
  34224. },
  34225. inIframe: function () {
  34226. return window.parent !== window
  34227. },
  34228. aspectRatio: function () {
  34229. var e = $('#player').width() / $('#player').height()
  34230. return isFinite(e) ? e : 0
  34231. },
  34232. userAgent: function () {
  34233. return window.navigator.userAgent
  34234. },
  34235. isLandscape: function () {
  34236. return this.isMobile && this.aspectRatio() > 1
  34237. },
  34238. isSmallScreen: function () {
  34239. var e = screen.width / window.devicePixelRatio
  34240. return e < 240
  34241. },
  34242. detectIE: function () {
  34243. var e = window.navigator.userAgent,
  34244. t = e.indexOf('MSIE ')
  34245. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  34246. },
  34247. detectSafari: function () {
  34248. var e = window.navigator.userAgent,
  34249. t = e.indexOf('Safari')
  34250. return t !== -1 && !this.detectChrome()
  34251. },
  34252. detectFirefox: function () {
  34253. var e = window.navigator.userAgent
  34254. return e.indexOf('Firefox') !== -1
  34255. },
  34256. detectChrome: function () {
  34257. var e = window.navigator.userAgent
  34258. return e.indexOf('Chrome') !== -1 && !this.detectOpera()
  34259. },
  34260. detectOpera: function () {
  34261. var e = window.navigator.userAgent
  34262. return e.indexOf('OPR') !== -1
  34263. },
  34264. detectIOS: function () {
  34265. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  34266. },
  34267. detectIPad: function () {
  34268. var e = window.navigator.userAgent,
  34269. t = /iPad/
  34270. return t.test(e)
  34271. },
  34272. detectIPod: function () {
  34273. var e = window.navigator.userAgent,
  34274. t = /iPod/
  34275. return t.test(e)
  34276. },
  34277. detectIPhone: function () {
  34278. var e = window.navigator.userAgent,
  34279. t = /iPhone/
  34280. return t.test(e)
  34281. },
  34282. detectAndroid: function () {
  34283. var e = window.navigator.userAgent
  34284. return e.indexOf('Android') !== -1
  34285. },
  34286. detectAndroidMobile: function () {
  34287. var e = window.navigator.userAgent
  34288. return this.detectAndroid() && e.indexOf('Mobile') !== -1
  34289. },
  34290. detectSamsungNative: function () {
  34291. var e = window.navigator.userAgent
  34292. return (
  34293. e.indexOf('SM-G900H') !== -1 ||
  34294. e.indexOf('GT-I9500') !== -1 ||
  34295. e.indexOf('SM-N900') !== -1
  34296. )
  34297. },
  34298. detectSamsungS6: function () {
  34299. var e = window.navigator.userAgent
  34300. return e.indexOf('SM-G92') !== -1
  34301. },
  34302. /************************************************************fyz改from徐世廷*************************************************************/
  34303. detectHUAWEI5X: function () {
  34304. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  34305. },
  34306. /*******************************************************************************************************************************/
  34307. detectWebVR: function () {
  34308. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  34309. },
  34310. getVRDisplay: function () {
  34311. var e = $.Deferred()
  34312. return this.detectWebVR()
  34313. ? (navigator.getVRDisplays().then(function (t) {
  34314. t.length >= 1 && e.resolve(t[0]), e.reject(null)
  34315. }),
  34316. e)
  34317. : e.reject(null)
  34318. },
  34319. iosVersion: function () {
  34320. if (!this.detectIOS()) throw new r('Did not detect an iDevice')
  34321. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  34322. t = '_'
  34323. return n(e, t)
  34324. },
  34325. androidVersion: function () {
  34326. if (!this.detectAndroid()) throw new r('Did not detect an Android based device')
  34327. var e = /Android ((?:\d+\.?){1,3})/,
  34328. t = '.'
  34329. return n(e, t)
  34330. },
  34331. valueFromCookie: function (e, t) {
  34332. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie)
  34333. if (!i) return t
  34334. var n = i[1]
  34335. return 'boolean' == typeof t
  34336. ? 'true' === n || '1' === n
  34337. : 'number' == typeof t
  34338. ? parseFloat(n)
  34339. : n
  34340. }
  34341. }
  34342. Object.assign(window.browser, t.exports)
  34343. t.exports = window.browser
  34344. changeLog()
  34345. },
  34346. {
  34347. '../exception/DeviceMismatchException': 56
  34348. }
  34349. ],
  34350. 183: [
  34351. function (e, t, i) {
  34352. ;(function (i) {
  34353. 'use strict'
  34354. function n(e, t) {
  34355. var i = r(t)
  34356. var replaceAll = function (str, f, e) {
  34357. //f全部替换成e
  34358. var reg = new RegExp(f, 'g') //创建正则RegExp对象
  34359. return str.replace(reg, e)
  34360. }
  34361. var urlFirstView = c.valueFromHash('firstView')
  34362. if (urlFirstView) {
  34363. //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.015155019941222028,0.3253822291629593,0.005215708110435864,0.945446737862511&qs=1
  34364. try {
  34365. urlFirstView = replaceAll(urlFirstView, 'pano:', '"pano":"')
  34366. if (urlFirstView.includes('qua')) {
  34367. urlFirstView = replaceAll(urlFirstView, ',qua:', '","qua":[')
  34368. urlFirstView += ']'
  34369. } else {
  34370. urlFirstView += '"'
  34371. }
  34372. urlFirstView = '{' + urlFirstView + '}'
  34373. let info = JSON.parse(urlFirstView)
  34374. i.pano = t.index[info.pano] //panos.get(info.pano)
  34375. if (!i.pano) {
  34376. urlFirstView = false
  34377. console.error('检测到firstView但是 找不到该pano')
  34378. } else {
  34379. if (info.qua) {
  34380. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  34381. } else {
  34382. i.quaternion = new THREE.Quaternion()
  34383. }
  34384. i.zoom = -1
  34385. i.mode = 'panorama'
  34386. i.setByUrl = true
  34387. }
  34388. } catch (e) {
  34389. urlFirstView = false
  34390. console.error('检测到firstView但是解析出错' + e)
  34391. }
  34392. }
  34393. if (Object.keys(i).length > 0) return i
  34394. if (e.heroImage) i = o(e, t)
  34395. else if (window.DATA.camera_start) {
  34396. var n = window.DATA.camera_start
  34397. try {
  34398. Object.keys(n).length > 0 &&
  34399. !l.isEmptyQuaternion(n.camera.quaternion) &&
  34400. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  34401. (i.position = n.camera.position),
  34402. //i.quaternion = n.camera.quaternion,
  34403. (i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion)), //xzw
  34404. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  34405. n.pano &&
  34406. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  34407. d.debug('Using camera_start'),
  34408. d.debug('Modeldata pano: ', i.pano.quaternion),
  34409. d.debug('Camera start pano: ', n.pano.quaternion)),
  34410. i.mode !== h.PANORAMA &&
  34411. (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  34412. } catch (e) {
  34413. d.warn(e.message)
  34414. if (i.mode == 'panorama' && !i.pano) i.pano = t.list[0]
  34415. }
  34416. }
  34417. if (
  34418. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  34419. i.mode === h.MESH &&
  34420. i.position &&
  34421. ((i.mode = h.PANORAMA),
  34422. (i.pano = t.findClosest(i.position)),
  34423. (i.quaternion = i.pano.quaternion)),
  34424. 0 === Object.keys(i).length)
  34425. ) {
  34426. var a = t.list[0]
  34427. a &&
  34428. ((i.mode = h.PANORAMA),
  34429. (i.pano = a),
  34430. (i.position = a.position),
  34431. (i.quaternion = a.quaternion),
  34432. d.info('Starting at 1st pano ' + a.id))
  34433. }
  34434. return (i.mode = i.mode || h.DOLLHOUSE), i
  34435. }
  34436. function r(e) {
  34437. var t = c.valueFromHash('start', ''),
  34438. i = {}
  34439. if ('' !== t) {
  34440. d.debug('Start override found in parameters, trying to parse...'), (i = a(t) || {})
  34441. var n = c.valueFromHash('tag', null)
  34442. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId))
  34443. }
  34444. return i
  34445. }
  34446. function o(e, t) {
  34447. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {}
  34448. var i = {},
  34449. n = e.heroImage.metadata
  34450. d.debug('Using start position from thumbnail image'),
  34451. (i.position = n.camera_position),
  34452. (i.quaternion = n.camera_quaternion)
  34453. try {
  34454. ;(i.mode = h.convertWorkshopModeInt(n.camera_mode)),
  34455. i.mode === h.PANORAMA
  34456. ? (i.pano = t.get(n.scan_id))
  34457. : (i.floorVisibility = n.floor_visibility)
  34458. } catch (e) {
  34459. d.debug(e.message)
  34460. }
  34461. return i
  34462. }
  34463. function a(e) {
  34464. return s.deserialize(e)
  34465. }
  34466. var s = e('../controls/serializer'),
  34467. l = e('../util/math'),
  34468. c = e('./browser'),
  34469. h = e('../enum/Viewmode'),
  34470. u = e('../util/logger'),
  34471. th = e('three'), //xzw
  34472. d = new u(i)
  34473. t.exports = {
  34474. getStartCameraOptions: n
  34475. }
  34476. }).call(this, '/js/util/camera.js')
  34477. },
  34478. {
  34479. '../controls/serializer': 14,
  34480. '../enum/Viewmode': 51,
  34481. '../util/logger': 189,
  34482. '../util/math': 190,
  34483. './browser': 182,
  34484. three: 217
  34485. }
  34486. ],
  34487. 184: [
  34488. function (e, t, i) {
  34489. 'use strict'
  34490. function n(e, t, i) {
  34491. return o(e.fov, t, i)
  34492. }
  34493. var r = e('./MathLight'),
  34494. o = function (e, t, i) {
  34495. var n = t,
  34496. o = i,
  34497. a =
  34498. 2 *
  34499. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) *
  34500. r.DEGREES_PER_RADIAN
  34501. return a
  34502. },
  34503. a = function (e, t, i) {
  34504. var n = t,
  34505. o = i,
  34506. a =
  34507. 2 *
  34508. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) *
  34509. r.DEGREES_PER_RADIAN
  34510. return a
  34511. },
  34512. s = function (e, t, i, n) {
  34513. var r = o(e, i, n)
  34514. return r > t ? a(t, i, n) : e
  34515. }
  34516. t.exports = {
  34517. clampVFOV: s,
  34518. getHFOVForCamera: n,
  34519. getHFOVFromVFOV: o,
  34520. getVFOVFromHFOV: a
  34521. }
  34522. window.MathLight = t.exports
  34523. MathLight.closeTo = function (e1, e2, precision) {
  34524. //xzw add 判断e1,e2是否接近
  34525. var prec = Math.pow(10, -(precision || 4))
  34526. var s1 =
  34527. Math.abs(e1.x - e2.x) < prec &&
  34528. Math.abs(e1.y - e2.y) < prec &&
  34529. Math.abs(e1.z - e2.z) < prec
  34530. if (e1.w) {
  34531. return s1 && Math.abs(e1.w - e2.w) < prec
  34532. } else return s1
  34533. }
  34534. },
  34535. {
  34536. './MathLight': 176
  34537. }
  34538. ],
  34539. 185: [
  34540. function (e, t, i) {
  34541. 'use strict'
  34542. var n = e('three')
  34543. ;(t.exports = {
  34544. delayOneFrame: function (e) {
  34545. window.setTimeout(e, 1)
  34546. },
  34547. normalizeUrl: function (e) {
  34548. return e.replace('https://', 'http://')
  34549. },
  34550. domainFromUrl: function (e) {
  34551. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e)
  34552. return t ? t[3] : e
  34553. },
  34554. average: function (e, t) {
  34555. if (0 === e.length) return null
  34556. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  34557. var o = t ? e[r][t] : e[r]
  34558. ;(i += o), n++
  34559. }
  34560. return i / n
  34561. },
  34562. countUnique: function (e) {
  34563. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0)
  34564. return Object.keys(t).length
  34565. },
  34566. averageVectors: function (e, t) {
  34567. var i = new n.Vector3()
  34568. if (0 === e.length) return i
  34569. for (var r = 0, o = 0; o < e.length; o++) {
  34570. var a = t ? e[o][t] : e[o]
  34571. i.add(a), r++
  34572. }
  34573. return i.divideScalar(r)
  34574. },
  34575. equalLists: function (e, t) {
  34576. if (e.length !== t.length) return !1
  34577. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1
  34578. return !0
  34579. },
  34580. lowerMedian: function (e, t) {
  34581. if (0 === e.length) return null
  34582. ;(t = t || 2),
  34583. e.sort(function (e, t) {
  34584. return e - t
  34585. })
  34586. var i = Math.floor(e.length / t)
  34587. return e[i]
  34588. },
  34589. stableSort: function (e, t) {
  34590. return e
  34591. .map(function (e, t) {
  34592. return {
  34593. value: e,
  34594. index: t
  34595. }
  34596. })
  34597. .sort(function (e, i) {
  34598. var n = t(e.value, i.value)
  34599. return 0 !== n ? n : e.index - i.index
  34600. })
  34601. .map(function (e) {
  34602. return e.value
  34603. })
  34604. },
  34605. filterAll: function (e, t) {
  34606. return e.filter(function (e) {
  34607. return t.every(function (t) {
  34608. return t(e)
  34609. })
  34610. })
  34611. },
  34612. formatDate: function (e) {
  34613. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-')
  34614. },
  34615. formatDatetime: function (e) {
  34616. return [
  34617. e.getFullYear(),
  34618. e.getMonth() + 1,
  34619. e.getDate(),
  34620. e.getHours(),
  34621. e.getMinutes()
  34622. ].join('-')
  34623. },
  34624. randomString: function (e) {
  34625. for (
  34626. var t = '',
  34627. i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
  34628. n = 0;
  34629. n < e;
  34630. n++
  34631. )
  34632. t += i.charAt(Math.floor(Math.random() * i.length))
  34633. return t
  34634. },
  34635. uint8ToBase64: function (e, t) {
  34636. ;(t && 'number' == typeof t) || (t = 8192)
  34637. for (var i = [], n = 0; n < e.length; n += t)
  34638. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)))
  34639. return btoa(i.join(''))
  34640. },
  34641. uuid4: function e(t) {
  34642. return t
  34643. ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16)
  34644. : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  34645. },
  34646. nth: function (e) {
  34647. return (
  34648. (e %= 10), 1 === e ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  34649. )
  34650. },
  34651. extendObject: function (e, t) {
  34652. return (
  34653. Object.keys(t).forEach(function (i) {
  34654. e[i] = t[i]
  34655. }),
  34656. e
  34657. )
  34658. },
  34659. deepExtend: function e(t) {
  34660. t = t || {}
  34661. for (var i = 1; i < arguments.length; i++) {
  34662. var n = arguments[i]
  34663. if (n)
  34664. for (var r in n)
  34665. n.hasOwnProperty(r) &&
  34666. ('object' == typeof n[r] ? (t[r] = e(t[r], n[r])) : (t[r] = n[r]))
  34667. }
  34668. return t
  34669. },
  34670. inherit: function (e, t) {
  34671. ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e)
  34672. },
  34673. extend: function (e, t) {
  34674. for (var i in t.prototype) e.prototype[i] = t.prototype[i]
  34675. },
  34676. getFileNameFromUrl: function (url) {
  34677. return url.split('/').pop()
  34678. }
  34679. }),
  34680. (Math.sign = function (e) {
  34681. return e < 0 ? -1 : 1
  34682. })
  34683. window.common = t.exports
  34684. expandCommon(common)
  34685. },
  34686. {
  34687. three: 217
  34688. }
  34689. ],
  34690. 186: [
  34691. function (e, t, i) {
  34692. 'use strict'
  34693. var n = {}
  34694. ;(n.linearTween = function (e, t, i, n) {
  34695. return (i * e) / n + t
  34696. }),
  34697. (n.easeInQuad = function (e, t, i, n) {
  34698. return (e /= n), i * e * e + t
  34699. }),
  34700. (n.easeOutQuad = function (e, t, i, n) {
  34701. return (e /= n), -i * e * (e - 2) + t
  34702. }),
  34703. (n.easeInOutQuad = function (e, t, i, n) {
  34704. return (
  34705. (e /= n / 2), e < 1 ? (i / 2) * e * e + t : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  34706. )
  34707. }),
  34708. (n.easeInCubic = function (e, t, i, n) {
  34709. return (e /= n), i * e * e * e + t
  34710. }),
  34711. (n.easeOutCubic = function (e, t, i, n) {
  34712. return (e /= n), e--, i * (e * e * e + 1) + t
  34713. }),
  34714. (n.easeInOutCubic = function (e, t, i, n) {
  34715. return (
  34716. (e /= n / 2),
  34717. e < 1 ? (i / 2) * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  34718. )
  34719. }),
  34720. (n.easeInQuart = function (e, t, i, n) {
  34721. return (e /= n), i * e * e * e * e + t
  34722. }),
  34723. (n.easeOutQuart = function (e, t, i, n) {
  34724. return (e /= n), e--, -i * (e * e * e * e - 1) + t
  34725. }),
  34726. (n.easeInOutQuart = function (e, t, i, n) {
  34727. return (
  34728. (e /= n / 2),
  34729. e < 1 ? (i / 2) * e * e * e * e + t : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  34730. )
  34731. }),
  34732. (n.easeInQuint = function (e, t, i, n) {
  34733. return (e /= n), i * e * e * e * e * e + t
  34734. }),
  34735. (n.easeOutQuint = function (e, t, i, n) {
  34736. return (e /= n), e--, i * (e * e * e * e * e + 1) + t
  34737. }),
  34738. (n.easeInOutQuint = function (e, t, i, n) {
  34739. return (
  34740. (e /= n / 2),
  34741. e < 1
  34742. ? (i / 2) * e * e * e * e * e + t
  34743. : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  34744. )
  34745. }),
  34746. (n.easeInSine = function (e, t, i, n) {
  34747. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t
  34748. }),
  34749. (n.easeOutSine = function (e, t, i, n) {
  34750. return i * Math.sin((e / n) * (Math.PI / 2)) + t
  34751. }),
  34752. (n.easeInOutSine = function (e, t, i, n) {
  34753. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t
  34754. }),
  34755. (n.easeInExpo = function (e, t, i, n) {
  34756. return i * Math.pow(2, 10 * (e / n - 1)) + t
  34757. }),
  34758. (n.easeOutExpo = function (e, t, i, n) {
  34759. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t
  34760. }),
  34761. (n.easeInOutExpo = function (e, t, i, n) {
  34762. return (
  34763. (e /= n / 2),
  34764. e < 1
  34765. ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t
  34766. : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  34767. )
  34768. }),
  34769. (n.easeInCirc = function (e, t, i, n) {
  34770. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t
  34771. }),
  34772. (n.easeOutCirc = function (e, t, i, n) {
  34773. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t
  34774. }),
  34775. (n.easeInOutCirc = function (e, t, i, n) {
  34776. return (
  34777. (e /= n / 2),
  34778. e < 1
  34779. ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t
  34780. : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  34781. )
  34782. }),
  34783. (n.easeInElastic = function (e, t, i, n) {
  34784. var r = 1.70158,
  34785. o = 0,
  34786. a = i
  34787. return 0 === e
  34788. ? t
  34789. : 1 === (e /= n)
  34790. ? t + i
  34791. : (o || (o = 0.3 * n),
  34792. a < Math.abs(i)
  34793. ? ((a = i), (r = o / 4))
  34794. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34795. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) + t)
  34796. }),
  34797. (n.easeOutElastic = function (e, t, i, n) {
  34798. var r = 1.70158,
  34799. o = 0,
  34800. a = i
  34801. return 0 === e
  34802. ? t
  34803. : 1 === (e /= n)
  34804. ? t + i
  34805. : (o || (o = 0.3 * n),
  34806. a < Math.abs(i)
  34807. ? ((a = i), (r = o / 4))
  34808. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34809. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t)
  34810. }),
  34811. (n.easeInOutElastic = function (e, t, i, n) {
  34812. var r = 1.70158,
  34813. o = 0,
  34814. a = i
  34815. return 0 === e
  34816. ? t
  34817. : 2 === (e /= n / 2)
  34818. ? t + i
  34819. : (o || (o = n * (0.3 * 1.5)),
  34820. a < Math.abs(i)
  34821. ? ((a = i), (r = o / 4))
  34822. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34823. e < 1
  34824. ? -0.5 *
  34825. (a *
  34826. Math.pow(2, 10 * (e -= 1)) *
  34827. Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  34828. t
  34829. : a *
  34830. Math.pow(2, -10 * (e -= 1)) *
  34831. Math.sin(((e * n - r) * (2 * Math.PI)) / o) *
  34832. 0.5 +
  34833. i +
  34834. t)
  34835. }),
  34836. (n.easeInBack = function (e, t, i, n, r) {
  34837. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t
  34838. }),
  34839. (n.easeOutBack = function (e, t, i, n, r) {
  34840. return (
  34841. void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  34842. )
  34843. }),
  34844. (n.easeInOutBack = function (e, t, i, n, r) {
  34845. return (
  34846. void 0 === r && (r = 1.70158),
  34847. (e /= n / 2) < 1
  34848. ? (i / 2) * (e * e * (((r *= 1.525) + 1) * e - r)) + t
  34849. : (i / 2) * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  34850. )
  34851. }),
  34852. (n.easeOutBounce = function (e, t, i, n) {
  34853. return (e /= n) < 1 / 2.75
  34854. ? i * (7.5625 * e * e) + t
  34855. : e < 2 / 2.75
  34856. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  34857. : e < 2.5 / 2.75
  34858. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  34859. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t
  34860. }),
  34861. (n.easeInBounce = function (e, t, i, r) {
  34862. return i - n.easeOutBounce(r - e, 0, i, r) + t
  34863. }),
  34864. (n.easeInOutBounce = function (e, t, i, r) {
  34865. return e < r / 2
  34866. ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t
  34867. : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t
  34868. }),
  34869. (t.exports = n)
  34870. window.easing = n
  34871. },
  34872. {}
  34873. ],
  34874. 187: [
  34875. function (e, t, i) {
  34876. 'use strict'
  34877. function n() {
  34878. ;(this.events = []), (this.valid = !1)
  34879. }
  34880. var r = e('../enum/Joystick')
  34881. ;(n.prototype.push = function (e, t) {
  34882. this.events.push({
  34883. direction: e,
  34884. pano: t
  34885. }),
  34886. (this.valid = !0)
  34887. }),
  34888. (n.prototype.pop = function (e) {
  34889. var t = this.events.pop()
  34890. return this.events.length < 1 && (this.valid = !1), t
  34891. }),
  34892. (n.prototype.peek = function () {
  34893. return this.events.length
  34894. ? this.events[this.events.length - 1]
  34895. : {
  34896. direction: null,
  34897. pano: null
  34898. }
  34899. }),
  34900. (n.prototype.invalidate = function () {
  34901. ;(this.events = []), (this.valid = !1)
  34902. }),
  34903. (n.prototype.reversePano = function (e) {
  34904. if (!this.valid) return null
  34905. var t = this.peek()
  34906. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null
  34907. }),
  34908. (t.exports = n)
  34909. },
  34910. {
  34911. '../enum/Joystick': 29
  34912. }
  34913. ],
  34914. 188: [
  34915. function (e, t, i) {
  34916. 'use strict'
  34917. window.lerp = t.exports = {
  34918. vector: function (e, t) {
  34919. var i = e.clone()
  34920. return (
  34921. (t = t.clone()),
  34922. function (n) {
  34923. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  34924. }
  34925. )
  34926. },
  34927. quaternion: function (e, t) {
  34928. var i = e.clone()
  34929. return function (n) {
  34930. e.copy(i).slerp(t, n)
  34931. }
  34932. },
  34933. property: function (e, t, i, n) {
  34934. var r = e[t]
  34935. return function (o) {
  34936. ;(e[t] = r * (1 - o) + i * o), n && n(e[t])
  34937. }
  34938. },
  34939. uniform: function (e, t, i) {
  34940. var n = e.material.uniforms[t].value
  34941. return function (r) {
  34942. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  34943. }
  34944. },
  34945. matrix4: function (e, t) {
  34946. var i = e.clone()
  34947. return function (n) {
  34948. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  34949. r[s] = o[s] * (1 - n) + a[s] * n
  34950. }
  34951. },
  34952. allUniforms: function (e, t, i) {
  34953. var n = e.map(
  34954. function (e) {
  34955. return this.uniform(e, t, i)
  34956. }.bind(this)
  34957. )
  34958. return function (e) {
  34959. n.forEach(function (t) {
  34960. t(e)
  34961. })
  34962. }
  34963. }
  34964. }
  34965. },
  34966. {}
  34967. ],
  34968. 189: [
  34969. function (e, t, i) {
  34970. 'use strict'
  34971. function n(e) {
  34972. var t,
  34973. i,
  34974. o,
  34975. a,
  34976. s = e.split('/'),
  34977. l = '[' + s[s.length - 1].replace('.js', '') + ']',
  34978. c = {}
  34979. if (n.consoleEnabled) {
  34980. var h = function (e) {
  34981. $('#debug-console').append('<p>' + e + '</p>'),
  34982. ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight)
  34983. }
  34984. ;(t = function (e) {
  34985. h(Array.prototype.slice.call(arguments).join(' '))
  34986. }),
  34987. (i = function (e) {
  34988. h(Array.prototype.slice.call(arguments).join(' '))
  34989. }),
  34990. (o = function (e) {
  34991. h('WARN: ' + Array.prototype.slice.call(arguments).join(' '))
  34992. }),
  34993. (a = function (e) {
  34994. h('ERROR: ' + Array.prototype.slice.call(arguments).join(' '))
  34995. })
  34996. } else
  34997. console.log
  34998. ? ((t = console.log),
  34999. (i = console.info ? console.info : console.log),
  35000. (o = console.warn ? console.warn : console.log),
  35001. (a = console.error ? console.error : console.log))
  35002. : (t = i = o = a = function () {})
  35003. var u = function (e) {
  35004. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  35005. },
  35006. d = function (t, i) {
  35007. if (r) {
  35008. var o = Array.prototype.slice.call(t).join(' ')
  35009. r.captureMessage(o, {
  35010. level: i,
  35011. path: e,
  35012. timestamp: n.timestamp()
  35013. })
  35014. }
  35015. },
  35016. p = function (t, i) {
  35017. if (r) {
  35018. var o = Array.prototype.slice.call(t).join(' ')
  35019. r.captureException(new Error(o), {
  35020. level: i,
  35021. path: e,
  35022. timestamp: n.timestamp()
  35023. })
  35024. }
  35025. }
  35026. return {
  35027. debug: function () {
  35028. n.level >= n.levels.debug && t.apply(console, u(arguments))
  35029. },
  35030. info: function () {
  35031. n.level >= n.levels.info && i.apply(console, u(arguments))
  35032. },
  35033. warn: function () {
  35034. d(arguments, 'warn'), n.level >= n.levels.warn && o.apply(console, u(arguments))
  35035. },
  35036. error: function () {
  35037. p(arguments, 'error'), n.level >= n.levels.error && a.apply(console, u(arguments))
  35038. },
  35039. v3str: function (e, t) {
  35040. var i = void 0 === t ? 2 : t
  35041. return (
  35042. '(' +
  35043. e.x.toPrecision(i) +
  35044. ', ' +
  35045. e.y.toPrecision(i) +
  35046. ', ' +
  35047. e.z.toPrecision(i) +
  35048. ')'
  35049. )
  35050. },
  35051. eulstr: function (e, t) {
  35052. var i = void 0 === t ? 2 : t
  35053. return (
  35054. '(' +
  35055. THREE.Math.radToDeg(e.x).toPrecision(i) +
  35056. ', ' +
  35057. THREE.Math.radToDeg(e.y).toPrecision(i) +
  35058. ', ' +
  35059. THREE.Math.radToDeg(e.z).toPrecision(i) +
  35060. ' "' +
  35061. e.order +
  35062. '")'
  35063. )
  35064. },
  35065. time: function (e) {
  35066. n.level >= n.levels.debug && (c[e] = Date.now())
  35067. },
  35068. timeEnd: function (e) {
  35069. if (n.level >= n.levels.debug) {
  35070. var t = c[e]
  35071. if (!t) return
  35072. var i = (Date.now() - t) / 1e3
  35073. this.debug(e, i + 's')
  35074. }
  35075. }
  35076. }
  35077. }
  35078. var r = window.Raven
  35079. ;(n.timestamp = function () {
  35080. return (Date.now() - window.navigationStart) / 1e3 + 's'
  35081. }),
  35082. (n.levels = {
  35083. debug: 3,
  35084. info: 2,
  35085. warn: 1,
  35086. error: 0
  35087. }),
  35088. (n.level = n.levels.info),
  35089. (t.exports = n)
  35090. },
  35091. {}
  35092. ],
  35093. 190: [
  35094. function (e, t, i) {
  35095. 'use strict'
  35096. var n = e('three'),
  35097. r = e('../enum/GLCubeFaces'),
  35098. o = e('../constants')
  35099. t.exports = {
  35100. convertVisionVector: function (e) {
  35101. return new n.Vector3(e.x, e.z, -e.y)
  35102. },
  35103. convertVisionQuaternion: function (e) {
  35104. return new n.Quaternion(e.x, e.z, -e.y, e.w).multiply(
  35105. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90))
  35106. )
  35107. },
  35108. convertWorkshopVector: function (e) {
  35109. return new n.Vector3(-e.x, e.y, e.z)
  35110. },
  35111. convertWorkshopQuaternion: function (e) {
  35112. return new n.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  35113. new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  35114. )
  35115. },
  35116. convertWorkshopPanoramaQuaternion: function (e) {
  35117. return new n.Quaternion(e.x, -e.y, -e.z, e.w)
  35118. .normalize()
  35119. .multiply(
  35120. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270))
  35121. )
  35122. },
  35123. convertWorkshopOrthoZoom: function (e) {
  35124. // xzw
  35125. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  35126. //return e;
  35127. return e === -1
  35128. ? -1
  35129. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  35130. g_snapShotHeight
  35131. },
  35132. toPrecision: function (e, t) {
  35133. //xzw change
  35134. var f = function (e, t) {
  35135. var i = Math.pow(10, t)
  35136. return Math.round(e * i) / i
  35137. }
  35138. if (e instanceof Array) {
  35139. for (var s = 0; s < e.length; s++) {
  35140. e[s] = f(e[s], t)
  35141. }
  35142. return e
  35143. } else return f(e, t)
  35144. },
  35145. isEmptyQuaternion: function (e) {
  35146. return (
  35147. 0 === Math.abs(e.x) &&
  35148. 0 === Math.abs(e.y) &&
  35149. 0 === Math.abs(e.z) &&
  35150. 0 === Math.abs(e.w)
  35151. )
  35152. },
  35153. projectPositionToCanvas: function (e, t, i) {
  35154. ;(i = i || new n.Vector3()), i.copy(e)
  35155. var r = 0.5 * $('#player').width(),
  35156. o = 0.5 * $('#player').height()
  35157. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i
  35158. },
  35159. convertScreenPositionToNDC: function (e, t, i) {
  35160. return (
  35161. (i = i || new n.Vector2()),
  35162. (i.x = (e / $('#player').width()) * 2 - 1),
  35163. (i.y = 2 * -(t / $('#player').height()) + 1),
  35164. i
  35165. )
  35166. },
  35167. constrainedTurn: function (e) {
  35168. var t = e % (2 * Math.PI)
  35169. return (t = t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t)
  35170. },
  35171. getFOVDotThreshold: function (e) {
  35172. return Math.cos(n.Math.degToRad(e / 2))
  35173. },
  35174. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  35175. switch (e) {
  35176. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  35177. i.set(1, t.y, t.x)
  35178. break
  35179. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  35180. i.set(-1, t.y, -t.x)
  35181. break
  35182. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  35183. i.set(-t.x, 1, -t.y)
  35184. break
  35185. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  35186. i.set(-t.x, -1, t.y)
  35187. break
  35188. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  35189. i.set(-t.x, t.y, 1)
  35190. break
  35191. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  35192. i.set(t.x, t.y, -1)
  35193. }
  35194. n && i.normalize()
  35195. },
  35196. //add:
  35197. getPos2d: function (point, camera, dom) {
  35198. var camera = camera
  35199. var dom = dom
  35200. var pos = point.clone().project(camera) //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  35201. var x, y
  35202. x = ((pos.x + 1) / 2) * dom.clientWidth
  35203. y = (1 - (pos.y + 1) / 2) * dom.clientHeight
  35204. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0
  35205. return {
  35206. pos: new THREE.Vector2(x, y),
  35207. vector: pos,
  35208. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  35209. inSight: inSight //在屏幕范围内可见
  35210. }
  35211. },
  35212. getDirByLonLat: function (lon, lat) {
  35213. var dir = new THREE.Vector3()
  35214. var phi = THREE.Math.degToRad(90 - lat)
  35215. var theta = THREE.Math.degToRad(lon)
  35216. dir.x = Math.sin(phi) * Math.cos(theta)
  35217. dir.y = Math.cos(phi)
  35218. dir.z = Math.sin(phi) * Math.sin(theta)
  35219. return dir.negate()
  35220. }
  35221. }
  35222. window.math = t.exports
  35223. expandMath(math)
  35224. },
  35225. {
  35226. '../constants': 8,
  35227. '../enum/GLCubeFaces': 25,
  35228. three: 217
  35229. }
  35230. ],
  35231. 191: [
  35232. function (e, t, i) {
  35233. 'use strict'
  35234. function n(e, t, i) {
  35235. return a.map(
  35236. function (n, o) {
  35237. return e.get('pan/' + i + '/' + t + '_skybox' + r(n) + '.jpg')
  35238. }.bind(this)
  35239. )
  35240. }
  35241. function r(e) {
  35242. return s[e]
  35243. }
  35244. var o = e('../enum/GLCubeFaces'),
  35245. a = [0, 1, 2, 3, 4, 5],
  35246. s = {
  35247. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  35248. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  35249. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  35250. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  35251. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  35252. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  35253. }
  35254. t.exports = {
  35255. mapFaceToCubemapFace: r,
  35256. getCubemapUrls: n
  35257. }
  35258. },
  35259. {
  35260. '../enum/GLCubeFaces': 25
  35261. }
  35262. ],
  35263. 192: [
  35264. function (e, t, i) {
  35265. 'use strict'
  35266. t.exports = {
  35267. captureErrors: function (e, t, i) {
  35268. if ('Raven' in window) {
  35269. Raven.config(e, t).install(), i && Raven.setTagsContext(i)
  35270. var n = console.warn,
  35271. r = console.error
  35272. ;(console.warn = function () {
  35273. var e = Array.prototype.slice.call(arguments)
  35274. Raven.captureMessage(e.join(' '), {
  35275. level: 'warning'
  35276. }),
  35277. n.apply(console, e)
  35278. }),
  35279. (console.error = function () {
  35280. var e = Array.prototype.slice.call(arguments)
  35281. Raven.captureException(new Error(e.join(' ')), {
  35282. level: 'error'
  35283. }),
  35284. r.apply(console, e)
  35285. })
  35286. } else console.error('Raven not found, not capturing errors.')
  35287. }
  35288. }
  35289. },
  35290. {}
  35291. ],
  35292. 193: [
  35293. function (e, t, i) {
  35294. ;(function (i) {
  35295. 'use strict'
  35296. var n = e('./browser'),
  35297. r = e('../constants'),
  35298. o = e('url'),
  35299. a = e('./logger'),
  35300. ss = e('three'),
  35301. s = new a(i),
  35302. l = {
  35303. getAuthorizationHeader: function () {
  35304. var e = n.valueFromHash('auth')
  35305. if (e) return e.replace(',', ' ')
  35306. var t = n.valueFromCookie('token')
  35307. return t ? 'Token ' + t : null
  35308. },
  35309. parseSidUrl: function (e) {
  35310. var t, i
  35311. t = g_Prefix
  35312. if (((e = e || ''), e.match(/^https?/))) {
  35313. var n = o.parse(e)
  35314. ;(t = g_Prefix), (i = e)
  35315. } else {
  35316. //xzw 原先的不能用
  35317. //t = window.location.protocol + "//" + window.location.host, //MP
  35318. t = g_Prefix
  35319. //i = t + "/api/player/models/" + e; //MP
  35320. i = t + 'data/' + e
  35321. }
  35322. return {
  35323. urlBase: t,
  35324. urlModel: i,
  35325. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  35326. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb')
  35327. }
  35328. },
  35329. getModelIDFromQueryString: function () {
  35330. return n.valueFromHash('model') || n.valueFromHash('m')
  35331. },
  35332. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  35333. e = JSON.parse(JSON.stringify(e));
  35334. var i = null;
  35335. if (e.images.forEach(function(n) {
  35336. if(!n.metadata) return;
  35337. if ("string" == typeof n.metadata)
  35338. try {
  35339. n.metadata = JSON.parse(n.metadata)
  35340. } catch (e) {
  35341. s.warn("Unable to parse image metadata"),
  35342. n.metadata = null
  35343. }
  35344. else{
  35345. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  35346. }
  35347. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  35348. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  35349. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  35350. }else{
  35351. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35352. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  35353. n.metadata.zoom = n.metadata.zoom || 1;
  35354. }
  35355. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  35356. }),
  35357. //icon初始视角的:
  35358. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  35359. var n = {};
  35360. n.pano = {
  35361. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35362. position: t.convertWorkshopVector(i.scan_position),
  35363. uuid: i.scan_id
  35364. },
  35365. n.camera = {
  35366. quaternion: i.camera_quaternion,
  35367. position: i.camera_position
  35368. },
  35369. e.startPano = n
  35370. }
  35371. return e
  35372. },
  35373. */
  35374. normalizeModeldata: function (e, t) {
  35375. //xzw 修改导览images数据
  35376. e = JSON.parse(JSON.stringify(e))
  35377. var i = null
  35378. var deal = function (n) {
  35379. if (!n.metadata) return
  35380. if ('string' == typeof n.metadata)
  35381. try {
  35382. n.metadata = JSON.parse(n.metadata)
  35383. } catch (e) {
  35384. s.warn('Unable to parse image metadata'), (n.metadata = null)
  35385. }
  35386. else {
  35387. 'object' == typeof n.metadata && s.debug('image.metadata already a JSON object')
  35388. }
  35389. if (n.metadata.camera_position instanceof Array) {
  35390. //xzw 改的格式
  35391. n.metadata.camera_position = new ss.Vector3().fromArray(
  35392. n.metadata.camera_position
  35393. )
  35394. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(
  35395. n.metadata.camera_quaternion
  35396. )
  35397. } else {
  35398. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  35399. n.metadata.camera_quaternion = new ss.Quaternion().copy(
  35400. n.metadata.camera_quaternion
  35401. )
  35402. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35403. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  35404. }
  35405. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  35406. }
  35407. //改
  35408. e.images.forEach(info => {
  35409. if (info.locations) {
  35410. info.locations.forEach(a => deal(a))
  35411. } else {
  35412. deal(info)
  35413. }
  35414. })
  35415. //icon初始视角的:
  35416. if (
  35417. i &&
  35418. i.camera_quaternion &&
  35419. i.camera_position &&
  35420. i.scan_position &&
  35421. i.scan_quaternion
  35422. ) {
  35423. var n = {}
  35424. ;(n.pano = {
  35425. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35426. position: t.convertWorkshopVector(i.scan_position),
  35427. uuid: i.scan_id
  35428. }),
  35429. (n.camera = {
  35430. quaternion: i.camera_quaternion,
  35431. position: i.camera_position
  35432. }),
  35433. (e.startPano = n)
  35434. }
  35435. return e
  35436. },
  35437. visionVersionToInt: (function () {
  35438. var e = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''))
  35439. return function (t) {
  35440. if (!t) throw new Error('Vision version is required')
  35441. var i = e.exec(t)
  35442. if (null === i) throw new Error('String is not a vision version: ' + t)
  35443. return parseInt(i[1])
  35444. }
  35445. })(),
  35446. modelDataPromisesTiles: function (e) {
  35447. var vision_version = e.vision_version || window.DATA.vision_version
  35448. if (vision_version)
  35449. try {
  35450. return (
  35451. l.visionVersionToInt(vision_version) >=
  35452. l.visionVersionToInt(r.visionTilingStartVersion)
  35453. )
  35454. } catch (t) {
  35455. s.warn('Invalid vision version: ' + vision_version)
  35456. }
  35457. // var t = e.created ? new Date(e.created) : null;
  35458. // return t && t >= r.visionTilingStartDate
  35459. return false
  35460. }
  35461. }
  35462. t.exports = l
  35463. }).call(this, '/js/util/showcase.js')
  35464. },
  35465. {
  35466. '../constants': 8,
  35467. './browser': 182,
  35468. './logger': 189,
  35469. three: 217,
  35470. url: 208
  35471. }
  35472. ],
  35473. 194: [
  35474. function (e, t, i) {
  35475. 'use strict'
  35476. var n = e('../util/ajax'),
  35477. r = e('three'),
  35478. o = e('../settings'),
  35479. a = {}
  35480. t.exports = {
  35481. load: function (e, t, i) {
  35482. var s = a[e]
  35483. return s
  35484. ? (t &&
  35485. setTimeout(function () {
  35486. t(s)
  35487. }, 1),
  35488. s)
  35489. : ((s = new r.Texture()),
  35490. o.minimalMemoryMode &&
  35491. ((s.minFilter = r.LinearFilter),
  35492. (s.magFilter = r.LinearFilter),
  35493. (s.generateMipmaps = !1)),
  35494. (s.sourceFile = e),
  35495. (a[e] = s),
  35496. n
  35497. .getImage(e)
  35498. .then(function (e) {
  35499. ;(s.image = e), (s.needsUpdate = !0), t && t(s)
  35500. })
  35501. .fail(i),
  35502. s)
  35503. },
  35504. loadBase64: function (e, t) {
  35505. t = t || 'png'
  35506. var i = new r.Texture()
  35507. return (
  35508. (i.image = document.createElement('img')),
  35509. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  35510. o.minimalMemoryMode &&
  35511. ((i.minFilter = r.LinearFilter),
  35512. (i.magFilter = r.LinearFilter),
  35513. (i.generateMipmaps = !1)),
  35514. (i.needsUpdate = !0),
  35515. i
  35516. )
  35517. },
  35518. isLoaded: function (e) {
  35519. return !!a[e]
  35520. }
  35521. }
  35522. window.Texture = t.exports
  35523. },
  35524. {
  35525. '../settings': 166,
  35526. '../util/ajax': 181,
  35527. three: 217
  35528. }
  35529. ],
  35530. 195: [
  35531. function (e, t, i) {
  35532. 'use strict'
  35533. var n = e('./easing')
  35534. window.transitions = t.exports = {
  35535. globalDone: null,
  35536. funcs: [],
  35537. counter: 0,
  35538. uniqueID: 0,
  35539. start: function (e, t, i, r, o, a, s) {
  35540. return (
  35541. (r = r || 0),
  35542. this.funcs.push({
  35543. func: e,
  35544. current: -r * Math.abs(t),
  35545. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  35546. done: i,
  35547. easing: o || n.linearTween,
  35548. cycling: t < 0,
  35549. running: !0,
  35550. debug: r < 0,
  35551. name: a || 'T' + this.counter,
  35552. id: void 0 === s ? this.counter : s,
  35553. paused: !1
  35554. }),
  35555. e(0, 16),
  35556. (this.counter += 1),
  35557. e
  35558. )
  35559. },
  35560. trigger: function (e) {
  35561. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  35562. i = e.func || function () {},
  35563. r = void 0 === e.duration ? 0 : e.duration
  35564. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r))
  35565. var o = e.done || null,
  35566. a = e.easing || n.linearTween,
  35567. s = e.name || 'R' + this.counter,
  35568. l = void 0 === e.id ? this.counter : e.id
  35569. return this.start(i, r, o, t, a, s, l)
  35570. },
  35571. setTimeout: function (e, t, i) {
  35572. var n = void 0 === i ? this.counter : i
  35573. return this.trigger({
  35574. done: e,
  35575. duration: void 0 === t ? 0 : t,
  35576. name: 'O' + this.counter,
  35577. id: n
  35578. })
  35579. },
  35580. pause: function () {
  35581. this.paused = !0
  35582. },
  35583. resume: function () {
  35584. this.paused = !1
  35585. },
  35586. update: function (e) {
  35587. this.funcs.forEach(function (t) {
  35588. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  35589. if (t.current >= t.duration && !t.cycling) {
  35590. var i = t.easing(1, 0, 1, 1)
  35591. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1)
  35592. } else {
  35593. var n = t.easing((t.current % t.duration) / t.duration, 0, 1, 1),
  35594. r = t.func(n, 1e3 * e) || !1
  35595. r && (t.done && t.done(), (t.running = !1))
  35596. }
  35597. })
  35598. var t = this.funcs.length
  35599. this.funcs = this.funcs.filter(function (e) {
  35600. return e.running
  35601. })
  35602. var i = this.funcs.length
  35603. if (t > 0 && 0 === i && this.globalDone) {
  35604. var n = this.globalDone
  35605. ;(this.globalDone = null), n()
  35606. }
  35607. },
  35608. adjustSpeed: function (e, t) {
  35609. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  35610. var r = i[n]
  35611. ;(r.duration /= t), (r.current /= t)
  35612. }
  35613. },
  35614. getById: function (e) {
  35615. return this.funcs.filter(function (t) {
  35616. return e === t.id
  35617. })
  35618. },
  35619. get: function (e) {
  35620. for (var t = 0; t < this.funcs.length; t += 1)
  35621. if (this.funcs[t].func === e) return this.funcs[t]
  35622. return null
  35623. },
  35624. isRunning: function (e) {
  35625. var t = this.get(e)
  35626. return null !== t && t.running
  35627. },
  35628. countActive: function () {
  35629. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running
  35630. return e
  35631. },
  35632. listActive: function () {
  35633. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  35634. this.funcs[t].running && e.push(this.funcs[t].name)
  35635. return e
  35636. },
  35637. done: function (e) {
  35638. this.globalDone = e
  35639. },
  35640. cancelById: function (e) {
  35641. var t = void 0 === e ? 0 : e
  35642. this.funcs = this.funcs.filter(function (e) {
  35643. return e.id !== t
  35644. })
  35645. },
  35646. cancel: function (e) {
  35647. this.funcs = this.funcs.filter(function (t) {
  35648. return t.func !== e
  35649. })
  35650. },
  35651. getUniqueId: function () {
  35652. return (this.uniqueID -= 1), this.uniqueID
  35653. }
  35654. }
  35655. },
  35656. {
  35657. './easing': 186
  35658. }
  35659. ],
  35660. 196: [
  35661. function (e, t, i) {
  35662. function n(e) {
  35663. if (
  35664. ((this.set = {}),
  35665. (this.infContains = function () {
  35666. return !0
  35667. }),
  35668. 'object' == typeof e)
  35669. )
  35670. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0
  35671. else this.set = e
  35672. else if ('function' == typeof e) this.infContains = e
  35673. else if ('undefined' != typeof e)
  35674. throw new Error('set must be either an array or an object.')
  35675. }
  35676. ;(t.exports = n),
  35677. (n.prototype.contains = function (e) {
  35678. return !!this.set[e]
  35679. }),
  35680. (n.prototype.has = n.prototype.contains),
  35681. (n.prototype.add = function (e) {
  35682. if (1 == arguments.length) this.set[e] = !0
  35683. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0
  35684. }),
  35685. (n.prototype.addAll = function (e) {
  35686. if ('object' != typeof e && !(e instanceof Array))
  35687. throw new Error('arr must be an array.')
  35688. for (var t = 0; t < e.length; t++) this.add(e[t])
  35689. }),
  35690. (n.prototype.remove = function (e) {
  35691. if (1 == arguments.length) delete this.set[e]
  35692. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]]
  35693. }),
  35694. (n.prototype.delete = n.prototype.remove),
  35695. (n.prototype.clear = function () {
  35696. this.set = {}
  35697. }),
  35698. (n.prototype.size = function () {
  35699. return Object.keys(this.set).length
  35700. }),
  35701. (n.prototype.toString = function () {
  35702. return '{' + Object.keys(this.set).toString() + '}'
  35703. }),
  35704. (n.prototype.toArray = function () {
  35705. return 'undefined' == typeof this.set ? [] : Object.keys(this.set)
  35706. }),
  35707. (n.prototype['*values'] = n.prototype.toArray)
  35708. },
  35709. {}
  35710. ],
  35711. 197: [function (e, t, i) {}, {}],
  35712. 198: [
  35713. function (e, t, i) {
  35714. ;(function (t) {
  35715. 'use strict'
  35716. function n() {
  35717. try {
  35718. var e = new Uint8Array(1)
  35719. return (
  35720. (e.__proto__ = {
  35721. __proto__: Uint8Array.prototype,
  35722. foo: function () {
  35723. return 42
  35724. }
  35725. }),
  35726. 42 === e.foo() &&
  35727. 'function' == typeof e.subarray &&
  35728. 0 === e.subarray(1, 1).byteLength
  35729. )
  35730. } catch (e) {
  35731. return !1
  35732. }
  35733. }
  35734. function r() {
  35735. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  35736. }
  35737. function o(e, t) {
  35738. if (r() < t) throw new RangeError('Invalid typed array length')
  35739. return (
  35740. a.TYPED_ARRAY_SUPPORT
  35741. ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype))
  35742. : (null === e && (e = new a(t)), (e.length = t)),
  35743. e
  35744. )
  35745. }
  35746. function a(e, t, i) {
  35747. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a)) return new a(e, t, i)
  35748. if ('number' == typeof e) {
  35749. if ('string' == typeof t)
  35750. throw new Error('If encoding is specified then the first argument must be a string')
  35751. return h(this, e)
  35752. }
  35753. return s(this, e, t, i)
  35754. }
  35755. function s(e, t, i, n) {
  35756. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number')
  35757. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
  35758. ? p(e, t, i, n)
  35759. : 'string' == typeof t
  35760. ? u(e, t, i)
  35761. : f(e, t)
  35762. }
  35763. function l(e) {
  35764. if ('number' != typeof e) throw new TypeError('"size" argument must be a number')
  35765. if (e < 0) throw new RangeError('"size" argument must not be negative')
  35766. }
  35767. function c(e, t, i, n) {
  35768. return (
  35769. l(t),
  35770. t <= 0
  35771. ? o(e, t)
  35772. : void 0 !== i
  35773. ? 'string' == typeof n
  35774. ? o(e, t).fill(i, n)
  35775. : o(e, t).fill(i)
  35776. : o(e, t)
  35777. )
  35778. }
  35779. function h(e, t) {
  35780. if ((l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT))
  35781. for (var i = 0; i < t; ++i) e[i] = 0
  35782. return e
  35783. }
  35784. function u(e, t, i) {
  35785. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !a.isEncoding(i)))
  35786. throw new TypeError('"encoding" must be a valid string encoding')
  35787. var n = 0 | v(t, i)
  35788. e = o(e, n)
  35789. var r = e.write(t, i)
  35790. return r !== n && (e = e.slice(0, r)), e
  35791. }
  35792. function d(e, t) {
  35793. var i = t.length < 0 ? 0 : 0 | g(t.length)
  35794. e = o(e, i)
  35795. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n]
  35796. return e
  35797. }
  35798. function p(e, t, i, n) {
  35799. if ((t.byteLength, i < 0 || t.byteLength < i))
  35800. throw new RangeError("'offset' is out of bounds")
  35801. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds")
  35802. return (
  35803. (t =
  35804. void 0 === i && void 0 === n
  35805. ? new Uint8Array(t)
  35806. : void 0 === n
  35807. ? new Uint8Array(t, i)
  35808. : new Uint8Array(t, i, n)),
  35809. a.TYPED_ARRAY_SUPPORT ? ((e = t), (e.__proto__ = a.prototype)) : (e = d(e, t)),
  35810. e
  35811. )
  35812. }
  35813. function f(e, t) {
  35814. if (a.isBuffer(t)) {
  35815. var i = 0 | g(t.length)
  35816. return (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e)
  35817. }
  35818. if (t) {
  35819. if (
  35820. ('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) ||
  35821. 'length' in t
  35822. )
  35823. return 'number' != typeof t.length || K(t.length) ? o(e, 0) : d(e, t)
  35824. if ('Buffer' === t.type && $(t.data)) return d(e, t.data)
  35825. }
  35826. throw new TypeError(
  35827. 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.'
  35828. )
  35829. }
  35830. function g(e) {
  35831. if (e >= r())
  35832. throw new RangeError(
  35833. 'Attempt to allocate Buffer larger than maximum size: 0x' +
  35834. r().toString(16) +
  35835. ' bytes'
  35836. )
  35837. return 0 | e
  35838. }
  35839. function m(e) {
  35840. return +e != e && (e = 0), a.alloc(+e)
  35841. }
  35842. function v(e, t) {
  35843. if (a.isBuffer(e)) return e.length
  35844. if (
  35845. 'undefined' != typeof ArrayBuffer &&
  35846. 'function' == typeof ArrayBuffer.isView &&
  35847. (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
  35848. )
  35849. return e.byteLength
  35850. 'string' != typeof e && (e = '' + e)
  35851. var i = e.length
  35852. if (0 === i) return 0
  35853. for (var n = !1; ; )
  35854. switch (t) {
  35855. case 'ascii':
  35856. case 'latin1':
  35857. case 'binary':
  35858. return i
  35859. case 'utf8':
  35860. case 'utf-8':
  35861. case void 0:
  35862. return j(e).length
  35863. case 'ucs2':
  35864. case 'ucs-2':
  35865. case 'utf16le':
  35866. case 'utf-16le':
  35867. return 2 * i
  35868. case 'hex':
  35869. return i >>> 1
  35870. case 'base64':
  35871. return Z(e).length
  35872. default:
  35873. if (n) return j(e).length
  35874. ;(t = ('' + t).toLowerCase()), (n = !0)
  35875. }
  35876. }
  35877. function A(e, t, i) {
  35878. var n = !1
  35879. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
  35880. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return ''
  35881. if (((i >>>= 0), (t >>>= 0), i <= t)) return ''
  35882. for (e || (e = 'utf8'); ; )
  35883. switch (e) {
  35884. case 'hex':
  35885. return L(this, t, i)
  35886. case 'utf8':
  35887. case 'utf-8':
  35888. return M(this, t, i)
  35889. case 'ascii':
  35890. return P(this, t, i)
  35891. case 'latin1':
  35892. case 'binary':
  35893. return O(this, t, i)
  35894. case 'base64':
  35895. return S(this, t, i)
  35896. case 'ucs2':
  35897. case 'ucs-2':
  35898. case 'utf16le':
  35899. case 'utf-16le':
  35900. return D(this, t, i)
  35901. default:
  35902. if (n) throw new TypeError('Unknown encoding: ' + e)
  35903. ;(e = (e + '').toLowerCase()), (n = !0)
  35904. }
  35905. }
  35906. function y(e, t, i) {
  35907. var n = e[t]
  35908. ;(e[t] = e[i]), (e[i] = n)
  35909. }
  35910. function C(e, t, i, n, r) {
  35911. if (0 === e.length) return -1
  35912. if (
  35913. ('string' == typeof i
  35914. ? ((n = i), (i = 0))
  35915. : i > 2147483647
  35916. ? (i = 2147483647)
  35917. : i < -2147483648 && (i = -2147483648),
  35918. (i = +i),
  35919. isNaN(i) && (i = r ? 0 : e.length - 1),
  35920. i < 0 && (i = e.length + i),
  35921. i >= e.length)
  35922. ) {
  35923. if (r) return -1
  35924. i = e.length - 1
  35925. } else if (i < 0) {
  35926. if (!r) return -1
  35927. i = 0
  35928. }
  35929. if (('string' == typeof t && (t = a.from(t, n)), a.isBuffer(t)))
  35930. return 0 === t.length ? -1 : I(e, t, i, n, r)
  35931. if ('number' == typeof t)
  35932. return (
  35933. (t &= 255),
  35934. a.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  35935. ? r
  35936. ? Uint8Array.prototype.indexOf.call(e, t, i)
  35937. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  35938. : I(e, [t], i, n, r)
  35939. )
  35940. throw new TypeError('val must be string, number or Buffer')
  35941. }
  35942. function I(e, t, i, n, r) {
  35943. function o(e, t) {
  35944. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  35945. }
  35946. var a = 1,
  35947. s = e.length,
  35948. l = t.length
  35949. if (
  35950. void 0 !== n &&
  35951. ((n = String(n).toLowerCase()),
  35952. 'ucs2' === n || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)
  35953. ) {
  35954. if (e.length < 2 || t.length < 2) return -1
  35955. ;(a = 2), (s /= 2), (l /= 2), (i /= 2)
  35956. }
  35957. var c
  35958. if (r) {
  35959. var h = -1
  35960. for (c = i; c < s; c++)
  35961. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  35962. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a
  35963. } else h !== -1 && (c -= c - h), (h = -1)
  35964. } else
  35965. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  35966. for (var u = !0, d = 0; d < l; d++)
  35967. if (o(e, c + d) !== o(t, d)) {
  35968. u = !1
  35969. break
  35970. }
  35971. if (u) return c
  35972. }
  35973. return -1
  35974. }
  35975. function E(e, t, i, n) {
  35976. i = Number(i) || 0
  35977. var r = e.length - i
  35978. n ? ((n = Number(n)), n > r && (n = r)) : (n = r)
  35979. var o = t.length
  35980. if (o % 2 !== 0) throw new TypeError('Invalid hex string')
  35981. n > o / 2 && (n = o / 2)
  35982. for (var a = 0; a < n; ++a) {
  35983. var s = parseInt(t.substr(2 * a, 2), 16)
  35984. if (isNaN(s)) return a
  35985. e[i + a] = s
  35986. }
  35987. return a
  35988. }
  35989. function b(e, t, i, n) {
  35990. return q(j(t, e.length - i), e, i, n)
  35991. }
  35992. function w(e, t, i, n) {
  35993. return q(Y(t), e, i, n)
  35994. }
  35995. function _(e, t, i, n) {
  35996. return w(e, t, i, n)
  35997. }
  35998. function T(e, t, i, n) {
  35999. return q(Z(t), e, i, n)
  36000. }
  36001. function x(e, t, i, n) {
  36002. return q(X(t, e.length - i), e, i, n)
  36003. }
  36004. function S(e, t, i) {
  36005. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  36006. }
  36007. function M(e, t, i) {
  36008. i = Math.min(e.length, i)
  36009. for (var n = [], r = t; r < i; ) {
  36010. var o = e[r],
  36011. a = null,
  36012. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1
  36013. if (r + s <= i) {
  36014. var l, c, h, u
  36015. switch (s) {
  36016. case 1:
  36017. o < 128 && (a = o)
  36018. break
  36019. case 2:
  36020. ;(l = e[r + 1]),
  36021. 128 === (192 & l) && ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u))
  36022. break
  36023. case 3:
  36024. ;(l = e[r + 1]),
  36025. (c = e[r + 2]),
  36026. 128 === (192 & l) &&
  36027. 128 === (192 & c) &&
  36028. ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)),
  36029. u > 2047 && (u < 55296 || u > 57343) && (a = u))
  36030. break
  36031. case 4:
  36032. ;(l = e[r + 1]),
  36033. (c = e[r + 2]),
  36034. (h = e[r + 3]),
  36035. 128 === (192 & l) &&
  36036. 128 === (192 & c) &&
  36037. 128 === (192 & h) &&
  36038. ((u = ((15 & o) << 18) | ((63 & l) << 12) | ((63 & c) << 6) | (63 & h)),
  36039. u > 65535 && u < 1114112 && (a = u))
  36040. }
  36041. }
  36042. null === a
  36043. ? ((a = 65533), (s = 1))
  36044. : a > 65535 &&
  36045. ((a -= 65536), n.push(((a >>> 10) & 1023) | 55296), (a = 56320 | (1023 & a))),
  36046. n.push(a),
  36047. (r += s)
  36048. }
  36049. return R(n)
  36050. }
  36051. function R(e) {
  36052. var t = e.length
  36053. if (t <= ee) return String.fromCharCode.apply(String, e)
  36054. for (var i = '', n = 0; n < t; )
  36055. i += String.fromCharCode.apply(String, e.slice(n, (n += ee)))
  36056. return i
  36057. }
  36058. function P(e, t, i) {
  36059. var n = ''
  36060. i = Math.min(e.length, i)
  36061. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r])
  36062. return n
  36063. }
  36064. function O(e, t, i) {
  36065. var n = ''
  36066. i = Math.min(e.length, i)
  36067. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r])
  36068. return n
  36069. }
  36070. function L(e, t, i) {
  36071. var n = e.length
  36072. ;(!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n)
  36073. for (var r = '', o = t; o < i; ++o) r += W(e[o])
  36074. return r
  36075. }
  36076. function D(e, t, i) {
  36077. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2)
  36078. r += String.fromCharCode(n[o] + 256 * n[o + 1])
  36079. return r
  36080. }
  36081. function N(e, t, i) {
  36082. if (e % 1 !== 0 || e < 0) throw new RangeError('offset is not uint')
  36083. if (e + t > i) throw new RangeError('Trying to access beyond buffer length')
  36084. }
  36085. function B(e, t, i, n, r, o) {
  36086. if (!a.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance')
  36087. if (t > r || t < o) throw new RangeError('"value" argument is out of bounds')
  36088. if (i + n > e.length) throw new RangeError('Index out of range')
  36089. }
  36090. function F(e, t, i, n) {
  36091. t < 0 && (t = 65535 + t + 1)
  36092. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  36093. e[i + r] = (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r))
  36094. }
  36095. function V(e, t, i, n) {
  36096. t < 0 && (t = 4294967295 + t + 1)
  36097. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  36098. e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255
  36099. }
  36100. function U(e, t, i, n, r, o) {
  36101. if (i + n > e.length) throw new RangeError('Index out of range')
  36102. if (i < 0) throw new RangeError('Index out of range')
  36103. }
  36104. function k(e, t, i, n, r) {
  36105. return (
  36106. r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  36107. J.write(e, t, i, n, 23, 4),
  36108. i + 4
  36109. )
  36110. }
  36111. function H(e, t, i, n, r) {
  36112. return (
  36113. r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  36114. J.write(e, t, i, n, 52, 8),
  36115. i + 8
  36116. )
  36117. }
  36118. function G(e) {
  36119. if (((e = z(e).replace(te, '')), e.length < 2)) return ''
  36120. for (; e.length % 4 !== 0; ) e += '='
  36121. return e
  36122. }
  36123. function z(e) {
  36124. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '')
  36125. }
  36126. function W(e) {
  36127. return e < 16 ? '0' + e.toString(16) : e.toString(16)
  36128. }
  36129. function j(e, t) {
  36130. t = t || 1 / 0
  36131. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  36132. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  36133. if (!r) {
  36134. if (i > 56319) {
  36135. ;(t -= 3) > -1 && o.push(239, 191, 189)
  36136. continue
  36137. }
  36138. if (a + 1 === n) {
  36139. ;(t -= 3) > -1 && o.push(239, 191, 189)
  36140. continue
  36141. }
  36142. r = i
  36143. continue
  36144. }
  36145. if (i < 56320) {
  36146. ;(t -= 3) > -1 && o.push(239, 191, 189), (r = i)
  36147. continue
  36148. }
  36149. i = (((r - 55296) << 10) | (i - 56320)) + 65536
  36150. } else r && (t -= 3) > -1 && o.push(239, 191, 189)
  36151. if (((r = null), i < 128)) {
  36152. if ((t -= 1) < 0) break
  36153. o.push(i)
  36154. } else if (i < 2048) {
  36155. if ((t -= 2) < 0) break
  36156. o.push((i >> 6) | 192, (63 & i) | 128)
  36157. } else if (i < 65536) {
  36158. if ((t -= 3) < 0) break
  36159. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128)
  36160. } else {
  36161. if (!(i < 1114112)) throw new Error('Invalid code point')
  36162. if ((t -= 4) < 0) break
  36163. o.push(
  36164. (i >> 18) | 240,
  36165. ((i >> 12) & 63) | 128,
  36166. ((i >> 6) & 63) | 128,
  36167. (63 & i) | 128
  36168. )
  36169. }
  36170. }
  36171. return o
  36172. }
  36173. function Y(e) {
  36174. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i))
  36175. return t
  36176. }
  36177. function X(e, t) {
  36178. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  36179. (i = e.charCodeAt(a)), (n = i >> 8), (r = i % 256), o.push(r), o.push(n)
  36180. return o
  36181. }
  36182. function Z(e) {
  36183. return Q.toByteArray(G(e))
  36184. }
  36185. function q(e, t, i, n) {
  36186. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r]
  36187. return r
  36188. }
  36189. function K(e) {
  36190. return e !== e
  36191. }
  36192. var Q = e('base64-js'),
  36193. J = e('ieee754'),
  36194. $ = e('isarray')
  36195. ;(i.Buffer = a),
  36196. (i.SlowBuffer = m),
  36197. (i.INSPECT_MAX_BYTES = 50),
  36198. (a.TYPED_ARRAY_SUPPORT =
  36199. void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  36200. (i.kMaxLength = r()),
  36201. (a.poolSize = 8192),
  36202. (a._augment = function (e) {
  36203. return (e.__proto__ = a.prototype), e
  36204. }),
  36205. (a.from = function (e, t, i) {
  36206. return s(null, e, t, i)
  36207. }),
  36208. a.TYPED_ARRAY_SUPPORT &&
  36209. ((a.prototype.__proto__ = Uint8Array.prototype),
  36210. (a.__proto__ = Uint8Array),
  36211. 'undefined' != typeof Symbol &&
  36212. Symbol.species &&
  36213. a[Symbol.species] === a &&
  36214. Object.defineProperty(a, Symbol.species, {
  36215. value: null,
  36216. configurable: !0
  36217. })),
  36218. (a.alloc = function (e, t, i) {
  36219. return c(null, e, t, i)
  36220. }),
  36221. (a.allocUnsafe = function (e) {
  36222. return h(null, e)
  36223. }),
  36224. (a.allocUnsafeSlow = function (e) {
  36225. return h(null, e)
  36226. }),
  36227. (a.isBuffer = function (e) {
  36228. return !(null == e || !e._isBuffer)
  36229. }),
  36230. (a.compare = function (e, t) {
  36231. if (!a.isBuffer(e) || !a.isBuffer(t)) throw new TypeError('Arguments must be Buffers')
  36232. if (e === t) return 0
  36233. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  36234. if (e[r] !== t[r]) {
  36235. ;(i = e[r]), (n = t[r])
  36236. break
  36237. }
  36238. return i < n ? -1 : n < i ? 1 : 0
  36239. }),
  36240. (a.isEncoding = function (e) {
  36241. switch (String(e).toLowerCase()) {
  36242. case 'hex':
  36243. case 'utf8':
  36244. case 'utf-8':
  36245. case 'ascii':
  36246. case 'latin1':
  36247. case 'binary':
  36248. case 'base64':
  36249. case 'ucs2':
  36250. case 'ucs-2':
  36251. case 'utf16le':
  36252. case 'utf-16le':
  36253. return !0
  36254. default:
  36255. return !1
  36256. }
  36257. }),
  36258. (a.concat = function (e, t) {
  36259. if (!$(e)) throw new TypeError('"list" argument must be an Array of Buffers')
  36260. if (0 === e.length) return a.alloc(0)
  36261. var i
  36262. if (void 0 === t) for (t = 0, i = 0; i < e.length; ++i) t += e[i].length
  36263. var n = a.allocUnsafe(t),
  36264. r = 0
  36265. for (i = 0; i < e.length; ++i) {
  36266. var o = e[i]
  36267. if (!a.isBuffer(o))
  36268. throw new TypeError('"list" argument must be an Array of Buffers')
  36269. o.copy(n, r), (r += o.length)
  36270. }
  36271. return n
  36272. }),
  36273. (a.byteLength = v),
  36274. (a.prototype._isBuffer = !0),
  36275. (a.prototype.swap16 = function () {
  36276. var e = this.length
  36277. if (e % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
  36278. for (var t = 0; t < e; t += 2) y(this, t, t + 1)
  36279. return this
  36280. }),
  36281. (a.prototype.swap32 = function () {
  36282. var e = this.length
  36283. if (e % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
  36284. for (var t = 0; t < e; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2)
  36285. return this
  36286. }),
  36287. (a.prototype.swap64 = function () {
  36288. var e = this.length
  36289. if (e % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
  36290. for (var t = 0; t < e; t += 8)
  36291. y(this, t, t + 7),
  36292. y(this, t + 1, t + 6),
  36293. y(this, t + 2, t + 5),
  36294. y(this, t + 3, t + 4)
  36295. return this
  36296. }),
  36297. (a.prototype.toString = function () {
  36298. var e = 0 | this.length
  36299. return 0 === e
  36300. ? ''
  36301. : 0 === arguments.length
  36302. ? M(this, 0, e)
  36303. : A.apply(this, arguments)
  36304. }),
  36305. (a.prototype.equals = function (e) {
  36306. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  36307. return this === e || 0 === a.compare(this, e)
  36308. }),
  36309. (a.prototype.inspect = function () {
  36310. var e = '',
  36311. t = i.INSPECT_MAX_BYTES
  36312. return (
  36313. this.length > 0 &&
  36314. ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')),
  36315. this.length > t && (e += ' ... ')),
  36316. '<Buffer ' + e + '>'
  36317. )
  36318. }),
  36319. (a.prototype.compare = function (e, t, i, n, r) {
  36320. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  36321. if (
  36322. (void 0 === t && (t = 0),
  36323. void 0 === i && (i = e ? e.length : 0),
  36324. void 0 === n && (n = 0),
  36325. void 0 === r && (r = this.length),
  36326. t < 0 || i > e.length || n < 0 || r > this.length)
  36327. )
  36328. throw new RangeError('out of range index')
  36329. if (n >= r && t >= i) return 0
  36330. if (n >= r) return -1
  36331. if (t >= i) return 1
  36332. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e)) return 0
  36333. for (
  36334. var o = r - n,
  36335. s = i - t,
  36336. l = Math.min(o, s),
  36337. c = this.slice(n, r),
  36338. h = e.slice(t, i),
  36339. u = 0;
  36340. u < l;
  36341. ++u
  36342. )
  36343. if (c[u] !== h[u]) {
  36344. ;(o = c[u]), (s = h[u])
  36345. break
  36346. }
  36347. return o < s ? -1 : s < o ? 1 : 0
  36348. }),
  36349. (a.prototype.includes = function (e, t, i) {
  36350. return this.indexOf(e, t, i) !== -1
  36351. }),
  36352. (a.prototype.indexOf = function (e, t, i) {
  36353. return C(this, e, t, i, !0)
  36354. }),
  36355. (a.prototype.lastIndexOf = function (e, t, i) {
  36356. return C(this, e, t, i, !1)
  36357. }),
  36358. (a.prototype.write = function (e, t, i, n) {
  36359. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0)
  36360. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0)
  36361. else {
  36362. if (!isFinite(t))
  36363. throw new Error(
  36364. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  36365. )
  36366. ;(t |= 0),
  36367. isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0))
  36368. }
  36369. var r = this.length - t
  36370. if (
  36371. ((void 0 === i || i > r) && (i = r),
  36372. (e.length > 0 && (i < 0 || t < 0)) || t > this.length)
  36373. )
  36374. throw new RangeError('Attempt to write outside buffer bounds')
  36375. n || (n = 'utf8')
  36376. for (var o = !1; ; )
  36377. switch (n) {
  36378. case 'hex':
  36379. return E(this, e, t, i)
  36380. case 'utf8':
  36381. case 'utf-8':
  36382. return b(this, e, t, i)
  36383. case 'ascii':
  36384. return w(this, e, t, i)
  36385. case 'latin1':
  36386. case 'binary':
  36387. return _(this, e, t, i)
  36388. case 'base64':
  36389. return T(this, e, t, i)
  36390. case 'ucs2':
  36391. case 'ucs-2':
  36392. case 'utf16le':
  36393. case 'utf-16le':
  36394. return x(this, e, t, i)
  36395. default:
  36396. if (o) throw new TypeError('Unknown encoding: ' + n)
  36397. ;(n = ('' + n).toLowerCase()), (o = !0)
  36398. }
  36399. }),
  36400. (a.prototype.toJSON = function () {
  36401. return {
  36402. type: 'Buffer',
  36403. data: Array.prototype.slice.call(this._arr || this, 0)
  36404. }
  36405. })
  36406. var ee = 4096
  36407. ;(a.prototype.slice = function (e, t) {
  36408. var i = this.length
  36409. ;(e = ~~e),
  36410. (t = void 0 === t ? i : ~~t),
  36411. e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i),
  36412. t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i),
  36413. t < e && (t = e)
  36414. var n
  36415. if (a.TYPED_ARRAY_SUPPORT) (n = this.subarray(e, t)), (n.__proto__ = a.prototype)
  36416. else {
  36417. var r = t - e
  36418. n = new a(r, void 0)
  36419. for (var o = 0; o < r; ++o) n[o] = this[o + e]
  36420. }
  36421. return n
  36422. }),
  36423. (a.prototype.readUIntLE = function (e, t, i) {
  36424. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36425. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  36426. return n
  36427. }),
  36428. (a.prototype.readUIntBE = function (e, t, i) {
  36429. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36430. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); ) n += this[e + --t] * r
  36431. return n
  36432. }),
  36433. (a.prototype.readUInt8 = function (e, t) {
  36434. return t || N(e, 1, this.length), this[e]
  36435. }),
  36436. (a.prototype.readUInt16LE = function (e, t) {
  36437. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8)
  36438. }),
  36439. (a.prototype.readUInt16BE = function (e, t) {
  36440. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1]
  36441. }),
  36442. (a.prototype.readUInt32LE = function (e, t) {
  36443. return (
  36444. t || N(e, 4, this.length),
  36445. (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  36446. )
  36447. }),
  36448. (a.prototype.readUInt32BE = function (e, t) {
  36449. return (
  36450. t || N(e, 4, this.length),
  36451. 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  36452. )
  36453. }),
  36454. (a.prototype.readIntLE = function (e, t, i) {
  36455. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36456. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  36457. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n
  36458. }),
  36459. (a.prototype.readIntBE = function (e, t, i) {
  36460. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36461. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  36462. o += this[e + --n] * r
  36463. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o
  36464. }),
  36465. (a.prototype.readInt8 = function (e, t) {
  36466. return t || N(e, 1, this.length), 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  36467. }),
  36468. (a.prototype.readInt16LE = function (e, t) {
  36469. t || N(e, 2, this.length)
  36470. var i = this[e] | (this[e + 1] << 8)
  36471. return 32768 & i ? 4294901760 | i : i
  36472. }),
  36473. (a.prototype.readInt16BE = function (e, t) {
  36474. t || N(e, 2, this.length)
  36475. var i = this[e + 1] | (this[e] << 8)
  36476. return 32768 & i ? 4294901760 | i : i
  36477. }),
  36478. (a.prototype.readInt32LE = function (e, t) {
  36479. return (
  36480. t || N(e, 4, this.length),
  36481. this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  36482. )
  36483. }),
  36484. (a.prototype.readInt32BE = function (e, t) {
  36485. return (
  36486. t || N(e, 4, this.length),
  36487. (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  36488. )
  36489. }),
  36490. (a.prototype.readFloatLE = function (e, t) {
  36491. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4)
  36492. }),
  36493. (a.prototype.readFloatBE = function (e, t) {
  36494. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4)
  36495. }),
  36496. (a.prototype.readDoubleLE = function (e, t) {
  36497. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8)
  36498. }),
  36499. (a.prototype.readDoubleBE = function (e, t) {
  36500. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8)
  36501. }),
  36502. (a.prototype.writeUIntLE = function (e, t, i, n) {
  36503. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36504. var r = Math.pow(2, 8 * i) - 1
  36505. B(this, e, t, i, r, 0)
  36506. }
  36507. var o = 1,
  36508. a = 0
  36509. for (this[t] = 255 & e; ++a < i && (o *= 256); ) this[t + a] = (e / o) & 255
  36510. return t + i
  36511. }),
  36512. (a.prototype.writeUIntBE = function (e, t, i, n) {
  36513. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36514. var r = Math.pow(2, 8 * i) - 1
  36515. B(this, e, t, i, r, 0)
  36516. }
  36517. var o = i - 1,
  36518. a = 1
  36519. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) this[t + o] = (e / a) & 255
  36520. return t + i
  36521. }),
  36522. (a.prototype.writeUInt8 = function (e, t, i) {
  36523. return (
  36524. (e = +e),
  36525. (t |= 0),
  36526. i || B(this, e, t, 1, 255, 0),
  36527. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36528. (this[t] = 255 & e),
  36529. t + 1
  36530. )
  36531. }),
  36532. (a.prototype.writeUInt16LE = function (e, t, i) {
  36533. return (
  36534. (e = +e),
  36535. (t |= 0),
  36536. i || B(this, e, t, 2, 65535, 0),
  36537. a.TYPED_ARRAY_SUPPORT
  36538. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36539. : F(this, e, t, !0),
  36540. t + 2
  36541. )
  36542. }),
  36543. (a.prototype.writeUInt16BE = function (e, t, i) {
  36544. return (
  36545. (e = +e),
  36546. (t |= 0),
  36547. i || B(this, e, t, 2, 65535, 0),
  36548. a.TYPED_ARRAY_SUPPORT
  36549. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36550. : F(this, e, t, !1),
  36551. t + 2
  36552. )
  36553. }),
  36554. (a.prototype.writeUInt32LE = function (e, t, i) {
  36555. return (
  36556. (e = +e),
  36557. (t |= 0),
  36558. i || B(this, e, t, 4, 4294967295, 0),
  36559. a.TYPED_ARRAY_SUPPORT
  36560. ? ((this[t + 3] = e >>> 24),
  36561. (this[t + 2] = e >>> 16),
  36562. (this[t + 1] = e >>> 8),
  36563. (this[t] = 255 & e))
  36564. : V(this, e, t, !0),
  36565. t + 4
  36566. )
  36567. }),
  36568. (a.prototype.writeUInt32BE = function (e, t, i) {
  36569. return (
  36570. (e = +e),
  36571. (t |= 0),
  36572. i || B(this, e, t, 4, 4294967295, 0),
  36573. a.TYPED_ARRAY_SUPPORT
  36574. ? ((this[t] = e >>> 24),
  36575. (this[t + 1] = e >>> 16),
  36576. (this[t + 2] = e >>> 8),
  36577. (this[t + 3] = 255 & e))
  36578. : V(this, e, t, !1),
  36579. t + 4
  36580. )
  36581. }),
  36582. (a.prototype.writeIntLE = function (e, t, i, n) {
  36583. if (((e = +e), (t |= 0), !n)) {
  36584. var r = Math.pow(2, 8 * i - 1)
  36585. B(this, e, t, i, r - 1, -r)
  36586. }
  36587. var o = 0,
  36588. a = 1,
  36589. s = 0
  36590. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  36591. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  36592. (this[t + o] = (((e / a) >> 0) - s) & 255)
  36593. return t + i
  36594. }),
  36595. (a.prototype.writeIntBE = function (e, t, i, n) {
  36596. if (((e = +e), (t |= 0), !n)) {
  36597. var r = Math.pow(2, 8 * i - 1)
  36598. B(this, e, t, i, r - 1, -r)
  36599. }
  36600. var o = i - 1,
  36601. a = 1,
  36602. s = 0
  36603. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  36604. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  36605. (this[t + o] = (((e / a) >> 0) - s) & 255)
  36606. return t + i
  36607. }),
  36608. (a.prototype.writeInt8 = function (e, t, i) {
  36609. return (
  36610. (e = +e),
  36611. (t |= 0),
  36612. i || B(this, e, t, 1, 127, -128),
  36613. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36614. e < 0 && (e = 255 + e + 1),
  36615. (this[t] = 255 & e),
  36616. t + 1
  36617. )
  36618. }),
  36619. (a.prototype.writeInt16LE = function (e, t, i) {
  36620. return (
  36621. (e = +e),
  36622. (t |= 0),
  36623. i || B(this, e, t, 2, 32767, -32768),
  36624. a.TYPED_ARRAY_SUPPORT
  36625. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36626. : F(this, e, t, !0),
  36627. t + 2
  36628. )
  36629. }),
  36630. (a.prototype.writeInt16BE = function (e, t, i) {
  36631. return (
  36632. (e = +e),
  36633. (t |= 0),
  36634. i || B(this, e, t, 2, 32767, -32768),
  36635. a.TYPED_ARRAY_SUPPORT
  36636. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36637. : F(this, e, t, !1),
  36638. t + 2
  36639. )
  36640. }),
  36641. (a.prototype.writeInt32LE = function (e, t, i) {
  36642. return (
  36643. (e = +e),
  36644. (t |= 0),
  36645. i || B(this, e, t, 4, 2147483647, -2147483648),
  36646. a.TYPED_ARRAY_SUPPORT
  36647. ? ((this[t] = 255 & e),
  36648. (this[t + 1] = e >>> 8),
  36649. (this[t + 2] = e >>> 16),
  36650. (this[t + 3] = e >>> 24))
  36651. : V(this, e, t, !0),
  36652. t + 4
  36653. )
  36654. }),
  36655. (a.prototype.writeInt32BE = function (e, t, i) {
  36656. return (
  36657. (e = +e),
  36658. (t |= 0),
  36659. i || B(this, e, t, 4, 2147483647, -2147483648),
  36660. e < 0 && (e = 4294967295 + e + 1),
  36661. a.TYPED_ARRAY_SUPPORT
  36662. ? ((this[t] = e >>> 24),
  36663. (this[t + 1] = e >>> 16),
  36664. (this[t + 2] = e >>> 8),
  36665. (this[t + 3] = 255 & e))
  36666. : V(this, e, t, !1),
  36667. t + 4
  36668. )
  36669. }),
  36670. (a.prototype.writeFloatLE = function (e, t, i) {
  36671. return k(this, e, t, !0, i)
  36672. }),
  36673. (a.prototype.writeFloatBE = function (e, t, i) {
  36674. return k(this, e, t, !1, i)
  36675. }),
  36676. (a.prototype.writeDoubleLE = function (e, t, i) {
  36677. return H(this, e, t, !0, i)
  36678. }),
  36679. (a.prototype.writeDoubleBE = function (e, t, i) {
  36680. return H(this, e, t, !1, i)
  36681. }),
  36682. (a.prototype.copy = function (e, t, i, n) {
  36683. if (
  36684. (i || (i = 0),
  36685. n || 0 === n || (n = this.length),
  36686. t >= e.length && (t = e.length),
  36687. t || (t = 0),
  36688. n > 0 && n < i && (n = i),
  36689. n === i)
  36690. )
  36691. return 0
  36692. if (0 === e.length || 0 === this.length) return 0
  36693. if (t < 0) throw new RangeError('targetStart out of bounds')
  36694. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds')
  36695. if (n < 0) throw new RangeError('sourceEnd out of bounds')
  36696. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i)
  36697. var r,
  36698. o = n - i
  36699. if (this === e && i < t && t < n) for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i]
  36700. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  36701. for (r = 0; r < o; ++r) e[r + t] = this[r + i]
  36702. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t)
  36703. return o
  36704. }),
  36705. (a.prototype.fill = function (e, t, i, n) {
  36706. if ('string' == typeof e) {
  36707. if (
  36708. ('string' == typeof t
  36709. ? ((n = t), (t = 0), (i = this.length))
  36710. : 'string' == typeof i && ((n = i), (i = this.length)),
  36711. 1 === e.length)
  36712. ) {
  36713. var r = e.charCodeAt(0)
  36714. r < 256 && (e = r)
  36715. }
  36716. if (void 0 !== n && 'string' != typeof n)
  36717. throw new TypeError('encoding must be a string')
  36718. if ('string' == typeof n && !a.isEncoding(n))
  36719. throw new TypeError('Unknown encoding: ' + n)
  36720. } else 'number' == typeof e && (e &= 255)
  36721. if (t < 0 || this.length < t || this.length < i)
  36722. throw new RangeError('Out of range index')
  36723. if (i <= t) return this
  36724. ;(t >>>= 0), (i = void 0 === i ? this.length : i >>> 0), e || (e = 0)
  36725. var o
  36726. if ('number' == typeof e) for (o = t; o < i; ++o) this[o] = e
  36727. else {
  36728. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  36729. l = s.length
  36730. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l]
  36731. }
  36732. return this
  36733. })
  36734. var te = /[^+\/0-9A-Za-z-_]/g
  36735. }).call(
  36736. this,
  36737. 'undefined' != typeof global
  36738. ? global
  36739. : 'undefined' != typeof self
  36740. ? self
  36741. : 'undefined' != typeof window
  36742. ? window
  36743. : {}
  36744. )
  36745. },
  36746. {
  36747. 'base64-js': 199,
  36748. ieee754: 200,
  36749. isarray: 201
  36750. }
  36751. ],
  36752. 199: [
  36753. function (e, t, i) {
  36754. 'use strict'
  36755. function n(e) {
  36756. var t = e.length
  36757. if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4')
  36758. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0
  36759. }
  36760. function r(e) {
  36761. return (3 * e.length) / 4 - n(e)
  36762. }
  36763. function o(e) {
  36764. var t,
  36765. i,
  36766. r,
  36767. o,
  36768. a,
  36769. s,
  36770. l = e.length
  36771. ;(a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l)
  36772. var c = 0
  36773. for (t = 0, i = 0; t < r; t += 4, i += 3)
  36774. (o =
  36775. (h[e.charCodeAt(t)] << 18) |
  36776. (h[e.charCodeAt(t + 1)] << 12) |
  36777. (h[e.charCodeAt(t + 2)] << 6) |
  36778. h[e.charCodeAt(t + 3)]),
  36779. (s[c++] = (o >> 16) & 255),
  36780. (s[c++] = (o >> 8) & 255),
  36781. (s[c++] = 255 & o)
  36782. return (
  36783. 2 === a
  36784. ? ((o = (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)),
  36785. (s[c++] = 255 & o))
  36786. : 1 === a &&
  36787. ((o =
  36788. (h[e.charCodeAt(t)] << 10) |
  36789. (h[e.charCodeAt(t + 1)] << 4) |
  36790. (h[e.charCodeAt(t + 2)] >> 2)),
  36791. (s[c++] = (o >> 8) & 255),
  36792. (s[c++] = 255 & o)),
  36793. s
  36794. )
  36795. }
  36796. function a(e) {
  36797. return c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e]
  36798. }
  36799. function s(e, t, i) {
  36800. for (var n, r = [], o = t; o < i; o += 3)
  36801. (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n))
  36802. return r.join('')
  36803. }
  36804. function l(e) {
  36805. for (
  36806. var t, i = e.length, n = i % 3, r = '', o = [], a = 16383, l = 0, h = i - n;
  36807. l < h;
  36808. l += a
  36809. )
  36810. o.push(s(e, l, l + a > h ? h : l + a))
  36811. return (
  36812. 1 === n
  36813. ? ((t = e[i - 1]), (r += c[t >> 2]), (r += c[(t << 4) & 63]), (r += '=='))
  36814. : 2 === n &&
  36815. ((t = (e[i - 2] << 8) + e[i - 1]),
  36816. (r += c[t >> 10]),
  36817. (r += c[(t >> 4) & 63]),
  36818. (r += c[(t << 2) & 63]),
  36819. (r += '=')),
  36820. o.push(r),
  36821. o.join('')
  36822. )
  36823. }
  36824. ;(i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l)
  36825. for (
  36826. var c = [],
  36827. h = [],
  36828. u = 'undefined' != typeof Uint8Array ? Uint8Array : Array,
  36829. d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
  36830. p = 0,
  36831. f = d.length;
  36832. p < f;
  36833. ++p
  36834. )
  36835. (c[p] = d[p]), (h[d.charCodeAt(p)] = p)
  36836. ;(h['-'.charCodeAt(0)] = 62), (h['_'.charCodeAt(0)] = 63)
  36837. },
  36838. {}
  36839. ],
  36840. 200: [
  36841. function (e, t, i) {
  36842. ;(i.read = function (e, t, i, n, r) {
  36843. var o,
  36844. a,
  36845. s = 8 * r - n - 1,
  36846. l = (1 << s) - 1,
  36847. c = l >> 1,
  36848. h = -7,
  36849. u = i ? r - 1 : 0,
  36850. d = i ? -1 : 1,
  36851. p = e[t + u]
  36852. for (
  36853. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  36854. h > 0;
  36855. o = 256 * o + e[t + u], u += d, h -= 8
  36856. );
  36857. for (
  36858. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  36859. h > 0;
  36860. a = 256 * a + e[t + u], u += d, h -= 8
  36861. );
  36862. if (0 === o) o = 1 - c
  36863. else {
  36864. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  36865. ;(a += Math.pow(2, n)), (o -= c)
  36866. }
  36867. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36868. }),
  36869. (i.write = function (e, t, i, n, r, o) {
  36870. var a,
  36871. s,
  36872. l,
  36873. c = 8 * o - r - 1,
  36874. h = (1 << c) - 1,
  36875. u = h >> 1,
  36876. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  36877. p = n ? 0 : o - 1,
  36878. f = n ? 1 : -1,
  36879. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  36880. for (
  36881. t = Math.abs(t),
  36882. isNaN(t) || t === 1 / 0
  36883. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  36884. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  36885. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  36886. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  36887. t * l >= 2 && (a++, (l /= 2)),
  36888. a + u >= h
  36889. ? ((s = 0), (a = h))
  36890. : a + u >= 1
  36891. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  36892. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  36893. r >= 8;
  36894. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  36895. );
  36896. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  36897. e[i + p - f] |= 128 * g
  36898. })
  36899. },
  36900. {}
  36901. ],
  36902. 201: [
  36903. function (e, t, i) {
  36904. var n = {}.toString
  36905. t.exports =
  36906. Array.isArray ||
  36907. function (e) {
  36908. return '[object Array]' == n.call(e)
  36909. }
  36910. },
  36911. {}
  36912. ],
  36913. 202: [
  36914. function (e, t, i) {
  36915. function n() {
  36916. ;(this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0)
  36917. }
  36918. function r(e) {
  36919. return 'function' == typeof e
  36920. }
  36921. function o(e) {
  36922. return 'number' == typeof e
  36923. }
  36924. function a(e) {
  36925. return 'object' == typeof e && null !== e
  36926. }
  36927. function s(e) {
  36928. return void 0 === e
  36929. }
  36930. ;(t.exports = n),
  36931. (n.EventEmitter = n),
  36932. (n.prototype._events = void 0),
  36933. (n.prototype._maxListeners = void 0),
  36934. (n.defaultMaxListeners = 10),
  36935. (n.prototype.setMaxListeners = function (e) {
  36936. if (!o(e) || e < 0 || isNaN(e)) throw TypeError('n must be a positive number')
  36937. return (this._maxListeners = e), this
  36938. }),
  36939. (n.prototype.emit = function (e) {
  36940. var t, i, n, o, l, c
  36941. if (
  36942. (this._events || (this._events = {}),
  36943. 'error' === e &&
  36944. (!this._events.error || (a(this._events.error) && !this._events.error.length)))
  36945. ) {
  36946. if (((t = arguments[1]), t instanceof Error)) throw t
  36947. var h = new Error('Uncaught, unspecified "error" event. (' + t + ')')
  36948. throw ((h.context = t), h)
  36949. }
  36950. if (((i = this._events[e]), s(i))) return !1
  36951. if (r(i))
  36952. switch (arguments.length) {
  36953. case 1:
  36954. i.call(this)
  36955. break
  36956. case 2:
  36957. i.call(this, arguments[1])
  36958. break
  36959. case 3:
  36960. i.call(this, arguments[1], arguments[2])
  36961. break
  36962. default:
  36963. ;(o = Array.prototype.slice.call(arguments, 1)), i.apply(this, o)
  36964. }
  36965. else if (a(i))
  36966. for (
  36967. o = Array.prototype.slice.call(arguments, 1), c = i.slice(), n = c.length, l = 0;
  36968. l < n;
  36969. l++
  36970. )
  36971. c[l].apply(this, o)
  36972. return !0
  36973. }),
  36974. (n.prototype.addListener = function (e, t) {
  36975. var i
  36976. if (!r(t)) throw TypeError('listener must be a function')
  36977. return (
  36978. this._events || (this._events = {}),
  36979. this._events.newListener &&
  36980. this.emit('newListener', e, r(t.listener) ? t.listener : t),
  36981. this._events[e]
  36982. ? a(this._events[e])
  36983. ? this._events[e].push(t)
  36984. : (this._events[e] = [this._events[e], t])
  36985. : (this._events[e] = t),
  36986. a(this._events[e]) &&
  36987. !this._events[e].warned &&
  36988. ((i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners),
  36989. i &&
  36990. i > 0 &&
  36991. this._events[e].length > i &&
  36992. ((this._events[e].warned = !0),
  36993. console.error(
  36994. '(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.',
  36995. this._events[e].length
  36996. ),
  36997. 'function' == typeof console.trace && console.trace())),
  36998. this
  36999. )
  37000. }),
  37001. (n.prototype.on = n.prototype.addListener),
  37002. (n.prototype.once = function (e, t) {
  37003. function i() {
  37004. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments))
  37005. }
  37006. if (!r(t)) throw TypeError('listener must be a function')
  37007. var n = !1
  37008. return (i.listener = t), this.on(e, i), this
  37009. }),
  37010. (n.prototype.removeListener = function (e, t) {
  37011. var i, n, o, s
  37012. if (!r(t)) throw TypeError('listener must be a function')
  37013. if (!this._events || !this._events[e]) return this
  37014. if (
  37015. ((i = this._events[e]),
  37016. (o = i.length),
  37017. (n = -1),
  37018. i === t || (r(i.listener) && i.listener === t))
  37019. )
  37020. delete this._events[e],
  37021. this._events.removeListener && this.emit('removeListener', e, t)
  37022. else if (a(i)) {
  37023. for (s = o; s-- > 0; )
  37024. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  37025. n = s
  37026. break
  37027. }
  37028. if (n < 0) return this
  37029. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1),
  37030. this._events.removeListener && this.emit('removeListener', e, t)
  37031. }
  37032. return this
  37033. }),
  37034. (n.prototype.removeAllListeners = function (e) {
  37035. var t, i
  37036. if (!this._events) return this
  37037. if (!this._events.removeListener)
  37038. return (
  37039. 0 === arguments.length
  37040. ? (this._events = {})
  37041. : this._events[e] && delete this._events[e],
  37042. this
  37043. )
  37044. if (0 === arguments.length) {
  37045. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t)
  37046. return this.removeAllListeners('removeListener'), (this._events = {}), this
  37047. }
  37048. if (((i = this._events[e]), r(i))) this.removeListener(e, i)
  37049. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1])
  37050. return delete this._events[e], this
  37051. }),
  37052. (n.prototype.listeners = function (e) {
  37053. var t
  37054. return (t =
  37055. this._events && this._events[e]
  37056. ? r(this._events[e])
  37057. ? [this._events[e]]
  37058. : this._events[e].slice()
  37059. : [])
  37060. }),
  37061. (n.prototype.listenerCount = function (e) {
  37062. if (this._events) {
  37063. var t = this._events[e]
  37064. if (r(t)) return 1
  37065. if (t) return t.length
  37066. }
  37067. return 0
  37068. }),
  37069. (n.listenerCount = function (e, t) {
  37070. return e.listenerCount(t)
  37071. })
  37072. },
  37073. {}
  37074. ],
  37075. 203: [
  37076. function (e, t, i) {
  37077. function n() {
  37078. throw new Error('setTimeout has not been defined')
  37079. }
  37080. function r() {
  37081. throw new Error('clearTimeout has not been defined')
  37082. }
  37083. function o(e) {
  37084. if (u === setTimeout) return setTimeout(e, 0)
  37085. if ((u === n || !u) && setTimeout) return (u = setTimeout), setTimeout(e, 0)
  37086. try {
  37087. return u(e, 0)
  37088. } catch (t) {
  37089. try {
  37090. return u.call(null, e, 0)
  37091. } catch (t) {
  37092. return u.call(this, e, 0)
  37093. }
  37094. }
  37095. }
  37096. function a(e) {
  37097. if (d === clearTimeout) return clearTimeout(e)
  37098. if ((d === r || !d) && clearTimeout) return (d = clearTimeout), clearTimeout(e)
  37099. try {
  37100. return d(e)
  37101. } catch (t) {
  37102. try {
  37103. return d.call(null, e)
  37104. } catch (t) {
  37105. return d.call(this, e)
  37106. }
  37107. }
  37108. }
  37109. function s() {
  37110. m && f && ((m = !1), f.length ? (g = f.concat(g)) : (v = -1), g.length && l())
  37111. }
  37112. function l() {
  37113. if (!m) {
  37114. var e = o(s)
  37115. m = !0
  37116. for (var t = g.length; t; ) {
  37117. for (f = g, g = []; ++v < t; ) f && f[v].run()
  37118. ;(v = -1), (t = g.length)
  37119. }
  37120. ;(f = null), (m = !1), a(e)
  37121. }
  37122. }
  37123. function c(e, t) {
  37124. ;(this.fun = e), (this.array = t)
  37125. }
  37126. function h() {}
  37127. var u,
  37128. d,
  37129. p = (t.exports = {})
  37130. !(function () {
  37131. try {
  37132. u = 'function' == typeof setTimeout ? setTimeout : n
  37133. } catch (e) {
  37134. u = n
  37135. }
  37136. try {
  37137. d = 'function' == typeof clearTimeout ? clearTimeout : r
  37138. } catch (e) {
  37139. d = r
  37140. }
  37141. })()
  37142. var f,
  37143. g = [],
  37144. m = !1,
  37145. v = -1
  37146. ;(p.nextTick = function (e) {
  37147. var t = new Array(arguments.length - 1)
  37148. if (arguments.length > 1)
  37149. for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]
  37150. g.push(new c(e, t)), 1 !== g.length || m || o(l)
  37151. }),
  37152. (c.prototype.run = function () {
  37153. this.fun.apply(null, this.array)
  37154. }),
  37155. (p.title = 'browser'),
  37156. (p.browser = !0),
  37157. (p.env = {}),
  37158. (p.argv = []),
  37159. (p.version = ''),
  37160. (p.versions = {}),
  37161. (p.on = h),
  37162. (p.addListener = h),
  37163. (p.once = h),
  37164. (p.off = h),
  37165. (p.removeListener = h),
  37166. (p.removeAllListeners = h),
  37167. (p.emit = h),
  37168. (p.binding = function (e) {
  37169. throw new Error('process.binding is not supported')
  37170. }),
  37171. (p.cwd = function () {
  37172. return '/'
  37173. }),
  37174. (p.chdir = function (e) {
  37175. throw new Error('process.chdir is not supported')
  37176. }),
  37177. (p.umask = function () {
  37178. return 0
  37179. })
  37180. },
  37181. {}
  37182. ],
  37183. 204: [
  37184. function (e, t, i) {
  37185. ;(function (e) {
  37186. !(function (n) {
  37187. function r(e) {
  37188. throw new RangeError(L[e])
  37189. }
  37190. function o(e, t) {
  37191. for (var i = e.length, n = []; i--; ) n[i] = t(e[i])
  37192. return n
  37193. }
  37194. function a(e, t) {
  37195. var i = e.split('@'),
  37196. n = ''
  37197. i.length > 1 && ((n = i[0] + '@'), (e = i[1])), (e = e.replace(O, '.'))
  37198. var r = e.split('.'),
  37199. a = o(r, t).join('.')
  37200. return n + a
  37201. }
  37202. function s(e) {
  37203. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  37204. (t = e.charCodeAt(r++)),
  37205. t >= 55296 && t <= 56319 && r < o
  37206. ? ((i = e.charCodeAt(r++)),
  37207. 56320 == (64512 & i)
  37208. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  37209. : (n.push(t), r--))
  37210. : n.push(t)
  37211. return n
  37212. }
  37213. function l(e) {
  37214. return o(e, function (e) {
  37215. var t = ''
  37216. return (
  37217. e > 65535 &&
  37218. ((e -= 65536), (t += B(((e >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))),
  37219. (t += B(e))
  37220. )
  37221. }).join('')
  37222. }
  37223. function c(e) {
  37224. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  37225. }
  37226. function h(e, t) {
  37227. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  37228. }
  37229. function u(e, t, i) {
  37230. var n = 0
  37231. for (e = i ? N(e / T) : e >> 1, e += N(e / t); e > (D * w) >> 1; n += E) e = N(e / D)
  37232. return N(n + ((D + 1) * e) / (e + _))
  37233. }
  37234. function d(e) {
  37235. var t,
  37236. i,
  37237. n,
  37238. o,
  37239. a,
  37240. s,
  37241. h,
  37242. d,
  37243. p,
  37244. f,
  37245. g = [],
  37246. m = e.length,
  37247. v = 0,
  37248. A = S,
  37249. y = x
  37250. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n)
  37251. e.charCodeAt(n) >= 128 && r('not-basic'), g.push(e.charCodeAt(n))
  37252. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  37253. for (
  37254. a = v, s = 1, h = E;
  37255. o >= m && r('invalid-input'),
  37256. (d = c(e.charCodeAt(o++))),
  37257. (d >= E || d > N((I - v) / s)) && r('overflow'),
  37258. (v += d * s),
  37259. (p = h <= y ? b : h >= y + w ? w : h - y),
  37260. !(d < p);
  37261. h += E
  37262. )
  37263. (f = E - p), s > N(I / f) && r('overflow'), (s *= f)
  37264. ;(t = g.length + 1),
  37265. (y = u(v - a, t, 0 == a)),
  37266. N(v / t) > I - A && r('overflow'),
  37267. (A += N(v / t)),
  37268. (v %= t),
  37269. g.splice(v++, 0, A)
  37270. }
  37271. return l(g)
  37272. }
  37273. function p(e) {
  37274. var t,
  37275. i,
  37276. n,
  37277. o,
  37278. a,
  37279. l,
  37280. c,
  37281. d,
  37282. p,
  37283. f,
  37284. g,
  37285. m,
  37286. v,
  37287. A,
  37288. y,
  37289. C = []
  37290. for (e = s(e), m = e.length, t = S, i = 0, a = x, l = 0; l < m; ++l)
  37291. (g = e[l]), g < 128 && C.push(B(g))
  37292. for (n = o = C.length, o && C.push(M); n < m; ) {
  37293. for (c = I, l = 0; l < m; ++l) (g = e[l]), g >= t && g < c && (c = g)
  37294. for (
  37295. v = n + 1,
  37296. c - t > N((I - i) / v) && r('overflow'),
  37297. i += (c - t) * v,
  37298. t = c,
  37299. l = 0;
  37300. l < m;
  37301. ++l
  37302. )
  37303. if (((g = e[l]), g < t && ++i > I && r('overflow'), g == t)) {
  37304. for (d = i, p = E; (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f); p += E)
  37305. (y = d - f), (A = E - f), C.push(B(h(f + (y % A), 0))), (d = N(y / A))
  37306. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n
  37307. }
  37308. ++i, ++t
  37309. }
  37310. return C.join('')
  37311. }
  37312. function f(e) {
  37313. return a(e, function (e) {
  37314. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  37315. })
  37316. }
  37317. function g(e) {
  37318. return a(e, function (e) {
  37319. return P.test(e) ? 'xn--' + p(e) : e
  37320. })
  37321. }
  37322. var m = 'object' == typeof i && i && !i.nodeType && i,
  37323. v = 'object' == typeof t && t && !t.nodeType && t,
  37324. A = 'object' == typeof e && e
  37325. ;(A.global !== A && A.window !== A && A.self !== A) || (n = A)
  37326. var y,
  37327. C,
  37328. I = 2147483647,
  37329. E = 36,
  37330. b = 1,
  37331. w = 26,
  37332. _ = 38,
  37333. T = 700,
  37334. x = 72,
  37335. S = 128,
  37336. M = '-',
  37337. R = /^xn--/,
  37338. P = /[^\x20-\x7E]/,
  37339. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  37340. L = {
  37341. overflow: 'Overflow: input needs wider integers to process',
  37342. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  37343. 'invalid-input': 'Invalid input'
  37344. },
  37345. D = E - b,
  37346. N = Math.floor,
  37347. B = String.fromCharCode
  37348. if (
  37349. ((y = {
  37350. version: '1.4.1',
  37351. ucs2: {
  37352. decode: s,
  37353. encode: l
  37354. },
  37355. decode: d,
  37356. encode: p,
  37357. toASCII: g,
  37358. toUnicode: f
  37359. }),
  37360. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  37361. )
  37362. define('punycode', function () {
  37363. return y
  37364. })
  37365. else if (m && v)
  37366. if (t.exports == m) v.exports = y
  37367. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C])
  37368. else n.punycode = y
  37369. })(this)
  37370. }).call(
  37371. this,
  37372. 'undefined' != typeof global
  37373. ? global
  37374. : 'undefined' != typeof self
  37375. ? self
  37376. : 'undefined' != typeof window
  37377. ? window
  37378. : {}
  37379. )
  37380. },
  37381. {}
  37382. ],
  37383. 205: [
  37384. function (e, t, i) {
  37385. 'use strict'
  37386. function n(e, t) {
  37387. return Object.prototype.hasOwnProperty.call(e, t)
  37388. }
  37389. t.exports = function (e, t, i, o) {
  37390. ;(t = t || '&'), (i = i || '=')
  37391. var a = {}
  37392. if ('string' != typeof e || 0 === e.length) return a
  37393. var s = /\+/g
  37394. e = e.split(t)
  37395. var l = 1e3
  37396. o && 'number' == typeof o.maxKeys && (l = o.maxKeys)
  37397. var c = e.length
  37398. l > 0 && c > l && (c = l)
  37399. for (var h = 0; h < c; ++h) {
  37400. var u,
  37401. d,
  37402. p,
  37403. f,
  37404. g = e[h].replace(s, '%20'),
  37405. m = g.indexOf(i)
  37406. m >= 0 ? ((u = g.substr(0, m)), (d = g.substr(m + 1))) : ((u = g), (d = '')),
  37407. (p = decodeURIComponent(u)),
  37408. (f = decodeURIComponent(d)),
  37409. n(a, p) ? (r(a[p]) ? a[p].push(f) : (a[p] = [a[p], f])) : (a[p] = f)
  37410. }
  37411. return a
  37412. }
  37413. var r =
  37414. Array.isArray ||
  37415. function (e) {
  37416. return '[object Array]' === Object.prototype.toString.call(e)
  37417. }
  37418. },
  37419. {}
  37420. ],
  37421. 206: [
  37422. function (e, t, i) {
  37423. 'use strict'
  37424. function n(e, t) {
  37425. if (e.map) return e.map(t)
  37426. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n))
  37427. return i
  37428. }
  37429. var r = function (e) {
  37430. switch (typeof e) {
  37431. case 'string':
  37432. return e
  37433. case 'boolean':
  37434. return e ? 'true' : 'false'
  37435. case 'number':
  37436. return isFinite(e) ? e : ''
  37437. default:
  37438. return ''
  37439. }
  37440. }
  37441. t.exports = function (e, t, i, s) {
  37442. return (
  37443. (t = t || '&'),
  37444. (i = i || '='),
  37445. null === e && (e = void 0),
  37446. 'object' == typeof e
  37447. ? n(a(e), function (a) {
  37448. var s = encodeURIComponent(r(a)) + i
  37449. return o(e[a])
  37450. ? n(e[a], function (e) {
  37451. return s + encodeURIComponent(r(e))
  37452. }).join(t)
  37453. : s + encodeURIComponent(r(e[a]))
  37454. }).join(t)
  37455. : s
  37456. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  37457. : ''
  37458. )
  37459. }
  37460. var o =
  37461. Array.isArray ||
  37462. function (e) {
  37463. return '[object Array]' === Object.prototype.toString.call(e)
  37464. },
  37465. a =
  37466. Object.keys ||
  37467. function (e) {
  37468. var t = []
  37469. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i)
  37470. return t
  37471. }
  37472. },
  37473. {}
  37474. ],
  37475. 207: [
  37476. function (e, t, i) {
  37477. 'use strict'
  37478. ;(i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'))
  37479. },
  37480. {
  37481. './decode': 205,
  37482. './encode': 206
  37483. }
  37484. ],
  37485. 208: [
  37486. function (e, t, i) {
  37487. 'use strict'
  37488. function n() {
  37489. ;(this.protocol = null),
  37490. (this.slashes = null),
  37491. (this.auth = null),
  37492. (this.host = null),
  37493. (this.port = null),
  37494. (this.hostname = null),
  37495. (this.hash = null),
  37496. (this.search = null),
  37497. (this.query = null),
  37498. (this.pathname = null),
  37499. (this.path = null),
  37500. (this.href = null)
  37501. }
  37502. function r(e, t, i) {
  37503. if (e && c.isObject(e) && e instanceof n) return e
  37504. var r = new n()
  37505. return r.parse(e, t, i), r
  37506. }
  37507. function o(e) {
  37508. return (
  37509. c.isString(e) && (e = r(e)), e instanceof n ? e.format() : n.prototype.format.call(e)
  37510. )
  37511. }
  37512. function a(e, t) {
  37513. return r(e, !1, !0).resolve(t)
  37514. }
  37515. function s(e, t) {
  37516. return e ? r(e, !1, !0).resolveObject(t) : t
  37517. }
  37518. var l = e('punycode'),
  37519. c = e('./util')
  37520. ;(i.parse = r), (i.resolve = a), (i.resolveObject = s), (i.format = o), (i.Url = n)
  37521. var h = /^([a-z0-9.+-]+:)/i,
  37522. u = /:[0-9]*$/,
  37523. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  37524. p = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
  37525. f = ['{', '}', '|', '\\', '^', '`'].concat(p),
  37526. g = ["'"].concat(f),
  37527. m = ['%', '/', '?', ';', '#'].concat(g),
  37528. v = ['/', '?', '#'],
  37529. A = 255,
  37530. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  37531. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  37532. I = {
  37533. javascript: !0,
  37534. 'javascript:': !0
  37535. },
  37536. E = {
  37537. javascript: !0,
  37538. 'javascript:': !0
  37539. },
  37540. b = {
  37541. http: !0,
  37542. https: !0,
  37543. ftp: !0,
  37544. gopher: !0,
  37545. file: !0,
  37546. 'http:': !0,
  37547. 'https:': !0,
  37548. 'ftp:': !0,
  37549. 'gopher:': !0,
  37550. 'file:': !0
  37551. },
  37552. w = e('querystring')
  37553. ;(n.prototype.parse = function (e, t, i) {
  37554. if (!c.isString(e))
  37555. throw new TypeError("Parameter 'url' must be a string, not " + typeof e)
  37556. var n = e.indexOf('?'),
  37557. r = n !== -1 && n < e.indexOf('#') ? '?' : '#',
  37558. o = e.split(r),
  37559. a = /\\/g
  37560. ;(o[0] = o[0].replace(a, '/')), (e = o.join(r))
  37561. var s = e
  37562. if (((s = s.trim()), !i && 1 === e.split('#').length)) {
  37563. var u = d.exec(s)
  37564. if (u)
  37565. return (
  37566. (this.path = s),
  37567. (this.href = s),
  37568. (this.pathname = u[1]),
  37569. u[2]
  37570. ? ((this.search = u[2]),
  37571. t
  37572. ? (this.query = w.parse(this.search.substr(1)))
  37573. : (this.query = this.search.substr(1)))
  37574. : t && ((this.search = ''), (this.query = {})),
  37575. this
  37576. )
  37577. }
  37578. var p = h.exec(s)
  37579. if (p) {
  37580. p = p[0]
  37581. var f = p.toLowerCase()
  37582. ;(this.protocol = f), (s = s.substr(p.length))
  37583. }
  37584. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  37585. var _ = '//' === s.substr(0, 2)
  37586. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0))
  37587. }
  37588. if (!E[p] && (_ || (p && !b[p]))) {
  37589. for (var T = -1, x = 0; x < v.length; x++) {
  37590. var S = s.indexOf(v[x])
  37591. S !== -1 && (T === -1 || S < T) && (T = S)
  37592. }
  37593. var M, R
  37594. ;(R = T === -1 ? s.lastIndexOf('@') : s.lastIndexOf('@', T)),
  37595. R !== -1 &&
  37596. ((M = s.slice(0, R)), (s = s.slice(R + 1)), (this.auth = decodeURIComponent(M))),
  37597. (T = -1)
  37598. for (var x = 0; x < m.length; x++) {
  37599. var S = s.indexOf(m[x])
  37600. S !== -1 && (T === -1 || S < T) && (T = S)
  37601. }
  37602. T === -1 && (T = s.length),
  37603. (this.host = s.slice(0, T)),
  37604. (s = s.slice(T)),
  37605. this.parseHost(),
  37606. (this.hostname = this.hostname || '')
  37607. var P = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1]
  37608. if (!P)
  37609. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  37610. var D = O[x]
  37611. if (D && !D.match(y)) {
  37612. for (var N = '', B = 0, F = D.length; B < F; B++)
  37613. N += D.charCodeAt(B) > 127 ? 'x' : D[B]
  37614. if (!N.match(y)) {
  37615. var V = O.slice(0, x),
  37616. U = O.slice(x + 1),
  37617. k = D.match(C)
  37618. k && (V.push(k[1]), U.unshift(k[2])),
  37619. U.length && (s = '/' + U.join('.') + s),
  37620. (this.hostname = V.join('.'))
  37621. break
  37622. }
  37623. }
  37624. }
  37625. this.hostname.length > A
  37626. ? (this.hostname = '')
  37627. : (this.hostname = this.hostname.toLowerCase()),
  37628. P || (this.hostname = l.toASCII(this.hostname))
  37629. var H = this.port ? ':' + this.port : '',
  37630. G = this.hostname || ''
  37631. ;(this.host = G + H),
  37632. (this.href += this.host),
  37633. P &&
  37634. ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)),
  37635. '/' !== s[0] && (s = '/' + s))
  37636. }
  37637. if (!I[f])
  37638. for (var x = 0, L = g.length; x < L; x++) {
  37639. var z = g[x]
  37640. if (s.indexOf(z) !== -1) {
  37641. var W = encodeURIComponent(z)
  37642. W === z && (W = escape(z)), (s = s.split(z).join(W))
  37643. }
  37644. }
  37645. var j = s.indexOf('#')
  37646. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)))
  37647. var Y = s.indexOf('?')
  37648. if (
  37649. (Y !== -1
  37650. ? ((this.search = s.substr(Y)),
  37651. (this.query = s.substr(Y + 1)),
  37652. t && (this.query = w.parse(this.query)),
  37653. (s = s.slice(0, Y)))
  37654. : t && ((this.search = ''), (this.query = {})),
  37655. s && (this.pathname = s),
  37656. b[f] && this.hostname && !this.pathname && (this.pathname = '/'),
  37657. this.pathname || this.search)
  37658. ) {
  37659. var H = this.pathname || '',
  37660. X = this.search || ''
  37661. this.path = H + X
  37662. }
  37663. return (this.href = this.format()), this
  37664. }),
  37665. (n.prototype.format = function () {
  37666. var e = this.auth || ''
  37667. e && ((e = encodeURIComponent(e)), (e = e.replace(/%3A/i, ':')), (e += '@'))
  37668. var t = this.protocol || '',
  37669. i = this.pathname || '',
  37670. n = this.hash || '',
  37671. r = !1,
  37672. o = ''
  37673. this.host
  37674. ? (r = e + this.host)
  37675. : this.hostname &&
  37676. ((r =
  37677. e +
  37678. (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']')),
  37679. this.port && (r += ':' + this.port)),
  37680. this.query &&
  37681. c.isObject(this.query) &&
  37682. Object.keys(this.query).length &&
  37683. (o = w.stringify(this.query))
  37684. var a = this.search || (o && '?' + o) || ''
  37685. return (
  37686. t && ':' !== t.substr(-1) && (t += ':'),
  37687. this.slashes || ((!t || b[t]) && r !== !1)
  37688. ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i))
  37689. : r || (r = ''),
  37690. n && '#' !== n.charAt(0) && (n = '#' + n),
  37691. a && '?' !== a.charAt(0) && (a = '?' + a),
  37692. (i = i.replace(/[?#]/g, function (e) {
  37693. return encodeURIComponent(e)
  37694. })),
  37695. (a = a.replace('#', '%23')),
  37696. t + r + i + a + n
  37697. )
  37698. }),
  37699. (n.prototype.resolve = function (e) {
  37700. return this.resolveObject(r(e, !1, !0)).format()
  37701. }),
  37702. (n.prototype.resolveObject = function (e) {
  37703. if (c.isString(e)) {
  37704. var t = new n()
  37705. t.parse(e, !1, !0), (e = t)
  37706. }
  37707. for (var i = new n(), r = Object.keys(this), o = 0; o < r.length; o++) {
  37708. var a = r[o]
  37709. i[a] = this[a]
  37710. }
  37711. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i
  37712. if (e.slashes && !e.protocol) {
  37713. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  37714. var h = s[l]
  37715. 'protocol' !== h && (i[h] = e[h])
  37716. }
  37717. return (
  37718. b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'),
  37719. (i.href = i.format()),
  37720. i
  37721. )
  37722. }
  37723. if (e.protocol && e.protocol !== i.protocol) {
  37724. if (!b[e.protocol]) {
  37725. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  37726. var p = u[d]
  37727. i[p] = e[p]
  37728. }
  37729. return (i.href = i.format()), i
  37730. }
  37731. if (((i.protocol = e.protocol), e.host || E[e.protocol])) i.pathname = e.pathname
  37732. else {
  37733. for (var f = (e.pathname || '').split('/'); f.length && !(e.host = f.shift()); );
  37734. e.host || (e.host = ''),
  37735. e.hostname || (e.hostname = ''),
  37736. '' !== f[0] && f.unshift(''),
  37737. f.length < 2 && f.unshift(''),
  37738. (i.pathname = f.join('/'))
  37739. }
  37740. if (
  37741. ((i.search = e.search),
  37742. (i.query = e.query),
  37743. (i.host = e.host || ''),
  37744. (i.auth = e.auth),
  37745. (i.hostname = e.hostname || e.host),
  37746. (i.port = e.port),
  37747. i.pathname || i.search)
  37748. ) {
  37749. var g = i.pathname || '',
  37750. m = i.search || ''
  37751. i.path = g + m
  37752. }
  37753. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  37754. }
  37755. var v = i.pathname && '/' === i.pathname.charAt(0),
  37756. A = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  37757. y = A || v || (i.host && e.pathname),
  37758. C = y,
  37759. I = (i.pathname && i.pathname.split('/')) || [],
  37760. f = (e.pathname && e.pathname.split('/')) || [],
  37761. w = i.protocol && !b[i.protocol]
  37762. if (
  37763. (w &&
  37764. ((i.hostname = ''),
  37765. (i.port = null),
  37766. i.host && ('' === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  37767. (i.host = ''),
  37768. e.protocol &&
  37769. ((e.hostname = null),
  37770. (e.port = null),
  37771. e.host && ('' === f[0] ? (f[0] = e.host) : f.unshift(e.host)),
  37772. (e.host = null)),
  37773. (y = y && ('' === f[0] || '' === I[0]))),
  37774. A)
  37775. )
  37776. (i.host = e.host || '' === e.host ? e.host : i.host),
  37777. (i.hostname = e.hostname || '' === e.hostname ? e.hostname : i.hostname),
  37778. (i.search = e.search),
  37779. (i.query = e.query),
  37780. (I = f)
  37781. else if (f.length)
  37782. I || (I = []), I.pop(), (I = I.concat(f)), (i.search = e.search), (i.query = e.query)
  37783. else if (!c.isNullOrUndefined(e.search)) {
  37784. if (w) {
  37785. i.hostname = i.host = I.shift()
  37786. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  37787. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  37788. }
  37789. return (
  37790. (i.search = e.search),
  37791. (i.query = e.query),
  37792. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37793. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37794. (i.href = i.format()),
  37795. i
  37796. )
  37797. }
  37798. if (!I.length)
  37799. return (
  37800. (i.pathname = null),
  37801. i.search ? (i.path = '/' + i.search) : (i.path = null),
  37802. (i.href = i.format()),
  37803. i
  37804. )
  37805. for (
  37806. var T = I.slice(-1)[0],
  37807. x = ((i.host || e.host || I.length > 1) && ('.' === T || '..' === T)) || '' === T,
  37808. S = 0,
  37809. M = I.length;
  37810. M >= 0;
  37811. M--
  37812. )
  37813. (T = I[M]),
  37814. '.' === T
  37815. ? I.splice(M, 1)
  37816. : '..' === T
  37817. ? (I.splice(M, 1), S++)
  37818. : S && (I.splice(M, 1), S--)
  37819. if (!y && !C) for (; S--; S) I.unshift('..')
  37820. !y || '' === I[0] || (I[0] && '/' === I[0].charAt(0)) || I.unshift(''),
  37821. x && '/' !== I.join('/').substr(-1) && I.push('')
  37822. var R = '' === I[0] || (I[0] && '/' === I[0].charAt(0))
  37823. if (w) {
  37824. i.hostname = i.host = R ? '' : I.length ? I.shift() : ''
  37825. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  37826. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  37827. }
  37828. return (
  37829. (y = y || (i.host && I.length)),
  37830. y && !R && I.unshift(''),
  37831. I.length ? (i.pathname = I.join('/')) : ((i.pathname = null), (i.path = null)),
  37832. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37833. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37834. (i.auth = e.auth || i.auth),
  37835. (i.slashes = i.slashes || e.slashes),
  37836. (i.href = i.format()),
  37837. i
  37838. )
  37839. }),
  37840. (n.prototype.parseHost = function () {
  37841. var e = this.host,
  37842. t = u.exec(e)
  37843. t &&
  37844. ((t = t[0]),
  37845. ':' !== t && (this.port = t.substr(1)),
  37846. (e = e.substr(0, e.length - t.length))),
  37847. e && (this.hostname = e)
  37848. })
  37849. },
  37850. {
  37851. './util': 209,
  37852. punycode: 204,
  37853. querystring: 207
  37854. }
  37855. ],
  37856. 209: [
  37857. function (e, t, i) {
  37858. 'use strict'
  37859. t.exports = {
  37860. isString: function (e) {
  37861. return 'string' == typeof e
  37862. },
  37863. isObject: function (e) {
  37864. return 'object' == typeof e && null !== e
  37865. },
  37866. isNull: function (e) {
  37867. return null === e
  37868. },
  37869. isNullOrUndefined: function (e) {
  37870. return null == e
  37871. }
  37872. }
  37873. },
  37874. {}
  37875. ],
  37876. 210: [
  37877. function (e, t, i) {
  37878. 'use strict'
  37879. function n(e) {
  37880. return l + e
  37881. }
  37882. function r(e) {
  37883. return e.substring(l.length)
  37884. }
  37885. function o(e, t) {
  37886. for (var i in t)
  37887. Object.defineProperty(e, i, {
  37888. value: t[i],
  37889. configurable: !0,
  37890. writable: !0
  37891. })
  37892. }
  37893. function a(e) {
  37894. if ('string' != typeof e) throw new TypeError('key must be a string.')
  37895. }
  37896. var s = Object.prototype.hasOwnProperty,
  37897. l = '~'
  37898. t.exports = function (e) {
  37899. var t = Object.create(null),
  37900. i = 0,
  37901. l = {}
  37902. return (
  37903. o(l, {
  37904. get: function (e, i) {
  37905. a(e)
  37906. var r = n(e)
  37907. return r in t ? t[r] : i
  37908. },
  37909. set: function (e, r) {
  37910. a(e)
  37911. var o = n(e)
  37912. return o in t || ++i, (t[o] = r)
  37913. },
  37914. has: function (e) {
  37915. return a(e), n(e) in t
  37916. },
  37917. delete: function (e) {
  37918. a(e)
  37919. var r = n(e)
  37920. return r in t && (--i, delete t[r], !0)
  37921. },
  37922. clear: function () {
  37923. ;(t = Object.create(null)), (i = 0)
  37924. },
  37925. forEach: function (e, i) {
  37926. if ('function' != typeof e) throw new TypeError('`callback` must be a function')
  37927. for (var n in t)
  37928. if (s.call(t, n)) {
  37929. var o = r(n),
  37930. a = t[n]
  37931. e.call(i, a, o, l)
  37932. }
  37933. }
  37934. }),
  37935. Object.defineProperty(l, 'size', {
  37936. get: function () {
  37937. return i
  37938. },
  37939. configurable: !0
  37940. }),
  37941. 'object' == typeof e &&
  37942. null !== e &&
  37943. Object.keys(e).forEach(function (t) {
  37944. l.set(t, e[t])
  37945. }),
  37946. l
  37947. )
  37948. }
  37949. },
  37950. {}
  37951. ],
  37952. 211: [
  37953. function (e, t, i) {
  37954. t.exports = e('./lib/heap')
  37955. },
  37956. {
  37957. './lib/heap': 212
  37958. }
  37959. ],
  37960. 212: [
  37961. function (e, t, i) {
  37962. ;(function () {
  37963. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m
  37964. ;(r = Math.floor),
  37965. (u = Math.min),
  37966. (n = function (e, t) {
  37967. return e < t ? -1 : e > t ? 1 : 0
  37968. }),
  37969. (h = function (e, t, i, o, a) {
  37970. var s
  37971. if ((null == i && (i = 0), null == a && (a = n), i < 0))
  37972. throw new Error('lo must be non-negative')
  37973. for (null == o && (o = e.length); i < o; )
  37974. (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1)
  37975. return [].splice.apply(e, [i, i - i].concat(t)), t
  37976. }),
  37977. (s = function (e, t, i) {
  37978. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i)
  37979. }),
  37980. (a = function (e, t) {
  37981. var i, r
  37982. return (
  37983. null == t && (t = n),
  37984. (i = e.pop()),
  37985. e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i),
  37986. r
  37987. )
  37988. }),
  37989. (c = function (e, t, i) {
  37990. var r
  37991. return null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r
  37992. }),
  37993. (l = function (e, t, i) {
  37994. var r
  37995. return (
  37996. null == i && (i = n),
  37997. e.length &&
  37998. i(e[0], t) < 0 &&
  37999. ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)),
  38000. t
  38001. )
  38002. }),
  38003. (o = function (e, t) {
  38004. var i, o, a, s, l, c
  38005. for (
  38006. null == t && (t = n),
  38007. s = function () {
  38008. c = []
  38009. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  38010. c.push(t)
  38011. return c
  38012. }
  38013. .apply(this)
  38014. .reverse(),
  38015. l = [],
  38016. o = 0,
  38017. a = s.length;
  38018. o < a;
  38019. o++
  38020. )
  38021. (i = s[o]), l.push(m(e, i, t))
  38022. return l
  38023. }),
  38024. (f = function (e, t, i) {
  38025. var r
  38026. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1))
  38027. return g(e, 0, r, i), m(e, r, i)
  38028. }),
  38029. (d = function (e, t, i) {
  38030. var r, a, s, c, h
  38031. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length)) return a
  38032. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++) (r = h[s]), l(a, r, i)
  38033. return a.sort(i).reverse()
  38034. }),
  38035. (p = function (e, t, i) {
  38036. var r, s, l, c, d, p, f, g, m, v
  38037. if ((null == i && (i = n), 10 * t <= e.length)) {
  38038. if (((c = e.slice(0, t).sort(i)), !c.length)) return c
  38039. for (l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length; d < f; d++)
  38040. (r = g[d]), i(r, l) < 0 && (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]))
  38041. return c
  38042. }
  38043. for (
  38044. o(e, i), v = [], s = p = 0, m = u(t, e.length);
  38045. 0 <= m ? p < m : p > m;
  38046. s = 0 <= m ? ++p : --p
  38047. )
  38048. v.push(a(e, i))
  38049. return v
  38050. }),
  38051. (g = function (e, t, i, r) {
  38052. var o, a, s
  38053. for (
  38054. null == r && (r = n), o = e[i];
  38055. i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0);
  38056. )
  38057. (e[i] = a), (i = s)
  38058. return (e[i] = o)
  38059. }),
  38060. (m = function (e, t, i) {
  38061. var r, o, a, s, l
  38062. for (null == i && (i = n), o = e.length, l = t, a = e[t], r = 2 * t + 1; r < o; )
  38063. (s = r + 1),
  38064. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  38065. (e[t] = e[r]),
  38066. (t = r),
  38067. (r = 2 * t + 1)
  38068. return (e[t] = a), g(e, l, t, i)
  38069. }),
  38070. (e = (function () {
  38071. function e(e) {
  38072. ;(this.cmp = null != e ? e : n), (this.nodes = [])
  38073. }
  38074. return (
  38075. (e.push = s),
  38076. (e.pop = a),
  38077. (e.replace = c),
  38078. (e.pushpop = l),
  38079. (e.heapify = o),
  38080. (e.updateItem = f),
  38081. (e.nlargest = d),
  38082. (e.nsmallest = p),
  38083. (e.prototype.push = function (e) {
  38084. return s(this.nodes, e, this.cmp)
  38085. }),
  38086. (e.prototype.pop = function () {
  38087. return a(this.nodes, this.cmp)
  38088. }),
  38089. (e.prototype.peek = function () {
  38090. return this.nodes[0]
  38091. }),
  38092. (e.prototype.contains = function (e) {
  38093. return this.nodes.indexOf(e) !== -1
  38094. }),
  38095. (e.prototype.replace = function (e) {
  38096. return c(this.nodes, e, this.cmp)
  38097. }),
  38098. (e.prototype.pushpop = function (e) {
  38099. return l(this.nodes, e, this.cmp)
  38100. }),
  38101. (e.prototype.heapify = function () {
  38102. return o(this.nodes, this.cmp)
  38103. }),
  38104. (e.prototype.updateItem = function (e) {
  38105. return f(this.nodes, e, this.cmp)
  38106. }),
  38107. (e.prototype.clear = function () {
  38108. return (this.nodes = [])
  38109. }),
  38110. (e.prototype.empty = function () {
  38111. return 0 === this.nodes.length
  38112. }),
  38113. (e.prototype.size = function () {
  38114. return this.nodes.length
  38115. }),
  38116. (e.prototype.clone = function () {
  38117. var t
  38118. return (t = new e()), (t.nodes = this.nodes.slice(0)), t
  38119. }),
  38120. (e.prototype.toArray = function () {
  38121. return this.nodes.slice(0)
  38122. }),
  38123. (e.prototype.insert = e.prototype.push),
  38124. (e.prototype.top = e.prototype.peek),
  38125. (e.prototype.front = e.prototype.peek),
  38126. (e.prototype.has = e.prototype.contains),
  38127. (e.prototype.copy = e.prototype.clone),
  38128. e
  38129. )
  38130. })()),
  38131. (function (e, n) {
  38132. return 'function' == typeof define && define.amd
  38133. ? define([], n)
  38134. : 'object' == typeof i
  38135. ? (t.exports = n())
  38136. : (e.Heap = n())
  38137. })(this, function () {
  38138. return e
  38139. })
  38140. }).call(this)
  38141. },
  38142. {}
  38143. ],
  38144. 213: [
  38145. function (e, t, i) {
  38146. !(function (e) {
  38147. function i() {}
  38148. function n(e, t) {
  38149. return function () {
  38150. e.apply(t, arguments)
  38151. }
  38152. }
  38153. function r(e) {
  38154. if ('object' != typeof this) throw new TypeError('Promises must be constructed via new')
  38155. if ('function' != typeof e) throw new TypeError('not a function')
  38156. ;(this._state = 0),
  38157. (this._handled = !1),
  38158. (this._value = void 0),
  38159. (this._deferreds = []),
  38160. h(e, this)
  38161. }
  38162. function o(e, t) {
  38163. for (; 3 === e._state; ) e = e._value
  38164. return 0 === e._state
  38165. ? void e._deferreds.push(t)
  38166. : ((e._handled = !0),
  38167. void r._immediateFn(function () {
  38168. var i = 1 === e._state ? t.onFulfilled : t.onRejected
  38169. if (null === i) return void (1 === e._state ? a : s)(t.promise, e._value)
  38170. var n
  38171. try {
  38172. n = i(e._value)
  38173. } catch (e) {
  38174. return void s(t.promise, e)
  38175. }
  38176. a(t.promise, n)
  38177. }))
  38178. }
  38179. function a(e, t) {
  38180. try {
  38181. if (t === e) throw new TypeError('A promise cannot be resolved with itself.')
  38182. if (t && ('object' == typeof t || 'function' == typeof t)) {
  38183. var i = t.then
  38184. if (t instanceof r) return (e._state = 3), (e._value = t), void l(e)
  38185. if ('function' == typeof i) return void h(n(i, t), e)
  38186. }
  38187. ;(e._state = 1), (e._value = t), l(e)
  38188. } catch (t) {
  38189. s(e, t)
  38190. }
  38191. }
  38192. function s(e, t) {
  38193. ;(e._state = 2), (e._value = t), l(e)
  38194. }
  38195. function l(e) {
  38196. 2 === e._state &&
  38197. 0 === e._deferreds.length &&
  38198. r._immediateFn(function () {
  38199. e._handled || r._unhandledRejectionFn(e._value)
  38200. })
  38201. for (var t = 0, i = e._deferreds.length; t < i; t++) o(e, e._deferreds[t])
  38202. e._deferreds = null
  38203. }
  38204. function c(e, t, i) {
  38205. ;(this.onFulfilled = 'function' == typeof e ? e : null),
  38206. (this.onRejected = 'function' == typeof t ? t : null),
  38207. (this.promise = i)
  38208. }
  38209. function h(e, t) {
  38210. var i = !1
  38211. try {
  38212. e(
  38213. function (e) {
  38214. i || ((i = !0), a(t, e))
  38215. },
  38216. function (e) {
  38217. i || ((i = !0), s(t, e))
  38218. }
  38219. )
  38220. } catch (e) {
  38221. if (i) return
  38222. ;(i = !0), s(t, e)
  38223. }
  38224. }
  38225. var u = setTimeout
  38226. ;(r.prototype.catch = function (e) {
  38227. return this.then(null, e)
  38228. }),
  38229. (r.prototype.then = function (e, t) {
  38230. var n = new this.constructor(i)
  38231. return o(this, new c(e, t, n)), n
  38232. }),
  38233. (r.all = function (e) {
  38234. var t = Array.prototype.slice.call(e)
  38235. return new r(function (e, i) {
  38236. function n(o, a) {
  38237. try {
  38238. if (a && ('object' == typeof a || 'function' == typeof a)) {
  38239. var s = a.then
  38240. if ('function' == typeof s)
  38241. return void s.call(
  38242. a,
  38243. function (e) {
  38244. n(o, e)
  38245. },
  38246. i
  38247. )
  38248. }
  38249. ;(t[o] = a), 0 === --r && e(t)
  38250. } catch (e) {
  38251. i(e)
  38252. }
  38253. }
  38254. if (0 === t.length) return e([])
  38255. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o])
  38256. })
  38257. }),
  38258. (r.resolve = function (e) {
  38259. return e && 'object' == typeof e && e.constructor === r
  38260. ? e
  38261. : new r(function (t) {
  38262. t(e)
  38263. })
  38264. }),
  38265. (r.reject = function (e) {
  38266. return new r(function (t, i) {
  38267. i(e)
  38268. })
  38269. }),
  38270. (r.race = function (e) {
  38271. return new r(function (t, i) {
  38272. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i)
  38273. })
  38274. }),
  38275. (r._immediateFn =
  38276. ('function' == typeof setImmediate &&
  38277. function (e) {
  38278. setImmediate(e)
  38279. }) ||
  38280. function (e) {
  38281. u(e, 0)
  38282. }),
  38283. (r._unhandledRejectionFn = function (e) {
  38284. 'undefined' != typeof console &&
  38285. console &&
  38286. console.warn('Possible Unhandled Promise Rejection:', e)
  38287. }),
  38288. (r._setImmediateFn = function (e) {
  38289. r._immediateFn = e
  38290. }),
  38291. (r._setUnhandledRejectionFn = function (e) {
  38292. r._unhandledRejectionFn = e
  38293. }),
  38294. 'undefined' != typeof t && t.exports ? (t.exports = r) : e.Promise || (e.Promise = r)
  38295. })(this)
  38296. },
  38297. {}
  38298. ],
  38299. 214: [
  38300. function (e, t, i) {
  38301. ;(function (i) {
  38302. !(function (i, n) {
  38303. 'function' == typeof define && define.amd
  38304. ? define(['bytebuffer'], n)
  38305. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  38306. ? (t.exports = n(e('bytebuffer'), !0))
  38307. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer))
  38308. })(this, function (t, n) {
  38309. 'use strict'
  38310. var r = {}
  38311. return (
  38312. (r.ByteBuffer = t),
  38313. (r.Long = t.Long || null),
  38314. (r.VERSION = '5.0.1'),
  38315. (r.WIRE_TYPES = {}),
  38316. (r.WIRE_TYPES.VARINT = 0),
  38317. (r.WIRE_TYPES.BITS64 = 1),
  38318. (r.WIRE_TYPES.LDELIM = 2),
  38319. (r.WIRE_TYPES.STARTGROUP = 3),
  38320. (r.WIRE_TYPES.ENDGROUP = 4),
  38321. (r.WIRE_TYPES.BITS32 = 5),
  38322. (r.PACKABLE_WIRE_TYPES = [
  38323. r.WIRE_TYPES.VARINT,
  38324. r.WIRE_TYPES.BITS64,
  38325. r.WIRE_TYPES.BITS32
  38326. ]),
  38327. (r.TYPES = {
  38328. int32: {
  38329. name: 'int32',
  38330. wireType: r.WIRE_TYPES.VARINT,
  38331. defaultValue: 0
  38332. },
  38333. uint32: {
  38334. name: 'uint32',
  38335. wireType: r.WIRE_TYPES.VARINT,
  38336. defaultValue: 0
  38337. },
  38338. sint32: {
  38339. name: 'sint32',
  38340. wireType: r.WIRE_TYPES.VARINT,
  38341. defaultValue: 0
  38342. },
  38343. int64: {
  38344. name: 'int64',
  38345. wireType: r.WIRE_TYPES.VARINT,
  38346. defaultValue: r.Long ? r.Long.ZERO : void 0
  38347. },
  38348. uint64: {
  38349. name: 'uint64',
  38350. wireType: r.WIRE_TYPES.VARINT,
  38351. defaultValue: r.Long ? r.Long.UZERO : void 0
  38352. },
  38353. sint64: {
  38354. name: 'sint64',
  38355. wireType: r.WIRE_TYPES.VARINT,
  38356. defaultValue: r.Long ? r.Long.ZERO : void 0
  38357. },
  38358. bool: {
  38359. name: 'bool',
  38360. wireType: r.WIRE_TYPES.VARINT,
  38361. defaultValue: !1
  38362. },
  38363. double: {
  38364. name: 'double',
  38365. wireType: r.WIRE_TYPES.BITS64,
  38366. defaultValue: 0
  38367. },
  38368. string: {
  38369. name: 'string',
  38370. wireType: r.WIRE_TYPES.LDELIM,
  38371. defaultValue: ''
  38372. },
  38373. bytes: {
  38374. name: 'bytes',
  38375. wireType: r.WIRE_TYPES.LDELIM,
  38376. defaultValue: null
  38377. },
  38378. fixed32: {
  38379. name: 'fixed32',
  38380. wireType: r.WIRE_TYPES.BITS32,
  38381. defaultValue: 0
  38382. },
  38383. sfixed32: {
  38384. name: 'sfixed32',
  38385. wireType: r.WIRE_TYPES.BITS32,
  38386. defaultValue: 0
  38387. },
  38388. fixed64: {
  38389. name: 'fixed64',
  38390. wireType: r.WIRE_TYPES.BITS64,
  38391. defaultValue: r.Long ? r.Long.UZERO : void 0
  38392. },
  38393. sfixed64: {
  38394. name: 'sfixed64',
  38395. wireType: r.WIRE_TYPES.BITS64,
  38396. defaultValue: r.Long ? r.Long.ZERO : void 0
  38397. },
  38398. float: {
  38399. name: 'float',
  38400. wireType: r.WIRE_TYPES.BITS32,
  38401. defaultValue: 0
  38402. },
  38403. enum: {
  38404. name: 'enum',
  38405. wireType: r.WIRE_TYPES.VARINT,
  38406. defaultValue: 0
  38407. },
  38408. message: {
  38409. name: 'message',
  38410. wireType: r.WIRE_TYPES.LDELIM,
  38411. defaultValue: null
  38412. },
  38413. group: {
  38414. name: 'group',
  38415. wireType: r.WIRE_TYPES.STARTGROUP,
  38416. defaultValue: null
  38417. }
  38418. }),
  38419. (r.MAP_KEY_TYPES = [
  38420. r.TYPES.int32,
  38421. r.TYPES.sint32,
  38422. r.TYPES.sfixed32,
  38423. r.TYPES.uint32,
  38424. r.TYPES.fixed32,
  38425. r.TYPES.int64,
  38426. r.TYPES.sint64,
  38427. r.TYPES.sfixed64,
  38428. r.TYPES.uint64,
  38429. r.TYPES.fixed64,
  38430. r.TYPES.bool,
  38431. r.TYPES.string,
  38432. r.TYPES.bytes
  38433. ]),
  38434. (r.ID_MIN = 1),
  38435. (r.ID_MAX = 536870911),
  38436. (r.convertFieldsToCamelCase = !1),
  38437. (r.populateAccessors = !0),
  38438. (r.populateDefaults = !0),
  38439. (r.Util = (function () {
  38440. var t = {}
  38441. return (
  38442. (t.IS_NODE = !(
  38443. 'object' != typeof i ||
  38444. i + '' != '[object process]' ||
  38445. i.browser
  38446. )),
  38447. (t.XHR = function () {
  38448. for (
  38449. var e = [
  38450. function () {
  38451. return new XMLHttpRequest()
  38452. },
  38453. function () {
  38454. return new ActiveXObject('Msxml2.XMLHTTP')
  38455. },
  38456. function () {
  38457. return new ActiveXObject('Msxml3.XMLHTTP')
  38458. },
  38459. function () {
  38460. return new ActiveXObject('Microsoft.XMLHTTP')
  38461. }
  38462. ],
  38463. t = null,
  38464. i = 0;
  38465. i < e.length;
  38466. i++
  38467. ) {
  38468. try {
  38469. t = e[i]()
  38470. } catch (e) {
  38471. continue
  38472. }
  38473. break
  38474. }
  38475. if (!t) throw Error('XMLHttpRequest is not supported')
  38476. return t
  38477. }),
  38478. (t.fetch = function (i, n) {
  38479. if ((n && 'function' != typeof n && (n = null), t.IS_NODE)) {
  38480. var r = e('fs')
  38481. if (n)
  38482. r.readFile(i, function (e, t) {
  38483. n(e ? null : '' + t)
  38484. })
  38485. else
  38486. try {
  38487. return r.readFileSync(i)
  38488. } catch (e) {
  38489. return null
  38490. }
  38491. } else {
  38492. var o = t.XHR()
  38493. if (
  38494. (o.open('GET', i, !!n),
  38495. o.setRequestHeader('Accept', 'text/plain'),
  38496. 'function' == typeof o.overrideMimeType && o.overrideMimeType('text/plain'),
  38497. !n)
  38498. )
  38499. return (
  38500. o.send(null),
  38501. 200 == o.status || (0 == o.status && 'string' == typeof o.responseText)
  38502. ? o.responseText
  38503. : null
  38504. )
  38505. if (
  38506. ((o.onreadystatechange = function () {
  38507. 4 == o.readyState &&
  38508. n(
  38509. 200 == o.status ||
  38510. (0 == o.status && 'string' == typeof o.responseText)
  38511. ? o.responseText
  38512. : null
  38513. )
  38514. }),
  38515. 4 == o.readyState)
  38516. )
  38517. return
  38518. o.send(null)
  38519. }
  38520. }),
  38521. (t.toCamelCase = function (e) {
  38522. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  38523. return t.toUpperCase()
  38524. })
  38525. }),
  38526. t
  38527. )
  38528. })()),
  38529. (r.Lang = {
  38530. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  38531. RULE: /^(?:required|optional|repeated|map)$/,
  38532. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  38533. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  38534. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  38535. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  38536. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  38537. NUMBER:
  38538. /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  38539. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  38540. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  38541. NUMBER_OCT: /^0[0-7]+$/,
  38542. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  38543. BOOL: /^(?:true|false)$/i,
  38544. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38545. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38546. WHITESPACE: /\s/,
  38547. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  38548. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  38549. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  38550. }),
  38551. (r.DotProto = (function (e, t) {
  38552. function i(e, i) {
  38553. var n = -1,
  38554. r = 1
  38555. if (
  38556. ('-' == e.charAt(0) && ((r = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38557. )
  38558. n = parseInt(e)
  38559. else if (t.NUMBER_HEX.test(e)) n = parseInt(e.substring(2), 16)
  38560. else {
  38561. if (!t.NUMBER_OCT.test(e))
  38562. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  38563. n = parseInt(e.substring(1), 8)
  38564. }
  38565. if (((n = (r * n) | 0), !i && n < 0))
  38566. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  38567. return n
  38568. }
  38569. function n(e) {
  38570. var i = 1
  38571. if (
  38572. ('-' == e.charAt(0) && ((i = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38573. )
  38574. return i * parseInt(e, 10)
  38575. if (t.NUMBER_HEX.test(e)) return i * parseInt(e.substring(2), 16)
  38576. if (t.NUMBER_OCT.test(e)) return i * parseInt(e.substring(1), 8)
  38577. if ('inf' === e) return i * (1 / 0)
  38578. if ('nan' === e) return NaN
  38579. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e)
  38580. throw Error('illegal number value: ' + (i < 0 ? '-' : '') + e)
  38581. }
  38582. function r(e, t, i) {
  38583. 'undefined' == typeof e[t]
  38584. ? (e[t] = i)
  38585. : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i))
  38586. }
  38587. var o = {},
  38588. a = function (e) {
  38589. ;(this.source = e + ''),
  38590. (this.index = 0),
  38591. (this.line = 1),
  38592. (this.stack = []),
  38593. (this._stringOpen = null)
  38594. },
  38595. s = a.prototype
  38596. ;(s._readString = function () {
  38597. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ
  38598. e.lastIndex = this.index - 1
  38599. var i = e.exec(this.source)
  38600. if (!i) throw Error('unterminated string')
  38601. return (
  38602. (this.index = e.lastIndex),
  38603. this.stack.push(this._stringOpen),
  38604. (this._stringOpen = null),
  38605. i[1]
  38606. )
  38607. }),
  38608. (s.next = function () {
  38609. if (this.stack.length > 0) return this.stack.shift()
  38610. if (this.index >= this.source.length) return null
  38611. if (null !== this._stringOpen) return this._readString()
  38612. var e, i, n
  38613. do {
  38614. for (e = !1; t.WHITESPACE.test((n = this.source.charAt(this.index))); )
  38615. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38616. return null
  38617. if ('/' === this.source.charAt(this.index))
  38618. if ((++this.index, '/' === this.source.charAt(this.index))) {
  38619. for (; '\n' !== this.source.charAt(++this.index); )
  38620. if (this.index == this.source.length) return null
  38621. ++this.index, ++this.line, (e = !0)
  38622. } else {
  38623. if ('*' !== (n = this.source.charAt(this.index))) return '/'
  38624. do {
  38625. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38626. return null
  38627. ;(i = n), (n = this.source.charAt(this.index))
  38628. } while ('*' !== i || '/' !== n)
  38629. ++this.index, (e = !0)
  38630. }
  38631. } while (e)
  38632. if (this.index === this.source.length) return null
  38633. var r = this.index
  38634. t.DELIM.lastIndex = 0
  38635. var o = t.DELIM.test(this.source.charAt(r++))
  38636. if (!o)
  38637. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); ) ++r
  38638. var a = this.source.substring(this.index, (this.index = r))
  38639. return ('"' !== a && "'" !== a) || (this._stringOpen = a), a
  38640. }),
  38641. (s.peek = function () {
  38642. if (0 === this.stack.length) {
  38643. var e = this.next()
  38644. if (null === e) return null
  38645. this.stack.push(e)
  38646. }
  38647. return this.stack[0]
  38648. }),
  38649. (s.skip = function (e) {
  38650. var t = this.next()
  38651. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected")
  38652. }),
  38653. (s.omit = function (e) {
  38654. return this.peek() === e && (this.next(), !0)
  38655. }),
  38656. (s.toString = function () {
  38657. return (
  38658. 'Tokenizer (' +
  38659. this.index +
  38660. '/' +
  38661. this.source.length +
  38662. ' at line ' +
  38663. this.line +
  38664. ')'
  38665. )
  38666. }),
  38667. (o.Tokenizer = a)
  38668. var l = function (e) {
  38669. ;(this.tn = new a(e)), (this.proto3 = !1)
  38670. },
  38671. c = l.prototype
  38672. return (
  38673. (c.parse = function () {
  38674. var e,
  38675. i,
  38676. n = {
  38677. name: '[ROOT]',
  38678. package: null,
  38679. messages: [],
  38680. enums: [],
  38681. imports: [],
  38682. options: {},
  38683. services: []
  38684. },
  38685. r = !0
  38686. try {
  38687. for (; (e = this.tn.next()); )
  38688. switch (e) {
  38689. case 'package':
  38690. if (!r || null !== n.package) throw Error("unexpected 'package'")
  38691. if (((e = this.tn.next()), !t.TYPEREF.test(e)))
  38692. throw Error('illegal package name: ' + e)
  38693. this.tn.skip(';'), (n.package = e)
  38694. break
  38695. case 'import':
  38696. if (!r) throw Error("unexpected 'import'")
  38697. ;(e = this.tn.peek()),
  38698. ('public' === e || (i = 'weak' === e)) && this.tn.next(),
  38699. (e = this._readString()),
  38700. this.tn.skip(';'),
  38701. i || n.imports.push(e)
  38702. break
  38703. case 'syntax':
  38704. if (!r) throw Error("unexpected 'syntax'")
  38705. this.tn.skip('='),
  38706. 'proto3' === (n.syntax = this._readString()) && (this.proto3 = !0),
  38707. this.tn.skip(';')
  38708. break
  38709. case 'message':
  38710. this._parseMessage(n, null), (r = !1)
  38711. break
  38712. case 'enum':
  38713. this._parseEnum(n), (r = !1)
  38714. break
  38715. case 'option':
  38716. this._parseOption(n)
  38717. break
  38718. case 'service':
  38719. this._parseService(n)
  38720. break
  38721. case 'extend':
  38722. this._parseExtend(n)
  38723. break
  38724. default:
  38725. throw Error("unexpected '" + e + "'")
  38726. }
  38727. } catch (e) {
  38728. throw (
  38729. ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  38730. )
  38731. }
  38732. return delete n.name, n
  38733. }),
  38734. (l.parse = function (e) {
  38735. return new l(e).parse()
  38736. }),
  38737. (c._readString = function () {
  38738. var e,
  38739. t,
  38740. i = ''
  38741. do {
  38742. if (((t = this.tn.next()), "'" !== t && '"' !== t))
  38743. throw Error('illegal string delimiter: ' + t)
  38744. ;(i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek())
  38745. } while ('"' === e || '"' === e)
  38746. return i
  38747. }),
  38748. (c._readValue = function (e) {
  38749. var i = this.tn.peek()
  38750. if ('"' === i || "'" === i) return this._readString()
  38751. if ((this.tn.next(), t.NUMBER.test(i))) return n(i)
  38752. if (t.BOOL.test(i)) return 'true' === i.toLowerCase()
  38753. if (e && t.TYPEREF.test(i)) return i
  38754. throw Error('illegal value: ' + i)
  38755. }),
  38756. (c._parseOption = function (e, i) {
  38757. var n = this.tn.next(),
  38758. r = !1
  38759. if (('(' === n && ((r = !0), (n = this.tn.next())), !t.TYPEREF.test(n)))
  38760. throw Error('illegal option name: ' + n)
  38761. var o = n
  38762. r &&
  38763. (this.tn.skip(')'),
  38764. (o = '(' + o + ')'),
  38765. (n = this.tn.peek()),
  38766. t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  38767. this.tn.skip('='),
  38768. this._parseOptionValue(e, o),
  38769. i || this.tn.skip(';')
  38770. }),
  38771. (c._parseOptionValue = function (e, i) {
  38772. var n = this.tn.peek()
  38773. if ('{' !== n) r(e.options, i, this._readValue(!0))
  38774. else
  38775. for (this.tn.skip('{'); '}' !== (n = this.tn.next()); ) {
  38776. if (!t.NAME.test(n)) throw Error('illegal option name: ' + i + '.' + n)
  38777. this.tn.omit(':')
  38778. ? r(e.options, i + '.' + n, this._readValue(!0))
  38779. : this._parseOptionValue(e, i + '.' + n)
  38780. }
  38781. }),
  38782. (c._parseService = function (e) {
  38783. var i = this.tn.next()
  38784. if (!t.NAME.test(i))
  38785. throw Error('illegal service name at line ' + this.tn.line + ': ' + i)
  38786. var n = i,
  38787. r = {
  38788. name: n,
  38789. rpc: {},
  38790. options: {}
  38791. }
  38792. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38793. if ('option' === i) this._parseOption(r)
  38794. else {
  38795. if ('rpc' !== i) throw Error('illegal service token: ' + i)
  38796. this._parseServiceRPC(r)
  38797. }
  38798. this.tn.omit(';'), e.services.push(r)
  38799. }),
  38800. (c._parseServiceRPC = function (e) {
  38801. var i = 'rpc',
  38802. n = this.tn.next()
  38803. if (!t.NAME.test(n)) throw Error('illegal rpc service method name: ' + n)
  38804. var r = n,
  38805. o = {
  38806. request: null,
  38807. response: null,
  38808. request_stream: !1,
  38809. response_stream: !1,
  38810. options: {}
  38811. }
  38812. if (
  38813. (this.tn.skip('('),
  38814. (n = this.tn.next()),
  38815. 'stream' === n.toLowerCase() &&
  38816. ((o.request_stream = !0), (n = this.tn.next())),
  38817. !t.TYPEREF.test(n))
  38818. )
  38819. throw Error('illegal rpc service request type: ' + n)
  38820. if (
  38821. ((o.request = n),
  38822. this.tn.skip(')'),
  38823. (n = this.tn.next()),
  38824. 'returns' !== n.toLowerCase())
  38825. )
  38826. throw Error('illegal rpc service request type delimiter: ' + n)
  38827. if (
  38828. (this.tn.skip('('),
  38829. (n = this.tn.next()),
  38830. 'stream' === n.toLowerCase() &&
  38831. ((o.response_stream = !0), (n = this.tn.next())),
  38832. (o.response = n),
  38833. this.tn.skip(')'),
  38834. (n = this.tn.peek()),
  38835. '{' === n)
  38836. ) {
  38837. for (this.tn.next(); '}' !== (n = this.tn.next()); ) {
  38838. if ('option' !== n) throw Error('illegal rpc service token: ' + n)
  38839. this._parseOption(o)
  38840. }
  38841. this.tn.omit(';')
  38842. } else this.tn.skip(';')
  38843. 'undefined' == typeof e[i] && (e[i] = {}), (e[i][r] = o)
  38844. }),
  38845. (c._parseMessage = function (e, n) {
  38846. var r = !!n,
  38847. o = this.tn.next(),
  38848. a = {
  38849. name: '',
  38850. fields: [],
  38851. enums: [],
  38852. messages: [],
  38853. options: {},
  38854. services: [],
  38855. oneofs: {}
  38856. }
  38857. if (!t.NAME.test(o))
  38858. throw Error('illegal ' + (r ? 'group' : 'message') + ' name: ' + o)
  38859. for (
  38860. a.name = o,
  38861. r && (this.tn.skip('='), (n.id = i(this.tn.next())), (a.isGroup = !0)),
  38862. o = this.tn.peek(),
  38863. '[' === o && n && this._parseFieldOptions(n),
  38864. this.tn.skip('{');
  38865. '}' !== (o = this.tn.next());
  38866. )
  38867. if (t.RULE.test(o)) this._parseMessageField(a, o)
  38868. else if ('oneof' === o) this._parseMessageOneOf(a)
  38869. else if ('enum' === o) this._parseEnum(a)
  38870. else if ('message' === o) this._parseMessage(a)
  38871. else if ('option' === o) this._parseOption(a)
  38872. else if ('service' === o) this._parseService(a)
  38873. else if ('extensions' === o) a.extensions = this._parseExtensionRanges()
  38874. else if ('reserved' === o) this._parseIgnored()
  38875. else if ('extend' === o) this._parseExtend(a)
  38876. else {
  38877. if (!t.TYPEREF.test(o)) throw Error('illegal message token: ' + o)
  38878. if (!this.proto3) throw Error('illegal field rule: ' + o)
  38879. this._parseMessageField(a, 'optional', o)
  38880. }
  38881. return this.tn.omit(';'), e.messages.push(a), a
  38882. }),
  38883. (c._parseIgnored = function () {
  38884. for (; ';' !== this.tn.peek(); ) this.tn.next()
  38885. this.tn.skip(';')
  38886. }),
  38887. (c._parseMessageField = function (e, n, r) {
  38888. if (!t.RULE.test(n)) throw Error('illegal message field rule: ' + n)
  38889. var o,
  38890. a = {
  38891. rule: n,
  38892. type: '',
  38893. name: '',
  38894. options: {},
  38895. id: 0
  38896. }
  38897. if ('map' === n) {
  38898. if (r) throw Error('illegal type: ' + r)
  38899. if (
  38900. (this.tn.skip('<'),
  38901. (o = this.tn.next()),
  38902. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38903. )
  38904. throw Error('illegal message field type: ' + o)
  38905. if (
  38906. ((a.keytype = o),
  38907. this.tn.skip(','),
  38908. (o = this.tn.next()),
  38909. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38910. )
  38911. throw Error('illegal message field: ' + o)
  38912. if (((a.type = o), this.tn.skip('>'), (o = this.tn.next()), !t.NAME.test(o)))
  38913. throw Error('illegal message field name: ' + o)
  38914. ;(a.name = o),
  38915. this.tn.skip('='),
  38916. (a.id = i(this.tn.next())),
  38917. (o = this.tn.peek()),
  38918. '[' === o && this._parseFieldOptions(a),
  38919. this.tn.skip(';')
  38920. } else if (
  38921. ((r = 'undefined' != typeof r ? r : this.tn.next()), 'group' === r)
  38922. ) {
  38923. var s = this._parseMessage(e, a)
  38924. if (!/^[A-Z]/.test(s.name)) throw Error('illegal group name: ' + s.name)
  38925. ;(a.type = s.name), (a.name = s.name.toLowerCase()), this.tn.omit(';')
  38926. } else {
  38927. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  38928. throw Error('illegal message field type: ' + r)
  38929. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o)))
  38930. throw Error('illegal message field name: ' + o)
  38931. ;(a.name = o),
  38932. this.tn.skip('='),
  38933. (a.id = i(this.tn.next())),
  38934. (o = this.tn.peek()),
  38935. '[' === o && this._parseFieldOptions(a),
  38936. this.tn.skip(';')
  38937. }
  38938. return e.fields.push(a), a
  38939. }),
  38940. (c._parseMessageOneOf = function (e) {
  38941. var i = this.tn.next()
  38942. if (!t.NAME.test(i)) throw Error('illegal oneof name: ' + i)
  38943. var n,
  38944. r = i,
  38945. o = []
  38946. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38947. (n = this._parseMessageField(e, 'optional', i)), (n.oneof = r), o.push(n.id)
  38948. this.tn.omit(';'), (e.oneofs[r] = o)
  38949. }),
  38950. (c._parseFieldOptions = function (e) {
  38951. this.tn.skip('[')
  38952. for (var t, i = !0; ']' !== (t = this.tn.peek()); )
  38953. i || this.tn.skip(','), this._parseOption(e, !0), (i = !1)
  38954. this.tn.next()
  38955. }),
  38956. (c._parseEnum = function (e) {
  38957. var n = {
  38958. name: '',
  38959. values: [],
  38960. options: {}
  38961. },
  38962. r = this.tn.next()
  38963. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  38964. for (n.name = r, this.tn.skip('{'); '}' !== (r = this.tn.next()); )
  38965. if ('option' === r) this._parseOption(n)
  38966. else {
  38967. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  38968. this.tn.skip('=')
  38969. var o = {
  38970. name: r,
  38971. id: i(this.tn.next(), !0)
  38972. }
  38973. ;(r = this.tn.peek()),
  38974. '[' === r &&
  38975. this._parseFieldOptions({
  38976. options: {}
  38977. }),
  38978. this.tn.skip(';'),
  38979. n.values.push(o)
  38980. }
  38981. this.tn.omit(';'), e.enums.push(n)
  38982. }),
  38983. (c._parseExtensionRanges = function () {
  38984. var t,
  38985. i,
  38986. r,
  38987. o = []
  38988. do {
  38989. for (i = []; ; ) {
  38990. switch ((t = this.tn.next())) {
  38991. case 'min':
  38992. r = e.ID_MIN
  38993. break
  38994. case 'max':
  38995. r = e.ID_MAX
  38996. break
  38997. default:
  38998. r = n(t)
  38999. }
  39000. if ((i.push(r), 2 === i.length)) break
  39001. if ('to' !== this.tn.peek()) {
  39002. i.push(r)
  39003. break
  39004. }
  39005. this.tn.next()
  39006. }
  39007. o.push(i)
  39008. } while (this.tn.omit(','))
  39009. return this.tn.skip(';'), o
  39010. }),
  39011. (c._parseExtend = function (e) {
  39012. var i = this.tn.next()
  39013. if (!t.TYPEREF.test(i)) throw Error('illegal extend reference: ' + i)
  39014. var n = {
  39015. ref: i,
  39016. fields: []
  39017. }
  39018. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  39019. if (t.RULE.test(i)) this._parseMessageField(n, i)
  39020. else {
  39021. if (!t.TYPEREF.test(i)) throw Error('illegal extend token: ' + i)
  39022. if (!this.proto3) throw Error('illegal field rule: ' + i)
  39023. this._parseMessageField(n, 'optional', i)
  39024. }
  39025. return this.tn.omit(';'), e.messages.push(n), n
  39026. }),
  39027. (c.toString = function () {
  39028. return 'Parser at line ' + this.tn.line
  39029. }),
  39030. (o.Parser = l),
  39031. o
  39032. )
  39033. })(r, r.Lang)),
  39034. (r.Reflect = (function (e) {
  39035. function i(i) {
  39036. if (
  39037. ('string' == typeof i && (i = e.TYPES[i]), 'undefined' == typeof i.defaultValue)
  39038. )
  39039. throw Error('default value for type ' + i.name + ' is not supported')
  39040. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  39041. }
  39042. function n(t, i) {
  39043. if (
  39044. t &&
  39045. 'number' == typeof t.low &&
  39046. 'number' == typeof t.high &&
  39047. 'boolean' == typeof t.unsigned &&
  39048. t.low === t.low &&
  39049. t.high === t.high
  39050. )
  39051. return new e.Long(t.low, t.high, 'undefined' == typeof i ? t.unsigned : i)
  39052. if ('string' == typeof t) return e.Long.fromString(t, i || !1, 10)
  39053. if ('number' == typeof t) return e.Long.fromNumber(t, i || !1)
  39054. throw Error('not convertible to Long')
  39055. }
  39056. function r(t, i) {
  39057. var n = i.readVarint32(),
  39058. o = 7 & n,
  39059. a = n >>> 3
  39060. switch (o) {
  39061. case e.WIRE_TYPES.VARINT:
  39062. do n = i.readUint8()
  39063. while (128 === (128 & n))
  39064. break
  39065. case e.WIRE_TYPES.BITS64:
  39066. i.offset += 8
  39067. break
  39068. case e.WIRE_TYPES.LDELIM:
  39069. ;(n = i.readVarint32()), (i.offset += n)
  39070. break
  39071. case e.WIRE_TYPES.STARTGROUP:
  39072. r(a, i)
  39073. break
  39074. case e.WIRE_TYPES.ENDGROUP:
  39075. if (a === t) return !1
  39076. throw Error(
  39077. 'Illegal GROUPEND after unknown group: ' + a + ' (' + t + ' expected)'
  39078. )
  39079. case e.WIRE_TYPES.BITS32:
  39080. i.offset += 4
  39081. break
  39082. default:
  39083. throw Error('Illegal wire type in unknown group ' + t + ': ' + o)
  39084. }
  39085. return !0
  39086. }
  39087. var o = {},
  39088. a = function (e, t, i) {
  39089. ;(this.builder = e), (this.parent = t), (this.name = i), this.className
  39090. },
  39091. s = a.prototype
  39092. ;(s.fqn = function () {
  39093. for (var e = this.name, t = this; ; ) {
  39094. if (((t = t.parent), null == t)) break
  39095. e = t.name + '.' + e
  39096. }
  39097. return e
  39098. }),
  39099. (s.toString = function (e) {
  39100. return (e ? this.className + ' ' : '') + this.fqn()
  39101. }),
  39102. (s.build = function () {
  39103. throw Error(this.toString(!0) + ' cannot be built directly')
  39104. }),
  39105. (o.T = a)
  39106. var l = function (e, t, i, n, r) {
  39107. a.call(this, e, t, i),
  39108. (this.className = 'Namespace'),
  39109. (this.children = []),
  39110. (this.options = n || {}),
  39111. (this.syntax = r || 'proto2')
  39112. },
  39113. c = (l.prototype = Object.create(a.prototype))
  39114. ;(c.getChildren = function (e) {
  39115. if (((e = e || null), null == e)) return this.children.slice()
  39116. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  39117. this.children[i] instanceof e && t.push(this.children[i])
  39118. return t
  39119. }),
  39120. (c.addChild = function (e) {
  39121. var t
  39122. if ((t = this.getChild(e.name)))
  39123. if (
  39124. t instanceof d.Field &&
  39125. t.name !== t.originalName &&
  39126. null === this.getChild(t.originalName)
  39127. )
  39128. t.name = t.originalName
  39129. else {
  39130. if (
  39131. !(
  39132. e instanceof d.Field &&
  39133. e.name !== e.originalName &&
  39134. null === this.getChild(e.originalName)
  39135. )
  39136. )
  39137. throw Error(
  39138. 'Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name
  39139. )
  39140. e.name = e.originalName
  39141. }
  39142. this.children.push(e)
  39143. }),
  39144. (c.getChild = function (e) {
  39145. for (
  39146. var t = 'number' == typeof e ? 'id' : 'name', i = 0, n = this.children.length;
  39147. i < n;
  39148. ++i
  39149. )
  39150. if (this.children[i][t] === e) return this.children[i]
  39151. return null
  39152. }),
  39153. (c.resolve = function (e, t) {
  39154. var i = 'string' == typeof e ? e.split('.') : e,
  39155. n = this,
  39156. r = 0
  39157. if ('' === i[r]) {
  39158. for (; null !== n.parent; ) n = n.parent
  39159. r++
  39160. }
  39161. var a
  39162. do {
  39163. do {
  39164. if (!(n instanceof o.Namespace)) {
  39165. n = null
  39166. break
  39167. }
  39168. if (
  39169. ((a = n.getChild(i[r])),
  39170. !a || !(a instanceof o.T) || (t && !(a instanceof o.Namespace)))
  39171. ) {
  39172. n = null
  39173. break
  39174. }
  39175. ;(n = a), r++
  39176. } while (r < i.length)
  39177. if (null != n) break
  39178. if (null !== this.parent) return this.parent.resolve(e, t)
  39179. } while (null != n)
  39180. return n
  39181. }),
  39182. (c.qn = function (e) {
  39183. var t = [],
  39184. i = e
  39185. do t.unshift(i.name), (i = i.parent)
  39186. while (null !== i)
  39187. for (var n = 1; n <= t.length; n++) {
  39188. var r = t.slice(t.length - n)
  39189. if (e === this.resolve(r, e instanceof o.Namespace)) return r.join('.')
  39190. }
  39191. return e.fqn()
  39192. }),
  39193. (c.build = function () {
  39194. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  39195. (e = i[n]), e instanceof l && (t[e.name] = e.build())
  39196. return (
  39197. Object.defineProperty &&
  39198. Object.defineProperty(t, '$options', {
  39199. value: this.buildOpt()
  39200. }),
  39201. t
  39202. )
  39203. }),
  39204. (c.buildOpt = function () {
  39205. for (
  39206. var e = {}, t = Object.keys(this.options), i = 0, n = t.length;
  39207. i < n;
  39208. ++i
  39209. ) {
  39210. var r = t[i],
  39211. o = this.options[t[i]]
  39212. e[r] = o
  39213. }
  39214. return e
  39215. }),
  39216. (c.getOption = function (e) {
  39217. return 'undefined' == typeof e
  39218. ? this.options
  39219. : 'undefined' != typeof this.options[e]
  39220. ? this.options[e]
  39221. : null
  39222. }),
  39223. (o.Namespace = l)
  39224. var h = function (t, i, n, r) {
  39225. if (
  39226. ((this.type = t),
  39227. (this.resolvedType = i),
  39228. (this.isMapKey = n),
  39229. (this.syntax = r),
  39230. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  39231. )
  39232. throw Error('Invalid map key type: ' + t.name)
  39233. },
  39234. u = h.prototype
  39235. ;(h.defaultFieldValue = i),
  39236. (u.verifyValue = function (i) {
  39237. function r(e, t) {
  39238. throw Error(
  39239. 'Illegal value for ' +
  39240. o.toString(!0) +
  39241. ' of type ' +
  39242. o.type.name +
  39243. ': ' +
  39244. e +
  39245. ' (' +
  39246. t +
  39247. ')'
  39248. )
  39249. }
  39250. var o = this
  39251. switch (this.type) {
  39252. case e.TYPES.int32:
  39253. case e.TYPES.sint32:
  39254. case e.TYPES.sfixed32:
  39255. return (
  39256. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39257. r(typeof i, 'not an integer'),
  39258. i > 4294967295 ? 0 | i : i
  39259. )
  39260. case e.TYPES.uint32:
  39261. case e.TYPES.fixed32:
  39262. return (
  39263. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39264. r(typeof i, 'not an integer'),
  39265. i < 0 ? i >>> 0 : i
  39266. )
  39267. case e.TYPES.int64:
  39268. case e.TYPES.sint64:
  39269. case e.TYPES.sfixed64:
  39270. if (e.Long)
  39271. try {
  39272. return n(i, !1)
  39273. } catch (e) {
  39274. r(typeof i, e.message)
  39275. }
  39276. else r(typeof i, 'requires Long.js')
  39277. case e.TYPES.uint64:
  39278. case e.TYPES.fixed64:
  39279. if (e.Long)
  39280. try {
  39281. return n(i, !0)
  39282. } catch (e) {
  39283. r(typeof i, e.message)
  39284. }
  39285. else r(typeof i, 'requires Long.js')
  39286. case e.TYPES.bool:
  39287. return 'boolean' != typeof i && r(typeof i, 'not a boolean'), i
  39288. case e.TYPES.float:
  39289. case e.TYPES.double:
  39290. return 'number' != typeof i && r(typeof i, 'not a number'), i
  39291. case e.TYPES.string:
  39292. return (
  39293. 'string' == typeof i ||
  39294. (i && i instanceof String) ||
  39295. r(typeof i, 'not a string'),
  39296. '' + i
  39297. )
  39298. case e.TYPES.bytes:
  39299. return t.isByteBuffer(i) ? i : t.wrap(i, 'base64')
  39300. case e.TYPES.enum:
  39301. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value)
  39302. for (l = 0; l < a.length; l++) {
  39303. if (a[l].name == i) return a[l].id
  39304. if (a[l].id == i) return a[l].id
  39305. }
  39306. if ('proto3' === this.syntax)
  39307. return (
  39308. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39309. r(typeof i, 'not an integer'),
  39310. (i > 4294967295 || i < 0) && r(typeof i, 'not in range for uint32'),
  39311. i
  39312. )
  39313. r(i, 'not a valid enum value')
  39314. case e.TYPES.group:
  39315. case e.TYPES.message:
  39316. if (
  39317. ((i && 'object' == typeof i) || r(typeof i, 'object expected'),
  39318. i instanceof this.resolvedType.clazz)
  39319. )
  39320. return i
  39321. if (i instanceof e.Builder.Message) {
  39322. var s = {}
  39323. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l])
  39324. i = s
  39325. }
  39326. return new this.resolvedType.clazz(i)
  39327. }
  39328. throw Error(
  39329. '[INTERNAL] Illegal value for ' +
  39330. this.toString(!0) +
  39331. ': ' +
  39332. i +
  39333. ' (undefined type ' +
  39334. this.type +
  39335. ')'
  39336. )
  39337. }),
  39338. (u.calculateLength = function (i, n) {
  39339. if (null === n) return 0
  39340. var r
  39341. switch (this.type) {
  39342. case e.TYPES.int32:
  39343. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n)
  39344. case e.TYPES.uint32:
  39345. return t.calculateVarint32(n)
  39346. case e.TYPES.sint32:
  39347. return t.calculateVarint32(t.zigZagEncode32(n))
  39348. case e.TYPES.fixed32:
  39349. case e.TYPES.sfixed32:
  39350. case e.TYPES.float:
  39351. return 4
  39352. case e.TYPES.int64:
  39353. case e.TYPES.uint64:
  39354. return t.calculateVarint64(n)
  39355. case e.TYPES.sint64:
  39356. return t.calculateVarint64(t.zigZagEncode64(n))
  39357. case e.TYPES.fixed64:
  39358. case e.TYPES.sfixed64:
  39359. return 8
  39360. case e.TYPES.bool:
  39361. return 1
  39362. case e.TYPES.enum:
  39363. return t.calculateVarint32(n)
  39364. case e.TYPES.double:
  39365. return 8
  39366. case e.TYPES.string:
  39367. return (r = t.calculateUTF8Bytes(n)), t.calculateVarint32(r) + r
  39368. case e.TYPES.bytes:
  39369. if (n.remaining() < 0)
  39370. throw Error(
  39371. 'Illegal value for ' +
  39372. this.toString(!0) +
  39373. ': ' +
  39374. n.remaining() +
  39375. ' bytes remaining'
  39376. )
  39377. return t.calculateVarint32(n.remaining()) + n.remaining()
  39378. case e.TYPES.message:
  39379. return (r = this.resolvedType.calculate(n)), t.calculateVarint32(r) + r
  39380. case e.TYPES.group:
  39381. return (
  39382. (r = this.resolvedType.calculate(n)),
  39383. r + t.calculateVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  39384. )
  39385. }
  39386. throw Error(
  39387. '[INTERNAL] Illegal value to encode in ' +
  39388. this.toString(!0) +
  39389. ': ' +
  39390. n +
  39391. ' (unknown type)'
  39392. )
  39393. }),
  39394. (u.encodeValue = function (i, n, r) {
  39395. if (null === n) return r
  39396. switch (this.type) {
  39397. case e.TYPES.int32:
  39398. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n)
  39399. break
  39400. case e.TYPES.uint32:
  39401. r.writeVarint32(n)
  39402. break
  39403. case e.TYPES.sint32:
  39404. r.writeVarint32ZigZag(n)
  39405. break
  39406. case e.TYPES.fixed32:
  39407. r.writeUint32(n)
  39408. break
  39409. case e.TYPES.sfixed32:
  39410. r.writeInt32(n)
  39411. break
  39412. case e.TYPES.int64:
  39413. case e.TYPES.uint64:
  39414. r.writeVarint64(n)
  39415. break
  39416. case e.TYPES.sint64:
  39417. r.writeVarint64ZigZag(n)
  39418. break
  39419. case e.TYPES.fixed64:
  39420. r.writeUint64(n)
  39421. break
  39422. case e.TYPES.sfixed64:
  39423. r.writeInt64(n)
  39424. break
  39425. case e.TYPES.bool:
  39426. 'string' == typeof n
  39427. ? r.writeVarint32('false' === n.toLowerCase() ? 0 : !!n)
  39428. : r.writeVarint32(n ? 1 : 0)
  39429. break
  39430. case e.TYPES.enum:
  39431. r.writeVarint32(n)
  39432. break
  39433. case e.TYPES.float:
  39434. r.writeFloat32(n)
  39435. break
  39436. case e.TYPES.double:
  39437. r.writeFloat64(n)
  39438. break
  39439. case e.TYPES.string:
  39440. r.writeVString(n)
  39441. break
  39442. case e.TYPES.bytes:
  39443. if (n.remaining() < 0)
  39444. throw Error(
  39445. 'Illegal value for ' +
  39446. this.toString(!0) +
  39447. ': ' +
  39448. n.remaining() +
  39449. ' bytes remaining'
  39450. )
  39451. var o = n.offset
  39452. r.writeVarint32(n.remaining()), r.append(n), (n.offset = o)
  39453. break
  39454. case e.TYPES.message:
  39455. var a = new t().LE()
  39456. this.resolvedType.encode(n, a),
  39457. r.writeVarint32(a.offset),
  39458. r.append(a.flip())
  39459. break
  39460. case e.TYPES.group:
  39461. this.resolvedType.encode(n, r),
  39462. r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  39463. break
  39464. default:
  39465. throw Error(
  39466. '[INTERNAL] Illegal value to encode in ' +
  39467. this.toString(!0) +
  39468. ': ' +
  39469. n +
  39470. ' (unknown type)'
  39471. )
  39472. }
  39473. return r
  39474. }),
  39475. (u.decode = function (t, i, n) {
  39476. if (i != this.type.wireType) throw Error('Unexpected wire type for element')
  39477. var r, o
  39478. switch (this.type) {
  39479. case e.TYPES.int32:
  39480. return 0 | t.readVarint32()
  39481. case e.TYPES.uint32:
  39482. return t.readVarint32() >>> 0
  39483. case e.TYPES.sint32:
  39484. return 0 | t.readVarint32ZigZag()
  39485. case e.TYPES.fixed32:
  39486. return t.readUint32() >>> 0
  39487. case e.TYPES.sfixed32:
  39488. return 0 | t.readInt32()
  39489. case e.TYPES.int64:
  39490. return t.readVarint64()
  39491. case e.TYPES.uint64:
  39492. return t.readVarint64().toUnsigned()
  39493. case e.TYPES.sint64:
  39494. return t.readVarint64ZigZag()
  39495. case e.TYPES.fixed64:
  39496. return t.readUint64()
  39497. case e.TYPES.sfixed64:
  39498. return t.readInt64()
  39499. case e.TYPES.bool:
  39500. return !!t.readVarint32()
  39501. case e.TYPES.enum:
  39502. return t.readVarint32()
  39503. case e.TYPES.float:
  39504. return t.readFloat()
  39505. case e.TYPES.double:
  39506. return t.readDouble()
  39507. case e.TYPES.string:
  39508. return t.readVString()
  39509. case e.TYPES.bytes:
  39510. if (((o = t.readVarint32()), t.remaining() < o))
  39511. throw Error(
  39512. 'Illegal number of bytes for ' +
  39513. this.toString(!0) +
  39514. ': ' +
  39515. o +
  39516. ' required but got only ' +
  39517. t.remaining()
  39518. )
  39519. return (r = t.clone()), (r.limit = r.offset + o), (t.offset += o), r
  39520. case e.TYPES.message:
  39521. return (o = t.readVarint32()), this.resolvedType.decode(t, o)
  39522. case e.TYPES.group:
  39523. return this.resolvedType.decode(t, -1, n)
  39524. }
  39525. throw Error('[INTERNAL] Illegal decode type')
  39526. }),
  39527. (u.valueFromString = function (i) {
  39528. if (!this.isMapKey)
  39529. throw Error('valueFromString() called on non-map-key element')
  39530. switch (this.type) {
  39531. case e.TYPES.int32:
  39532. case e.TYPES.sint32:
  39533. case e.TYPES.sfixed32:
  39534. case e.TYPES.uint32:
  39535. case e.TYPES.fixed32:
  39536. return this.verifyValue(parseInt(i))
  39537. case e.TYPES.int64:
  39538. case e.TYPES.sint64:
  39539. case e.TYPES.sfixed64:
  39540. case e.TYPES.uint64:
  39541. case e.TYPES.fixed64:
  39542. return this.verifyValue(i)
  39543. case e.TYPES.bool:
  39544. return 'true' === i
  39545. case e.TYPES.string:
  39546. return this.verifyValue(i)
  39547. case e.TYPES.bytes:
  39548. return t.fromBinary(i)
  39549. }
  39550. }),
  39551. (u.valueToString = function (t) {
  39552. if (!this.isMapKey) throw Error('valueToString() called on non-map-key element')
  39553. return this.type === e.TYPES.bytes ? t.toString('binary') : t.toString()
  39554. }),
  39555. (o.Element = h)
  39556. var d = function (e, t, i, n, r, o) {
  39557. l.call(this, e, t, i, n, o),
  39558. (this.className = 'Message'),
  39559. (this.extensions = void 0),
  39560. (this.clazz = null),
  39561. (this.isGroup = !!r),
  39562. (this._fields = null),
  39563. (this._fieldsById = null),
  39564. (this._fieldsByName = null)
  39565. },
  39566. p = (d.prototype = Object.create(l.prototype))
  39567. ;(p.build = function (i) {
  39568. if (this.clazz && !i) return this.clazz
  39569. var n = (function (e, i) {
  39570. function n(i, r, o, a) {
  39571. if (null === i || 'object' != typeof i) {
  39572. if (a && a instanceof e.Reflect.Enum) {
  39573. var s = e.Reflect.Enum.getName(a.object, i)
  39574. if (null !== s) return s
  39575. }
  39576. return i
  39577. }
  39578. if (t.isByteBuffer(i)) return r ? i.toBase64() : i.toBuffer()
  39579. if (e.Long.isLong(i)) return o ? i.toString() : e.Long.fromValue(i)
  39580. var l
  39581. if (Array.isArray(i))
  39582. return (
  39583. (l = []),
  39584. i.forEach(function (e, t) {
  39585. l[t] = n(e, r, o, a)
  39586. }),
  39587. l
  39588. )
  39589. if (((l = {}), i instanceof e.Map)) {
  39590. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  39591. l[i.keyElem.valueToString(h.value[0])] = n(
  39592. h.value[1],
  39593. r,
  39594. o,
  39595. i.valueElem.resolvedType
  39596. )
  39597. return l
  39598. }
  39599. var u = i.$type,
  39600. d = void 0
  39601. for (var p in i)
  39602. i.hasOwnProperty(p) &&
  39603. (u && (d = u.getChild(p))
  39604. ? (l[p] = n(i[p], r, o, d.resolvedType))
  39605. : (l[p] = n(i[p], r, o)))
  39606. return l
  39607. }
  39608. var r = i.getChildren(e.Reflect.Message.Field),
  39609. o = i.getChildren(e.Reflect.Message.OneOf),
  39610. a = function (n, s) {
  39611. e.Builder.Message.call(this)
  39612. for (var l = 0, c = o.length; l < c; ++l) this[o[l].name] = null
  39613. for (l = 0, c = r.length; l < c; ++l) {
  39614. var h = r[l]
  39615. ;(this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null),
  39616. (!h.required && 'proto3' !== i.syntax) ||
  39617. null === h.defaultValue ||
  39618. (this[h.name] = h.defaultValue)
  39619. }
  39620. if (arguments.length > 0) {
  39621. var u
  39622. if (
  39623. 1 !== arguments.length ||
  39624. null === n ||
  39625. 'object' != typeof n ||
  39626. !('function' != typeof n.encode || n instanceof a) ||
  39627. Array.isArray(n) ||
  39628. n instanceof e.Map ||
  39629. t.isByteBuffer(n) ||
  39630. n instanceof ArrayBuffer ||
  39631. (e.Long && n instanceof e.Long)
  39632. )
  39633. for (l = 0, c = arguments.length; l < c; ++l)
  39634. 'undefined' != typeof (u = arguments[l]) && this.$set(r[l].name, u)
  39635. else this.$set(n)
  39636. }
  39637. },
  39638. s = (a.prototype = Object.create(e.Builder.Message.prototype))
  39639. ;(s.add = function (t, n, r) {
  39640. var o = i._fieldsByName[t]
  39641. if (!r) {
  39642. if (!o) throw Error(this + '#' + t + ' is undefined')
  39643. if (!(o instanceof e.Reflect.Message.Field))
  39644. throw Error(this + '#' + t + ' is not a field: ' + o.toString(!0))
  39645. if (!o.repeated) throw Error(this + '#' + t + ' is not a repeated field')
  39646. n = o.verifyValue(n, !0)
  39647. }
  39648. return null === this[t] && (this[t] = []), this[t].push(n), this
  39649. }),
  39650. (s.$add = s.add),
  39651. (s.set = function (t, n, r) {
  39652. if (t && 'object' == typeof t) {
  39653. r = n
  39654. for (var o in t)
  39655. t.hasOwnProperty(o) &&
  39656. 'undefined' != typeof (n = t[o]) &&
  39657. this.$set(o, n, r)
  39658. return this
  39659. }
  39660. var a = i._fieldsByName[t]
  39661. if (r) this[t] = n
  39662. else {
  39663. if (!a) throw Error(this + '#' + t + ' is not a field: undefined')
  39664. if (!(a instanceof e.Reflect.Message.Field))
  39665. throw Error(this + '#' + t + ' is not a field: ' + a.toString(!0))
  39666. this[a.name] = n = a.verifyValue(n)
  39667. }
  39668. if (a && a.oneof) {
  39669. var s = this[a.oneof.name]
  39670. null !== n
  39671. ? (null !== s && s !== a.name && (this[s] = null),
  39672. (this[a.oneof.name] = a.name))
  39673. : s === t && (this[a.oneof.name] = null)
  39674. }
  39675. return this
  39676. }),
  39677. (s.$set = s.set),
  39678. (s.get = function (t, n) {
  39679. if (n) return this[t]
  39680. var r = i._fieldsByName[t]
  39681. if (!(r && r instanceof e.Reflect.Message.Field))
  39682. throw Error(this + '#' + t + ' is not a field: undefined')
  39683. if (!(r instanceof e.Reflect.Message.Field))
  39684. throw Error(this + '#' + t + ' is not a field: ' + r.toString(!0))
  39685. return this[r.name]
  39686. }),
  39687. (s.$get = s.get)
  39688. for (var l = 0; l < r.length; l++) {
  39689. var c = r[l]
  39690. c instanceof e.Reflect.Message.ExtensionField ||
  39691. (i.builder.options.populateAccessors &&
  39692. (function (e) {
  39693. var t = e.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  39694. return e.toUpperCase().replace('_', '')
  39695. })
  39696. t = t.substring(0, 1).toUpperCase() + t.substring(1)
  39697. var n = e.originalName.replace(/([A-Z])/g, function (e) {
  39698. return '_' + e
  39699. }),
  39700. r = function (t, i) {
  39701. return (this[e.name] = i ? t : e.verifyValue(t)), this
  39702. },
  39703. o = function () {
  39704. return this[e.name]
  39705. }
  39706. null === i.getChild('set' + t) && (s['set' + t] = r),
  39707. null === i.getChild('set_' + n) && (s['set_' + n] = r),
  39708. null === i.getChild('get' + t) && (s['get' + t] = o),
  39709. null === i.getChild('get_' + n) && (s['get_' + n] = o)
  39710. })(c))
  39711. }
  39712. ;(s.encode = function (e, n) {
  39713. 'boolean' == typeof e && ((n = e), (e = void 0))
  39714. var r = !1
  39715. e || ((e = new t()), (r = !0))
  39716. var o = e.littleEndian
  39717. try {
  39718. return i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o)
  39719. } catch (t) {
  39720. throw (e.LE(o), t)
  39721. }
  39722. }),
  39723. (a.encode = function (e, t, i) {
  39724. return new a(e).encode(t, i)
  39725. }),
  39726. (s.calculate = function () {
  39727. return i.calculate(this)
  39728. }),
  39729. (s.encodeDelimited = function (e, n) {
  39730. var r = !1
  39731. e || ((e = new t()), (r = !0))
  39732. var o = new t().LE()
  39733. return (
  39734. i.encode(this, o, n).flip(),
  39735. e.writeVarint32(o.remaining()),
  39736. e.append(o),
  39737. r ? e.flip() : e
  39738. )
  39739. }),
  39740. (s.encodeAB = function () {
  39741. try {
  39742. return this.encode().toArrayBuffer()
  39743. } catch (e) {
  39744. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e)
  39745. }
  39746. }),
  39747. (s.toArrayBuffer = s.encodeAB),
  39748. (s.encodeNB = function () {
  39749. try {
  39750. return this.encode().toBuffer()
  39751. } catch (e) {
  39752. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  39753. }
  39754. }),
  39755. (s.toBuffer = s.encodeNB),
  39756. (s.encode64 = function () {
  39757. try {
  39758. return this.encode().toBase64()
  39759. } catch (e) {
  39760. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  39761. }
  39762. }),
  39763. (s.toBase64 = s.encode64),
  39764. (s.encodeHex = function () {
  39765. try {
  39766. return this.encode().toHex()
  39767. } catch (e) {
  39768. throw (e.encoded && (e.encoded = e.encoded.toHex()), e)
  39769. }
  39770. }),
  39771. (s.toHex = s.encodeHex),
  39772. (s.toRaw = function (e, t) {
  39773. return n(this, !!e, !!t, this.$type)
  39774. }),
  39775. (s.encodeJSON = function () {
  39776. return JSON.stringify(n(this, !0, !0, this.$type))
  39777. }),
  39778. (a.decode = function (e, n, r) {
  39779. 'string' == typeof n && ((r = n), (n = -1)),
  39780. 'string' == typeof e && (e = t.wrap(e, r ? r : 'base64')),
  39781. (e = t.isByteBuffer(e) ? e : t.wrap(e))
  39782. var o = e.littleEndian
  39783. try {
  39784. var a = i.decode(e.LE())
  39785. return e.LE(o), a
  39786. } catch (t) {
  39787. throw (e.LE(o), t)
  39788. }
  39789. }),
  39790. (a.decodeDelimited = function (e, n) {
  39791. if (
  39792. ('string' == typeof e && (e = t.wrap(e, n ? n : 'base64')),
  39793. (e = t.isByteBuffer(e) ? e : t.wrap(e)),
  39794. e.remaining() < 1)
  39795. )
  39796. return null
  39797. var r = e.offset,
  39798. o = e.readVarint32()
  39799. if (e.remaining() < o) return (e.offset = r), null
  39800. try {
  39801. var a = i.decode(e.slice(e.offset, e.offset + o).LE())
  39802. return (e.offset += o), a
  39803. } catch (t) {
  39804. throw ((e.offset += o), t)
  39805. }
  39806. }),
  39807. (a.decode64 = function (e) {
  39808. return a.decode(e, 'base64')
  39809. }),
  39810. (a.decodeHex = function (e) {
  39811. return a.decode(e, 'hex')
  39812. }),
  39813. (a.decodeJSON = function (e) {
  39814. return new a(JSON.parse(e))
  39815. }),
  39816. (s.toString = function () {
  39817. return i.toString()
  39818. })
  39819. return (
  39820. Object.defineProperty &&
  39821. (Object.defineProperty(a, '$options', {
  39822. value: i.buildOpt()
  39823. }),
  39824. Object.defineProperty(s, '$options', {
  39825. value: a.$options
  39826. }),
  39827. Object.defineProperty(a, '$type', {
  39828. value: i
  39829. }),
  39830. Object.defineProperty(s, '$type', {
  39831. value: i
  39832. })),
  39833. a
  39834. )
  39835. })(e, this)
  39836. ;(this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {})
  39837. for (var r, o = 0, a = this.children.length; o < a; o++)
  39838. if (
  39839. ((r = this.children[o]), r instanceof A || r instanceof d || r instanceof E)
  39840. ) {
  39841. if (n.hasOwnProperty(r.name))
  39842. throw Error(
  39843. 'Illegal reflect child of ' +
  39844. this.toString(!0) +
  39845. ': ' +
  39846. r.toString(!0) +
  39847. " cannot override static property '" +
  39848. r.name +
  39849. "'"
  39850. )
  39851. n[r.name] = r.build()
  39852. } else if (r instanceof d.Field)
  39853. r.build(),
  39854. this._fields.push(r),
  39855. (this._fieldsById[r.id] = r),
  39856. (this._fieldsByName[r.name] = r)
  39857. else if (!(r instanceof d.OneOf || r instanceof I))
  39858. throw Error(
  39859. 'Illegal reflect child of ' +
  39860. this.toString(!0) +
  39861. ': ' +
  39862. this.children[o].toString(!0)
  39863. )
  39864. return (this.clazz = n)
  39865. }),
  39866. (p.encode = function (e, t, i) {
  39867. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  39868. (n = this._fields[a]),
  39869. (r = e[n.name]),
  39870. n.required && null === r
  39871. ? null === o && (o = n)
  39872. : n.encode(i ? r : n.verifyValue(r), t, e)
  39873. if (null !== o) {
  39874. var l = Error(
  39875. 'Missing at least one required field for ' + this.toString(!0) + ': ' + o
  39876. )
  39877. throw ((l.encoded = t), l)
  39878. }
  39879. return t
  39880. }),
  39881. (p.calculate = function (e) {
  39882. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  39883. if (((t = this._fields[r]), (i = e[t.name]), t.required && null === i))
  39884. throw Error(
  39885. 'Missing at least one required field for ' + this.toString(!0) + ': ' + t
  39886. )
  39887. n += t.calculate(i, e)
  39888. }
  39889. return n
  39890. }),
  39891. (p.decode = function (t, i, n) {
  39892. i = 'number' == typeof i ? i : -1
  39893. for (
  39894. var o, a, s, l, c = t.offset, h = new this.clazz();
  39895. t.offset < c + i || (i === -1 && t.remaining() > 0);
  39896. ) {
  39897. if (
  39898. ((o = t.readVarint32()),
  39899. (a = 7 & o),
  39900. (s = o >>> 3),
  39901. a === e.WIRE_TYPES.ENDGROUP)
  39902. ) {
  39903. if (s !== n)
  39904. throw Error(
  39905. 'Illegal group end indicator for ' +
  39906. this.toString(!0) +
  39907. ': ' +
  39908. s +
  39909. ' (' +
  39910. (n ? n + ' expected' : 'not a group') +
  39911. ')'
  39912. )
  39913. break
  39914. }
  39915. if ((l = this._fieldsById[s])) {
  39916. if (l.repeated && !l.options.packed) h[l.name].push(l.decode(a, t))
  39917. else if (l.map) {
  39918. var u = l.decode(a, t)
  39919. h[l.name].set(u[0], u[1])
  39920. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  39921. var d = h[l.oneof.name]
  39922. null !== d && d !== l.name && (h[d] = null), (h[l.oneof.name] = l.name)
  39923. }
  39924. } else
  39925. switch (a) {
  39926. case e.WIRE_TYPES.VARINT:
  39927. t.readVarint32()
  39928. break
  39929. case e.WIRE_TYPES.BITS32:
  39930. t.offset += 4
  39931. break
  39932. case e.WIRE_TYPES.BITS64:
  39933. t.offset += 8
  39934. break
  39935. case e.WIRE_TYPES.LDELIM:
  39936. var p = t.readVarint32()
  39937. t.offset += p
  39938. break
  39939. case e.WIRE_TYPES.STARTGROUP:
  39940. for (; r(s, t); );
  39941. break
  39942. default:
  39943. throw Error(
  39944. 'Illegal wire type for unknown field ' +
  39945. s +
  39946. ' in ' +
  39947. this.toString(!0) +
  39948. '#decode: ' +
  39949. a
  39950. )
  39951. }
  39952. }
  39953. for (var f = 0, g = this._fields.length; f < g; ++f)
  39954. if (((l = this._fields[f]), null === h[l.name]))
  39955. if ('proto3' === this.syntax) h[l.name] = l.defaultValue
  39956. else {
  39957. if (l.required) {
  39958. var m = Error(
  39959. 'Missing at least one required field for ' +
  39960. this.toString(!0) +
  39961. ': ' +
  39962. l.name
  39963. )
  39964. throw ((m.decoded = h), m)
  39965. }
  39966. e.populateDefaults &&
  39967. null !== l.defaultValue &&
  39968. (h[l.name] = l.defaultValue)
  39969. }
  39970. return h
  39971. }),
  39972. (o.Message = d)
  39973. var f = function (t, i, n, r, o, s, l, c, h, u) {
  39974. a.call(this, t, i, s),
  39975. (this.className = 'Message.Field'),
  39976. (this.required = 'required' === n),
  39977. (this.repeated = 'repeated' === n),
  39978. (this.map = 'map' === n),
  39979. (this.keyType = r || null),
  39980. (this.type = o),
  39981. (this.resolvedType = null),
  39982. (this.id = l),
  39983. (this.options = c || {}),
  39984. (this.defaultValue = null),
  39985. (this.oneof = h || null),
  39986. (this.syntax = u || 'proto2'),
  39987. (this.originalName = this.name),
  39988. (this.element = null),
  39989. (this.keyElement = null),
  39990. !this.builder.options.convertFieldsToCamelCase ||
  39991. this instanceof d.ExtensionField ||
  39992. (this.name = e.Util.toCamelCase(this.name))
  39993. },
  39994. g = (f.prototype = Object.create(a.prototype))
  39995. ;(g.build = function () {
  39996. ;(this.element = new h(this.type, this.resolvedType, !1, this.syntax)),
  39997. this.map && (this.keyElement = new h(this.keyType, void 0, !0, this.syntax)),
  39998. 'proto3' !== this.syntax || this.repeated || this.map
  39999. ? 'undefined' != typeof this.options.default &&
  40000. (this.defaultValue = this.verifyValue(this.options.default))
  40001. : (this.defaultValue = h.defaultFieldValue(this.type))
  40002. }),
  40003. (g.verifyValue = function (t, i) {
  40004. function n(e, t) {
  40005. throw Error(
  40006. 'Illegal value for ' +
  40007. r.toString(!0) +
  40008. ' of type ' +
  40009. r.type.name +
  40010. ': ' +
  40011. e +
  40012. ' (' +
  40013. t +
  40014. ')'
  40015. )
  40016. }
  40017. i = i || !1
  40018. var r = this
  40019. if (null === t)
  40020. return (
  40021. this.required && n(typeof t, 'required'),
  40022. 'proto3' === this.syntax &&
  40023. this.type !== e.TYPES.message &&
  40024. n(typeof t, 'proto3 field without field presence cannot be null'),
  40025. null
  40026. )
  40027. var o
  40028. if (this.repeated && !i) {
  40029. Array.isArray(t) || (t = [t])
  40030. var a = []
  40031. for (o = 0; o < t.length; o++) a.push(this.element.verifyValue(t[o]))
  40032. return a
  40033. }
  40034. return this.map && !i
  40035. ? t instanceof e.Map
  40036. ? t
  40037. : (t instanceof Object ||
  40038. n(typeof t, 'expected ProtoBuf.Map or raw object for map field'),
  40039. new e.Map(this, t))
  40040. : (!this.repeated && Array.isArray(t) && n(typeof t, 'no array expected'),
  40041. this.element.verifyValue(t))
  40042. }),
  40043. (g.hasWirePresence = function (t, i) {
  40044. if ('proto3' !== this.syntax) return null !== t
  40045. if (this.oneof && i[this.oneof.name] === this.name) return !0
  40046. switch (this.type) {
  40047. case e.TYPES.int32:
  40048. case e.TYPES.sint32:
  40049. case e.TYPES.sfixed32:
  40050. case e.TYPES.uint32:
  40051. case e.TYPES.fixed32:
  40052. return 0 !== t
  40053. case e.TYPES.int64:
  40054. case e.TYPES.sint64:
  40055. case e.TYPES.sfixed64:
  40056. case e.TYPES.uint64:
  40057. case e.TYPES.fixed64:
  40058. return 0 !== t.low || 0 !== t.high
  40059. case e.TYPES.bool:
  40060. return t
  40061. case e.TYPES.float:
  40062. case e.TYPES.double:
  40063. return 0 !== t
  40064. case e.TYPES.string:
  40065. return t.length > 0
  40066. case e.TYPES.bytes:
  40067. return t.remaining() > 0
  40068. case e.TYPES.enum:
  40069. return 0 !== t
  40070. case e.TYPES.message:
  40071. return null !== t
  40072. default:
  40073. return !0
  40074. }
  40075. }),
  40076. (g.encode = function (i, n, r) {
  40077. if (null === this.type || 'object' != typeof this.type)
  40078. throw Error(
  40079. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  40080. )
  40081. if (null === i || (this.repeated && 0 == i.length)) return n
  40082. try {
  40083. if (this.repeated) {
  40084. var o
  40085. if (
  40086. this.options.packed &&
  40087. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  40088. ) {
  40089. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  40090. n.ensureCapacity((n.offset += 1))
  40091. var a = n.offset
  40092. for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n)
  40093. var s = n.offset - a,
  40094. l = t.calculateVarint32(s)
  40095. if (l > 1) {
  40096. var c = n.slice(a, n.offset)
  40097. ;(a += l - 1), (n.offset = a), n.append(c)
  40098. }
  40099. n.writeVarint32(s, a - l)
  40100. } else
  40101. for (o = 0; o < i.length; o++)
  40102. n.writeVarint32((this.id << 3) | this.type.wireType),
  40103. this.element.encodeValue(this.id, i[o], n)
  40104. } else
  40105. this.map
  40106. ? i.forEach(function (i, r, o) {
  40107. var a =
  40108. t.calculateVarint32(8 | this.keyType.wireType) +
  40109. this.keyElement.calculateLength(1, r) +
  40110. t.calculateVarint32(16 | this.type.wireType) +
  40111. this.element.calculateLength(2, i)
  40112. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  40113. n.writeVarint32(a),
  40114. n.writeVarint32(8 | this.keyType.wireType),
  40115. this.keyElement.encodeValue(1, r, n),
  40116. n.writeVarint32(16 | this.type.wireType),
  40117. this.element.encodeValue(2, i, n)
  40118. }, this)
  40119. : this.hasWirePresence(i, r) &&
  40120. (n.writeVarint32((this.id << 3) | this.type.wireType),
  40121. this.element.encodeValue(this.id, i, n))
  40122. } catch (e) {
  40123. throw Error(
  40124. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  40125. )
  40126. }
  40127. return n
  40128. }),
  40129. (g.calculate = function (i, n) {
  40130. if (
  40131. ((i = this.verifyValue(i)),
  40132. null === this.type || 'object' != typeof this.type)
  40133. )
  40134. throw Error(
  40135. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  40136. )
  40137. if (null === i || (this.repeated && 0 == i.length)) return 0
  40138. var r = 0
  40139. try {
  40140. if (this.repeated) {
  40141. var o, a
  40142. if (
  40143. this.options.packed &&
  40144. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  40145. ) {
  40146. for (
  40147. r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  40148. a = 0,
  40149. o = 0;
  40150. o < i.length;
  40151. o++
  40152. )
  40153. a += this.element.calculateLength(this.id, i[o])
  40154. ;(r += t.calculateVarint32(a)), (r += a)
  40155. } else
  40156. for (o = 0; o < i.length; o++)
  40157. (r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40158. (r += this.element.calculateLength(this.id, i[o]))
  40159. } else
  40160. this.map
  40161. ? i.forEach(function (i, n, o) {
  40162. var a =
  40163. t.calculateVarint32(8 | this.keyType.wireType) +
  40164. this.keyElement.calculateLength(1, n) +
  40165. t.calculateVarint32(16 | this.type.wireType) +
  40166. this.element.calculateLength(2, i)
  40167. ;(r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM)),
  40168. (r += t.calculateVarint32(a)),
  40169. (r += a)
  40170. }, this)
  40171. : this.hasWirePresence(i, n) &&
  40172. ((r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40173. (r += this.element.calculateLength(this.id, i)))
  40174. } catch (e) {
  40175. throw Error(
  40176. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  40177. )
  40178. }
  40179. return r
  40180. }),
  40181. (g.decode = function (t, i, n) {
  40182. var r,
  40183. o,
  40184. a =
  40185. (!this.map && t == this.type.wireType) ||
  40186. (!n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM) ||
  40187. (this.map && t == e.WIRE_TYPES.LDELIM)
  40188. if (!a)
  40189. throw Error(
  40190. 'Illegal wire type for field ' +
  40191. this.toString(!0) +
  40192. ': ' +
  40193. t +
  40194. ' (' +
  40195. this.type.wireType +
  40196. ' expected)'
  40197. )
  40198. if (
  40199. t == e.WIRE_TYPES.LDELIM &&
  40200. this.repeated &&
  40201. this.options.packed &&
  40202. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 &&
  40203. !n
  40204. ) {
  40205. ;(o = i.readVarint32()), (o = i.offset + o)
  40206. for (var s = []; i.offset < o; )
  40207. s.push(this.decode(this.type.wireType, i, !0))
  40208. return s
  40209. }
  40210. if (this.map) {
  40211. var l = h.defaultFieldValue(this.keyType)
  40212. if (
  40213. ((r = h.defaultFieldValue(this.type)),
  40214. (o = i.readVarint32()),
  40215. i.remaining() < o)
  40216. )
  40217. throw Error(
  40218. 'Illegal number of bytes for ' +
  40219. this.toString(!0) +
  40220. ': ' +
  40221. o +
  40222. ' required but got only ' +
  40223. i.remaining()
  40224. )
  40225. var c = i.clone()
  40226. for (c.limit = c.offset + o, i.offset += o; c.remaining() > 0; ) {
  40227. var u = c.readVarint32()
  40228. t = 7 & u
  40229. var d = u >>> 3
  40230. if (1 === d) l = this.keyElement.decode(c, t, d)
  40231. else {
  40232. if (2 !== d)
  40233. throw Error('Unexpected tag in map field key/value submessage')
  40234. r = this.element.decode(c, t, d)
  40235. }
  40236. }
  40237. return [l, r]
  40238. }
  40239. return this.element.decode(i, t, this.id)
  40240. }),
  40241. (o.Message.Field = f)
  40242. var m = function (e, t, i, n, r, o, a) {
  40243. f.call(this, e, t, i, null, n, r, o, a), this.extension
  40244. }
  40245. ;(m.prototype = Object.create(f.prototype)), (o.Message.ExtensionField = m)
  40246. var v = function (e, t, i) {
  40247. a.call(this, e, t, i), (this.fields = [])
  40248. }
  40249. o.Message.OneOf = v
  40250. var A = function (e, t, i, n, r) {
  40251. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null)
  40252. }
  40253. A.getName = function (e, t) {
  40254. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  40255. if (e[(i = n[r])] === t) return i
  40256. return null
  40257. }
  40258. var y = (A.prototype = Object.create(l.prototype))
  40259. ;(y.build = function (t) {
  40260. if (this.object && !t) return this.object
  40261. for (
  40262. var i = new e.Builder.Enum(),
  40263. n = this.getChildren(A.Value),
  40264. r = 0,
  40265. o = n.length;
  40266. r < o;
  40267. ++r
  40268. )
  40269. i[n[r].name] = n[r].id
  40270. return (
  40271. Object.defineProperty &&
  40272. Object.defineProperty(i, '$options', {
  40273. value: this.buildOpt(),
  40274. enumerable: !1
  40275. }),
  40276. (this.object = i)
  40277. )
  40278. }),
  40279. (o.Enum = A)
  40280. var C = function (e, t, i, n) {
  40281. a.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n)
  40282. }
  40283. ;(C.prototype = Object.create(a.prototype)), (o.Enum.Value = C)
  40284. var I = function (e, t, i, n) {
  40285. a.call(this, e, t, i), (this.field = n)
  40286. }
  40287. ;(I.prototype = Object.create(a.prototype)), (o.Extension = I)
  40288. var E = function (e, t, i, n) {
  40289. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null)
  40290. },
  40291. b = (E.prototype = Object.create(l.prototype))
  40292. ;(b.build = function (i) {
  40293. return this.clazz && !i
  40294. ? this.clazz
  40295. : (this.clazz = (function (e, i) {
  40296. for (
  40297. var n = function (t) {
  40298. e.Builder.Service.call(this),
  40299. (this.rpcImpl =
  40300. t ||
  40301. function (e, t, i) {
  40302. setTimeout(
  40303. i.bind(
  40304. this,
  40305. Error(
  40306. 'Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services'
  40307. )
  40308. ),
  40309. 0
  40310. )
  40311. })
  40312. },
  40313. r = (n.prototype = Object.create(e.Builder.Service.prototype)),
  40314. o = i.getChildren(e.Reflect.Service.RPCMethod),
  40315. a = 0;
  40316. a < o.length;
  40317. a++
  40318. )
  40319. !(function (e) {
  40320. ;(r[e.name] = function (n, r) {
  40321. try {
  40322. try {
  40323. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  40324. } catch (e) {
  40325. if (!(e instanceof TypeError)) throw e
  40326. }
  40327. if (null === n || 'object' != typeof n)
  40328. throw Error('Illegal arguments')
  40329. n instanceof e.resolvedRequestType.clazz ||
  40330. (n = new e.resolvedRequestType.clazz(n)),
  40331. this.rpcImpl(e.fqn(), n, function (t, n) {
  40332. if (t) return void r(t)
  40333. null === n && (n = '')
  40334. try {
  40335. n = e.resolvedResponseType.clazz.decode(n)
  40336. } catch (e) {}
  40337. return n && n instanceof e.resolvedResponseType.clazz
  40338. ? void r(null, n)
  40339. : void r(
  40340. Error(
  40341. 'Illegal response type received in service method ' +
  40342. i.name +
  40343. '#' +
  40344. e.name
  40345. )
  40346. )
  40347. })
  40348. } catch (e) {
  40349. setTimeout(r.bind(this, e), 0)
  40350. }
  40351. }),
  40352. (n[e.name] = function (t, i, r) {
  40353. new n(t)[e.name](i, r)
  40354. }),
  40355. Object.defineProperty &&
  40356. (Object.defineProperty(n[e.name], '$options', {
  40357. value: e.buildOpt()
  40358. }),
  40359. Object.defineProperty(r[e.name], '$options', {
  40360. value: n[e.name].$options
  40361. }))
  40362. })(o[a])
  40363. return (
  40364. Object.defineProperty &&
  40365. (Object.defineProperty(n, '$options', {
  40366. value: i.buildOpt()
  40367. }),
  40368. Object.defineProperty(r, '$options', {
  40369. value: n.$options
  40370. }),
  40371. Object.defineProperty(n, '$type', {
  40372. value: i
  40373. }),
  40374. Object.defineProperty(r, '$type', {
  40375. value: i
  40376. })),
  40377. n
  40378. )
  40379. })(e, this))
  40380. }),
  40381. (o.Service = E)
  40382. var w = function (e, t, i, n) {
  40383. a.call(this, e, t, i),
  40384. (this.className = 'Service.Method'),
  40385. (this.options = n || {})
  40386. },
  40387. _ = (w.prototype = Object.create(a.prototype))
  40388. ;(_.buildOpt = c.buildOpt), (o.Service.Method = w)
  40389. var T = function (e, t, i, n, r, o, a, s) {
  40390. w.call(this, e, t, i, s),
  40391. (this.className = 'Service.RPCMethod'),
  40392. (this.requestName = n),
  40393. (this.responseName = r),
  40394. (this.requestStream = o),
  40395. (this.responseStream = a),
  40396. (this.resolvedRequestType = null),
  40397. (this.resolvedResponseType = null)
  40398. }
  40399. return (T.prototype = Object.create(w.prototype)), (o.Service.RPCMethod = T), o
  40400. })(r)),
  40401. (r.Builder = (function (t, i, n) {
  40402. function r(e) {
  40403. e.messages &&
  40404. e.messages.forEach(function (t) {
  40405. ;(t.syntax = e.syntax), r(t)
  40406. }),
  40407. e.enums &&
  40408. e.enums.forEach(function (t) {
  40409. t.syntax = e.syntax
  40410. })
  40411. }
  40412. var o = function (e) {
  40413. ;(this.ns = new n.Namespace(this, null, '')),
  40414. (this.ptr = this.ns),
  40415. (this.resolved = !1),
  40416. (this.result = null),
  40417. (this.files = {}),
  40418. (this.importRoot = null),
  40419. (this.options = e || {})
  40420. },
  40421. a = o.prototype
  40422. return (
  40423. (o.isMessage = function (e) {
  40424. return (
  40425. 'string' == typeof e.name &&
  40426. 'undefined' == typeof e.values &&
  40427. 'undefined' == typeof e.rpc
  40428. )
  40429. }),
  40430. (o.isMessageField = function (e) {
  40431. return (
  40432. 'string' == typeof e.rule &&
  40433. 'string' == typeof e.name &&
  40434. 'string' == typeof e.type &&
  40435. 'undefined' != typeof e.id
  40436. )
  40437. }),
  40438. (o.isEnum = function (e) {
  40439. return (
  40440. 'string' == typeof e.name &&
  40441. !(
  40442. 'undefined' == typeof e.values ||
  40443. !Array.isArray(e.values) ||
  40444. 0 === e.values.length
  40445. )
  40446. )
  40447. }),
  40448. (o.isService = function (e) {
  40449. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc)
  40450. }),
  40451. (o.isExtend = function (e) {
  40452. return 'string' == typeof e.ref
  40453. }),
  40454. (a.reset = function () {
  40455. return (this.ptr = this.ns), this
  40456. }),
  40457. (a.define = function (e) {
  40458. if ('string' != typeof e || !i.TYPEREF.test(e))
  40459. throw Error('illegal namespace: ' + e)
  40460. return (
  40461. e.split('.').forEach(function (e) {
  40462. var t = this.ptr.getChild(e)
  40463. null === t && this.ptr.addChild((t = new n.Namespace(this, this.ptr, e))),
  40464. (this.ptr = t)
  40465. }, this),
  40466. this
  40467. )
  40468. }),
  40469. (a.create = function (e) {
  40470. if (!e) return this
  40471. if (Array.isArray(e)) {
  40472. if (0 === e.length) return this
  40473. e = e.slice()
  40474. } else e = [e]
  40475. for (var i = [e]; i.length > 0; ) {
  40476. if (((e = i.pop()), !Array.isArray(e)))
  40477. throw Error('not a valid namespace: ' + JSON.stringify(e))
  40478. for (; e.length > 0; ) {
  40479. var r = e.shift()
  40480. if (o.isMessage(r)) {
  40481. var a = new n.Message(
  40482. this,
  40483. this.ptr,
  40484. r.name,
  40485. r.options,
  40486. r.isGroup,
  40487. r.syntax
  40488. ),
  40489. s = {}
  40490. r.oneofs &&
  40491. Object.keys(r.oneofs).forEach(function (e) {
  40492. a.addChild((s[e] = new n.Message.OneOf(this, a, e)))
  40493. }, this),
  40494. r.fields &&
  40495. r.fields.forEach(function (e) {
  40496. if (null !== a.getChild(0 | e.id))
  40497. throw Error(
  40498. 'duplicate or invalid field id in ' + a.name + ': ' + e.id
  40499. )
  40500. if (e.options && 'object' != typeof e.options)
  40501. throw Error('illegal field options in ' + a.name + '#' + e.name)
  40502. var t = null
  40503. if ('string' == typeof e.oneof && !(t = s[e.oneof]))
  40504. throw Error(
  40505. 'illegal oneof in ' + a.name + '#' + e.name + ': ' + e.oneof
  40506. )
  40507. ;(e = new n.Message.Field(
  40508. this,
  40509. a,
  40510. e.rule,
  40511. e.keytype,
  40512. e.type,
  40513. e.name,
  40514. e.id,
  40515. e.options,
  40516. t,
  40517. r.syntax
  40518. )),
  40519. t && t.fields.push(e),
  40520. a.addChild(e)
  40521. }, this)
  40522. var l = []
  40523. if (
  40524. (r.enums &&
  40525. r.enums.forEach(function (e) {
  40526. l.push(e)
  40527. }),
  40528. r.messages &&
  40529. r.messages.forEach(function (e) {
  40530. l.push(e)
  40531. }),
  40532. r.services &&
  40533. r.services.forEach(function (e) {
  40534. l.push(e)
  40535. }),
  40536. r.extensions &&
  40537. ('number' == typeof r.extensions[0]
  40538. ? (a.extensions = [r.extensions])
  40539. : (a.extensions = r.extensions)),
  40540. this.ptr.addChild(a),
  40541. l.length > 0)
  40542. ) {
  40543. i.push(e), (e = l), (l = null), (this.ptr = a), (a = null)
  40544. continue
  40545. }
  40546. l = null
  40547. } else if (o.isEnum(r))
  40548. (a = new n.Enum(this, this.ptr, r.name, r.options, r.syntax)),
  40549. r.values.forEach(function (e) {
  40550. a.addChild(new n.Enum.Value(this, a, e.name, e.id))
  40551. }, this),
  40552. this.ptr.addChild(a)
  40553. else if (o.isService(r))
  40554. (a = new n.Service(this, this.ptr, r.name, r.options)),
  40555. Object.keys(r.rpc).forEach(function (e) {
  40556. var t = r.rpc[e]
  40557. a.addChild(
  40558. new n.Service.RPCMethod(
  40559. this,
  40560. a,
  40561. e,
  40562. t.request,
  40563. t.response,
  40564. !!t.request_stream,
  40565. !!t.response_stream,
  40566. t.options
  40567. )
  40568. )
  40569. }, this),
  40570. this.ptr.addChild(a)
  40571. else {
  40572. if (!o.isExtend(r))
  40573. throw Error('not a valid definition: ' + JSON.stringify(r))
  40574. if ((a = this.ptr.resolve(r.ref, !0)))
  40575. r.fields.forEach(function (e) {
  40576. if (null !== a.getChild(0 | e.id))
  40577. throw Error(
  40578. 'duplicate extended field id in ' + a.name + ': ' + e.id
  40579. )
  40580. if (a.extensions) {
  40581. var i = !1
  40582. if (
  40583. (a.extensions.forEach(function (t) {
  40584. e.id >= t[0] && e.id <= t[1] && (i = !0)
  40585. }),
  40586. !i)
  40587. )
  40588. throw Error(
  40589. 'illegal extended field id in ' +
  40590. a.name +
  40591. ': ' +
  40592. e.id +
  40593. ' (not within valid ranges)'
  40594. )
  40595. }
  40596. var r = e.name
  40597. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r))
  40598. var o = new n.Message.ExtensionField(
  40599. this,
  40600. a,
  40601. e.rule,
  40602. e.type,
  40603. this.ptr.fqn() + '.' + r,
  40604. e.id,
  40605. e.options
  40606. ),
  40607. s = new n.Extension(this, this.ptr, e.name, o)
  40608. ;(o.extension = s), this.ptr.addChild(s), a.addChild(o)
  40609. }, this)
  40610. else if (!/\.?google\.protobuf\./.test(r.ref))
  40611. throw Error('extended message ' + r.ref + ' is not defined')
  40612. }
  40613. ;(r = null), (a = null)
  40614. }
  40615. ;(e = null), (this.ptr = this.ptr.parent)
  40616. }
  40617. return (this.resolved = !1), (this.result = null), this
  40618. }),
  40619. (a.import = function (i, n) {
  40620. var o = '/'
  40621. if ('string' == typeof n) {
  40622. if ((t.Util.IS_NODE && (n = e('path').resolve(n)), this.files[n] === !0))
  40623. return this.reset()
  40624. this.files[n] = !0
  40625. } else if ('object' == typeof n) {
  40626. var a = n.root
  40627. t.Util.IS_NODE && (a = e('path').resolve(a)),
  40628. (a.indexOf('\\') >= 0 || n.file.indexOf('\\') >= 0) && (o = '\\')
  40629. var s = a + o + n.file
  40630. if (this.files[s] === !0) return this.reset()
  40631. this.files[s] = !0
  40632. }
  40633. if (i.imports && i.imports.length > 0) {
  40634. var l,
  40635. c = !1
  40636. 'object' == typeof n
  40637. ? ((this.importRoot = n.root),
  40638. (c = !0),
  40639. (l = this.importRoot),
  40640. (n = n.file),
  40641. (l.indexOf('\\') >= 0 || n.indexOf('\\') >= 0) && (o = '\\'))
  40642. : 'string' == typeof n
  40643. ? this.importRoot
  40644. ? (l = this.importRoot)
  40645. : n.indexOf('/') >= 0
  40646. ? ((l = n.replace(/\/[^\/]*$/, '')), '' === l && (l = '/'))
  40647. : n.indexOf('\\') >= 0
  40648. ? ((l = n.replace(/\\[^\\]*$/, '')), (o = '\\'))
  40649. : (l = '.')
  40650. : (l = null)
  40651. for (var h = 0; h < i.imports.length; h++)
  40652. if ('string' == typeof i.imports[h]) {
  40653. if (!l) throw Error('cannot determine import root')
  40654. var u = i.imports[h]
  40655. if ('google/protobuf/descriptor.proto' === u) continue
  40656. if (((u = l + o + u), this.files[u] === !0)) continue
  40657. ;/\.proto$/i.test(u) &&
  40658. !t.DotProto &&
  40659. (u = u.replace(/\.proto$/, '.json'))
  40660. var d = t.Util.fetch(u)
  40661. if (null === d)
  40662. throw Error(
  40663. "failed to import '" + u + "' in '" + n + "': file not found"
  40664. )
  40665. ;/\.json$/i.test(u)
  40666. ? this.import(JSON.parse(d + ''), u)
  40667. : this.import(t.DotProto.Parser.parse(d), u)
  40668. } else
  40669. n
  40670. ? /\.(\w+)$/.test(n)
  40671. ? this.import(
  40672. i.imports[h],
  40673. n.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  40674. return t + '_import' + h + '.' + i
  40675. })
  40676. )
  40677. : this.import(i.imports[h], n + '_import' + h)
  40678. : this.import(i.imports[h])
  40679. c && (this.importRoot = null)
  40680. }
  40681. i.package && this.define(i.package), i.syntax && r(i)
  40682. var p = this.ptr
  40683. return (
  40684. i.options &&
  40685. Object.keys(i.options).forEach(function (e) {
  40686. p.options[e] = i.options[e]
  40687. }),
  40688. i.messages && (this.create(i.messages), (this.ptr = p)),
  40689. i.enums && (this.create(i.enums), (this.ptr = p)),
  40690. i.services && (this.create(i.services), (this.ptr = p)),
  40691. i.extends && this.create(i.extends),
  40692. this.reset()
  40693. )
  40694. }),
  40695. (a.resolveAll = function () {
  40696. var e
  40697. if (null == this.ptr || 'object' == typeof this.ptr.type) return this
  40698. if (this.ptr instanceof n.Namespace)
  40699. this.ptr.children.forEach(function (e) {
  40700. ;(this.ptr = e), this.resolveAll()
  40701. }, this)
  40702. else if (this.ptr instanceof n.Message.Field) {
  40703. if (i.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type]
  40704. else {
  40705. if (!i.TYPEREF.test(this.ptr.type))
  40706. throw Error(
  40707. 'illegal type reference in ' +
  40708. this.ptr.toString(!0) +
  40709. ': ' +
  40710. this.ptr.type
  40711. )
  40712. if (
  40713. ((e = (
  40714. this.ptr instanceof n.Message.ExtensionField
  40715. ? this.ptr.extension.parent
  40716. : this.ptr.parent
  40717. ).resolve(this.ptr.type, !0)),
  40718. !e)
  40719. )
  40720. throw Error(
  40721. 'unresolvable type reference in ' +
  40722. this.ptr.toString(!0) +
  40723. ': ' +
  40724. this.ptr.type
  40725. )
  40726. if (((this.ptr.resolvedType = e), e instanceof n.Enum)) {
  40727. if (
  40728. ((this.ptr.type = t.TYPES.enum),
  40729. 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)
  40730. )
  40731. throw Error('proto3 message cannot reference proto2 enum')
  40732. } else {
  40733. if (!(e instanceof n.Message))
  40734. throw Error(
  40735. 'illegal type reference in ' +
  40736. this.ptr.toString(!0) +
  40737. ': ' +
  40738. this.ptr.type
  40739. )
  40740. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  40741. }
  40742. }
  40743. if (this.ptr.map) {
  40744. if (!i.TYPE.test(this.ptr.keyType))
  40745. throw Error(
  40746. 'illegal key type for map field in ' +
  40747. this.ptr.toString(!0) +
  40748. ': ' +
  40749. this.ptr.keyType
  40750. )
  40751. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  40752. }
  40753. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  40754. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  40755. throw Error('illegal service type in ' + this.ptr.toString(!0))
  40756. if (
  40757. ((e = this.ptr.parent.resolve(this.ptr.requestName, !0)),
  40758. !(e && e instanceof t.Reflect.Message))
  40759. )
  40760. throw Error(
  40761. 'Illegal type reference in ' +
  40762. this.ptr.toString(!0) +
  40763. ': ' +
  40764. this.ptr.requestName
  40765. )
  40766. if (
  40767. ((this.ptr.resolvedRequestType = e),
  40768. (e = this.ptr.parent.resolve(this.ptr.responseName, !0)),
  40769. !(e && e instanceof t.Reflect.Message))
  40770. )
  40771. throw Error(
  40772. 'Illegal type reference in ' +
  40773. this.ptr.toString(!0) +
  40774. ': ' +
  40775. this.ptr.responseName
  40776. )
  40777. this.ptr.resolvedResponseType = e
  40778. } else if (
  40779. !(
  40780. this.ptr instanceof t.Reflect.Message.OneOf ||
  40781. this.ptr instanceof t.Reflect.Extension ||
  40782. this.ptr instanceof t.Reflect.Enum.Value
  40783. )
  40784. )
  40785. throw Error(
  40786. 'illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr
  40787. )
  40788. return this.reset()
  40789. }),
  40790. (a.build = function (e) {
  40791. if (
  40792. (this.reset(),
  40793. this.resolved ||
  40794. (this.resolveAll(), (this.resolved = !0), (this.result = null)),
  40795. null === this.result && (this.result = this.ns.build()),
  40796. !e)
  40797. )
  40798. return this.result
  40799. for (
  40800. var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0;
  40801. n < t.length;
  40802. n++
  40803. ) {
  40804. if (!i[t[n]]) {
  40805. i = null
  40806. break
  40807. }
  40808. i = i[t[n]]
  40809. }
  40810. return i
  40811. }),
  40812. (a.lookup = function (e, t) {
  40813. return e ? this.ns.resolve(e, t) : this.ns
  40814. }),
  40815. (a.toString = function () {
  40816. return 'Builder'
  40817. }),
  40818. (o.Message = function () {}),
  40819. (o.Enum = function () {}),
  40820. (o.Service = function () {}),
  40821. o
  40822. )
  40823. })(r, r.Lang, r.Reflect)),
  40824. (r.Map = (function (e, t) {
  40825. function i(e) {
  40826. var t = 0
  40827. return {
  40828. next: function () {
  40829. return t < e.length
  40830. ? {
  40831. done: !1,
  40832. value: e[t++]
  40833. }
  40834. : {
  40835. done: !0
  40836. }
  40837. }
  40838. }
  40839. }
  40840. var n = function (e, i) {
  40841. if (!e.map) throw Error('field is not a map')
  40842. if (
  40843. ((this.field = e),
  40844. (this.keyElem = new t.Element(e.keyType, null, !0, e.syntax)),
  40845. (this.valueElem = new t.Element(e.type, e.resolvedType, !1, e.syntax)),
  40846. (this.map = {}),
  40847. Object.defineProperty(this, 'size', {
  40848. get: function () {
  40849. return Object.keys(this.map).length
  40850. }
  40851. }),
  40852. i)
  40853. )
  40854. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  40855. var o = this.keyElem.valueFromString(n[r]),
  40856. a = this.valueElem.verifyValue(i[n[r]])
  40857. this.map[this.keyElem.valueToString(o)] = {
  40858. key: o,
  40859. value: a
  40860. }
  40861. }
  40862. },
  40863. r = n.prototype
  40864. return (
  40865. (r.clear = function () {
  40866. this.map = {}
  40867. }),
  40868. (r.delete = function (e) {
  40869. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  40870. i = t in this.map
  40871. return delete this.map[t], i
  40872. }),
  40873. (r.entries = function () {
  40874. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  40875. t.push([(e = this.map[n[r]]).key, e.value])
  40876. return i(t)
  40877. }),
  40878. (r.keys = function () {
  40879. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40880. e.push(this.map[t[n]].key)
  40881. return i(e)
  40882. }),
  40883. (r.values = function () {
  40884. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40885. e.push(this.map[t[n]].value)
  40886. return i(e)
  40887. }),
  40888. (r.forEach = function (e, t) {
  40889. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  40890. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  40891. }),
  40892. (r.set = function (e, t) {
  40893. var i = this.keyElem.verifyValue(e),
  40894. n = this.valueElem.verifyValue(t)
  40895. return (
  40896. (this.map[this.keyElem.valueToString(i)] = {
  40897. key: i,
  40898. value: n
  40899. }),
  40900. this
  40901. )
  40902. }),
  40903. (r.get = function (e) {
  40904. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  40905. if (t in this.map) return this.map[t].value
  40906. }),
  40907. (r.has = function (e) {
  40908. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  40909. return t in this.map
  40910. }),
  40911. n
  40912. )
  40913. })(r, r.Reflect)),
  40914. (r.loadProto = function (e, t, i) {
  40915. return (
  40916. ('string' == typeof t ||
  40917. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40918. ((i = t), (t = void 0)),
  40919. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  40920. )
  40921. }),
  40922. (r.protoFromString = r.loadProto),
  40923. (r.loadProtoFile = function (e, t, i) {
  40924. if (
  40925. (t && 'object' == typeof t
  40926. ? ((i = t), (t = null))
  40927. : (t && 'function' == typeof t) || (t = null),
  40928. t)
  40929. )
  40930. return r.Util.fetch(
  40931. 'string' == typeof e ? e : e.root + '/' + e.file,
  40932. function (n) {
  40933. if (null === n) return void t(Error('Failed to fetch file'))
  40934. try {
  40935. t(null, r.loadProto(n, i, e))
  40936. } catch (e) {
  40937. t(e)
  40938. }
  40939. }
  40940. )
  40941. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  40942. return null === n ? null : r.loadProto(n, i, e)
  40943. }),
  40944. (r.protoFromFile = r.loadProtoFile),
  40945. (r.newBuilder = function (e) {
  40946. return (
  40947. (e = e || {}),
  40948. 'undefined' == typeof e.convertFieldsToCamelCase &&
  40949. (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  40950. 'undefined' == typeof e.populateAccessors &&
  40951. (e.populateAccessors = r.populateAccessors),
  40952. new r.Builder(e)
  40953. )
  40954. }),
  40955. (r.loadJson = function (e, t, i) {
  40956. return (
  40957. ('string' == typeof t ||
  40958. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40959. ((i = t), (t = null)),
  40960. (t && 'object' == typeof t) || (t = r.newBuilder()),
  40961. 'string' == typeof e && (e = JSON.parse(e)),
  40962. t.import(e, i),
  40963. t.resolveAll(),
  40964. t
  40965. )
  40966. }),
  40967. (r.loadJsonFile = function (e, t, i) {
  40968. if (
  40969. (t && 'object' == typeof t
  40970. ? ((i = t), (t = null))
  40971. : (t && 'function' == typeof t) || (t = null),
  40972. t)
  40973. )
  40974. return r.Util.fetch(
  40975. 'string' == typeof e ? e : e.root + '/' + e.file,
  40976. function (n) {
  40977. if (null === n) return void t(Error('Failed to fetch file'))
  40978. try {
  40979. t(null, r.loadJson(JSON.parse(n), i, e))
  40980. } catch (e) {
  40981. t(e)
  40982. }
  40983. }
  40984. )
  40985. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  40986. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  40987. }),
  40988. r
  40989. )
  40990. })
  40991. }).call(this, e('_process'))
  40992. },
  40993. {
  40994. _process: 203,
  40995. bytebuffer: 215,
  40996. fs: 197,
  40997. path: 197
  40998. }
  40999. ],
  41000. 215: [
  41001. function (e, t, i) {
  41002. !(function (i, n) {
  41003. 'function' == typeof define && define.amd
  41004. ? define(['long'], n)
  41005. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  41006. ? (t.exports = (function () {
  41007. var t
  41008. try {
  41009. t = e('long')
  41010. } catch (e) {}
  41011. return n(t)
  41012. })())
  41013. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long))
  41014. })(this, function (e) {
  41015. 'use strict'
  41016. function t(e) {
  41017. var t = 0
  41018. return function () {
  41019. return t < e.length ? e.charCodeAt(t++) : null
  41020. }
  41021. }
  41022. function i() {
  41023. var e = [],
  41024. t = []
  41025. return function () {
  41026. return 0 === arguments.length
  41027. ? t.join('') + l.apply(String, e)
  41028. : (e.length + arguments.length > 1024 &&
  41029. (t.push(l.apply(String, e)), (e.length = 0)),
  41030. void Array.prototype.push.apply(e, arguments))
  41031. }
  41032. }
  41033. function n(e, t, i, n, r) {
  41034. var o,
  41035. a,
  41036. s = 8 * r - n - 1,
  41037. l = (1 << s) - 1,
  41038. c = l >> 1,
  41039. h = -7,
  41040. u = i ? r - 1 : 0,
  41041. d = i ? -1 : 1,
  41042. p = e[t + u]
  41043. for (
  41044. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  41045. h > 0;
  41046. o = 256 * o + e[t + u], u += d, h -= 8
  41047. );
  41048. for (
  41049. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  41050. h > 0;
  41051. a = 256 * a + e[t + u], u += d, h -= 8
  41052. );
  41053. if (0 === o) o = 1 - c
  41054. else {
  41055. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  41056. ;(a += Math.pow(2, n)), (o -= c)
  41057. }
  41058. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  41059. }
  41060. function r(e, t, i, n, r, o) {
  41061. var a,
  41062. s,
  41063. l,
  41064. c = 8 * o - r - 1,
  41065. h = (1 << c) - 1,
  41066. u = h >> 1,
  41067. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  41068. p = n ? 0 : o - 1,
  41069. f = n ? 1 : -1,
  41070. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  41071. for (
  41072. t = Math.abs(t),
  41073. isNaN(t) || t === 1 / 0
  41074. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  41075. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  41076. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  41077. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  41078. t * l >= 2 && (a++, (l /= 2)),
  41079. a + u >= h
  41080. ? ((s = 0), (a = h))
  41081. : a + u >= 1
  41082. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  41083. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  41084. r >= 8;
  41085. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  41086. );
  41087. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  41088. e[i + p - f] |= 128 * g
  41089. }
  41090. var o = function (e, t, i) {
  41091. if (
  41092. ('undefined' == typeof e && (e = o.DEFAULT_CAPACITY),
  41093. 'undefined' == typeof t && (t = o.DEFAULT_ENDIAN),
  41094. 'undefined' == typeof i && (i = o.DEFAULT_NOASSERT),
  41095. !i)
  41096. ) {
  41097. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity')
  41098. ;(t = !!t), (i = !!i)
  41099. }
  41100. ;(this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  41101. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  41102. (this.offset = 0),
  41103. (this.markedOffset = -1),
  41104. (this.limit = e),
  41105. (this.littleEndian = t),
  41106. (this.noAssert = i)
  41107. }
  41108. ;(o.VERSION = '5.0.1'),
  41109. (o.LITTLE_ENDIAN = !0),
  41110. (o.BIG_ENDIAN = !1),
  41111. (o.DEFAULT_CAPACITY = 16),
  41112. (o.DEFAULT_ENDIAN = o.BIG_ENDIAN),
  41113. (o.DEFAULT_NOASSERT = !1),
  41114. (o.Long = e || null)
  41115. var a = o.prototype
  41116. a.__isByteBuffer__,
  41117. Object.defineProperty(a, '__isByteBuffer__', {
  41118. value: !0,
  41119. enumerable: !1,
  41120. configurable: !1
  41121. })
  41122. var s = new ArrayBuffer(0),
  41123. l = String.fromCharCode
  41124. ;(o.accessor = function () {
  41125. return Uint8Array
  41126. }),
  41127. (o.allocate = function (e, t, i) {
  41128. return new o(e, t, i)
  41129. }),
  41130. (o.concat = function (e, t, i, n) {
  41131. ;('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0))
  41132. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  41133. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  41134. (r = e[s].limit - e[s].offset),
  41135. r > 0 && (a += r)
  41136. if (0 === a) return new o(0, i, n)
  41137. var c,
  41138. h = new o(a, i, n)
  41139. for (s = 0; s < l; )
  41140. (c = e[s++]),
  41141. (r = c.limit - c.offset),
  41142. r <= 0 ||
  41143. (h.view.set(c.view.subarray(c.offset, c.limit), h.offset), (h.offset += r))
  41144. return (h.limit = h.offset), (h.offset = 0), h
  41145. }),
  41146. (o.isByteBuffer = function (e) {
  41147. return (e && e.__isByteBuffer__) === !0
  41148. }),
  41149. (o.type = function () {
  41150. return ArrayBuffer
  41151. }),
  41152. (o.wrap = function (e, t, i, n) {
  41153. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  41154. switch (('undefined' == typeof t && (t = 'utf8'), t)) {
  41155. case 'base64':
  41156. return o.fromBase64(e, i)
  41157. case 'hex':
  41158. return o.fromHex(e, i)
  41159. case 'binary':
  41160. return o.fromBinary(e, i)
  41161. case 'utf8':
  41162. return o.fromUTF8(e, i)
  41163. case 'debug':
  41164. return o.fromDebug(e, i)
  41165. default:
  41166. throw Error('Unsupported encoding: ' + t)
  41167. }
  41168. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer')
  41169. var r
  41170. if (o.isByteBuffer(e)) return (r = a.clone.call(e)), (r.markedOffset = -1), r
  41171. if (e instanceof Uint8Array)
  41172. (r = new o(0, i, n)),
  41173. e.length > 0 &&
  41174. ((r.buffer = e.buffer),
  41175. (r.offset = e.byteOffset),
  41176. (r.limit = e.byteOffset + e.byteLength),
  41177. (r.view = new Uint8Array(e.buffer)))
  41178. else if (e instanceof ArrayBuffer)
  41179. (r = new o(0, i, n)),
  41180. e.byteLength > 0 &&
  41181. ((r.buffer = e),
  41182. (r.offset = 0),
  41183. (r.limit = e.byteLength),
  41184. (r.view = e.byteLength > 0 ? new Uint8Array(e) : null))
  41185. else {
  41186. if ('[object Array]' !== Object.prototype.toString.call(e))
  41187. throw TypeError('Illegal buffer')
  41188. ;(r = new o(e.length, i, n)), (r.limit = e.length)
  41189. for (var s = 0; s < e.length; ++s) r.view[s] = e[s]
  41190. }
  41191. return r
  41192. }),
  41193. (a.writeBitSet = function (e, t) {
  41194. var i = 'undefined' == typeof t
  41195. if ((i && (t = this.offset), !this.noAssert)) {
  41196. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array')
  41197. if ('number' != typeof t || t % 1 !== 0)
  41198. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41199. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41200. throw RangeError(
  41201. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41202. )
  41203. }
  41204. var n,
  41205. r = t,
  41206. o = e.length,
  41207. a = o >> 3,
  41208. s = 0
  41209. for (t += this.writeVarint32(o, t); a--; )
  41210. (n =
  41211. (1 & !!e[s++]) |
  41212. ((1 & !!e[s++]) << 1) |
  41213. ((1 & !!e[s++]) << 2) |
  41214. ((1 & !!e[s++]) << 3) |
  41215. ((1 & !!e[s++]) << 4) |
  41216. ((1 & !!e[s++]) << 5) |
  41217. ((1 & !!e[s++]) << 6) |
  41218. ((1 & !!e[s++]) << 7)),
  41219. this.writeByte(n, t++)
  41220. if (s < o) {
  41221. var l = 0
  41222. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++
  41223. this.writeByte(n, t++)
  41224. }
  41225. return i ? ((this.offset = t), this) : t - r
  41226. }),
  41227. (a.readBitSet = function (e) {
  41228. var t = 'undefined' == typeof e
  41229. t && (e = this.offset)
  41230. var i,
  41231. n = this.readVarint32(e),
  41232. r = n.value,
  41233. o = r >> 3,
  41234. a = 0,
  41235. s = []
  41236. for (e += n.length; o--; )
  41237. (i = this.readByte(e++)),
  41238. (s[a++] = !!(1 & i)),
  41239. (s[a++] = !!(2 & i)),
  41240. (s[a++] = !!(4 & i)),
  41241. (s[a++] = !!(8 & i)),
  41242. (s[a++] = !!(16 & i)),
  41243. (s[a++] = !!(32 & i)),
  41244. (s[a++] = !!(64 & i)),
  41245. (s[a++] = !!(128 & i))
  41246. if (a < r) {
  41247. var l = 0
  41248. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1)
  41249. }
  41250. return t && (this.offset = e), s
  41251. }),
  41252. (a.readBytes = function (e, t) {
  41253. var i = 'undefined' == typeof t
  41254. if ((i && (t = this.offset), !this.noAssert)) {
  41255. if ('number' != typeof t || t % 1 !== 0)
  41256. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41257. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength))
  41258. throw RangeError(
  41259. 'Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength
  41260. )
  41261. }
  41262. var n = this.slice(t, t + e)
  41263. return i && (this.offset += e), n
  41264. }),
  41265. (a.writeBytes = a.append),
  41266. (a.writeInt8 = function (e, t) {
  41267. var i = 'undefined' == typeof t
  41268. if ((i && (t = this.offset), !this.noAssert)) {
  41269. if ('number' != typeof e || e % 1 !== 0)
  41270. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41271. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41272. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41273. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41274. throw RangeError(
  41275. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41276. )
  41277. }
  41278. t += 1
  41279. var n = this.buffer.byteLength
  41280. return (
  41281. t > n && this.resize((n *= 2) > t ? n : t),
  41282. (t -= 1),
  41283. (this.view[t] = e),
  41284. i && (this.offset += 1),
  41285. this
  41286. )
  41287. }),
  41288. (a.writeByte = a.writeInt8),
  41289. (a.readInt8 = function (e) {
  41290. var t = 'undefined' == typeof e
  41291. if ((t && (e = this.offset), !this.noAssert)) {
  41292. if ('number' != typeof e || e % 1 !== 0)
  41293. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41294. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41295. throw RangeError(
  41296. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41297. )
  41298. }
  41299. var i = this.view[e]
  41300. return 128 === (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i
  41301. }),
  41302. (a.readByte = a.readInt8),
  41303. (a.writeUint8 = function (e, t) {
  41304. var i = 'undefined' == typeof t
  41305. if ((i && (t = this.offset), !this.noAssert)) {
  41306. if ('number' != typeof e || e % 1 !== 0)
  41307. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41308. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41309. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41310. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41311. throw RangeError(
  41312. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41313. )
  41314. }
  41315. t += 1
  41316. var n = this.buffer.byteLength
  41317. return (
  41318. t > n && this.resize((n *= 2) > t ? n : t),
  41319. (t -= 1),
  41320. (this.view[t] = e),
  41321. i && (this.offset += 1),
  41322. this
  41323. )
  41324. }),
  41325. (a.writeUInt8 = a.writeUint8),
  41326. (a.readUint8 = function (e) {
  41327. var t = 'undefined' == typeof e
  41328. if ((t && (e = this.offset), !this.noAssert)) {
  41329. if ('number' != typeof e || e % 1 !== 0)
  41330. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41331. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41332. throw RangeError(
  41333. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41334. )
  41335. }
  41336. var i = this.view[e]
  41337. return t && (this.offset += 1), i
  41338. }),
  41339. (a.readUInt8 = a.readUint8),
  41340. (a.writeInt16 = function (e, t) {
  41341. var i = 'undefined' == typeof t
  41342. if ((i && (t = this.offset), !this.noAssert)) {
  41343. if ('number' != typeof e || e % 1 !== 0)
  41344. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41345. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41346. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41347. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41348. throw RangeError(
  41349. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41350. )
  41351. }
  41352. t += 2
  41353. var n = this.buffer.byteLength
  41354. return (
  41355. t > n && this.resize((n *= 2) > t ? n : t),
  41356. (t -= 2),
  41357. this.littleEndian
  41358. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41359. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41360. i && (this.offset += 2),
  41361. this
  41362. )
  41363. }),
  41364. (a.writeShort = a.writeInt16),
  41365. (a.readInt16 = function (e) {
  41366. var t = 'undefined' == typeof e
  41367. if ((t && (e = this.offset), !this.noAssert)) {
  41368. if ('number' != typeof e || e % 1 !== 0)
  41369. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41370. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41371. throw RangeError(
  41372. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41373. )
  41374. }
  41375. var i = 0
  41376. return (
  41377. this.littleEndian
  41378. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41379. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41380. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  41381. t && (this.offset += 2),
  41382. i
  41383. )
  41384. }),
  41385. (a.readShort = a.readInt16),
  41386. (a.writeUint16 = function (e, t) {
  41387. var i = 'undefined' == typeof t
  41388. if ((i && (t = this.offset), !this.noAssert)) {
  41389. if ('number' != typeof e || e % 1 !== 0)
  41390. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41391. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41392. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41393. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41394. throw RangeError(
  41395. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41396. )
  41397. }
  41398. t += 2
  41399. var n = this.buffer.byteLength
  41400. return (
  41401. t > n && this.resize((n *= 2) > t ? n : t),
  41402. (t -= 2),
  41403. this.littleEndian
  41404. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41405. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41406. i && (this.offset += 2),
  41407. this
  41408. )
  41409. }),
  41410. (a.writeUInt16 = a.writeUint16),
  41411. (a.readUint16 = function (e) {
  41412. var t = 'undefined' == typeof e
  41413. if ((t && (e = this.offset), !this.noAssert)) {
  41414. if ('number' != typeof e || e % 1 !== 0)
  41415. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41416. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41417. throw RangeError(
  41418. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41419. )
  41420. }
  41421. var i = 0
  41422. return (
  41423. this.littleEndian
  41424. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41425. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41426. t && (this.offset += 2),
  41427. i
  41428. )
  41429. }),
  41430. (a.readUInt16 = a.readUint16),
  41431. (a.writeInt32 = function (e, t) {
  41432. var i = 'undefined' == typeof t
  41433. if ((i && (t = this.offset), !this.noAssert)) {
  41434. if ('number' != typeof e || e % 1 !== 0)
  41435. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41436. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41437. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41438. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41439. throw RangeError(
  41440. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41441. )
  41442. }
  41443. t += 4
  41444. var n = this.buffer.byteLength
  41445. return (
  41446. t > n && this.resize((n *= 2) > t ? n : t),
  41447. (t -= 4),
  41448. this.littleEndian
  41449. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41450. (this.view[t + 2] = (e >>> 16) & 255),
  41451. (this.view[t + 1] = (e >>> 8) & 255),
  41452. (this.view[t] = 255 & e))
  41453. : ((this.view[t] = (e >>> 24) & 255),
  41454. (this.view[t + 1] = (e >>> 16) & 255),
  41455. (this.view[t + 2] = (e >>> 8) & 255),
  41456. (this.view[t + 3] = 255 & e)),
  41457. i && (this.offset += 4),
  41458. this
  41459. )
  41460. }),
  41461. (a.writeInt = a.writeInt32),
  41462. (a.readInt32 = function (e) {
  41463. var t = 'undefined' == typeof e
  41464. if ((t && (e = this.offset), !this.noAssert)) {
  41465. if ('number' != typeof e || e % 1 !== 0)
  41466. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41467. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41468. throw RangeError(
  41469. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41470. )
  41471. }
  41472. var i = 0
  41473. return (
  41474. this.littleEndian
  41475. ? ((i = this.view[e + 2] << 16),
  41476. (i |= this.view[e + 1] << 8),
  41477. (i |= this.view[e]),
  41478. (i += (this.view[e + 3] << 24) >>> 0))
  41479. : ((i = this.view[e + 1] << 16),
  41480. (i |= this.view[e + 2] << 8),
  41481. (i |= this.view[e + 3]),
  41482. (i += (this.view[e] << 24) >>> 0)),
  41483. (i |= 0),
  41484. t && (this.offset += 4),
  41485. i
  41486. )
  41487. }),
  41488. (a.readInt = a.readInt32),
  41489. (a.writeUint32 = function (e, t) {
  41490. var i = 'undefined' == typeof t
  41491. if ((i && (t = this.offset), !this.noAssert)) {
  41492. if ('number' != typeof e || e % 1 !== 0)
  41493. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41494. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41495. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41496. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41497. throw RangeError(
  41498. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41499. )
  41500. }
  41501. t += 4
  41502. var n = this.buffer.byteLength
  41503. return (
  41504. t > n && this.resize((n *= 2) > t ? n : t),
  41505. (t -= 4),
  41506. this.littleEndian
  41507. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41508. (this.view[t + 2] = (e >>> 16) & 255),
  41509. (this.view[t + 1] = (e >>> 8) & 255),
  41510. (this.view[t] = 255 & e))
  41511. : ((this.view[t] = (e >>> 24) & 255),
  41512. (this.view[t + 1] = (e >>> 16) & 255),
  41513. (this.view[t + 2] = (e >>> 8) & 255),
  41514. (this.view[t + 3] = 255 & e)),
  41515. i && (this.offset += 4),
  41516. this
  41517. )
  41518. }),
  41519. (a.writeUInt32 = a.writeUint32),
  41520. (a.readUint32 = function (e) {
  41521. var t = 'undefined' == typeof e
  41522. if ((t && (e = this.offset), !this.noAssert)) {
  41523. if ('number' != typeof e || e % 1 !== 0)
  41524. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41525. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41526. throw RangeError(
  41527. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41528. )
  41529. }
  41530. var i = 0
  41531. return (
  41532. this.littleEndian
  41533. ? ((i = this.view[e + 2] << 16),
  41534. (i |= this.view[e + 1] << 8),
  41535. (i |= this.view[e]),
  41536. (i += (this.view[e + 3] << 24) >>> 0))
  41537. : ((i = this.view[e + 1] << 16),
  41538. (i |= this.view[e + 2] << 8),
  41539. (i |= this.view[e + 3]),
  41540. (i += (this.view[e] << 24) >>> 0)),
  41541. t && (this.offset += 4),
  41542. i
  41543. )
  41544. }),
  41545. (a.readUInt32 = a.readUint32),
  41546. e &&
  41547. ((a.writeInt64 = function (t, i) {
  41548. var n = 'undefined' == typeof i
  41549. if ((n && (i = this.offset), !this.noAssert)) {
  41550. if ('number' == typeof t) t = e.fromNumber(t)
  41551. else if ('string' == typeof t) t = e.fromString(t)
  41552. else if (!(t && t instanceof e))
  41553. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  41554. if ('number' != typeof i || i % 1 !== 0)
  41555. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  41556. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41557. throw RangeError(
  41558. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41559. )
  41560. }
  41561. 'number' == typeof t
  41562. ? (t = e.fromNumber(t))
  41563. : 'string' == typeof t && (t = e.fromString(t)),
  41564. (i += 8)
  41565. var r = this.buffer.byteLength
  41566. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  41567. var o = t.low,
  41568. a = t.high
  41569. return (
  41570. this.littleEndian
  41571. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41572. (this.view[i + 2] = (o >>> 16) & 255),
  41573. (this.view[i + 1] = (o >>> 8) & 255),
  41574. (this.view[i] = 255 & o),
  41575. (i += 4),
  41576. (this.view[i + 3] = (a >>> 24) & 255),
  41577. (this.view[i + 2] = (a >>> 16) & 255),
  41578. (this.view[i + 1] = (a >>> 8) & 255),
  41579. (this.view[i] = 255 & a))
  41580. : ((this.view[i] = (a >>> 24) & 255),
  41581. (this.view[i + 1] = (a >>> 16) & 255),
  41582. (this.view[i + 2] = (a >>> 8) & 255),
  41583. (this.view[i + 3] = 255 & a),
  41584. (i += 4),
  41585. (this.view[i] = (o >>> 24) & 255),
  41586. (this.view[i + 1] = (o >>> 16) & 255),
  41587. (this.view[i + 2] = (o >>> 8) & 255),
  41588. (this.view[i + 3] = 255 & o)),
  41589. n && (this.offset += 8),
  41590. this
  41591. )
  41592. }),
  41593. (a.writeLong = a.writeInt64),
  41594. (a.readInt64 = function (t) {
  41595. var i = 'undefined' == typeof t
  41596. if ((i && (t = this.offset), !this.noAssert)) {
  41597. if ('number' != typeof t || t % 1 !== 0)
  41598. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41599. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41600. throw RangeError(
  41601. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41602. )
  41603. }
  41604. var n = 0,
  41605. r = 0
  41606. this.littleEndian
  41607. ? ((n = this.view[t + 2] << 16),
  41608. (n |= this.view[t + 1] << 8),
  41609. (n |= this.view[t]),
  41610. (n += (this.view[t + 3] << 24) >>> 0),
  41611. (t += 4),
  41612. (r = this.view[t + 2] << 16),
  41613. (r |= this.view[t + 1] << 8),
  41614. (r |= this.view[t]),
  41615. (r += (this.view[t + 3] << 24) >>> 0))
  41616. : ((r = this.view[t + 1] << 16),
  41617. (r |= this.view[t + 2] << 8),
  41618. (r |= this.view[t + 3]),
  41619. (r += (this.view[t] << 24) >>> 0),
  41620. (t += 4),
  41621. (n = this.view[t + 1] << 16),
  41622. (n |= this.view[t + 2] << 8),
  41623. (n |= this.view[t + 3]),
  41624. (n += (this.view[t] << 24) >>> 0))
  41625. var o = new e(n, r, !1)
  41626. return i && (this.offset += 8), o
  41627. }),
  41628. (a.readLong = a.readInt64),
  41629. (a.writeUint64 = function (t, i) {
  41630. var n = 'undefined' == typeof i
  41631. if ((n && (i = this.offset), !this.noAssert)) {
  41632. if ('number' == typeof t) t = e.fromNumber(t)
  41633. else if ('string' == typeof t) t = e.fromString(t)
  41634. else if (!(t && t instanceof e))
  41635. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  41636. if ('number' != typeof i || i % 1 !== 0)
  41637. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  41638. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41639. throw RangeError(
  41640. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41641. )
  41642. }
  41643. 'number' == typeof t
  41644. ? (t = e.fromNumber(t))
  41645. : 'string' == typeof t && (t = e.fromString(t)),
  41646. (i += 8)
  41647. var r = this.buffer.byteLength
  41648. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  41649. var o = t.low,
  41650. a = t.high
  41651. return (
  41652. this.littleEndian
  41653. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41654. (this.view[i + 2] = (o >>> 16) & 255),
  41655. (this.view[i + 1] = (o >>> 8) & 255),
  41656. (this.view[i] = 255 & o),
  41657. (i += 4),
  41658. (this.view[i + 3] = (a >>> 24) & 255),
  41659. (this.view[i + 2] = (a >>> 16) & 255),
  41660. (this.view[i + 1] = (a >>> 8) & 255),
  41661. (this.view[i] = 255 & a))
  41662. : ((this.view[i] = (a >>> 24) & 255),
  41663. (this.view[i + 1] = (a >>> 16) & 255),
  41664. (this.view[i + 2] = (a >>> 8) & 255),
  41665. (this.view[i + 3] = 255 & a),
  41666. (i += 4),
  41667. (this.view[i] = (o >>> 24) & 255),
  41668. (this.view[i + 1] = (o >>> 16) & 255),
  41669. (this.view[i + 2] = (o >>> 8) & 255),
  41670. (this.view[i + 3] = 255 & o)),
  41671. n && (this.offset += 8),
  41672. this
  41673. )
  41674. }),
  41675. (a.writeUInt64 = a.writeUint64),
  41676. (a.readUint64 = function (t) {
  41677. var i = 'undefined' == typeof t
  41678. if ((i && (t = this.offset), !this.noAssert)) {
  41679. if ('number' != typeof t || t % 1 !== 0)
  41680. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41681. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41682. throw RangeError(
  41683. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41684. )
  41685. }
  41686. var n = 0,
  41687. r = 0
  41688. this.littleEndian
  41689. ? ((n = this.view[t + 2] << 16),
  41690. (n |= this.view[t + 1] << 8),
  41691. (n |= this.view[t]),
  41692. (n += (this.view[t + 3] << 24) >>> 0),
  41693. (t += 4),
  41694. (r = this.view[t + 2] << 16),
  41695. (r |= this.view[t + 1] << 8),
  41696. (r |= this.view[t]),
  41697. (r += (this.view[t + 3] << 24) >>> 0))
  41698. : ((r = this.view[t + 1] << 16),
  41699. (r |= this.view[t + 2] << 8),
  41700. (r |= this.view[t + 3]),
  41701. (r += (this.view[t] << 24) >>> 0),
  41702. (t += 4),
  41703. (n = this.view[t + 1] << 16),
  41704. (n |= this.view[t + 2] << 8),
  41705. (n |= this.view[t + 3]),
  41706. (n += (this.view[t] << 24) >>> 0))
  41707. var o = new e(n, r, !0)
  41708. return i && (this.offset += 8), o
  41709. }),
  41710. (a.readUInt64 = a.readUint64)),
  41711. (a.writeFloat32 = function (e, t) {
  41712. var i = 'undefined' == typeof t
  41713. if ((i && (t = this.offset), !this.noAssert)) {
  41714. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  41715. if ('number' != typeof t || t % 1 !== 0)
  41716. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41717. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41718. throw RangeError(
  41719. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41720. )
  41721. }
  41722. t += 4
  41723. var n = this.buffer.byteLength
  41724. return (
  41725. t > n && this.resize((n *= 2) > t ? n : t),
  41726. (t -= 4),
  41727. r(this.view, e, t, this.littleEndian, 23, 4),
  41728. i && (this.offset += 4),
  41729. this
  41730. )
  41731. }),
  41732. (a.writeFloat = a.writeFloat32),
  41733. (a.readFloat32 = function (e) {
  41734. var t = 'undefined' == typeof e
  41735. if ((t && (e = this.offset), !this.noAssert)) {
  41736. if ('number' != typeof e || e % 1 !== 0)
  41737. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41738. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41739. throw RangeError(
  41740. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41741. )
  41742. }
  41743. var i = n(this.view, e, this.littleEndian, 23, 4)
  41744. return t && (this.offset += 4), i
  41745. }),
  41746. (a.readFloat = a.readFloat32),
  41747. (a.writeFloat64 = function (e, t) {
  41748. var i = 'undefined' == typeof t
  41749. if ((i && (t = this.offset), !this.noAssert)) {
  41750. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  41751. if ('number' != typeof t || t % 1 !== 0)
  41752. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41753. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41754. throw RangeError(
  41755. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41756. )
  41757. }
  41758. t += 8
  41759. var n = this.buffer.byteLength
  41760. return (
  41761. t > n && this.resize((n *= 2) > t ? n : t),
  41762. (t -= 8),
  41763. r(this.view, e, t, this.littleEndian, 52, 8),
  41764. i && (this.offset += 8),
  41765. this
  41766. )
  41767. }),
  41768. (a.writeDouble = a.writeFloat64),
  41769. (a.readFloat64 = function (e) {
  41770. var t = 'undefined' == typeof e
  41771. if ((t && (e = this.offset), !this.noAssert)) {
  41772. if ('number' != typeof e || e % 1 !== 0)
  41773. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41774. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength))
  41775. throw RangeError(
  41776. 'Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength
  41777. )
  41778. }
  41779. var i = n(this.view, e, this.littleEndian, 52, 8)
  41780. return t && (this.offset += 8), i
  41781. }),
  41782. (a.readDouble = a.readFloat64),
  41783. (o.MAX_VARINT32_BYTES = 5),
  41784. (o.calculateVarint32 = function (e) {
  41785. return (e >>>= 0), e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  41786. }),
  41787. (o.zigZagEncode32 = function (e) {
  41788. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0
  41789. }),
  41790. (o.zigZagDecode32 = function (e) {
  41791. return ((e >>> 1) ^ -(1 & e)) | 0
  41792. }),
  41793. (a.writeVarint32 = function (e, t) {
  41794. var i = 'undefined' == typeof t
  41795. if ((i && (t = this.offset), !this.noAssert)) {
  41796. if ('number' != typeof e || e % 1 !== 0)
  41797. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41798. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41799. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41800. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41801. throw RangeError(
  41802. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41803. )
  41804. }
  41805. var n,
  41806. r = o.calculateVarint32(e)
  41807. t += r
  41808. var a = this.buffer.byteLength
  41809. for (t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0; e >= 128; )
  41810. (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7)
  41811. return (this.view[t++] = e), i ? ((this.offset = t), this) : r
  41812. }),
  41813. (a.writeVarint32ZigZag = function (e, t) {
  41814. return this.writeVarint32(o.zigZagEncode32(e), t)
  41815. }),
  41816. (a.readVarint32 = function (e) {
  41817. var t = 'undefined' == typeof e
  41818. if ((t && (e = this.offset), !this.noAssert)) {
  41819. if ('number' != typeof e || e % 1 !== 0)
  41820. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41821. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41822. throw RangeError(
  41823. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41824. )
  41825. }
  41826. var i,
  41827. n = 0,
  41828. r = 0
  41829. do {
  41830. if (!this.noAssert && e > this.limit) {
  41831. var o = Error('Truncated')
  41832. throw ((o.truncated = !0), o)
  41833. }
  41834. ;(i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n
  41835. } while (0 !== (128 & i))
  41836. return (
  41837. (r |= 0),
  41838. t
  41839. ? ((this.offset = e), r)
  41840. : {
  41841. value: r,
  41842. length: n
  41843. }
  41844. )
  41845. }),
  41846. (a.readVarint32ZigZag = function (e) {
  41847. var t = this.readVarint32(e)
  41848. return (
  41849. 'object' == typeof t
  41850. ? (t.value = o.zigZagDecode32(t.value))
  41851. : (t = o.zigZagDecode32(t)),
  41852. t
  41853. )
  41854. }),
  41855. e &&
  41856. ((o.MAX_VARINT64_BYTES = 10),
  41857. (o.calculateVarint64 = function (t) {
  41858. 'number' == typeof t
  41859. ? (t = e.fromNumber(t))
  41860. : 'string' == typeof t && (t = e.fromString(t))
  41861. var i = t.toInt() >>> 0,
  41862. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  41863. r = t.shiftRightUnsigned(56).toInt() >>> 0
  41864. return 0 == r
  41865. ? 0 == n
  41866. ? i < 16384
  41867. ? i < 128
  41868. ? 1
  41869. : 2
  41870. : i < 1 << 21
  41871. ? 3
  41872. : 4
  41873. : n < 16384
  41874. ? n < 128
  41875. ? 5
  41876. : 6
  41877. : n < 1 << 21
  41878. ? 7
  41879. : 8
  41880. : r < 128
  41881. ? 9
  41882. : 10
  41883. }),
  41884. (o.zigZagEncode64 = function (t) {
  41885. return (
  41886. 'number' == typeof t
  41887. ? (t = e.fromNumber(t, !1))
  41888. : 'string' == typeof t
  41889. ? (t = e.fromString(t, !1))
  41890. : t.unsigned !== !1 && (t = t.toSigned()),
  41891. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  41892. )
  41893. }),
  41894. (o.zigZagDecode64 = function (t) {
  41895. return (
  41896. 'number' == typeof t
  41897. ? (t = e.fromNumber(t, !1))
  41898. : 'string' == typeof t
  41899. ? (t = e.fromString(t, !1))
  41900. : t.unsigned !== !1 && (t = t.toSigned()),
  41901. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  41902. )
  41903. }),
  41904. (a.writeVarint64 = function (t, i) {
  41905. var n = 'undefined' == typeof i
  41906. if ((n && (i = this.offset), !this.noAssert)) {
  41907. if ('number' == typeof t) t = e.fromNumber(t)
  41908. else if ('string' == typeof t) t = e.fromString(t)
  41909. else if (!(t && t instanceof e))
  41910. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  41911. if ('number' != typeof i || i % 1 !== 0)
  41912. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  41913. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41914. throw RangeError(
  41915. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41916. )
  41917. }
  41918. 'number' == typeof t
  41919. ? (t = e.fromNumber(t, !1))
  41920. : 'string' == typeof t
  41921. ? (t = e.fromString(t, !1))
  41922. : t.unsigned !== !1 && (t = t.toSigned())
  41923. var r = o.calculateVarint64(t),
  41924. a = t.toInt() >>> 0,
  41925. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  41926. l = t.shiftRightUnsigned(56).toInt() >>> 0
  41927. i += r
  41928. var c = this.buffer.byteLength
  41929. switch ((i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)) {
  41930. case 10:
  41931. this.view[i + 9] = (l >>> 7) & 1
  41932. case 9:
  41933. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l
  41934. case 8:
  41935. this.view[i + 7] = 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127
  41936. case 7:
  41937. this.view[i + 6] = 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127
  41938. case 6:
  41939. this.view[i + 5] = 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127
  41940. case 5:
  41941. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s
  41942. case 4:
  41943. this.view[i + 3] = 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127
  41944. case 3:
  41945. this.view[i + 2] = 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127
  41946. case 2:
  41947. this.view[i + 1] = 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127
  41948. case 1:
  41949. this.view[i] = 1 !== r ? 128 | a : 127 & a
  41950. }
  41951. return n ? ((this.offset += r), this) : r
  41952. }),
  41953. (a.writeVarint64ZigZag = function (e, t) {
  41954. return this.writeVarint64(o.zigZagEncode64(e), t)
  41955. }),
  41956. (a.readVarint64 = function (t) {
  41957. var i = 'undefined' == typeof t
  41958. if ((i && (t = this.offset), !this.noAssert)) {
  41959. if ('number' != typeof t || t % 1 !== 0)
  41960. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41961. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength))
  41962. throw RangeError(
  41963. 'Illegal offset: 0 <= ' + t + ' (+1) <= ' + this.buffer.byteLength
  41964. )
  41965. }
  41966. var n = t,
  41967. r = 0,
  41968. o = 0,
  41969. a = 0,
  41970. s = 0
  41971. if (
  41972. ((s = this.view[t++]),
  41973. (r = 127 & s),
  41974. 128 & s &&
  41975. ((s = this.view[t++]),
  41976. (r |= (127 & s) << 7),
  41977. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41978. ((s = this.view[t++]),
  41979. (r |= (127 & s) << 14),
  41980. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41981. ((s = this.view[t++]),
  41982. (r |= (127 & s) << 21),
  41983. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41984. ((s = this.view[t++]),
  41985. (o = 127 & s),
  41986. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41987. ((s = this.view[t++]),
  41988. (o |= (127 & s) << 7),
  41989. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41990. ((s = this.view[t++]),
  41991. (o |= (127 & s) << 14),
  41992. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41993. ((s = this.view[t++]),
  41994. (o |= (127 & s) << 21),
  41995. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41996. ((s = this.view[t++]),
  41997. (a = 127 & s),
  41998. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41999. ((s = this.view[t++]),
  42000. (a |= (127 & s) << 7),
  42001. 128 & s || (this.noAssert && 'undefined' == typeof s)))))))))))
  42002. )
  42003. throw Error('Buffer overrun')
  42004. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1)
  42005. return i
  42006. ? ((this.offset = t), l)
  42007. : {
  42008. value: l,
  42009. length: t - n
  42010. }
  42011. }),
  42012. (a.readVarint64ZigZag = function (t) {
  42013. var i = this.readVarint64(t)
  42014. return (
  42015. i && i.value instanceof e
  42016. ? (i.value = o.zigZagDecode64(i.value))
  42017. : (i = o.zigZagDecode64(i)),
  42018. i
  42019. )
  42020. })),
  42021. (a.writeCString = function (e, i) {
  42022. var n = 'undefined' == typeof i
  42023. n && (i = this.offset)
  42024. var r,
  42025. o = e.length
  42026. if (!this.noAssert) {
  42027. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42028. for (r = 0; r < o; ++r)
  42029. if (0 === e.charCodeAt(r))
  42030. throw RangeError('Illegal str: Contains NULL-characters')
  42031. if ('number' != typeof i || i % 1 !== 0)
  42032. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42033. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42034. throw RangeError(
  42035. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42036. )
  42037. }
  42038. ;(o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1)
  42039. var a = this.buffer.byteLength
  42040. return (
  42041. i > a && this.resize((a *= 2) > i ? a : i),
  42042. (i -= o + 1),
  42043. h.encodeUTF16toUTF8(
  42044. t(e),
  42045. function (e) {
  42046. this.view[i++] = e
  42047. }.bind(this)
  42048. ),
  42049. (this.view[i++] = 0),
  42050. n ? ((this.offset = i), this) : o
  42051. )
  42052. }),
  42053. (a.readCString = function (e) {
  42054. var t = 'undefined' == typeof e
  42055. if ((t && (e = this.offset), !this.noAssert)) {
  42056. if ('number' != typeof e || e % 1 !== 0)
  42057. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42058. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  42059. throw RangeError(
  42060. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  42061. )
  42062. }
  42063. var n,
  42064. r = e,
  42065. o = -1
  42066. return (
  42067. h.decodeUTF8toUTF16(
  42068. function () {
  42069. if (0 === o) return null
  42070. if (e >= this.limit)
  42071. throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit)
  42072. return (o = this.view[e++]), 0 === o ? null : o
  42073. }.bind(this),
  42074. (n = i()),
  42075. !0
  42076. ),
  42077. t
  42078. ? ((this.offset = e), n())
  42079. : {
  42080. string: n(),
  42081. length: e - r
  42082. }
  42083. )
  42084. }),
  42085. (a.writeIString = function (e, i) {
  42086. var n = 'undefined' == typeof i
  42087. if ((n && (i = this.offset), !this.noAssert)) {
  42088. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42089. if ('number' != typeof i || i % 1 !== 0)
  42090. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42091. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42092. throw RangeError(
  42093. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42094. )
  42095. }
  42096. var r,
  42097. o = i
  42098. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (i += 4 + r)
  42099. var a = this.buffer.byteLength
  42100. if (
  42101. (i > a && this.resize((a *= 2) > i ? a : i),
  42102. (i -= 4 + r),
  42103. this.littleEndian
  42104. ? ((this.view[i + 3] = (r >>> 24) & 255),
  42105. (this.view[i + 2] = (r >>> 16) & 255),
  42106. (this.view[i + 1] = (r >>> 8) & 255),
  42107. (this.view[i] = 255 & r))
  42108. : ((this.view[i] = (r >>> 24) & 255),
  42109. (this.view[i + 1] = (r >>> 16) & 255),
  42110. (this.view[i + 2] = (r >>> 8) & 255),
  42111. (this.view[i + 3] = 255 & r)),
  42112. (i += 4),
  42113. h.encodeUTF16toUTF8(
  42114. t(e),
  42115. function (e) {
  42116. this.view[i++] = e
  42117. }.bind(this)
  42118. ),
  42119. i !== o + 4 + r)
  42120. )
  42121. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + 4 + r))
  42122. return n ? ((this.offset = i), this) : i - o
  42123. }),
  42124. (a.readIString = function (e) {
  42125. var t = 'undefined' == typeof e
  42126. if ((t && (e = this.offset), !this.noAssert)) {
  42127. if ('number' != typeof e || e % 1 !== 0)
  42128. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42129. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  42130. throw RangeError(
  42131. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  42132. )
  42133. }
  42134. var i = e,
  42135. n = this.readUint32(e),
  42136. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4))
  42137. return (
  42138. (e += r.length),
  42139. t
  42140. ? ((this.offset = e), r.string)
  42141. : {
  42142. string: r.string,
  42143. length: e - i
  42144. }
  42145. )
  42146. }),
  42147. (o.METRICS_CHARS = 'c'),
  42148. (o.METRICS_BYTES = 'b'),
  42149. (a.writeUTF8String = function (e, i) {
  42150. var n = 'undefined' == typeof i
  42151. if ((n && (i = this.offset), !this.noAssert)) {
  42152. if ('number' != typeof i || i % 1 !== 0)
  42153. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42154. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42155. throw RangeError(
  42156. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42157. )
  42158. }
  42159. var r,
  42160. o = i
  42161. ;(r = h.calculateUTF16asUTF8(t(e))[1]), (i += r)
  42162. var a = this.buffer.byteLength
  42163. return (
  42164. i > a && this.resize((a *= 2) > i ? a : i),
  42165. (i -= r),
  42166. h.encodeUTF16toUTF8(
  42167. t(e),
  42168. function (e) {
  42169. this.view[i++] = e
  42170. }.bind(this)
  42171. ),
  42172. n ? ((this.offset = i), this) : i - o
  42173. )
  42174. }),
  42175. (a.writeString = a.writeUTF8String),
  42176. (o.calculateUTF8Chars = function (e) {
  42177. return h.calculateUTF16asUTF8(t(e))[0]
  42178. }),
  42179. (o.calculateUTF8Bytes = function (e) {
  42180. return h.calculateUTF16asUTF8(t(e))[1]
  42181. }),
  42182. (o.calculateString = o.calculateUTF8Bytes),
  42183. (a.readUTF8String = function (e, t, n) {
  42184. 'number' == typeof t && ((n = t), (t = void 0))
  42185. var r = 'undefined' == typeof n
  42186. if (
  42187. (r && (n = this.offset),
  42188. 'undefined' == typeof t && (t = o.METRICS_CHARS),
  42189. !this.noAssert)
  42190. ) {
  42191. if ('number' != typeof e || e % 1 !== 0)
  42192. throw TypeError('Illegal length: ' + e + ' (not an integer)')
  42193. if (((e |= 0), 'number' != typeof n || n % 1 !== 0))
  42194. throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  42195. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength))
  42196. throw RangeError(
  42197. 'Illegal offset: 0 <= ' + n + ' (+0) <= ' + this.buffer.byteLength
  42198. )
  42199. }
  42200. var a,
  42201. s = 0,
  42202. l = n
  42203. if (t === o.METRICS_CHARS) {
  42204. if (
  42205. ((a = i()),
  42206. h.decodeUTF8(
  42207. function () {
  42208. return s < e && n < this.limit ? this.view[n++] : null
  42209. }.bind(this),
  42210. function (e) {
  42211. ++s, h.UTF8toUTF16(e, a)
  42212. }
  42213. ),
  42214. s !== e)
  42215. )
  42216. throw RangeError('Illegal range: Truncated data, ' + s + ' == ' + e)
  42217. return r
  42218. ? ((this.offset = n), a())
  42219. : {
  42220. string: a(),
  42221. length: n - l
  42222. }
  42223. }
  42224. if (t === o.METRICS_BYTES) {
  42225. if (!this.noAssert) {
  42226. if ('number' != typeof n || n % 1 !== 0)
  42227. throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  42228. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength))
  42229. throw RangeError(
  42230. 'Illegal offset: 0 <= ' + n + ' (+' + e + ') <= ' + this.buffer.byteLength
  42231. )
  42232. }
  42233. var c = n + e
  42234. if (
  42235. (h.decodeUTF8toUTF16(
  42236. function () {
  42237. return n < c ? this.view[n++] : null
  42238. }.bind(this),
  42239. (a = i()),
  42240. this.noAssert
  42241. ),
  42242. n !== c)
  42243. )
  42244. throw RangeError('Illegal range: Truncated data, ' + n + ' == ' + c)
  42245. return r
  42246. ? ((this.offset = n), a())
  42247. : {
  42248. string: a(),
  42249. length: n - l
  42250. }
  42251. }
  42252. throw TypeError('Unsupported metrics: ' + t)
  42253. }),
  42254. (a.readString = a.readUTF8String),
  42255. (a.writeVString = function (e, i) {
  42256. var n = 'undefined' == typeof i
  42257. if ((n && (i = this.offset), !this.noAssert)) {
  42258. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42259. if ('number' != typeof i || i % 1 !== 0)
  42260. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42261. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42262. throw RangeError(
  42263. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42264. )
  42265. }
  42266. var r,
  42267. a,
  42268. s = i
  42269. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  42270. (a = o.calculateVarint32(r)),
  42271. (i += a + r)
  42272. var l = this.buffer.byteLength
  42273. if (
  42274. (i > l && this.resize((l *= 2) > i ? l : i),
  42275. (i -= a + r),
  42276. (i += this.writeVarint32(r, i)),
  42277. h.encodeUTF16toUTF8(
  42278. t(e),
  42279. function (e) {
  42280. this.view[i++] = e
  42281. }.bind(this)
  42282. ),
  42283. i !== s + r + a)
  42284. )
  42285. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + r + a))
  42286. return n ? ((this.offset = i), this) : i - s
  42287. }),
  42288. (a.readVString = function (e) {
  42289. var t = 'undefined' == typeof e
  42290. if ((t && (e = this.offset), !this.noAssert)) {
  42291. if ('number' != typeof e || e % 1 !== 0)
  42292. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42293. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  42294. throw RangeError(
  42295. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  42296. )
  42297. }
  42298. var i = e,
  42299. n = this.readVarint32(e),
  42300. r = this.readUTF8String(n.value, o.METRICS_BYTES, (e += n.length))
  42301. return (
  42302. (e += r.length),
  42303. t
  42304. ? ((this.offset = e), r.string)
  42305. : {
  42306. string: r.string,
  42307. length: e - i
  42308. }
  42309. )
  42310. }),
  42311. (a.append = function (e, t, i) {
  42312. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  42313. var n = 'undefined' == typeof i
  42314. if ((n && (i = this.offset), !this.noAssert)) {
  42315. if ('number' != typeof i || i % 1 !== 0)
  42316. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42317. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42318. throw RangeError(
  42319. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42320. )
  42321. }
  42322. e instanceof o || (e = o.wrap(e, t))
  42323. var r = e.limit - e.offset
  42324. if (r <= 0) return this
  42325. i += r
  42326. var a = this.buffer.byteLength
  42327. return (
  42328. i > a && this.resize((a *= 2) > i ? a : i),
  42329. (i -= r),
  42330. this.view.set(e.view.subarray(e.offset, e.limit), i),
  42331. (e.offset += r),
  42332. n && (this.offset += r),
  42333. this
  42334. )
  42335. }),
  42336. (a.appendTo = function (e, t) {
  42337. return e.append(this, t), this
  42338. }),
  42339. (a.assert = function (e) {
  42340. return (this.noAssert = !e), this
  42341. }),
  42342. (a.capacity = function () {
  42343. return this.buffer.byteLength
  42344. }),
  42345. (a.clear = function () {
  42346. return (
  42347. (this.offset = 0),
  42348. (this.limit = this.buffer.byteLength),
  42349. (this.markedOffset = -1),
  42350. this
  42351. )
  42352. }),
  42353. (a.clone = function (e) {
  42354. var t = new o(0, this.littleEndian, this.noAssert)
  42355. return (
  42356. e
  42357. ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)),
  42358. (t.view = new Uint8Array(t.buffer)))
  42359. : ((t.buffer = this.buffer), (t.view = this.view)),
  42360. (t.offset = this.offset),
  42361. (t.markedOffset = this.markedOffset),
  42362. (t.limit = this.limit),
  42363. t
  42364. )
  42365. }),
  42366. (a.compact = function (e, t) {
  42367. if (
  42368. ('undefined' == typeof e && (e = this.offset),
  42369. 'undefined' == typeof t && (t = this.limit),
  42370. !this.noAssert)
  42371. ) {
  42372. if ('number' != typeof e || e % 1 !== 0)
  42373. throw TypeError('Illegal begin: Not an integer')
  42374. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42375. throw TypeError('Illegal end: Not an integer')
  42376. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42377. throw RangeError(
  42378. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42379. )
  42380. }
  42381. if (0 === e && t === this.buffer.byteLength) return this
  42382. var i = t - e
  42383. if (0 === i)
  42384. return (
  42385. (this.buffer = s),
  42386. (this.view = null),
  42387. this.markedOffset >= 0 && (this.markedOffset -= e),
  42388. (this.offset = 0),
  42389. (this.limit = 0),
  42390. this
  42391. )
  42392. var n = new ArrayBuffer(i),
  42393. r = new Uint8Array(n)
  42394. return (
  42395. r.set(this.view.subarray(e, t)),
  42396. (this.buffer = n),
  42397. (this.view = r),
  42398. this.markedOffset >= 0 && (this.markedOffset -= e),
  42399. (this.offset = 0),
  42400. (this.limit = i),
  42401. this
  42402. )
  42403. }),
  42404. (a.copy = function (e, t) {
  42405. if (
  42406. ('undefined' == typeof e && (e = this.offset),
  42407. 'undefined' == typeof t && (t = this.limit),
  42408. !this.noAssert)
  42409. ) {
  42410. if ('number' != typeof e || e % 1 !== 0)
  42411. throw TypeError('Illegal begin: Not an integer')
  42412. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42413. throw TypeError('Illegal end: Not an integer')
  42414. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42415. throw RangeError(
  42416. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42417. )
  42418. }
  42419. if (e === t) return new o(0, this.littleEndian, this.noAssert)
  42420. var i = t - e,
  42421. n = new o(i, this.littleEndian, this.noAssert)
  42422. return (
  42423. (n.offset = 0),
  42424. (n.limit = i),
  42425. n.markedOffset >= 0 && (n.markedOffset -= e),
  42426. this.copyTo(n, 0, e, t),
  42427. n
  42428. )
  42429. }),
  42430. (a.copyTo = function (e, t, i, n) {
  42431. var r, a
  42432. if (!this.noAssert && !o.isByteBuffer(e))
  42433. throw TypeError('Illegal target: Not a ByteBuffer')
  42434. if (
  42435. ((t = (a = 'undefined' == typeof t) ? e.offset : 0 | t),
  42436. (i = (r = 'undefined' == typeof i) ? this.offset : 0 | i),
  42437. (n = 'undefined' == typeof n ? this.limit : 0 | n),
  42438. t < 0 || t > e.buffer.byteLength)
  42439. )
  42440. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength)
  42441. if (i < 0 || n > this.buffer.byteLength)
  42442. throw RangeError(
  42443. 'Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength
  42444. )
  42445. var s = n - i
  42446. return 0 === s
  42447. ? e
  42448. : (e.ensureCapacity(t + s),
  42449. e.view.set(this.view.subarray(i, n), t),
  42450. r && (this.offset += s),
  42451. a && (e.offset += s),
  42452. this)
  42453. }),
  42454. (a.ensureCapacity = function (e) {
  42455. var t = this.buffer.byteLength
  42456. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  42457. }),
  42458. (a.fill = function (e, t, i) {
  42459. var n = 'undefined' == typeof t
  42460. if (
  42461. (n && (t = this.offset),
  42462. 'string' == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  42463. 'undefined' == typeof t && (t = this.offset),
  42464. 'undefined' == typeof i && (i = this.limit),
  42465. !this.noAssert)
  42466. ) {
  42467. if ('number' != typeof e || e % 1 !== 0)
  42468. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  42469. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  42470. throw TypeError('Illegal begin: Not an integer')
  42471. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42472. throw TypeError('Illegal end: Not an integer')
  42473. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42474. throw RangeError(
  42475. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42476. )
  42477. }
  42478. if (t >= i) return this
  42479. for (; t < i; ) this.view[t++] = e
  42480. return n && (this.offset = t), this
  42481. }),
  42482. (a.flip = function () {
  42483. return (this.limit = this.offset), (this.offset = 0), this
  42484. }),
  42485. (a.mark = function (e) {
  42486. if (((e = 'undefined' == typeof e ? this.offset : e), !this.noAssert)) {
  42487. if ('number' != typeof e || e % 1 !== 0)
  42488. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42489. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength))
  42490. throw RangeError(
  42491. 'Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength
  42492. )
  42493. }
  42494. return (this.markedOffset = e), this
  42495. }),
  42496. (a.order = function (e) {
  42497. if (!this.noAssert && 'boolean' != typeof e)
  42498. throw TypeError('Illegal littleEndian: Not a boolean')
  42499. return (this.littleEndian = !!e), this
  42500. }),
  42501. (a.LE = function (e) {
  42502. return (this.littleEndian = 'undefined' == typeof e || !!e), this
  42503. }),
  42504. (a.BE = function (e) {
  42505. return (this.littleEndian = 'undefined' != typeof e && !e), this
  42506. }),
  42507. (a.prepend = function (e, t, i) {
  42508. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  42509. var n = 'undefined' == typeof i
  42510. if ((n && (i = this.offset), !this.noAssert)) {
  42511. if ('number' != typeof i || i % 1 !== 0)
  42512. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42513. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42514. throw RangeError(
  42515. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42516. )
  42517. }
  42518. e instanceof o || (e = o.wrap(e, t))
  42519. var r = e.limit - e.offset
  42520. if (r <= 0) return this
  42521. var a = r - i
  42522. if (a > 0) {
  42523. var s = new ArrayBuffer(this.buffer.byteLength + a),
  42524. l = new Uint8Array(s)
  42525. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  42526. (this.buffer = s),
  42527. (this.view = l),
  42528. (this.offset += a),
  42529. this.markedOffset >= 0 && (this.markedOffset += a),
  42530. (this.limit += a),
  42531. (i += a)
  42532. } else {
  42533. new Uint8Array(this.buffer)
  42534. }
  42535. return (
  42536. this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  42537. (e.offset = e.limit),
  42538. n && (this.offset -= r),
  42539. this
  42540. )
  42541. }),
  42542. (a.prependTo = function (e, t) {
  42543. return e.prepend(this, t), this
  42544. }),
  42545. (a.printDebug = function (e) {
  42546. 'function' != typeof e && (e = console.log.bind(console)),
  42547. e(
  42548. this.toString() +
  42549. '\n-------------------------------------------------------------------\n' +
  42550. this.toDebug(!0)
  42551. )
  42552. }),
  42553. (a.remaining = function () {
  42554. return this.limit - this.offset
  42555. }),
  42556. (a.reset = function () {
  42557. return (
  42558. this.markedOffset >= 0
  42559. ? ((this.offset = this.markedOffset), (this.markedOffset = -1))
  42560. : (this.offset = 0),
  42561. this
  42562. )
  42563. }),
  42564. (a.resize = function (e) {
  42565. if (!this.noAssert) {
  42566. if ('number' != typeof e || e % 1 !== 0)
  42567. throw TypeError('Illegal capacity: ' + e + ' (not an integer)')
  42568. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity: 0 <= ' + e)
  42569. }
  42570. if (this.buffer.byteLength < e) {
  42571. var t = new ArrayBuffer(e),
  42572. i = new Uint8Array(t)
  42573. i.set(this.view), (this.buffer = t), (this.view = i)
  42574. }
  42575. return this
  42576. }),
  42577. (a.reverse = function (e, t) {
  42578. if (
  42579. ('undefined' == typeof e && (e = this.offset),
  42580. 'undefined' == typeof t && (t = this.limit),
  42581. !this.noAssert)
  42582. ) {
  42583. if ('number' != typeof e || e % 1 !== 0)
  42584. throw TypeError('Illegal begin: Not an integer')
  42585. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42586. throw TypeError('Illegal end: Not an integer')
  42587. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42588. throw RangeError(
  42589. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42590. )
  42591. }
  42592. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)), this)
  42593. }),
  42594. (a.skip = function (e) {
  42595. if (!this.noAssert) {
  42596. if ('number' != typeof e || e % 1 !== 0)
  42597. throw TypeError('Illegal length: ' + e + ' (not an integer)')
  42598. e |= 0
  42599. }
  42600. var t = this.offset + e
  42601. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  42602. throw RangeError(
  42603. 'Illegal length: 0 <= ' +
  42604. this.offset +
  42605. ' + ' +
  42606. e +
  42607. ' <= ' +
  42608. this.buffer.byteLength
  42609. )
  42610. return (this.offset = t), this
  42611. }),
  42612. (a.slice = function (e, t) {
  42613. if (
  42614. ('undefined' == typeof e && (e = this.offset),
  42615. 'undefined' == typeof t && (t = this.limit),
  42616. !this.noAssert)
  42617. ) {
  42618. if ('number' != typeof e || e % 1 !== 0)
  42619. throw TypeError('Illegal begin: Not an integer')
  42620. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42621. throw TypeError('Illegal end: Not an integer')
  42622. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42623. throw RangeError(
  42624. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42625. )
  42626. }
  42627. var i = this.clone()
  42628. return (i.offset = e), (i.limit = t), i
  42629. }),
  42630. (a.toBuffer = function (e) {
  42631. var t = this.offset,
  42632. i = this.limit
  42633. if (!this.noAssert) {
  42634. if ('number' != typeof t || t % 1 !== 0)
  42635. throw TypeError('Illegal offset: Not an integer')
  42636. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42637. throw TypeError('Illegal limit: Not an integer')
  42638. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42639. throw RangeError(
  42640. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42641. )
  42642. }
  42643. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer
  42644. if (t === i) return s
  42645. var n = new ArrayBuffer(i - t)
  42646. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n
  42647. }),
  42648. (a.toArrayBuffer = a.toBuffer),
  42649. (a.toString = function (e, t, i) {
  42650. if ('undefined' == typeof e)
  42651. return (
  42652. 'ByteBufferAB(offset=' +
  42653. this.offset +
  42654. ',markedOffset=' +
  42655. this.markedOffset +
  42656. ',limit=' +
  42657. this.limit +
  42658. ',capacity=' +
  42659. this.capacity() +
  42660. ')'
  42661. )
  42662. switch (('number' == typeof e && ((e = 'utf8'), (t = e), (i = t)), e)) {
  42663. case 'utf8':
  42664. return this.toUTF8(t, i)
  42665. case 'base64':
  42666. return this.toBase64(t, i)
  42667. case 'hex':
  42668. return this.toHex(t, i)
  42669. case 'binary':
  42670. return this.toBinary(t, i)
  42671. case 'debug':
  42672. return this.toDebug()
  42673. case 'columns':
  42674. return this.toColumns()
  42675. default:
  42676. throw Error('Unsupported encoding: ' + e)
  42677. }
  42678. })
  42679. var c = (function () {
  42680. for (
  42681. var e = {},
  42682. t = [
  42683. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
  42684. 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
  42685. 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50,
  42686. 51, 52, 53, 54, 55, 56, 57, 43, 47
  42687. ],
  42688. i = [],
  42689. n = 0,
  42690. r = t.length;
  42691. n < r;
  42692. ++n
  42693. )
  42694. i[t[n]] = n
  42695. return (
  42696. (e.encode = function (e, i) {
  42697. for (var n, r; null !== (n = e()); )
  42698. i(t[(n >> 2) & 63]),
  42699. (r = (3 & n) << 4),
  42700. null !== (n = e())
  42701. ? ((r |= (n >> 4) & 15),
  42702. i(t[63 & (r | ((n >> 4) & 15))]),
  42703. (r = (15 & n) << 2),
  42704. null !== (n = e())
  42705. ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n]))
  42706. : (i(t[63 & r]), i(61)))
  42707. : (i(t[63 & r]), i(61), i(61))
  42708. }),
  42709. (e.decode = function (e, t) {
  42710. function n(e) {
  42711. throw Error('Illegal character code: ' + e)
  42712. }
  42713. for (var r, o, a; null !== (r = e()); )
  42714. if (
  42715. ((o = i[r]),
  42716. 'undefined' == typeof o && n(r),
  42717. null !== (r = e()) &&
  42718. ((a = i[r]),
  42719. 'undefined' == typeof a && n(r),
  42720. t(((o << 2) >>> 0) | ((48 & a) >> 4)),
  42721. null !== (r = e())))
  42722. ) {
  42723. if (((o = i[r]), 'undefined' == typeof o)) {
  42724. if (61 === r) break
  42725. n(r)
  42726. }
  42727. if ((t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)), null !== (r = e()))) {
  42728. if (((a = i[r]), 'undefined' == typeof a)) {
  42729. if (61 === r) break
  42730. n(r)
  42731. }
  42732. t((((3 & o) << 6) >>> 0) | a)
  42733. }
  42734. }
  42735. }),
  42736. (e.test = function (e) {
  42737. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  42738. }),
  42739. e
  42740. )
  42741. })()
  42742. ;(a.toBase64 = function (e, t) {
  42743. if (
  42744. ('undefined' == typeof e && (e = this.offset),
  42745. 'undefined' == typeof t && (t = this.limit),
  42746. (e |= 0),
  42747. (t |= 0),
  42748. e < 0 || t > this.capacity || e > t)
  42749. )
  42750. throw RangeError('begin, end')
  42751. var n
  42752. return (
  42753. c.encode(
  42754. function () {
  42755. return e < t ? this.view[e++] : null
  42756. }.bind(this),
  42757. (n = i())
  42758. ),
  42759. n()
  42760. )
  42761. }),
  42762. (o.fromBase64 = function (e, i) {
  42763. if ('string' != typeof e) throw TypeError('str')
  42764. var n = new o((e.length / 4) * 3, i),
  42765. r = 0
  42766. return (
  42767. c.decode(t(e), function (e) {
  42768. n.view[r++] = e
  42769. }),
  42770. (n.limit = r),
  42771. n
  42772. )
  42773. }),
  42774. (o.btoa = function (e) {
  42775. return o.fromBinary(e).toBase64()
  42776. }),
  42777. (o.atob = function (e) {
  42778. return o.fromBase64(e).toBinary()
  42779. }),
  42780. (a.toBinary = function (e, t) {
  42781. if (
  42782. ('undefined' == typeof e && (e = this.offset),
  42783. 'undefined' == typeof t && (t = this.limit),
  42784. (e |= 0),
  42785. (t |= 0),
  42786. e < 0 || t > this.capacity() || e > t)
  42787. )
  42788. throw RangeError('begin, end')
  42789. if (e === t) return ''
  42790. for (var i = [], n = []; e < t; )
  42791. i.push(this.view[e++]),
  42792. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), (i = []))
  42793. return n.join('') + String.fromCharCode.apply(String, i)
  42794. }),
  42795. (o.fromBinary = function (e, t) {
  42796. if ('string' != typeof e) throw TypeError('str')
  42797. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  42798. if (((i = e.charCodeAt(n)), i > 255)) throw RangeError('illegal char code: ' + i)
  42799. a.view[n++] = i
  42800. }
  42801. return (a.limit = r), a
  42802. }),
  42803. (a.toDebug = function (e) {
  42804. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  42805. if (
  42806. (i !== -1 &&
  42807. ((t = this.view[i]),
  42808. (r +=
  42809. t < 16 ? '0' + t.toString(16).toUpperCase() : t.toString(16).toUpperCase()),
  42810. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : '.')),
  42811. ++i,
  42812. e && i > 0 && i % 16 === 0 && i !== n)
  42813. ) {
  42814. for (; r.length < 51; ) r += ' '
  42815. ;(a += r + o + '\n'), (r = o = '')
  42816. }
  42817. r +=
  42818. i === this.offset && i === this.limit
  42819. ? i === this.markedOffset
  42820. ? '!'
  42821. : '|'
  42822. : i === this.offset
  42823. ? i === this.markedOffset
  42824. ? '['
  42825. : '<'
  42826. : i === this.limit
  42827. ? i === this.markedOffset
  42828. ? ']'
  42829. : '>'
  42830. : i === this.markedOffset
  42831. ? "'"
  42832. : e || (0 !== i && i !== n)
  42833. ? ' '
  42834. : ''
  42835. }
  42836. if (e && ' ' !== r) {
  42837. for (; r.length < 51; ) r += ' '
  42838. a += r + o + '\n'
  42839. }
  42840. return e ? a : r
  42841. }),
  42842. (o.fromDebug = function (e, t, i) {
  42843. for (
  42844. var n,
  42845. r,
  42846. a = e.length,
  42847. s = new o(((a + 1) / 3) | 0, t, i),
  42848. l = 0,
  42849. c = 0,
  42850. h = !1,
  42851. u = !1,
  42852. d = !1,
  42853. p = !1,
  42854. f = !1;
  42855. l < a;
  42856. ) {
  42857. switch ((n = e.charAt(l++))) {
  42858. case '!':
  42859. if (!i) {
  42860. if (u || d || p) {
  42861. f = !0
  42862. break
  42863. }
  42864. u = d = p = !0
  42865. }
  42866. ;(s.offset = s.markedOffset = s.limit = c), (h = !1)
  42867. break
  42868. case '|':
  42869. if (!i) {
  42870. if (u || p) {
  42871. f = !0
  42872. break
  42873. }
  42874. u = p = !0
  42875. }
  42876. ;(s.offset = s.limit = c), (h = !1)
  42877. break
  42878. case '[':
  42879. if (!i) {
  42880. if (u || d) {
  42881. f = !0
  42882. break
  42883. }
  42884. u = d = !0
  42885. }
  42886. ;(s.offset = s.markedOffset = c), (h = !1)
  42887. break
  42888. case '<':
  42889. if (!i) {
  42890. if (u) {
  42891. f = !0
  42892. break
  42893. }
  42894. u = !0
  42895. }
  42896. ;(s.offset = c), (h = !1)
  42897. break
  42898. case ']':
  42899. if (!i) {
  42900. if (p || d) {
  42901. f = !0
  42902. break
  42903. }
  42904. p = d = !0
  42905. }
  42906. ;(s.limit = s.markedOffset = c), (h = !1)
  42907. break
  42908. case '>':
  42909. if (!i) {
  42910. if (p) {
  42911. f = !0
  42912. break
  42913. }
  42914. p = !0
  42915. }
  42916. ;(s.limit = c), (h = !1)
  42917. break
  42918. case "'":
  42919. if (!i) {
  42920. if (d) {
  42921. f = !0
  42922. break
  42923. }
  42924. d = !0
  42925. }
  42926. ;(s.markedOffset = c), (h = !1)
  42927. break
  42928. case ' ':
  42929. h = !1
  42930. break
  42931. default:
  42932. if (!i && h) {
  42933. f = !0
  42934. break
  42935. }
  42936. if (
  42937. ((r = parseInt(n + e.charAt(l++), 16)), !i && (isNaN(r) || r < 0 || r > 255))
  42938. )
  42939. throw TypeError('Illegal str: Not a debug encoded string')
  42940. ;(s.view[c++] = r), (h = !0)
  42941. }
  42942. if (f) throw TypeError('Illegal str: Invalid symbol at ' + l)
  42943. }
  42944. if (!i) {
  42945. if (!u || !p) throw TypeError('Illegal str: Missing offset or limit')
  42946. if (c < s.buffer.byteLength)
  42947. throw TypeError(
  42948. 'Illegal str: Not a debug encoded string (is it hex?) ' + c + ' < ' + a
  42949. )
  42950. }
  42951. return s
  42952. }),
  42953. (a.toHex = function (e, t) {
  42954. if (
  42955. ((e = 'undefined' == typeof e ? this.offset : e),
  42956. (t = 'undefined' == typeof t ? this.limit : t),
  42957. !this.noAssert)
  42958. ) {
  42959. if ('number' != typeof e || e % 1 !== 0)
  42960. throw TypeError('Illegal begin: Not an integer')
  42961. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42962. throw TypeError('Illegal end: Not an integer')
  42963. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42964. throw RangeError(
  42965. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42966. )
  42967. }
  42968. for (var i, n = new Array(t - e); e < t; )
  42969. (i = this.view[e++]), i < 16 ? n.push('0', i.toString(16)) : n.push(i.toString(16))
  42970. return n.join('')
  42971. }),
  42972. (o.fromHex = function (e, t, i) {
  42973. if (!i) {
  42974. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42975. if (e.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2')
  42976. }
  42977. for (var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0; s < r; s += 2) {
  42978. if (
  42979. ((n = parseInt(e.substring(s, s + 2), 16)),
  42980. !i && (!isFinite(n) || n < 0 || n > 255))
  42981. )
  42982. throw TypeError('Illegal str: Contains non-hex characters')
  42983. a.view[l++] = n
  42984. }
  42985. return (a.limit = l), a
  42986. })
  42987. var h = (function () {
  42988. var e = {}
  42989. return (
  42990. (e.MAX_CODEPOINT = 1114111),
  42991. (e.encodeUTF8 = function (e, t) {
  42992. var i = null
  42993. for (
  42994. 'number' == typeof e &&
  42995. ((i = e),
  42996. (e = function () {
  42997. return null
  42998. }));
  42999. null !== i || null !== (i = e());
  43000. )
  43001. i < 128
  43002. ? t(127 & i)
  43003. : i < 2048
  43004. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  43005. : i < 65536
  43006. ? (t(((i >> 12) & 15) | 224), t(((i >> 6) & 63) | 128), t((63 & i) | 128))
  43007. : (t(((i >> 18) & 7) | 240),
  43008. t(((i >> 12) & 63) | 128),
  43009. t(((i >> 6) & 63) | 128),
  43010. t((63 & i) | 128)),
  43011. (i = null)
  43012. }),
  43013. (e.decodeUTF8 = function (e, t) {
  43014. for (
  43015. var i,
  43016. n,
  43017. r,
  43018. o,
  43019. a = function (e) {
  43020. e = e.slice(0, e.indexOf(null))
  43021. var t = Error(e.toString())
  43022. throw ((t.name = 'TruncatedError'), (t.bytes = e), t)
  43023. };
  43024. null !== (i = e());
  43025. )
  43026. if (0 === (128 & i)) t(i)
  43027. else if (192 === (224 & i))
  43028. null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n))
  43029. else if (224 === (240 & i))
  43030. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  43031. t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r))
  43032. else {
  43033. if (240 !== (248 & i)) throw RangeError('Illegal starting byte: ' + i)
  43034. ;(null === (n = e()) || null === (r = e()) || null === (o = e())) &&
  43035. a([i, n, r, o]),
  43036. t(((7 & i) << 18) | ((63 & n) << 12) | ((63 & r) << 6) | (63 & o))
  43037. }
  43038. }),
  43039. (e.UTF16toUTF8 = function (e, t) {
  43040. for (var i, n = null; ; ) {
  43041. if (null === (i = null !== n ? n : e())) break
  43042. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343
  43043. ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null))
  43044. : t(i)
  43045. }
  43046. null !== n && t(n)
  43047. }),
  43048. (e.UTF8toUTF16 = function (e, t) {
  43049. var i = null
  43050. for (
  43051. 'number' == typeof e &&
  43052. ((i = e),
  43053. (e = function () {
  43054. return null
  43055. }));
  43056. null !== i || null !== (i = e());
  43057. )
  43058. i <= 65535 ? t(i) : ((i -= 65536), t((i >> 10) + 55296), t((i % 1024) + 56320)),
  43059. (i = null)
  43060. }),
  43061. (e.encodeUTF16toUTF8 = function (t, i) {
  43062. e.UTF16toUTF8(t, function (t) {
  43063. e.encodeUTF8(t, i)
  43064. })
  43065. }),
  43066. (e.decodeUTF8toUTF16 = function (t, i) {
  43067. e.decodeUTF8(t, function (t) {
  43068. e.UTF8toUTF16(t, i)
  43069. })
  43070. }),
  43071. (e.calculateCodePoint = function (e) {
  43072. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  43073. }),
  43074. (e.calculateUTF8 = function (e) {
  43075. for (var t, i = 0; null !== (t = e()); )
  43076. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  43077. return i
  43078. }),
  43079. (e.calculateUTF16asUTF8 = function (t) {
  43080. var i = 0,
  43081. n = 0
  43082. return (
  43083. e.UTF16toUTF8(t, function (e) {
  43084. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4)
  43085. }),
  43086. [i, n]
  43087. )
  43088. }),
  43089. e
  43090. )
  43091. })()
  43092. return (
  43093. (a.toUTF8 = function (e, t) {
  43094. if (
  43095. ('undefined' == typeof e && (e = this.offset),
  43096. 'undefined' == typeof t && (t = this.limit),
  43097. !this.noAssert)
  43098. ) {
  43099. if ('number' != typeof e || e % 1 !== 0)
  43100. throw TypeError('Illegal begin: Not an integer')
  43101. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  43102. throw TypeError('Illegal end: Not an integer')
  43103. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  43104. throw RangeError(
  43105. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  43106. )
  43107. }
  43108. var n
  43109. try {
  43110. h.decodeUTF8toUTF16(
  43111. function () {
  43112. return e < t ? this.view[e++] : null
  43113. }.bind(this),
  43114. (n = i())
  43115. )
  43116. } catch (i) {
  43117. if (e !== t) throw RangeError('Illegal range: Truncated data, ' + e + ' != ' + t)
  43118. }
  43119. return n()
  43120. }),
  43121. (o.fromUTF8 = function (e, i, n) {
  43122. if (!n && 'string' != typeof e) throw TypeError('Illegal str: Not a string')
  43123. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  43124. a = 0
  43125. return (
  43126. h.encodeUTF16toUTF8(t(e), function (e) {
  43127. r.view[a++] = e
  43128. }),
  43129. (r.limit = a),
  43130. r
  43131. )
  43132. }),
  43133. o
  43134. )
  43135. })
  43136. },
  43137. {
  43138. long: 216
  43139. }
  43140. ],
  43141. 216: [
  43142. function (e, t, i) {
  43143. !(function (i, n) {
  43144. 'function' == typeof define && define.amd
  43145. ? define([], n)
  43146. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  43147. ? (t.exports = n())
  43148. : ((i.dcodeIO = i.dcodeIO || {}).Long = n())
  43149. })(this, function () {
  43150. 'use strict'
  43151. function e(e, t, i) {
  43152. ;(this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i)
  43153. }
  43154. function t(e) {
  43155. return (e && e.__isLong__) === !0
  43156. }
  43157. function i(e, t) {
  43158. var i, n, o
  43159. return t
  43160. ? ((e >>>= 0),
  43161. (o = 0 <= e && e < 256) && (n = l[e])
  43162. ? n
  43163. : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  43164. : ((e |= 0),
  43165. (o = -128 <= e && e < 128) && (n = s[e])
  43166. ? n
  43167. : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i))
  43168. }
  43169. function n(e, t) {
  43170. if (isNaN(e) || !isFinite(e)) return t ? m : g
  43171. if (t) {
  43172. if (e < 0) return m
  43173. if (e >= d) return I
  43174. } else {
  43175. if (e <= -p) return E
  43176. if (e + 1 >= p) return C
  43177. }
  43178. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t)
  43179. }
  43180. function r(t, i, n) {
  43181. return new e(t, i, n)
  43182. }
  43183. function o(e, t, i) {
  43184. if (0 === e.length) throw Error('empty string')
  43185. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return g
  43186. if (
  43187. ('number' == typeof t ? ((i = t), (t = !1)) : (t = !!t),
  43188. (i = i || 10),
  43189. i < 2 || 36 < i)
  43190. )
  43191. throw RangeError('radix')
  43192. var r
  43193. if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen')
  43194. if (0 === r) return o(e.substring(1), t, i).neg()
  43195. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  43196. var h = Math.min(8, e.length - l),
  43197. u = parseInt(e.substring(l, l + h), i)
  43198. if (h < 8) {
  43199. var d = n(c(i, h))
  43200. s = s.mul(d).add(n(u))
  43201. } else (s = s.mul(a)), (s = s.add(n(u)))
  43202. }
  43203. return (s.unsigned = t), s
  43204. }
  43205. function a(t) {
  43206. return t instanceof e
  43207. ? t
  43208. : 'number' == typeof t
  43209. ? n(t)
  43210. : 'string' == typeof t
  43211. ? o(t)
  43212. : r(t.low, t.high, t.unsigned)
  43213. }
  43214. e.prototype.__isLong__,
  43215. Object.defineProperty(e.prototype, '__isLong__', {
  43216. value: !0,
  43217. enumerable: !1,
  43218. configurable: !1
  43219. }),
  43220. (e.isLong = t)
  43221. var s = {},
  43222. l = {}
  43223. ;(e.fromInt = i), (e.fromNumber = n), (e.fromBits = r)
  43224. var c = Math.pow
  43225. ;(e.fromString = o), (e.fromValue = a)
  43226. var h = 1 << 24,
  43227. u = 4294967296,
  43228. d = 0x10000000000000000,
  43229. p = d / 2,
  43230. f = i(h),
  43231. g = i(0)
  43232. e.ZERO = g
  43233. var m = i(0, !0)
  43234. e.UZERO = m
  43235. var v = i(1)
  43236. e.ONE = v
  43237. var A = i(1, !0)
  43238. e.UONE = A
  43239. var y = i(-1)
  43240. e.NEG_ONE = y
  43241. var C = r(-1, 2147483647, !1)
  43242. e.MAX_VALUE = C
  43243. var I = r(-1, -1, !0)
  43244. e.MAX_UNSIGNED_VALUE = I
  43245. var E = r(0, -2147483648, !1)
  43246. e.MIN_VALUE = E
  43247. var b = e.prototype
  43248. return (
  43249. (b.toInt = function () {
  43250. return this.unsigned ? this.low >>> 0 : this.low
  43251. }),
  43252. (b.toNumber = function () {
  43253. return this.unsigned
  43254. ? (this.high >>> 0) * u + (this.low >>> 0)
  43255. : this.high * u + (this.low >>> 0)
  43256. }),
  43257. (b.toString = function (e) {
  43258. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError('radix')
  43259. if (this.isZero()) return '0'
  43260. if (this.isNegative()) {
  43261. if (this.eq(E)) {
  43262. var t = n(e),
  43263. i = this.div(t),
  43264. r = i.mul(t).sub(this)
  43265. return i.toString(e) + r.toInt().toString(e)
  43266. }
  43267. return '-' + this.neg().toString(e)
  43268. }
  43269. for (var o = n(c(e, 6), this.unsigned), a = this, s = ''; ; ) {
  43270. var l = a.div(o),
  43271. h = a.sub(l.mul(o)).toInt() >>> 0,
  43272. u = h.toString(e)
  43273. if (((a = l), a.isZero())) return u + s
  43274. for (; u.length < 6; ) u = '0' + u
  43275. s = '' + u + s
  43276. }
  43277. }),
  43278. (b.getHighBits = function () {
  43279. return this.high
  43280. }),
  43281. (b.getHighBitsUnsigned = function () {
  43282. return this.high >>> 0
  43283. }),
  43284. (b.getLowBits = function () {
  43285. return this.low
  43286. }),
  43287. (b.getLowBitsUnsigned = function () {
  43288. return this.low >>> 0
  43289. }),
  43290. (b.getNumBitsAbs = function () {
  43291. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs()
  43292. for (
  43293. var e = 0 != this.high ? this.high : this.low, t = 31;
  43294. t > 0 && 0 == (e & (1 << t));
  43295. t--
  43296. );
  43297. return 0 != this.high ? t + 33 : t + 1
  43298. }),
  43299. (b.isZero = function () {
  43300. return 0 === this.high && 0 === this.low
  43301. }),
  43302. (b.isNegative = function () {
  43303. return !this.unsigned && this.high < 0
  43304. }),
  43305. (b.isPositive = function () {
  43306. return this.unsigned || this.high >= 0
  43307. }),
  43308. (b.isOdd = function () {
  43309. return 1 === (1 & this.low)
  43310. }),
  43311. (b.isEven = function () {
  43312. return 0 === (1 & this.low)
  43313. }),
  43314. (b.equals = function (e) {
  43315. return (
  43316. t(e) || (e = a(e)),
  43317. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) &&
  43318. this.high === e.high &&
  43319. this.low === e.low
  43320. )
  43321. }),
  43322. (b.eq = b.equals),
  43323. (b.notEquals = function (e) {
  43324. return !this.eq(e)
  43325. }),
  43326. (b.neq = b.notEquals),
  43327. (b.lessThan = function (e) {
  43328. return this.comp(e) < 0
  43329. }),
  43330. (b.lt = b.lessThan),
  43331. (b.lessThanOrEqual = function (e) {
  43332. return this.comp(e) <= 0
  43333. }),
  43334. (b.lte = b.lessThanOrEqual),
  43335. (b.greaterThan = function (e) {
  43336. return this.comp(e) > 0
  43337. }),
  43338. (b.gt = b.greaterThan),
  43339. (b.greaterThanOrEqual = function (e) {
  43340. return this.comp(e) >= 0
  43341. }),
  43342. (b.gte = b.greaterThanOrEqual),
  43343. (b.compare = function (e) {
  43344. if ((t(e) || (e = a(e)), this.eq(e))) return 0
  43345. var i = this.isNegative(),
  43346. n = e.isNegative()
  43347. return i && !n
  43348. ? -1
  43349. : !i && n
  43350. ? 1
  43351. : this.unsigned
  43352. ? e.high >>> 0 > this.high >>> 0 ||
  43353. (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  43354. ? -1
  43355. : 1
  43356. : this.sub(e).isNegative()
  43357. ? -1
  43358. : 1
  43359. }),
  43360. (b.comp = b.compare),
  43361. (b.negate = function () {
  43362. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  43363. }),
  43364. (b.neg = b.negate),
  43365. (b.add = function (e) {
  43366. t(e) || (e = a(e))
  43367. var i = this.high >>> 16,
  43368. n = 65535 & this.high,
  43369. o = this.low >>> 16,
  43370. s = 65535 & this.low,
  43371. l = e.high >>> 16,
  43372. c = 65535 & e.high,
  43373. h = e.low >>> 16,
  43374. u = 65535 & e.low,
  43375. d = 0,
  43376. p = 0,
  43377. f = 0,
  43378. g = 0
  43379. return (
  43380. (g += s + u),
  43381. (f += g >>> 16),
  43382. (g &= 65535),
  43383. (f += o + h),
  43384. (p += f >>> 16),
  43385. (f &= 65535),
  43386. (p += n + c),
  43387. (d += p >>> 16),
  43388. (p &= 65535),
  43389. (d += i + l),
  43390. (d &= 65535),
  43391. r((f << 16) | g, (d << 16) | p, this.unsigned)
  43392. )
  43393. }),
  43394. (b.subtract = function (e) {
  43395. return t(e) || (e = a(e)), this.add(e.neg())
  43396. }),
  43397. (b.sub = b.subtract),
  43398. (b.multiply = function (e) {
  43399. if (this.isZero()) return g
  43400. if ((t(e) || (e = a(e)), e.isZero())) return g
  43401. if (this.eq(E)) return e.isOdd() ? E : g
  43402. if (e.eq(E)) return this.isOdd() ? E : g
  43403. if (this.isNegative())
  43404. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg()
  43405. if (e.isNegative()) return this.mul(e.neg()).neg()
  43406. if (this.lt(f) && e.lt(f)) return n(this.toNumber() * e.toNumber(), this.unsigned)
  43407. var i = this.high >>> 16,
  43408. o = 65535 & this.high,
  43409. s = this.low >>> 16,
  43410. l = 65535 & this.low,
  43411. c = e.high >>> 16,
  43412. h = 65535 & e.high,
  43413. u = e.low >>> 16,
  43414. d = 65535 & e.low,
  43415. p = 0,
  43416. m = 0,
  43417. v = 0,
  43418. A = 0
  43419. return (
  43420. (A += l * d),
  43421. (v += A >>> 16),
  43422. (A &= 65535),
  43423. (v += s * d),
  43424. (m += v >>> 16),
  43425. (v &= 65535),
  43426. (v += l * u),
  43427. (m += v >>> 16),
  43428. (v &= 65535),
  43429. (m += o * d),
  43430. (p += m >>> 16),
  43431. (m &= 65535),
  43432. (m += s * u),
  43433. (p += m >>> 16),
  43434. (m &= 65535),
  43435. (m += l * h),
  43436. (p += m >>> 16),
  43437. (m &= 65535),
  43438. (p += i * d + o * u + s * h + l * c),
  43439. (p &= 65535),
  43440. r((v << 16) | A, (p << 16) | m, this.unsigned)
  43441. )
  43442. }),
  43443. (b.mul = b.multiply),
  43444. (b.divide = function (e) {
  43445. if ((t(e) || (e = a(e)), e.isZero())) throw Error('division by zero')
  43446. if (this.isZero()) return this.unsigned ? m : g
  43447. var i, r, o
  43448. if (this.unsigned) {
  43449. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m
  43450. if (e.gt(this.shru(1))) return A
  43451. o = m
  43452. } else {
  43453. if (this.eq(E)) {
  43454. if (e.eq(v) || e.eq(y)) return E
  43455. if (e.eq(E)) return v
  43456. var s = this.shr(1)
  43457. return (
  43458. (i = s.div(e).shl(1)),
  43459. i.eq(g)
  43460. ? e.isNegative()
  43461. ? v
  43462. : y
  43463. : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  43464. )
  43465. }
  43466. if (e.eq(E)) return this.unsigned ? m : g
  43467. if (this.isNegative())
  43468. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg()
  43469. if (e.isNegative()) return this.div(e.neg()).neg()
  43470. o = g
  43471. }
  43472. for (r = this; r.gte(e); ) {
  43473. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()))
  43474. for (
  43475. var l = Math.ceil(Math.log(i) / Math.LN2),
  43476. h = l <= 48 ? 1 : c(2, l - 48),
  43477. u = n(i),
  43478. d = u.mul(e);
  43479. d.isNegative() || d.gt(r);
  43480. )
  43481. (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e))
  43482. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d))
  43483. }
  43484. return o
  43485. }),
  43486. (b.div = b.divide),
  43487. (b.modulo = function (e) {
  43488. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e))
  43489. }),
  43490. (b.mod = b.modulo),
  43491. (b.not = function () {
  43492. return r(~this.low, ~this.high, this.unsigned)
  43493. }),
  43494. (b.and = function (e) {
  43495. return t(e) || (e = a(e)), r(this.low & e.low, this.high & e.high, this.unsigned)
  43496. }),
  43497. (b.or = function (e) {
  43498. return t(e) || (e = a(e)), r(this.low | e.low, this.high | e.high, this.unsigned)
  43499. }),
  43500. (b.xor = function (e) {
  43501. return t(e) || (e = a(e)), r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  43502. }),
  43503. (b.shiftLeft = function (e) {
  43504. return (
  43505. t(e) && (e = e.toInt()),
  43506. 0 === (e &= 63)
  43507. ? this
  43508. : e < 32
  43509. ? r(this.low << e, (this.high << e) | (this.low >>> (32 - e)), this.unsigned)
  43510. : r(0, this.low << (e - 32), this.unsigned)
  43511. )
  43512. }),
  43513. (b.shl = b.shiftLeft),
  43514. (b.shiftRight = function (e) {
  43515. return (
  43516. t(e) && (e = e.toInt()),
  43517. 0 === (e &= 63)
  43518. ? this
  43519. : e < 32
  43520. ? r((this.low >>> e) | (this.high << (32 - e)), this.high >> e, this.unsigned)
  43521. : r(this.high >> (e - 32), this.high >= 0 ? 0 : -1, this.unsigned)
  43522. )
  43523. }),
  43524. (b.shr = b.shiftRight),
  43525. (b.shiftRightUnsigned = function (e) {
  43526. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this
  43527. var i = this.high
  43528. if (e < 32) {
  43529. var n = this.low
  43530. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned)
  43531. }
  43532. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> (e - 32), 0, this.unsigned)
  43533. }),
  43534. (b.shru = b.shiftRightUnsigned),
  43535. (b.toSigned = function () {
  43536. return this.unsigned ? r(this.low, this.high, !1) : this
  43537. }),
  43538. (b.toUnsigned = function () {
  43539. return this.unsigned ? this : r(this.low, this.high, !0)
  43540. }),
  43541. (b.toBytes = function (e) {
  43542. return e ? this.toBytesLE() : this.toBytesBE()
  43543. }),
  43544. (b.toBytesLE = function () {
  43545. var e = this.high,
  43546. t = this.low
  43547. return [
  43548. 255 & t,
  43549. (t >>> 8) & 255,
  43550. (t >>> 16) & 255,
  43551. (t >>> 24) & 255,
  43552. 255 & e,
  43553. (e >>> 8) & 255,
  43554. (e >>> 16) & 255,
  43555. (e >>> 24) & 255
  43556. ]
  43557. }),
  43558. (b.toBytesBE = function () {
  43559. var e = this.high,
  43560. t = this.low
  43561. return [
  43562. (e >>> 24) & 255,
  43563. (e >>> 16) & 255,
  43564. (e >>> 8) & 255,
  43565. 255 & e,
  43566. (t >>> 24) & 255,
  43567. (t >>> 16) & 255,
  43568. (t >>> 8) & 255,
  43569. 255 & t
  43570. ]
  43571. }),
  43572. e
  43573. )
  43574. })
  43575. },
  43576. {}
  43577. ],
  43578. 217: [
  43579. function (e, t, i) {
  43580. var n = {
  43581. REVISION: '75'
  43582. }
  43583. 'function' == typeof define && define.amd
  43584. ? define('three', n)
  43585. : 'undefined' != typeof i && 'undefined' != typeof t && (t.exports = n),
  43586. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  43587. void 0 === Math.sign &&
  43588. (Math.sign = function (e) {
  43589. return e < 0 ? -1 : e > 0 ? 1 : +e
  43590. }),
  43591. void 0 === Function.prototype.name &&
  43592. void 0 !== Object.defineProperty &&
  43593. Object.defineProperty(Function.prototype, 'name', {
  43594. get: function () {
  43595. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  43596. }
  43597. }),
  43598. void 0 === Object.assign &&
  43599. Object.defineProperty(Object, 'assign', {
  43600. writable: !0,
  43601. configurable: !0,
  43602. value: function (e) {
  43603. 'use strict'
  43604. if (void 0 === e || null === e)
  43605. throw new TypeError('Cannot convert first argument to object')
  43606. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  43607. var r = arguments[i]
  43608. if (void 0 !== r && null !== r) {
  43609. r = Object(r)
  43610. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  43611. var l = o[a],
  43612. c = Object.getOwnPropertyDescriptor(r, l)
  43613. void 0 !== c && c.enumerable && (t[l] = r[l])
  43614. }
  43615. }
  43616. }
  43617. return t
  43618. }
  43619. }),
  43620. (n.MOUSE = {
  43621. LEFT: 0,
  43622. MIDDLE: 1,
  43623. RIGHT: 2
  43624. }),
  43625. (n.CullFaceNone = 0),
  43626. (n.CullFaceBack = 1),
  43627. (n.CullFaceFront = 2),
  43628. (n.CullFaceFrontBack = 3),
  43629. (n.FrontFaceDirectionCW = 0),
  43630. (n.FrontFaceDirectionCCW = 1),
  43631. (n.BasicShadowMap = 0),
  43632. (n.PCFShadowMap = 1),
  43633. (n.PCFSoftShadowMap = 2),
  43634. (n.FrontSide = 0),
  43635. (n.BackSide = 1),
  43636. (n.DoubleSide = 2),
  43637. (n.FlatShading = 1),
  43638. (n.SmoothShading = 2),
  43639. (n.NoColors = 0),
  43640. (n.FaceColors = 1),
  43641. (n.VertexColors = 2),
  43642. (n.NoBlending = 0),
  43643. (n.NormalBlending = 1),
  43644. (n.AdditiveBlending = 2),
  43645. (n.SubtractiveBlending = 3),
  43646. (n.MultiplyBlending = 4),
  43647. (n.CustomBlending = 5),
  43648. (n.AddEquation = 100),
  43649. (n.SubtractEquation = 101),
  43650. (n.ReverseSubtractEquation = 102),
  43651. (n.MinEquation = 103),
  43652. (n.MaxEquation = 104),
  43653. (n.ZeroFactor = 200),
  43654. (n.OneFactor = 201),
  43655. (n.SrcColorFactor = 202),
  43656. (n.OneMinusSrcColorFactor = 203),
  43657. (n.SrcAlphaFactor = 204),
  43658. (n.OneMinusSrcAlphaFactor = 205),
  43659. (n.DstAlphaFactor = 206),
  43660. (n.OneMinusDstAlphaFactor = 207),
  43661. (n.DstColorFactor = 208),
  43662. (n.OneMinusDstColorFactor = 209),
  43663. (n.SrcAlphaSaturateFactor = 210),
  43664. (n.NeverDepth = 0),
  43665. (n.AlwaysDepth = 1),
  43666. (n.LessDepth = 2),
  43667. (n.LessEqualDepth = 3),
  43668. (n.EqualDepth = 4),
  43669. (n.GreaterEqualDepth = 5),
  43670. (n.GreaterDepth = 6),
  43671. (n.NotEqualDepth = 7),
  43672. (n.MultiplyOperation = 0),
  43673. (n.MixOperation = 1),
  43674. (n.AddOperation = 2),
  43675. (n.NoToneMapping = 0),
  43676. (n.LinearToneMapping = 1),
  43677. (n.ReinhardToneMapping = 2),
  43678. (n.Uncharted2ToneMapping = 3),
  43679. (n.CineonToneMapping = 4),
  43680. (n.UVMapping = 300),
  43681. (n.CubeReflectionMapping = 301),
  43682. (n.CubeRefractionMapping = 302),
  43683. (n.EquirectangularReflectionMapping = 303),
  43684. (n.EquirectangularRefractionMapping = 304),
  43685. (n.SphericalReflectionMapping = 305),
  43686. (n.CubeUVReflectionMapping = 306),
  43687. (n.CubeUVRefractionMapping = 307),
  43688. (n.RepeatWrapping = 1e3),
  43689. (n.ClampToEdgeWrapping = 1001),
  43690. (n.MirroredRepeatWrapping = 1002),
  43691. (n.NearestFilter = 1003),
  43692. (n.NearestMipMapNearestFilter = 1004),
  43693. (n.NearestMipMapLinearFilter = 1005),
  43694. (n.LinearFilter = 1006),
  43695. (n.LinearMipMapNearestFilter = 1007),
  43696. (n.LinearMipMapLinearFilter = 1008),
  43697. (n.UnsignedByteType = 1009),
  43698. (n.ByteType = 1010),
  43699. (n.ShortType = 1011),
  43700. (n.UnsignedShortType = 1012),
  43701. (n.IntType = 1013),
  43702. (n.UnsignedIntType = 1014),
  43703. (n.FloatType = 1015),
  43704. (n.HalfFloatType = 1025),
  43705. (n.UnsignedShort4444Type = 1016),
  43706. (n.UnsignedShort5551Type = 1017),
  43707. (n.UnsignedShort565Type = 1018),
  43708. (n.AlphaFormat = 1019),
  43709. (n.RGBFormat = 1020),
  43710. (n.RGBAFormat = 1021),
  43711. (n.LuminanceFormat = 1022),
  43712. (n.LuminanceAlphaFormat = 1023),
  43713. (n.RGBEFormat = n.RGBAFormat),
  43714. (n.RGB_S3TC_DXT1_Format = 2001),
  43715. (n.RGBA_S3TC_DXT1_Format = 2002),
  43716. (n.RGBA_S3TC_DXT3_Format = 2003),
  43717. (n.RGBA_S3TC_DXT5_Format = 2004),
  43718. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  43719. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  43720. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  43721. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  43722. (n.RGB_ETC1_Format = 2151),
  43723. (n.LoopOnce = 2200),
  43724. (n.LoopRepeat = 2201),
  43725. (n.LoopPingPong = 2202),
  43726. (n.InterpolateDiscrete = 2300),
  43727. (n.InterpolateLinear = 2301),
  43728. (n.InterpolateSmooth = 2302),
  43729. (n.ZeroCurvatureEnding = 2400),
  43730. (n.ZeroSlopeEnding = 2401),
  43731. (n.WrapAroundEnding = 2402),
  43732. (n.TrianglesDrawMode = 0),
  43733. (n.TriangleStripDrawMode = 1),
  43734. (n.TriangleFanDrawMode = 2),
  43735. (n.LinearEncoding = 3e3),
  43736. (n.sRGBEncoding = 3001),
  43737. (n.GammaEncoding = 3007),
  43738. (n.RGBEEncoding = 3002),
  43739. (n.LogLuvEncoding = 3003),
  43740. (n.RGBM7Encoding = 3004),
  43741. (n.RGBM16Encoding = 3005),
  43742. (n.RGBDEncoding = 3006),
  43743. (n.Color = function (e) {
  43744. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  43745. }),
  43746. (n.Color.prototype = {
  43747. constructor: n.Color,
  43748. r: 1,
  43749. g: 1,
  43750. b: 1,
  43751. set: function (e) {
  43752. return (
  43753. e instanceof n.Color
  43754. ? this.copy(e)
  43755. : 'number' == typeof e
  43756. ? this.setHex(e)
  43757. : 'string' == typeof e && this.setStyle(e),
  43758. this
  43759. )
  43760. },
  43761. setScalar: function (e) {
  43762. ;(this.r = e), (this.g = e), (this.b = e)
  43763. },
  43764. setHex: function (e) {
  43765. return (
  43766. (e = Math.floor(e)),
  43767. (this.r = ((e >> 16) & 255) / 255),
  43768. (this.g = ((e >> 8) & 255) / 255),
  43769. (this.b = (255 & e) / 255),
  43770. this
  43771. )
  43772. },
  43773. setRGB: function (e, t, i) {
  43774. return (this.r = e), (this.g = t), (this.b = i), this
  43775. },
  43776. setHSL: (function () {
  43777. function e(e, t, i) {
  43778. return (
  43779. i < 0 && (i += 1),
  43780. i > 1 && (i -= 1),
  43781. i < 1 / 6
  43782. ? e + 6 * (t - e) * i
  43783. : i < 0.5
  43784. ? t
  43785. : i < 2 / 3
  43786. ? e + 6 * (t - e) * (2 / 3 - i)
  43787. : e
  43788. )
  43789. }
  43790. return function (t, i, r) {
  43791. if (
  43792. ((t = n.Math.euclideanModulo(t, 1)),
  43793. (i = n.Math.clamp(i, 0, 1)),
  43794. (r = n.Math.clamp(r, 0, 1)),
  43795. 0 === i)
  43796. )
  43797. this.r = this.g = this.b = r
  43798. else {
  43799. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  43800. a = 2 * r - o
  43801. ;(this.r = e(a, o, t + 1 / 3)),
  43802. (this.g = e(a, o, t)),
  43803. (this.b = e(a, o, t - 1 / 3))
  43804. }
  43805. return this
  43806. }
  43807. })(),
  43808. setStyle: function (e) {
  43809. function t(t) {
  43810. void 0 !== t &&
  43811. parseFloat(t) < 1 &&
  43812. console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.')
  43813. }
  43814. var i
  43815. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  43816. var r,
  43817. o = i[1],
  43818. a = i[2]
  43819. switch (o) {
  43820. case 'rgb':
  43821. case 'rgba':
  43822. if (
  43823. (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  43824. )
  43825. return (
  43826. (this.r = Math.min(255, parseInt(r[1], 10)) / 255),
  43827. (this.g = Math.min(255, parseInt(r[2], 10)) / 255),
  43828. (this.b = Math.min(255, parseInt(r[3], 10)) / 255),
  43829. t(r[5]),
  43830. this
  43831. )
  43832. if (
  43833. (r =
  43834. /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43835. a
  43836. ))
  43837. )
  43838. return (
  43839. (this.r = Math.min(100, parseInt(r[1], 10)) / 100),
  43840. (this.g = Math.min(100, parseInt(r[2], 10)) / 100),
  43841. (this.b = Math.min(100, parseInt(r[3], 10)) / 100),
  43842. t(r[5]),
  43843. this
  43844. )
  43845. break
  43846. case 'hsl':
  43847. case 'hsla':
  43848. if (
  43849. (r =
  43850. /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43851. a
  43852. ))
  43853. ) {
  43854. var s = parseFloat(r[1]) / 360,
  43855. l = parseInt(r[2], 10) / 100,
  43856. c = parseInt(r[3], 10) / 100
  43857. return t(r[5]), this.setHSL(s, l, c)
  43858. }
  43859. }
  43860. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  43861. var h = i[1],
  43862. u = h.length
  43863. if (3 === u)
  43864. return (
  43865. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255),
  43866. (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255),
  43867. (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255),
  43868. this
  43869. )
  43870. if (6 === u)
  43871. return (
  43872. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255),
  43873. (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255),
  43874. (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255),
  43875. this
  43876. )
  43877. }
  43878. if (e && e.length > 0) {
  43879. var h = n.ColorKeywords[e]
  43880. void 0 !== h ? this.setHex(h) : console.warn('THREE.Color: Unknown color ' + e)
  43881. }
  43882. return this
  43883. },
  43884. clone: function () {
  43885. return new this.constructor(this.r, this.g, this.b)
  43886. },
  43887. copy: function (e) {
  43888. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this
  43889. },
  43890. copyGammaToLinear: function (e, t) {
  43891. return (
  43892. void 0 === t && (t = 2),
  43893. (this.r = Math.pow(e.r, t)),
  43894. (this.g = Math.pow(e.g, t)),
  43895. (this.b = Math.pow(e.b, t)),
  43896. this
  43897. )
  43898. },
  43899. copyLinearToGamma: function (e, t) {
  43900. void 0 === t && (t = 2)
  43901. var i = t > 0 ? 1 / t : 1
  43902. return (
  43903. (this.r = Math.pow(e.r, i)),
  43904. (this.g = Math.pow(e.g, i)),
  43905. (this.b = Math.pow(e.b, i)),
  43906. this
  43907. )
  43908. },
  43909. convertGammaToLinear: function () {
  43910. var e = this.r,
  43911. t = this.g,
  43912. i = this.b
  43913. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this
  43914. },
  43915. convertLinearToGamma: function () {
  43916. return (
  43917. (this.r = Math.sqrt(this.r)),
  43918. (this.g = Math.sqrt(this.g)),
  43919. (this.b = Math.sqrt(this.b)),
  43920. this
  43921. )
  43922. },
  43923. getHex: function () {
  43924. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0)
  43925. },
  43926. getHexString: function () {
  43927. return ('000000' + this.getHex().toString(16)).slice(-6)
  43928. },
  43929. getHSL: function (e) {
  43930. var t,
  43931. i,
  43932. n = e || {
  43933. h: 0,
  43934. s: 0,
  43935. l: 0
  43936. },
  43937. r = this.r,
  43938. o = this.g,
  43939. a = this.b,
  43940. s = Math.max(r, o, a),
  43941. l = Math.min(r, o, a),
  43942. c = (l + s) / 2
  43943. if (l === s) (t = 0), (i = 0)
  43944. else {
  43945. var h = s - l
  43946. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  43947. case r:
  43948. t = (o - a) / h + (o < a ? 6 : 0)
  43949. break
  43950. case o:
  43951. t = (a - r) / h + 2
  43952. break
  43953. case a:
  43954. t = (r - o) / h + 4
  43955. }
  43956. t /= 6
  43957. }
  43958. return (n.h = t), (n.s = i), (n.l = c), n
  43959. },
  43960. getStyle: function () {
  43961. return (
  43962. 'rgb(' +
  43963. ((255 * this.r) | 0) +
  43964. ',' +
  43965. ((255 * this.g) | 0) +
  43966. ',' +
  43967. ((255 * this.b) | 0) +
  43968. ')'
  43969. )
  43970. },
  43971. offsetHSL: function (e, t, i) {
  43972. var n = this.getHSL()
  43973. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this
  43974. },
  43975. add: function (e) {
  43976. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this
  43977. },
  43978. addColors: function (e, t) {
  43979. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this
  43980. },
  43981. addScalar: function (e) {
  43982. return (this.r += e), (this.g += e), (this.b += e), this
  43983. },
  43984. multiply: function (e) {
  43985. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this
  43986. },
  43987. multiplyScalar: function (e) {
  43988. return (this.r *= e), (this.g *= e), (this.b *= e), this
  43989. },
  43990. lerp: function (e, t) {
  43991. return (
  43992. (this.r += (e.r - this.r) * t),
  43993. (this.g += (e.g - this.g) * t),
  43994. (this.b += (e.b - this.b) * t),
  43995. this
  43996. )
  43997. },
  43998. equals: function (e) {
  43999. return e.r === this.r && e.g === this.g && e.b === this.b
  44000. },
  44001. fromArray: function (e, t) {
  44002. return (
  44003. void 0 === t && (t = 0),
  44004. (this.r = e[t]),
  44005. (this.g = e[t + 1]),
  44006. (this.b = e[t + 2]),
  44007. this
  44008. )
  44009. },
  44010. toArray: function (e, t) {
  44011. return (
  44012. void 0 === e && (e = []),
  44013. void 0 === t && (t = 0),
  44014. (e[t] = this.r),
  44015. (e[t + 1] = this.g),
  44016. (e[t + 2] = this.b),
  44017. e
  44018. )
  44019. }
  44020. }),
  44021. (n.ColorKeywords = {
  44022. aliceblue: 15792383,
  44023. antiquewhite: 16444375,
  44024. aqua: 65535,
  44025. aquamarine: 8388564,
  44026. azure: 15794175,
  44027. beige: 16119260,
  44028. bisque: 16770244,
  44029. black: 0,
  44030. blanchedalmond: 16772045,
  44031. blue: 255,
  44032. blueviolet: 9055202,
  44033. brown: 10824234,
  44034. burlywood: 14596231,
  44035. cadetblue: 6266528,
  44036. chartreuse: 8388352,
  44037. chocolate: 13789470,
  44038. coral: 16744272,
  44039. cornflowerblue: 6591981,
  44040. cornsilk: 16775388,
  44041. crimson: 14423100,
  44042. cyan: 65535,
  44043. darkblue: 139,
  44044. darkcyan: 35723,
  44045. darkgoldenrod: 12092939,
  44046. darkgray: 11119017,
  44047. darkgreen: 25600,
  44048. darkgrey: 11119017,
  44049. darkkhaki: 12433259,
  44050. darkmagenta: 9109643,
  44051. darkolivegreen: 5597999,
  44052. darkorange: 16747520,
  44053. darkorchid: 10040012,
  44054. darkred: 9109504,
  44055. darksalmon: 15308410,
  44056. darkseagreen: 9419919,
  44057. darkslateblue: 4734347,
  44058. darkslategray: 3100495,
  44059. darkslategrey: 3100495,
  44060. darkturquoise: 52945,
  44061. darkviolet: 9699539,
  44062. deeppink: 16716947,
  44063. deepskyblue: 49151,
  44064. dimgray: 6908265,
  44065. dimgrey: 6908265,
  44066. dodgerblue: 2003199,
  44067. firebrick: 11674146,
  44068. floralwhite: 16775920,
  44069. forestgreen: 2263842,
  44070. fuchsia: 16711935,
  44071. gainsboro: 14474460,
  44072. ghostwhite: 16316671,
  44073. gold: 16766720,
  44074. goldenrod: 14329120,
  44075. gray: 8421504,
  44076. green: 32768,
  44077. greenyellow: 11403055,
  44078. grey: 8421504,
  44079. honeydew: 15794160,
  44080. hotpink: 16738740,
  44081. indianred: 13458524,
  44082. indigo: 4915330,
  44083. ivory: 16777200,
  44084. khaki: 15787660,
  44085. lavender: 15132410,
  44086. lavenderblush: 16773365,
  44087. lawngreen: 8190976,
  44088. lemonchiffon: 16775885,
  44089. lightblue: 11393254,
  44090. lightcoral: 15761536,
  44091. lightcyan: 14745599,
  44092. lightgoldenrodyellow: 16448210,
  44093. lightgray: 13882323,
  44094. lightgreen: 9498256,
  44095. lightgrey: 13882323,
  44096. lightpink: 16758465,
  44097. lightsalmon: 16752762,
  44098. lightseagreen: 2142890,
  44099. lightskyblue: 8900346,
  44100. lightslategray: 7833753,
  44101. lightslategrey: 7833753,
  44102. lightsteelblue: 11584734,
  44103. lightyellow: 16777184,
  44104. lime: 65280,
  44105. limegreen: 3329330,
  44106. linen: 16445670,
  44107. magenta: 16711935,
  44108. maroon: 8388608,
  44109. mediumaquamarine: 6737322,
  44110. mediumblue: 205,
  44111. mediumorchid: 12211667,
  44112. mediumpurple: 9662683,
  44113. mediumseagreen: 3978097,
  44114. mediumslateblue: 8087790,
  44115. mediumspringgreen: 64154,
  44116. mediumturquoise: 4772300,
  44117. mediumvioletred: 13047173,
  44118. midnightblue: 1644912,
  44119. mintcream: 16121850,
  44120. mistyrose: 16770273,
  44121. moccasin: 16770229,
  44122. navajowhite: 16768685,
  44123. navy: 128,
  44124. oldlace: 16643558,
  44125. olive: 8421376,
  44126. olivedrab: 7048739,
  44127. orange: 16753920,
  44128. orangered: 16729344,
  44129. orchid: 14315734,
  44130. palegoldenrod: 15657130,
  44131. palegreen: 10025880,
  44132. paleturquoise: 11529966,
  44133. palevioletred: 14381203,
  44134. papayawhip: 16773077,
  44135. peachpuff: 16767673,
  44136. peru: 13468991,
  44137. pink: 16761035,
  44138. plum: 14524637,
  44139. powderblue: 11591910,
  44140. purple: 8388736,
  44141. red: 16711680,
  44142. rosybrown: 12357519,
  44143. royalblue: 4286945,
  44144. saddlebrown: 9127187,
  44145. salmon: 16416882,
  44146. sandybrown: 16032864,
  44147. seagreen: 3050327,
  44148. seashell: 16774638,
  44149. sienna: 10506797,
  44150. silver: 12632256,
  44151. skyblue: 8900331,
  44152. slateblue: 6970061,
  44153. slategray: 7372944,
  44154. slategrey: 7372944,
  44155. snow: 16775930,
  44156. springgreen: 65407,
  44157. steelblue: 4620980,
  44158. tan: 13808780,
  44159. teal: 32896,
  44160. thistle: 14204888,
  44161. tomato: 16737095,
  44162. turquoise: 4251856,
  44163. violet: 15631086,
  44164. wheat: 16113331,
  44165. white: 16777215,
  44166. whitesmoke: 16119285,
  44167. yellow: 16776960,
  44168. yellowgreen: 10145074
  44169. }),
  44170. (n.Quaternion = function (e, t, i, n) {
  44171. ;(this._x = e || 0),
  44172. (this._y = t || 0),
  44173. (this._z = i || 0),
  44174. (this._w = void 0 !== n ? n : 1)
  44175. }),
  44176. (n.Quaternion.prototype = {
  44177. constructor: n.Quaternion,
  44178. get x() {
  44179. return this._x
  44180. },
  44181. set x(e) {
  44182. ;(this._x = e), this.onChangeCallback()
  44183. },
  44184. get y() {
  44185. return this._y
  44186. },
  44187. set y(e) {
  44188. ;(this._y = e), this.onChangeCallback()
  44189. },
  44190. get z() {
  44191. return this._z
  44192. },
  44193. set z(e) {
  44194. ;(this._z = e), this.onChangeCallback()
  44195. },
  44196. get w() {
  44197. return this._w
  44198. },
  44199. set w(e) {
  44200. ;(this._w = e), this.onChangeCallback()
  44201. },
  44202. set: function (e, t, i, n) {
  44203. return (
  44204. (this._x = e),
  44205. (this._y = t),
  44206. (this._z = i),
  44207. (this._w = n),
  44208. this.onChangeCallback(),
  44209. this
  44210. )
  44211. },
  44212. clone: function () {
  44213. return new this.constructor(this._x, this._y, this._z, this._w)
  44214. },
  44215. copy: function (e) {
  44216. return (
  44217. (this._x = e.x),
  44218. (this._y = e.y),
  44219. (this._z = e.z),
  44220. (this._w = e.w),
  44221. this.onChangeCallback(),
  44222. this
  44223. )
  44224. },
  44225. setFromEuler: function (e, t) {
  44226. if (e instanceof n.Euler == !1)
  44227. throw new Error(
  44228. 'THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  44229. )
  44230. var i = Math.cos(e._x / 2),
  44231. r = Math.cos(e._y / 2),
  44232. o = Math.cos(e._z / 2),
  44233. a = Math.sin(e._x / 2),
  44234. s = Math.sin(e._y / 2),
  44235. l = Math.sin(e._z / 2),
  44236. c = e.order
  44237. return (
  44238. 'XYZ' === c
  44239. ? ((this._x = a * r * o + i * s * l),
  44240. (this._y = i * s * o - a * r * l),
  44241. (this._z = i * r * l + a * s * o),
  44242. (this._w = i * r * o - a * s * l))
  44243. : 'YXZ' === c
  44244. ? ((this._x = a * r * o + i * s * l),
  44245. (this._y = i * s * o - a * r * l),
  44246. (this._z = i * r * l - a * s * o),
  44247. (this._w = i * r * o + a * s * l))
  44248. : 'ZXY' === c
  44249. ? ((this._x = a * r * o - i * s * l),
  44250. (this._y = i * s * o + a * r * l),
  44251. (this._z = i * r * l + a * s * o),
  44252. (this._w = i * r * o - a * s * l))
  44253. : 'ZYX' === c
  44254. ? ((this._x = a * r * o - i * s * l),
  44255. (this._y = i * s * o + a * r * l),
  44256. (this._z = i * r * l - a * s * o),
  44257. (this._w = i * r * o + a * s * l))
  44258. : 'YZX' === c
  44259. ? ((this._x = a * r * o + i * s * l),
  44260. (this._y = i * s * o + a * r * l),
  44261. (this._z = i * r * l - a * s * o),
  44262. (this._w = i * r * o - a * s * l))
  44263. : 'XZY' === c &&
  44264. ((this._x = a * r * o - i * s * l),
  44265. (this._y = i * s * o - a * r * l),
  44266. (this._z = i * r * l + a * s * o),
  44267. (this._w = i * r * o + a * s * l)),
  44268. t !== !1 && this.onChangeCallback(),
  44269. this
  44270. )
  44271. },
  44272. setFromAxisAngle: function (e, t) {
  44273. var i = t / 2,
  44274. n = Math.sin(i)
  44275. return (
  44276. (this._x = e.x * n),
  44277. (this._y = e.y * n),
  44278. (this._z = e.z * n),
  44279. (this._w = Math.cos(i)),
  44280. this.onChangeCallback(),
  44281. this
  44282. )
  44283. },
  44284. setFromRotationMatrix: function (e) {
  44285. var t,
  44286. i = e.elements,
  44287. n = i[0],
  44288. r = i[4],
  44289. o = i[8],
  44290. a = i[1],
  44291. s = i[5],
  44292. l = i[9],
  44293. c = i[2],
  44294. h = i[6],
  44295. u = i[10],
  44296. d = n + s + u
  44297. return (
  44298. d > 0
  44299. ? ((t = 0.5 / Math.sqrt(d + 1)),
  44300. (this._w = 0.25 / t),
  44301. (this._x = (h - l) * t),
  44302. (this._y = (o - c) * t),
  44303. (this._z = (a - r) * t))
  44304. : n > s && n > u
  44305. ? ((t = 2 * Math.sqrt(1 + n - s - u)),
  44306. (this._w = (h - l) / t),
  44307. (this._x = 0.25 * t),
  44308. (this._y = (r + a) / t),
  44309. (this._z = (o + c) / t))
  44310. : s > u
  44311. ? ((t = 2 * Math.sqrt(1 + s - n - u)),
  44312. (this._w = (o - c) / t),
  44313. (this._x = (r + a) / t),
  44314. (this._y = 0.25 * t),
  44315. (this._z = (l + h) / t))
  44316. : ((t = 2 * Math.sqrt(1 + u - n - s)),
  44317. (this._w = (a - r) / t),
  44318. (this._x = (o + c) / t),
  44319. (this._y = (l + h) / t),
  44320. (this._z = 0.25 * t)),
  44321. this.onChangeCallback(),
  44322. this
  44323. )
  44324. },
  44325. setFromUnitVectors: (function () {
  44326. var e,
  44327. t,
  44328. i = 1e-6
  44329. return function (r, o) {
  44330. return (
  44331. void 0 === e && (e = new n.Vector3()),
  44332. (t = r.dot(o) + 1),
  44333. t < i
  44334. ? ((t = 0),
  44335. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y))
  44336. : e.crossVectors(r, o),
  44337. (this._x = e.x),
  44338. (this._y = e.y),
  44339. (this._z = e.z),
  44340. (this._w = t),
  44341. this.normalize(),
  44342. this
  44343. )
  44344. }
  44345. })(),
  44346. inverse: function () {
  44347. return this.conjugate().normalize(), this
  44348. },
  44349. conjugate: function () {
  44350. return (
  44351. (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  44352. )
  44353. },
  44354. dot: function (e) {
  44355. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  44356. },
  44357. lengthSq: function () {
  44358. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  44359. },
  44360. length: function () {
  44361. return Math.sqrt(
  44362. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  44363. )
  44364. },
  44365. normalize: function () {
  44366. var e = this.length()
  44367. return (
  44368. 0 === e
  44369. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  44370. : ((e = 1 / e),
  44371. (this._x = this._x * e),
  44372. (this._y = this._y * e),
  44373. (this._z = this._z * e),
  44374. (this._w = this._w * e)),
  44375. this.onChangeCallback(),
  44376. this
  44377. )
  44378. },
  44379. multiply: function (e, t) {
  44380. return void 0 !== t
  44381. ? (console.warn(
  44382. 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'
  44383. ),
  44384. this.multiplyQuaternions(e, t))
  44385. : this.multiplyQuaternions(this, e)
  44386. },
  44387. multiplyQuaternions: function (e, t) {
  44388. var i = e._x,
  44389. n = e._y,
  44390. r = e._z,
  44391. o = e._w,
  44392. a = t._x,
  44393. s = t._y,
  44394. l = t._z,
  44395. c = t._w
  44396. return (
  44397. (this._x = i * c + o * a + n * l - r * s),
  44398. (this._y = n * c + o * s + r * a - i * l),
  44399. (this._z = r * c + o * l + i * s - n * a),
  44400. (this._w = o * c - i * a - n * s - r * l),
  44401. this.onChangeCallback(),
  44402. this
  44403. )
  44404. },
  44405. slerp: function (e, t) {
  44406. if (0 === t) return this
  44407. if (1 === t) return this.copy(e)
  44408. var i = this._x,
  44409. n = this._y,
  44410. r = this._z,
  44411. o = this._w,
  44412. a = o * e._w + i * e._x + n * e._y + r * e._z
  44413. if (
  44414. (a < 0
  44415. ? ((this._w = -e._w),
  44416. (this._x = -e._x),
  44417. (this._y = -e._y),
  44418. (this._z = -e._z),
  44419. (a = -a))
  44420. : this.copy(e),
  44421. a >= 1)
  44422. )
  44423. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this
  44424. var s = Math.sqrt(1 - a * a)
  44425. if (Math.abs(s) < 0.001)
  44426. return (
  44427. (this._w = 0.5 * (o + this._w)),
  44428. (this._x = 0.5 * (i + this._x)),
  44429. (this._y = 0.5 * (n + this._y)),
  44430. (this._z = 0.5 * (r + this._z)),
  44431. this
  44432. )
  44433. var l = Math.atan2(s, a),
  44434. c = Math.sin((1 - t) * l) / s,
  44435. h = Math.sin(t * l) / s
  44436. return (
  44437. (this._w = o * c + this._w * h),
  44438. (this._x = i * c + this._x * h),
  44439. (this._y = n * c + this._y * h),
  44440. (this._z = r * c + this._z * h),
  44441. this.onChangeCallback(),
  44442. this
  44443. )
  44444. },
  44445. equals: function (e) {
  44446. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  44447. },
  44448. fromArray: function (e, t) {
  44449. return (
  44450. void 0 === t && (t = 0),
  44451. (this._x = e[t]),
  44452. (this._y = e[t + 1]),
  44453. (this._z = e[t + 2]),
  44454. (this._w = e[t + 3]),
  44455. this.onChangeCallback(),
  44456. this
  44457. )
  44458. },
  44459. toArray: function (e, t) {
  44460. return (
  44461. void 0 === e && (e = []),
  44462. void 0 === t && (t = 0),
  44463. (e[t] = this._x),
  44464. (e[t + 1] = this._y),
  44465. (e[t + 2] = this._z),
  44466. (e[t + 3] = this._w),
  44467. e
  44468. )
  44469. },
  44470. onChange: function (e) {
  44471. return (this.onChangeCallback = e), this
  44472. },
  44473. onChangeCallback: function () {}
  44474. }),
  44475. Object.assign(n.Quaternion, {
  44476. slerp: function (e, t, i, n) {
  44477. return i.copy(e).slerp(t, n)
  44478. },
  44479. slerpFlat: function (e, t, i, n, r, o, a) {
  44480. var s = i[n + 0],
  44481. l = i[n + 1],
  44482. c = i[n + 2],
  44483. h = i[n + 3],
  44484. u = r[o + 0],
  44485. d = r[o + 1],
  44486. p = r[o + 2],
  44487. f = r[o + 3]
  44488. if (h !== f || s !== u || l !== d || c !== p) {
  44489. var g = 1 - a,
  44490. m = s * u + l * d + c * p + h * f,
  44491. v = m >= 0 ? 1 : -1,
  44492. A = 1 - m * m
  44493. if (A > Number.EPSILON) {
  44494. var y = Math.sqrt(A),
  44495. C = Math.atan2(y, m * v)
  44496. ;(g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y)
  44497. }
  44498. var I = a * v
  44499. if (
  44500. ((s = s * g + u * I),
  44501. (l = l * g + d * I),
  44502. (c = c * g + p * I),
  44503. (h = h * g + f * I),
  44504. g === 1 - a)
  44505. ) {
  44506. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h)
  44507. ;(s *= E), (l *= E), (c *= E), (h *= E)
  44508. }
  44509. }
  44510. ;(e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h)
  44511. }
  44512. }),
  44513. (n.Vector2 = function (e, t) {
  44514. ;(this.x = e || 0), (this.y = t || 0)
  44515. }),
  44516. (n.Vector2.prototype = {
  44517. constructor: n.Vector2,
  44518. get width() {
  44519. return this.x
  44520. },
  44521. set width(e) {
  44522. this.x = e
  44523. },
  44524. get height() {
  44525. return this.y
  44526. },
  44527. set height(e) {
  44528. this.y = e
  44529. },
  44530. set: function (e, t) {
  44531. return (this.x = e), (this.y = t), this
  44532. },
  44533. setScalar: function (e) {
  44534. return (this.x = e), (this.y = e), this
  44535. },
  44536. setX: function (e) {
  44537. return (this.x = e), this
  44538. },
  44539. setY: function (e) {
  44540. return (this.y = e), this
  44541. },
  44542. setComponent: function (e, t) {
  44543. switch (e) {
  44544. case 0:
  44545. this.x = t
  44546. break
  44547. case 1:
  44548. this.y = t
  44549. break
  44550. default:
  44551. throw new Error('index is out of range: ' + e)
  44552. }
  44553. },
  44554. getComponent: function (e) {
  44555. switch (e) {
  44556. case 0:
  44557. return this.x
  44558. case 1:
  44559. return this.y
  44560. default:
  44561. throw new Error('index is out of range: ' + e)
  44562. }
  44563. },
  44564. clone: function () {
  44565. return new this.constructor(this.x, this.y)
  44566. },
  44567. copy: function (e) {
  44568. return (this.x = e.x), (this.y = e.y), this
  44569. },
  44570. add: function (e, t) {
  44571. return void 0 !== t
  44572. ? (console.warn(
  44573. 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44574. ),
  44575. this.addVectors(e, t))
  44576. : ((this.x += e.x), (this.y += e.y), this)
  44577. },
  44578. addScalar: function (e) {
  44579. return (this.x += e), (this.y += e), this
  44580. },
  44581. addVectors: function (e, t) {
  44582. return (this.x = e.x + t.x), (this.y = e.y + t.y), this
  44583. },
  44584. addScaledVector: function (e, t) {
  44585. return (this.x += e.x * t), (this.y += e.y * t), this
  44586. },
  44587. sub: function (e, t) {
  44588. return void 0 !== t
  44589. ? (console.warn(
  44590. 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44591. ),
  44592. this.subVectors(e, t))
  44593. : ((this.x -= e.x), (this.y -= e.y), this)
  44594. },
  44595. subScalar: function (e) {
  44596. return (this.x -= e), (this.y -= e), this
  44597. },
  44598. subVectors: function (e, t) {
  44599. return (this.x = e.x - t.x), (this.y = e.y - t.y), this
  44600. },
  44601. multiply: function (e) {
  44602. return (this.x *= e.x), (this.y *= e.y), this
  44603. },
  44604. multiplyScalar: function (e) {
  44605. return (
  44606. isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  44607. )
  44608. },
  44609. divide: function (e) {
  44610. return (this.x /= e.x), (this.y /= e.y), this
  44611. },
  44612. divideScalar: function (e) {
  44613. return this.multiplyScalar(1 / e)
  44614. },
  44615. min: function (e) {
  44616. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this
  44617. },
  44618. max: function (e) {
  44619. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this
  44620. },
  44621. clamp: function (e, t) {
  44622. return (
  44623. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44624. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44625. this
  44626. )
  44627. },
  44628. clampScalar: (function () {
  44629. var e, t
  44630. return function (i, r) {
  44631. return (
  44632. void 0 === e && ((e = new n.Vector2()), (t = new n.Vector2())),
  44633. e.set(i, i),
  44634. t.set(r, r),
  44635. this.clamp(e, t)
  44636. )
  44637. }
  44638. })(),
  44639. clampLength: function (e, t) {
  44640. var i = this.length()
  44641. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  44642. },
  44643. floor: function () {
  44644. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
  44645. },
  44646. ceil: function () {
  44647. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  44648. },
  44649. round: function () {
  44650. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
  44651. },
  44652. roundToZero: function () {
  44653. return (
  44654. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  44655. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  44656. this
  44657. )
  44658. },
  44659. negate: function () {
  44660. return (this.x = -this.x), (this.y = -this.y), this
  44661. },
  44662. dot: function (e) {
  44663. return this.x * e.x + this.y * e.y
  44664. },
  44665. lengthSq: function () {
  44666. return this.x * this.x + this.y * this.y
  44667. },
  44668. length: function () {
  44669. return Math.sqrt(this.x * this.x + this.y * this.y)
  44670. },
  44671. lengthManhattan: function () {
  44672. return Math.abs(this.x) + Math.abs(this.y)
  44673. },
  44674. normalize: function () {
  44675. return this.divideScalar(this.length())
  44676. },
  44677. angle: function () {
  44678. var e = Math.atan2(this.y, this.x)
  44679. return e < 0 && (e += 2 * Math.PI), e
  44680. },
  44681. distanceTo: function (e) {
  44682. return Math.sqrt(this.distanceToSquared(e))
  44683. },
  44684. distanceToSquared: function (e) {
  44685. var t = this.x - e.x,
  44686. i = this.y - e.y
  44687. return t * t + i * i
  44688. },
  44689. setLength: function (e) {
  44690. return this.multiplyScalar(e / this.length())
  44691. },
  44692. lerp: function (e, t) {
  44693. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this
  44694. },
  44695. lerpVectors: function (e, t, i) {
  44696. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  44697. },
  44698. equals: function (e) {
  44699. return e.x === this.x && e.y === this.y
  44700. },
  44701. fromArray: function (e, t) {
  44702. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this
  44703. },
  44704. toArray: function (e, t) {
  44705. return (
  44706. void 0 === e && (e = []),
  44707. void 0 === t && (t = 0),
  44708. (e[t] = this.x),
  44709. (e[t + 1] = this.y),
  44710. e
  44711. )
  44712. },
  44713. fromAttribute: function (e, t, i) {
  44714. return (
  44715. void 0 === i && (i = 0),
  44716. (t = t * e.itemSize + i),
  44717. (this.x = e.array[t]),
  44718. (this.y = e.array[t + 1]),
  44719. this
  44720. )
  44721. },
  44722. rotateAround: function (e, t) {
  44723. var i = Math.cos(t),
  44724. n = Math.sin(t),
  44725. r = this.x - e.x,
  44726. o = this.y - e.y
  44727. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this
  44728. }
  44729. }),
  44730. (n.Vector3 = function (e, t, i) {
  44731. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  44732. }),
  44733. (n.Vector3.prototype = {
  44734. constructor: n.Vector3,
  44735. set: function (e, t, i) {
  44736. return (this.x = e), (this.y = t), (this.z = i), this
  44737. },
  44738. setScalar: function (e) {
  44739. return (this.x = e), (this.y = e), (this.z = e), this
  44740. },
  44741. setX: function (e) {
  44742. return (this.x = e), this
  44743. },
  44744. setY: function (e) {
  44745. return (this.y = e), this
  44746. },
  44747. setZ: function (e) {
  44748. return (this.z = e), this
  44749. },
  44750. setComponent: function (e, t) {
  44751. switch (e) {
  44752. case 0:
  44753. this.x = t
  44754. break
  44755. case 1:
  44756. this.y = t
  44757. break
  44758. case 2:
  44759. this.z = t
  44760. break
  44761. default:
  44762. throw new Error('index is out of range: ' + e)
  44763. }
  44764. },
  44765. getComponent: function (e) {
  44766. switch (e) {
  44767. case 0:
  44768. return this.x
  44769. case 1:
  44770. return this.y
  44771. case 2:
  44772. return this.z
  44773. default:
  44774. throw new Error('index is out of range: ' + e)
  44775. }
  44776. },
  44777. clone: function () {
  44778. return new this.constructor(this.x, this.y, this.z)
  44779. },
  44780. copy: function (e) {
  44781. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this
  44782. },
  44783. add: function (e, t) {
  44784. return void 0 !== t
  44785. ? (console.warn(
  44786. 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44787. ),
  44788. this.addVectors(e, t))
  44789. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
  44790. },
  44791. addScalar: function (e) {
  44792. return (this.x += e), (this.y += e), (this.z += e), this
  44793. },
  44794. addVectors: function (e, t) {
  44795. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this
  44796. },
  44797. addScaledVector: function (e, t) {
  44798. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this
  44799. },
  44800. sub: function (e, t) {
  44801. return void 0 !== t
  44802. ? (console.warn(
  44803. 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44804. ),
  44805. this.subVectors(e, t))
  44806. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
  44807. },
  44808. subScalar: function (e) {
  44809. return (this.x -= e), (this.y -= e), (this.z -= e), this
  44810. },
  44811. subVectors: function (e, t) {
  44812. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this
  44813. },
  44814. multiply: function (e, t) {
  44815. return void 0 !== t
  44816. ? (console.warn(
  44817. 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'
  44818. ),
  44819. this.multiplyVectors(e, t))
  44820. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
  44821. },
  44822. multiplyScalar: function (e) {
  44823. return (
  44824. isFinite(e)
  44825. ? ((this.x *= e), (this.y *= e), (this.z *= e))
  44826. : ((this.x = 0), (this.y = 0), (this.z = 0)),
  44827. this
  44828. )
  44829. },
  44830. multiplyVectors: function (e, t) {
  44831. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this
  44832. },
  44833. applyEuler: (function () {
  44834. var e
  44835. return function (t) {
  44836. return (
  44837. t instanceof n.Euler == !1 &&
  44838. console.error(
  44839. 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'
  44840. ),
  44841. void 0 === e && (e = new n.Quaternion()),
  44842. this.applyQuaternion(e.setFromEuler(t)),
  44843. this
  44844. )
  44845. }
  44846. })(),
  44847. applyAxisAngle: (function () {
  44848. var e
  44849. return function (t, i) {
  44850. return (
  44851. void 0 === e && (e = new n.Quaternion()),
  44852. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  44853. this
  44854. )
  44855. }
  44856. })(),
  44857. applyMatrix3: function (e) {
  44858. var t = this.x,
  44859. i = this.y,
  44860. n = this.z,
  44861. r = e.elements
  44862. return (
  44863. (this.x = r[0] * t + r[3] * i + r[6] * n),
  44864. (this.y = r[1] * t + r[4] * i + r[7] * n),
  44865. (this.z = r[2] * t + r[5] * i + r[8] * n),
  44866. this
  44867. )
  44868. },
  44869. applyMatrix4: function (e) {
  44870. var t = this.x,
  44871. i = this.y,
  44872. n = this.z,
  44873. r = e.elements
  44874. return (
  44875. (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  44876. (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  44877. (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  44878. this
  44879. )
  44880. },
  44881. applyProjection: function (e) {
  44882. var t = this.x,
  44883. i = this.y,
  44884. n = this.z,
  44885. r = e.elements,
  44886. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15])
  44887. return (
  44888. (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o),
  44889. (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o),
  44890. (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o),
  44891. this
  44892. )
  44893. },
  44894. applyQuaternion: function (e) {
  44895. var t = this.x,
  44896. i = this.y,
  44897. n = this.z,
  44898. r = e.x,
  44899. o = e.y,
  44900. a = e.z,
  44901. s = e.w,
  44902. l = s * t + o * n - a * i,
  44903. c = s * i + a * t - r * n,
  44904. h = s * n + r * i - o * t,
  44905. u = -r * t - o * i - a * n
  44906. return (
  44907. (this.x = l * s + u * -r + c * -a - h * -o),
  44908. (this.y = c * s + u * -o + h * -r - l * -a),
  44909. (this.z = h * s + u * -a + l * -o - c * -r),
  44910. this
  44911. )
  44912. },
  44913. project: (function () {
  44914. var e
  44915. return function (t) {
  44916. return (
  44917. void 0 === e && (e = new n.Matrix4()),
  44918. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  44919. this.applyProjection(e)
  44920. )
  44921. }
  44922. })(),
  44923. unproject: (function () {
  44924. var e
  44925. return function (t) {
  44926. return (
  44927. void 0 === e && (e = new n.Matrix4()),
  44928. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  44929. this.applyProjection(e)
  44930. )
  44931. }
  44932. })(),
  44933. transformDirection: function (e) {
  44934. var t = this.x,
  44935. i = this.y,
  44936. n = this.z,
  44937. r = e.elements
  44938. return (
  44939. (this.x = r[0] * t + r[4] * i + r[8] * n),
  44940. (this.y = r[1] * t + r[5] * i + r[9] * n),
  44941. (this.z = r[2] * t + r[6] * i + r[10] * n),
  44942. this.normalize(),
  44943. this
  44944. )
  44945. },
  44946. divide: function (e) {
  44947. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this
  44948. },
  44949. divideScalar: function (e) {
  44950. return this.multiplyScalar(1 / e)
  44951. },
  44952. min: function (e) {
  44953. return (
  44954. (this.x = Math.min(this.x, e.x)),
  44955. (this.y = Math.min(this.y, e.y)),
  44956. (this.z = Math.min(this.z, e.z)),
  44957. this
  44958. )
  44959. },
  44960. max: function (e) {
  44961. return (
  44962. (this.x = Math.max(this.x, e.x)),
  44963. (this.y = Math.max(this.y, e.y)),
  44964. (this.z = Math.max(this.z, e.z)),
  44965. this
  44966. )
  44967. },
  44968. clamp: function (e, t) {
  44969. return (
  44970. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44971. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44972. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  44973. this
  44974. )
  44975. },
  44976. clampScalar: (function () {
  44977. var e, t
  44978. return function (i, r) {
  44979. return (
  44980. void 0 === e && ((e = new n.Vector3()), (t = new n.Vector3())),
  44981. e.set(i, i, i),
  44982. t.set(r, r, r),
  44983. this.clamp(e, t)
  44984. )
  44985. }
  44986. })(),
  44987. clampLength: function (e, t) {
  44988. var i = this.length()
  44989. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  44990. },
  44991. floor: function () {
  44992. return (
  44993. (this.x = Math.floor(this.x)),
  44994. (this.y = Math.floor(this.y)),
  44995. (this.z = Math.floor(this.z)),
  44996. this
  44997. )
  44998. },
  44999. ceil: function () {
  45000. return (
  45001. (this.x = Math.ceil(this.x)),
  45002. (this.y = Math.ceil(this.y)),
  45003. (this.z = Math.ceil(this.z)),
  45004. this
  45005. )
  45006. },
  45007. round: function () {
  45008. return (
  45009. (this.x = Math.round(this.x)),
  45010. (this.y = Math.round(this.y)),
  45011. (this.z = Math.round(this.z)),
  45012. this
  45013. )
  45014. },
  45015. roundToZero: function () {
  45016. return (
  45017. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  45018. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  45019. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  45020. this
  45021. )
  45022. },
  45023. negate: function () {
  45024. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  45025. },
  45026. dot: function (e) {
  45027. return this.x * e.x + this.y * e.y + this.z * e.z
  45028. },
  45029. lengthSq: function () {
  45030. return this.x * this.x + this.y * this.y + this.z * this.z
  45031. },
  45032. length: function () {
  45033. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  45034. },
  45035. lengthManhattan: function () {
  45036. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  45037. },
  45038. normalize: function () {
  45039. return this.divideScalar(this.length())
  45040. },
  45041. setLength: function (e) {
  45042. return this.multiplyScalar(e / this.length())
  45043. },
  45044. lerp: function (e, t) {
  45045. return (
  45046. (this.x += (e.x - this.x) * t),
  45047. (this.y += (e.y - this.y) * t),
  45048. (this.z += (e.z - this.z) * t),
  45049. this
  45050. )
  45051. },
  45052. lerpVectors: function (e, t, i) {
  45053. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  45054. },
  45055. cross: function (e, t) {
  45056. if (void 0 !== t)
  45057. return (
  45058. console.warn(
  45059. 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'
  45060. ),
  45061. this.crossVectors(e, t)
  45062. )
  45063. var i = this.x,
  45064. n = this.y,
  45065. r = this.z
  45066. return (
  45067. (this.x = n * e.z - r * e.y),
  45068. (this.y = r * e.x - i * e.z),
  45069. (this.z = i * e.y - n * e.x),
  45070. this
  45071. )
  45072. },
  45073. crossVectors: function (e, t) {
  45074. var i = e.x,
  45075. n = e.y,
  45076. r = e.z,
  45077. o = t.x,
  45078. a = t.y,
  45079. s = t.z
  45080. return (
  45081. (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  45082. )
  45083. },
  45084. projectOnVector: (function () {
  45085. var e, t
  45086. return function (i) {
  45087. return (
  45088. void 0 === e && (e = new n.Vector3()),
  45089. e.copy(i).normalize(),
  45090. (t = this.dot(e)),
  45091. this.copy(e).multiplyScalar(t)
  45092. )
  45093. }
  45094. })(),
  45095. projectOnPlane: (function () {
  45096. var e
  45097. return function (t) {
  45098. return (
  45099. void 0 === e && (e = new n.Vector3()),
  45100. e.copy(this).projectOnVector(t),
  45101. this.sub(e)
  45102. )
  45103. }
  45104. })(),
  45105. reflect: (function () {
  45106. var e
  45107. return function (t) {
  45108. return (
  45109. void 0 === e && (e = new n.Vector3()),
  45110. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  45111. )
  45112. }
  45113. })(),
  45114. angleTo: function (e) {
  45115. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq())
  45116. return Math.acos(n.Math.clamp(t, -1, 1))
  45117. },
  45118. distanceTo: function (e) {
  45119. return Math.sqrt(this.distanceToSquared(e))
  45120. },
  45121. distanceToSquared: function (e) {
  45122. var t = this.x - e.x,
  45123. i = this.y - e.y,
  45124. n = this.z - e.z
  45125. return t * t + i * i + n * n
  45126. },
  45127. setFromSpherical: function (e) {
  45128. var t = Math.sin(e.phi) * e.radius
  45129. return (
  45130. (this.x = t * Math.sin(e.theta)),
  45131. (this.y = Math.cos(e.phi) * e.radius),
  45132. (this.z = t * Math.cos(e.theta)),
  45133. this
  45134. )
  45135. },
  45136. setFromMatrixPosition: function (e) {
  45137. return this.setFromMatrixColumn(e, 3)
  45138. },
  45139. setFromMatrixScale: function (e) {
  45140. var t = this.setFromMatrixColumn(e, 0).length(),
  45141. i = this.setFromMatrixColumn(e, 1).length(),
  45142. n = this.setFromMatrixColumn(e, 2).length()
  45143. return (this.x = t), (this.y = i), (this.z = n), this
  45144. },
  45145. setFromMatrixColumn: function (e, t) {
  45146. return (
  45147. 'number' == typeof e &&
  45148. (console.warn(
  45149. 'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'
  45150. ),
  45151. (e = arguments[1]),
  45152. (t = arguments[0])),
  45153. this.fromArray(e.elements, 4 * t)
  45154. )
  45155. },
  45156. equals: function (e) {
  45157. return e.x === this.x && e.y === this.y && e.z === this.z
  45158. },
  45159. fromArray: function (e, t) {
  45160. return (
  45161. void 0 === t && (t = 0),
  45162. (this.x = e[t]),
  45163. (this.y = e[t + 1]),
  45164. (this.z = e[t + 2]),
  45165. this
  45166. )
  45167. },
  45168. toArray: function (e, t) {
  45169. return (
  45170. void 0 === e && (e = []),
  45171. void 0 === t && (t = 0),
  45172. (e[t] = this.x),
  45173. (e[t + 1] = this.y),
  45174. (e[t + 2] = this.z),
  45175. e
  45176. )
  45177. },
  45178. fromAttribute: function (e, t, i) {
  45179. return (
  45180. void 0 === i && (i = 0),
  45181. (t = t * e.itemSize + i),
  45182. (this.x = e.array[t]),
  45183. (this.y = e.array[t + 1]),
  45184. (this.z = e.array[t + 2]),
  45185. this
  45186. )
  45187. }
  45188. }),
  45189. (n.Vector4 = function (e, t, i, n) {
  45190. ;(this.x = e || 0),
  45191. (this.y = t || 0),
  45192. (this.z = i || 0),
  45193. (this.w = void 0 !== n ? n : 1)
  45194. }),
  45195. (n.Vector4.prototype = {
  45196. constructor: n.Vector4,
  45197. set: function (e, t, i, n) {
  45198. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  45199. },
  45200. setScalar: function (e) {
  45201. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  45202. },
  45203. setX: function (e) {
  45204. return (this.x = e), this
  45205. },
  45206. setY: function (e) {
  45207. return (this.y = e), this
  45208. },
  45209. setZ: function (e) {
  45210. return (this.z = e), this
  45211. },
  45212. setW: function (e) {
  45213. return (this.w = e), this
  45214. },
  45215. setComponent: function (e, t) {
  45216. switch (e) {
  45217. case 0:
  45218. this.x = t
  45219. break
  45220. case 1:
  45221. this.y = t
  45222. break
  45223. case 2:
  45224. this.z = t
  45225. break
  45226. case 3:
  45227. this.w = t
  45228. break
  45229. default:
  45230. throw new Error('index is out of range: ' + e)
  45231. }
  45232. },
  45233. getComponent: function (e) {
  45234. switch (e) {
  45235. case 0:
  45236. return this.x
  45237. case 1:
  45238. return this.y
  45239. case 2:
  45240. return this.z
  45241. case 3:
  45242. return this.w
  45243. default:
  45244. throw new Error('index is out of range: ' + e)
  45245. }
  45246. },
  45247. clone: function () {
  45248. return new this.constructor(this.x, this.y, this.z, this.w)
  45249. },
  45250. copy: function (e) {
  45251. return (
  45252. (this.x = e.x),
  45253. (this.y = e.y),
  45254. (this.z = e.z),
  45255. (this.w = void 0 !== e.w ? e.w : 1),
  45256. this
  45257. )
  45258. },
  45259. add: function (e, t) {
  45260. return void 0 !== t
  45261. ? (console.warn(
  45262. 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  45263. ),
  45264. this.addVectors(e, t))
  45265. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this)
  45266. },
  45267. addScalar: function (e) {
  45268. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  45269. },
  45270. addVectors: function (e, t) {
  45271. return (
  45272. (this.x = e.x + t.x),
  45273. (this.y = e.y + t.y),
  45274. (this.z = e.z + t.z),
  45275. (this.w = e.w + t.w),
  45276. this
  45277. )
  45278. },
  45279. addScaledVector: function (e, t) {
  45280. return (
  45281. (this.x += e.x * t),
  45282. (this.y += e.y * t),
  45283. (this.z += e.z * t),
  45284. (this.w += e.w * t),
  45285. this
  45286. )
  45287. },
  45288. sub: function (e, t) {
  45289. return void 0 !== t
  45290. ? (console.warn(
  45291. 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  45292. ),
  45293. this.subVectors(e, t))
  45294. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this)
  45295. },
  45296. subScalar: function (e) {
  45297. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  45298. },
  45299. subVectors: function (e, t) {
  45300. return (
  45301. (this.x = e.x - t.x),
  45302. (this.y = e.y - t.y),
  45303. (this.z = e.z - t.z),
  45304. (this.w = e.w - t.w),
  45305. this
  45306. )
  45307. },
  45308. multiplyScalar: function (e) {
  45309. return (
  45310. isFinite(e)
  45311. ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e))
  45312. : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)),
  45313. this
  45314. )
  45315. },
  45316. applyMatrix4: function (e) {
  45317. var t = this.x,
  45318. i = this.y,
  45319. n = this.z,
  45320. r = this.w,
  45321. o = e.elements
  45322. return (
  45323. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  45324. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  45325. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  45326. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  45327. this
  45328. )
  45329. },
  45330. divideScalar: function (e) {
  45331. return this.multiplyScalar(1 / e)
  45332. },
  45333. setAxisAngleFromQuaternion: function (e) {
  45334. this.w = 2 * Math.acos(e.w)
  45335. var t = Math.sqrt(1 - e.w * e.w)
  45336. return (
  45337. t < 1e-4
  45338. ? ((this.x = 1), (this.y = 0), (this.z = 0))
  45339. : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)),
  45340. this
  45341. )
  45342. },
  45343. setAxisAngleFromRotationMatrix: function (e) {
  45344. var t,
  45345. i,
  45346. n,
  45347. r,
  45348. o = 0.01,
  45349. a = 0.1,
  45350. s = e.elements,
  45351. l = s[0],
  45352. c = s[4],
  45353. h = s[8],
  45354. u = s[1],
  45355. d = s[5],
  45356. p = s[9],
  45357. f = s[2],
  45358. g = s[6],
  45359. m = s[10]
  45360. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  45361. if (
  45362. Math.abs(c + u) < a &&
  45363. Math.abs(h + f) < a &&
  45364. Math.abs(p + g) < a &&
  45365. Math.abs(l + d + m - 3) < a
  45366. )
  45367. return this.set(1, 0, 0, 0), this
  45368. t = Math.PI
  45369. var v = (l + 1) / 2,
  45370. A = (d + 1) / 2,
  45371. y = (m + 1) / 2,
  45372. C = (c + u) / 4,
  45373. I = (h + f) / 4,
  45374. E = (p + g) / 4
  45375. return (
  45376. v > A && v > y
  45377. ? v < o
  45378. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  45379. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  45380. : A > y
  45381. ? A < o
  45382. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  45383. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  45384. : y < o
  45385. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  45386. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  45387. this.set(i, n, r, t),
  45388. this
  45389. )
  45390. }
  45391. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c))
  45392. return (
  45393. Math.abs(b) < 0.001 && (b = 1),
  45394. (this.x = (g - p) / b),
  45395. (this.y = (h - f) / b),
  45396. (this.z = (u - c) / b),
  45397. (this.w = Math.acos((l + d + m - 1) / 2)),
  45398. this
  45399. )
  45400. },
  45401. min: function (e) {
  45402. return (
  45403. (this.x = Math.min(this.x, e.x)),
  45404. (this.y = Math.min(this.y, e.y)),
  45405. (this.z = Math.min(this.z, e.z)),
  45406. (this.w = Math.min(this.w, e.w)),
  45407. this
  45408. )
  45409. },
  45410. max: function (e) {
  45411. return (
  45412. (this.x = Math.max(this.x, e.x)),
  45413. (this.y = Math.max(this.y, e.y)),
  45414. (this.z = Math.max(this.z, e.z)),
  45415. (this.w = Math.max(this.w, e.w)),
  45416. this
  45417. )
  45418. },
  45419. clamp: function (e, t) {
  45420. return (
  45421. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  45422. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  45423. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  45424. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  45425. this
  45426. )
  45427. },
  45428. clampScalar: (function () {
  45429. var e, t
  45430. return function (i, r) {
  45431. return (
  45432. void 0 === e && ((e = new n.Vector4()), (t = new n.Vector4())),
  45433. e.set(i, i, i, i),
  45434. t.set(r, r, r, r),
  45435. this.clamp(e, t)
  45436. )
  45437. }
  45438. })(),
  45439. floor: function () {
  45440. return (
  45441. (this.x = Math.floor(this.x)),
  45442. (this.y = Math.floor(this.y)),
  45443. (this.z = Math.floor(this.z)),
  45444. (this.w = Math.floor(this.w)),
  45445. this
  45446. )
  45447. },
  45448. ceil: function () {
  45449. return (
  45450. (this.x = Math.ceil(this.x)),
  45451. (this.y = Math.ceil(this.y)),
  45452. (this.z = Math.ceil(this.z)),
  45453. (this.w = Math.ceil(this.w)),
  45454. this
  45455. )
  45456. },
  45457. round: function () {
  45458. return (
  45459. (this.x = Math.round(this.x)),
  45460. (this.y = Math.round(this.y)),
  45461. (this.z = Math.round(this.z)),
  45462. (this.w = Math.round(this.w)),
  45463. this
  45464. )
  45465. },
  45466. roundToZero: function () {
  45467. return (
  45468. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  45469. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  45470. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  45471. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  45472. this
  45473. )
  45474. },
  45475. negate: function () {
  45476. return (
  45477. (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  45478. )
  45479. },
  45480. dot: function (e) {
  45481. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  45482. },
  45483. lengthSq: function () {
  45484. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  45485. },
  45486. length: function () {
  45487. return Math.sqrt(
  45488. this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  45489. )
  45490. },
  45491. lengthManhattan: function () {
  45492. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  45493. },
  45494. normalize: function () {
  45495. return this.divideScalar(this.length())
  45496. },
  45497. setLength: function (e) {
  45498. return this.multiplyScalar(e / this.length())
  45499. },
  45500. lerp: function (e, t) {
  45501. return (
  45502. (this.x += (e.x - this.x) * t),
  45503. (this.y += (e.y - this.y) * t),
  45504. (this.z += (e.z - this.z) * t),
  45505. (this.w += (e.w - this.w) * t),
  45506. this
  45507. )
  45508. },
  45509. lerpVectors: function (e, t, i) {
  45510. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  45511. },
  45512. equals: function (e) {
  45513. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  45514. },
  45515. fromArray: function (e, t) {
  45516. return (
  45517. void 0 === t && (t = 0),
  45518. (this.x = e[t]),
  45519. (this.y = e[t + 1]),
  45520. (this.z = e[t + 2]),
  45521. (this.w = e[t + 3]),
  45522. this
  45523. )
  45524. },
  45525. toArray: function (e, t) {
  45526. return (
  45527. void 0 === e && (e = []),
  45528. void 0 === t && (t = 0),
  45529. (e[t] = this.x),
  45530. (e[t + 1] = this.y),
  45531. (e[t + 2] = this.z),
  45532. (e[t + 3] = this.w),
  45533. e
  45534. )
  45535. },
  45536. fromAttribute: function (e, t, i) {
  45537. return (
  45538. void 0 === i && (i = 0),
  45539. (t = t * e.itemSize + i),
  45540. (this.x = e.array[t]),
  45541. (this.y = e.array[t + 1]),
  45542. (this.z = e.array[t + 2]),
  45543. (this.w = e.array[t + 3]),
  45544. this
  45545. )
  45546. }
  45547. }),
  45548. (n.Euler = function (e, t, i, r) {
  45549. ;(this._x = e || 0),
  45550. (this._y = t || 0),
  45551. (this._z = i || 0),
  45552. (this._order = r || n.Euler.DefaultOrder)
  45553. }),
  45554. (n.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  45555. (n.Euler.DefaultOrder = 'XYZ'),
  45556. (n.Euler.prototype = {
  45557. constructor: n.Euler,
  45558. get x() {
  45559. return this._x
  45560. },
  45561. set x(e) {
  45562. ;(this._x = e), this.onChangeCallback()
  45563. },
  45564. get y() {
  45565. return this._y
  45566. },
  45567. set y(e) {
  45568. ;(this._y = e), this.onChangeCallback()
  45569. },
  45570. get z() {
  45571. return this._z
  45572. },
  45573. set z(e) {
  45574. ;(this._z = e), this.onChangeCallback()
  45575. },
  45576. get order() {
  45577. return this._order
  45578. },
  45579. set order(e) {
  45580. ;(this._order = e), this.onChangeCallback()
  45581. },
  45582. set: function (e, t, i, n) {
  45583. return (
  45584. (this._x = e),
  45585. (this._y = t),
  45586. (this._z = i),
  45587. (this._order = n || this._order),
  45588. this.onChangeCallback(),
  45589. this
  45590. )
  45591. },
  45592. clone: function () {
  45593. return new this.constructor(this._x, this._y, this._z, this._order)
  45594. },
  45595. copy: function (e) {
  45596. return (
  45597. (this._x = e._x),
  45598. (this._y = e._y),
  45599. (this._z = e._z),
  45600. (this._order = e._order),
  45601. this.onChangeCallback(),
  45602. this
  45603. )
  45604. },
  45605. setFromRotationMatrix: function (e, t, i) {
  45606. var r = n.Math.clamp,
  45607. o = e.elements,
  45608. a = o[0],
  45609. s = o[4],
  45610. l = o[8],
  45611. c = o[1],
  45612. h = o[5],
  45613. u = o[9],
  45614. d = o[2],
  45615. p = o[6],
  45616. f = o[10]
  45617. return (
  45618. (t = t || this._order),
  45619. 'XYZ' === t
  45620. ? ((this._y = Math.asin(r(l, -1, 1))),
  45621. Math.abs(l) < 0.99999
  45622. ? ((this._x = Math.atan2(-u, f)), (this._z = Math.atan2(-s, a)))
  45623. : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  45624. : 'YXZ' === t
  45625. ? ((this._x = Math.asin(-r(u, -1, 1))),
  45626. Math.abs(u) < 0.99999
  45627. ? ((this._y = Math.atan2(l, f)), (this._z = Math.atan2(c, h)))
  45628. : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  45629. : 'ZXY' === t
  45630. ? ((this._x = Math.asin(r(p, -1, 1))),
  45631. Math.abs(p) < 0.99999
  45632. ? ((this._y = Math.atan2(-d, f)), (this._z = Math.atan2(-s, h)))
  45633. : ((this._y = 0), (this._z = Math.atan2(c, a))))
  45634. : 'ZYX' === t
  45635. ? ((this._y = Math.asin(-r(d, -1, 1))),
  45636. Math.abs(d) < 0.99999
  45637. ? ((this._x = Math.atan2(p, f)), (this._z = Math.atan2(c, a)))
  45638. : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  45639. : 'YZX' === t
  45640. ? ((this._z = Math.asin(r(c, -1, 1))),
  45641. Math.abs(c) < 0.99999
  45642. ? ((this._x = Math.atan2(-u, h)), (this._y = Math.atan2(-d, a)))
  45643. : ((this._x = 0), (this._y = Math.atan2(l, f))))
  45644. : 'XZY' === t
  45645. ? ((this._z = Math.asin(-r(s, -1, 1))),
  45646. Math.abs(s) < 0.99999
  45647. ? ((this._x = Math.atan2(p, h)), (this._y = Math.atan2(l, a)))
  45648. : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  45649. : console.warn(
  45650. 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t
  45651. ),
  45652. (this._order = t),
  45653. i !== !1 && this.onChangeCallback(),
  45654. this
  45655. )
  45656. },
  45657. setFromQuaternion: (function () {
  45658. var e
  45659. return function (t, i, r) {
  45660. return (
  45661. void 0 === e && (e = new n.Matrix4()),
  45662. e.makeRotationFromQuaternion(t),
  45663. this.setFromRotationMatrix(e, i, r),
  45664. this
  45665. )
  45666. }
  45667. })(),
  45668. setFromVector3: function (e, t) {
  45669. return this.set(e.x, e.y, e.z, t || this._order)
  45670. },
  45671. reorder: (function () {
  45672. var e = new n.Quaternion()
  45673. return function (t) {
  45674. e.setFromEuler(this), this.setFromQuaternion(e, t)
  45675. }
  45676. })(),
  45677. equals: function (e) {
  45678. return (
  45679. e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  45680. )
  45681. },
  45682. fromArray: function (e) {
  45683. return (
  45684. (this._x = e[0]),
  45685. (this._y = e[1]),
  45686. (this._z = e[2]),
  45687. void 0 !== e[3] && (this._order = e[3]),
  45688. this.onChangeCallback(),
  45689. this
  45690. )
  45691. },
  45692. toArray: function (e, t) {
  45693. return (
  45694. void 0 === e && (e = []),
  45695. void 0 === t && (t = 0),
  45696. (e[t] = this._x),
  45697. (e[t + 1] = this._y),
  45698. (e[t + 2] = this._z),
  45699. (e[t + 3] = this._order),
  45700. e
  45701. )
  45702. },
  45703. toVector3: function (e) {
  45704. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x, this._y, this._z)
  45705. },
  45706. onChange: function (e) {
  45707. return (this.onChangeCallback = e), this
  45708. },
  45709. onChangeCallback: function () {}
  45710. }),
  45711. (n.Line3 = function (e, t) {
  45712. ;(this.start = void 0 !== e ? e : new n.Vector3()),
  45713. (this.end = void 0 !== t ? t : new n.Vector3())
  45714. }),
  45715. (n.Line3.prototype = {
  45716. constructor: n.Line3,
  45717. set: function (e, t) {
  45718. return this.start.copy(e), this.end.copy(t), this
  45719. },
  45720. clone: function () {
  45721. return new this.constructor().copy(this)
  45722. },
  45723. copy: function (e) {
  45724. return this.start.copy(e.start), this.end.copy(e.end), this
  45725. },
  45726. center: function (e) {
  45727. var t = e || new n.Vector3()
  45728. return t.addVectors(this.start, this.end).multiplyScalar(0.5)
  45729. },
  45730. delta: function (e) {
  45731. var t = e || new n.Vector3()
  45732. return t.subVectors(this.end, this.start)
  45733. },
  45734. distanceSq: function () {
  45735. return this.start.distanceToSquared(this.end)
  45736. },
  45737. distance: function () {
  45738. return this.start.distanceTo(this.end)
  45739. },
  45740. at: function (e, t) {
  45741. var i = t || new n.Vector3()
  45742. return this.delta(i).multiplyScalar(e).add(this.start)
  45743. },
  45744. closestPointToPointParameter: (function () {
  45745. var e = new n.Vector3(),
  45746. t = new n.Vector3()
  45747. return function (i, r) {
  45748. e.subVectors(i, this.start), t.subVectors(this.end, this.start)
  45749. var o = t.dot(t),
  45750. a = t.dot(e),
  45751. s = a / o
  45752. return r && (s = n.Math.clamp(s, 0, 1)), s
  45753. }
  45754. })(),
  45755. closestPointToPoint: function (e, t, i) {
  45756. var r = this.closestPointToPointParameter(e, t),
  45757. o = i || new n.Vector3()
  45758. return this.delta(o).multiplyScalar(r).add(this.start)
  45759. },
  45760. applyMatrix4: function (e) {
  45761. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
  45762. },
  45763. equals: function (e) {
  45764. return e.start.equals(this.start) && e.end.equals(this.end)
  45765. }
  45766. }),
  45767. (n.Box2 = function (e, t) {
  45768. ;(this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))),
  45769. (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)))
  45770. }),
  45771. (n.Box2.prototype = {
  45772. constructor: n.Box2,
  45773. set: function (e, t) {
  45774. return this.min.copy(e), this.max.copy(t), this
  45775. },
  45776. setFromPoints: function (e) {
  45777. this.makeEmpty()
  45778. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  45779. return this
  45780. },
  45781. setFromCenterAndSize: (function () {
  45782. var e = new n.Vector2()
  45783. return function (t, i) {
  45784. var n = e.copy(i).multiplyScalar(0.5)
  45785. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  45786. }
  45787. })(),
  45788. clone: function () {
  45789. return new this.constructor().copy(this)
  45790. },
  45791. copy: function (e) {
  45792. return this.min.copy(e.min), this.max.copy(e.max), this
  45793. },
  45794. makeEmpty: function () {
  45795. return (
  45796. (this.min.x = this.min.y = +(1 / 0)), (this.max.x = this.max.y = -(1 / 0)), this
  45797. )
  45798. },
  45799. isEmpty: function () {
  45800. return this.max.x < this.min.x || this.max.y < this.min.y
  45801. },
  45802. center: function (e) {
  45803. var t = e || new n.Vector2()
  45804. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  45805. },
  45806. size: function (e) {
  45807. var t = e || new n.Vector2()
  45808. return t.subVectors(this.max, this.min)
  45809. },
  45810. expandByPoint: function (e) {
  45811. return this.min.min(e), this.max.max(e), this
  45812. },
  45813. expandByVector: function (e) {
  45814. return this.min.sub(e), this.max.add(e), this
  45815. },
  45816. expandByScalar: function (e) {
  45817. return this.min.addScalar(-e), this.max.addScalar(e), this
  45818. },
  45819. containsPoint: function (e) {
  45820. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  45821. },
  45822. containsBox: function (e) {
  45823. return (
  45824. this.min.x <= e.min.x &&
  45825. e.max.x <= this.max.x &&
  45826. this.min.y <= e.min.y &&
  45827. e.max.y <= this.max.y
  45828. )
  45829. },
  45830. getParameter: function (e, t) {
  45831. var i = t || new n.Vector2()
  45832. return i.set(
  45833. (e.x - this.min.x) / (this.max.x - this.min.x),
  45834. (e.y - this.min.y) / (this.max.y - this.min.y)
  45835. )
  45836. },
  45837. intersectsBox: function (e) {
  45838. return !(
  45839. e.max.x < this.min.x ||
  45840. e.min.x > this.max.x ||
  45841. e.max.y < this.min.y ||
  45842. e.min.y > this.max.y
  45843. )
  45844. },
  45845. clampPoint: function (e, t) {
  45846. var i = t || new n.Vector2()
  45847. return i.copy(e).clamp(this.min, this.max)
  45848. },
  45849. distanceToPoint: (function () {
  45850. var e = new n.Vector2()
  45851. return function (t) {
  45852. var i = e.copy(t).clamp(this.min, this.max)
  45853. return i.sub(t).length()
  45854. }
  45855. })(),
  45856. intersect: function (e) {
  45857. return this.min.max(e.min), this.max.min(e.max), this
  45858. },
  45859. union: function (e) {
  45860. return this.min.min(e.min), this.max.max(e.max), this
  45861. },
  45862. translate: function (e) {
  45863. return this.min.add(e), this.max.add(e), this
  45864. },
  45865. equals: function (e) {
  45866. return e.min.equals(this.min) && e.max.equals(this.max)
  45867. }
  45868. }),
  45869. (n.Box3 = function (e, t) {
  45870. ;(this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))),
  45871. (this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)))
  45872. }),
  45873. (n.Box3.prototype = {
  45874. constructor: n.Box3,
  45875. set: function (e, t) {
  45876. return this.min.copy(e), this.max.copy(t), this
  45877. },
  45878. setFromArray: function (e) {
  45879. this.makeEmpty()
  45880. for (
  45881. var t = +(1 / 0),
  45882. i = +(1 / 0),
  45883. n = +(1 / 0),
  45884. r = -(1 / 0),
  45885. o = -(1 / 0),
  45886. a = -(1 / 0),
  45887. s = 0,
  45888. l = e.length;
  45889. s < l;
  45890. s += 3
  45891. ) {
  45892. var c = e[s],
  45893. h = e[s + 1],
  45894. u = e[s + 2]
  45895. c < t && (t = c),
  45896. h < i && (i = h),
  45897. u < n && (n = u),
  45898. c > r && (r = c),
  45899. h > o && (o = h),
  45900. u > a && (a = u)
  45901. }
  45902. this.min.set(t, i, n), this.max.set(r, o, a)
  45903. },
  45904. setFromPoints: function (e) {
  45905. this.makeEmpty()
  45906. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  45907. return this
  45908. },
  45909. setFromCenterAndSize: (function () {
  45910. var e = new n.Vector3()
  45911. return function (t, i) {
  45912. var n = e.copy(i).multiplyScalar(0.5)
  45913. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  45914. }
  45915. })(),
  45916. setFromObject: (function () {
  45917. var e
  45918. return function (t) {
  45919. void 0 === e && (e = new n.Box3())
  45920. var i = this
  45921. return (
  45922. this.makeEmpty(),
  45923. t.updateMatrixWorld(!0),
  45924. t.traverse(function (t) {
  45925. var n = t.geometry
  45926. void 0 !== n &&
  45927. (null === n.boundingBox && n.computeBoundingBox(),
  45928. n.boundingBox.isEmpty() === !1 &&
  45929. (e.copy(n.boundingBox), e.applyMatrix4(t.matrixWorld), i.union(e)))
  45930. }),
  45931. this
  45932. )
  45933. }
  45934. })(),
  45935. clone: function () {
  45936. return new this.constructor().copy(this)
  45937. },
  45938. copy: function (e) {
  45939. return this.min.copy(e.min), this.max.copy(e.max), this
  45940. },
  45941. makeEmpty: function () {
  45942. return (
  45943. (this.min.x = this.min.y = this.min.z = +(1 / 0)),
  45944. (this.max.x = this.max.y = this.max.z = -(1 / 0)),
  45945. this
  45946. )
  45947. },
  45948. isEmpty: function () {
  45949. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  45950. },
  45951. center: function (e) {
  45952. var t = e || new n.Vector3()
  45953. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  45954. },
  45955. size: function (e) {
  45956. var t = e || new n.Vector3()
  45957. return t.subVectors(this.max, this.min)
  45958. },
  45959. expandByPoint: function (e) {
  45960. return this.min.min(e), this.max.max(e), this
  45961. },
  45962. expandByVector: function (e) {
  45963. return this.min.sub(e), this.max.add(e), this
  45964. },
  45965. expandByScalar: function (e) {
  45966. return this.min.addScalar(-e), this.max.addScalar(e), this
  45967. },
  45968. containsPoint: function (e) {
  45969. return !(
  45970. e.x < this.min.x ||
  45971. e.x > this.max.x ||
  45972. e.y < this.min.y ||
  45973. e.y > this.max.y ||
  45974. e.z < this.min.z ||
  45975. e.z > this.max.z
  45976. )
  45977. },
  45978. containsBox: function (e) {
  45979. return (
  45980. this.min.x <= e.min.x &&
  45981. e.max.x <= this.max.x &&
  45982. this.min.y <= e.min.y &&
  45983. e.max.y <= this.max.y &&
  45984. this.min.z <= e.min.z &&
  45985. e.max.z <= this.max.z
  45986. )
  45987. },
  45988. getParameter: function (e, t) {
  45989. var i = t || new n.Vector3()
  45990. return i.set(
  45991. (e.x - this.min.x) / (this.max.x - this.min.x),
  45992. (e.y - this.min.y) / (this.max.y - this.min.y),
  45993. (e.z - this.min.z) / (this.max.z - this.min.z)
  45994. )
  45995. },
  45996. intersectsBox: function (e) {
  45997. return !(
  45998. e.max.x < this.min.x ||
  45999. e.min.x > this.max.x ||
  46000. e.max.y < this.min.y ||
  46001. e.min.y > this.max.y ||
  46002. e.max.z < this.min.z ||
  46003. e.min.z > this.max.z
  46004. )
  46005. },
  46006. intersectsSphere: (function () {
  46007. var e
  46008. return function (t) {
  46009. return (
  46010. void 0 === e && (e = new n.Vector3()),
  46011. this.clampPoint(t.center, e),
  46012. e.distanceToSquared(t.center) <= t.radius * t.radius
  46013. )
  46014. }
  46015. })(),
  46016. intersectsPlane: function (e) {
  46017. var t, i
  46018. return (
  46019. e.normal.x > 0
  46020. ? ((t = e.normal.x * this.min.x), (i = e.normal.x * this.max.x))
  46021. : ((t = e.normal.x * this.max.x), (i = e.normal.x * this.min.x)),
  46022. e.normal.y > 0
  46023. ? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y))
  46024. : ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
  46025. e.normal.z > 0
  46026. ? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z))
  46027. : ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
  46028. t <= e.constant && i >= e.constant
  46029. )
  46030. },
  46031. clampPoint: function (e, t) {
  46032. var i = t || new n.Vector3()
  46033. return i.copy(e).clamp(this.min, this.max)
  46034. },
  46035. distanceToPoint: (function () {
  46036. var e = new n.Vector3()
  46037. return function (t) {
  46038. var i = e.copy(t).clamp(this.min, this.max)
  46039. return i.sub(t).length()
  46040. }
  46041. })(),
  46042. getBoundingSphere: (function () {
  46043. var e = new n.Vector3()
  46044. return function (t) {
  46045. var i = t || new n.Sphere()
  46046. return (i.center = this.center()), (i.radius = 0.5 * this.size(e).length()), i
  46047. }
  46048. })(),
  46049. intersect: function (e) {
  46050. return this.min.max(e.min), this.max.min(e.max), this
  46051. },
  46052. union: function (e) {
  46053. return this.min.min(e.min), this.max.max(e.max), this
  46054. },
  46055. applyMatrix4: (function () {
  46056. var e = [
  46057. new n.Vector3(),
  46058. new n.Vector3(),
  46059. new n.Vector3(),
  46060. new n.Vector3(),
  46061. new n.Vector3(),
  46062. new n.Vector3(),
  46063. new n.Vector3(),
  46064. new n.Vector3()
  46065. ]
  46066. return function (t) {
  46067. return (
  46068. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  46069. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  46070. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  46071. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  46072. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  46073. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  46074. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  46075. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  46076. this.makeEmpty(),
  46077. this.setFromPoints(e),
  46078. this
  46079. )
  46080. }
  46081. })(),
  46082. translate: function (e) {
  46083. return this.min.add(e), this.max.add(e), this
  46084. },
  46085. equals: function (e) {
  46086. return e.min.equals(this.min) && e.max.equals(this.max)
  46087. }
  46088. }),
  46089. (n.Matrix3 = function () {
  46090. ;(this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])),
  46091. arguments.length > 0 &&
  46092. console.error(
  46093. 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.'
  46094. )
  46095. }),
  46096. (n.Matrix3.prototype = {
  46097. constructor: n.Matrix3,
  46098. set: function (e, t, i, n, r, o, a, s, l) {
  46099. var c = this.elements
  46100. return (
  46101. (c[0] = e),
  46102. (c[1] = n),
  46103. (c[2] = a),
  46104. (c[3] = t),
  46105. (c[4] = r),
  46106. (c[5] = s),
  46107. (c[6] = i),
  46108. (c[7] = o),
  46109. (c[8] = l),
  46110. this
  46111. )
  46112. },
  46113. identity: function () {
  46114. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  46115. },
  46116. clone: function () {
  46117. return new this.constructor().fromArray(this.elements)
  46118. },
  46119. copy: function (e) {
  46120. var t = e.elements
  46121. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
  46122. },
  46123. setFromMatrix4: function (e) {
  46124. var t = e.elements
  46125. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  46126. },
  46127. applyToVector3Array: (function () {
  46128. var e
  46129. return function (t, i, r) {
  46130. void 0 === e && (e = new n.Vector3()),
  46131. void 0 === i && (i = 0),
  46132. void 0 === r && (r = t.length)
  46133. for (var o = 0, a = i; o < r; o += 3, a += 3)
  46134. e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a)
  46135. return t
  46136. }
  46137. })(),
  46138. applyToBuffer: (function () {
  46139. var e
  46140. return function (t, i, r) {
  46141. void 0 === e && (e = new n.Vector3()),
  46142. void 0 === i && (i = 0),
  46143. void 0 === r && (r = t.length / t.itemSize)
  46144. for (var o = 0, a = i; o < r; o++, a++)
  46145. (e.x = t.getX(a)),
  46146. (e.y = t.getY(a)),
  46147. (e.z = t.getZ(a)),
  46148. e.applyMatrix3(this),
  46149. t.setXYZ(e.x, e.y, e.z)
  46150. return t
  46151. }
  46152. })(),
  46153. multiplyScalar: function (e) {
  46154. var t = this.elements
  46155. return (
  46156. (t[0] *= e),
  46157. (t[3] *= e),
  46158. (t[6] *= e),
  46159. (t[1] *= e),
  46160. (t[4] *= e),
  46161. (t[7] *= e),
  46162. (t[2] *= e),
  46163. (t[5] *= e),
  46164. (t[8] *= e),
  46165. this
  46166. )
  46167. },
  46168. determinant: function () {
  46169. var e = this.elements,
  46170. t = e[0],
  46171. i = e[1],
  46172. n = e[2],
  46173. r = e[3],
  46174. o = e[4],
  46175. a = e[5],
  46176. s = e[6],
  46177. l = e[7],
  46178. c = e[8]
  46179. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  46180. },
  46181. getInverse: function (e, t) {
  46182. e instanceof n.Matrix4 &&
  46183. console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.')
  46184. var i = e.elements,
  46185. r = this.elements,
  46186. o = i[0],
  46187. a = i[1],
  46188. s = i[2],
  46189. l = i[3],
  46190. c = i[4],
  46191. h = i[5],
  46192. u = i[6],
  46193. d = i[7],
  46194. p = i[8],
  46195. f = p * c - h * d,
  46196. g = h * u - p * l,
  46197. m = d * l - c * u,
  46198. v = o * f + a * g + s * m
  46199. if (0 === v) {
  46200. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"
  46201. if (t) throw new Error(A)
  46202. return console.warn(A), this.identity()
  46203. }
  46204. return (
  46205. (r[0] = f),
  46206. (r[1] = s * d - p * a),
  46207. (r[2] = h * a - s * c),
  46208. (r[3] = g),
  46209. (r[4] = p * o - s * u),
  46210. (r[5] = s * l - h * o),
  46211. (r[6] = m),
  46212. (r[7] = a * u - d * o),
  46213. (r[8] = c * o - a * l),
  46214. this.multiplyScalar(1 / v)
  46215. )
  46216. },
  46217. transpose: function () {
  46218. var e,
  46219. t = this.elements
  46220. return (
  46221. (e = t[1]),
  46222. (t[1] = t[3]),
  46223. (t[3] = e),
  46224. (e = t[2]),
  46225. (t[2] = t[6]),
  46226. (t[6] = e),
  46227. (e = t[5]),
  46228. (t[5] = t[7]),
  46229. (t[7] = e),
  46230. this
  46231. )
  46232. },
  46233. flattenToArrayOffset: function (e, t) {
  46234. var i = this.elements
  46235. return (
  46236. (e[t] = i[0]),
  46237. (e[t + 1] = i[1]),
  46238. (e[t + 2] = i[2]),
  46239. (e[t + 3] = i[3]),
  46240. (e[t + 4] = i[4]),
  46241. (e[t + 5] = i[5]),
  46242. (e[t + 6] = i[6]),
  46243. (e[t + 7] = i[7]),
  46244. (e[t + 8] = i[8]),
  46245. e
  46246. )
  46247. },
  46248. getNormalMatrix: function (e) {
  46249. return this.setFromMatrix4(e).getInverse(this).transpose()
  46250. },
  46251. transposeIntoArray: function (e) {
  46252. var t = this.elements
  46253. return (
  46254. (e[0] = t[0]),
  46255. (e[1] = t[3]),
  46256. (e[2] = t[6]),
  46257. (e[3] = t[1]),
  46258. (e[4] = t[4]),
  46259. (e[5] = t[7]),
  46260. (e[6] = t[2]),
  46261. (e[7] = t[5]),
  46262. (e[8] = t[8]),
  46263. this
  46264. )
  46265. },
  46266. fromArray: function (e) {
  46267. return this.elements.set(e), this
  46268. },
  46269. toArray: function () {
  46270. var e = this.elements
  46271. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  46272. }
  46273. }),
  46274. (n.Matrix4 = function () {
  46275. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  46276. arguments.length > 0 &&
  46277. console.error(
  46278. 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  46279. )
  46280. }),
  46281. (n.Matrix4.prototype = {
  46282. constructor: n.Matrix4,
  46283. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  46284. var m = this.elements
  46285. return (
  46286. (m[0] = e),
  46287. (m[4] = t),
  46288. (m[8] = i),
  46289. (m[12] = n),
  46290. (m[1] = r),
  46291. (m[5] = o),
  46292. (m[9] = a),
  46293. (m[13] = s),
  46294. (m[2] = l),
  46295. (m[6] = c),
  46296. (m[10] = h),
  46297. (m[14] = u),
  46298. (m[3] = d),
  46299. (m[7] = p),
  46300. (m[11] = f),
  46301. (m[15] = g),
  46302. this
  46303. )
  46304. },
  46305. identity: function () {
  46306. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  46307. },
  46308. clone: function () {
  46309. return new n.Matrix4().fromArray(this.elements)
  46310. },
  46311. copy: function (e) {
  46312. return this.elements.set(e.elements), this
  46313. },
  46314. copyPosition: function (e) {
  46315. var t = this.elements,
  46316. i = e.elements
  46317. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this
  46318. },
  46319. extractBasis: function (e, t, i) {
  46320. return (
  46321. e.setFromMatrixColumn(this, 0),
  46322. t.setFromMatrixColumn(this, 1),
  46323. i.setFromMatrixColumn(this, 2),
  46324. this
  46325. )
  46326. },
  46327. makeBasis: function (e, t, i) {
  46328. return (
  46329. 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), this
  46330. )
  46331. },
  46332. extractRotation: (function () {
  46333. var e
  46334. return function (t) {
  46335. void 0 === e && (e = new n.Vector3())
  46336. var i = this.elements,
  46337. r = t.elements,
  46338. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  46339. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  46340. s = 1 / e.setFromMatrixColumn(t, 2).length()
  46341. return (
  46342. (i[0] = r[0] * o),
  46343. (i[1] = r[1] * o),
  46344. (i[2] = r[2] * o),
  46345. (i[4] = r[4] * a),
  46346. (i[5] = r[5] * a),
  46347. (i[6] = r[6] * a),
  46348. (i[8] = r[8] * s),
  46349. (i[9] = r[9] * s),
  46350. (i[10] = r[10] * s),
  46351. this
  46352. )
  46353. }
  46354. })(),
  46355. makeRotationFromEuler: function (e) {
  46356. e instanceof n.Euler == !1 &&
  46357. console.error(
  46358. 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  46359. )
  46360. var t = this.elements,
  46361. i = e.x,
  46362. r = e.y,
  46363. o = e.z,
  46364. a = Math.cos(i),
  46365. s = Math.sin(i),
  46366. l = Math.cos(r),
  46367. c = Math.sin(r),
  46368. h = Math.cos(o),
  46369. u = Math.sin(o)
  46370. if ('XYZ' === e.order) {
  46371. var d = a * h,
  46372. p = a * u,
  46373. f = s * h,
  46374. g = s * u
  46375. ;(t[0] = l * h),
  46376. (t[4] = -l * u),
  46377. (t[8] = c),
  46378. (t[1] = p + f * c),
  46379. (t[5] = d - g * c),
  46380. (t[9] = -s * l),
  46381. (t[2] = g - d * c),
  46382. (t[6] = f + p * c),
  46383. (t[10] = a * l)
  46384. } else if ('YXZ' === e.order) {
  46385. var m = l * h,
  46386. v = l * u,
  46387. A = c * h,
  46388. y = c * u
  46389. ;(t[0] = m + y * s),
  46390. (t[4] = A * s - v),
  46391. (t[8] = a * c),
  46392. (t[1] = a * u),
  46393. (t[5] = a * h),
  46394. (t[9] = -s),
  46395. (t[2] = v * s - A),
  46396. (t[6] = y + m * s),
  46397. (t[10] = a * l)
  46398. } else if ('ZXY' === e.order) {
  46399. var m = l * h,
  46400. v = l * u,
  46401. A = c * h,
  46402. y = c * u
  46403. ;(t[0] = m - y * s),
  46404. (t[4] = -a * u),
  46405. (t[8] = A + v * s),
  46406. (t[1] = v + A * s),
  46407. (t[5] = a * h),
  46408. (t[9] = y - m * s),
  46409. (t[2] = -a * c),
  46410. (t[6] = s),
  46411. (t[10] = a * l)
  46412. } else if ('ZYX' === e.order) {
  46413. var d = a * h,
  46414. p = a * u,
  46415. f = s * h,
  46416. g = s * u
  46417. ;(t[0] = l * h),
  46418. (t[4] = f * c - p),
  46419. (t[8] = d * c + g),
  46420. (t[1] = l * u),
  46421. (t[5] = g * c + d),
  46422. (t[9] = p * c - f),
  46423. (t[2] = -c),
  46424. (t[6] = s * l),
  46425. (t[10] = a * l)
  46426. } else if ('YZX' === e.order) {
  46427. var C = a * l,
  46428. I = a * c,
  46429. E = s * l,
  46430. b = s * c
  46431. ;(t[0] = l * h),
  46432. (t[4] = b - C * u),
  46433. (t[8] = E * u + I),
  46434. (t[1] = u),
  46435. (t[5] = a * h),
  46436. (t[9] = -s * h),
  46437. (t[2] = -c * h),
  46438. (t[6] = I * u + E),
  46439. (t[10] = C - b * u)
  46440. } else if ('XZY' === e.order) {
  46441. var C = a * l,
  46442. I = a * c,
  46443. E = s * l,
  46444. b = s * c
  46445. ;(t[0] = l * h),
  46446. (t[4] = -u),
  46447. (t[8] = c * h),
  46448. (t[1] = C * u + b),
  46449. (t[5] = a * h),
  46450. (t[9] = I * u - E),
  46451. (t[2] = E * u - I),
  46452. (t[6] = s * h),
  46453. (t[10] = b * u + C)
  46454. }
  46455. return (
  46456. (t[3] = 0),
  46457. (t[7] = 0),
  46458. (t[11] = 0),
  46459. (t[12] = 0),
  46460. (t[13] = 0),
  46461. (t[14] = 0),
  46462. (t[15] = 1),
  46463. this
  46464. )
  46465. },
  46466. makeRotationFromQuaternion: function (e) {
  46467. var t = this.elements,
  46468. i = e.x,
  46469. n = e.y,
  46470. r = e.z,
  46471. o = e.w,
  46472. a = i + i,
  46473. s = n + n,
  46474. l = r + r,
  46475. c = i * a,
  46476. h = i * s,
  46477. u = i * l,
  46478. d = n * s,
  46479. p = n * l,
  46480. f = r * l,
  46481. g = o * a,
  46482. m = o * s,
  46483. v = o * l
  46484. return (
  46485. (t[0] = 1 - (d + f)),
  46486. (t[4] = h - v),
  46487. (t[8] = u + m),
  46488. (t[1] = h + v),
  46489. (t[5] = 1 - (c + f)),
  46490. (t[9] = p - g),
  46491. (t[2] = u - m),
  46492. (t[6] = p + g),
  46493. (t[10] = 1 - (c + d)),
  46494. (t[3] = 0),
  46495. (t[7] = 0),
  46496. (t[11] = 0),
  46497. (t[12] = 0),
  46498. (t[13] = 0),
  46499. (t[14] = 0),
  46500. (t[15] = 1),
  46501. this
  46502. )
  46503. },
  46504. lookAt: (function () {
  46505. var e, t, i
  46506. return function (r, o, a) {
  46507. void 0 === e && (e = new n.Vector3()),
  46508. void 0 === t && (t = new n.Vector3()),
  46509. void 0 === i && (i = new n.Vector3())
  46510. var s = this.elements
  46511. return (
  46512. i.subVectors(r, o).normalize(),
  46513. 0 === i.lengthSq() && (i.z = 1),
  46514. e.crossVectors(a, i).normalize(),
  46515. 0 === e.lengthSq() && ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  46516. t.crossVectors(i, e),
  46517. (s[0] = e.x),
  46518. (s[4] = t.x),
  46519. (s[8] = i.x),
  46520. (s[1] = e.y),
  46521. (s[5] = t.y),
  46522. (s[9] = i.y),
  46523. (s[2] = e.z),
  46524. (s[6] = t.z),
  46525. (s[10] = i.z),
  46526. this
  46527. )
  46528. }
  46529. })(),
  46530. multiply: function (e, t) {
  46531. return void 0 !== t
  46532. ? (console.warn(
  46533. 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'
  46534. ),
  46535. this.multiplyMatrices(e, t))
  46536. : this.multiplyMatrices(this, e)
  46537. },
  46538. multiplyMatrices: function (e, t) {
  46539. var i = e.elements,
  46540. n = t.elements,
  46541. r = this.elements,
  46542. o = i[0],
  46543. a = i[4],
  46544. s = i[8],
  46545. l = i[12],
  46546. c = i[1],
  46547. h = i[5],
  46548. u = i[9],
  46549. d = i[13],
  46550. p = i[2],
  46551. f = i[6],
  46552. g = i[10],
  46553. m = i[14],
  46554. v = i[3],
  46555. A = i[7],
  46556. y = i[11],
  46557. C = i[15],
  46558. I = n[0],
  46559. E = n[4],
  46560. b = n[8],
  46561. w = n[12],
  46562. _ = n[1],
  46563. T = n[5],
  46564. x = n[9],
  46565. S = n[13],
  46566. M = n[2],
  46567. R = n[6],
  46568. P = n[10],
  46569. O = n[14],
  46570. L = n[3],
  46571. D = n[7],
  46572. N = n[11],
  46573. B = n[15]
  46574. return (
  46575. (r[0] = o * I + a * _ + s * M + l * L),
  46576. (r[4] = o * E + a * T + s * R + l * D),
  46577. (r[8] = o * b + a * x + s * P + l * N),
  46578. (r[12] = o * w + a * S + s * O + l * B),
  46579. (r[1] = c * I + h * _ + u * M + d * L),
  46580. (r[5] = c * E + h * T + u * R + d * D),
  46581. (r[9] = c * b + h * x + u * P + d * N),
  46582. (r[13] = c * w + h * S + u * O + d * B),
  46583. (r[2] = p * I + f * _ + g * M + m * L),
  46584. (r[6] = p * E + f * T + g * R + m * D),
  46585. (r[10] = p * b + f * x + g * P + m * N),
  46586. (r[14] = p * w + f * S + g * O + m * B),
  46587. (r[3] = v * I + A * _ + y * M + C * L),
  46588. (r[7] = v * E + A * T + y * R + C * D),
  46589. (r[11] = v * b + A * x + y * P + C * N),
  46590. (r[15] = v * w + A * S + y * O + C * B),
  46591. this
  46592. )
  46593. },
  46594. multiplyToArray: function (e, t, i) {
  46595. var n = this.elements
  46596. return (
  46597. this.multiplyMatrices(e, t),
  46598. (i[0] = n[0]),
  46599. (i[1] = n[1]),
  46600. (i[2] = n[2]),
  46601. (i[3] = n[3]),
  46602. (i[4] = n[4]),
  46603. (i[5] = n[5]),
  46604. (i[6] = n[6]),
  46605. (i[7] = n[7]),
  46606. (i[8] = n[8]),
  46607. (i[9] = n[9]),
  46608. (i[10] = n[10]),
  46609. (i[11] = n[11]),
  46610. (i[12] = n[12]),
  46611. (i[13] = n[13]),
  46612. (i[14] = n[14]),
  46613. (i[15] = n[15]),
  46614. this
  46615. )
  46616. },
  46617. multiplyScalar: function (e) {
  46618. var t = this.elements
  46619. return (
  46620. (t[0] *= e),
  46621. (t[4] *= e),
  46622. (t[8] *= e),
  46623. (t[12] *= e),
  46624. (t[1] *= e),
  46625. (t[5] *= e),
  46626. (t[9] *= e),
  46627. (t[13] *= e),
  46628. (t[2] *= e),
  46629. (t[6] *= e),
  46630. (t[10] *= e),
  46631. (t[14] *= e),
  46632. (t[3] *= e),
  46633. (t[7] *= e),
  46634. (t[11] *= e),
  46635. (t[15] *= e),
  46636. this
  46637. )
  46638. },
  46639. applyToVector3Array: (function () {
  46640. var e
  46641. return function (t, i, r) {
  46642. void 0 === e && (e = new n.Vector3()),
  46643. void 0 === i && (i = 0),
  46644. void 0 === r && (r = t.length)
  46645. for (var o = 0, a = i; o < r; o += 3, a += 3)
  46646. e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a)
  46647. return t
  46648. }
  46649. })(),
  46650. applyToBuffer: (function () {
  46651. var e
  46652. return function (t, i, r) {
  46653. void 0 === e && (e = new n.Vector3()),
  46654. void 0 === i && (i = 0),
  46655. void 0 === r && (r = t.length / t.itemSize)
  46656. for (var o = 0, a = i; o < r; o++, a++)
  46657. (e.x = t.getX(a)),
  46658. (e.y = t.getY(a)),
  46659. (e.z = t.getZ(a)),
  46660. e.applyMatrix4(this),
  46661. t.setXYZ(e.x, e.y, e.z)
  46662. return t
  46663. }
  46664. })(),
  46665. determinant: function () {
  46666. var e = this.elements,
  46667. t = e[0],
  46668. i = e[4],
  46669. n = e[8],
  46670. r = e[12],
  46671. o = e[1],
  46672. a = e[5],
  46673. s = e[9],
  46674. l = e[13],
  46675. c = e[2],
  46676. h = e[6],
  46677. u = e[10],
  46678. d = e[14],
  46679. p = e[3],
  46680. f = e[7],
  46681. g = e[11],
  46682. m = e[15]
  46683. return (
  46684. p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  46685. f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  46686. g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  46687. m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  46688. )
  46689. },
  46690. transpose: function () {
  46691. var e,
  46692. t = this.elements
  46693. return (
  46694. (e = t[1]),
  46695. (t[1] = t[4]),
  46696. (t[4] = e),
  46697. (e = t[2]),
  46698. (t[2] = t[8]),
  46699. (t[8] = e),
  46700. (e = t[6]),
  46701. (t[6] = t[9]),
  46702. (t[9] = e),
  46703. (e = t[3]),
  46704. (t[3] = t[12]),
  46705. (t[12] = e),
  46706. (e = t[7]),
  46707. (t[7] = t[13]),
  46708. (t[13] = e),
  46709. (e = t[11]),
  46710. (t[11] = t[14]),
  46711. (t[14] = e),
  46712. this
  46713. )
  46714. },
  46715. flattenToArrayOffset: function (e, t) {
  46716. var i = this.elements
  46717. return (
  46718. (e[t] = i[0]),
  46719. (e[t + 1] = i[1]),
  46720. (e[t + 2] = i[2]),
  46721. (e[t + 3] = i[3]),
  46722. (e[t + 4] = i[4]),
  46723. (e[t + 5] = i[5]),
  46724. (e[t + 6] = i[6]),
  46725. (e[t + 7] = i[7]),
  46726. (e[t + 8] = i[8]),
  46727. (e[t + 9] = i[9]),
  46728. (e[t + 10] = i[10]),
  46729. (e[t + 11] = i[11]),
  46730. (e[t + 12] = i[12]),
  46731. (e[t + 13] = i[13]),
  46732. (e[t + 14] = i[14]),
  46733. (e[t + 15] = i[15]),
  46734. e
  46735. )
  46736. },
  46737. getPosition: (function () {
  46738. var e
  46739. return function () {
  46740. return (
  46741. void 0 === e && (e = new n.Vector3()),
  46742. console.warn(
  46743. 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'
  46744. ),
  46745. e.setFromMatrixColumn(this, 3)
  46746. )
  46747. }
  46748. })(),
  46749. setPosition: function (e) {
  46750. var t = this.elements
  46751. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this
  46752. },
  46753. getInverse: function (e, t) {
  46754. var i = this.elements,
  46755. n = e.elements,
  46756. r = n[0],
  46757. o = n[1],
  46758. a = n[2],
  46759. s = n[3],
  46760. l = n[4],
  46761. c = n[5],
  46762. h = n[6],
  46763. u = n[7],
  46764. d = n[8],
  46765. p = n[9],
  46766. f = n[10],
  46767. g = n[11],
  46768. m = n[12],
  46769. v = n[13],
  46770. A = n[14],
  46771. y = n[15],
  46772. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  46773. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  46774. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  46775. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  46776. w = r * C + o * I + a * E + s * b
  46777. if (0 === w) {
  46778. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  46779. if (t) throw new Error(_)
  46780. return console.warn(_), this.identity()
  46781. }
  46782. return (
  46783. (i[0] = C),
  46784. (i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y),
  46785. (i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y),
  46786. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  46787. (i[4] = I),
  46788. (i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y),
  46789. (i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y),
  46790. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  46791. (i[8] = E),
  46792. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y),
  46793. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y),
  46794. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  46795. (i[12] = b),
  46796. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A),
  46797. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A),
  46798. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  46799. this.multiplyScalar(1 / w)
  46800. )
  46801. },
  46802. scale: function (e) {
  46803. var t = this.elements,
  46804. i = e.x,
  46805. n = e.y,
  46806. r = e.z
  46807. return (
  46808. (t[0] *= i),
  46809. (t[4] *= n),
  46810. (t[8] *= r),
  46811. (t[1] *= i),
  46812. (t[5] *= n),
  46813. (t[9] *= r),
  46814. (t[2] *= i),
  46815. (t[6] *= n),
  46816. (t[10] *= r),
  46817. (t[3] *= i),
  46818. (t[7] *= n),
  46819. (t[11] *= r),
  46820. this
  46821. )
  46822. },
  46823. getMaxScaleOnAxis: function () {
  46824. var e = this.elements,
  46825. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  46826. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  46827. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]
  46828. return Math.sqrt(Math.max(t, i, n))
  46829. },
  46830. makeTranslation: function (e, t, i) {
  46831. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  46832. },
  46833. makeRotationX: function (e) {
  46834. var t = Math.cos(e),
  46835. i = Math.sin(e)
  46836. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  46837. },
  46838. makeRotationY: function (e) {
  46839. var t = Math.cos(e),
  46840. i = Math.sin(e)
  46841. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  46842. },
  46843. makeRotationZ: function (e) {
  46844. var t = Math.cos(e),
  46845. i = Math.sin(e)
  46846. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  46847. },
  46848. makeRotationAxis: function (e, t) {
  46849. var i = Math.cos(t),
  46850. n = Math.sin(t),
  46851. r = 1 - i,
  46852. o = e.x,
  46853. a = e.y,
  46854. s = e.z,
  46855. l = r * o,
  46856. c = r * a
  46857. return (
  46858. this.set(
  46859. l * o + i,
  46860. l * a - n * s,
  46861. l * s + n * a,
  46862. 0,
  46863. l * a + n * s,
  46864. c * a + i,
  46865. c * s - n * o,
  46866. 0,
  46867. l * s - n * a,
  46868. c * s + n * o,
  46869. r * s * s + i,
  46870. 0,
  46871. 0,
  46872. 0,
  46873. 0,
  46874. 1
  46875. ),
  46876. this
  46877. )
  46878. },
  46879. makeScale: function (e, t, i) {
  46880. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  46881. },
  46882. compose: function (e, t, i) {
  46883. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this
  46884. },
  46885. decompose: (function () {
  46886. var e, t
  46887. return function (i, r, o) {
  46888. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Matrix4())
  46889. var a = this.elements,
  46890. s = e.set(a[0], a[1], a[2]).length(),
  46891. l = e.set(a[4], a[5], a[6]).length(),
  46892. c = e.set(a[8], a[9], a[10]).length(),
  46893. h = this.determinant()
  46894. h < 0 && (s = -s),
  46895. (i.x = a[12]),
  46896. (i.y = a[13]),
  46897. (i.z = a[14]),
  46898. t.elements.set(this.elements)
  46899. var u = 1 / s,
  46900. d = 1 / l,
  46901. p = 1 / c
  46902. return (
  46903. (t.elements[0] *= u),
  46904. (t.elements[1] *= u),
  46905. (t.elements[2] *= u),
  46906. (t.elements[4] *= d),
  46907. (t.elements[5] *= d),
  46908. (t.elements[6] *= d),
  46909. (t.elements[8] *= p),
  46910. (t.elements[9] *= p),
  46911. (t.elements[10] *= p),
  46912. r.setFromRotationMatrix(t),
  46913. (o.x = s),
  46914. (o.y = l),
  46915. (o.z = c),
  46916. this
  46917. )
  46918. }
  46919. })(),
  46920. makeFrustum: function (e, t, i, n, r, o) {
  46921. var a = this.elements,
  46922. s = (2 * r) / (t - e),
  46923. l = (2 * r) / (n - i),
  46924. c = (t + e) / (t - e),
  46925. h = (n + i) / (n - i),
  46926. u = -(o + r) / (o - r),
  46927. d = (-2 * o * r) / (o - r)
  46928. return (
  46929. (a[0] = s),
  46930. (a[4] = 0),
  46931. (a[8] = c),
  46932. (a[12] = 0),
  46933. (a[1] = 0),
  46934. (a[5] = l),
  46935. (a[9] = h),
  46936. (a[13] = 0),
  46937. (a[2] = 0),
  46938. (a[6] = 0),
  46939. (a[10] = u),
  46940. (a[14] = d),
  46941. (a[3] = 0),
  46942. (a[7] = 0),
  46943. (a[11] = -1),
  46944. (a[15] = 0),
  46945. this
  46946. )
  46947. },
  46948. makePerspective: function (e, t, i, r) {
  46949. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  46950. a = -o,
  46951. s = a * t,
  46952. l = o * t
  46953. return this.makeFrustum(s, l, a, o, i, r)
  46954. },
  46955. makeOrthographic: function (e, t, i, n, r, o) {
  46956. var a = this.elements,
  46957. s = 1 / (t - e),
  46958. l = 1 / (i - n),
  46959. c = 1 / (o - r),
  46960. h = (t + e) * s,
  46961. u = (i + n) * l,
  46962. d = (o + r) * c
  46963. return (
  46964. (a[0] = 2 * s),
  46965. (a[4] = 0),
  46966. (a[8] = 0),
  46967. (a[12] = -h),
  46968. (a[1] = 0),
  46969. (a[5] = 2 * l),
  46970. (a[9] = 0),
  46971. (a[13] = -u),
  46972. (a[2] = 0),
  46973. (a[6] = 0),
  46974. (a[10] = -2 * c),
  46975. (a[14] = -d),
  46976. (a[3] = 0),
  46977. (a[7] = 0),
  46978. (a[11] = 0),
  46979. (a[15] = 1),
  46980. this
  46981. )
  46982. },
  46983. equals: function (e) {
  46984. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  46985. if (t[n] !== i[n]) return !1
  46986. return !0
  46987. },
  46988. fromArray: function (e) {
  46989. return this.elements.set(e), this
  46990. },
  46991. toArray: function () {
  46992. var e = this.elements
  46993. return [
  46994. e[0],
  46995. e[1],
  46996. e[2],
  46997. e[3],
  46998. e[4],
  46999. e[5],
  47000. e[6],
  47001. e[7],
  47002. e[8],
  47003. e[9],
  47004. e[10],
  47005. e[11],
  47006. e[12],
  47007. e[13],
  47008. e[14],
  47009. e[15]
  47010. ]
  47011. }
  47012. }),
  47013. (n.Ray = function (e, t) {
  47014. ;(this.origin = void 0 !== e ? e : new n.Vector3()),
  47015. (this.direction = void 0 !== t ? t : new n.Vector3())
  47016. }),
  47017. (n.Ray.prototype = {
  47018. constructor: n.Ray,
  47019. set: function (e, t) {
  47020. return this.origin.copy(e), this.direction.copy(t), this
  47021. },
  47022. clone: function () {
  47023. return new this.constructor().copy(this)
  47024. },
  47025. copy: function (e) {
  47026. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  47027. },
  47028. at: function (e, t) {
  47029. var i = t || new n.Vector3()
  47030. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  47031. },
  47032. lookAt: function (e) {
  47033. this.direction.copy(e).sub(this.origin).normalize()
  47034. },
  47035. recast: (function () {
  47036. var e = new n.Vector3()
  47037. return function (t) {
  47038. return this.origin.copy(this.at(t, e)), this
  47039. }
  47040. })(),
  47041. closestPointToPoint: function (e, t) {
  47042. var i = t || new n.Vector3()
  47043. i.subVectors(e, this.origin)
  47044. var r = i.dot(this.direction)
  47045. return r < 0
  47046. ? i.copy(this.origin)
  47047. : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  47048. },
  47049. distanceToPoint: function (e) {
  47050. return Math.sqrt(this.distanceSqToPoint(e))
  47051. },
  47052. distanceSqToPoint: (function () {
  47053. var e = new n.Vector3()
  47054. return function (t) {
  47055. var i = e.subVectors(t, this.origin).dot(this.direction)
  47056. return i < 0
  47057. ? this.origin.distanceToSquared(t)
  47058. : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  47059. e.distanceToSquared(t))
  47060. }
  47061. })(),
  47062. distanceSqToSegment: (function () {
  47063. var e = new n.Vector3(),
  47064. t = new n.Vector3(),
  47065. i = new n.Vector3()
  47066. return function (n, r, o, a) {
  47067. e.copy(n).add(r).multiplyScalar(0.5),
  47068. t.copy(r).sub(n).normalize(),
  47069. i.copy(this.origin).sub(e)
  47070. var s,
  47071. l,
  47072. c,
  47073. h,
  47074. u = 0.5 * n.distanceTo(r),
  47075. d = -this.direction.dot(t),
  47076. p = i.dot(this.direction),
  47077. f = -i.dot(t),
  47078. g = i.lengthSq(),
  47079. m = Math.abs(1 - d * d)
  47080. if (m > 0)
  47081. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  47082. if (l >= -h)
  47083. if (l <= h) {
  47084. var v = 1 / m
  47085. ;(s *= v),
  47086. (l *= v),
  47087. (c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g)
  47088. } else
  47089. (l = u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  47090. else
  47091. (l = -u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  47092. else
  47093. l <= -h
  47094. ? ((s = Math.max(0, -(-d * u + p))),
  47095. (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)),
  47096. (c = -s * s + l * (l + 2 * f) + g))
  47097. : l <= h
  47098. ? ((s = 0), (l = Math.min(Math.max(-u, -f), u)), (c = l * (l + 2 * f) + g))
  47099. : ((s = Math.max(0, -(d * u + p))),
  47100. (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)),
  47101. (c = -s * s + l * (l + 2 * f) + g))
  47102. else
  47103. (l = d > 0 ? -u : u),
  47104. (s = Math.max(0, -(d * l + p))),
  47105. (c = -s * s + l * (l + 2 * f) + g)
  47106. return (
  47107. o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  47108. a && a.copy(t).multiplyScalar(l).add(e),
  47109. c
  47110. )
  47111. }
  47112. })(),
  47113. intersectSphere: (function () {
  47114. var e = new n.Vector3()
  47115. return function (t, i) {
  47116. e.subVectors(t.center, this.origin)
  47117. var n = e.dot(this.direction),
  47118. r = e.dot(e) - n * n,
  47119. o = t.radius * t.radius
  47120. if (r > o) return null
  47121. var a = Math.sqrt(o - r),
  47122. s = n - a,
  47123. l = n + a
  47124. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  47125. }
  47126. })(),
  47127. intersectsSphere: function (e) {
  47128. return this.distanceToPoint(e.center) <= e.radius
  47129. },
  47130. distanceToPlane: function (e) {
  47131. var t = e.normal.dot(this.direction)
  47132. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null
  47133. var i = -(this.origin.dot(e.normal) + e.constant) / t
  47134. return i >= 0 ? i : null
  47135. },
  47136. intersectPlane: function (e, t) {
  47137. var i = this.distanceToPlane(e)
  47138. return null === i ? null : this.at(i, t)
  47139. },
  47140. intersectsPlane: function (e) {
  47141. var t = e.distanceToPoint(this.origin)
  47142. if (0 === t) return !0
  47143. var i = e.normal.dot(this.direction)
  47144. return i * t < 0
  47145. },
  47146. intersectBox: function (e, t) {
  47147. var i,
  47148. n,
  47149. r,
  47150. o,
  47151. a,
  47152. s,
  47153. l = 1 / this.direction.x,
  47154. c = 1 / this.direction.y,
  47155. h = 1 / this.direction.z,
  47156. u = this.origin
  47157. return (
  47158. l >= 0
  47159. ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l))
  47160. : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  47161. c >= 0
  47162. ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c))
  47163. : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  47164. i > o || r > n
  47165. ? null
  47166. : ((r > i || i !== i) && (i = r),
  47167. (o < n || n !== n) && (n = o),
  47168. h >= 0
  47169. ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h))
  47170. : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  47171. i > s || a > n
  47172. ? null
  47173. : ((a > i || i !== i) && (i = a),
  47174. (s < n || n !== n) && (n = s),
  47175. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  47176. )
  47177. },
  47178. intersectsBox: (function () {
  47179. var e = new n.Vector3()
  47180. return function (t) {
  47181. return null !== this.intersectBox(t, e)
  47182. }
  47183. })(),
  47184. intersectTriangle: (function () {
  47185. var e = new n.Vector3(),
  47186. t = new n.Vector3(),
  47187. i = new n.Vector3(),
  47188. r = new n.Vector3()
  47189. return function (n, o, a, s, l) {
  47190. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i)
  47191. var c,
  47192. h = this.direction.dot(r)
  47193. if (h > 0) {
  47194. if (s) return null
  47195. c = 1
  47196. } else {
  47197. if (!(h < 0)) return null
  47198. ;(c = -1), (h = -h)
  47199. }
  47200. e.subVectors(this.origin, n)
  47201. var u = c * this.direction.dot(i.crossVectors(e, i))
  47202. if (u < 0) return null
  47203. var d = c * this.direction.dot(t.cross(e))
  47204. if (d < 0) return null
  47205. if (u + d > h) return null
  47206. var p = -c * e.dot(r)
  47207. return p < 0 ? null : this.at(p / h, l)
  47208. }
  47209. })(),
  47210. applyMatrix4: function (e) {
  47211. return (
  47212. this.direction.add(this.origin).applyMatrix4(e),
  47213. this.origin.applyMatrix4(e),
  47214. this.direction.sub(this.origin),
  47215. this.direction.normalize(),
  47216. this
  47217. )
  47218. },
  47219. equals: function (e) {
  47220. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  47221. }
  47222. }),
  47223. (n.Sphere = function (e, t) {
  47224. ;(this.center = void 0 !== e ? e : new n.Vector3()),
  47225. (this.radius = void 0 !== t ? t : 0)
  47226. }),
  47227. (n.Sphere.prototype = {
  47228. constructor: n.Sphere,
  47229. set: function (e, t) {
  47230. return this.center.copy(e), (this.radius = t), this
  47231. },
  47232. setFromPoints: (function () {
  47233. var e = new n.Box3()
  47234. return function (t, i) {
  47235. var n = this.center
  47236. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n)
  47237. for (var r = 0, o = 0, a = t.length; o < a; o++)
  47238. r = Math.max(r, n.distanceToSquared(t[o]))
  47239. return (this.radius = Math.sqrt(r)), this
  47240. }
  47241. })(),
  47242. clone: function () {
  47243. return new this.constructor().copy(this)
  47244. },
  47245. copy: function (e) {
  47246. return this.center.copy(e.center), (this.radius = e.radius), this
  47247. },
  47248. empty: function () {
  47249. return this.radius <= 0
  47250. },
  47251. containsPoint: function (e) {
  47252. return e.distanceToSquared(this.center) <= this.radius * this.radius
  47253. },
  47254. distanceToPoint: function (e) {
  47255. return e.distanceTo(this.center) - this.radius
  47256. },
  47257. intersectsSphere: function (e) {
  47258. var t = this.radius + e.radius
  47259. return e.center.distanceToSquared(this.center) <= t * t
  47260. },
  47261. intersectsBox: function (e) {
  47262. return e.intersectsSphere(this)
  47263. },
  47264. intersectsPlane: function (e) {
  47265. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  47266. },
  47267. clampPoint: function (e, t) {
  47268. var i = this.center.distanceToSquared(e),
  47269. r = t || new n.Vector3()
  47270. return (
  47271. r.copy(e),
  47272. i > this.radius * this.radius &&
  47273. (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)),
  47274. r
  47275. )
  47276. },
  47277. getBoundingBox: function (e) {
  47278. var t = e || new n.Box3()
  47279. return t.set(this.center, this.center), t.expandByScalar(this.radius), t
  47280. },
  47281. applyMatrix4: function (e) {
  47282. return (
  47283. this.center.applyMatrix4(e),
  47284. (this.radius = this.radius * e.getMaxScaleOnAxis()),
  47285. this
  47286. )
  47287. },
  47288. translate: function (e) {
  47289. return this.center.add(e), this
  47290. },
  47291. equals: function (e) {
  47292. return e.center.equals(this.center) && e.radius === this.radius
  47293. }
  47294. }),
  47295. (n.Frustum = function (e, t, i, r, o, a) {
  47296. this.planes = [
  47297. void 0 !== e ? e : new n.Plane(),
  47298. void 0 !== t ? t : new n.Plane(),
  47299. void 0 !== i ? i : new n.Plane(),
  47300. void 0 !== r ? r : new n.Plane(),
  47301. void 0 !== o ? o : new n.Plane(),
  47302. void 0 !== a ? a : new n.Plane()
  47303. ]
  47304. }),
  47305. (n.Frustum.prototype = {
  47306. constructor: n.Frustum,
  47307. set: function (e, t, i, n, r, o) {
  47308. var a = this.planes
  47309. return (
  47310. a[0].copy(e),
  47311. a[1].copy(t),
  47312. a[2].copy(i),
  47313. a[3].copy(n),
  47314. a[4].copy(r),
  47315. a[5].copy(o),
  47316. this
  47317. )
  47318. },
  47319. clone: function () {
  47320. return new this.constructor().copy(this)
  47321. },
  47322. copy: function (e) {
  47323. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i])
  47324. return this
  47325. },
  47326. setFromMatrix: function (e) {
  47327. var t = this.planes,
  47328. i = e.elements,
  47329. n = i[0],
  47330. r = i[1],
  47331. o = i[2],
  47332. a = i[3],
  47333. s = i[4],
  47334. l = i[5],
  47335. c = i[6],
  47336. h = i[7],
  47337. u = i[8],
  47338. d = i[9],
  47339. p = i[10],
  47340. f = i[11],
  47341. g = i[12],
  47342. m = i[13],
  47343. v = i[14],
  47344. A = i[15]
  47345. return (
  47346. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  47347. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  47348. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  47349. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  47350. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  47351. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  47352. this
  47353. )
  47354. },
  47355. intersectsObject: (function () {
  47356. var e = new n.Sphere()
  47357. return function (t) {
  47358. var i = t.geometry
  47359. return (
  47360. null === i.boundingSphere && i.computeBoundingSphere(),
  47361. e.copy(i.boundingSphere),
  47362. e.applyMatrix4(t.matrixWorld),
  47363. this.intersectsSphere(e)
  47364. )
  47365. }
  47366. })(),
  47367. intersectsSphere: function (e) {
  47368. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  47369. var o = t[r].distanceToPoint(i)
  47370. if (o < n) return !1
  47371. }
  47372. return !0
  47373. },
  47374. intersectsBox: (function () {
  47375. var e = new n.Vector3(),
  47376. t = new n.Vector3()
  47377. return function (i) {
  47378. for (var n = this.planes, r = 0; r < 6; r++) {
  47379. var o = n[r]
  47380. ;(e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  47381. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  47382. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  47383. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  47384. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  47385. (t.z = o.normal.z > 0 ? i.max.z : i.min.z)
  47386. var a = o.distanceToPoint(e),
  47387. s = o.distanceToPoint(t)
  47388. if (a < 0 && s < 0) return !1
  47389. }
  47390. return !0
  47391. }
  47392. })(),
  47393. containsPoint: function (e) {
  47394. for (var t = this.planes, i = 0; i < 6; i++)
  47395. if (t[i].distanceToPoint(e) < 0) return !1
  47396. return !0
  47397. }
  47398. }),
  47399. (n.Plane = function (e, t) {
  47400. ;(this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)),
  47401. (this.constant = void 0 !== t ? t : 0)
  47402. }),
  47403. (n.Plane.prototype = {
  47404. constructor: n.Plane,
  47405. set: function (e, t) {
  47406. return this.normal.copy(e), (this.constant = t), this
  47407. },
  47408. setComponents: function (e, t, i, n) {
  47409. return this.normal.set(e, t, i), (this.constant = n), this
  47410. },
  47411. setFromNormalAndCoplanarPoint: function (e, t) {
  47412. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  47413. },
  47414. setFromCoplanarPoints: (function () {
  47415. var e = new n.Vector3(),
  47416. t = new n.Vector3()
  47417. return function (i, n, r) {
  47418. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize()
  47419. return this.setFromNormalAndCoplanarPoint(o, i), this
  47420. }
  47421. })(),
  47422. clone: function () {
  47423. return new this.constructor().copy(this)
  47424. },
  47425. copy: function (e) {
  47426. return this.normal.copy(e.normal), (this.constant = e.constant), this
  47427. },
  47428. normalize: function () {
  47429. var e = 1 / this.normal.length()
  47430. return this.normal.multiplyScalar(e), (this.constant *= e), this
  47431. },
  47432. negate: function () {
  47433. return (this.constant *= -1), this.normal.negate(), this
  47434. },
  47435. distanceToPoint: function (e) {
  47436. return this.normal.dot(e) + this.constant
  47437. },
  47438. distanceToSphere: function (e) {
  47439. return this.distanceToPoint(e.center) - e.radius
  47440. },
  47441. projectPoint: function (e, t) {
  47442. return this.orthoPoint(e, t).sub(e).negate()
  47443. },
  47444. orthoPoint: function (e, t) {
  47445. var i = this.distanceToPoint(e),
  47446. r = t || new n.Vector3()
  47447. return r.copy(this.normal).multiplyScalar(i)
  47448. },
  47449. intersectLine: (function () {
  47450. var e = new n.Vector3()
  47451. return function (t, i) {
  47452. var r = i || new n.Vector3(),
  47453. o = t.delta(e),
  47454. a = this.normal.dot(o)
  47455. if (0 !== a) {
  47456. var s = -(t.start.dot(this.normal) + this.constant) / a
  47457. if (!(s < 0 || s > 1)) return r.copy(o).multiplyScalar(s).add(t.start)
  47458. } else if (0 === this.distanceToPoint(t.start)) return r.copy(t.start)
  47459. }
  47460. })(),
  47461. intersectsLine: function (e) {
  47462. var t = this.distanceToPoint(e.start),
  47463. i = this.distanceToPoint(e.end)
  47464. return (t < 0 && i > 0) || (i < 0 && t > 0)
  47465. },
  47466. intersectsBox: function (e) {
  47467. return e.intersectsPlane(this)
  47468. },
  47469. intersectsSphere: function (e) {
  47470. return e.intersectsPlane(this)
  47471. },
  47472. coplanarPoint: function (e) {
  47473. var t = e || new n.Vector3()
  47474. return t.copy(this.normal).multiplyScalar(-this.constant)
  47475. },
  47476. applyMatrix4: (function () {
  47477. var e = new n.Vector3(),
  47478. t = new n.Vector3(),
  47479. i = new n.Matrix3()
  47480. return function (n, r) {
  47481. var o = r || i.getNormalMatrix(n),
  47482. a = e.copy(this.normal).applyMatrix3(o),
  47483. s = this.coplanarPoint(t)
  47484. return s.applyMatrix4(n), this.setFromNormalAndCoplanarPoint(a, s), this
  47485. }
  47486. })(),
  47487. translate: function (e) {
  47488. return (this.constant = this.constant - e.dot(this.normal)), this
  47489. },
  47490. equals: function (e) {
  47491. return e.normal.equals(this.normal) && e.constant === this.constant
  47492. }
  47493. }),
  47494. (n.Spherical = function (e, t, i) {
  47495. return (
  47496. (this.radius = void 0 !== e ? e : 1),
  47497. (this.phi = void 0 !== t ? t : 0),
  47498. (this.theta = void 0 !== i ? i : 0),
  47499. this
  47500. )
  47501. }),
  47502. (n.Spherical.prototype = {
  47503. constructor: n.Spherical,
  47504. set: function (e, t, i) {
  47505. ;(this.radius = e), (this.phi = t), (this.theta = i)
  47506. },
  47507. clone: function () {
  47508. return new this.constructor().copy(this)
  47509. },
  47510. copy: function (e) {
  47511. return (
  47512. this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  47513. )
  47514. },
  47515. makeSafe: function () {
  47516. var e = 1e-6
  47517. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  47518. },
  47519. setFromVector3: function (e) {
  47520. return (
  47521. (this.radius = e.length()),
  47522. 0 === this.radius
  47523. ? ((this.theta = 0), (this.phi = 0))
  47524. : ((this.theta = Math.atan2(e.x, e.z)),
  47525. (this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1)))),
  47526. this
  47527. )
  47528. }
  47529. }),
  47530. (n.Math = {
  47531. generateUUID: (function () {
  47532. var e,
  47533. t = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
  47534. i = new Array(36),
  47535. n = 0
  47536. return function () {
  47537. for (var r = 0; r < 36; r++)
  47538. 8 === r || 13 === r || 18 === r || 23 === r
  47539. ? (i[r] = '-')
  47540. : 14 === r
  47541. ? (i[r] = '4')
  47542. : (n <= 2 && (n = (33554432 + 16777216 * Math.random()) | 0),
  47543. (e = 15 & n),
  47544. (n >>= 4),
  47545. (i[r] = t[19 === r ? (3 & e) | 8 : e]))
  47546. return i.join('')
  47547. }
  47548. })(),
  47549. clamp: function (e, t, i) {
  47550. return Math.max(t, Math.min(i, e))
  47551. },
  47552. euclideanModulo: function (e, t) {
  47553. return ((e % t) + t) % t
  47554. },
  47555. mapLinear: function (e, t, i, n, r) {
  47556. return n + ((e - t) * (r - n)) / (i - t)
  47557. },
  47558. smoothstep: function (e, t, i) {
  47559. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e))
  47560. },
  47561. smootherstep: function (e, t, i) {
  47562. return e <= t
  47563. ? 0
  47564. : e >= i
  47565. ? 1
  47566. : ((e = (e - t) / (i - t)), e * e * e * (e * (6 * e - 15) + 10))
  47567. },
  47568. random16: function () {
  47569. return (
  47570. console.warn(
  47571. 'THREE.Math.random16() has been deprecated. Use Math.random() instead.'
  47572. ),
  47573. Math.random()
  47574. )
  47575. },
  47576. randInt: function (e, t) {
  47577. return e + Math.floor(Math.random() * (t - e + 1))
  47578. },
  47579. randFloat: function (e, t) {
  47580. return e + Math.random() * (t - e)
  47581. },
  47582. randFloatSpread: function (e) {
  47583. return e * (0.5 - Math.random())
  47584. },
  47585. degToRad: (function () {
  47586. var e = Math.PI / 180
  47587. return function (t) {
  47588. return t * e
  47589. }
  47590. })(),
  47591. radToDeg: (function () {
  47592. var e = 180 / Math.PI
  47593. return function (t) {
  47594. return t * e
  47595. }
  47596. })(),
  47597. isPowerOfTwo: function (e) {
  47598. return 0 === (e & (e - 1)) && 0 !== e
  47599. },
  47600. nearestPowerOfTwo: function (e) {
  47601. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  47602. },
  47603. nextPowerOfTwo: function (e) {
  47604. return (
  47605. e--,
  47606. (e |= e >> 1),
  47607. (e |= e >> 2),
  47608. (e |= e >> 4),
  47609. (e |= e >> 8),
  47610. (e |= e >> 16),
  47611. e++,
  47612. e
  47613. )
  47614. }
  47615. }),
  47616. (n.Spline = function (e) {
  47617. function t(e, t, i, n, r, o, a) {
  47618. var s = 0.5 * (i - e),
  47619. l = 0.5 * (n - t)
  47620. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  47621. }
  47622. this.points = e
  47623. var i,
  47624. r,
  47625. o,
  47626. a,
  47627. s,
  47628. l,
  47629. c,
  47630. h,
  47631. u,
  47632. d = [],
  47633. p = {
  47634. x: 0,
  47635. y: 0,
  47636. z: 0
  47637. }
  47638. ;(this.initFromArray = function (e) {
  47639. this.points = []
  47640. for (var t = 0; t < e.length; t++)
  47641. this.points[t] = {
  47642. x: e[t][0],
  47643. y: e[t][1],
  47644. z: e[t][2]
  47645. }
  47646. }),
  47647. (this.getPoint = function (e) {
  47648. return (
  47649. (i = (this.points.length - 1) * e),
  47650. (r = Math.floor(i)),
  47651. (o = i - r),
  47652. (d[0] = 0 === r ? r : r - 1),
  47653. (d[1] = r),
  47654. (d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1),
  47655. (d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2),
  47656. (l = this.points[d[0]]),
  47657. (c = this.points[d[1]]),
  47658. (h = this.points[d[2]]),
  47659. (u = this.points[d[3]]),
  47660. (a = o * o),
  47661. (s = o * a),
  47662. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  47663. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  47664. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  47665. p
  47666. )
  47667. }),
  47668. (this.getControlPointsArray = function () {
  47669. var e,
  47670. t,
  47671. i = this.points.length,
  47672. n = []
  47673. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z])
  47674. return n
  47675. }),
  47676. (this.getLength = function (e) {
  47677. var t,
  47678. i,
  47679. r,
  47680. o,
  47681. a = 0,
  47682. s = 0,
  47683. l = 0,
  47684. c = new n.Vector3(),
  47685. h = new n.Vector3(),
  47686. u = [],
  47687. d = 0
  47688. for (
  47689. u[0] = 0,
  47690. e || (e = 100),
  47691. r = this.points.length * e,
  47692. c.copy(this.points[0]),
  47693. t = 1;
  47694. t < r;
  47695. t++
  47696. )
  47697. (i = t / r),
  47698. (o = this.getPoint(i)),
  47699. h.copy(o),
  47700. (d += h.distanceTo(c)),
  47701. c.copy(o),
  47702. (a = (this.points.length - 1) * i),
  47703. (s = Math.floor(a)),
  47704. s !== l && ((u[s] = d), (l = s))
  47705. return (
  47706. (u[u.length] = d),
  47707. {
  47708. chunks: u,
  47709. total: d
  47710. }
  47711. )
  47712. }),
  47713. (this.reparametrizeByArcLength = function (e) {
  47714. var t,
  47715. i,
  47716. r,
  47717. o,
  47718. a,
  47719. s,
  47720. l,
  47721. c,
  47722. h = [],
  47723. u = new n.Vector3(),
  47724. d = this.getLength()
  47725. for (h.push(u.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  47726. for (
  47727. s = d.chunks[t] - d.chunks[t - 1],
  47728. l = Math.ceil((e * s) / d.total),
  47729. o = (t - 1) / (this.points.length - 1),
  47730. a = t / (this.points.length - 1),
  47731. i = 1;
  47732. i < l - 1;
  47733. i++
  47734. )
  47735. (r = o + i * (1 / l) * (a - o)),
  47736. (c = this.getPoint(r)),
  47737. h.push(u.copy(c).clone())
  47738. h.push(u.copy(this.points[t]).clone())
  47739. }
  47740. this.points = h
  47741. })
  47742. }),
  47743. (n.Triangle = function (e, t, i) {
  47744. ;(this.a = void 0 !== e ? e : new n.Vector3()),
  47745. (this.b = void 0 !== t ? t : new n.Vector3()),
  47746. (this.c = void 0 !== i ? i : new n.Vector3())
  47747. }),
  47748. (n.Triangle.normal = (function () {
  47749. var e = new n.Vector3()
  47750. return function (t, i, r, o) {
  47751. var a = o || new n.Vector3()
  47752. a.subVectors(r, i), e.subVectors(t, i), a.cross(e)
  47753. var s = a.lengthSq()
  47754. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  47755. }
  47756. })()),
  47757. (n.Triangle.barycoordFromPoint = (function () {
  47758. var e = new n.Vector3(),
  47759. t = new n.Vector3(),
  47760. i = new n.Vector3()
  47761. return function (r, o, a, s, l) {
  47762. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o)
  47763. var c = e.dot(e),
  47764. h = e.dot(t),
  47765. u = e.dot(i),
  47766. d = t.dot(t),
  47767. p = t.dot(i),
  47768. f = c * d - h * h,
  47769. g = l || new n.Vector3()
  47770. if (0 === f) return g.set(-2, -1, -1)
  47771. var m = 1 / f,
  47772. v = (d * u - h * p) * m,
  47773. A = (c * p - h * u) * m
  47774. return g.set(1 - v - A, A, v)
  47775. }
  47776. })()),
  47777. (n.Triangle.containsPoint = (function () {
  47778. var e = new n.Vector3()
  47779. return function (t, i, r, o) {
  47780. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e)
  47781. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  47782. }
  47783. })()),
  47784. (n.Triangle.prototype = {
  47785. constructor: n.Triangle,
  47786. set: function (e, t, i) {
  47787. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this
  47788. },
  47789. setFromPointsAndIndices: function (e, t, i, n) {
  47790. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  47791. },
  47792. clone: function () {
  47793. return new this.constructor().copy(this)
  47794. },
  47795. copy: function (e) {
  47796. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  47797. },
  47798. area: (function () {
  47799. var e = new n.Vector3(),
  47800. t = new n.Vector3()
  47801. return function () {
  47802. return (
  47803. e.subVectors(this.c, this.b),
  47804. t.subVectors(this.a, this.b),
  47805. 0.5 * e.cross(t).length()
  47806. )
  47807. }
  47808. })(),
  47809. midpoint: function (e) {
  47810. var t = e || new n.Vector3()
  47811. return t
  47812. .addVectors(this.a, this.b)
  47813. .add(this.c)
  47814. .multiplyScalar(1 / 3)
  47815. },
  47816. normal: function (e) {
  47817. return n.Triangle.normal(this.a, this.b, this.c, e)
  47818. },
  47819. plane: function (e) {
  47820. var t = e || new n.Plane()
  47821. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  47822. },
  47823. barycoordFromPoint: function (e, t) {
  47824. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  47825. },
  47826. containsPoint: function (e) {
  47827. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  47828. },
  47829. equals: function (e) {
  47830. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  47831. }
  47832. }),
  47833. (n.Interpolant = function (e, t, i, n) {
  47834. ;(this.parameterPositions = e),
  47835. (this._cachedIndex = 0),
  47836. (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)),
  47837. (this.sampleValues = t),
  47838. (this.valueSize = i)
  47839. }),
  47840. (n.Interpolant.prototype = {
  47841. constructor: n.Interpolant,
  47842. evaluate: function (e) {
  47843. var t = this.parameterPositions,
  47844. i = this._cachedIndex,
  47845. n = t[i],
  47846. r = t[i - 1]
  47847. e: {
  47848. t: {
  47849. var o
  47850. i: {
  47851. n: if (!(e < n)) {
  47852. for (var a = i + 2; ; ) {
  47853. if (void 0 === n) {
  47854. if (e < r) break n
  47855. return (
  47856. (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  47857. )
  47858. }
  47859. if (i === a) break
  47860. if (((r = n), (n = t[++i]), e < n)) break t
  47861. }
  47862. o = t.length
  47863. break i
  47864. }
  47865. {
  47866. if (e >= r) break e
  47867. var s = t[1]
  47868. e < s && ((i = 2), (r = s))
  47869. for (var a = i - 2; ; ) {
  47870. if (void 0 === r) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  47871. if (i === a) break
  47872. if (((n = r), (r = t[--i - 1]), e >= r)) break t
  47873. }
  47874. ;(o = i), (i = 0)
  47875. }
  47876. }
  47877. for (; i < o; ) {
  47878. var l = (i + o) >>> 1
  47879. e < t[l] ? (o = l) : (i = l + 1)
  47880. }
  47881. if (((n = t[i]), (r = t[i - 1]), void 0 === r))
  47882. return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  47883. if (void 0 === n)
  47884. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e)
  47885. }
  47886. ;(this._cachedIndex = i), this.intervalChanged_(i, r, n)
  47887. }
  47888. return this.interpolate_(i, r, e, n)
  47889. },
  47890. settings: null,
  47891. DefaultSettings_: {},
  47892. getSettings_: function () {
  47893. return this.settings || this.DefaultSettings_
  47894. },
  47895. copySampleValue_: function (e) {
  47896. for (
  47897. var t = this.resultBuffer,
  47898. i = this.sampleValues,
  47899. n = this.valueSize,
  47900. r = e * n,
  47901. o = 0;
  47902. o !== n;
  47903. ++o
  47904. )
  47905. t[o] = i[r + o]
  47906. return t
  47907. },
  47908. interpolate_: function (e, t, i, n) {
  47909. throw new Error('call to abstract method')
  47910. },
  47911. intervalChanged_: function (e, t, i) {}
  47912. }),
  47913. Object.assign(n.Interpolant.prototype, {
  47914. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  47915. afterEnd_: n.Interpolant.prototype.copySampleValue_
  47916. }),
  47917. (n.CubicInterpolant = function (e, t, i, r) {
  47918. n.Interpolant.call(this, e, t, i, r),
  47919. (this._weightPrev = -0),
  47920. (this._offsetPrev = -0),
  47921. (this._weightNext = -0),
  47922. (this._offsetNext = -0)
  47923. }),
  47924. (n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47925. constructor: n.CubicInterpolant,
  47926. DefaultSettings_: {
  47927. endingStart: n.ZeroCurvatureEnding,
  47928. endingEnd: n.ZeroCurvatureEnding
  47929. },
  47930. intervalChanged_: function (e, t, i) {
  47931. var r = this.parameterPositions,
  47932. o = e - 2,
  47933. a = e + 1,
  47934. s = r[o],
  47935. l = r[a]
  47936. if (void 0 === s)
  47937. switch (this.getSettings_().endingStart) {
  47938. case n.ZeroSlopeEnding:
  47939. ;(o = e), (s = 2 * t - i)
  47940. break
  47941. case n.WrapAroundEnding:
  47942. ;(o = r.length - 2), (s = t + r[o] - r[o + 1])
  47943. break
  47944. default:
  47945. ;(o = e), (s = i)
  47946. }
  47947. if (void 0 === l)
  47948. switch (this.getSettings_().endingEnd) {
  47949. case n.ZeroSlopeEnding:
  47950. ;(a = e), (l = 2 * i - t)
  47951. break
  47952. case n.WrapAroundEnding:
  47953. ;(a = 1), (l = i + r[1] - r[0])
  47954. break
  47955. default:
  47956. ;(a = e - 1), (l = t)
  47957. }
  47958. var c = 0.5 * (i - t),
  47959. h = this.valueSize
  47960. ;(this._weightPrev = c / (t - s)),
  47961. (this._weightNext = c / (l - i)),
  47962. (this._offsetPrev = o * h),
  47963. (this._offsetNext = a * h)
  47964. },
  47965. interpolate_: function (e, t, i, n) {
  47966. for (
  47967. var r = this.resultBuffer,
  47968. o = this.sampleValues,
  47969. a = this.valueSize,
  47970. s = e * a,
  47971. l = s - a,
  47972. c = this._offsetPrev,
  47973. h = this._offsetNext,
  47974. u = this._weightPrev,
  47975. d = this._weightNext,
  47976. p = (i - t) / (n - t),
  47977. f = p * p,
  47978. g = f * p,
  47979. m = -u * g + 2 * u * f - u * p,
  47980. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  47981. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  47982. y = d * g - d * f,
  47983. C = 0;
  47984. C !== a;
  47985. ++C
  47986. )
  47987. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C]
  47988. return r
  47989. }
  47990. })),
  47991. (n.DiscreteInterpolant = function (e, t, i, r) {
  47992. n.Interpolant.call(this, e, t, i, r)
  47993. }),
  47994. (n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47995. constructor: n.DiscreteInterpolant,
  47996. interpolate_: function (e, t, i, n) {
  47997. return this.copySampleValue_(e - 1)
  47998. }
  47999. })),
  48000. (n.LinearInterpolant = function (e, t, i, r) {
  48001. n.Interpolant.call(this, e, t, i, r)
  48002. }),
  48003. (n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  48004. constructor: n.LinearInterpolant,
  48005. interpolate_: function (e, t, i, n) {
  48006. for (
  48007. var r = this.resultBuffer,
  48008. o = this.sampleValues,
  48009. a = this.valueSize,
  48010. s = e * a,
  48011. l = s - a,
  48012. c = (i - t) / (n - t),
  48013. h = 1 - c,
  48014. u = 0;
  48015. u !== a;
  48016. ++u
  48017. )
  48018. r[u] = o[l + u] * h + o[s + u] * c
  48019. return r
  48020. }
  48021. })),
  48022. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  48023. n.Interpolant.call(this, e, t, i, r)
  48024. }),
  48025. (n.QuaternionLinearInterpolant.prototype = Object.assign(
  48026. Object.create(n.Interpolant.prototype),
  48027. {
  48028. constructor: n.QuaternionLinearInterpolant,
  48029. interpolate_: function (e, t, i, r) {
  48030. for (
  48031. var o = this.resultBuffer,
  48032. a = this.sampleValues,
  48033. s = this.valueSize,
  48034. l = e * s,
  48035. c = (i - t) / (r - t),
  48036. h = l + s;
  48037. l !== h;
  48038. l += 4
  48039. )
  48040. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c)
  48041. return o
  48042. }
  48043. }
  48044. )),
  48045. (n.Clock = function (e) {
  48046. ;(this.autoStart = void 0 === e || e),
  48047. (this.startTime = 0),
  48048. (this.oldTime = 0),
  48049. (this.elapsedTime = 0),
  48050. (this.running = !1)
  48051. }),
  48052. (n.Clock.prototype = {
  48053. constructor: n.Clock,
  48054. start: function () {
  48055. ;(this.startTime = performance.now()),
  48056. (this.oldTime = this.startTime),
  48057. (this.running = !0)
  48058. },
  48059. stop: function () {
  48060. this.getElapsedTime(), (this.running = !1)
  48061. },
  48062. getElapsedTime: function () {
  48063. return this.getDelta(), this.elapsedTime
  48064. },
  48065. getDelta: function () {
  48066. var e = 0
  48067. if ((this.autoStart && !this.running && this.start(), this.running)) {
  48068. var t = performance.now()
  48069. ;(e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e)
  48070. }
  48071. return e
  48072. }
  48073. }),
  48074. (n.EventDispatcher = function () {}),
  48075. (n.EventDispatcher.prototype = {
  48076. constructor: n.EventDispatcher,
  48077. apply: function (e) {
  48078. ;(e.addEventListener = n.EventDispatcher.prototype.addEventListener),
  48079. (e.hasEventListener = n.EventDispatcher.prototype.hasEventListener),
  48080. (e.removeEventListener = n.EventDispatcher.prototype.removeEventListener),
  48081. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent)
  48082. },
  48083. addEventListener: function (e, t) {
  48084. void 0 === this._listeners && (this._listeners = {})
  48085. var i = this._listeners
  48086. void 0 === i[e] && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t)
  48087. },
  48088. hasEventListener: function (e, t) {
  48089. if (void 0 === this._listeners) return !1
  48090. var i = this._listeners
  48091. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  48092. },
  48093. removeEventListener: function (e, t) {
  48094. if (void 0 !== this._listeners) {
  48095. var i = this._listeners,
  48096. n = i[e]
  48097. if (void 0 !== n) {
  48098. var r = n.indexOf(t)
  48099. r !== -1 && n.splice(r, 1)
  48100. }
  48101. }
  48102. },
  48103. dispatchEvent: function (e) {
  48104. if (void 0 !== this._listeners) {
  48105. var t = this._listeners,
  48106. i = t[e.type]
  48107. if (void 0 !== i) {
  48108. e.target = this
  48109. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o]
  48110. for (var o = 0; o < r; o++) n[o].call(this, e)
  48111. }
  48112. }
  48113. }
  48114. }),
  48115. (n.Layers = function () {
  48116. this.mask = 1
  48117. }),
  48118. (n.Layers.prototype = {
  48119. constructor: n.Layers,
  48120. set: function (e) {
  48121. this.mask = 1 << e
  48122. },
  48123. enable: function (e) {
  48124. this.mask |= 1 << e
  48125. },
  48126. toggle: function (e) {
  48127. this.mask ^= 1 << e
  48128. },
  48129. disable: function (e) {
  48130. this.mask &= ~(1 << e)
  48131. },
  48132. test: function (e) {
  48133. return 0 !== (this.mask & e.mask)
  48134. }
  48135. }),
  48136. (function (e) {
  48137. function t(e, t) {
  48138. return e.distance - t.distance
  48139. }
  48140. function i(e, t, n, r) {
  48141. if (e.visible !== !1 && (e.raycast(t, n), r === !0))
  48142. for (var o = e.children, a = 0, s = o.length; a < s; a++) i(o[a], t, n, !0)
  48143. }
  48144. ;(e.Raycaster = function (t, i, n, r) {
  48145. ;(this.ray = new e.Ray(t, i)),
  48146. (this.near = n || 0),
  48147. (this.far = r || 1 / 0),
  48148. (this.params = {
  48149. Mesh: {},
  48150. Line: {},
  48151. LOD: {},
  48152. Points: {
  48153. threshold: 1
  48154. },
  48155. Sprite: {}
  48156. }),
  48157. Object.defineProperties(this.params, {
  48158. PointCloud: {
  48159. get: function () {
  48160. return (
  48161. console.warn(
  48162. 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.'
  48163. ),
  48164. this.Points
  48165. )
  48166. }
  48167. }
  48168. })
  48169. }),
  48170. (e.Raycaster.prototype = {
  48171. constructor: e.Raycaster,
  48172. linePrecision: 1,
  48173. set: function (e, t) {
  48174. this.ray.set(e, t)
  48175. },
  48176. setFromCamera: function (t, i) {
  48177. i instanceof e.PerspectiveCamera
  48178. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  48179. this.ray.direction
  48180. .set(t.x, t.y, 0.5)
  48181. .unproject(i)
  48182. .sub(this.ray.origin)
  48183. .normalize())
  48184. : i instanceof e.OrthographicCamera
  48185. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  48186. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld))
  48187. : console.error('THREE.Raycaster: Unsupported camera type.')
  48188. },
  48189. intersectObject: function (e, n) {
  48190. var r = []
  48191. return i(e, this, r, n), r.sort(t), r
  48192. },
  48193. intersectObjects: function (e, n) {
  48194. var r = []
  48195. if (Array.isArray(e) === !1)
  48196. return (
  48197. console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), r
  48198. )
  48199. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n)
  48200. return r.sort(t), r
  48201. }
  48202. })
  48203. })(n),
  48204. (n.Object3D = function () {
  48205. function e() {
  48206. o.setFromEuler(r, !1)
  48207. }
  48208. function t() {
  48209. r.setFromQuaternion(o, void 0, !1)
  48210. }
  48211. Object.defineProperty(this, 'id', {
  48212. value: n.Object3DIdCount++
  48213. }),
  48214. (this.uuid = n.Math.generateUUID()),
  48215. (this.name = ''),
  48216. (this.type = 'Object3D'),
  48217. (this.parent = null),
  48218. (this.children = []),
  48219. (this.up = n.Object3D.DefaultUp.clone())
  48220. var i = new n.Vector3(),
  48221. r = new n.Euler(),
  48222. o = new n.Quaternion(),
  48223. a = new n.Vector3(1, 1, 1)
  48224. r.onChange(e),
  48225. o.onChange(t),
  48226. Object.defineProperties(this, {
  48227. position: {
  48228. enumerable: !0,
  48229. value: i
  48230. },
  48231. rotation: {
  48232. enumerable: !0,
  48233. value: r
  48234. },
  48235. quaternion: {
  48236. enumerable: !0,
  48237. value: o
  48238. },
  48239. scale: {
  48240. enumerable: !0,
  48241. value: a
  48242. },
  48243. modelViewMatrix: {
  48244. value: new n.Matrix4()
  48245. },
  48246. normalMatrix: {
  48247. value: new n.Matrix3()
  48248. }
  48249. }),
  48250. (this.rotationAutoUpdate = !0),
  48251. (this.matrix = new n.Matrix4()),
  48252. (this.matrixWorld = new n.Matrix4()),
  48253. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  48254. (this.matrixWorldNeedsUpdate = !1),
  48255. (this.layers = new n.Layers()),
  48256. (this.visible = !0),
  48257. (this.castShadow = !1),
  48258. (this.receiveShadow = !1),
  48259. (this.frustumCulled = !0),
  48260. (this.renderOrder = 0),
  48261. (this.userData = {})
  48262. }),
  48263. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  48264. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  48265. (n.Object3D.prototype = {
  48266. constructor: n.Object3D,
  48267. applyMatrix: function (e) {
  48268. this.matrix.multiplyMatrices(e, this.matrix),
  48269. this.matrix.decompose(this.position, this.quaternion, this.scale)
  48270. },
  48271. setRotationFromAxisAngle: function (e, t) {
  48272. this.quaternion.setFromAxisAngle(e, t)
  48273. },
  48274. setRotationFromEuler: function (e) {
  48275. this.quaternion.setFromEuler(e, !0)
  48276. },
  48277. setRotationFromMatrix: function (e) {
  48278. this.quaternion.setFromRotationMatrix(e)
  48279. },
  48280. setRotationFromQuaternion: function (e) {
  48281. this.quaternion.copy(e)
  48282. },
  48283. rotateOnAxis: (function () {
  48284. var e = new n.Quaternion()
  48285. return function (t, i) {
  48286. return e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this
  48287. }
  48288. })(),
  48289. rotateX: (function () {
  48290. var e = new n.Vector3(1, 0, 0)
  48291. return function (t) {
  48292. return this.rotateOnAxis(e, t)
  48293. }
  48294. })(),
  48295. rotateY: (function () {
  48296. var e = new n.Vector3(0, 1, 0)
  48297. return function (t) {
  48298. return this.rotateOnAxis(e, t)
  48299. }
  48300. })(),
  48301. rotateZ: (function () {
  48302. var e = new n.Vector3(0, 0, 1)
  48303. return function (t) {
  48304. return this.rotateOnAxis(e, t)
  48305. }
  48306. })(),
  48307. translateOnAxis: (function () {
  48308. var e = new n.Vector3()
  48309. return function (t, i) {
  48310. return (
  48311. e.copy(t).applyQuaternion(this.quaternion),
  48312. this.position.add(e.multiplyScalar(i)),
  48313. this
  48314. )
  48315. }
  48316. })(),
  48317. translateX: (function () {
  48318. var e = new n.Vector3(1, 0, 0)
  48319. return function (t) {
  48320. return this.translateOnAxis(e, t)
  48321. }
  48322. })(),
  48323. translateY: (function () {
  48324. var e = new n.Vector3(0, 1, 0)
  48325. return function (t) {
  48326. return this.translateOnAxis(e, t)
  48327. }
  48328. })(),
  48329. translateZ: (function () {
  48330. var e = new n.Vector3(0, 0, 1)
  48331. return function (t) {
  48332. return this.translateOnAxis(e, t)
  48333. }
  48334. })(),
  48335. localToWorld: function (e) {
  48336. return e.applyMatrix4(this.matrixWorld)
  48337. },
  48338. worldToLocal: (function () {
  48339. var e = new n.Matrix4()
  48340. return function (t) {
  48341. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  48342. }
  48343. })(),
  48344. lookAt: (function () {
  48345. var e = new n.Matrix4()
  48346. return function (t) {
  48347. e.lookAt(t, this.position, this.up), this.quaternion.setFromRotationMatrix(e)
  48348. }
  48349. })(),
  48350. add: function (e) {
  48351. if (arguments.length > 1) {
  48352. for (var t = 0; t < arguments.length; t++) this.add(arguments[t])
  48353. return this
  48354. }
  48355. return e === this
  48356. ? (console.error(
  48357. "THREE.Object3D.add: object can't be added as a child of itself.",
  48358. e
  48359. ),
  48360. this)
  48361. : (e instanceof n.Object3D
  48362. ? (null !== e.parent && e.parent.remove(e),
  48363. (e.parent = this),
  48364. e.dispatchEvent({
  48365. type: 'added'
  48366. }),
  48367. this.children.push(e))
  48368. : console.error(
  48369. 'THREE.Object3D.add: object not an instance of THREE.Object3D.',
  48370. e
  48371. ),
  48372. this)
  48373. },
  48374. remove: function (e) {
  48375. if (arguments.length > 1)
  48376. for (var t = 0; t < arguments.length; t++) this.remove(arguments[t])
  48377. var i = this.children.indexOf(e)
  48378. i !== -1 &&
  48379. ((e.parent = null),
  48380. e.dispatchEvent({
  48381. type: 'removed'
  48382. }),
  48383. this.children.splice(i, 1))
  48384. },
  48385. getObjectById: function (e) {
  48386. return this.getObjectByProperty('id', e)
  48387. },
  48388. getObjectByName: function (e) {
  48389. return this.getObjectByProperty('name', e)
  48390. },
  48391. getObjectByProperty: function (e, t) {
  48392. if (this[e] === t) return this
  48393. for (var i = 0, n = this.children.length; i < n; i++) {
  48394. var r = this.children[i],
  48395. o = r.getObjectByProperty(e, t)
  48396. if (void 0 !== o) return o
  48397. }
  48398. },
  48399. getWorldPosition: function (e) {
  48400. var t = e || new n.Vector3()
  48401. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
  48402. },
  48403. getWorldQuaternion: (function () {
  48404. var e = new n.Vector3(),
  48405. t = new n.Vector3()
  48406. return function (i) {
  48407. var r = i || new n.Quaternion()
  48408. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, r, t), r
  48409. }
  48410. })(),
  48411. getWorldRotation: (function () {
  48412. var e = new n.Quaternion()
  48413. return function (t) {
  48414. var i = t || new n.Euler()
  48415. return this.getWorldQuaternion(e), i.setFromQuaternion(e, this.rotation.order, !1)
  48416. }
  48417. })(),
  48418. getWorldScale: (function () {
  48419. var e = new n.Vector3(),
  48420. t = new n.Quaternion()
  48421. return function (i) {
  48422. var r = i || new n.Vector3()
  48423. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, r), r
  48424. }
  48425. })(),
  48426. getWorldDirection: (function () {
  48427. var e = new n.Quaternion()
  48428. return function (t) {
  48429. var i = t || new n.Vector3()
  48430. return this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e)
  48431. }
  48432. })(),
  48433. raycast: function () {},
  48434. traverse: function (e) {
  48435. e(this)
  48436. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e)
  48437. },
  48438. traverseVisible: function (e) {
  48439. if (this.visible !== !1) {
  48440. e(this)
  48441. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverseVisible(e)
  48442. }
  48443. },
  48444. traverseAncestors: function (e) {
  48445. var t = this.parent
  48446. null !== t && (e(t), t.traverseAncestors(e))
  48447. },
  48448. updateMatrix: function () {
  48449. this.matrix.compose(this.position, this.quaternion, this.scale),
  48450. (this.matrixWorldNeedsUpdate = !0)
  48451. },
  48452. updateMatrixWorld: function (e) {
  48453. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  48454. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  48455. (null === this.parent
  48456. ? this.matrixWorld.copy(this.matrix)
  48457. : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  48458. (this.matrixWorldNeedsUpdate = !1),
  48459. (e = !0))
  48460. for (var t = 0, i = this.children.length; t < i; t++)
  48461. this.children[t].updateMatrixWorld(e)
  48462. },
  48463. toJSON: function (e) {
  48464. function t(e) {
  48465. var t = []
  48466. for (var i in e) {
  48467. var n = e[i]
  48468. delete n.metadata, t.push(n)
  48469. }
  48470. return t
  48471. }
  48472. var i = void 0 === e,
  48473. n = {}
  48474. i &&
  48475. ((e = {
  48476. geometries: {},
  48477. materials: {},
  48478. textures: {},
  48479. images: {}
  48480. }),
  48481. (n.metadata = {
  48482. version: 4.4,
  48483. type: 'Object',
  48484. generator: 'Object3D.toJSON'
  48485. }))
  48486. var r = {}
  48487. if (
  48488. ((r.uuid = this.uuid),
  48489. (r.type = this.type),
  48490. '' !== this.name && (r.name = this.name),
  48491. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  48492. this.castShadow === !0 && (r.castShadow = !0),
  48493. this.receiveShadow === !0 && (r.receiveShadow = !0),
  48494. this.visible === !1 && (r.visible = !1),
  48495. (r.matrix = this.matrix.toArray()),
  48496. void 0 !== this.geometry &&
  48497. (void 0 === e.geometries[this.geometry.uuid] &&
  48498. (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  48499. (r.geometry = this.geometry.uuid)),
  48500. void 0 !== this.material &&
  48501. (void 0 === e.materials[this.material.uuid] &&
  48502. (e.materials[this.material.uuid] = this.material.toJSON(e)),
  48503. (r.material = this.material.uuid)),
  48504. this.children.length > 0)
  48505. ) {
  48506. r.children = []
  48507. for (var o = 0; o < this.children.length; o++)
  48508. r.children.push(this.children[o].toJSON(e).object)
  48509. }
  48510. if (i) {
  48511. var a = t(e.geometries),
  48512. s = t(e.materials),
  48513. l = t(e.textures),
  48514. c = t(e.images)
  48515. a.length > 0 && (n.geometries = a),
  48516. s.length > 0 && (n.materials = s),
  48517. l.length > 0 && (n.textures = l),
  48518. c.length > 0 && (n.images = c)
  48519. }
  48520. return (n.object = r), n
  48521. },
  48522. clone: function (e) {
  48523. return new this.constructor().copy(this, e)
  48524. },
  48525. copy: function (e, t) {
  48526. if (
  48527. (void 0 === t && (t = !0),
  48528. (this.name = e.name),
  48529. this.up.copy(e.up),
  48530. this.position.copy(e.position),
  48531. this.quaternion.copy(e.quaternion),
  48532. this.scale.copy(e.scale),
  48533. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  48534. this.matrix.copy(e.matrix),
  48535. this.matrixWorld.copy(e.matrixWorld),
  48536. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  48537. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  48538. (this.visible = e.visible),
  48539. (this.castShadow = e.castShadow),
  48540. (this.receiveShadow = e.receiveShadow),
  48541. (this.frustumCulled = e.frustumCulled),
  48542. (this.renderOrder = e.renderOrder),
  48543. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  48544. t === !0)
  48545. )
  48546. for (var i = 0; i < e.children.length; i++) {
  48547. var n = e.children[i]
  48548. this.add(n.clone())
  48549. }
  48550. return this
  48551. }
  48552. }),
  48553. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  48554. (n.Object3DIdCount = 0),
  48555. (n.Face3 = function (e, t, i, r, o, a) {
  48556. ;(this.a = e),
  48557. (this.b = t),
  48558. (this.c = i),
  48559. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  48560. (this.vertexNormals = Array.isArray(r) ? r : []),
  48561. (this.color = o instanceof n.Color ? o : new n.Color()),
  48562. (this.vertexColors = Array.isArray(o) ? o : []),
  48563. (this.materialIndex = void 0 !== a ? a : 0)
  48564. }),
  48565. (n.Face3.prototype = {
  48566. constructor: n.Face3,
  48567. clone: function () {
  48568. return new this.constructor().copy(this)
  48569. },
  48570. copy: function (e) {
  48571. ;(this.a = e.a),
  48572. (this.b = e.b),
  48573. (this.c = e.c),
  48574. this.normal.copy(e.normal),
  48575. this.color.copy(e.color),
  48576. (this.materialIndex = e.materialIndex)
  48577. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  48578. this.vertexNormals[t] = e.vertexNormals[t].clone()
  48579. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  48580. this.vertexColors[t] = e.vertexColors[t].clone()
  48581. return this
  48582. }
  48583. }),
  48584. (n.BufferAttribute = function (e, t) {
  48585. ;(this.uuid = n.Math.generateUUID()),
  48586. (this.array = e),
  48587. (this.itemSize = t),
  48588. (this.dynamic = !1),
  48589. (this.updateRange = {
  48590. offset: 0,
  48591. count: -1
  48592. }),
  48593. (this.version = 0)
  48594. }),
  48595. (n.BufferAttribute.prototype = {
  48596. constructor: n.BufferAttribute,
  48597. get count() {
  48598. return this.array.length / this.itemSize
  48599. },
  48600. set needsUpdate(e) {
  48601. e === !0 && this.version++
  48602. },
  48603. setDynamic: function (e) {
  48604. return (this.dynamic = e), this
  48605. },
  48606. copy: function (e) {
  48607. return (
  48608. (this.array = new e.array.constructor(e.array)),
  48609. (this.itemSize = e.itemSize),
  48610. (this.dynamic = e.dynamic),
  48611. this
  48612. )
  48613. },
  48614. copyAt: function (e, t, i) {
  48615. ;(e *= this.itemSize), (i *= t.itemSize)
  48616. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n]
  48617. return this
  48618. },
  48619. copyArray: function (e) {
  48620. return this.array.set(e), this
  48621. },
  48622. copyColorsArray: function (e) {
  48623. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48624. var a = e[r]
  48625. void 0 === a &&
  48626. (console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', r),
  48627. (a = new n.Color())),
  48628. (t[i++] = a.r),
  48629. (t[i++] = a.g),
  48630. (t[i++] = a.b)
  48631. }
  48632. return this
  48633. },
  48634. copyIndicesArray: function (e) {
  48635. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  48636. var o = e[n]
  48637. ;(t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c)
  48638. }
  48639. return this
  48640. },
  48641. copyVector2sArray: function (e) {
  48642. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48643. var a = e[r]
  48644. void 0 === a &&
  48645. (console.warn(
  48646. 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined',
  48647. r
  48648. ),
  48649. (a = new n.Vector2())),
  48650. (t[i++] = a.x),
  48651. (t[i++] = a.y)
  48652. }
  48653. return this
  48654. },
  48655. copyVector3sArray: function (e) {
  48656. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48657. var a = e[r]
  48658. void 0 === a &&
  48659. (console.warn(
  48660. 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined',
  48661. r
  48662. ),
  48663. (a = new n.Vector3())),
  48664. (t[i++] = a.x),
  48665. (t[i++] = a.y),
  48666. (t[i++] = a.z)
  48667. }
  48668. return this
  48669. },
  48670. copyVector4sArray: function (e) {
  48671. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48672. var a = e[r]
  48673. void 0 === a &&
  48674. (console.warn(
  48675. 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined',
  48676. r
  48677. ),
  48678. (a = new n.Vector4())),
  48679. (t[i++] = a.x),
  48680. (t[i++] = a.y),
  48681. (t[i++] = a.z),
  48682. (t[i++] = a.w)
  48683. }
  48684. return this
  48685. },
  48686. set: function (e, t) {
  48687. return void 0 === t && (t = 0), this.array.set(e, t), this
  48688. },
  48689. getX: function (e) {
  48690. return this.array[e * this.itemSize]
  48691. },
  48692. setX: function (e, t) {
  48693. return (this.array[e * this.itemSize] = t), this
  48694. },
  48695. getY: function (e) {
  48696. return this.array[e * this.itemSize + 1]
  48697. },
  48698. setY: function (e, t) {
  48699. return (this.array[e * this.itemSize + 1] = t), this
  48700. },
  48701. getZ: function (e) {
  48702. return this.array[e * this.itemSize + 2]
  48703. },
  48704. setZ: function (e, t) {
  48705. return (this.array[e * this.itemSize + 2] = t), this
  48706. },
  48707. getW: function (e) {
  48708. return this.array[e * this.itemSize + 3]
  48709. },
  48710. setW: function (e, t) {
  48711. return (this.array[e * this.itemSize + 3] = t), this
  48712. },
  48713. setXY: function (e, t, i) {
  48714. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this
  48715. },
  48716. setXYZ: function (e, t, i, n) {
  48717. return (
  48718. (e *= this.itemSize),
  48719. (this.array[e + 0] = t),
  48720. (this.array[e + 1] = i),
  48721. (this.array[e + 2] = n),
  48722. this
  48723. )
  48724. },
  48725. setXYZW: function (e, t, i, n, r) {
  48726. return (
  48727. (e *= this.itemSize),
  48728. (this.array[e + 0] = t),
  48729. (this.array[e + 1] = i),
  48730. (this.array[e + 2] = n),
  48731. (this.array[e + 3] = r),
  48732. this
  48733. )
  48734. },
  48735. clone: function () {
  48736. return new this.constructor().copy(this)
  48737. }
  48738. }),
  48739. (n.Int8Attribute = function (e, t) {
  48740. return new n.BufferAttribute(new Int8Array(e), t)
  48741. }),
  48742. (n.Uint8Attribute = function (e, t) {
  48743. return new n.BufferAttribute(new Uint8Array(e), t)
  48744. }),
  48745. (n.Uint8ClampedAttribute = function (e, t) {
  48746. return new n.BufferAttribute(new Uint8ClampedArray(e), t)
  48747. }),
  48748. (n.Int16Attribute = function (e, t) {
  48749. return new n.BufferAttribute(new Int16Array(e), t)
  48750. }),
  48751. (n.Uint16Attribute = function (e, t) {
  48752. return new n.BufferAttribute(new Uint16Array(e), t)
  48753. })
  48754. n.Int32Attribute = function (e, t) {
  48755. return new n.BufferAttribute(new Int32Array(e), t)
  48756. }
  48757. ;(n.Uint32Attribute = function (e, t) {
  48758. return new n.BufferAttribute(new Uint32Array(e), t)
  48759. }),
  48760. (n.Float32Attribute = function (e, t) {
  48761. return new n.BufferAttribute(new Float32Array(e), t)
  48762. }),
  48763. (n.Float64Attribute = function (e, t) {
  48764. return new n.BufferAttribute(new Float64Array(e), t)
  48765. }),
  48766. (n.DynamicBufferAttribute = function (e, t) {
  48767. return (
  48768. console.warn(
  48769. 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'
  48770. ),
  48771. new n.BufferAttribute(e, t).setDynamic(!0)
  48772. )
  48773. }),
  48774. (n.InstancedBufferAttribute = function (e, t, i) {
  48775. n.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1)
  48776. }),
  48777. (n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype)),
  48778. (n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute),
  48779. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  48780. return (
  48781. n.BufferAttribute.prototype.copy.call(this, e),
  48782. (this.meshPerAttribute = e.meshPerAttribute),
  48783. this
  48784. )
  48785. }),
  48786. (n.InterleavedBuffer = function (e, t) {
  48787. ;(this.uuid = n.Math.generateUUID()),
  48788. (this.array = e),
  48789. (this.stride = t),
  48790. (this.dynamic = !1),
  48791. (this.updateRange = {
  48792. offset: 0,
  48793. count: -1
  48794. }),
  48795. (this.version = 0)
  48796. }),
  48797. (n.InterleavedBuffer.prototype = {
  48798. constructor: n.InterleavedBuffer,
  48799. get length() {
  48800. return this.array.length
  48801. },
  48802. get count() {
  48803. return this.array.length / this.stride
  48804. },
  48805. set needsUpdate(e) {
  48806. e === !0 && this.version++
  48807. },
  48808. setDynamic: function (e) {
  48809. return (this.dynamic = e), this
  48810. },
  48811. copy: function (e) {
  48812. return (
  48813. (this.array = new e.array.constructor(e.array)),
  48814. (this.stride = e.stride),
  48815. (this.dynamic = e.dynamic),
  48816. this
  48817. )
  48818. },
  48819. copyAt: function (e, t, i) {
  48820. ;(e *= this.stride), (i *= t.stride)
  48821. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n]
  48822. return this
  48823. },
  48824. set: function (e, t) {
  48825. return void 0 === t && (t = 0), this.array.set(e, t), this
  48826. },
  48827. clone: function () {
  48828. return new this.constructor().copy(this)
  48829. }
  48830. }),
  48831. (n.InstancedInterleavedBuffer = function (e, t, i) {
  48832. n.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1)
  48833. }),
  48834. (n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype)),
  48835. (n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer),
  48836. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  48837. return (
  48838. n.InterleavedBuffer.prototype.copy.call(this, e),
  48839. (this.meshPerAttribute = e.meshPerAttribute),
  48840. this
  48841. )
  48842. }),
  48843. (n.InterleavedBufferAttribute = function (e, t, i) {
  48844. ;(this.uuid = n.Math.generateUUID()),
  48845. (this.data = e),
  48846. (this.itemSize = t),
  48847. (this.offset = i)
  48848. }),
  48849. (n.InterleavedBufferAttribute.prototype = {
  48850. constructor: n.InterleavedBufferAttribute,
  48851. get length() {
  48852. return (
  48853. console.warn(
  48854. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  48855. ),
  48856. this.array.length
  48857. )
  48858. },
  48859. get count() {
  48860. return this.data.count
  48861. },
  48862. setX: function (e, t) {
  48863. return (this.data.array[e * this.data.stride + this.offset] = t), this
  48864. },
  48865. setY: function (e, t) {
  48866. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this
  48867. },
  48868. setZ: function (e, t) {
  48869. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this
  48870. },
  48871. setW: function (e, t) {
  48872. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this
  48873. },
  48874. getX: function (e) {
  48875. return this.data.array[e * this.data.stride + this.offset]
  48876. },
  48877. getY: function (e) {
  48878. return this.data.array[e * this.data.stride + this.offset + 1]
  48879. },
  48880. getZ: function (e) {
  48881. return this.data.array[e * this.data.stride + this.offset + 2]
  48882. },
  48883. getW: function (e) {
  48884. return this.data.array[e * this.data.stride + this.offset + 3]
  48885. },
  48886. setXY: function (e, t, i) {
  48887. return (
  48888. (e = e * this.data.stride + this.offset),
  48889. (this.data.array[e + 0] = t),
  48890. (this.data.array[e + 1] = i),
  48891. this
  48892. )
  48893. },
  48894. setXYZ: function (e, t, i, n) {
  48895. return (
  48896. (e = e * this.data.stride + this.offset),
  48897. (this.data.array[e + 0] = t),
  48898. (this.data.array[e + 1] = i),
  48899. (this.data.array[e + 2] = n),
  48900. this
  48901. )
  48902. },
  48903. setXYZW: function (e, t, i, n, r) {
  48904. return (
  48905. (e = e * this.data.stride + this.offset),
  48906. (this.data.array[e + 0] = t),
  48907. (this.data.array[e + 1] = i),
  48908. (this.data.array[e + 2] = n),
  48909. (this.data.array[e + 3] = r),
  48910. this
  48911. )
  48912. }
  48913. }),
  48914. (n.Geometry = function () {
  48915. Object.defineProperty(this, 'id', {
  48916. value: n.GeometryIdCount++
  48917. }),
  48918. (this.uuid = n.Math.generateUUID()),
  48919. (this.name = ''),
  48920. (this.type = 'Geometry'),
  48921. (this.vertices = []),
  48922. (this.colors = []),
  48923. (this.faces = []),
  48924. (this.faceVertexUvs = [[]]),
  48925. (this.morphTargets = []),
  48926. (this.morphNormals = []),
  48927. (this.skinWeights = []),
  48928. (this.skinIndices = []),
  48929. (this.lineDistances = []),
  48930. (this.boundingBox = null),
  48931. (this.boundingSphere = null),
  48932. (this.verticesNeedUpdate = !1),
  48933. (this.elementsNeedUpdate = !1),
  48934. (this.uvsNeedUpdate = !1),
  48935. (this.normalsNeedUpdate = !1),
  48936. (this.colorsNeedUpdate = !1),
  48937. (this.lineDistancesNeedUpdate = !1),
  48938. (this.groupsNeedUpdate = !1)
  48939. }),
  48940. (n.Geometry.prototype = {
  48941. constructor: n.Geometry,
  48942. applyMatrix: function (e) {
  48943. for (
  48944. var t = new n.Matrix3().getNormalMatrix(e), i = 0, r = this.vertices.length;
  48945. i < r;
  48946. i++
  48947. ) {
  48948. var o = this.vertices[i]
  48949. o.applyMatrix4(e)
  48950. }
  48951. for (var i = 0, r = this.faces.length; i < r; i++) {
  48952. var a = this.faces[i]
  48953. a.normal.applyMatrix3(t).normalize()
  48954. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  48955. a.vertexNormals[s].applyMatrix3(t).normalize()
  48956. }
  48957. return (
  48958. null !== this.boundingBox && this.computeBoundingBox(),
  48959. null !== this.boundingSphere && this.computeBoundingSphere(),
  48960. (this.verticesNeedUpdate = !0),
  48961. (this.normalsNeedUpdate = !0),
  48962. this
  48963. )
  48964. },
  48965. rotateX: (function () {
  48966. var e
  48967. return function (t) {
  48968. return (
  48969. void 0 === e && (e = new n.Matrix4()),
  48970. e.makeRotationX(t),
  48971. this.applyMatrix(e),
  48972. this
  48973. )
  48974. }
  48975. })(),
  48976. rotateY: (function () {
  48977. var e
  48978. return function (t) {
  48979. return (
  48980. void 0 === e && (e = new n.Matrix4()),
  48981. e.makeRotationY(t),
  48982. this.applyMatrix(e),
  48983. this
  48984. )
  48985. }
  48986. })(),
  48987. rotateZ: (function () {
  48988. var e
  48989. return function (t) {
  48990. return (
  48991. void 0 === e && (e = new n.Matrix4()),
  48992. e.makeRotationZ(t),
  48993. this.applyMatrix(e),
  48994. this
  48995. )
  48996. }
  48997. })(),
  48998. translate: (function () {
  48999. var e
  49000. return function (t, i, r) {
  49001. return (
  49002. void 0 === e && (e = new n.Matrix4()),
  49003. e.makeTranslation(t, i, r),
  49004. this.applyMatrix(e),
  49005. this
  49006. )
  49007. }
  49008. })(),
  49009. scale: (function () {
  49010. var e
  49011. return function (t, i, r) {
  49012. return (
  49013. void 0 === e && (e = new n.Matrix4()),
  49014. e.makeScale(t, i, r),
  49015. this.applyMatrix(e),
  49016. this
  49017. )
  49018. }
  49019. })(),
  49020. lookAt: (function () {
  49021. var e
  49022. return function (t) {
  49023. void 0 === e && (e = new n.Object3D()),
  49024. e.lookAt(t),
  49025. e.updateMatrix(),
  49026. this.applyMatrix(e.matrix)
  49027. }
  49028. })(),
  49029. fromBufferGeometry: function (e) {
  49030. function t(e, t, r, o) {
  49031. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : [],
  49032. f =
  49033. void 0 !== l
  49034. ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()]
  49035. : [],
  49036. g = new n.Face3(e, t, r, a, f, o)
  49037. i.faces.push(g),
  49038. void 0 !== c &&
  49039. i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  49040. void 0 !== h &&
  49041. i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  49042. }
  49043. var i = this,
  49044. r = null !== e.index ? e.index.array : void 0,
  49045. o = e.attributes,
  49046. a = o.position.array,
  49047. s = void 0 !== o.normal ? o.normal.array : void 0,
  49048. l = void 0 !== o.color ? o.color.array : void 0,
  49049. c = void 0 !== o.uv ? o.uv.array : void 0,
  49050. h = void 0 !== o.uv2 ? o.uv2.array : void 0
  49051. void 0 !== h && (this.faceVertexUvs[1] = [])
  49052. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3, g += 2)
  49053. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  49054. void 0 !== s && u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  49055. void 0 !== l && i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  49056. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  49057. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]))
  49058. if (void 0 !== r) {
  49059. var m = e.groups
  49060. if (m.length > 0)
  49061. for (var f = 0; f < m.length; f++)
  49062. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  49063. t(r[g], r[g + 1], r[g + 2], v.materialIndex)
  49064. else for (var f = 0; f < r.length; f += 3) t(r[f], r[f + 1], r[f + 2])
  49065. } else for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2)
  49066. return (
  49067. this.computeFaceNormals(),
  49068. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  49069. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  49070. this
  49071. )
  49072. },
  49073. center: function () {
  49074. this.computeBoundingBox()
  49075. var e = this.boundingBox.center().negate()
  49076. return this.translate(e.x, e.y, e.z), e
  49077. },
  49078. normalize: function () {
  49079. this.computeBoundingSphere()
  49080. var e = this.boundingSphere.center,
  49081. t = this.boundingSphere.radius,
  49082. i = 0 === t ? 1 : 1 / t,
  49083. r = new n.Matrix4()
  49084. return (
  49085. r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  49086. this.applyMatrix(r),
  49087. this
  49088. )
  49089. },
  49090. computeFaceNormals: function () {
  49091. for (
  49092. var e = new n.Vector3(), t = new n.Vector3(), i = 0, r = this.faces.length;
  49093. i < r;
  49094. i++
  49095. ) {
  49096. var o = this.faces[i],
  49097. a = this.vertices[o.a],
  49098. s = this.vertices[o.b],
  49099. l = this.vertices[o.c]
  49100. e.subVectors(l, s), t.subVectors(a, s), e.cross(t), e.normalize(), o.normal.copy(e)
  49101. }
  49102. },
  49103. computeVertexNormals: function (e) {
  49104. void 0 === e && (e = !0)
  49105. var t, i, r, o, a, s
  49106. for (s = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++)
  49107. s[t] = new n.Vector3()
  49108. if (e) {
  49109. var l,
  49110. c,
  49111. h,
  49112. u = new n.Vector3(),
  49113. d = new n.Vector3()
  49114. for (r = 0, o = this.faces.length; r < o; r++)
  49115. (a = this.faces[r]),
  49116. (l = this.vertices[a.a]),
  49117. (c = this.vertices[a.b]),
  49118. (h = this.vertices[a.c]),
  49119. u.subVectors(h, c),
  49120. d.subVectors(l, c),
  49121. u.cross(d),
  49122. s[a.a].add(u),
  49123. s[a.b].add(u),
  49124. s[a.c].add(u)
  49125. } else
  49126. for (r = 0, o = this.faces.length; r < o; r++)
  49127. (a = this.faces[r]),
  49128. s[a.a].add(a.normal),
  49129. s[a.b].add(a.normal),
  49130. s[a.c].add(a.normal)
  49131. for (t = 0, i = this.vertices.length; t < i; t++) s[t].normalize()
  49132. for (r = 0, o = this.faces.length; r < o; r++) {
  49133. a = this.faces[r]
  49134. var p = a.vertexNormals
  49135. 3 === p.length
  49136. ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c]))
  49137. : ((p[0] = s[a.a].clone()), (p[1] = s[a.b].clone()), (p[2] = s[a.c].clone()))
  49138. }
  49139. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  49140. },
  49141. computeMorphNormals: function () {
  49142. var e, t, i, r, o
  49143. for (i = 0, r = this.faces.length; i < r; i++)
  49144. for (
  49145. o = this.faces[i],
  49146. o.__originalFaceNormal
  49147. ? o.__originalFaceNormal.copy(o.normal)
  49148. : (o.__originalFaceNormal = o.normal.clone()),
  49149. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  49150. e = 0,
  49151. t = o.vertexNormals.length;
  49152. e < t;
  49153. e++
  49154. )
  49155. o.__originalVertexNormals[e]
  49156. ? o.__originalVertexNormals[e].copy(o.vertexNormals[e])
  49157. : (o.__originalVertexNormals[e] = o.vertexNormals[e].clone())
  49158. var a = new n.Geometry()
  49159. for (a.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  49160. if (!this.morphNormals[e]) {
  49161. ;(this.morphNormals[e] = {}),
  49162. (this.morphNormals[e].faceNormals = []),
  49163. (this.morphNormals[e].vertexNormals = [])
  49164. var s,
  49165. l,
  49166. c = this.morphNormals[e].faceNormals,
  49167. h = this.morphNormals[e].vertexNormals
  49168. for (i = 0, r = this.faces.length; i < r; i++)
  49169. (s = new n.Vector3()),
  49170. (l = {
  49171. a: new n.Vector3(),
  49172. b: new n.Vector3(),
  49173. c: new n.Vector3()
  49174. }),
  49175. c.push(s),
  49176. h.push(l)
  49177. }
  49178. var u = this.morphNormals[e]
  49179. ;(a.vertices = this.morphTargets[e].vertices),
  49180. a.computeFaceNormals(),
  49181. a.computeVertexNormals()
  49182. var s, l
  49183. for (i = 0, r = this.faces.length; i < r; i++)
  49184. (o = this.faces[i]),
  49185. (s = u.faceNormals[i]),
  49186. (l = u.vertexNormals[i]),
  49187. s.copy(o.normal),
  49188. l.a.copy(o.vertexNormals[0]),
  49189. l.b.copy(o.vertexNormals[1]),
  49190. l.c.copy(o.vertexNormals[2])
  49191. }
  49192. for (i = 0, r = this.faces.length; i < r; i++)
  49193. (o = this.faces[i]),
  49194. (o.normal = o.__originalFaceNormal),
  49195. (o.vertexNormals = o.__originalVertexNormals)
  49196. },
  49197. computeTangents: function () {
  49198. console.warn('THREE.Geometry: .computeTangents() has been removed.')
  49199. },
  49200. computeLineDistances: function () {
  49201. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  49202. i > 0 && (e += t[i].distanceTo(t[i - 1])), (this.lineDistances[i] = e)
  49203. },
  49204. computeBoundingBox: function () {
  49205. null === this.boundingBox && (this.boundingBox = new n.Box3()),
  49206. this.boundingBox.setFromPoints(this.vertices)
  49207. },
  49208. computeBoundingSphere: function () {
  49209. null === this.boundingSphere && (this.boundingSphere = new n.Sphere()),
  49210. this.boundingSphere.setFromPoints(this.vertices)
  49211. },
  49212. merge: function (e, t, i) {
  49213. if (e instanceof n.Geometry == !1)
  49214. return void console.error(
  49215. 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.',
  49216. e
  49217. )
  49218. var r,
  49219. o = this.vertices.length,
  49220. a = this.vertices,
  49221. s = e.vertices,
  49222. l = this.faces,
  49223. c = e.faces,
  49224. h = this.faceVertexUvs[0],
  49225. u = e.faceVertexUvs[0]
  49226. void 0 === i && (i = 0), void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t))
  49227. for (var d = 0, p = s.length; d < p; d++) {
  49228. var f = s[d],
  49229. g = f.clone()
  49230. void 0 !== t && g.applyMatrix4(t), a.push(g)
  49231. }
  49232. for (d = 0, p = c.length; d < p; d++) {
  49233. var m,
  49234. v,
  49235. A,
  49236. y = c[d],
  49237. C = y.vertexNormals,
  49238. I = y.vertexColors
  49239. ;(m = new n.Face3(y.a + o, y.b + o, y.c + o)),
  49240. m.normal.copy(y.normal),
  49241. void 0 !== r && m.normal.applyMatrix3(r).normalize()
  49242. for (var E = 0, b = C.length; E < b; E++)
  49243. (v = C[E].clone()),
  49244. void 0 !== r && v.applyMatrix3(r).normalize(),
  49245. m.vertexNormals.push(v)
  49246. m.color.copy(y.color)
  49247. for (var E = 0, b = I.length; E < b; E++) (A = I[E]), m.vertexColors.push(A.clone())
  49248. ;(m.materialIndex = y.materialIndex + i), l.push(m)
  49249. }
  49250. for (d = 0, p = u.length; d < p; d++) {
  49251. var w = u[d],
  49252. _ = []
  49253. if (void 0 !== w) {
  49254. for (var E = 0, b = w.length; E < b; E++) _.push(w[E].clone())
  49255. h.push(_)
  49256. }
  49257. }
  49258. },
  49259. mergeMesh: function (e) {
  49260. return e instanceof n.Mesh == !1
  49261. ? void console.error(
  49262. 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.',
  49263. e
  49264. )
  49265. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix))
  49266. },
  49267. mergeVertices: function () {
  49268. var e,
  49269. t,
  49270. i,
  49271. n,
  49272. r,
  49273. o,
  49274. a,
  49275. s,
  49276. l = {},
  49277. c = [],
  49278. h = [],
  49279. u = 4,
  49280. d = Math.pow(10, u)
  49281. for (i = 0, n = this.vertices.length; i < n; i++)
  49282. (e = this.vertices[i]),
  49283. (t = Math.round(e.x * d) + '_' + Math.round(e.y * d) + '_' + Math.round(e.z * d)),
  49284. void 0 === l[t]
  49285. ? ((l[t] = i), c.push(this.vertices[i]), (h[i] = c.length - 1))
  49286. : (h[i] = h[l[t]])
  49287. var p = []
  49288. for (i = 0, n = this.faces.length; i < n; i++) {
  49289. ;(r = this.faces[i]),
  49290. (r.a = h[r.a]),
  49291. (r.b = h[r.b]),
  49292. (r.c = h[r.c]),
  49293. (o = [r.a, r.b, r.c])
  49294. for (var f = -1, g = 0; g < 3; g++)
  49295. if (o[g] === o[(g + 1) % 3]) {
  49296. ;(f = g), p.push(i)
  49297. break
  49298. }
  49299. }
  49300. for (i = p.length - 1; i >= 0; i--) {
  49301. var m = p[i]
  49302. for (this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++)
  49303. this.faceVertexUvs[a].splice(m, 1)
  49304. }
  49305. var v = this.vertices.length - c.length
  49306. return (this.vertices = c), v
  49307. },
  49308. sortFacesByMaterialIndex: function () {
  49309. function e(e, t) {
  49310. return e.materialIndex - t.materialIndex
  49311. }
  49312. for (var t = this.faces, i = t.length, n = 0; n < i; n++) t[n]._id = n
  49313. t.sort(e)
  49314. var r,
  49315. o,
  49316. a = this.faceVertexUvs[0],
  49317. s = this.faceVertexUvs[1]
  49318. a && a.length === i && (r = []), s && s.length === i && (o = [])
  49319. for (var n = 0; n < i; n++) {
  49320. var l = t[n]._id
  49321. r && r.push(a[l]), o && o.push(s[l])
  49322. }
  49323. r && (this.faceVertexUvs[0] = r), o && (this.faceVertexUvs[1] = o)
  49324. },
  49325. toJSON: function () {
  49326. function e(e, t, i) {
  49327. return i ? e | (1 << t) : e & ~(1 << t)
  49328. }
  49329. function t(e) {
  49330. var t = e.x.toString() + e.y.toString() + e.z.toString()
  49331. return void 0 !== d[t] ? d[t] : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t])
  49332. }
  49333. function i(e) {
  49334. var t = e.r.toString() + e.g.toString() + e.b.toString()
  49335. return void 0 !== f[t] ? f[t] : ((f[t] = p.length), p.push(e.getHex()), f[t])
  49336. }
  49337. function n(e) {
  49338. var t = e.x.toString() + e.y.toString()
  49339. return void 0 !== m[t] ? m[t] : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t])
  49340. }
  49341. var r = {
  49342. metadata: {
  49343. version: 4.4,
  49344. type: 'Geometry',
  49345. generator: 'Geometry.toJSON'
  49346. }
  49347. }
  49348. if (
  49349. ((r.uuid = this.uuid),
  49350. (r.type = this.type),
  49351. '' !== this.name && (r.name = this.name),
  49352. void 0 !== this.parameters)
  49353. ) {
  49354. var o = this.parameters
  49355. for (var a in o) void 0 !== o[a] && (r[a] = o[a])
  49356. return r
  49357. }
  49358. for (var s = [], l = 0; l < this.vertices.length; l++) {
  49359. var c = this.vertices[l]
  49360. s.push(c.x, c.y, c.z)
  49361. }
  49362. for (
  49363. var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0;
  49364. l < this.faces.length;
  49365. l++
  49366. ) {
  49367. var v = this.faces[l],
  49368. A = !0,
  49369. y = !1,
  49370. C = void 0 !== this.faceVertexUvs[0][l],
  49371. I = v.normal.length() > 0,
  49372. E = v.vertexNormals.length > 0,
  49373. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  49374. w = v.vertexColors.length > 0,
  49375. _ = 0
  49376. if (
  49377. ((_ = e(_, 0, 0)),
  49378. (_ = e(_, 1, A)),
  49379. (_ = e(_, 2, y)),
  49380. (_ = e(_, 3, C)),
  49381. (_ = e(_, 4, I)),
  49382. (_ = e(_, 5, E)),
  49383. (_ = e(_, 6, b)),
  49384. (_ = e(_, 7, w)),
  49385. h.push(_),
  49386. h.push(v.a, v.b, v.c),
  49387. h.push(v.materialIndex),
  49388. C)
  49389. ) {
  49390. var T = this.faceVertexUvs[0][l]
  49391. h.push(n(T[0]), n(T[1]), n(T[2]))
  49392. }
  49393. if ((I && h.push(t(v.normal)), E)) {
  49394. var x = v.vertexNormals
  49395. h.push(t(x[0]), t(x[1]), t(x[2]))
  49396. }
  49397. if ((b && h.push(i(v.color)), w)) {
  49398. var S = v.vertexColors
  49399. h.push(i(S[0]), i(S[1]), i(S[2]))
  49400. }
  49401. }
  49402. return (
  49403. (r.data = {}),
  49404. (r.data.vertices = s),
  49405. (r.data.normals = u),
  49406. p.length > 0 && (r.data.colors = p),
  49407. g.length > 0 && (r.data.uvs = [g]),
  49408. (r.data.faces = h),
  49409. r
  49410. )
  49411. },
  49412. clone: function () {
  49413. return new n.Geometry().copy(this)
  49414. },
  49415. copy: function (e) {
  49416. ;(this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]])
  49417. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  49418. this.vertices.push(t[i].clone())
  49419. for (var r = e.faces, i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone())
  49420. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  49421. var o = e.faceVertexUvs[i]
  49422. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = [])
  49423. for (var a = 0, s = o.length; a < s; a++) {
  49424. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  49425. var d = l[h]
  49426. c.push(d.clone())
  49427. }
  49428. this.faceVertexUvs[i].push(c)
  49429. }
  49430. }
  49431. return this
  49432. },
  49433. dispose: function () {
  49434. this.dispatchEvent({
  49435. type: 'dispose'
  49436. })
  49437. }
  49438. }),
  49439. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  49440. (n.GeometryIdCount = 0),
  49441. (n.DirectGeometry = function () {
  49442. Object.defineProperty(this, 'id', {
  49443. value: n.GeometryIdCount++
  49444. }),
  49445. (this.uuid = n.Math.generateUUID()),
  49446. (this.name = ''),
  49447. (this.type = 'DirectGeometry'),
  49448. (this.indices = []),
  49449. (this.vertices = []),
  49450. (this.normals = []),
  49451. (this.colors = []),
  49452. (this.uvs = []),
  49453. (this.uvs2 = []),
  49454. (this.groups = []),
  49455. (this.morphTargets = {}),
  49456. (this.skinWeights = []),
  49457. (this.skinIndices = []),
  49458. (this.boundingBox = null),
  49459. (this.boundingSphere = null),
  49460. (this.verticesNeedUpdate = !1),
  49461. (this.normalsNeedUpdate = !1),
  49462. (this.colorsNeedUpdate = !1),
  49463. (this.uvsNeedUpdate = !1),
  49464. (this.groupsNeedUpdate = !1)
  49465. }),
  49466. (n.DirectGeometry.prototype = {
  49467. constructor: n.DirectGeometry,
  49468. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  49469. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  49470. computeFaceNormals: function () {
  49471. console.warn(
  49472. 'THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.'
  49473. )
  49474. },
  49475. computeVertexNormals: function () {
  49476. console.warn(
  49477. 'THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.'
  49478. )
  49479. },
  49480. computeGroups: function (e) {
  49481. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  49482. var a = r[o]
  49483. a.materialIndex !== i &&
  49484. ((i = a.materialIndex),
  49485. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  49486. (t = {
  49487. start: 3 * o,
  49488. materialIndex: i
  49489. }))
  49490. }
  49491. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n)
  49492. },
  49493. fromGeometry: function (e) {
  49494. var t,
  49495. i = e.faces,
  49496. r = e.vertices,
  49497. o = e.faceVertexUvs,
  49498. a = o[0] && o[0].length > 0,
  49499. s = o[1] && o[1].length > 0,
  49500. l = e.morphTargets,
  49501. c = l.length
  49502. if (c > 0) {
  49503. t = []
  49504. for (var h = 0; h < c; h++) t[h] = []
  49505. this.morphTargets.position = t
  49506. }
  49507. var u,
  49508. d = e.morphNormals,
  49509. p = d.length
  49510. if (p > 0) {
  49511. u = []
  49512. for (var h = 0; h < p; h++) u[h] = []
  49513. this.morphTargets.normal = u
  49514. }
  49515. for (
  49516. var f = e.skinIndices,
  49517. g = e.skinWeights,
  49518. m = f.length === r.length,
  49519. v = g.length === r.length,
  49520. h = 0;
  49521. h < i.length;
  49522. h++
  49523. ) {
  49524. var A = i[h]
  49525. this.vertices.push(r[A.a], r[A.b], r[A.c])
  49526. var y = A.vertexNormals
  49527. if (3 === y.length) this.normals.push(y[0], y[1], y[2])
  49528. else {
  49529. var C = A.normal
  49530. this.normals.push(C, C, C)
  49531. }
  49532. var I = A.vertexColors
  49533. if (3 === I.length) this.colors.push(I[0], I[1], I[2])
  49534. else {
  49535. var E = A.color
  49536. this.colors.push(E, E, E)
  49537. }
  49538. if (a === !0) {
  49539. var b = o[0][h]
  49540. void 0 !== b
  49541. ? this.uvs.push(b[0], b[1], b[2])
  49542. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', h),
  49543. this.uvs.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  49544. }
  49545. if (s === !0) {
  49546. var b = o[1][h]
  49547. void 0 !== b
  49548. ? this.uvs2.push(b[0], b[1], b[2])
  49549. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', h),
  49550. this.uvs2.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  49551. }
  49552. for (var w = 0; w < c; w++) {
  49553. var _ = l[w].vertices
  49554. t[w].push(_[A.a], _[A.b], _[A.c])
  49555. }
  49556. for (var w = 0; w < p; w++) {
  49557. var T = d[w].vertexNormals[h]
  49558. u[w].push(T.a, T.b, T.c)
  49559. }
  49560. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  49561. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  49562. }
  49563. return (
  49564. this.computeGroups(e),
  49565. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  49566. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  49567. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  49568. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  49569. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  49570. this
  49571. )
  49572. },
  49573. dispose: function () {
  49574. this.dispatchEvent({
  49575. type: 'dispose'
  49576. })
  49577. }
  49578. }),
  49579. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  49580. (n.BufferGeometry = function () {
  49581. Object.defineProperty(this, 'id', {
  49582. value: n.GeometryIdCount++
  49583. }),
  49584. (this.uuid = n.Math.generateUUID()),
  49585. (this.name = ''),
  49586. (this.type = 'BufferGeometry'),
  49587. (this.index = null),
  49588. (this.attributes = {}),
  49589. (this.morphAttributes = {}),
  49590. (this.groups = []),
  49591. (this.boundingBox = null),
  49592. (this.boundingSphere = null),
  49593. (this.drawRange = {
  49594. start: 0,
  49595. count: 1 / 0
  49596. })
  49597. }),
  49598. (n.BufferGeometry.prototype = {
  49599. constructor: n.BufferGeometry,
  49600. getIndex: function () {
  49601. return this.index
  49602. },
  49603. setIndex: function (e) {
  49604. this.index = e
  49605. },
  49606. addAttribute: function (e, t) {
  49607. return t instanceof n.BufferAttribute == !1 &&
  49608. t instanceof n.InterleavedBufferAttribute == !1
  49609. ? (console.warn(
  49610. 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'
  49611. ),
  49612. void this.addAttribute(e, new n.BufferAttribute(arguments[1], arguments[2])))
  49613. : 'index' === e
  49614. ? (console.warn(
  49615. 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'
  49616. ),
  49617. void this.setIndex(t))
  49618. : ((this.attributes[e] = t), this)
  49619. },
  49620. getAttribute: function (e) {
  49621. return this.attributes[e]
  49622. },
  49623. removeAttribute: function (e) {
  49624. return delete this.attributes[e], this
  49625. },
  49626. addGroup: function (e, t, i) {
  49627. this.groups.push({
  49628. start: e,
  49629. count: t,
  49630. materialIndex: void 0 !== i ? i : 0
  49631. })
  49632. },
  49633. clearGroups: function () {
  49634. this.groups = []
  49635. },
  49636. setDrawRange: function (e, t) {
  49637. ;(this.drawRange.start = e), (this.drawRange.count = t)
  49638. },
  49639. applyMatrix: function (e) {
  49640. var t = this.attributes.position
  49641. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0))
  49642. var i = this.attributes.normal
  49643. if (void 0 !== i) {
  49644. var r = new n.Matrix3().getNormalMatrix(e)
  49645. r.applyToVector3Array(i.array), (i.needsUpdate = !0)
  49646. }
  49647. return (
  49648. null !== this.boundingBox && this.computeBoundingBox(),
  49649. null !== this.boundingSphere && this.computeBoundingSphere(),
  49650. this
  49651. )
  49652. },
  49653. rotateX: (function () {
  49654. var e
  49655. return function (t) {
  49656. return (
  49657. void 0 === e && (e = new n.Matrix4()),
  49658. e.makeRotationX(t),
  49659. this.applyMatrix(e),
  49660. this
  49661. )
  49662. }
  49663. })(),
  49664. rotateY: (function () {
  49665. var e
  49666. return function (t) {
  49667. return (
  49668. void 0 === e && (e = new n.Matrix4()),
  49669. e.makeRotationY(t),
  49670. this.applyMatrix(e),
  49671. this
  49672. )
  49673. }
  49674. })(),
  49675. rotateZ: (function () {
  49676. var e
  49677. return function (t) {
  49678. return (
  49679. void 0 === e && (e = new n.Matrix4()),
  49680. e.makeRotationZ(t),
  49681. this.applyMatrix(e),
  49682. this
  49683. )
  49684. }
  49685. })(),
  49686. translate: (function () {
  49687. var e
  49688. return function (t, i, r) {
  49689. return (
  49690. void 0 === e && (e = new n.Matrix4()),
  49691. e.makeTranslation(t, i, r),
  49692. this.applyMatrix(e),
  49693. this
  49694. )
  49695. }
  49696. })(),
  49697. scale: (function () {
  49698. var e
  49699. return function (t, i, r) {
  49700. return (
  49701. void 0 === e && (e = new n.Matrix4()),
  49702. e.makeScale(t, i, r),
  49703. this.applyMatrix(e),
  49704. this
  49705. )
  49706. }
  49707. })(),
  49708. lookAt: (function () {
  49709. var e
  49710. return function (t) {
  49711. void 0 === e && (e = new n.Object3D()),
  49712. e.lookAt(t),
  49713. e.updateMatrix(),
  49714. this.applyMatrix(e.matrix)
  49715. }
  49716. })(),
  49717. center: function () {
  49718. this.computeBoundingBox()
  49719. var e = this.boundingBox.center().negate()
  49720. return this.translate(e.x, e.y, e.z), e
  49721. },
  49722. setFromObject: function (e) {
  49723. var t = e.geometry
  49724. if (e instanceof n.Points || e instanceof n.Line) {
  49725. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  49726. r = new n.Float32Attribute(3 * t.colors.length, 3)
  49727. if (
  49728. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  49729. this.addAttribute('color', r.copyColorsArray(t.colors)),
  49730. t.lineDistances && t.lineDistances.length === t.vertices.length)
  49731. ) {
  49732. var o = new n.Float32Attribute(t.lineDistances.length, 1)
  49733. this.addAttribute('lineDistance', o.copyArray(t.lineDistances))
  49734. }
  49735. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  49736. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  49737. } else e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t)
  49738. return this
  49739. },
  49740. updateFromObject: function (e) {
  49741. var t = e.geometry
  49742. if (e instanceof n.Mesh) {
  49743. var i = t.__directGeometry
  49744. if (void 0 === i) return this.fromGeometry(t)
  49745. ;(i.verticesNeedUpdate = t.verticesNeedUpdate),
  49746. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  49747. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  49748. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  49749. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  49750. (t.verticesNeedUpdate = !1),
  49751. (t.normalsNeedUpdate = !1),
  49752. (t.colorsNeedUpdate = !1),
  49753. (t.uvsNeedUpdate = !1),
  49754. (t.groupsNeedUpdate = !1),
  49755. (t = i)
  49756. }
  49757. if (t.verticesNeedUpdate === !0) {
  49758. var r = this.attributes.position
  49759. void 0 !== r && (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)),
  49760. (t.verticesNeedUpdate = !1)
  49761. }
  49762. if (t.normalsNeedUpdate === !0) {
  49763. var r = this.attributes.normal
  49764. void 0 !== r && (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)),
  49765. (t.normalsNeedUpdate = !1)
  49766. }
  49767. if (t.colorsNeedUpdate === !0) {
  49768. var r = this.attributes.color
  49769. void 0 !== r && (r.copyColorsArray(t.colors), (r.needsUpdate = !0)),
  49770. (t.colorsNeedUpdate = !1)
  49771. }
  49772. if (t.uvsNeedUpdate) {
  49773. var r = this.attributes.uv
  49774. void 0 !== r && (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)),
  49775. (t.uvsNeedUpdate = !1)
  49776. }
  49777. if (t.lineDistancesNeedUpdate) {
  49778. var r = this.attributes.lineDistance
  49779. void 0 !== r && (r.copyArray(t.lineDistances), (r.needsUpdate = !0)),
  49780. (t.lineDistancesNeedUpdate = !1)
  49781. }
  49782. return (
  49783. t.groupsNeedUpdate &&
  49784. (t.computeGroups(e.geometry),
  49785. (this.groups = t.groups),
  49786. (t.groupsNeedUpdate = !1)),
  49787. this
  49788. )
  49789. },
  49790. fromGeometry: function (e) {
  49791. return (
  49792. (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)),
  49793. this.fromDirectGeometry(e.__directGeometry)
  49794. )
  49795. },
  49796. fromDirectGeometry: function (e) {
  49797. var t = new Float32Array(3 * e.vertices.length)
  49798. if (
  49799. (this.addAttribute(
  49800. 'position',
  49801. new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)
  49802. ),
  49803. e.normals.length > 0)
  49804. ) {
  49805. var i = new Float32Array(3 * e.normals.length)
  49806. this.addAttribute(
  49807. 'normal',
  49808. new n.BufferAttribute(i, 3).copyVector3sArray(e.normals)
  49809. )
  49810. }
  49811. if (e.colors.length > 0) {
  49812. var r = new Float32Array(3 * e.colors.length)
  49813. this.addAttribute('color', new n.BufferAttribute(r, 3).copyColorsArray(e.colors))
  49814. }
  49815. if (e.uvs.length > 0) {
  49816. var o = new Float32Array(2 * e.uvs.length)
  49817. this.addAttribute('uv', new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs))
  49818. }
  49819. if (e.uvs2.length > 0) {
  49820. var a = new Float32Array(2 * e.uvs2.length)
  49821. this.addAttribute('uv2', new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2))
  49822. }
  49823. if (e.indices.length > 0) {
  49824. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  49825. l = new s(3 * e.indices.length)
  49826. this.setIndex(new n.BufferAttribute(l, 1).copyIndicesArray(e.indices))
  49827. }
  49828. this.groups = e.groups
  49829. for (var c in e.morphTargets) {
  49830. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  49831. var f = u[d],
  49832. g = new n.Float32Attribute(3 * f.length, 3)
  49833. h.push(g.copyVector3sArray(f))
  49834. }
  49835. this.morphAttributes[c] = h
  49836. }
  49837. if (e.skinIndices.length > 0) {
  49838. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4)
  49839. this.addAttribute('skinIndex', m.copyVector4sArray(e.skinIndices))
  49840. }
  49841. if (e.skinWeights.length > 0) {
  49842. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4)
  49843. this.addAttribute('skinWeight', v.copyVector4sArray(e.skinWeights))
  49844. }
  49845. return (
  49846. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  49847. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  49848. this
  49849. )
  49850. },
  49851. computeBoundingBox: (function () {
  49852. new n.Vector3()
  49853. return function () {
  49854. null === this.boundingBox && (this.boundingBox = new n.Box3())
  49855. var e = this.attributes.position.array
  49856. e && this.boundingBox.setFromArray(e),
  49857. (void 0 !== e && 0 !== e.length) ||
  49858. (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  49859. (isNaN(this.boundingBox.min.x) ||
  49860. isNaN(this.boundingBox.min.y) ||
  49861. isNaN(this.boundingBox.min.z)) &&
  49862. console.error(
  49863. 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
  49864. this
  49865. )
  49866. }
  49867. })(),
  49868. computeBoundingSphere: (function () {
  49869. var e = new n.Box3(),
  49870. t = new n.Vector3()
  49871. return function () {
  49872. null === this.boundingSphere && (this.boundingSphere = new n.Sphere())
  49873. var i = this.attributes.position.array
  49874. if (i) {
  49875. var r = this.boundingSphere.center
  49876. e.setFromArray(i), e.center(r)
  49877. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  49878. t.fromArray(i, a), (o = Math.max(o, r.distanceToSquared(t)))
  49879. ;(this.boundingSphere.radius = Math.sqrt(o)),
  49880. isNaN(this.boundingSphere.radius) &&
  49881. console.error(
  49882. 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
  49883. this
  49884. )
  49885. }
  49886. }
  49887. })(),
  49888. computeFaceNormals: function () {},
  49889. computeVertexNormals: function () {
  49890. var e = this.index,
  49891. t = this.attributes,
  49892. i = this.groups
  49893. if (t.position) {
  49894. var r = t.position.array
  49895. if (void 0 === t.normal)
  49896. this.addAttribute('normal', new n.BufferAttribute(new Float32Array(r.length), 3))
  49897. else for (var o = t.normal.array, a = 0, s = o.length; a < s; a++) o[a] = 0
  49898. var l,
  49899. c,
  49900. h,
  49901. u = t.normal.array,
  49902. d = new n.Vector3(),
  49903. p = new n.Vector3(),
  49904. f = new n.Vector3(),
  49905. g = new n.Vector3(),
  49906. m = new n.Vector3()
  49907. if (e) {
  49908. var v = e.array
  49909. 0 === i.length && this.addGroup(0, v.length)
  49910. for (var A = 0, y = i.length; A < y; ++A)
  49911. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  49912. (l = 3 * v[a + 0]),
  49913. (c = 3 * v[a + 1]),
  49914. (h = 3 * v[a + 2]),
  49915. d.fromArray(r, l),
  49916. p.fromArray(r, c),
  49917. f.fromArray(r, h),
  49918. g.subVectors(f, p),
  49919. m.subVectors(d, p),
  49920. g.cross(m),
  49921. (u[l] += g.x),
  49922. (u[l + 1] += g.y),
  49923. (u[l + 2] += g.z),
  49924. (u[c] += g.x),
  49925. (u[c + 1] += g.y),
  49926. (u[c + 2] += g.z),
  49927. (u[h] += g.x),
  49928. (u[h + 1] += g.y),
  49929. (u[h + 2] += g.z)
  49930. } else
  49931. for (var a = 0, s = r.length; a < s; a += 9)
  49932. d.fromArray(r, a),
  49933. p.fromArray(r, a + 3),
  49934. f.fromArray(r, a + 6),
  49935. g.subVectors(f, p),
  49936. m.subVectors(d, p),
  49937. g.cross(m),
  49938. (u[a] = g.x),
  49939. (u[a + 1] = g.y),
  49940. (u[a + 2] = g.z),
  49941. (u[a + 3] = g.x),
  49942. (u[a + 4] = g.y),
  49943. (u[a + 5] = g.z),
  49944. (u[a + 6] = g.x),
  49945. (u[a + 7] = g.y),
  49946. (u[a + 8] = g.z)
  49947. this.normalizeNormals(), (t.normal.needsUpdate = !0)
  49948. }
  49949. },
  49950. merge: function (e, t) {
  49951. if (e instanceof n.BufferGeometry == !1)
  49952. return void console.error(
  49953. 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.',
  49954. e
  49955. )
  49956. void 0 === t && (t = 0)
  49957. var i = this.attributes
  49958. for (var r in i)
  49959. if (void 0 !== e.attributes[r])
  49960. for (
  49961. var o = i[r],
  49962. a = o.array,
  49963. s = e.attributes[r],
  49964. l = s.array,
  49965. c = s.itemSize,
  49966. h = 0,
  49967. u = c * t;
  49968. h < l.length;
  49969. h++, u++
  49970. )
  49971. a[u] = l[h]
  49972. return this
  49973. },
  49974. normalizeNormals: function () {
  49975. for (
  49976. var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length;
  49977. o < a;
  49978. o += 3
  49979. )
  49980. (e = r[o]),
  49981. (t = r[o + 1]),
  49982. (i = r[o + 2]),
  49983. (n = 1 / Math.sqrt(e * e + t * t + i * i)),
  49984. (r[o] *= n),
  49985. (r[o + 1] *= n),
  49986. (r[o + 2] *= n)
  49987. },
  49988. toNonIndexed: function () {
  49989. if (null === this.index)
  49990. return (
  49991. console.warn(
  49992. 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'
  49993. ),
  49994. this
  49995. )
  49996. var e = new n.BufferGeometry(),
  49997. t = this.index.array,
  49998. i = this.attributes
  49999. for (var r in i) {
  50000. for (
  50001. var o = i[r],
  50002. a = o.array,
  50003. s = o.itemSize,
  50004. l = new a.constructor(t.length * s),
  50005. c = 0,
  50006. h = 0,
  50007. u = 0,
  50008. d = t.length;
  50009. u < d;
  50010. u++
  50011. ) {
  50012. c = t[u] * s
  50013. for (var p = 0; p < s; p++) l[h++] = a[c++]
  50014. }
  50015. e.addAttribute(r, new n.BufferAttribute(l, s))
  50016. }
  50017. return e
  50018. },
  50019. toJSON: function () {
  50020. var e = {
  50021. metadata: {
  50022. version: 4.4,
  50023. type: 'BufferGeometry',
  50024. generator: 'BufferGeometry.toJSON'
  50025. }
  50026. }
  50027. if (
  50028. ((e.uuid = this.uuid),
  50029. (e.type = this.type),
  50030. '' !== this.name && (e.name = this.name),
  50031. void 0 !== this.parameters)
  50032. ) {
  50033. var t = this.parameters
  50034. for (var i in t) void 0 !== t[i] && (e[i] = t[i])
  50035. return e
  50036. }
  50037. e.data = {
  50038. attributes: {}
  50039. }
  50040. var n = this.index
  50041. if (null !== n) {
  50042. var r = Array.prototype.slice.call(n.array)
  50043. e.data.index = {
  50044. type: n.array.constructor.name,
  50045. array: r
  50046. }
  50047. }
  50048. var o = this.attributes
  50049. for (var i in o) {
  50050. var a = o[i],
  50051. r = Array.prototype.slice.call(a.array)
  50052. e.data.attributes[i] = {
  50053. itemSize: a.itemSize,
  50054. type: a.array.constructor.name,
  50055. array: r
  50056. }
  50057. }
  50058. var s = this.groups
  50059. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)))
  50060. var l = this.boundingSphere
  50061. return (
  50062. null !== l &&
  50063. (e.data.boundingSphere = {
  50064. center: l.center.toArray(),
  50065. radius: l.radius
  50066. }),
  50067. e
  50068. )
  50069. },
  50070. clone: function () {
  50071. return new n.BufferGeometry().copy(this)
  50072. },
  50073. copy: function (e) {
  50074. var t = e.index
  50075. null !== t && this.setIndex(t.clone())
  50076. var i = e.attributes
  50077. for (var n in i) {
  50078. var r = i[n]
  50079. this.addAttribute(n, r.clone())
  50080. }
  50081. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  50082. var l = o[a]
  50083. this.addGroup(l.start, l.count)
  50084. }
  50085. return this
  50086. },
  50087. dispose: function () {
  50088. this.dispatchEvent({
  50089. type: 'dispose'
  50090. })
  50091. }
  50092. }),
  50093. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  50094. (n.BufferGeometry.MaxIndex = 65535),
  50095. (n.InstancedBufferGeometry = function () {
  50096. n.BufferGeometry.call(this),
  50097. (this.type = 'InstancedBufferGeometry'),
  50098. (this.maxInstancedCount = void 0)
  50099. }),
  50100. (n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  50101. (n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry),
  50102. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  50103. this.groups.push({
  50104. start: e,
  50105. count: t,
  50106. instances: i
  50107. })
  50108. }),
  50109. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  50110. var t = e.index
  50111. null !== t && this.setIndex(t.clone())
  50112. var i = e.attributes
  50113. for (var n in i) {
  50114. var r = i[n]
  50115. this.addAttribute(n, r.clone())
  50116. }
  50117. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  50118. var l = o[a]
  50119. this.addGroup(l.start, l.count, l.instances)
  50120. }
  50121. return this
  50122. }),
  50123. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  50124. (n.Uniform = function (e, t) {
  50125. ;(this.type = e), (this.value = t), (this.dynamic = !1)
  50126. }),
  50127. (n.Uniform.prototype = {
  50128. constructor: n.Uniform,
  50129. onUpdate: function (e) {
  50130. return (this.dynamic = !0), (this.onUpdateCallback = e), this
  50131. }
  50132. }),
  50133. (n.AnimationClip = function (e, t, i) {
  50134. ;(this.name = e || n.Math.generateUUID()),
  50135. (this.tracks = i),
  50136. (this.duration = void 0 !== t ? t : -1),
  50137. this.duration < 0 && this.resetDuration(),
  50138. this.trim(),
  50139. this.optimize()
  50140. }),
  50141. (n.AnimationClip.prototype = {
  50142. constructor: n.AnimationClip,
  50143. resetDuration: function () {
  50144. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  50145. var r = this.tracks[i]
  50146. t = Math.max(t, r.times[r.times.length - 1])
  50147. }
  50148. this.duration = t
  50149. },
  50150. trim: function () {
  50151. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration)
  50152. return this
  50153. },
  50154. optimize: function () {
  50155. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
  50156. return this
  50157. }
  50158. }),
  50159. Object.assign(n.AnimationClip, {
  50160. parse: function (e) {
  50161. for (
  50162. var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length;
  50163. o !== a;
  50164. ++o
  50165. )
  50166. t.push(n.KeyframeTrack.parse(i[o]).scale(r))
  50167. return new n.AnimationClip(e.name, e.duration, t)
  50168. },
  50169. toJSON: function (e) {
  50170. for (
  50171. var t = [],
  50172. i = e.tracks,
  50173. r = {
  50174. name: e.name,
  50175. duration: e.duration,
  50176. tracks: t
  50177. },
  50178. o = 0,
  50179. a = i.length;
  50180. o !== a;
  50181. ++o
  50182. )
  50183. t.push(n.KeyframeTrack.toJSON(i[o]))
  50184. return r
  50185. },
  50186. CreateFromMorphTargetSequence: function (e, t, i) {
  50187. for (var r = t.length, o = [], a = 0; a < r; a++) {
  50188. var s = [],
  50189. l = []
  50190. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0)
  50191. var c = n.AnimationUtils.getKeyframeOrder(s)
  50192. ;(s = n.AnimationUtils.sortedArray(s, 1, c)),
  50193. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  50194. 0 === s[0] && (s.push(r), l.push(l[0])),
  50195. o.push(
  50196. new n.NumberKeyframeTrack(
  50197. '.morphTargetInfluences[' + t[a].name + ']',
  50198. s,
  50199. l
  50200. ).scale(1 / i)
  50201. )
  50202. }
  50203. return new n.AnimationClip(e, -1, o)
  50204. },
  50205. findByName: function (e, t) {
  50206. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i]
  50207. return null
  50208. },
  50209. CreateClipsFromMorphTargetSequences: function (e, t) {
  50210. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  50211. var s = e[o],
  50212. l = s.name.match(r)
  50213. if (l && l.length > 1) {
  50214. var c = l[1],
  50215. h = i[c]
  50216. h || (i[c] = h = []), h.push(s)
  50217. }
  50218. }
  50219. var u = []
  50220. for (var c in i) u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t))
  50221. return u
  50222. },
  50223. parseAnimation: function (e, t, i) {
  50224. if (!e) return console.error(' no animation in JSONLoader data'), null
  50225. for (
  50226. var r = function (e, t, i, r, o) {
  50227. if (0 !== i.length) {
  50228. var a = [],
  50229. s = []
  50230. n.AnimationUtils.flattenJSON(i, a, s, r),
  50231. 0 !== a.length && o.push(new e(t, a, s))
  50232. }
  50233. },
  50234. o = [],
  50235. a = e.name || 'default',
  50236. s = e.length || -1,
  50237. l = e.fps || 30,
  50238. c = e.hierarchy || [],
  50239. h = 0;
  50240. h < c.length;
  50241. h++
  50242. ) {
  50243. var u = c[h].keys
  50244. if (u && 0 != u.length)
  50245. if (u[0].morphTargets) {
  50246. for (var d = {}, p = 0; p < u.length; p++)
  50247. if (u[p].morphTargets)
  50248. for (var f = 0; f < u[p].morphTargets.length; f++)
  50249. d[u[p].morphTargets[f]] = -1
  50250. for (var g in d) {
  50251. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  50252. var A = u[p]
  50253. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0)
  50254. }
  50255. o.push(new n.NumberKeyframeTrack('.morphTargetInfluence[' + g + ']', m, v))
  50256. }
  50257. s = d.length * (l || 1)
  50258. } else {
  50259. var y = '.bones[' + t[h].name + ']'
  50260. r(n.VectorKeyframeTrack, y + '.position', u, 'pos', o),
  50261. r(n.QuaternionKeyframeTrack, y + '.quaternion', u, 'rot', o),
  50262. r(n.VectorKeyframeTrack, y + '.scale', u, 'scl', o)
  50263. }
  50264. }
  50265. if (0 === o.length) return null
  50266. var C = new n.AnimationClip(a, s, o)
  50267. return C
  50268. }
  50269. }),
  50270. (n.AnimationMixer = function (e) {
  50271. ;(this._root = e),
  50272. this._initMemoryManager(),
  50273. (this._accuIndex = 0),
  50274. (this.time = 0),
  50275. (this.timeScale = 1)
  50276. }),
  50277. (n.AnimationMixer.prototype = {
  50278. constructor: n.AnimationMixer,
  50279. clipAction: function (e, t) {
  50280. var i,
  50281. r = t || this._root,
  50282. o = r.uuid,
  50283. a = 'string' == typeof e ? e : e.name,
  50284. s = e !== a ? e : null,
  50285. l = this._actionsByClip[a]
  50286. if (void 0 !== l) {
  50287. var c = l.actionByRoot[o]
  50288. if (void 0 !== c) return c
  50289. if (((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s))
  50290. throw new Error('Different clips with the same name detected!')
  50291. }
  50292. if (null === s) return null
  50293. var h = new n.AnimationMixer._Action(this, s, t)
  50294. return this._bindAction(h, i), this._addInactiveAction(h, a, o), h
  50295. },
  50296. existingAction: function (e, t) {
  50297. var i = t || this._root,
  50298. n = i.uuid,
  50299. r = 'string' == typeof e ? e : e.name,
  50300. o = this._actionsByClip[r]
  50301. return void 0 !== o ? o.actionByRoot[n] || null : null
  50302. },
  50303. stopAllAction: function () {
  50304. var e = this._actions,
  50305. t = this._nActiveActions,
  50306. i = this._bindings,
  50307. n = this._nActiveBindings
  50308. ;(this._nActiveActions = 0), (this._nActiveBindings = 0)
  50309. for (var r = 0; r !== t; ++r) e[r].reset()
  50310. for (var r = 0; r !== n; ++r) i[r].useCount = 0
  50311. return this
  50312. },
  50313. update: function (e) {
  50314. e *= this.timeScale
  50315. for (
  50316. var t = this._actions,
  50317. i = this._nActiveActions,
  50318. n = (this.time += e),
  50319. r = Math.sign(e),
  50320. o = (this._accuIndex ^= 1),
  50321. a = 0;
  50322. a !== i;
  50323. ++a
  50324. ) {
  50325. var s = t[a]
  50326. s.enabled && s._update(n, e, r, o)
  50327. }
  50328. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  50329. l[a].apply(o)
  50330. return this
  50331. },
  50332. getRoot: function () {
  50333. return this._root
  50334. },
  50335. uncacheClip: function (e) {
  50336. var t = this._actions,
  50337. i = e.name,
  50338. n = this._actionsByClip,
  50339. r = n[i]
  50340. if (void 0 !== r) {
  50341. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  50342. var l = o[a]
  50343. this._deactivateAction(l)
  50344. var c = l._cacheIndex,
  50345. h = t[t.length - 1]
  50346. ;(l._cacheIndex = null),
  50347. (l._byClipCacheIndex = null),
  50348. (h._cacheIndex = c),
  50349. (t[c] = h),
  50350. t.pop(),
  50351. this._removeInactiveBindingsForAction(l)
  50352. }
  50353. delete n[i]
  50354. }
  50355. },
  50356. uncacheRoot: function (e) {
  50357. var t = e.uuid,
  50358. i = this._actionsByClip
  50359. for (var n in i) {
  50360. var r = i[n].actionByRoot,
  50361. o = r[t]
  50362. void 0 !== o && (this._deactivateAction(o), this._removeInactiveAction(o))
  50363. }
  50364. var a = this._bindingsByRootAndName,
  50365. s = a[t]
  50366. if (void 0 !== s)
  50367. for (var l in s) {
  50368. var c = s[l]
  50369. c.restoreOriginalState(), this._removeInactiveBinding(c)
  50370. }
  50371. },
  50372. uncacheAction: function (e, t) {
  50373. var i = this.existingAction(e, t)
  50374. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
  50375. }
  50376. }),
  50377. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  50378. (n.AnimationMixer._Action = function (e, t, i) {
  50379. ;(this._mixer = e), (this._clip = t), (this._localRoot = i || null)
  50380. for (
  50381. var r = t.tracks,
  50382. o = r.length,
  50383. a = new Array(o),
  50384. s = {
  50385. endingStart: n.ZeroCurvatureEnding,
  50386. endingEnd: n.ZeroCurvatureEnding
  50387. },
  50388. l = 0;
  50389. l !== o;
  50390. ++l
  50391. ) {
  50392. var c = r[l].createInterpolant(null)
  50393. ;(a[l] = c), (c.settings = s)
  50394. }
  50395. ;(this._interpolantSettings = s),
  50396. (this._interpolants = a),
  50397. (this._propertyBindings = new Array(o)),
  50398. (this._cacheIndex = null),
  50399. (this._byClipCacheIndex = null),
  50400. (this._timeScaleInterpolant = null),
  50401. (this._weightInterpolant = null),
  50402. (this.loop = n.LoopRepeat),
  50403. (this._loopCount = -1),
  50404. (this._startTime = null),
  50405. (this.time = 0),
  50406. (this.timeScale = 1),
  50407. (this._effectiveTimeScale = 1),
  50408. (this.weight = 1),
  50409. (this._effectiveWeight = 1),
  50410. (this.repetitions = 1 / 0),
  50411. (this.paused = !1),
  50412. (this.enabled = !0),
  50413. (this.clampWhenFinished = !1),
  50414. (this.zeroSlopeAtStart = !0),
  50415. (this.zeroSlopeAtEnd = !0)
  50416. }),
  50417. (n.AnimationMixer._Action.prototype = {
  50418. constructor: n.AnimationMixer._Action,
  50419. play: function () {
  50420. return this._mixer._activateAction(this), this
  50421. },
  50422. stop: function () {
  50423. return this._mixer._deactivateAction(this), this.reset()
  50424. },
  50425. reset: function () {
  50426. return (
  50427. (this.paused = !1),
  50428. (this.enabled = !0),
  50429. (this.time = 0),
  50430. (this._loopCount = -1),
  50431. (this._startTime = null),
  50432. this.stopFading().stopWarping()
  50433. )
  50434. },
  50435. isRunning: function () {
  50436. this._startTime
  50437. return (
  50438. this.enabled &&
  50439. !this.paused &&
  50440. 0 !== this.timeScale &&
  50441. null === this._startTime &&
  50442. this._mixer._isActiveAction(this)
  50443. )
  50444. },
  50445. isScheduled: function () {
  50446. return this._mixer._isActiveAction(this)
  50447. },
  50448. startAt: function (e) {
  50449. return (this._startTime = e), this
  50450. },
  50451. setLoop: function (e, t) {
  50452. return (this.loop = e), (this.repetitions = t), this
  50453. },
  50454. setEffectiveWeight: function (e) {
  50455. return (
  50456. (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  50457. )
  50458. },
  50459. getEffectiveWeight: function () {
  50460. return this._effectiveWeight
  50461. },
  50462. fadeIn: function (e) {
  50463. return this._scheduleFading(e, 0, 1)
  50464. },
  50465. fadeOut: function (e) {
  50466. return this._scheduleFading(e, 1, 0)
  50467. },
  50468. crossFadeFrom: function (e, t, i) {
  50469. this._mixer
  50470. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  50471. var n = this._clip.duration,
  50472. r = e._clip.duration,
  50473. o = r / n,
  50474. a = n / r
  50475. e.warp(1, o, t), this.warp(a, 1, t)
  50476. }
  50477. return this
  50478. },
  50479. crossFadeTo: function (e, t, i) {
  50480. return e.crossFadeFrom(this, t, i)
  50481. },
  50482. stopFading: function () {
  50483. var e = this._weightInterpolant
  50484. return (
  50485. null !== e &&
  50486. ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50487. this
  50488. )
  50489. },
  50490. setEffectiveTimeScale: function (e) {
  50491. return (
  50492. (this.timeScale = e),
  50493. (this._effectiveTimeScale = this.paused ? 0 : e),
  50494. this.stopWarping()
  50495. )
  50496. },
  50497. getEffectiveTimeScale: function () {
  50498. return this._effectiveTimeScale
  50499. },
  50500. setDuration: function (e) {
  50501. return (this.timeScale = this._clip.duration / e), this.stopWarping()
  50502. },
  50503. syncWith: function (e) {
  50504. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping()
  50505. },
  50506. halt: function (e) {
  50507. return this.warp(this._currentTimeScale, 0, e)
  50508. },
  50509. warp: function (e, t, i) {
  50510. var n = this._mixer,
  50511. r = n.time,
  50512. o = this._timeScaleInterpolant,
  50513. a = this.timeScale
  50514. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o))
  50515. var s = o.parameterPositions,
  50516. l = o.sampleValues
  50517. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  50518. },
  50519. stopWarping: function () {
  50520. var e = this._timeScaleInterpolant
  50521. return (
  50522. null !== e &&
  50523. ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50524. this
  50525. )
  50526. },
  50527. getMixer: function () {
  50528. return this._mixer
  50529. },
  50530. getClip: function () {
  50531. return this._clip
  50532. },
  50533. getRoot: function () {
  50534. return this._localRoot || this._mixer._root
  50535. },
  50536. _update: function (e, t, i, n) {
  50537. var r = this._startTime
  50538. if (null !== r) {
  50539. var o = (e - r) * i
  50540. if (o < 0 || 0 === i) return
  50541. ;(this._startTime = null), (t = i * o)
  50542. }
  50543. t *= this._updateTimeScale(e)
  50544. var a = this._updateTime(t),
  50545. s = this._updateWeight(e)
  50546. if (s > 0)
  50547. for (
  50548. var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length;
  50549. h !== u;
  50550. ++h
  50551. )
  50552. l[h].evaluate(a), c[h].accumulate(n, s)
  50553. },
  50554. _updateWeight: function (e) {
  50555. var t = 0
  50556. if (this.enabled) {
  50557. t = this.weight
  50558. var i = this._weightInterpolant
  50559. if (null !== i) {
  50560. var n = i.evaluate(e)[0]
  50561. ;(t *= n),
  50562. e > i.parameterPositions[1] &&
  50563. (this.stopFading(), 0 === n && (this.enabled = !1))
  50564. }
  50565. }
  50566. return (this._effectiveWeight = t), t
  50567. },
  50568. _updateTimeScale: function (e) {
  50569. var t = 0
  50570. if (!this.paused) {
  50571. t = this.timeScale
  50572. var i = this._timeScaleInterpolant
  50573. if (null !== i) {
  50574. var n = i.evaluate(e)[0]
  50575. ;(t *= n),
  50576. e > i.parameterPositions[1] &&
  50577. (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t))
  50578. }
  50579. }
  50580. return (this._effectiveTimeScale = t), t
  50581. },
  50582. _updateTime: function (e) {
  50583. var t = this.time + e
  50584. if (0 === e) return t
  50585. var i = this._clip.duration,
  50586. r = this.loop,
  50587. o = this._loopCount,
  50588. a = !1
  50589. switch (r) {
  50590. case n.LoopOnce:
  50591. if ((o === -1 && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), t >= i))
  50592. t = i
  50593. else {
  50594. if (!(t < 0)) break
  50595. t = 0
  50596. }
  50597. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  50598. this._mixer.dispatchEvent({
  50599. type: 'finished',
  50600. action: this,
  50601. direction: e < 0 ? -1 : 1
  50602. })
  50603. break
  50604. case n.LoopPingPong:
  50605. a = !0
  50606. case n.LoopRepeat:
  50607. if (
  50608. (o === -1 &&
  50609. (e > 0
  50610. ? ((o = 0), this._setEndings(!0, 0 === this.repetitions, a))
  50611. : this._setEndings(0 === this.repetitions, !0, a)),
  50612. t >= i || t < 0)
  50613. ) {
  50614. var s = Math.floor(t / i)
  50615. ;(t -= i * s), (o += Math.abs(s))
  50616. var l = this.repetitions - o
  50617. if (l < 0) {
  50618. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  50619. (t = e > 0 ? i : 0),
  50620. this._mixer.dispatchEvent({
  50621. type: 'finished',
  50622. action: this,
  50623. direction: e > 0 ? 1 : -1
  50624. })
  50625. break
  50626. }
  50627. if (0 === l) {
  50628. var c = e < 0
  50629. this._setEndings(c, !c, a)
  50630. } else this._setEndings(!1, !1, a)
  50631. ;(this._loopCount = o),
  50632. this._mixer.dispatchEvent({
  50633. type: 'loop',
  50634. action: this,
  50635. loopDelta: s
  50636. })
  50637. }
  50638. if (r === n.LoopPingPong && 1 === (1 & o)) return (this.time = t), i - t
  50639. }
  50640. return (this.time = t), t
  50641. },
  50642. _setEndings: function (e, t, i) {
  50643. var r = this._interpolantSettings
  50644. i
  50645. ? ((r.endingStart = n.ZeroSlopeEnding), (r.endingEnd = n.ZeroSlopeEnding))
  50646. : (e
  50647. ? (r.endingStart = this.zeroSlopeAtStart
  50648. ? n.ZeroSlopeEnding
  50649. : n.ZeroCurvatureEnding)
  50650. : (r.endingStart = n.WrapAroundEnding),
  50651. t
  50652. ? (r.endingEnd = this.zeroSlopeAtEnd
  50653. ? n.ZeroSlopeEnding
  50654. : n.ZeroCurvatureEnding)
  50655. : (r.endingEnd = n.WrapAroundEnding))
  50656. },
  50657. _scheduleFading: function (e, t, i) {
  50658. var n = this._mixer,
  50659. r = n.time,
  50660. o = this._weightInterpolant
  50661. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o))
  50662. var a = o.parameterPositions,
  50663. s = o.sampleValues
  50664. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this
  50665. }
  50666. }),
  50667. Object.assign(n.AnimationMixer.prototype, {
  50668. _bindAction: function (e, t) {
  50669. var i = e._localRoot || this._root,
  50670. r = e._clip.tracks,
  50671. o = r.length,
  50672. a = e._propertyBindings,
  50673. s = e._interpolants,
  50674. l = i.uuid,
  50675. c = this._bindingsByRootAndName,
  50676. h = c[l]
  50677. void 0 === h && ((h = {}), (c[l] = h))
  50678. for (var u = 0; u !== o; ++u) {
  50679. var d = r[u],
  50680. p = d.name,
  50681. f = h[p]
  50682. if (void 0 !== f) a[u] = f
  50683. else {
  50684. if (((f = a[u]), void 0 !== f)) {
  50685. null === f._cacheIndex &&
  50686. (++f.referenceCount, this._addInactiveBinding(f, l, p))
  50687. continue
  50688. }
  50689. var g = t && t._propertyBindings[u].binding.parsedPath
  50690. ;(f = new n.PropertyMixer(
  50691. n.PropertyBinding.create(i, p, g),
  50692. d.ValueTypeName,
  50693. d.getValueSize()
  50694. )),
  50695. ++f.referenceCount,
  50696. this._addInactiveBinding(f, l, p),
  50697. (a[u] = f)
  50698. }
  50699. s[u].resultBuffer = f.buffer
  50700. }
  50701. },
  50702. _activateAction: function (e) {
  50703. if (!this._isActiveAction(e)) {
  50704. if (null === e._cacheIndex) {
  50705. var t = (e._localRoot || this._root).uuid,
  50706. i = e._clip.name,
  50707. n = this._actionsByClip[i]
  50708. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t)
  50709. }
  50710. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  50711. var s = r[o]
  50712. 0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
  50713. }
  50714. this._lendAction(e)
  50715. }
  50716. },
  50717. _deactivateAction: function (e) {
  50718. if (this._isActiveAction(e)) {
  50719. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50720. var r = t[i]
  50721. 0 === --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r))
  50722. }
  50723. this._takeBackAction(e)
  50724. }
  50725. },
  50726. _initMemoryManager: function () {
  50727. ;(this._actions = []),
  50728. (this._nActiveActions = 0),
  50729. (this._actionsByClip = {}),
  50730. (this._bindings = []),
  50731. (this._nActiveBindings = 0),
  50732. (this._bindingsByRootAndName = {}),
  50733. (this._controlInterpolants = []),
  50734. (this._nActiveControlInterpolants = 0)
  50735. var e = this
  50736. this.stats = {
  50737. actions: {
  50738. get total() {
  50739. return e._actions.length
  50740. },
  50741. get inUse() {
  50742. return e._nActiveActions
  50743. }
  50744. },
  50745. bindings: {
  50746. get total() {
  50747. return e._bindings.length
  50748. },
  50749. get inUse() {
  50750. return e._nActiveBindings
  50751. }
  50752. },
  50753. controlInterpolants: {
  50754. get total() {
  50755. return e._controlInterpolants.length
  50756. },
  50757. get inUse() {
  50758. return e._nActiveControlInterpolants
  50759. }
  50760. }
  50761. }
  50762. },
  50763. _isActiveAction: function (e) {
  50764. var t = e._cacheIndex
  50765. return null !== t && t < this._nActiveActions
  50766. },
  50767. _addInactiveAction: function (e, t, i) {
  50768. var n = this._actions,
  50769. r = this._actionsByClip,
  50770. o = r[t]
  50771. if (void 0 === o)
  50772. (o = {
  50773. knownActions: [e],
  50774. actionByRoot: {}
  50775. }),
  50776. (e._byClipCacheIndex = 0),
  50777. (r[t] = o)
  50778. else {
  50779. var a = o.knownActions
  50780. ;(e._byClipCacheIndex = a.length), a.push(e)
  50781. }
  50782. ;(e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e)
  50783. },
  50784. _removeInactiveAction: function (e) {
  50785. var t = this._actions,
  50786. i = t[t.length - 1],
  50787. n = e._cacheIndex
  50788. ;(i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null)
  50789. var r = e._clip.name,
  50790. o = this._actionsByClip,
  50791. a = o[r],
  50792. s = a.knownActions,
  50793. l = s[s.length - 1],
  50794. c = e._byClipCacheIndex
  50795. ;(l._byClipCacheIndex = c), (s[c] = l), s.pop(), (e._byClipCacheIndex = null)
  50796. var h = a.actionByRoot,
  50797. u = (t._localRoot || this._root).uuid
  50798. delete h[u], 0 === s.length && delete o[r], this._removeInactiveBindingsForAction(e)
  50799. },
  50800. _removeInactiveBindingsForAction: function (e) {
  50801. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50802. var r = t[i]
  50803. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  50804. }
  50805. },
  50806. _lendAction: function (e) {
  50807. var t = this._actions,
  50808. i = e._cacheIndex,
  50809. n = this._nActiveActions++,
  50810. r = t[n]
  50811. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50812. },
  50813. _takeBackAction: function (e) {
  50814. var t = this._actions,
  50815. i = e._cacheIndex,
  50816. n = --this._nActiveActions,
  50817. r = t[n]
  50818. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50819. },
  50820. _addInactiveBinding: function (e, t, i) {
  50821. var n = this._bindingsByRootAndName,
  50822. r = n[t],
  50823. o = this._bindings
  50824. void 0 === r && ((r = {}), (n[t] = r)),
  50825. (r[i] = e),
  50826. (e._cacheIndex = o.length),
  50827. o.push(e)
  50828. },
  50829. _removeInactiveBinding: function (e) {
  50830. var t = this._bindings,
  50831. i = e.binding,
  50832. n = i.rootNode.uuid,
  50833. r = i.path,
  50834. o = this._bindingsByRootAndName,
  50835. a = o[n],
  50836. s = t[t.length - 1],
  50837. l = e._cacheIndex
  50838. ;(s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r]
  50839. e: {
  50840. for (var c in a) break e
  50841. delete o[n]
  50842. }
  50843. },
  50844. _lendBinding: function (e) {
  50845. var t = this._bindings,
  50846. i = e._cacheIndex,
  50847. n = this._nActiveBindings++,
  50848. r = t[n]
  50849. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50850. },
  50851. _takeBackBinding: function (e) {
  50852. var t = this._bindings,
  50853. i = e._cacheIndex,
  50854. n = --this._nActiveBindings,
  50855. r = t[n]
  50856. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50857. },
  50858. _lendControlInterpolant: function () {
  50859. var e = this._controlInterpolants,
  50860. t = this._nActiveControlInterpolants++,
  50861. i = e[t]
  50862. return (
  50863. void 0 === i &&
  50864. ((i = new n.LinearInterpolant(
  50865. new Float32Array(2),
  50866. new Float32Array(2),
  50867. 1,
  50868. this._controlInterpolantsResultBuffer
  50869. )),
  50870. (i.__cacheIndex = t),
  50871. (e[t] = i)),
  50872. i
  50873. )
  50874. },
  50875. _takeBackControlInterpolant: function (e) {
  50876. var t = this._controlInterpolants,
  50877. i = e.__cacheIndex,
  50878. n = --this._nActiveControlInterpolants,
  50879. r = t[n]
  50880. ;(e.__cacheIndex = n), (t[n] = e), (r.__cacheIndex = i), (t[i] = r)
  50881. },
  50882. _controlInterpolantsResultBuffer: new Float32Array(1)
  50883. }),
  50884. (n.AnimationObjectGroup = function (e) {
  50885. ;(this.uuid = n.Math.generateUUID()),
  50886. (this._objects = Array.prototype.slice.call(arguments)),
  50887. (this.nCachedObjects_ = 0)
  50888. var t = {}
  50889. this._indicesByUUID = t
  50890. for (var i = 0, r = arguments.length; i !== r; ++i) t[arguments[i].uuid] = i
  50891. ;(this._paths = []),
  50892. (this._parsedPaths = []),
  50893. (this._bindings = []),
  50894. (this._bindingsIndicesByPath = {})
  50895. var o = this
  50896. this.stats = {
  50897. objects: {
  50898. get total() {
  50899. return o._objects.length
  50900. },
  50901. get inUse() {
  50902. return this.total - o.nCachedObjects_
  50903. }
  50904. },
  50905. get bindingsPerObject() {
  50906. return o._bindings.length
  50907. }
  50908. }
  50909. }),
  50910. (n.AnimationObjectGroup.prototype = {
  50911. constructor: n.AnimationObjectGroup,
  50912. add: function (e) {
  50913. for (
  50914. var t = this._objects,
  50915. i = t.length,
  50916. r = this.nCachedObjects_,
  50917. o = this._indicesByUUID,
  50918. a = this._paths,
  50919. s = this._parsedPaths,
  50920. l = this._bindings,
  50921. c = l.length,
  50922. h = 0,
  50923. u = arguments.length;
  50924. h !== u;
  50925. ++h
  50926. ) {
  50927. var d = arguments[h],
  50928. p = d.uuid,
  50929. f = o[p]
  50930. if (void 0 === f) {
  50931. ;(f = i++), (o[p] = f), t.push(d)
  50932. for (var g = 0, m = c; g !== m; ++g)
  50933. l[g].push(new n.PropertyBinding(d, a[g], s[g]))
  50934. } else if (f < r) {
  50935. var v = t[f],
  50936. A = --r,
  50937. y = t[A]
  50938. ;(o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d)
  50939. for (var g = 0, m = c; g !== m; ++g) {
  50940. var C = l[g],
  50941. I = C[A],
  50942. E = C[f]
  50943. ;(C[f] = I),
  50944. void 0 === E && (E = new n.PropertyBinding(d, a[g], s[g])),
  50945. (C[A] = E)
  50946. }
  50947. } else
  50948. t[f] !== v &&
  50949. console.error(
  50950. 'Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...'
  50951. )
  50952. }
  50953. this.nCachedObjects_ = r
  50954. },
  50955. remove: function (e) {
  50956. for (
  50957. var t = this._objects,
  50958. i = (t.length, this.nCachedObjects_),
  50959. n = this._indicesByUUID,
  50960. r = this._bindings,
  50961. o = r.length,
  50962. a = 0,
  50963. s = arguments.length;
  50964. a !== s;
  50965. ++a
  50966. ) {
  50967. var l = arguments[a],
  50968. c = l.uuid,
  50969. h = n[c]
  50970. if (void 0 !== h && h >= i) {
  50971. var u = i++,
  50972. d = t[u]
  50973. ;(n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l)
  50974. for (var p = 0, f = o; p !== f; ++p) {
  50975. var g = r[p],
  50976. m = g[u],
  50977. v = g[h]
  50978. ;(g[h] = m), (g[u] = v)
  50979. }
  50980. }
  50981. }
  50982. this.nCachedObjects_ = i
  50983. },
  50984. uncache: function (e) {
  50985. for (
  50986. var t = this._objects,
  50987. i = t.length,
  50988. n = this.nCachedObjects_,
  50989. r = this._indicesByUUID,
  50990. o = this._bindings,
  50991. a = o.length,
  50992. s = 0,
  50993. l = arguments.length;
  50994. s !== l;
  50995. ++s
  50996. ) {
  50997. var c = arguments[s],
  50998. h = c.uuid,
  50999. u = r[h]
  51000. if (void 0 !== u)
  51001. if ((delete r[h], u < n)) {
  51002. var d = --n,
  51003. p = t[d],
  51004. f = --i,
  51005. g = t[f]
  51006. ;(r[p.uuid] = u), (t[u] = p), (r[g.uuid] = d), (t[d] = g), t.pop()
  51007. for (var m = 0, v = a; m !== v; ++m) {
  51008. var A = o[m],
  51009. y = A[d],
  51010. C = A[f]
  51011. ;(A[u] = y), (A[d] = C), A.pop()
  51012. }
  51013. } else {
  51014. var f = --i,
  51015. g = t[f]
  51016. ;(r[g.uuid] = u), (t[u] = g), t.pop()
  51017. for (var m = 0, v = a; m !== v; ++m) {
  51018. var A = o[m]
  51019. ;(A[u] = A[f]), A.pop()
  51020. }
  51021. }
  51022. }
  51023. this.nCachedObjects_ = n
  51024. },
  51025. subscribe_: function (e, t) {
  51026. var i = this._bindingsIndicesByPath,
  51027. r = i[e],
  51028. o = this._bindings
  51029. if (void 0 !== r) return o[r]
  51030. var a = this._paths,
  51031. s = this._parsedPaths,
  51032. l = this._objects,
  51033. c = l.length,
  51034. h = this.nCachedObjects_,
  51035. u = new Array(c)
  51036. ;(r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u)
  51037. for (var d = h, p = l.length; d !== p; ++d) {
  51038. var f = l[d]
  51039. u[d] = new n.PropertyBinding(f, e, t)
  51040. }
  51041. return u
  51042. },
  51043. unsubscribe_: function (e) {
  51044. var t = this._bindingsIndicesByPath,
  51045. i = t[e]
  51046. if (void 0 !== i) {
  51047. var n = this._paths,
  51048. r = this._parsedPaths,
  51049. o = this._bindings,
  51050. a = o.length - 1,
  51051. s = o[a],
  51052. l = e[a]
  51053. ;(t[l] = i), (o[i] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop()
  51054. }
  51055. }
  51056. }),
  51057. (n.AnimationUtils = {
  51058. arraySlice: function (e, t, i) {
  51059. return n.AnimationUtils.isTypedArray(e)
  51060. ? new e.constructor(e.subarray(t, i))
  51061. : e.slice(t, i)
  51062. },
  51063. convertArray: function (e, t, i) {
  51064. return !e || (!i && e.constructor === t)
  51065. ? e
  51066. : 'number' == typeof t.BYTES_PER_ELEMENT
  51067. ? new t(e)
  51068. : Array.prototype.slice.call(e)
  51069. },
  51070. isTypedArray: function (e) {
  51071. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  51072. },
  51073. getKeyframeOrder: function (e) {
  51074. function t(t, i) {
  51075. return e[t] - e[i]
  51076. }
  51077. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r) n[r] = r
  51078. return n.sort(t), n
  51079. },
  51080. sortedArray: function (e, t, i) {
  51081. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  51082. for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l]
  51083. return r
  51084. },
  51085. flattenJSON: function (e, t, i, n) {
  51086. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++]
  51087. if (void 0 !== o) {
  51088. var a = o[n]
  51089. if (void 0 !== a)
  51090. if (Array.isArray(a)) {
  51091. do
  51092. (a = o[n]), void 0 !== a && (t.push(o.time), i.push.apply(i, a)), (o = e[r++])
  51093. while (void 0 !== o)
  51094. } else if (void 0 !== a.toArray) {
  51095. do
  51096. (a = o[n]),
  51097. void 0 !== a && (t.push(o.time), a.toArray(i, i.length)),
  51098. (o = e[r++])
  51099. while (void 0 !== o)
  51100. } else
  51101. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push(a)), (o = e[r++])
  51102. while (void 0 !== o)
  51103. }
  51104. }
  51105. }),
  51106. (n.KeyframeTrack = function (e, t, i, r) {
  51107. if (void 0 === e) throw new Error('track name is undefined')
  51108. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e)
  51109. ;(this.name = e),
  51110. (this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType)),
  51111. (this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType)),
  51112. this.setInterpolation(r || this.DefaultInterpolation),
  51113. this.validate(),
  51114. this.optimize()
  51115. }),
  51116. (n.KeyframeTrack.prototype = {
  51117. constructor: n.KeyframeTrack,
  51118. TimeBufferType: Float32Array,
  51119. ValueBufferType: Float32Array,
  51120. DefaultInterpolation: n.InterpolateLinear,
  51121. InterpolantFactoryMethodDiscrete: function (e) {
  51122. return new n.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e)
  51123. },
  51124. InterpolantFactoryMethodLinear: function (e) {
  51125. return new n.LinearInterpolant(this.times, this.values, this.getValueSize(), e)
  51126. },
  51127. InterpolantFactoryMethodSmooth: function (e) {
  51128. return new n.CubicInterpolant(this.times, this.values, this.getValueSize(), e)
  51129. },
  51130. setInterpolation: function (e) {
  51131. var t = void 0
  51132. switch (e) {
  51133. case n.InterpolateDiscrete:
  51134. t = this.InterpolantFactoryMethodDiscrete
  51135. break
  51136. case n.InterpolateLinear:
  51137. t = this.InterpolantFactoryMethodLinear
  51138. break
  51139. case n.InterpolateSmooth:
  51140. t = this.InterpolantFactoryMethodSmooth
  51141. }
  51142. if (void 0 === t) {
  51143. var i =
  51144. 'unsupported interpolation for ' +
  51145. this.ValueTypeName +
  51146. ' keyframe track named ' +
  51147. this.name
  51148. if (void 0 === this.createInterpolant) {
  51149. if (e === this.DefaultInterpolation) throw new Error(i)
  51150. this.setInterpolation(this.DefaultInterpolation)
  51151. }
  51152. return void console.warn(i)
  51153. }
  51154. this.createInterpolant = t
  51155. },
  51156. getInterpolation: function () {
  51157. switch (this.createInterpolant) {
  51158. case this.InterpolantFactoryMethodDiscrete:
  51159. return n.InterpolateDiscrete
  51160. case this.InterpolantFactoryMethodLinear:
  51161. return n.InterpolateLinear
  51162. case this.InterpolantFactoryMethodSmooth:
  51163. return n.InterpolateSmooth
  51164. }
  51165. },
  51166. getValueSize: function () {
  51167. return this.values.length / this.times.length
  51168. },
  51169. shift: function (e) {
  51170. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e
  51171. return this
  51172. },
  51173. scale: function (e) {
  51174. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e
  51175. return this
  51176. },
  51177. trim: function (e, t) {
  51178. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; ) ++o
  51179. for (; a !== -1 && i[a] > t; ) --a
  51180. if ((++a, 0 !== o || a !== r)) {
  51181. o >= a && ((a = Math.max(a, 1)), (o = a - 1))
  51182. var s = this.getValueSize()
  51183. ;(this.times = n.AnimationUtils.arraySlice(i, o, a)),
  51184. (this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s))
  51185. }
  51186. return this
  51187. },
  51188. validate: function () {
  51189. var e = !0,
  51190. t = this.getValueSize()
  51191. t - Math.floor(t) !== 0 &&
  51192. (console.error('invalid value size in track', this), (e = !1))
  51193. var i = this.times,
  51194. r = this.values,
  51195. o = i.length
  51196. 0 === o && (console.error('track is empty', this), (e = !1))
  51197. for (var a = null, s = 0; s !== o; s++) {
  51198. var l = i[s]
  51199. if ('number' == typeof l && isNaN(l)) {
  51200. console.error('time is not a valid number', this, s, l), (e = !1)
  51201. break
  51202. }
  51203. if (null !== a && a > l) {
  51204. console.error('out of order keys', this, s, l, a), (e = !1)
  51205. break
  51206. }
  51207. a = l
  51208. }
  51209. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  51210. for (var s = 0, c = r.length; s !== c; ++s) {
  51211. var h = r[s]
  51212. if (isNaN(h)) {
  51213. console.error('value is not a valid number', this, s, h), (e = !1)
  51214. break
  51215. }
  51216. }
  51217. return e
  51218. },
  51219. optimize: function () {
  51220. for (
  51221. var e = this.times,
  51222. t = this.values,
  51223. i = this.getValueSize(),
  51224. r = 1,
  51225. o = 1,
  51226. a = e.length - 1;
  51227. o <= a;
  51228. ++o
  51229. ) {
  51230. var s = !1,
  51231. l = e[o],
  51232. c = e[o + 1]
  51233. if (l !== c && (1 !== o || l !== l[0]))
  51234. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  51235. var f = t[h + p]
  51236. if (f !== t[u + p] || f !== t[d + p]) {
  51237. s = !0
  51238. break
  51239. }
  51240. }
  51241. if (s) {
  51242. if (o !== r) {
  51243. e[r] = e[o]
  51244. for (var g = o * i, m = r * i, p = 0; p !== i; ++p) t[m + p] = t[g + p]
  51245. }
  51246. ++r
  51247. }
  51248. }
  51249. return (
  51250. r !== e.length &&
  51251. ((this.times = n.AnimationUtils.arraySlice(e, 0, r)),
  51252. (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))),
  51253. this
  51254. )
  51255. }
  51256. }),
  51257. Object.assign(n.KeyframeTrack, {
  51258. parse: function (e) {
  51259. if (void 0 === e.type) throw new Error('track type undefined, can not parse')
  51260. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type)
  51261. if (void 0 === e.times) {
  51262. console.warn('legacy JSON format detected, converting')
  51263. var i = [],
  51264. r = []
  51265. n.AnimationUtils.flattenJSON(e.keys, i, r, 'value'), (e.times = i), (e.values = r)
  51266. }
  51267. return void 0 !== t.parse
  51268. ? t.parse(e)
  51269. : new t(e.name, e.times, e.values, e.interpolation)
  51270. },
  51271. toJSON: function (e) {
  51272. var t,
  51273. i = e.constructor
  51274. if (void 0 !== i.toJSON) t = i.toJSON(e)
  51275. else {
  51276. t = {
  51277. name: e.name,
  51278. times: n.AnimationUtils.convertArray(e.times, Array),
  51279. values: n.AnimationUtils.convertArray(e.values, Array)
  51280. }
  51281. var r = e.getInterpolation()
  51282. r !== e.DefaultInterpolation && (t.interpolation = r)
  51283. }
  51284. return (t.type = e.ValueTypeName), t
  51285. },
  51286. _getTrackTypeForValueTypeName: function (e) {
  51287. switch (e.toLowerCase()) {
  51288. case 'scalar':
  51289. case 'double':
  51290. case 'float':
  51291. case 'number':
  51292. case 'integer':
  51293. return n.NumberKeyframeTrack
  51294. case 'vector':
  51295. case 'vector2':
  51296. case 'vector3':
  51297. case 'vector4':
  51298. return n.VectorKeyframeTrack
  51299. case 'color':
  51300. return n.ColorKeyframeTrack
  51301. case 'quaternion':
  51302. return n.QuaternionKeyframeTrack
  51303. case 'bool':
  51304. case 'boolean':
  51305. return n.BooleanKeyframeTrack
  51306. case 'string':
  51307. return n.StringKeyframeTrack
  51308. }
  51309. throw new Error('Unsupported typeName: ' + e)
  51310. }
  51311. }),
  51312. (n.PropertyBinding = function (e, t, i) {
  51313. ;(this.path = t),
  51314. (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)),
  51315. (this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e),
  51316. (this.rootNode = e)
  51317. }),
  51318. (n.PropertyBinding.prototype = {
  51319. constructor: n.PropertyBinding,
  51320. getValue: function (e, t) {
  51321. this.bind(), this.getValue(e, t)
  51322. },
  51323. setValue: function (e, t) {
  51324. this.bind(), this.setValue(e, t)
  51325. },
  51326. bind: function () {
  51327. var e = this.node,
  51328. t = this.parsedPath,
  51329. i = t.objectName,
  51330. r = t.propertyName,
  51331. o = t.propertyIndex
  51332. if (
  51333. (e ||
  51334. ((e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode),
  51335. (this.node = e)),
  51336. (this.getValue = this._getValue_unavailable),
  51337. (this.setValue = this._setValue_unavailable),
  51338. !e)
  51339. )
  51340. return void console.error(
  51341. ' trying to update node for track: ' + this.path + " but it wasn't found."
  51342. )
  51343. if (i) {
  51344. var a = t.objectIndex
  51345. switch (i) {
  51346. case 'materials':
  51347. if (!e.material)
  51348. return void console.error(
  51349. ' can not bind to material as node does not have a material',
  51350. this
  51351. )
  51352. if (!e.material.materials)
  51353. return void console.error(
  51354. ' can not bind to material.materials as node.material does not have a materials array',
  51355. this
  51356. )
  51357. e = e.material.materials
  51358. break
  51359. case 'bones':
  51360. if (!e.skeleton)
  51361. return void console.error(
  51362. ' can not bind to bones as node does not have a skeleton',
  51363. this
  51364. )
  51365. e = e.skeleton.bones
  51366. for (var s = 0; s < e.length; s++)
  51367. if (e[s].name === a) {
  51368. a = s
  51369. break
  51370. }
  51371. break
  51372. default:
  51373. if (void 0 === e[i])
  51374. return void console.error(
  51375. ' can not bind to objectName of node, undefined',
  51376. this
  51377. )
  51378. e = e[i]
  51379. }
  51380. if (void 0 !== a) {
  51381. if (void 0 === e[a])
  51382. return void console.error(
  51383. ' trying to bind to objectIndex of objectName, but is undefined:',
  51384. this,
  51385. e
  51386. )
  51387. e = e[a]
  51388. }
  51389. }
  51390. var l = e[r]
  51391. if (!l) {
  51392. var c = t.nodeName
  51393. return void console.error(
  51394. ' trying to update property for track: ' + c + '.' + r + " but it wasn't found.",
  51395. e
  51396. )
  51397. }
  51398. var h = this.Versioning.None
  51399. void 0 !== e.needsUpdate
  51400. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  51401. : void 0 !== e.matrixWorldNeedsUpdate &&
  51402. ((h = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e))
  51403. var u = this.BindingType.Direct
  51404. if (void 0 !== o) {
  51405. if ('morphTargetInfluences' === r) {
  51406. if (!e.geometry)
  51407. return void console.error(
  51408. ' can not bind to morphTargetInfluences becasuse node does not have a geometry',
  51409. this
  51410. )
  51411. if (!e.geometry.morphTargets)
  51412. return void console.error(
  51413. ' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets',
  51414. this
  51415. )
  51416. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  51417. if (e.geometry.morphTargets[s].name === o) {
  51418. o = s
  51419. break
  51420. }
  51421. }
  51422. ;(u = this.BindingType.ArrayElement),
  51423. (this.resolvedProperty = l),
  51424. (this.propertyIndex = o)
  51425. } else
  51426. void 0 !== l.fromArray && void 0 !== l.toArray
  51427. ? ((u = this.BindingType.HasFromToArray), (this.resolvedProperty = l))
  51428. : void 0 !== l.length
  51429. ? ((u = this.BindingType.EntireArray), (this.resolvedProperty = l))
  51430. : (this.propertyName = r)
  51431. ;(this.getValue = this.GetterByBindingType[u]),
  51432. (this.setValue = this.SetterByBindingTypeAndVersioning[u][h])
  51433. },
  51434. unbind: function () {
  51435. ;(this.node = null),
  51436. (this.getValue = this._getValue_unbound),
  51437. (this.setValue = this._setValue_unbound)
  51438. }
  51439. }),
  51440. Object.assign(n.PropertyBinding.prototype, {
  51441. _getValue_unavailable: function () {},
  51442. _setValue_unavailable: function () {},
  51443. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  51444. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  51445. BindingType: {
  51446. Direct: 0,
  51447. EntireArray: 1,
  51448. ArrayElement: 2,
  51449. HasFromToArray: 3
  51450. },
  51451. Versioning: {
  51452. None: 0,
  51453. NeedsUpdate: 1,
  51454. MatrixWorldNeedsUpdate: 2
  51455. },
  51456. GetterByBindingType: [
  51457. function (e, t) {
  51458. e[t] = this.node[this.propertyName]
  51459. },
  51460. function (e, t) {
  51461. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) e[t++] = i[n]
  51462. },
  51463. function (e, t) {
  51464. e[t] = this.resolvedProperty[this.propertyIndex]
  51465. },
  51466. function (e, t) {
  51467. this.resolvedProperty.toArray(e, t)
  51468. }
  51469. ],
  51470. SetterByBindingTypeAndVersioning: [
  51471. [
  51472. function (e, t) {
  51473. this.node[this.propertyName] = e[t]
  51474. },
  51475. function (e, t) {
  51476. ;(this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0)
  51477. },
  51478. function (e, t) {
  51479. ;(this.node[this.propertyName] = e[t]),
  51480. (this.targetObject.matrixWorldNeedsUpdate = !0)
  51481. }
  51482. ],
  51483. [
  51484. function (e, t) {
  51485. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51486. i[n] = e[t++]
  51487. },
  51488. function (e, t) {
  51489. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51490. i[n] = e[t++]
  51491. this.targetObject.needsUpdate = !0
  51492. },
  51493. function (e, t) {
  51494. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51495. i[n] = e[t++]
  51496. this.targetObject.matrixWorldNeedsUpdate = !0
  51497. }
  51498. ],
  51499. [
  51500. function (e, t) {
  51501. this.resolvedProperty[this.propertyIndex] = e[t]
  51502. },
  51503. function (e, t) {
  51504. ;(this.resolvedProperty[this.propertyIndex] = e[t]),
  51505. (this.targetObject.needsUpdate = !0)
  51506. },
  51507. function (e, t) {
  51508. ;(this.resolvedProperty[this.propertyIndex] = e[t]),
  51509. (this.targetObject.matrixWorldNeedsUpdate = !0)
  51510. }
  51511. ],
  51512. [
  51513. function (e, t) {
  51514. this.resolvedProperty.fromArray(e, t)
  51515. },
  51516. function (e, t) {
  51517. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0)
  51518. },
  51519. function (e, t) {
  51520. this.resolvedProperty.fromArray(e, t),
  51521. (this.targetObject.matrixWorldNeedsUpdate = !0)
  51522. }
  51523. ]
  51524. ]
  51525. }),
  51526. (n.PropertyBinding.Composite = function (e, t, i) {
  51527. var r = i || n.PropertyBinding.parseTrackName(t)
  51528. ;(this._targetGroup = e), (this._bindings = e.subscribe_(t, r))
  51529. }),
  51530. (n.PropertyBinding.Composite.prototype = {
  51531. constructor: n.PropertyBinding.Composite,
  51532. getValue: function (e, t) {
  51533. this.bind()
  51534. var i = this._targetGroup.nCachedObjects_,
  51535. n = this._bindings[i]
  51536. void 0 !== n && n.getValue(e, t)
  51537. },
  51538. setValue: function (e, t) {
  51539. for (
  51540. var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length;
  51541. n !== r;
  51542. ++n
  51543. )
  51544. i[n].setValue(e, t)
  51545. },
  51546. bind: function () {
  51547. for (
  51548. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51549. t !== i;
  51550. ++t
  51551. )
  51552. e[t].bind()
  51553. },
  51554. unbind: function () {
  51555. for (
  51556. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51557. t !== i;
  51558. ++t
  51559. )
  51560. e[t].unbind()
  51561. }
  51562. }),
  51563. (n.PropertyBinding.create = function (e, t, i) {
  51564. return e instanceof n.AnimationObjectGroup
  51565. ? new n.PropertyBinding.Composite(e, t, i)
  51566. : new n.PropertyBinding(e, t, i)
  51567. }),
  51568. (n.PropertyBinding.parseTrackName = function (e) {
  51569. var t =
  51570. /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  51571. i = t.exec(e)
  51572. if (!i) throw new Error('cannot parse trackName at all: ' + e)
  51573. i.index === t.lastIndex && t.lastIndex++
  51574. var n = {
  51575. nodeName: i[3],
  51576. objectName: i[5],
  51577. objectIndex: i[7],
  51578. propertyName: i[9],
  51579. propertyIndex: i[11]
  51580. }
  51581. if (null === n.propertyName || 0 === n.propertyName.length)
  51582. throw new Error('can not parse propertyName from trackName: ' + e)
  51583. return n
  51584. }),
  51585. (n.PropertyBinding.findNode = function (e, t) {
  51586. if (
  51587. !t ||
  51588. '' === t ||
  51589. 'root' === t ||
  51590. '.' === t ||
  51591. t === -1 ||
  51592. t === e.name ||
  51593. t === e.uuid
  51594. )
  51595. return e
  51596. if (e.skeleton) {
  51597. var i = function (e) {
  51598. for (var i = 0; i < e.bones.length; i++) {
  51599. var n = e.bones[i]
  51600. if (n.name === t) return n
  51601. }
  51602. return null
  51603. },
  51604. n = i(e.skeleton)
  51605. if (n) return n
  51606. }
  51607. if (e.children) {
  51608. var r = function (e) {
  51609. for (var i = 0; i < e.length; i++) {
  51610. var n = e[i]
  51611. if (n.name === t || n.uuid === t) return n
  51612. var o = r(n.children)
  51613. if (o) return o
  51614. }
  51615. return null
  51616. },
  51617. o = r(e.children)
  51618. if (o) return o
  51619. }
  51620. return null
  51621. }),
  51622. (n.PropertyMixer = function (e, t, i) {
  51623. ;(this.binding = e), (this.valueSize = i)
  51624. var n,
  51625. r = Float64Array
  51626. switch (t) {
  51627. case 'quaternion':
  51628. n = this._slerp
  51629. break
  51630. case 'string':
  51631. case 'bool':
  51632. ;(r = Array), (n = this._select)
  51633. break
  51634. default:
  51635. n = this._lerp
  51636. }
  51637. ;(this.buffer = new r(4 * i)),
  51638. (this._mixBufferRegion = n),
  51639. (this.cumulativeWeight = 0),
  51640. (this.useCount = 0),
  51641. (this.referenceCount = 0)
  51642. }),
  51643. (n.PropertyMixer.prototype = {
  51644. constructor: n.PropertyMixer,
  51645. accumulate: function (e, t) {
  51646. var i = this.buffer,
  51647. n = this.valueSize,
  51648. r = e * n + n,
  51649. o = this.cumulativeWeight
  51650. if (0 === o) {
  51651. for (var a = 0; a !== n; ++a) i[r + a] = i[a]
  51652. o = t
  51653. } else {
  51654. o += t
  51655. var s = t / o
  51656. this._mixBufferRegion(i, r, 0, s, n)
  51657. }
  51658. this.cumulativeWeight = o
  51659. },
  51660. apply: function (e) {
  51661. var t = this.valueSize,
  51662. i = this.buffer,
  51663. n = e * t + t,
  51664. r = this.cumulativeWeight,
  51665. o = this.binding
  51666. if (((this.cumulativeWeight = 0), r < 1)) {
  51667. var a = 3 * t
  51668. this._mixBufferRegion(i, n, a, 1 - r, t)
  51669. }
  51670. for (var s = t, l = t + t; s !== l; ++s)
  51671. if (i[s] !== i[s + t]) {
  51672. o.setValue(i, n)
  51673. break
  51674. }
  51675. },
  51676. saveOriginalState: function () {
  51677. var e = this.binding,
  51678. t = this.buffer,
  51679. i = this.valueSize,
  51680. n = 3 * i
  51681. e.getValue(t, n)
  51682. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)]
  51683. this.cumulativeWeight = 0
  51684. },
  51685. restoreOriginalState: function () {
  51686. var e = 3 * this.valueSize
  51687. this.binding.setValue(this.buffer, e)
  51688. },
  51689. _select: function (e, t, i, n, r) {
  51690. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o]
  51691. },
  51692. _slerp: function (e, t, i, r, o) {
  51693. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  51694. },
  51695. _lerp: function (e, t, i, n, r) {
  51696. for (var o = 1 - n, a = 0; a !== r; ++a) {
  51697. var s = t + a
  51698. e[s] = e[s] * o + e[i + a] * n
  51699. }
  51700. }
  51701. }),
  51702. (n.BooleanKeyframeTrack = function (e, t, i) {
  51703. n.KeyframeTrack.call(this, e, t, i)
  51704. }),
  51705. (n.BooleanKeyframeTrack.prototype = Object.assign(
  51706. Object.create(n.KeyframeTrack.prototype),
  51707. {
  51708. constructor: n.BooleanKeyframeTrack,
  51709. ValueTypeName: 'bool',
  51710. ValueBufferType: Array,
  51711. DefaultInterpolation: n.IntepolateDiscrete,
  51712. InterpolantFactoryMethodLinear: void 0,
  51713. InterpolantFactoryMethodSmooth: void 0
  51714. }
  51715. )),
  51716. (n.NumberKeyframeTrack = function (e, t, i, r) {
  51717. n.KeyframeTrack.call(this, e, t, i, r)
  51718. }),
  51719. (n.NumberKeyframeTrack.prototype = Object.assign(
  51720. Object.create(n.KeyframeTrack.prototype),
  51721. {
  51722. constructor: n.NumberKeyframeTrack,
  51723. ValueTypeName: 'number'
  51724. }
  51725. )),
  51726. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  51727. n.KeyframeTrack.call(this, e, t, i, r)
  51728. }),
  51729. (n.QuaternionKeyframeTrack.prototype = Object.assign(
  51730. Object.create(n.KeyframeTrack.prototype),
  51731. {
  51732. constructor: n.QuaternionKeyframeTrack,
  51733. ValueTypeName: 'quaternion',
  51734. DefaultInterpolation: n.InterpolateLinear,
  51735. InterpolantFactoryMethodLinear: function (e) {
  51736. return new n.QuaternionLinearInterpolant(
  51737. this.times,
  51738. this.values,
  51739. this.getValueSize(),
  51740. e
  51741. )
  51742. },
  51743. InterpolantFactoryMethodSmooth: void 0
  51744. }
  51745. )),
  51746. (n.StringKeyframeTrack = function (e, t, i, r) {
  51747. n.KeyframeTrack.call(this, e, t, i, r)
  51748. }),
  51749. (n.StringKeyframeTrack.prototype = Object.assign(
  51750. Object.create(n.KeyframeTrack.prototype),
  51751. {
  51752. constructor: n.StringKeyframeTrack,
  51753. ValueTypeName: 'string',
  51754. ValueBufferType: Array,
  51755. DefaultInterpolation: n.IntepolateDiscrete,
  51756. InterpolantFactoryMethodLinear: void 0,
  51757. InterpolantFactoryMethodSmooth: void 0
  51758. }
  51759. )),
  51760. (n.VectorKeyframeTrack = function (e, t, i, r) {
  51761. n.KeyframeTrack.call(this, e, t, i, r)
  51762. }),
  51763. (n.VectorKeyframeTrack.prototype = Object.assign(
  51764. Object.create(n.KeyframeTrack.prototype),
  51765. {
  51766. constructor: n.VectorKeyframeTrack,
  51767. ValueTypeName: 'vector'
  51768. }
  51769. )),
  51770. (n.Audio = function (e) {
  51771. n.Object3D.call(this),
  51772. (this.type = 'Audio'),
  51773. (this.context = e.context),
  51774. (this.source = this.context.createBufferSource()),
  51775. (this.source.onended = this.onEnded.bind(this)),
  51776. (this.gain = this.context.createGain()),
  51777. this.gain.connect(e.getInput()),
  51778. (this.autoplay = !1),
  51779. (this.startTime = 0),
  51780. (this.playbackRate = 1),
  51781. (this.isPlaying = !1),
  51782. (this.hasPlaybackControl = !0),
  51783. (this.sourceType = 'empty'),
  51784. (this.filter = null)
  51785. }),
  51786. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  51787. (n.Audio.prototype.constructor = n.Audio),
  51788. (n.Audio.prototype.getOutput = function () {
  51789. return this.gain
  51790. }),
  51791. (n.Audio.prototype.load = function (e) {
  51792. var t = new n.AudioBuffer(this.context)
  51793. return t.load(e), this.setBuffer(t), this
  51794. }),
  51795. (n.Audio.prototype.setNodeSource = function (e) {
  51796. return (
  51797. (this.hasPlaybackControl = !1),
  51798. (this.sourceType = 'audioNode'),
  51799. (this.source = e),
  51800. this.connect(),
  51801. this
  51802. )
  51803. }),
  51804. (n.Audio.prototype.setBuffer = function (e) {
  51805. var t = this
  51806. return (
  51807. e.onReady(function (e) {
  51808. ;(t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play()
  51809. }),
  51810. this
  51811. )
  51812. }),
  51813. (n.Audio.prototype.play = function () {
  51814. if (this.isPlaying === !0)
  51815. return void console.warn('THREE.Audio: Audio is already playing.')
  51816. if (this.hasPlaybackControl === !1)
  51817. return void console.warn('THREE.Audio: this Audio has no playback control.')
  51818. var e = this.context.createBufferSource()
  51819. ;(e.buffer = this.source.buffer),
  51820. (e.loop = this.source.loop),
  51821. (e.onended = this.source.onended),
  51822. e.start(0, this.startTime),
  51823. (e.playbackRate.value = this.playbackRate),
  51824. (this.isPlaying = !0),
  51825. (this.source = e),
  51826. this.connect()
  51827. }),
  51828. (n.Audio.prototype.pause = function () {
  51829. return this.hasPlaybackControl === !1
  51830. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51831. : (this.source.stop(), void (this.startTime = this.context.currentTime))
  51832. }),
  51833. (n.Audio.prototype.stop = function () {
  51834. return this.hasPlaybackControl === !1
  51835. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51836. : (this.source.stop(), void (this.startTime = 0))
  51837. }),
  51838. (n.Audio.prototype.connect = function () {
  51839. null !== this.filter
  51840. ? (this.source.connect(this.filter), this.filter.connect(this.getOutput()))
  51841. : this.source.connect(this.getOutput())
  51842. }),
  51843. (n.Audio.prototype.disconnect = function () {
  51844. null !== this.filter
  51845. ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput()))
  51846. : this.source.disconnect(this.getOutput())
  51847. }),
  51848. (n.Audio.prototype.getFilter = function () {
  51849. return this.filter
  51850. }),
  51851. (n.Audio.prototype.setFilter = function (e) {
  51852. void 0 === e && (e = null),
  51853. this.isPlaying === !0
  51854. ? (this.disconnect(), (this.filter = e), this.connect())
  51855. : (this.filter = e)
  51856. }),
  51857. (n.Audio.prototype.setPlaybackRate = function (e) {
  51858. return this.hasPlaybackControl === !1
  51859. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51860. : ((this.playbackRate = e),
  51861. void (
  51862. this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)
  51863. ))
  51864. }),
  51865. (n.Audio.prototype.getPlaybackRate = function () {
  51866. return this.playbackRate
  51867. }),
  51868. (n.Audio.prototype.onEnded = function () {
  51869. this.isPlaying = !1
  51870. }),
  51871. (n.Audio.prototype.setLoop = function (e) {
  51872. return this.hasPlaybackControl === !1
  51873. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51874. : void (this.source.loop = e)
  51875. }),
  51876. (n.Audio.prototype.getLoop = function () {
  51877. return this.hasPlaybackControl === !1
  51878. ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1)
  51879. : this.source.loop
  51880. }),
  51881. (n.Audio.prototype.setVolume = function (e) {
  51882. this.gain.gain.value = e
  51883. }),
  51884. (n.Audio.prototype.getVolume = function () {
  51885. return this.gain.gain.value
  51886. }),
  51887. (n.AudioAnalyser = function (e, t) {
  51888. ;(this.analyser = e.context.createAnalyser()),
  51889. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  51890. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  51891. e.getOutput().connect(this.analyser)
  51892. }),
  51893. (n.AudioAnalyser.prototype = {
  51894. constructor: n.AudioAnalyser,
  51895. getData: function () {
  51896. return this.analyser.getByteFrequencyData(this.data), this.data
  51897. }
  51898. }),
  51899. (n.AudioBuffer = function (e) {
  51900. ;(this.context = e), (this.ready = !1), (this.readyCallbacks = [])
  51901. }),
  51902. (n.AudioBuffer.prototype.load = function (e) {
  51903. var t = this,
  51904. i = new XMLHttpRequest()
  51905. return (
  51906. i.open('GET', e, !0),
  51907. (i.responseType = 'arraybuffer'),
  51908. (i.onload = function (e) {
  51909. t.context.decodeAudioData(this.response, function (e) {
  51910. ;(t.buffer = e), (t.ready = !0)
  51911. for (var i = 0; i < t.readyCallbacks.length; i++) t.readyCallbacks[i](t.buffer)
  51912. t.readyCallbacks = []
  51913. })
  51914. }),
  51915. i.send(),
  51916. this
  51917. )
  51918. }),
  51919. (n.AudioBuffer.prototype.onReady = function (e) {
  51920. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  51921. }),
  51922. (n.PositionalAudio = function (e) {
  51923. n.Audio.call(this, e),
  51924. (this.panner = this.context.createPanner()),
  51925. this.panner.connect(this.gain)
  51926. }),
  51927. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  51928. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  51929. (n.PositionalAudio.prototype.getOutput = function () {
  51930. return this.panner
  51931. }),
  51932. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  51933. this.panner.refDistance = e
  51934. }),
  51935. (n.PositionalAudio.prototype.getRefDistance = function () {
  51936. return this.panner.refDistance
  51937. }),
  51938. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  51939. this.panner.rolloffFactor = e
  51940. }),
  51941. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  51942. return this.panner.rolloffFactor
  51943. }),
  51944. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  51945. this.panner.distanceModel = e
  51946. }),
  51947. (n.PositionalAudio.prototype.getDistanceModel = function () {
  51948. return this.panner.distanceModel
  51949. }),
  51950. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  51951. this.panner.maxDistance = e
  51952. }),
  51953. (n.PositionalAudio.prototype.getMaxDistance = function () {
  51954. return this.panner.maxDistance
  51955. }),
  51956. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  51957. var e = new n.Vector3()
  51958. return function (t) {
  51959. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  51960. e.setFromMatrixPosition(this.matrixWorld),
  51961. this.panner.setPosition(e.x, e.y, e.z)
  51962. }
  51963. })()),
  51964. (n.AudioListener = function () {
  51965. n.Object3D.call(this),
  51966. (this.type = 'AudioListener'),
  51967. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  51968. (this.gain = this.context.createGain()),
  51969. this.gain.connect(this.context.destination),
  51970. (this.filter = null)
  51971. }),
  51972. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  51973. (n.AudioListener.prototype.constructor = n.AudioListener),
  51974. (n.AudioListener.prototype.getInput = function () {
  51975. return this.gain
  51976. }),
  51977. (n.AudioListener.prototype.removeFilter = function () {
  51978. null !== this.filter &&
  51979. (this.gain.disconnect(this.filter),
  51980. this.filter.disconnect(this.context.destination),
  51981. this.gain.connect(this.context.destination),
  51982. (this.filter = null))
  51983. }),
  51984. (n.AudioListener.prototype.setFilter = function (e) {
  51985. null !== this.filter
  51986. ? (this.gain.disconnect(this.filter),
  51987. this.filter.disconnect(this.context.destination))
  51988. : this.gain.disconnect(this.context.destination),
  51989. (this.filter = e),
  51990. this.gain.connect(this.filter),
  51991. this.filter.connect(this.context.destination)
  51992. }),
  51993. (n.AudioListener.prototype.getFilter = function () {
  51994. return this.filter
  51995. }),
  51996. (n.AudioListener.prototype.setMasterVolume = function (e) {
  51997. this.gain.gain.value = e
  51998. }),
  51999. (n.AudioListener.prototype.getMasterVolume = function () {
  52000. return this.gain.gain.value
  52001. }),
  52002. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  52003. var e = new n.Vector3(),
  52004. t = new n.Quaternion(),
  52005. i = new n.Vector3(),
  52006. r = new n.Vector3()
  52007. return function (o) {
  52008. n.Object3D.prototype.updateMatrixWorld.call(this, o)
  52009. var a = this.context.listener,
  52010. s = this.up
  52011. this.matrixWorld.decompose(e, t, i),
  52012. r.set(0, 0, -1).applyQuaternion(t),
  52013. a.setPosition(e.x, e.y, e.z),
  52014. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  52015. }
  52016. })()),
  52017. (n.Camera = function () {
  52018. n.Object3D.call(this),
  52019. (this.type = 'Camera'),
  52020. (this.matrixWorldInverse = new n.Matrix4()),
  52021. (this.projectionMatrix = new n.Matrix4())
  52022. }),
  52023. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  52024. (n.Camera.prototype.constructor = n.Camera),
  52025. (n.Camera.prototype.getWorldDirection = (function () {
  52026. var e = new n.Quaternion()
  52027. return function (t) {
  52028. var i = t || new n.Vector3()
  52029. return this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e)
  52030. }
  52031. })()),
  52032. (n.Camera.prototype.lookAt = (function () {
  52033. var e = new n.Matrix4()
  52034. return function (t) {
  52035. e.lookAt(this.position, t, this.up), this.quaternion.setFromRotationMatrix(e)
  52036. }
  52037. })()),
  52038. (n.Camera.prototype.clone = function () {
  52039. return new this.constructor().copy(this)
  52040. }),
  52041. (n.Camera.prototype.copy = function (e) {
  52042. return (
  52043. n.Object3D.prototype.copy.call(this, e),
  52044. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  52045. this.projectionMatrix.copy(e.projectionMatrix),
  52046. this
  52047. )
  52048. }),
  52049. (n.CubeCamera = function (e, t, i) {
  52050. n.Object3D.call(this), (this.type = 'CubeCamera')
  52051. var r = 90,
  52052. o = 1,
  52053. a = new n.PerspectiveCamera(r, o, e, t)
  52054. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a)
  52055. var s = new n.PerspectiveCamera(r, o, e, t)
  52056. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s)
  52057. var l = new n.PerspectiveCamera(r, o, e, t)
  52058. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l)
  52059. var c = new n.PerspectiveCamera(r, o, e, t)
  52060. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c)
  52061. var h = new n.PerspectiveCamera(r, o, e, t)
  52062. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h)
  52063. var u = new n.PerspectiveCamera(r, o, e, t)
  52064. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u)
  52065. var d = {
  52066. format: n.RGBFormat,
  52067. magFilter: n.LinearFilter,
  52068. minFilter: n.LinearFilter
  52069. }
  52070. ;(this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  52071. (this.updateCubeMap = function (e, t) {
  52072. null === this.parent && this.updateMatrixWorld()
  52073. var i = this.renderTarget,
  52074. n = i.texture.generateMipmaps
  52075. ;(i.texture.generateMipmaps = !1),
  52076. (i.activeCubeFace = 0),
  52077. e.render(t, a, i),
  52078. (i.activeCubeFace = 1),
  52079. e.render(t, s, i),
  52080. (i.activeCubeFace = 2),
  52081. e.render(t, l, i),
  52082. (i.activeCubeFace = 3),
  52083. e.render(t, c, i),
  52084. (i.activeCubeFace = 4),
  52085. e.render(t, h, i),
  52086. (i.texture.generateMipmaps = n),
  52087. (i.activeCubeFace = 5),
  52088. e.render(t, u, i),
  52089. e.setRenderTarget(null)
  52090. })
  52091. }),
  52092. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  52093. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  52094. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  52095. n.Camera.call(this),
  52096. (this.type = 'OrthographicCamera'),
  52097. (this.zoom = 1),
  52098. (this.left = e),
  52099. (this.right = t),
  52100. (this.top = i),
  52101. (this.bottom = r),
  52102. (this.near = void 0 !== o ? o : 0.1),
  52103. (this.far = void 0 !== a ? a : 2e3),
  52104. this.updateProjectionMatrix()
  52105. }),
  52106. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  52107. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  52108. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  52109. var e = (this.right - this.left) / (2 * this.zoom),
  52110. t = (this.top - this.bottom) / (2 * this.zoom),
  52111. i = (this.right + this.left) / 2,
  52112. n = (this.top + this.bottom) / 2
  52113. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  52114. }),
  52115. (n.OrthographicCamera.prototype.copy = function (e) {
  52116. return (
  52117. n.Camera.prototype.copy.call(this, e),
  52118. (this.left = e.left),
  52119. (this.right = e.right),
  52120. (this.top = e.top),
  52121. (this.bottom = e.bottom),
  52122. (this.near = e.near),
  52123. (this.far = e.far),
  52124. (this.zoom = e.zoom),
  52125. this
  52126. )
  52127. }),
  52128. (n.OrthographicCamera.prototype.toJSON = function (e) {
  52129. var t = n.Object3D.prototype.toJSON.call(this, e)
  52130. return (
  52131. (t.object.zoom = this.zoom),
  52132. (t.object.left = this.left),
  52133. (t.object.right = this.right),
  52134. (t.object.top = this.top),
  52135. (t.object.bottom = this.bottom),
  52136. (t.object.near = this.near),
  52137. (t.object.far = this.far),
  52138. t
  52139. )
  52140. }),
  52141. (n.PerspectiveCamera = function (e, t, i, r) {
  52142. n.Camera.call(this),
  52143. (this.type = 'PerspectiveCamera'),
  52144. (this.focalLength = 10),
  52145. (this.zoom = 1),
  52146. (this.fov = void 0 !== e ? e : 50),
  52147. (this.aspect = void 0 !== t ? t : 1),
  52148. (this.near = void 0 !== i ? i : 0.1),
  52149. (this.far = void 0 !== r ? r : 2e3),
  52150. this.updateProjectionMatrix()
  52151. }),
  52152. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  52153. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  52154. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  52155. void 0 === t && (t = 24),
  52156. (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))),
  52157. this.updateProjectionMatrix()
  52158. }),
  52159. (n.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  52160. ;(this.fullWidth = e),
  52161. (this.fullHeight = t),
  52162. (this.x = i),
  52163. (this.y = n),
  52164. (this.width = r),
  52165. (this.height = o),
  52166. this.updateProjectionMatrix()
  52167. }),
  52168. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  52169. var e = n.Math.radToDeg(
  52170. 2 * Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom)
  52171. )
  52172. if (this.fullWidth) {
  52173. var t = this.fullWidth / this.fullHeight,
  52174. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  52175. r = -i,
  52176. o = t * r,
  52177. a = t * i,
  52178. s = Math.abs(a - o),
  52179. l = Math.abs(i - r)
  52180. this.projectionMatrix.makeFrustum(
  52181. o + (this.x * s) / this.fullWidth,
  52182. o + ((this.x + this.width) * s) / this.fullWidth,
  52183. i - ((this.y + this.height) * l) / this.fullHeight,
  52184. i - (this.y * l) / this.fullHeight,
  52185. this.near,
  52186. this.far
  52187. )
  52188. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  52189. }),
  52190. (n.PerspectiveCamera.prototype.copy = function (e) {
  52191. return (
  52192. n.Camera.prototype.copy.call(this, e),
  52193. (this.focalLength = e.focalLength),
  52194. (this.zoom = e.zoom),
  52195. (this.fov = e.fov),
  52196. (this.aspect = e.aspect),
  52197. (this.near = e.near),
  52198. (this.far = e.far),
  52199. this
  52200. )
  52201. }),
  52202. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  52203. var t = n.Object3D.prototype.toJSON.call(this, e)
  52204. return (
  52205. (t.object.focalLength = this.focalLength),
  52206. (t.object.zoom = this.zoom),
  52207. (t.object.fov = this.fov),
  52208. (t.object.aspect = this.aspect),
  52209. (t.object.near = this.near),
  52210. (t.object.far = this.far),
  52211. t
  52212. )
  52213. }),
  52214. (n.StereoCamera = function () {
  52215. ;(this.type = 'StereoCamera'),
  52216. (this.aspect = 1),
  52217. (this.cameraL = new n.PerspectiveCamera()),
  52218. this.cameraL.layers.enable(1),
  52219. (this.cameraL.matrixAutoUpdate = !1),
  52220. (this.cameraR = new n.PerspectiveCamera()),
  52221. this.cameraR.layers.enable(2),
  52222. (this.cameraR.matrixAutoUpdate = !1)
  52223. }),
  52224. (n.StereoCamera.prototype = {
  52225. constructor: n.StereoCamera,
  52226. update: (function () {
  52227. var e,
  52228. t,
  52229. i,
  52230. r,
  52231. o,
  52232. a = new n.Matrix4(),
  52233. s = new n.Matrix4()
  52234. return function (l) {
  52235. var c =
  52236. e !== l.focalLength ||
  52237. t !== l.fov ||
  52238. i !== l.aspect * this.aspect ||
  52239. r !== l.near ||
  52240. o !== l.far
  52241. if (c) {
  52242. ;(e = l.focalLength),
  52243. (t = l.fov),
  52244. (i = l.aspect * this.aspect),
  52245. (r = l.near),
  52246. (o = l.far)
  52247. var h,
  52248. u,
  52249. d = l.projectionMatrix.clone(),
  52250. p = 0.032,
  52251. f = (p * r) / e,
  52252. g = r * Math.tan(n.Math.degToRad(0.5 * t))
  52253. ;(s.elements[12] = -p),
  52254. (a.elements[12] = p),
  52255. (h = -g * i + f),
  52256. (u = g * i + f),
  52257. (d.elements[0] = (2 * r) / (u - h)),
  52258. (d.elements[8] = (u + h) / (u - h)),
  52259. this.cameraL.projectionMatrix.copy(d),
  52260. (h = -g * i - f),
  52261. (u = g * i - f),
  52262. (d.elements[0] = (2 * r) / (u - h)),
  52263. (d.elements[8] = (u + h) / (u - h)),
  52264. this.cameraR.projectionMatrix.copy(d)
  52265. }
  52266. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  52267. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  52268. }
  52269. })()
  52270. }),
  52271. (n.Light = function (e, t) {
  52272. n.Object3D.call(this),
  52273. (this.type = 'Light'),
  52274. (this.color = new n.Color(e)),
  52275. (this.intensity = void 0 !== t ? t : 1),
  52276. (this.receiveShadow = void 0)
  52277. }),
  52278. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  52279. (n.Light.prototype.constructor = n.Light),
  52280. (n.Light.prototype.copy = function (e) {
  52281. return (
  52282. n.Object3D.prototype.copy.call(this, e),
  52283. this.color.copy(e.color),
  52284. (this.intensity = e.intensity),
  52285. this
  52286. )
  52287. }),
  52288. (n.Light.prototype.toJSON = function (e) {
  52289. var t = n.Object3D.prototype.toJSON.call(this, e)
  52290. return (
  52291. (t.object.color = this.color.getHex()),
  52292. (t.object.intensity = this.intensity),
  52293. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  52294. void 0 !== this.distance && (t.object.distance = this.distance),
  52295. void 0 !== this.angle && (t.object.angle = this.angle),
  52296. void 0 !== this.decay && (t.object.decay = this.decay),
  52297. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  52298. t
  52299. )
  52300. }),
  52301. (n.LightShadow = function (e) {
  52302. ;(this.camera = e),
  52303. (this.bias = 0),
  52304. (this.radius = 1),
  52305. (this.mapSize = new n.Vector2(512, 512)),
  52306. (this.map = null),
  52307. (this.matrix = new n.Matrix4())
  52308. }),
  52309. (n.LightShadow.prototype = {
  52310. constructor: n.LightShadow,
  52311. copy: function (e) {
  52312. return (
  52313. (this.camera = e.camera.clone()),
  52314. (this.bias = e.bias),
  52315. (this.radius = e.radius),
  52316. this.mapSize.copy(e.mapSize),
  52317. this
  52318. )
  52319. },
  52320. clone: function () {
  52321. return new this.constructor().copy(this)
  52322. }
  52323. }),
  52324. (n.AmbientLight = function (e, t) {
  52325. n.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0)
  52326. }),
  52327. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  52328. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  52329. (n.DirectionalLight = function (e, t) {
  52330. n.Light.call(this, e, t),
  52331. (this.type = 'DirectionalLight'),
  52332. this.position.set(0, 1, 0),
  52333. this.updateMatrix(),
  52334. (this.target = new n.Object3D()),
  52335. (this.shadow = new n.LightShadow(new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)))
  52336. }),
  52337. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  52338. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  52339. (n.DirectionalLight.prototype.copy = function (e) {
  52340. return (
  52341. n.Light.prototype.copy.call(this, e),
  52342. (this.target = e.target.clone()),
  52343. (this.shadow = e.shadow.clone()),
  52344. this
  52345. )
  52346. }),
  52347. (n.HemisphereLight = function (e, t, i) {
  52348. n.Light.call(this, e, i),
  52349. (this.type = 'HemisphereLight'),
  52350. (this.castShadow = void 0),
  52351. this.position.set(0, 1, 0),
  52352. this.updateMatrix(),
  52353. (this.groundColor = new n.Color(t))
  52354. }),
  52355. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  52356. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  52357. (n.HemisphereLight.prototype.copy = function (e) {
  52358. return n.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this
  52359. }),
  52360. (n.PointLight = function (e, t, i, r) {
  52361. n.Light.call(this, e, t),
  52362. (this.type = 'PointLight'),
  52363. (this.distance = void 0 !== i ? i : 0),
  52364. (this.decay = void 0 !== r ? r : 1),
  52365. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(90, 1, 0.5, 500)))
  52366. }),
  52367. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  52368. (n.PointLight.prototype.constructor = n.PointLight),
  52369. Object.defineProperty(n.PointLight.prototype, 'power', {
  52370. get: function () {
  52371. return 4 * this.intensity * Math.PI
  52372. },
  52373. set: function (e) {
  52374. this.intensity = e / (4 * Math.PI)
  52375. }
  52376. }),
  52377. (n.PointLight.prototype.copy = function (e) {
  52378. return (
  52379. n.Light.prototype.copy.call(this, e),
  52380. (this.distance = e.distance),
  52381. (this.decay = e.decay),
  52382. (this.shadow = e.shadow.clone()),
  52383. this
  52384. )
  52385. }),
  52386. (n.SpotLight = function (e, t, i, r, o, a) {
  52387. n.Light.call(this, e, t),
  52388. (this.type = 'SpotLight'),
  52389. this.position.set(0, 1, 0),
  52390. this.updateMatrix(),
  52391. (this.target = new n.Object3D()),
  52392. (this.distance = void 0 !== i ? i : 0),
  52393. (this.angle = void 0 !== r ? r : Math.PI / 3),
  52394. (this.penumbra = void 0 !== o ? o : 0),
  52395. (this.decay = void 0 !== a ? a : 1),
  52396. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(50, 1, 0.5, 500)))
  52397. }),
  52398. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  52399. (n.SpotLight.prototype.constructor = n.SpotLight),
  52400. Object.defineProperty(n.SpotLight.prototype, 'power', {
  52401. get: function () {
  52402. return this.intensity * Math.PI
  52403. },
  52404. set: function (e) {
  52405. this.intensity = e / Math.PI
  52406. }
  52407. }),
  52408. (n.SpotLight.prototype.copy = function (e) {
  52409. return (
  52410. n.Light.prototype.copy.call(this, e),
  52411. (this.distance = e.distance),
  52412. (this.angle = e.angle),
  52413. (this.penumbra = e.penumbra),
  52414. (this.decay = e.decay),
  52415. (this.target = e.target.clone()),
  52416. (this.shadow = e.shadow.clone()),
  52417. this
  52418. )
  52419. }),
  52420. (n.Cache = {
  52421. enabled: !1,
  52422. files: {},
  52423. add: function (e, t) {
  52424. this.enabled !== !1 && (this.files[e] = t)
  52425. },
  52426. get: function (e) {
  52427. if (this.enabled !== !1) return this.files[e]
  52428. },
  52429. remove: function (e) {
  52430. delete this.files[e]
  52431. },
  52432. clear: function () {
  52433. this.files = {}
  52434. }
  52435. }),
  52436. (n.Loader = function () {
  52437. ;(this.onLoadStart = function () {}),
  52438. (this.onLoadProgress = function () {}),
  52439. (this.onLoadComplete = function () {})
  52440. }),
  52441. (n.Loader.prototype = {
  52442. constructor: n.Loader,
  52443. crossOrigin: void 0,
  52444. extractUrlBase: function (e) {
  52445. var t = e.split('/')
  52446. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/')
  52447. },
  52448. initMaterials: function (e, t, i) {
  52449. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i)
  52450. return n
  52451. },
  52452. createMaterial: (function () {
  52453. var e, t, i
  52454. return function (r, o, a) {
  52455. function s(e, i, r, s, c) {
  52456. var h,
  52457. u = o + e,
  52458. d = n.Loader.Handlers.get(u)
  52459. null !== d ? (h = d.load(u)) : (t.setCrossOrigin(a), (h = t.load(u))),
  52460. void 0 !== i &&
  52461. (h.repeat.fromArray(i),
  52462. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  52463. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  52464. void 0 !== r && h.offset.fromArray(r),
  52465. void 0 !== s &&
  52466. ('repeat' === s[0] && (h.wrapS = n.RepeatWrapping),
  52467. 'mirror' === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  52468. 'repeat' === s[1] && (h.wrapT = n.RepeatWrapping),
  52469. 'mirror' === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  52470. void 0 !== c && (h.anisotropy = c)
  52471. var p = n.Math.generateUUID()
  52472. return (l[p] = h), p
  52473. }
  52474. void 0 === e && (e = new n.Color()),
  52475. void 0 === t && (t = new n.TextureLoader()),
  52476. void 0 === i && (i = new n.MaterialLoader())
  52477. var l = {},
  52478. c = {
  52479. uuid: n.Math.generateUUID(),
  52480. type: 'MeshLambertMaterial'
  52481. }
  52482. for (var h in r) {
  52483. var u = r[h]
  52484. switch (h) {
  52485. case 'DbgColor':
  52486. case 'DbgIndex':
  52487. case 'opticalDensity':
  52488. case 'illumination':
  52489. break
  52490. case 'DbgName':
  52491. c.name = u
  52492. break
  52493. case 'blending':
  52494. c.blending = n[u]
  52495. break
  52496. case 'colorAmbient':
  52497. case 'mapAmbient':
  52498. console.warn('THREE.Loader.createMaterial:', h, 'is no longer supported.')
  52499. break
  52500. case 'colorDiffuse':
  52501. c.color = e.fromArray(u).getHex()
  52502. break
  52503. case 'colorSpecular':
  52504. c.specular = e.fromArray(u).getHex()
  52505. break
  52506. case 'colorEmissive':
  52507. c.emissive = e.fromArray(u).getHex()
  52508. break
  52509. case 'specularCoef':
  52510. c.shininess = u
  52511. break
  52512. case 'shading':
  52513. 'basic' === u.toLowerCase() && (c.type = 'MeshBasicMaterial'),
  52514. 'phong' === u.toLowerCase() && (c.type = 'MeshPhongMaterial')
  52515. break
  52516. case 'mapDiffuse':
  52517. c.map = s(
  52518. u,
  52519. r.mapDiffuseRepeat,
  52520. r.mapDiffuseOffset,
  52521. r.mapDiffuseWrap,
  52522. r.mapDiffuseAnisotropy
  52523. )
  52524. break
  52525. case 'mapDiffuseRepeat':
  52526. case 'mapDiffuseOffset':
  52527. case 'mapDiffuseWrap':
  52528. case 'mapDiffuseAnisotropy':
  52529. break
  52530. case 'mapLight':
  52531. c.lightMap = s(
  52532. u,
  52533. r.mapLightRepeat,
  52534. r.mapLightOffset,
  52535. r.mapLightWrap,
  52536. r.mapLightAnisotropy
  52537. )
  52538. break
  52539. case 'mapLightRepeat':
  52540. case 'mapLightOffset':
  52541. case 'mapLightWrap':
  52542. case 'mapLightAnisotropy':
  52543. break
  52544. case 'mapAO':
  52545. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy)
  52546. break
  52547. case 'mapAORepeat':
  52548. case 'mapAOOffset':
  52549. case 'mapAOWrap':
  52550. case 'mapAOAnisotropy':
  52551. break
  52552. case 'mapBump':
  52553. c.bumpMap = s(
  52554. u,
  52555. r.mapBumpRepeat,
  52556. r.mapBumpOffset,
  52557. r.mapBumpWrap,
  52558. r.mapBumpAnisotropy
  52559. )
  52560. break
  52561. case 'mapBumpScale':
  52562. c.bumpScale = u
  52563. break
  52564. case 'mapBumpRepeat':
  52565. case 'mapBumpOffset':
  52566. case 'mapBumpWrap':
  52567. case 'mapBumpAnisotropy':
  52568. break
  52569. case 'mapNormal':
  52570. c.normalMap = s(
  52571. u,
  52572. r.mapNormalRepeat,
  52573. r.mapNormalOffset,
  52574. r.mapNormalWrap,
  52575. r.mapNormalAnisotropy
  52576. )
  52577. break
  52578. case 'mapNormalFactor':
  52579. c.normalScale = [u, u]
  52580. break
  52581. case 'mapNormalRepeat':
  52582. case 'mapNormalOffset':
  52583. case 'mapNormalWrap':
  52584. case 'mapNormalAnisotropy':
  52585. break
  52586. case 'mapSpecular':
  52587. c.specularMap = s(
  52588. u,
  52589. r.mapSpecularRepeat,
  52590. r.mapSpecularOffset,
  52591. r.mapSpecularWrap,
  52592. r.mapSpecularAnisotropy
  52593. )
  52594. break
  52595. case 'mapSpecularRepeat':
  52596. case 'mapSpecularOffset':
  52597. case 'mapSpecularWrap':
  52598. case 'mapSpecularAnisotropy':
  52599. break
  52600. case 'mapAlpha':
  52601. c.alphaMap = s(
  52602. u,
  52603. r.mapAlphaRepeat,
  52604. r.mapAlphaOffset,
  52605. r.mapAlphaWrap,
  52606. r.mapAlphaAnisotropy
  52607. )
  52608. break
  52609. case 'mapAlphaRepeat':
  52610. case 'mapAlphaOffset':
  52611. case 'mapAlphaWrap':
  52612. case 'mapAlphaAnisotropy':
  52613. break
  52614. case 'flipSided':
  52615. c.side = n.BackSide
  52616. break
  52617. case 'doubleSided':
  52618. c.side = n.DoubleSide
  52619. break
  52620. case 'transparency':
  52621. console.warn(
  52622. 'THREE.Loader.createMaterial: transparency has been renamed to opacity'
  52623. ),
  52624. (c.opacity = u)
  52625. break
  52626. case 'depthTest':
  52627. case 'depthWrite':
  52628. case 'colorWrite':
  52629. case 'opacity':
  52630. case 'reflectivity':
  52631. case 'transparent':
  52632. case 'visible':
  52633. case 'wireframe':
  52634. c[h] = u
  52635. break
  52636. case 'vertexColors':
  52637. u === !0 && (c.vertexColors = n.VertexColors),
  52638. 'face' === u && (c.vertexColors = n.FaceColors)
  52639. break
  52640. default:
  52641. console.error('THREE.Loader.createMaterial: Unsupported', h, u)
  52642. }
  52643. }
  52644. return (
  52645. 'MeshBasicMaterial' === c.type && delete c.emissive,
  52646. 'MeshPhongMaterial' !== c.type && delete c.specular,
  52647. c.opacity < 1 && (c.transparent = !0),
  52648. i.setTextures(l),
  52649. i.parse(c)
  52650. )
  52651. }
  52652. })()
  52653. }),
  52654. (n.Loader.Handlers = {
  52655. handlers: [],
  52656. add: function (e, t) {
  52657. this.handlers.push(e, t)
  52658. },
  52659. get: function (e) {
  52660. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  52661. var r = t[i],
  52662. o = t[i + 1]
  52663. if (r.test(e)) return o
  52664. }
  52665. return null
  52666. }
  52667. }),
  52668. (n.XHRLoader = function (e) {
  52669. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  52670. }),
  52671. (n.XHRLoader.prototype = {
  52672. constructor: n.XHRLoader,
  52673. load: function (e, t, i, r) {
  52674. void 0 !== this.path && (e = this.path + e)
  52675. var o = this,
  52676. a = n.Cache.get(e)
  52677. if (void 0 !== a)
  52678. return (
  52679. t &&
  52680. setTimeout(function () {
  52681. t(a)
  52682. }, 0),
  52683. a
  52684. )
  52685. var s = new XMLHttpRequest()
  52686. return (
  52687. s.overrideMimeType('text/plain'),
  52688. s.open('GET', e, !0),
  52689. s.addEventListener(
  52690. 'load',
  52691. function (i) {
  52692. var a = i.target.response
  52693. n.Cache.add(e, a),
  52694. 200 === this.status
  52695. ? (t && t(a), o.manager.itemEnd(e))
  52696. : 0 === this.status
  52697. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'),
  52698. t && t(a),
  52699. o.manager.itemEnd(e))
  52700. : (r && r(i), o.manager.itemError(e))
  52701. },
  52702. !1
  52703. ),
  52704. void 0 !== i &&
  52705. s.addEventListener(
  52706. 'progress',
  52707. function (e) {
  52708. i(e)
  52709. },
  52710. !1
  52711. ),
  52712. s.addEventListener(
  52713. 'error',
  52714. function (t) {
  52715. r && r(t), o.manager.itemError(e)
  52716. },
  52717. !1
  52718. ),
  52719. void 0 !== this.responseType && (s.responseType = this.responseType),
  52720. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  52721. s.send(null),
  52722. o.manager.itemStart(e),
  52723. s
  52724. )
  52725. },
  52726. setPath: function (e) {
  52727. this.path = e
  52728. },
  52729. setResponseType: function (e) {
  52730. this.responseType = e
  52731. },
  52732. setWithCredentials: function (e) {
  52733. this.withCredentials = e
  52734. }
  52735. }),
  52736. (n.FontLoader = function (e) {
  52737. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  52738. }),
  52739. (n.FontLoader.prototype = {
  52740. constructor: n.FontLoader,
  52741. load: function (e, t, i, r) {
  52742. var o = new n.XHRLoader(this.manager)
  52743. o.load(
  52744. e,
  52745. function (e) {
  52746. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  52747. },
  52748. i,
  52749. r
  52750. )
  52751. }
  52752. }),
  52753. (n.ImageLoader = function (e) {
  52754. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  52755. }),
  52756. (n.ImageLoader.prototype = {
  52757. constructor: n.ImageLoader,
  52758. load: function (e, t, i, r) {
  52759. void 0 !== this.path && (e = this.path + e)
  52760. var o = this,
  52761. a = n.Cache.get(e)
  52762. if (void 0 !== a)
  52763. return (
  52764. o.manager.itemStart(e),
  52765. t
  52766. ? setTimeout(function () {
  52767. t(a), o.manager.itemEnd(e)
  52768. }, 0)
  52769. : o.manager.itemEnd(e),
  52770. a
  52771. )
  52772. var s = document.createElement('img')
  52773. return (
  52774. s.addEventListener(
  52775. 'load',
  52776. function (i) {
  52777. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e)
  52778. },
  52779. !1
  52780. ),
  52781. void 0 !== i &&
  52782. s.addEventListener(
  52783. 'progress',
  52784. function (e) {
  52785. i(e)
  52786. },
  52787. !1
  52788. ),
  52789. s.addEventListener(
  52790. 'error',
  52791. function (t) {
  52792. r && r(t), o.manager.itemError(e)
  52793. },
  52794. !1
  52795. ),
  52796. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  52797. o.manager.itemStart(e),
  52798. (s.src = e),
  52799. s
  52800. )
  52801. },
  52802. setCrossOrigin: function (e) {
  52803. this.crossOrigin = e
  52804. },
  52805. setPath: function (e) {
  52806. this.path = e
  52807. }
  52808. }),
  52809. (n.JSONLoader = function (e) {
  52810. 'boolean' == typeof e &&
  52811. (console.warn(
  52812. 'THREE.JSONLoader: showStatus parameter has been removed from constructor.'
  52813. ),
  52814. (e = void 0)),
  52815. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  52816. (this.withCredentials = !1)
  52817. }),
  52818. (n.JSONLoader.prototype = {
  52819. constructor: n.JSONLoader,
  52820. get statusDomElement() {
  52821. return (
  52822. void 0 === this._statusDomElement &&
  52823. (this._statusDomElement = document.createElement('div')),
  52824. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  52825. this._statusDomElement
  52826. )
  52827. },
  52828. load: function (e, t, i, r) {
  52829. var o = this,
  52830. a =
  52831. this.texturePath && 'string' == typeof this.texturePath
  52832. ? this.texturePath
  52833. : n.Loader.prototype.extractUrlBase(e),
  52834. s = new n.XHRLoader(this.manager)
  52835. s.setWithCredentials(this.withCredentials),
  52836. s.load(
  52837. e,
  52838. function (i) {
  52839. var n = JSON.parse(i),
  52840. r = n.metadata
  52841. if (void 0 !== r) {
  52842. var s = r.type
  52843. if (void 0 !== s) {
  52844. if ('object' === s.toLowerCase())
  52845. return void console.error(
  52846. 'THREE.JSONLoader: ' +
  52847. e +
  52848. ' should be loaded with THREE.ObjectLoader instead.'
  52849. )
  52850. if ('scene' === s.toLowerCase())
  52851. return void console.error(
  52852. 'THREE.JSONLoader: ' +
  52853. e +
  52854. ' should be loaded with THREE.SceneLoader instead.'
  52855. )
  52856. }
  52857. }
  52858. var l = o.parse(n, a)
  52859. t(l.geometry, l.materials)
  52860. },
  52861. i,
  52862. r
  52863. )
  52864. },
  52865. setTexturePath: function (e) {
  52866. this.texturePath = e
  52867. },
  52868. parse: function (e, t) {
  52869. function i(t) {
  52870. function i(e, t) {
  52871. return e & (1 << t)
  52872. }
  52873. var r,
  52874. o,
  52875. a,
  52876. l,
  52877. c,
  52878. h,
  52879. u,
  52880. d,
  52881. p,
  52882. f,
  52883. g,
  52884. m,
  52885. v,
  52886. A,
  52887. y,
  52888. C,
  52889. I,
  52890. E,
  52891. b,
  52892. w,
  52893. _,
  52894. T,
  52895. x,
  52896. S,
  52897. M,
  52898. R,
  52899. P,
  52900. O = e.faces,
  52901. L = e.vertices,
  52902. D = e.normals,
  52903. N = e.colors,
  52904. B = 0
  52905. if (void 0 !== e.uvs) {
  52906. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++
  52907. for (r = 0; r < B; r++) s.faceVertexUvs[r] = []
  52908. }
  52909. for (l = 0, c = L.length; l < c; )
  52910. (E = new n.Vector3()),
  52911. (E.x = L[l++] * t),
  52912. (E.y = L[l++] * t),
  52913. (E.z = L[l++] * t),
  52914. s.vertices.push(E)
  52915. for (l = 0, c = O.length; l < c; )
  52916. if (
  52917. ((f = O[l++]),
  52918. (g = i(f, 0)),
  52919. (m = i(f, 1)),
  52920. (v = i(f, 3)),
  52921. (A = i(f, 4)),
  52922. (y = i(f, 5)),
  52923. (C = i(f, 6)),
  52924. (I = i(f, 7)),
  52925. g)
  52926. ) {
  52927. if (
  52928. ((w = new n.Face3()),
  52929. (w.a = O[l]),
  52930. (w.b = O[l + 1]),
  52931. (w.c = O[l + 3]),
  52932. (_ = new n.Face3()),
  52933. (_.a = O[l + 1]),
  52934. (_.b = O[l + 2]),
  52935. (_.c = O[l + 3]),
  52936. (l += 4),
  52937. m && ((p = O[l++]), (w.materialIndex = p), (_.materialIndex = p)),
  52938. (a = s.faces.length),
  52939. v)
  52940. )
  52941. for (r = 0; r < B; r++)
  52942. for (
  52943. S = e.uvs[r],
  52944. s.faceVertexUvs[r][a] = [],
  52945. s.faceVertexUvs[r][a + 1] = [],
  52946. o = 0;
  52947. o < 4;
  52948. o++
  52949. )
  52950. (d = O[l++]),
  52951. (R = S[2 * d]),
  52952. (P = S[2 * d + 1]),
  52953. (M = new n.Vector2(R, P)),
  52954. 2 !== o && s.faceVertexUvs[r][a].push(M),
  52955. 0 !== o && s.faceVertexUvs[r][a + 1].push(M)
  52956. if (
  52957. (A &&
  52958. ((u = 3 * O[l++]),
  52959. w.normal.set(D[u++], D[u++], D[u]),
  52960. _.normal.copy(w.normal)),
  52961. y)
  52962. )
  52963. for (r = 0; r < 4; r++)
  52964. (u = 3 * O[l++]),
  52965. (x = new n.Vector3(D[u++], D[u++], D[u])),
  52966. 2 !== r && w.vertexNormals.push(x),
  52967. 0 !== r && _.vertexNormals.push(x)
  52968. if ((C && ((h = O[l++]), (T = N[h]), w.color.setHex(T), _.color.setHex(T)), I))
  52969. for (r = 0; r < 4; r++)
  52970. (h = O[l++]),
  52971. (T = N[h]),
  52972. 2 !== r && w.vertexColors.push(new n.Color(T)),
  52973. 0 !== r && _.vertexColors.push(new n.Color(T))
  52974. s.faces.push(w), s.faces.push(_)
  52975. } else {
  52976. if (
  52977. ((b = new n.Face3()),
  52978. (b.a = O[l++]),
  52979. (b.b = O[l++]),
  52980. (b.c = O[l++]),
  52981. m && ((p = O[l++]), (b.materialIndex = p)),
  52982. (a = s.faces.length),
  52983. v)
  52984. )
  52985. for (r = 0; r < B; r++)
  52986. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0; o < 3; o++)
  52987. (d = O[l++]),
  52988. (R = S[2 * d]),
  52989. (P = S[2 * d + 1]),
  52990. (M = new n.Vector2(R, P)),
  52991. s.faceVertexUvs[r][a].push(M)
  52992. if ((A && ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])), y))
  52993. for (r = 0; r < 3; r++)
  52994. (u = 3 * O[l++]),
  52995. (x = new n.Vector3(D[u++], D[u++], D[u])),
  52996. b.vertexNormals.push(x)
  52997. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I))
  52998. for (r = 0; r < 3; r++) (h = O[l++]), b.vertexColors.push(new n.Color(N[h]))
  52999. s.faces.push(b)
  53000. }
  53001. }
  53002. function r() {
  53003. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2
  53004. if (e.skinWeights)
  53005. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  53006. var o = e.skinWeights[i],
  53007. a = t > 1 ? e.skinWeights[i + 1] : 0,
  53008. l = t > 2 ? e.skinWeights[i + 2] : 0,
  53009. c = t > 3 ? e.skinWeights[i + 3] : 0
  53010. s.skinWeights.push(new n.Vector4(o, a, l, c))
  53011. }
  53012. if (e.skinIndices)
  53013. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  53014. var h = e.skinIndices[i],
  53015. u = t > 1 ? e.skinIndices[i + 1] : 0,
  53016. d = t > 2 ? e.skinIndices[i + 2] : 0,
  53017. p = t > 3 ? e.skinIndices[i + 3] : 0
  53018. s.skinIndices.push(new n.Vector4(h, u, d, p))
  53019. }
  53020. ;(s.bones = e.bones),
  53021. s.bones &&
  53022. s.bones.length > 0 &&
  53023. (s.skinWeights.length !== s.skinIndices.length ||
  53024. s.skinIndices.length !== s.vertices.length) &&
  53025. console.warn(
  53026. 'When skinning, number of vertices (' +
  53027. s.vertices.length +
  53028. '), skinIndices (' +
  53029. s.skinIndices.length +
  53030. '), and skinWeights (' +
  53031. s.skinWeights.length +
  53032. ') should match.'
  53033. )
  53034. }
  53035. function o(t) {
  53036. if (void 0 !== e.morphTargets)
  53037. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  53038. ;(s.morphTargets[i] = {}),
  53039. (s.morphTargets[i].name = e.morphTargets[i].name),
  53040. (s.morphTargets[i].vertices = [])
  53041. for (
  53042. var o = s.morphTargets[i].vertices,
  53043. a = e.morphTargets[i].vertices,
  53044. l = 0,
  53045. c = a.length;
  53046. l < c;
  53047. l += 3
  53048. ) {
  53049. var h = new n.Vector3()
  53050. ;(h.x = a[l] * t), (h.y = a[l + 1] * t), (h.z = a[l + 2] * t), o.push(h)
  53051. }
  53052. }
  53053. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  53054. console.warn(
  53055. 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'
  53056. )
  53057. for (
  53058. var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length;
  53059. i < r;
  53060. i++
  53061. )
  53062. u[i].color.fromArray(d, 3 * i)
  53063. }
  53064. }
  53065. function a() {
  53066. var t = [],
  53067. i = []
  53068. void 0 !== e.animation && i.push(e.animation),
  53069. void 0 !== e.animations &&
  53070. (e.animations.length ? (i = i.concat(e.animations)) : i.push(e.animations))
  53071. for (var r = 0; r < i.length; r++) {
  53072. var o = n.AnimationClip.parseAnimation(i[r], s.bones)
  53073. o && t.push(o)
  53074. }
  53075. if (s.morphTargets) {
  53076. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10)
  53077. t = t.concat(a)
  53078. }
  53079. t.length > 0 && (s.animations = t)
  53080. }
  53081. var s = new n.Geometry(),
  53082. l = void 0 !== e.scale ? 1 / e.scale : 1
  53083. if (
  53084. (i(l),
  53085. r(),
  53086. o(l),
  53087. a(),
  53088. s.computeFaceNormals(),
  53089. s.computeBoundingSphere(),
  53090. void 0 === e.materials || 0 === e.materials.length)
  53091. )
  53092. return {
  53093. geometry: s
  53094. }
  53095. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin)
  53096. return {
  53097. geometry: s,
  53098. materials: c
  53099. }
  53100. }
  53101. }),
  53102. (n.LoadingManager = function (e, t, i) {
  53103. var n = this,
  53104. r = !1,
  53105. o = 0,
  53106. a = 0
  53107. ;(this.onStart = void 0),
  53108. (this.onLoad = e),
  53109. (this.onProgress = t),
  53110. (this.onError = i),
  53111. (this.itemStart = function (e) {
  53112. a++, r === !1 && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0)
  53113. }),
  53114. (this.itemEnd = function (e) {
  53115. o++,
  53116. void 0 !== n.onProgress && n.onProgress(e, o, a),
  53117. o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad())
  53118. }),
  53119. (this.itemError = function (e) {
  53120. void 0 !== n.onError && n.onError(e)
  53121. })
  53122. }),
  53123. (n.DefaultLoadingManager = new n.LoadingManager()),
  53124. (n.BufferGeometryLoader = function (e) {
  53125. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  53126. }),
  53127. (n.BufferGeometryLoader.prototype = {
  53128. constructor: n.BufferGeometryLoader,
  53129. load: function (e, t, i, r) {
  53130. var o = this,
  53131. a = new n.XHRLoader(o.manager)
  53132. a.load(
  53133. e,
  53134. function (e) {
  53135. t(o.parse(JSON.parse(e)))
  53136. },
  53137. i,
  53138. r
  53139. )
  53140. },
  53141. parse: function (e) {
  53142. var t = new n.BufferGeometry(),
  53143. i = e.data.index,
  53144. r = {
  53145. Int8Array: Int8Array,
  53146. Uint8Array: Uint8Array,
  53147. Uint8ClampedArray: Uint8ClampedArray,
  53148. Int16Array: Int16Array,
  53149. Uint16Array: Uint16Array,
  53150. Int32Array: Int32Array,
  53151. Uint32Array: Uint32Array,
  53152. Float32Array: Float32Array,
  53153. Float64Array: Float64Array
  53154. }
  53155. if (void 0 !== i) {
  53156. var o = new r[i.type](i.array)
  53157. t.setIndex(new n.BufferAttribute(o, 1))
  53158. }
  53159. var a = e.data.attributes
  53160. for (var s in a) {
  53161. var l = a[s],
  53162. o = new r[l.type](l.array)
  53163. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize))
  53164. }
  53165. var c = e.data.groups || e.data.drawcalls || e.data.offsets
  53166. if (void 0 !== c)
  53167. for (var h = 0, u = c.length; h !== u; ++h) {
  53168. var d = c[h]
  53169. t.addGroup(d.start, d.count, d.materialIndex)
  53170. }
  53171. var p = e.data.boundingSphere
  53172. if (void 0 !== p) {
  53173. var f = new n.Vector3()
  53174. void 0 !== p.center && f.fromArray(p.center),
  53175. (t.boundingSphere = new n.Sphere(f, p.radius))
  53176. }
  53177. return t
  53178. }
  53179. }),
  53180. (n.MaterialLoader = function (e) {
  53181. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.textures = {})
  53182. }),
  53183. (n.MaterialLoader.prototype = {
  53184. constructor: n.MaterialLoader,
  53185. load: function (e, t, i, r) {
  53186. var o = this,
  53187. a = new n.XHRLoader(o.manager)
  53188. a.load(
  53189. e,
  53190. function (e) {
  53191. t(o.parse(JSON.parse(e)))
  53192. },
  53193. i,
  53194. r
  53195. )
  53196. },
  53197. setTextures: function (e) {
  53198. this.textures = e
  53199. },
  53200. getTexture: function (e) {
  53201. var t = this.textures
  53202. return (
  53203. void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  53204. )
  53205. },
  53206. parse: function (e) {
  53207. var t = new n[e.type]()
  53208. if (
  53209. (void 0 !== e.uuid && (t.uuid = e.uuid),
  53210. void 0 !== e.name && (t.name = e.name),
  53211. void 0 !== e.color && t.color.setHex(e.color),
  53212. void 0 !== e.roughness && (t.roughness = e.roughness),
  53213. void 0 !== e.metalness && (t.metalness = e.metalness),
  53214. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  53215. void 0 !== e.specular && t.specular.setHex(e.specular),
  53216. void 0 !== e.shininess && (t.shininess = e.shininess),
  53217. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  53218. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  53219. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  53220. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  53221. void 0 !== e.shading && (t.shading = e.shading),
  53222. void 0 !== e.blending && (t.blending = e.blending),
  53223. void 0 !== e.side && (t.side = e.side),
  53224. void 0 !== e.opacity && (t.opacity = e.opacity),
  53225. void 0 !== e.transparent && (t.transparent = e.transparent),
  53226. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  53227. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  53228. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  53229. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  53230. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  53231. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  53232. void 0 !== e.size && (t.size = e.size),
  53233. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  53234. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  53235. void 0 !== e.alphaMap &&
  53236. ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  53237. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  53238. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  53239. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  53240. void 0 !== e.normalScale)
  53241. ) {
  53242. var i = e.normalScale
  53243. Array.isArray(i) === !1 && (i = [i, i]),
  53244. (t.normalScale = new n.Vector2().fromArray(i))
  53245. }
  53246. if (
  53247. (void 0 !== e.displacementMap &&
  53248. (t.displacementMap = this.getTexture(e.displacementMap)),
  53249. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  53250. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  53251. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  53252. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  53253. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  53254. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  53255. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  53256. void 0 !== e.envMap &&
  53257. ((t.envMap = this.getTexture(e.envMap)), (t.combine = n.MultiplyOperation)),
  53258. e.reflectivity && (t.reflectivity = e.reflectivity),
  53259. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  53260. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  53261. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  53262. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  53263. void 0 !== e.materials)
  53264. )
  53265. for (var r = 0, o = e.materials.length; r < o; r++)
  53266. t.materials.push(this.parse(e.materials[r]))
  53267. return t
  53268. }
  53269. }),
  53270. (n.ObjectLoader = function (e) {
  53271. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.texturePath = '')
  53272. }),
  53273. (n.ObjectLoader.prototype = {
  53274. constructor: n.ObjectLoader,
  53275. load: function (e, t, i, r) {
  53276. '' === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1))
  53277. var o = this,
  53278. a = new n.XHRLoader(o.manager)
  53279. a.load(
  53280. e,
  53281. function (e) {
  53282. o.parse(JSON.parse(e), t)
  53283. },
  53284. i,
  53285. r
  53286. )
  53287. },
  53288. setTexturePath: function (e) {
  53289. this.texturePath = e
  53290. },
  53291. setCrossOrigin: function (e) {
  53292. this.crossOrigin = e
  53293. },
  53294. parse: function (e, t) {
  53295. var i = this.parseGeometries(e.geometries),
  53296. n = this.parseImages(e.images, function () {
  53297. void 0 !== t && t(a)
  53298. }),
  53299. r = this.parseTextures(e.textures, n),
  53300. o = this.parseMaterials(e.materials, r),
  53301. a = this.parseObject(e.object, i, o)
  53302. return (
  53303. e.animations && (a.animations = this.parseAnimations(e.animations)),
  53304. (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)),
  53305. a
  53306. )
  53307. },
  53308. parseGeometries: function (e) {
  53309. var t = {}
  53310. if (void 0 !== e)
  53311. for (
  53312. var i = new n.JSONLoader(), r = new n.BufferGeometryLoader(), o = 0, a = e.length;
  53313. o < a;
  53314. o++
  53315. ) {
  53316. var s,
  53317. l = e[o]
  53318. switch (l.type) {
  53319. case 'PlaneGeometry':
  53320. case 'PlaneBufferGeometry':
  53321. s = new n[l.type](l.width, l.height, l.widthSegments, l.heightSegments)
  53322. break
  53323. case 'BoxGeometry':
  53324. case 'BoxBufferGeometry':
  53325. case 'CubeGeometry':
  53326. s = new n[l.type](
  53327. l.width,
  53328. l.height,
  53329. l.depth,
  53330. l.widthSegments,
  53331. l.heightSegments,
  53332. l.depthSegments
  53333. )
  53334. break
  53335. case 'CircleGeometry':
  53336. case 'CircleBufferGeometry':
  53337. s = new n[l.type](l.radius, l.segments, l.thetaStart, l.thetaLength)
  53338. break
  53339. case 'CylinderGeometry':
  53340. case 'CylinderBufferGeometry':
  53341. s = new n[l.type](
  53342. l.radiusTop,
  53343. l.radiusBottom,
  53344. l.height,
  53345. l.radialSegments,
  53346. l.heightSegments,
  53347. l.openEnded,
  53348. l.thetaStart,
  53349. l.thetaLength
  53350. )
  53351. break
  53352. case 'SphereGeometry':
  53353. case 'SphereBufferGeometry':
  53354. s = new n[l.type](
  53355. l.radius,
  53356. l.widthSegments,
  53357. l.heightSegments,
  53358. l.phiStart,
  53359. l.phiLength,
  53360. l.thetaStart,
  53361. l.thetaLength
  53362. )
  53363. break
  53364. case 'DodecahedronGeometry':
  53365. s = new n.DodecahedronGeometry(l.radius, l.detail)
  53366. break
  53367. case 'IcosahedronGeometry':
  53368. s = new n.IcosahedronGeometry(l.radius, l.detail)
  53369. break
  53370. case 'OctahedronGeometry':
  53371. s = new n.OctahedronGeometry(l.radius, l.detail)
  53372. break
  53373. case 'TetrahedronGeometry':
  53374. s = new n.TetrahedronGeometry(l.radius, l.detail)
  53375. break
  53376. case 'RingGeometry':
  53377. case 'RingBufferGeometry':
  53378. s = new n[l.type](
  53379. l.innerRadius,
  53380. l.outerRadius,
  53381. l.thetaSegments,
  53382. l.phiSegments,
  53383. l.thetaStart,
  53384. l.thetaLength
  53385. )
  53386. break
  53387. case 'TorusGeometry':
  53388. case 'TorusBufferGeometry':
  53389. s = new n[l.type](
  53390. l.radius,
  53391. l.tube,
  53392. l.radialSegments,
  53393. l.tubularSegments,
  53394. l.arc
  53395. )
  53396. break
  53397. case 'TorusKnotGeometry':
  53398. case 'TorusKnotBufferGeometry':
  53399. s = new n[l.type](
  53400. l.radius,
  53401. l.tube,
  53402. l.tubularSegments,
  53403. l.radialSegments,
  53404. l.p,
  53405. l.q
  53406. )
  53407. break
  53408. case 'LatheGeometry':
  53409. s = new n.LatheGeometry(l.points, l.segments, l.phiStart, l.phiLength)
  53410. break
  53411. case 'BufferGeometry':
  53412. s = r.parse(l)
  53413. break
  53414. case 'Geometry':
  53415. s = i.parse(l.data, this.texturePath).geometry
  53416. break
  53417. default:
  53418. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"')
  53419. continue
  53420. }
  53421. ;(s.uuid = l.uuid), void 0 !== l.name && (s.name = l.name), (t[l.uuid] = s)
  53422. }
  53423. return t
  53424. },
  53425. parseMaterials: function (e, t) {
  53426. var i = {}
  53427. if (void 0 !== e) {
  53428. var r = new n.MaterialLoader()
  53429. r.setTextures(t)
  53430. for (var o = 0, a = e.length; o < a; o++) {
  53431. var s = r.parse(e[o])
  53432. i[s.uuid] = s
  53433. }
  53434. }
  53435. return i
  53436. },
  53437. parseAnimations: function (e) {
  53438. for (var t = [], i = 0; i < e.length; i++) {
  53439. var r = n.AnimationClip.parse(e[i])
  53440. t.push(r)
  53441. }
  53442. return t
  53443. },
  53444. parseImages: function (e, t) {
  53445. function i(e) {
  53446. return (
  53447. r.manager.itemStart(e),
  53448. s.load(e, function () {
  53449. r.manager.itemEnd(e)
  53450. })
  53451. )
  53452. }
  53453. var r = this,
  53454. o = {}
  53455. if (void 0 !== e && e.length > 0) {
  53456. var a = new n.LoadingManager(t),
  53457. s = new n.ImageLoader(a)
  53458. s.setCrossOrigin(this.crossOrigin)
  53459. for (var l = 0, c = e.length; l < c; l++) {
  53460. var h = e[l],
  53461. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url
  53462. o[h.uuid] = i(u)
  53463. }
  53464. }
  53465. return o
  53466. },
  53467. parseTextures: function (e, t) {
  53468. function i(e) {
  53469. return 'number' == typeof e
  53470. ? e
  53471. : (console.warn(
  53472. 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.',
  53473. e
  53474. ),
  53475. n[e])
  53476. }
  53477. var r = {}
  53478. if (void 0 !== e)
  53479. for (var o = 0, a = e.length; o < a; o++) {
  53480. var s = e[o]
  53481. void 0 === s.image &&
  53482. console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  53483. void 0 === t[s.image] &&
  53484. console.warn('THREE.ObjectLoader: Undefined image', s.image)
  53485. var l = new n.Texture(t[s.image])
  53486. ;(l.needsUpdate = !0),
  53487. (l.uuid = s.uuid),
  53488. void 0 !== s.name && (l.name = s.name),
  53489. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  53490. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  53491. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  53492. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  53493. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  53494. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  53495. Array.isArray(s.wrap) && ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  53496. (r[s.uuid] = l)
  53497. }
  53498. return r
  53499. },
  53500. parseObject: (function () {
  53501. var e = new n.Matrix4()
  53502. return function (t, i, r) {
  53503. function o(e) {
  53504. return (
  53505. void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e),
  53506. i[e]
  53507. )
  53508. }
  53509. function a(e) {
  53510. if (void 0 !== e)
  53511. return (
  53512. void 0 === r[e] && console.warn('THREE.ObjectLoader: Undefined material', e),
  53513. r[e]
  53514. )
  53515. }
  53516. var s
  53517. switch (t.type) {
  53518. case 'Scene':
  53519. s = new n.Scene()
  53520. break
  53521. case 'PerspectiveCamera':
  53522. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far)
  53523. break
  53524. case 'OrthographicCamera':
  53525. s = new n.OrthographicCamera(t.left, t.right, t.top, t.bottom, t.near, t.far)
  53526. break
  53527. case 'AmbientLight':
  53528. s = new n.AmbientLight(t.color, t.intensity)
  53529. break
  53530. case 'DirectionalLight':
  53531. s = new n.DirectionalLight(t.color, t.intensity)
  53532. break
  53533. case 'PointLight':
  53534. s = new n.PointLight(t.color, t.intensity, t.distance, t.decay)
  53535. break
  53536. case 'SpotLight':
  53537. s = new n.SpotLight(
  53538. t.color,
  53539. t.intensity,
  53540. t.distance,
  53541. t.angle,
  53542. t.penumbra,
  53543. t.decay
  53544. )
  53545. break
  53546. case 'HemisphereLight':
  53547. s = new n.HemisphereLight(t.color, t.groundColor, t.intensity)
  53548. break
  53549. case 'Mesh':
  53550. var l = o(t.geometry),
  53551. c = a(t.material)
  53552. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l, c) : new n.Mesh(l, c)
  53553. break
  53554. case 'LOD':
  53555. s = new n.LOD()
  53556. break
  53557. case 'Line':
  53558. s = new n.Line(o(t.geometry), a(t.material), t.mode)
  53559. break
  53560. case 'PointCloud':
  53561. case 'Points':
  53562. s = new n.Points(o(t.geometry), a(t.material))
  53563. break
  53564. case 'Sprite':
  53565. s = new n.Sprite(a(t.material))
  53566. break
  53567. case 'Group':
  53568. s = new n.Group()
  53569. break
  53570. default:
  53571. s = new n.Object3D()
  53572. }
  53573. if (
  53574. ((s.uuid = t.uuid),
  53575. void 0 !== t.name && (s.name = t.name),
  53576. void 0 !== t.matrix
  53577. ? (e.fromArray(t.matrix), e.decompose(s.position, s.quaternion, s.scale))
  53578. : (void 0 !== t.position && s.position.fromArray(t.position),
  53579. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  53580. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  53581. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  53582. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  53583. void 0 !== t.visible && (s.visible = t.visible),
  53584. void 0 !== t.userData && (s.userData = t.userData),
  53585. void 0 !== t.children)
  53586. )
  53587. for (var h in t.children) s.add(this.parseObject(t.children[h], i, r))
  53588. if ('LOD' === t.type)
  53589. for (var u = t.levels, d = 0; d < u.length; d++) {
  53590. var p = u[d],
  53591. h = s.getObjectByProperty('uuid', p.object)
  53592. void 0 !== h && s.addLevel(h, p.distance)
  53593. }
  53594. return s
  53595. }
  53596. })()
  53597. }),
  53598. (n.TextureLoader = function (e) {
  53599. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  53600. }),
  53601. (n.TextureLoader.prototype = {
  53602. constructor: n.TextureLoader,
  53603. load: function (e, t, i, r) {
  53604. var o = new n.Texture(),
  53605. a = new n.ImageLoader(this.manager)
  53606. return (
  53607. a.setCrossOrigin(this.crossOrigin),
  53608. a.setPath(this.path),
  53609. a.load(
  53610. e,
  53611. function (e) {
  53612. ;(o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o)
  53613. },
  53614. i,
  53615. r
  53616. ),
  53617. o
  53618. )
  53619. },
  53620. setCrossOrigin: function (e) {
  53621. this.crossOrigin = e
  53622. },
  53623. setPath: function (e) {
  53624. this.path = e
  53625. }
  53626. }),
  53627. (n.CubeTextureLoader = function (e) {
  53628. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  53629. }),
  53630. (n.CubeTextureLoader.prototype = {
  53631. constructor: n.CubeTextureLoader,
  53632. load: function (e, t, i, r) {
  53633. function o(i) {
  53634. s.load(
  53635. e[i],
  53636. function (e) {
  53637. ;(a.images[i] = e), l++, 6 === l && ((a.needsUpdate = !0), t && t(a))
  53638. },
  53639. void 0,
  53640. r
  53641. )
  53642. }
  53643. var a = new n.CubeTexture(),
  53644. s = new n.ImageLoader(this.manager)
  53645. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path)
  53646. for (var l = 0, c = 0; c < e.length; ++c) o(c)
  53647. return a
  53648. },
  53649. setCrossOrigin: function (e) {
  53650. this.crossOrigin = e
  53651. },
  53652. setPath: function (e) {
  53653. this.path = e
  53654. }
  53655. }),
  53656. (n.DataTextureLoader = n.BinaryTextureLoader =
  53657. function (e) {
  53658. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  53659. }),
  53660. (n.BinaryTextureLoader.prototype = {
  53661. constructor: n.BinaryTextureLoader,
  53662. load: function (e, t, i, r) {
  53663. var o = this,
  53664. a = new n.DataTexture(),
  53665. s = new n.XHRLoader(this.manager)
  53666. return (
  53667. s.setResponseType('arraybuffer'),
  53668. s.load(
  53669. e,
  53670. function (e) {
  53671. var i = o._parser(e)
  53672. i &&
  53673. (void 0 !== i.image
  53674. ? (a.image = i.image)
  53675. : void 0 !== i.data &&
  53676. ((a.image.width = i.width),
  53677. (a.image.height = i.height),
  53678. (a.image.data = i.data)),
  53679. (a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  53680. (a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  53681. (a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  53682. (a.minFilter =
  53683. void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter),
  53684. (a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1),
  53685. void 0 !== i.format && (a.format = i.format),
  53686. void 0 !== i.type && (a.type = i.type),
  53687. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  53688. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  53689. (a.needsUpdate = !0),
  53690. t && t(a, i))
  53691. },
  53692. i,
  53693. r
  53694. ),
  53695. a
  53696. )
  53697. }
  53698. }),
  53699. (n.CompressedTextureLoader = function (e) {
  53700. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  53701. })
  53702. n.CompressedTextureLoader.prototype = {
  53703. constructor: n.CompressedTextureLoader,
  53704. load: function (e, t, i, r) {
  53705. function o(o) {
  53706. c.load(
  53707. e[o],
  53708. function (e) {
  53709. var i = a._parser(e, !0)
  53710. ;(s[o] = {
  53711. width: i.width,
  53712. height: i.height,
  53713. format: i.format,
  53714. mipmaps: i.mipmaps
  53715. }),
  53716. (h += 1),
  53717. 6 === h &&
  53718. (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53719. (l.format = i.format),
  53720. (l.needsUpdate = !0),
  53721. t && t(l))
  53722. },
  53723. i,
  53724. r
  53725. )
  53726. }
  53727. var a = this,
  53728. s = [],
  53729. l = new n.CompressedTexture()
  53730. l.image = s
  53731. var c = new n.XHRLoader(this.manager)
  53732. if ((c.setPath(this.path), c.setResponseType('arraybuffer'), Array.isArray(e)))
  53733. for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u)
  53734. else
  53735. c.load(
  53736. e,
  53737. function (e) {
  53738. var i = a._parser(e, !0)
  53739. if (i.isCubemap)
  53740. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  53741. s[o] = {
  53742. mipmaps: []
  53743. }
  53744. for (var c = 0; c < i.mipmapCount; c++)
  53745. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  53746. (s[o].format = i.format),
  53747. (s[o].width = i.width),
  53748. (s[o].height = i.height)
  53749. }
  53750. else
  53751. (l.image.width = i.width), (l.image.height = i.height), (l.mipmaps = i.mipmaps)
  53752. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53753. (l.format = i.format),
  53754. (l.needsUpdate = !0),
  53755. t && t(l)
  53756. },
  53757. i,
  53758. r
  53759. )
  53760. return l
  53761. },
  53762. setPath: function (e) {
  53763. this.path = e
  53764. }
  53765. }
  53766. ;(n.Material = function () {
  53767. Object.defineProperty(this, 'id', {
  53768. value: n.MaterialIdCount++
  53769. }),
  53770. (this.uuid = n.Math.generateUUID()),
  53771. (this.name = ''),
  53772. (this.type = 'Material'),
  53773. (this.side = n.FrontSide),
  53774. (this.opacity = 1),
  53775. (this.transparent = !1),
  53776. (this.blending = n.NormalBlending),
  53777. (this.blendSrc = n.SrcAlphaFactor),
  53778. (this.blendDst = n.OneMinusSrcAlphaFactor),
  53779. (this.blendEquation = n.AddEquation),
  53780. (this.blendSrcAlpha = null),
  53781. (this.blendDstAlpha = null),
  53782. (this.blendEquationAlpha = null),
  53783. (this.depthFunc = n.LessEqualDepth),
  53784. (this.depthTest = !0),
  53785. (this.depthWrite = !0),
  53786. (this.colorWrite = !0),
  53787. (this.precision = null),
  53788. (this.polygonOffset = !1),
  53789. (this.polygonOffsetFactor = 0),
  53790. (this.polygonOffsetUnits = 0),
  53791. (this.alphaTest = 0),
  53792. (this.premultipliedAlpha = !1),
  53793. (this.overdraw = 0),
  53794. (this.visible = !0),
  53795. (this._needsUpdate = !0)
  53796. }),
  53797. (n.Material.prototype = {
  53798. constructor: n.Material,
  53799. get needsUpdate() {
  53800. return this._needsUpdate
  53801. },
  53802. set needsUpdate(e) {
  53803. e === !0 && this.update(), (this._needsUpdate = e)
  53804. },
  53805. setValues: function (e) {
  53806. if (void 0 !== e)
  53807. for (var t in e) {
  53808. var i = e[t]
  53809. if (void 0 !== i) {
  53810. var r = this[t]
  53811. void 0 !== r
  53812. ? r instanceof n.Color
  53813. ? r.set(i)
  53814. : r instanceof n.Vector3 && i instanceof n.Vector3
  53815. ? r.copy(i)
  53816. : 'overdraw' === t
  53817. ? (this[t] = Number(i))
  53818. : (this[t] = i)
  53819. : console.warn(
  53820. 'THREE.' + this.type + ": '" + t + "' is not a property of this material."
  53821. )
  53822. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  53823. }
  53824. },
  53825. toJSON: function (e) {
  53826. function t(e) {
  53827. var t = []
  53828. for (var i in e) {
  53829. var n = e[i]
  53830. delete n.metadata, t.push(n)
  53831. }
  53832. return t
  53833. }
  53834. var i = void 0 === e
  53835. i &&
  53836. (e = {
  53837. textures: {},
  53838. images: {}
  53839. })
  53840. var r = {
  53841. metadata: {
  53842. version: 4.4,
  53843. type: 'Material',
  53844. generator: 'Material.toJSON'
  53845. }
  53846. }
  53847. if (
  53848. ((r.uuid = this.uuid),
  53849. (r.type = this.type),
  53850. '' !== this.name && (r.name = this.name),
  53851. this.color instanceof n.Color && (r.color = this.color.getHex()),
  53852. 0.5 !== this.roughness && (r.roughness = this.roughness),
  53853. 0.5 !== this.metalness && (r.metalness = this.metalness),
  53854. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  53855. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  53856. void 0 !== this.shininess && (r.shininess = this.shininess),
  53857. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  53858. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  53859. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  53860. this.bumpMap instanceof n.Texture &&
  53861. ((r.bumpMap = this.bumpMap.toJSON(e).uuid), (r.bumpScale = this.bumpScale)),
  53862. this.normalMap instanceof n.Texture &&
  53863. ((r.normalMap = this.normalMap.toJSON(e).uuid),
  53864. (r.normalScale = this.normalScale.toArray())),
  53865. this.displacementMap instanceof n.Texture &&
  53866. ((r.displacementMap = this.displacementMap.toJSON(e).uuid),
  53867. (r.displacementScale = this.displacementScale),
  53868. (r.displacementBias = this.displacementBias)),
  53869. this.roughnessMap instanceof n.Texture &&
  53870. (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  53871. this.metalnessMap instanceof n.Texture &&
  53872. (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  53873. this.emissiveMap instanceof n.Texture &&
  53874. (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  53875. this.specularMap instanceof n.Texture &&
  53876. (r.specularMap = this.specularMap.toJSON(e).uuid),
  53877. this.envMap instanceof n.Texture &&
  53878. ((r.envMap = this.envMap.toJSON(e).uuid), (r.reflectivity = this.reflectivity)),
  53879. void 0 !== this.size && (r.size = this.size),
  53880. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  53881. void 0 !== this.vertexColors &&
  53882. this.vertexColors !== n.NoColors &&
  53883. (r.vertexColors = this.vertexColors),
  53884. void 0 !== this.shading &&
  53885. this.shading !== n.SmoothShading &&
  53886. (r.shading = this.shading),
  53887. void 0 !== this.blending &&
  53888. this.blending !== n.NormalBlending &&
  53889. (r.blending = this.blending),
  53890. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  53891. this.opacity < 1 && (r.opacity = this.opacity),
  53892. this.transparent === !0 && (r.transparent = this.transparent),
  53893. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  53894. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  53895. this.wireframe === !0 && (r.wireframe = this.wireframe),
  53896. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  53897. i)
  53898. ) {
  53899. var o = t(e.textures),
  53900. a = t(e.images)
  53901. o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a)
  53902. }
  53903. return r
  53904. },
  53905. clone: function () {
  53906. return new this.constructor().copy(this)
  53907. },
  53908. copy: function (e) {
  53909. return (
  53910. (this.name = e.name),
  53911. (this.side = e.side),
  53912. (this.opacity = e.opacity),
  53913. (this.transparent = e.transparent),
  53914. (this.blending = e.blending),
  53915. (this.blendSrc = e.blendSrc),
  53916. (this.blendDst = e.blendDst),
  53917. (this.blendEquation = e.blendEquation),
  53918. (this.blendSrcAlpha = e.blendSrcAlpha),
  53919. (this.blendDstAlpha = e.blendDstAlpha),
  53920. (this.blendEquationAlpha = e.blendEquationAlpha),
  53921. (this.depthFunc = e.depthFunc),
  53922. (this.depthTest = e.depthTest),
  53923. (this.depthWrite = e.depthWrite),
  53924. (this.colorWrite = e.colorWrite),
  53925. (this.precision = e.precision),
  53926. (this.polygonOffset = e.polygonOffset),
  53927. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  53928. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  53929. (this.alphaTest = e.alphaTest),
  53930. (this.premultipliedAlpha = e.premultipliedAlpha),
  53931. (this.overdraw = e.overdraw),
  53932. (this.visible = e.visible),
  53933. this
  53934. )
  53935. },
  53936. update: function () {
  53937. this.dispatchEvent({
  53938. type: 'update'
  53939. })
  53940. },
  53941. dispose: function () {
  53942. this.dispatchEvent({
  53943. type: 'dispose'
  53944. })
  53945. }
  53946. }),
  53947. n.EventDispatcher.prototype.apply(n.Material.prototype),
  53948. (n.MaterialIdCount = 0),
  53949. (n.LineBasicMaterial = function (e) {
  53950. n.Material.call(this),
  53951. (this.type = 'LineBasicMaterial'),
  53952. (this.color = new n.Color(16777215)),
  53953. (this.linewidth = 1),
  53954. (this.linecap = 'round'),
  53955. (this.linejoin = 'round'),
  53956. (this.blending = n.NormalBlending),
  53957. (this.vertexColors = n.NoColors),
  53958. (this.fog = !0),
  53959. this.setValues(e)
  53960. }),
  53961. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  53962. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  53963. (n.LineBasicMaterial.prototype.copy = function (e) {
  53964. return (
  53965. n.Material.prototype.copy.call(this, e),
  53966. this.color.copy(e.color),
  53967. (this.linewidth = e.linewidth),
  53968. (this.linecap = e.linecap),
  53969. (this.linejoin = e.linejoin),
  53970. (this.vertexColors = e.vertexColors),
  53971. (this.fog = e.fog),
  53972. this
  53973. )
  53974. }),
  53975. (n.LineDashedMaterial = function (e) {
  53976. n.Material.call(this),
  53977. (this.type = 'LineDashedMaterial'),
  53978. (this.color = new n.Color(16777215)),
  53979. (this.linewidth = 1),
  53980. (this.scale = 1),
  53981. (this.dashSize = 3),
  53982. (this.gapSize = 1),
  53983. (this.blending = n.NormalBlending),
  53984. (this.vertexColors = n.NoColors),
  53985. (this.fog = !0),
  53986. this.setValues(e)
  53987. }),
  53988. (n.LineDashedMaterial.prototype = Object.create(n.Material.prototype)),
  53989. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  53990. (n.LineDashedMaterial.prototype.copy = function (e) {
  53991. return (
  53992. n.Material.prototype.copy.call(this, e),
  53993. this.color.copy(e.color),
  53994. (this.linewidth = e.linewidth),
  53995. (this.scale = e.scale),
  53996. (this.dashSize = e.dashSize),
  53997. (this.gapSize = e.gapSize),
  53998. (this.vertexColors = e.vertexColors),
  53999. (this.fog = e.fog),
  54000. this
  54001. )
  54002. }),
  54003. (n.MeshBasicMaterial = function (e) {
  54004. n.Material.call(this),
  54005. (this.type = 'MeshBasicMaterial'),
  54006. (this.color = new n.Color(16777215)),
  54007. (this.map = null),
  54008. (this.aoMap = null),
  54009. (this.aoMapIntensity = 1),
  54010. (this.specularMap = null),
  54011. (this.alphaMap = null),
  54012. (this.envMap = null),
  54013. (this.combine = n.MultiplyOperation),
  54014. (this.reflectivity = 1),
  54015. (this.refractionRatio = 0.98),
  54016. (this.fog = !0),
  54017. (this.shading = n.SmoothShading),
  54018. (this.blending = n.NormalBlending),
  54019. (this.wireframe = !1),
  54020. (this.wireframeLinewidth = 1),
  54021. (this.wireframeLinecap = 'round'),
  54022. (this.wireframeLinejoin = 'round'),
  54023. (this.vertexColors = n.NoColors),
  54024. (this.skinning = !1),
  54025. (this.morphTargets = !1),
  54026. this.setValues(e)
  54027. }),
  54028. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  54029. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  54030. (n.MeshBasicMaterial.prototype.copy = function (e) {
  54031. return (
  54032. n.Material.prototype.copy.call(this, e),
  54033. this.color.copy(e.color),
  54034. (this.map = e.map),
  54035. (this.aoMap = e.aoMap),
  54036. (this.aoMapIntensity = e.aoMapIntensity),
  54037. (this.specularMap = e.specularMap),
  54038. (this.alphaMap = e.alphaMap),
  54039. (this.envMap = e.envMap),
  54040. (this.combine = e.combine),
  54041. (this.reflectivity = e.reflectivity),
  54042. (this.refractionRatio = e.refractionRatio),
  54043. (this.fog = e.fog),
  54044. (this.shading = e.shading),
  54045. (this.wireframe = e.wireframe),
  54046. (this.wireframeLinewidth = e.wireframeLinewidth),
  54047. (this.wireframeLinecap = e.wireframeLinecap),
  54048. (this.wireframeLinejoin = e.wireframeLinejoin),
  54049. (this.vertexColors = e.vertexColors),
  54050. (this.skinning = e.skinning),
  54051. (this.morphTargets = e.morphTargets),
  54052. this
  54053. )
  54054. }),
  54055. (n.MeshLambertMaterial = function (e) {
  54056. n.Material.call(this),
  54057. (this.type = 'MeshLambertMaterial'),
  54058. (this.color = new n.Color(16777215)),
  54059. (this.map = null),
  54060. (this.lightMap = null),
  54061. (this.lightMapIntensity = 1),
  54062. (this.aoMap = null),
  54063. (this.aoMapIntensity = 1),
  54064. (this.emissive = new n.Color(0)),
  54065. (this.emissiveIntensity = 1),
  54066. (this.emissiveMap = null),
  54067. (this.specularMap = null),
  54068. (this.alphaMap = null),
  54069. (this.envMap = null),
  54070. (this.combine = n.MultiplyOperation),
  54071. (this.reflectivity = 1),
  54072. (this.refractionRatio = 0.98),
  54073. (this.fog = !0),
  54074. (this.blending = n.NormalBlending),
  54075. (this.wireframe = !1),
  54076. (this.wireframeLinewidth = 1),
  54077. (this.wireframeLinecap = 'round'),
  54078. (this.wireframeLinejoin = 'round'),
  54079. (this.vertexColors = n.NoColors),
  54080. (this.skinning = !1),
  54081. (this.morphTargets = !1),
  54082. (this.morphNormals = !1),
  54083. this.setValues(e)
  54084. }),
  54085. (n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype)),
  54086. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  54087. (n.MeshLambertMaterial.prototype.copy = function (e) {
  54088. return (
  54089. n.Material.prototype.copy.call(this, e),
  54090. this.color.copy(e.color),
  54091. (this.map = e.map),
  54092. (this.lightMap = e.lightMap),
  54093. (this.lightMapIntensity = e.lightMapIntensity),
  54094. (this.aoMap = e.aoMap),
  54095. (this.aoMapIntensity = e.aoMapIntensity),
  54096. this.emissive.copy(e.emissive),
  54097. (this.emissiveMap = e.emissiveMap),
  54098. (this.emissiveIntensity = e.emissiveIntensity),
  54099. (this.specularMap = e.specularMap),
  54100. (this.alphaMap = e.alphaMap),
  54101. (this.envMap = e.envMap),
  54102. (this.combine = e.combine),
  54103. (this.reflectivity = e.reflectivity),
  54104. (this.refractionRatio = e.refractionRatio),
  54105. (this.fog = e.fog),
  54106. (this.wireframe = e.wireframe),
  54107. (this.wireframeLinewidth = e.wireframeLinewidth),
  54108. (this.wireframeLinecap = e.wireframeLinecap),
  54109. (this.wireframeLinejoin = e.wireframeLinejoin),
  54110. (this.vertexColors = e.vertexColors),
  54111. (this.skinning = e.skinning),
  54112. (this.morphTargets = e.morphTargets),
  54113. (this.morphNormals = e.morphNormals),
  54114. this
  54115. )
  54116. }),
  54117. (n.MeshPhongMaterial = function (e) {
  54118. n.Material.call(this),
  54119. (this.type = 'MeshPhongMaterial'),
  54120. (this.color = new n.Color(16777215)),
  54121. (this.specular = new n.Color(1118481)),
  54122. (this.shininess = 30),
  54123. (this.map = null),
  54124. (this.lightMap = null),
  54125. (this.lightMapIntensity = 1),
  54126. (this.aoMap = null),
  54127. (this.aoMapIntensity = 1),
  54128. (this.emissive = new n.Color(0)),
  54129. (this.emissiveIntensity = 1),
  54130. (this.emissiveMap = null),
  54131. (this.bumpMap = null),
  54132. (this.bumpScale = 1),
  54133. (this.normalMap = null),
  54134. (this.normalScale = new n.Vector2(1, 1)),
  54135. (this.displacementMap = null),
  54136. (this.displacementScale = 1),
  54137. (this.displacementBias = 0),
  54138. (this.specularMap = null),
  54139. (this.alphaMap = null),
  54140. (this.envMap = null),
  54141. (this.combine = n.MultiplyOperation),
  54142. (this.reflectivity = 1),
  54143. (this.refractionRatio = 0.98),
  54144. (this.fog = !0),
  54145. (this.shading = n.SmoothShading),
  54146. (this.blending = n.NormalBlending),
  54147. (this.wireframe = !1),
  54148. (this.wireframeLinewidth = 1),
  54149. (this.wireframeLinecap = 'round'),
  54150. (this.wireframeLinejoin = 'round'),
  54151. (this.vertexColors = n.NoColors),
  54152. (this.skinning = !1),
  54153. (this.morphTargets = !1),
  54154. (this.morphNormals = !1),
  54155. this.setValues(e)
  54156. }),
  54157. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  54158. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  54159. (n.MeshPhongMaterial.prototype.copy = function (e) {
  54160. return (
  54161. n.Material.prototype.copy.call(this, e),
  54162. this.color.copy(e.color),
  54163. this.specular.copy(e.specular),
  54164. (this.shininess = e.shininess),
  54165. (this.map = e.map),
  54166. (this.lightMap = e.lightMap),
  54167. (this.lightMapIntensity = e.lightMapIntensity),
  54168. (this.aoMap = e.aoMap),
  54169. (this.aoMapIntensity = e.aoMapIntensity),
  54170. this.emissive.copy(e.emissive),
  54171. (this.emissiveMap = e.emissiveMap),
  54172. (this.emissiveIntensity = e.emissiveIntensity),
  54173. (this.bumpMap = e.bumpMap),
  54174. (this.bumpScale = e.bumpScale),
  54175. (this.normalMap = e.normalMap),
  54176. this.normalScale.copy(e.normalScale),
  54177. (this.displacementMap = e.displacementMap),
  54178. (this.displacementScale = e.displacementScale),
  54179. (this.displacementBias = e.displacementBias),
  54180. (this.specularMap = e.specularMap),
  54181. (this.alphaMap = e.alphaMap),
  54182. (this.envMap = e.envMap),
  54183. (this.combine = e.combine),
  54184. (this.reflectivity = e.reflectivity),
  54185. (this.refractionRatio = e.refractionRatio),
  54186. (this.fog = e.fog),
  54187. (this.shading = e.shading),
  54188. (this.wireframe = e.wireframe),
  54189. (this.wireframeLinewidth = e.wireframeLinewidth),
  54190. (this.wireframeLinecap = e.wireframeLinecap),
  54191. (this.wireframeLinejoin = e.wireframeLinejoin),
  54192. (this.vertexColors = e.vertexColors),
  54193. (this.skinning = e.skinning),
  54194. (this.morphTargets = e.morphTargets),
  54195. (this.morphNormals = e.morphNormals),
  54196. this
  54197. )
  54198. }),
  54199. (n.MeshStandardMaterial = function (e) {
  54200. n.Material.call(this),
  54201. (this.type = 'MeshStandardMaterial'),
  54202. (this.color = new n.Color(16777215)),
  54203. (this.roughness = 0.5),
  54204. (this.metalness = 0.5),
  54205. (this.map = null),
  54206. (this.lightMap = null),
  54207. (this.lightMapIntensity = 1),
  54208. (this.aoMap = null),
  54209. (this.aoMapIntensity = 1),
  54210. (this.emissive = new n.Color(0)),
  54211. (this.emissiveIntensity = 1),
  54212. (this.emissiveMap = null),
  54213. (this.bumpMap = null),
  54214. (this.bumpScale = 1),
  54215. (this.normalMap = null),
  54216. (this.normalScale = new n.Vector2(1, 1)),
  54217. (this.displacementMap = null),
  54218. (this.displacementScale = 1),
  54219. (this.displacementBias = 0),
  54220. (this.roughnessMap = null),
  54221. (this.metalnessMap = null),
  54222. (this.alphaMap = null),
  54223. (this.envMap = null),
  54224. (this.envMapIntensity = 1),
  54225. (this.refractionRatio = 0.98),
  54226. (this.fog = !0),
  54227. (this.shading = n.SmoothShading),
  54228. (this.blending = n.NormalBlending),
  54229. (this.wireframe = !1),
  54230. (this.wireframeLinewidth = 1),
  54231. (this.wireframeLinecap = 'round'),
  54232. (this.wireframeLinejoin = 'round'),
  54233. (this.vertexColors = n.NoColors),
  54234. (this.skinning = !1),
  54235. (this.morphTargets = !1),
  54236. (this.morphNormals = !1),
  54237. this.setValues(e)
  54238. }),
  54239. (n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype)),
  54240. (n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial),
  54241. (n.MeshStandardMaterial.prototype.copy = function (e) {
  54242. return (
  54243. n.Material.prototype.copy.call(this, e),
  54244. this.color.copy(e.color),
  54245. (this.roughness = e.roughness),
  54246. (this.metalness = e.metalness),
  54247. (this.map = e.map),
  54248. (this.lightMap = e.lightMap),
  54249. (this.lightMapIntensity = e.lightMapIntensity),
  54250. (this.aoMap = e.aoMap),
  54251. (this.aoMapIntensity = e.aoMapIntensity),
  54252. this.emissive.copy(e.emissive),
  54253. (this.emissiveMap = e.emissiveMap),
  54254. (this.emissiveIntensity = e.emissiveIntensity),
  54255. (this.bumpMap = e.bumpMap),
  54256. (this.bumpScale = e.bumpScale),
  54257. (this.normalMap = e.normalMap),
  54258. this.normalScale.copy(e.normalScale),
  54259. (this.displacementMap = e.displacementMap),
  54260. (this.displacementScale = e.displacementScale),
  54261. (this.displacementBias = e.displacementBias),
  54262. (this.roughnessMap = e.roughnessMap),
  54263. (this.metalnessMap = e.metalnessMap),
  54264. (this.alphaMap = e.alphaMap),
  54265. (this.envMap = e.envMap),
  54266. (this.envMapIntensity = e.envMapIntensity),
  54267. (this.refractionRatio = e.refractionRatio),
  54268. (this.fog = e.fog),
  54269. (this.shading = e.shading),
  54270. (this.wireframe = e.wireframe),
  54271. (this.wireframeLinewidth = e.wireframeLinewidth),
  54272. (this.wireframeLinecap = e.wireframeLinecap),
  54273. (this.wireframeLinejoin = e.wireframeLinejoin),
  54274. (this.vertexColors = e.vertexColors),
  54275. (this.skinning = e.skinning),
  54276. (this.morphTargets = e.morphTargets),
  54277. (this.morphNormals = e.morphNormals),
  54278. this
  54279. )
  54280. }),
  54281. (n.MeshDepthMaterial = function (e) {
  54282. n.Material.call(this),
  54283. (this.type = 'MeshDepthMaterial'),
  54284. (this.morphTargets = !1),
  54285. (this.wireframe = !1),
  54286. (this.wireframeLinewidth = 1),
  54287. this.setValues(e)
  54288. }),
  54289. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  54290. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  54291. (n.MeshDepthMaterial.prototype.copy = function (e) {
  54292. return (
  54293. n.Material.prototype.copy.call(this, e),
  54294. (this.wireframe = e.wireframe),
  54295. (this.wireframeLinewidth = e.wireframeLinewidth),
  54296. this
  54297. )
  54298. }),
  54299. (n.MeshNormalMaterial = function (e) {
  54300. n.Material.call(this, e),
  54301. (this.type = 'MeshNormalMaterial'),
  54302. (this.wireframe = !1),
  54303. (this.wireframeLinewidth = 1),
  54304. (this.morphTargets = !1),
  54305. this.setValues(e)
  54306. }),
  54307. (n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype)),
  54308. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  54309. (n.MeshNormalMaterial.prototype.copy = function (e) {
  54310. return (
  54311. n.Material.prototype.copy.call(this, e),
  54312. (this.wireframe = e.wireframe),
  54313. (this.wireframeLinewidth = e.wireframeLinewidth),
  54314. this
  54315. )
  54316. }),
  54317. (n.MultiMaterial = function (e) {
  54318. ;(this.uuid = n.Math.generateUUID()),
  54319. (this.type = 'MultiMaterial'),
  54320. (this.materials = e instanceof Array ? e : []),
  54321. (this.visible = !0)
  54322. }),
  54323. (n.MultiMaterial.prototype = {
  54324. constructor: n.MultiMaterial,
  54325. toJSON: function (e) {
  54326. for (
  54327. var t = {
  54328. metadata: {
  54329. version: 4.2,
  54330. type: 'material',
  54331. generator: 'MaterialExporter'
  54332. },
  54333. uuid: this.uuid,
  54334. type: this.type,
  54335. materials: []
  54336. },
  54337. i = this.materials,
  54338. n = 0,
  54339. r = i.length;
  54340. n < r;
  54341. n++
  54342. ) {
  54343. var o = i[n].toJSON(e)
  54344. delete o.metadata, t.materials.push(o)
  54345. }
  54346. return (t.visible = this.visible), t
  54347. },
  54348. clone: function () {
  54349. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++)
  54350. e.materials.push(this.materials[t].clone())
  54351. return (e.visible = this.visible), e
  54352. }
  54353. }),
  54354. (n.PointsMaterial = function (e) {
  54355. n.Material.call(this),
  54356. (this.type = 'PointsMaterial'),
  54357. (this.color = new n.Color(16777215)),
  54358. (this.map = null),
  54359. (this.size = 1),
  54360. (this.sizeAttenuation = !0),
  54361. (this.blending = n.NormalBlending),
  54362. (this.vertexColors = n.NoColors),
  54363. (this.fog = !0),
  54364. this.setValues(e)
  54365. }),
  54366. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  54367. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  54368. (n.PointsMaterial.prototype.copy = function (e) {
  54369. return (
  54370. n.Material.prototype.copy.call(this, e),
  54371. this.color.copy(e.color),
  54372. (this.map = e.map),
  54373. (this.size = e.size),
  54374. (this.sizeAttenuation = e.sizeAttenuation),
  54375. (this.vertexColors = e.vertexColors),
  54376. (this.fog = e.fog),
  54377. this
  54378. )
  54379. }),
  54380. (n.ShaderMaterial = function (e) {
  54381. n.Material.call(this),
  54382. (this.type = 'ShaderMaterial'),
  54383. (this.defines = {}),
  54384. (this.uniforms = {}),
  54385. (this.vertexShader =
  54386. 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  54387. (this.fragmentShader =
  54388. 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  54389. (this.shading = n.SmoothShading),
  54390. (this.linewidth = 1),
  54391. (this.wireframe = !1),
  54392. (this.wireframeLinewidth = 1),
  54393. (this.fog = !1),
  54394. (this.lights = !1),
  54395. (this.vertexColors = n.NoColors),
  54396. (this.skinning = !1),
  54397. (this.morphTargets = !1),
  54398. (this.morphNormals = !1),
  54399. (this.extensions = {
  54400. derivatives: !1,
  54401. fragDepth: !1,
  54402. drawBuffers: !1,
  54403. shaderTextureLOD: !1
  54404. }),
  54405. (this.defaultAttributeValues = {
  54406. color: [1, 1, 1],
  54407. uv: [0, 0],
  54408. uv2: [0, 0]
  54409. }),
  54410. (this.index0AttributeName = void 0),
  54411. void 0 !== e &&
  54412. (void 0 !== e.attributes &&
  54413. console.error(
  54414. 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'
  54415. ),
  54416. this.setValues(e))
  54417. }),
  54418. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  54419. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  54420. (n.ShaderMaterial.prototype.copy = function (e) {
  54421. return (
  54422. n.Material.prototype.copy.call(this, e),
  54423. (this.fragmentShader = e.fragmentShader),
  54424. (this.vertexShader = e.vertexShader),
  54425. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  54426. (this.defines = e.defines),
  54427. (this.shading = e.shading),
  54428. (this.wireframe = e.wireframe),
  54429. (this.wireframeLinewidth = e.wireframeLinewidth),
  54430. (this.fog = e.fog),
  54431. (this.lights = e.lights),
  54432. (this.vertexColors = e.vertexColors),
  54433. (this.skinning = e.skinning),
  54434. (this.morphTargets = e.morphTargets),
  54435. (this.morphNormals = e.morphNormals),
  54436. (this.extensions = e.extensions),
  54437. this
  54438. )
  54439. }),
  54440. (n.ShaderMaterial.prototype.toJSON = function (e) {
  54441. var t = n.Material.prototype.toJSON.call(this, e)
  54442. return (
  54443. (t.uniforms = this.uniforms),
  54444. (t.vertexShader = this.vertexShader),
  54445. (t.fragmentShader = this.fragmentShader),
  54446. t
  54447. )
  54448. }),
  54449. (n.RawShaderMaterial = function (e) {
  54450. n.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial')
  54451. }),
  54452. (n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype)),
  54453. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  54454. (n.SpriteMaterial = function (e) {
  54455. n.Material.call(this),
  54456. (this.type = 'SpriteMaterial'),
  54457. (this.color = new n.Color(16777215)),
  54458. (this.map = null),
  54459. (this.rotation = 0),
  54460. (this.fog = !1),
  54461. this.setValues(e)
  54462. }),
  54463. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  54464. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  54465. (n.SpriteMaterial.prototype.copy = function (e) {
  54466. return (
  54467. n.Material.prototype.copy.call(this, e),
  54468. this.color.copy(e.color),
  54469. (this.map = e.map),
  54470. (this.rotation = e.rotation),
  54471. (this.fog = e.fog),
  54472. this
  54473. )
  54474. }),
  54475. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  54476. Object.defineProperty(this, 'id', {
  54477. value: n.TextureIdCount++
  54478. }),
  54479. (this.uuid = n.Math.generateUUID()),
  54480. (this.name = ''),
  54481. (this.sourceFile = ''),
  54482. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  54483. (this.mipmaps = []),
  54484. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  54485. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  54486. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  54487. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  54488. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  54489. (this.anisotropy = void 0 !== c ? c : 1),
  54490. (this.format = void 0 !== s ? s : n.RGBAFormat),
  54491. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  54492. (this.offset = new n.Vector2(0, 0)),
  54493. (this.repeat = new n.Vector2(1, 1)),
  54494. (this.generateMipmaps = !0),
  54495. (this.premultiplyAlpha = !1),
  54496. (this.flipY = !0),
  54497. (this.unpackAlignment = 4),
  54498. (this.encoding = n.LinearEncoding),
  54499. (this.version = 0),
  54500. (this.onUpdate = null)
  54501. }),
  54502. (n.Texture.DEFAULT_IMAGE = void 0),
  54503. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  54504. (n.Texture.prototype = {
  54505. constructor: n.Texture,
  54506. set needsUpdate(e) {
  54507. e === !0 && this.version++
  54508. },
  54509. clone: function () {
  54510. return new this.constructor().copy(this)
  54511. },
  54512. copy: function (e) {
  54513. return (
  54514. (this.image = e.image),
  54515. (this.mipmaps = e.mipmaps.slice(0)),
  54516. (this.mapping = e.mapping),
  54517. (this.wrapS = e.wrapS),
  54518. (this.wrapT = e.wrapT),
  54519. (this.magFilter = e.magFilter),
  54520. (this.minFilter = e.minFilter),
  54521. (this.anisotropy = e.anisotropy),
  54522. (this.format = e.format),
  54523. (this.type = e.type),
  54524. this.offset.copy(e.offset),
  54525. this.repeat.copy(e.repeat),
  54526. (this.generateMipmaps = e.generateMipmaps),
  54527. (this.premultiplyAlpha = e.premultiplyAlpha),
  54528. (this.flipY = e.flipY),
  54529. (this.unpackAlignment = e.unpackAlignment),
  54530. (this.encoding = e.encoding),
  54531. this
  54532. )
  54533. },
  54534. toJSON: function (e) {
  54535. function t(e) {
  54536. var t
  54537. return (
  54538. void 0 !== e.toDataURL
  54539. ? (t = e)
  54540. : ((t = document.createElement('canvas')),
  54541. (t.width = e.width),
  54542. (t.height = e.height),
  54543. t.getContext('2d').drawImage(e, 0, 0, e.width, e.height)),
  54544. t.width > 2048 || t.height > 2048
  54545. ? t.toDataURL('image/jpeg', 0.6)
  54546. : t.toDataURL('image/png')
  54547. )
  54548. }
  54549. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid]
  54550. var i = {
  54551. metadata: {
  54552. version: 4.4,
  54553. type: 'Texture',
  54554. generator: 'Texture.toJSON'
  54555. },
  54556. uuid: this.uuid,
  54557. name: this.name,
  54558. mapping: this.mapping,
  54559. repeat: [this.repeat.x, this.repeat.y],
  54560. offset: [this.offset.x, this.offset.y],
  54561. wrap: [this.wrapS, this.wrapT],
  54562. minFilter: this.minFilter,
  54563. magFilter: this.magFilter,
  54564. anisotropy: this.anisotropy
  54565. }
  54566. if (void 0 !== this.image) {
  54567. var r = this.image
  54568. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  54569. void 0 === e.images[r.uuid] &&
  54570. (e.images[r.uuid] = {
  54571. uuid: r.uuid,
  54572. url: t(r)
  54573. }),
  54574. (i.image = r.uuid)
  54575. }
  54576. return (e.textures[this.uuid] = i), i
  54577. },
  54578. dispose: function () {
  54579. this.dispatchEvent({
  54580. type: 'dispose'
  54581. })
  54582. },
  54583. transformUv: function (e) {
  54584. if (this.mapping === n.UVMapping) {
  54585. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || e.x > 1))
  54586. switch (this.wrapS) {
  54587. case n.RepeatWrapping:
  54588. e.x = e.x - Math.floor(e.x)
  54589. break
  54590. case n.ClampToEdgeWrapping:
  54591. e.x = e.x < 0 ? 0 : 1
  54592. break
  54593. case n.MirroredRepeatWrapping:
  54594. 1 === Math.abs(Math.floor(e.x) % 2)
  54595. ? (e.x = Math.ceil(e.x) - e.x)
  54596. : (e.x = e.x - Math.floor(e.x))
  54597. }
  54598. if (e.y < 0 || e.y > 1)
  54599. switch (this.wrapT) {
  54600. case n.RepeatWrapping:
  54601. e.y = e.y - Math.floor(e.y)
  54602. break
  54603. case n.ClampToEdgeWrapping:
  54604. e.y = e.y < 0 ? 0 : 1
  54605. break
  54606. case n.MirroredRepeatWrapping:
  54607. 1 === Math.abs(Math.floor(e.y) % 2)
  54608. ? (e.y = Math.ceil(e.y) - e.y)
  54609. : (e.y = e.y - Math.floor(e.y))
  54610. }
  54611. this.flipY && (e.y = 1 - e.y)
  54612. }
  54613. }
  54614. }),
  54615. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  54616. (n.TextureIdCount = 0),
  54617. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  54618. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.needsUpdate = !0)
  54619. }),
  54620. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  54621. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  54622. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  54623. ;(e = void 0 !== e ? e : []),
  54624. (t = void 0 !== t ? t : n.CubeReflectionMapping),
  54625. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  54626. (this.flipY = !1)
  54627. }),
  54628. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  54629. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  54630. Object.defineProperty(n.CubeTexture.prototype, 'images', {
  54631. get: function () {
  54632. return this.image
  54633. },
  54634. set: function (e) {
  54635. this.image = e
  54636. }
  54637. }),
  54638. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54639. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54640. (this.image = {
  54641. width: t,
  54642. height: i
  54643. }),
  54644. (this.mipmaps = e),
  54645. (this.flipY = !1),
  54646. (this.generateMipmaps = !1)
  54647. }),
  54648. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  54649. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  54650. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54651. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54652. (this.image = {
  54653. data: e,
  54654. width: t,
  54655. height: i
  54656. }),
  54657. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  54658. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  54659. (this.flipY = !1),
  54660. (this.generateMipmaps = !1)
  54661. }),
  54662. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  54663. (n.DataTexture.prototype.constructor = n.DataTexture),
  54664. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  54665. function h() {
  54666. requestAnimationFrame(h)
  54667. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  54668. //改 add !e.paused
  54669. u.needsUpdate = !0
  54670. }
  54671. }
  54672. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.generateMipmaps = !1)
  54673. var u = this
  54674. h()
  54675. }),
  54676. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  54677. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  54678. (n.Group = function () {
  54679. n.Object3D.call(this), (this.type = 'Group')
  54680. }),
  54681. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  54682. (n.Group.prototype.constructor = n.Group),
  54683. (n.Points = function (e, t) {
  54684. n.Object3D.call(this),
  54685. (this.type = 'Points'),
  54686. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54687. (this.material =
  54688. void 0 !== t
  54689. ? t
  54690. : new n.PointsMaterial({
  54691. color: 16777215 * Math.random()
  54692. }))
  54693. }),
  54694. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  54695. (n.Points.prototype.constructor = n.Points),
  54696. (n.Points.prototype.raycast = (function () {
  54697. var e = new n.Matrix4(),
  54698. t = new n.Ray(),
  54699. i = new n.Sphere()
  54700. return function (r, o) {
  54701. function a(e, i) {
  54702. var n = t.distanceSqToPoint(e)
  54703. if (n < d) {
  54704. var a = t.closestPointToPoint(e)
  54705. a.applyMatrix4(c)
  54706. var l = r.ray.origin.distanceTo(a)
  54707. if (l < r.near || l > r.far) return
  54708. o.push({
  54709. distance: l,
  54710. distanceToRay: Math.sqrt(n),
  54711. point: a.clone(),
  54712. index: i,
  54713. face: null,
  54714. object: s
  54715. })
  54716. }
  54717. }
  54718. var s = this,
  54719. l = this.geometry,
  54720. c = this.matrixWorld,
  54721. h = r.params.Points.threshold
  54722. if (
  54723. (null === l.boundingSphere && l.computeBoundingSphere(),
  54724. i.copy(l.boundingSphere),
  54725. i.applyMatrix4(c),
  54726. r.ray.intersectsSphere(i) !== !1)
  54727. ) {
  54728. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  54729. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  54730. d = u * u,
  54731. p = new n.Vector3()
  54732. if (l instanceof n.BufferGeometry) {
  54733. var f = l.index,
  54734. g = l.attributes,
  54735. m = g.position.array
  54736. if (null !== f)
  54737. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  54738. var C = v[A]
  54739. p.fromArray(m, 3 * C), a(p, C)
  54740. }
  54741. else for (var A = 0, I = m.length / 3; A < I; A++) p.fromArray(m, 3 * A), a(p, A)
  54742. } else for (var E = l.vertices, A = 0, I = E.length; A < I; A++) a(E[A], A)
  54743. }
  54744. }
  54745. })()),
  54746. (n.Points.prototype.clone = function () {
  54747. return new this.constructor(this.geometry, this.material).copy(this)
  54748. }),
  54749. (n.Line = function (e, t, i) {
  54750. return 1 === i
  54751. ? (console.warn(
  54752. 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'
  54753. ),
  54754. new n.LineSegments(e, t))
  54755. : (n.Object3D.call(this),
  54756. (this.type = 'Line'),
  54757. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54758. void (this.material =
  54759. void 0 !== t
  54760. ? t
  54761. : new n.LineBasicMaterial({
  54762. color: 16777215 * Math.random()
  54763. })))
  54764. }),
  54765. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  54766. (n.Line.prototype.constructor = n.Line),
  54767. (n.Line.prototype.raycast = (function () {
  54768. var e = new n.Matrix4(),
  54769. t = new n.Ray(),
  54770. i = new n.Sphere()
  54771. return function (r, o) {
  54772. var a = r.linePrecision,
  54773. s = a * a,
  54774. l = this.geometry,
  54775. c = this.matrixWorld
  54776. if (
  54777. (null === l.boundingSphere && l.computeBoundingSphere(),
  54778. i.copy(l.boundingSphere),
  54779. i.applyMatrix4(c),
  54780. r.ray.intersectsSphere(i) !== !1)
  54781. ) {
  54782. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  54783. var h = new n.Vector3(),
  54784. u = new n.Vector3(),
  54785. d = new n.Vector3(),
  54786. p = new n.Vector3(),
  54787. f = this instanceof n.LineSegments ? 2 : 1
  54788. if (l instanceof n.BufferGeometry) {
  54789. var g = l.index,
  54790. m = l.attributes,
  54791. v = m.position.array
  54792. if (null !== g)
  54793. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  54794. var I = A[y],
  54795. E = A[y + 1]
  54796. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E)
  54797. var b = t.distanceSqToSegment(h, u, p, d)
  54798. if (!(b > s)) {
  54799. p.applyMatrix4(this.matrixWorld)
  54800. var w = r.ray.origin.distanceTo(p)
  54801. w < r.near ||
  54802. w > r.far ||
  54803. o.push({
  54804. distance: w,
  54805. point: d.clone().applyMatrix4(this.matrixWorld),
  54806. index: y,
  54807. face: null,
  54808. faceIndex: null,
  54809. object: this
  54810. })
  54811. }
  54812. }
  54813. else
  54814. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  54815. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3)
  54816. var b = t.distanceSqToSegment(h, u, p, d)
  54817. if (!(b > s)) {
  54818. p.applyMatrix4(this.matrixWorld)
  54819. var w = r.ray.origin.distanceTo(p)
  54820. w < r.near ||
  54821. w > r.far ||
  54822. o.push({
  54823. distance: w,
  54824. point: d.clone().applyMatrix4(this.matrixWorld),
  54825. index: y,
  54826. face: null,
  54827. faceIndex: null,
  54828. object: this
  54829. })
  54830. }
  54831. }
  54832. } else if (l instanceof n.Geometry)
  54833. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  54834. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d)
  54835. if (!(b > s)) {
  54836. p.applyMatrix4(this.matrixWorld)
  54837. var w = r.ray.origin.distanceTo(p)
  54838. w < r.near ||
  54839. w > r.far ||
  54840. o.push({
  54841. distance: w,
  54842. point: d.clone().applyMatrix4(this.matrixWorld),
  54843. index: y,
  54844. face: null,
  54845. faceIndex: null,
  54846. object: this
  54847. })
  54848. }
  54849. }
  54850. }
  54851. }
  54852. })()),
  54853. (n.Line.prototype.clone = function () {
  54854. return new this.constructor(this.geometry, this.material).copy(this)
  54855. }),
  54856. (n.LineStrip = 0),
  54857. (n.LinePieces = 1),
  54858. (n.LineSegments = function (e, t) {
  54859. n.Line.call(this, e, t), (this.type = 'LineSegments')
  54860. }),
  54861. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  54862. (n.LineSegments.prototype.constructor = n.LineSegments),
  54863. (n.Mesh = function (e, t) {
  54864. n.Object3D.call(this),
  54865. (this.type = 'Mesh'),
  54866. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54867. (this.material =
  54868. void 0 !== t
  54869. ? t
  54870. : new n.MeshBasicMaterial({
  54871. color: 16777215 * Math.random()
  54872. })),
  54873. (this.drawMode = n.TrianglesDrawMode),
  54874. this.updateMorphTargets()
  54875. }),
  54876. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  54877. (n.Mesh.prototype.constructor = n.Mesh),
  54878. (n.Mesh.prototype.setDrawMode = function (e) {
  54879. this.drawMode = e
  54880. }),
  54881. (n.Mesh.prototype.updateMorphTargets = function () {
  54882. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  54883. ;(this.morphTargetBase = -1),
  54884. (this.morphTargetInfluences = []),
  54885. (this.morphTargetDictionary = {})
  54886. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  54887. this.morphTargetInfluences.push(0),
  54888. (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e)
  54889. }
  54890. }),
  54891. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  54892. return void 0 !== this.morphTargetDictionary[e]
  54893. ? this.morphTargetDictionary[e]
  54894. : (console.warn(
  54895. 'THREE.Mesh.getMorphTargetIndexByName: morph target ' +
  54896. e +
  54897. ' does not exist. Returning 0.'
  54898. ),
  54899. 0)
  54900. }),
  54901. (n.Mesh.prototype.raycast = (function () {
  54902. function e(e, t, i, r, o, a, s) {
  54903. return (
  54904. n.Triangle.barycoordFromPoint(e, t, i, r, m),
  54905. o.multiplyScalar(m.x),
  54906. a.multiplyScalar(m.y),
  54907. s.multiplyScalar(m.z),
  54908. o.add(a).add(s),
  54909. o.clone()
  54910. )
  54911. }
  54912. function t(e, t, i, r, o, a, s) {
  54913. var l,
  54914. c = e.material
  54915. if (
  54916. ((l =
  54917. c.side === n.BackSide
  54918. ? i.intersectTriangle(a, o, r, !0, s)
  54919. : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)),
  54920. null === l)
  54921. )
  54922. return null
  54923. A.copy(s), A.applyMatrix4(e.matrixWorld)
  54924. var h = t.ray.origin.distanceTo(A)
  54925. return h < t.near || h > t.far
  54926. ? null
  54927. : {
  54928. distance: h,
  54929. point: A.clone(),
  54930. object: e
  54931. }
  54932. }
  54933. function i(i, r, o, a, h, u, d, m) {
  54934. s.fromArray(a, 3 * u), l.fromArray(a, 3 * d), c.fromArray(a, 3 * m)
  54935. var A = t(i, r, o, s, l, c, v)
  54936. return (
  54937. A &&
  54938. (h &&
  54939. (p.fromArray(h, 2 * u),
  54940. f.fromArray(h, 2 * d),
  54941. g.fromArray(h, 2 * m),
  54942. (A.uv = e(v, s, l, c, p, f, g))),
  54943. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  54944. (A.faceIndex = u)),
  54945. A
  54946. )
  54947. }
  54948. var r = new n.Matrix4(),
  54949. o = new n.Ray(),
  54950. a = new n.Sphere(),
  54951. s = new n.Vector3(),
  54952. l = new n.Vector3(),
  54953. c = new n.Vector3(),
  54954. h = new n.Vector3(),
  54955. u = new n.Vector3(),
  54956. d = new n.Vector3(),
  54957. p = new n.Vector2(),
  54958. f = new n.Vector2(),
  54959. g = new n.Vector2(),
  54960. m = new n.Vector3(),
  54961. v = new n.Vector3(),
  54962. A = new n.Vector3()
  54963. return function (m, A) {
  54964. var y = this.geometry,
  54965. C = this.material,
  54966. I = this.matrixWorld
  54967. if (
  54968. void 0 !== C &&
  54969. (null === y.boundingSphere && y.computeBoundingSphere(),
  54970. a.copy(y.boundingSphere),
  54971. a.applyMatrix4(I),
  54972. m.ray.intersectsSphere(a) !== !1 &&
  54973. (r.getInverse(I),
  54974. o.copy(m.ray).applyMatrix4(r),
  54975. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))
  54976. ) {
  54977. var E, b
  54978. if (y instanceof n.BufferGeometry) {
  54979. var w,
  54980. _,
  54981. T,
  54982. x = y.index,
  54983. S = y.attributes,
  54984. M = S.position.array
  54985. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  54986. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  54987. (w = R[P]),
  54988. (_ = R[P + 1]),
  54989. (T = R[P + 2]),
  54990. (b = i(this, m, o, M, E, w, _, T)),
  54991. b && ((b.faceIndex = Math.floor(P / 3)), A.push(b))
  54992. else
  54993. for (var P = 0, O = M.length; P < O; P += 9)
  54994. (w = P / 3),
  54995. (_ = w + 1),
  54996. (T = w + 2),
  54997. (b = i(this, m, o, M, E, w, _, T)),
  54998. b && ((b.index = w), A.push(b))
  54999. } else if (y instanceof n.Geometry) {
  55000. var L,
  55001. D,
  55002. N,
  55003. B = C instanceof n.MultiMaterial,
  55004. F = B === !0 ? C.materials : null,
  55005. V = y.vertices,
  55006. U = y.faces,
  55007. k = y.faceVertexUvs[0]
  55008. k.length > 0 && (E = k)
  55009. for (var H = 0, G = U.length; H < G; H++) {
  55010. var z = U[H],
  55011. W = B === !0 ? F[z.materialIndex] : C
  55012. if (void 0 !== W) {
  55013. if (((L = V[z.a]), (D = V[z.b]), (N = V[z.c]), W.morphTargets === !0)) {
  55014. var j = y.morphTargets,
  55015. Y = this.morphTargetInfluences
  55016. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0)
  55017. for (var X = 0, Z = j.length; X < Z; X++) {
  55018. var q = Y[X]
  55019. if (0 !== q) {
  55020. var K = j[X].vertices
  55021. s.addScaledVector(h.subVectors(K[z.a], L), q),
  55022. l.addScaledVector(u.subVectors(K[z.b], D), q),
  55023. c.addScaledVector(d.subVectors(K[z.c], N), q)
  55024. }
  55025. }
  55026. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c)
  55027. }
  55028. if ((b = t(this, m, o, L, D, N, v))) {
  55029. if (E) {
  55030. var Q = E[H]
  55031. p.copy(Q[0]), f.copy(Q[1]), g.copy(Q[2]), (b.uv = e(v, L, D, N, p, f, g))
  55032. }
  55033. ;(b.face = z), (b.faceIndex = H), A.push(b)
  55034. }
  55035. }
  55036. }
  55037. }
  55038. }
  55039. }
  55040. })()),
  55041. (n.Mesh.prototype.clone = function () {
  55042. return new this.constructor(this.geometry, this.material).copy(this)
  55043. }),
  55044. (n.Bone = function (e) {
  55045. n.Object3D.call(this), (this.type = 'Bone'), (this.skin = e)
  55046. }),
  55047. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  55048. (n.Bone.prototype.constructor = n.Bone),
  55049. (n.Bone.prototype.copy = function (e) {
  55050. return n.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this
  55051. }),
  55052. (n.Skeleton = function (e, t, i) {
  55053. if (
  55054. ((this.useVertexTexture = void 0 === i || i),
  55055. (this.identityMatrix = new n.Matrix4()),
  55056. (e = e || []),
  55057. (this.bones = e.slice(0)),
  55058. this.useVertexTexture)
  55059. ) {
  55060. var r = Math.sqrt(4 * this.bones.length)
  55061. ;(r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  55062. (r = Math.max(r, 4)),
  55063. (this.boneTextureWidth = r),
  55064. (this.boneTextureHeight = r),
  55065. (this.boneMatrices = new Float32Array(
  55066. this.boneTextureWidth * this.boneTextureHeight * 4
  55067. )),
  55068. (this.boneTexture = new n.DataTexture(
  55069. this.boneMatrices,
  55070. this.boneTextureWidth,
  55071. this.boneTextureHeight,
  55072. n.RGBAFormat,
  55073. n.FloatType
  55074. ))
  55075. } else this.boneMatrices = new Float32Array(16 * this.bones.length)
  55076. if (void 0 === t) this.calculateInverses()
  55077. else if (this.bones.length === t.length) this.boneInverses = t.slice(0)
  55078. else {
  55079. console.warn('THREE.Skeleton bonInverses is the wrong length.'),
  55080. (this.boneInverses = [])
  55081. for (var o = 0, a = this.bones.length; o < a; o++)
  55082. this.boneInverses.push(new n.Matrix4())
  55083. }
  55084. }),
  55085. (n.Skeleton.prototype.calculateInverses = function () {
  55086. this.boneInverses = []
  55087. for (var e = 0, t = this.bones.length; e < t; e++) {
  55088. var i = new n.Matrix4()
  55089. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i)
  55090. }
  55091. }),
  55092. (n.Skeleton.prototype.pose = function () {
  55093. for (var e, t = 0, i = this.bones.length; t < i; t++)
  55094. (e = this.bones[t]), e && e.matrixWorld.getInverse(this.boneInverses[t])
  55095. for (var t = 0, i = this.bones.length; t < i; t++)
  55096. (e = this.bones[t]),
  55097. e &&
  55098. (e.parent
  55099. ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld))
  55100. : e.matrix.copy(e.matrixWorld),
  55101. e.matrix.decompose(e.position, e.quaternion, e.scale))
  55102. }),
  55103. (n.Skeleton.prototype.update = (function () {
  55104. var e = new n.Matrix4()
  55105. return function () {
  55106. for (var t = 0, i = this.bones.length; t < i; t++) {
  55107. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix
  55108. e.multiplyMatrices(n, this.boneInverses[t]),
  55109. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  55110. }
  55111. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  55112. }
  55113. })()),
  55114. (n.Skeleton.prototype.clone = function () {
  55115. return new n.Skeleton(this.bones, this.boneInverses, this.useVertexTexture)
  55116. }),
  55117. (n.SkinnedMesh = function (e, t, i) {
  55118. n.Mesh.call(this, e, t),
  55119. (this.type = 'SkinnedMesh'),
  55120. (this.bindMode = 'attached'),
  55121. (this.bindMatrix = new n.Matrix4()),
  55122. (this.bindMatrixInverse = new n.Matrix4())
  55123. var r = []
  55124. if (this.geometry && void 0 !== this.geometry.bones) {
  55125. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  55126. (a = this.geometry.bones[s]),
  55127. (o = new n.Bone(this)),
  55128. r.push(o),
  55129. (o.name = a.name),
  55130. o.position.fromArray(a.pos),
  55131. o.quaternion.fromArray(a.rotq),
  55132. void 0 !== a.scl && o.scale.fromArray(a.scl)
  55133. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  55134. (a = this.geometry.bones[s]),
  55135. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  55136. }
  55137. this.normalizeSkinWeights(),
  55138. this.updateMatrixWorld(!0),
  55139. this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld)
  55140. }),
  55141. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  55142. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  55143. (n.SkinnedMesh.prototype.bind = function (e, t) {
  55144. ;(this.skeleton = e),
  55145. void 0 === t &&
  55146. (this.updateMatrixWorld(!0),
  55147. this.skeleton.calculateInverses(),
  55148. (t = this.matrixWorld)),
  55149. this.bindMatrix.copy(t),
  55150. this.bindMatrixInverse.getInverse(t)
  55151. }),
  55152. (n.SkinnedMesh.prototype.pose = function () {
  55153. this.skeleton.pose()
  55154. }),
  55155. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  55156. if (this.geometry instanceof n.Geometry)
  55157. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  55158. var t = this.geometry.skinWeights[e],
  55159. i = 1 / t.lengthManhattan()
  55160. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  55161. }
  55162. else if (this.geometry instanceof n.BufferGeometry)
  55163. for (
  55164. var r = new n.Vector4(), o = this.geometry.attributes.skinWeight, e = 0;
  55165. e < o.count;
  55166. e++
  55167. ) {
  55168. ;(r.x = o.getX(e)), (r.y = o.getY(e)), (r.z = o.getZ(e)), (r.w = o.getW(e))
  55169. var i = 1 / r.lengthManhattan()
  55170. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  55171. o.setXYZW(e, r.x, r.y, r.z, r.w)
  55172. }
  55173. }),
  55174. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  55175. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  55176. 'attached' === this.bindMode
  55177. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  55178. : 'detached' === this.bindMode
  55179. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  55180. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode)
  55181. }),
  55182. (n.SkinnedMesh.prototype.clone = function () {
  55183. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(
  55184. this
  55185. )
  55186. }),
  55187. (n.LOD = function () {
  55188. n.Object3D.call(this),
  55189. (this.type = 'LOD'),
  55190. Object.defineProperties(this, {
  55191. levels: {
  55192. enumerable: !0,
  55193. value: []
  55194. },
  55195. objects: {
  55196. get: function () {
  55197. return (
  55198. console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  55199. )
  55200. }
  55201. }
  55202. })
  55203. }),
  55204. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  55205. (n.LOD.prototype.constructor = n.LOD),
  55206. (n.LOD.prototype.addLevel = function (e, t) {
  55207. void 0 === t && (t = 0), (t = Math.abs(t))
  55208. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  55209. i.splice(n, 0, {
  55210. distance: t,
  55211. object: e
  55212. }),
  55213. this.add(e)
  55214. }),
  55215. (n.LOD.prototype.getObjectForDistance = function (e) {
  55216. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  55217. return t[i - 1].object
  55218. }),
  55219. (n.LOD.prototype.raycast = (function () {
  55220. var e = new n.Vector3()
  55221. return function (t, i) {
  55222. e.setFromMatrixPosition(this.matrixWorld)
  55223. var n = t.ray.origin.distanceTo(e)
  55224. this.getObjectForDistance(n).raycast(t, i)
  55225. }
  55226. })()),
  55227. (n.LOD.prototype.update = (function () {
  55228. var e = new n.Vector3(),
  55229. t = new n.Vector3()
  55230. return function (i) {
  55231. var n = this.levels
  55232. if (n.length > 1) {
  55233. e.setFromMatrixPosition(i.matrixWorld), t.setFromMatrixPosition(this.matrixWorld)
  55234. var r = e.distanceTo(t)
  55235. n[0].object.visible = !0
  55236. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  55237. (n[o - 1].object.visible = !1), (n[o].object.visible = !0)
  55238. for (; o < a; o++) n[o].object.visible = !1
  55239. }
  55240. }
  55241. })()),
  55242. (n.LOD.prototype.copy = function (e) {
  55243. n.Object3D.prototype.copy.call(this, e, !1)
  55244. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  55245. var o = t[i]
  55246. this.addLevel(o.object.clone(), o.distance)
  55247. }
  55248. return this
  55249. }),
  55250. (n.LOD.prototype.toJSON = function (e) {
  55251. var t = n.Object3D.prototype.toJSON.call(this, e)
  55252. t.object.levels = []
  55253. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  55254. var a = i[r]
  55255. t.object.levels.push({
  55256. object: a.object.uuid,
  55257. distance: a.distance
  55258. })
  55259. }
  55260. return t
  55261. }),
  55262. (n.Sprite = (function () {
  55263. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  55264. t = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0]),
  55265. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  55266. r = new n.BufferGeometry()
  55267. return (
  55268. r.setIndex(new n.BufferAttribute(e, 1)),
  55269. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  55270. r.addAttribute('uv', new n.BufferAttribute(i, 2)),
  55271. function (e) {
  55272. n.Object3D.call(this),
  55273. (this.type = 'Sprite'),
  55274. (this.geometry = r),
  55275. (this.material = void 0 !== e ? e : new n.SpriteMaterial())
  55276. }
  55277. )
  55278. })()),
  55279. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  55280. (n.Sprite.prototype.constructor = n.Sprite),
  55281. (n.Sprite.prototype.raycast = (function () {
  55282. var e = new n.Vector3()
  55283. return function (t, i) {
  55284. e.setFromMatrixPosition(this.matrixWorld)
  55285. var n = t.ray.distanceSqToPoint(e),
  55286. r = this.scale.x * this.scale.y
  55287. n > r ||
  55288. i.push({
  55289. distance: Math.sqrt(n),
  55290. point: this.position,
  55291. face: null,
  55292. object: this
  55293. })
  55294. }
  55295. })()),
  55296. (n.Sprite.prototype.clone = function () {
  55297. return new this.constructor(this.material).copy(this)
  55298. }),
  55299. (n.Particle = n.Sprite),
  55300. (n.LensFlare = function (e, t, i, r, o) {
  55301. n.Object3D.call(this),
  55302. (this.lensFlares = []),
  55303. (this.positionScreen = new n.Vector3()),
  55304. (this.customUpdateCallback = void 0),
  55305. void 0 !== e && this.add(e, t, i, r, o)
  55306. }),
  55307. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  55308. (n.LensFlare.prototype.constructor = n.LensFlare),
  55309. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  55310. void 0 === t && (t = -1),
  55311. void 0 === i && (i = 0),
  55312. void 0 === a && (a = 1),
  55313. void 0 === o && (o = new n.Color(16777215)),
  55314. void 0 === r && (r = n.NormalBlending),
  55315. (i = Math.min(i, Math.max(0, i))),
  55316. this.lensFlares.push({
  55317. texture: e,
  55318. size: t,
  55319. distance: i,
  55320. x: 0,
  55321. y: 0,
  55322. z: 0,
  55323. scale: 1,
  55324. rotation: 0,
  55325. opacity: a,
  55326. color: o,
  55327. blending: r
  55328. })
  55329. }),
  55330. (n.LensFlare.prototype.updateLensFlares = function () {
  55331. var e,
  55332. t,
  55333. i = this.lensFlares.length,
  55334. n = 2 * -this.positionScreen.x,
  55335. r = 2 * -this.positionScreen.y
  55336. for (e = 0; e < i; e++)
  55337. (t = this.lensFlares[e]),
  55338. (t.x = this.positionScreen.x + n * t.distance),
  55339. (t.y = this.positionScreen.y + r * t.distance),
  55340. (t.wantedRotation = t.x * Math.PI * 0.25),
  55341. (t.rotation += 0.25 * (t.wantedRotation - t.rotation))
  55342. }),
  55343. (n.LensFlare.prototype.copy = function (e) {
  55344. n.Object3D.prototype.copy.call(this, e),
  55345. this.positionScreen.copy(e.positionScreen),
  55346. (this.customUpdateCallback = e.customUpdateCallback)
  55347. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  55348. this.lensFlares.push(e.lensFlares[t])
  55349. return this
  55350. }),
  55351. (n.Scene = function () {
  55352. n.Object3D.call(this),
  55353. (this.type = 'Scene'),
  55354. (this.fog = null),
  55355. (this.overrideMaterial = null),
  55356. (this.autoUpdate = !0)
  55357. }),
  55358. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  55359. (n.Scene.prototype.constructor = n.Scene),
  55360. (n.Scene.prototype.copy = function (e, t) {
  55361. return (
  55362. n.Object3D.prototype.copy.call(this, e, t),
  55363. null !== e.fog && (this.fog = e.fog.clone()),
  55364. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  55365. (this.autoUpdate = e.autoUpdate),
  55366. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  55367. this
  55368. )
  55369. }),
  55370. (n.Fog = function (e, t, i) {
  55371. ;(this.name = ''),
  55372. (this.color = new n.Color(e)),
  55373. (this.near = void 0 !== t ? t : 1),
  55374. (this.far = void 0 !== i ? i : 1e3)
  55375. }),
  55376. (n.Fog.prototype.clone = function () {
  55377. return new n.Fog(this.color.getHex(), this.near, this.far)
  55378. }),
  55379. (n.FogExp2 = function (e, t) {
  55380. ;(this.name = ''),
  55381. (this.color = new n.Color(e)),
  55382. (this.density = void 0 !== t ? t : 25e-5)
  55383. }),
  55384. (n.FogExp2.prototype.clone = function () {
  55385. return new n.FogExp2(this.color.getHex(), this.density)
  55386. }),
  55387. (n.ShaderChunk = {}),
  55388. (n.ShaderChunk.alphamap_fragment =
  55389. '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  55390. (n.ShaderChunk.alphamap_pars_fragment =
  55391. '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  55392. (n.ShaderChunk.alphatest_fragment =
  55393. '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  55394. (n.ShaderChunk.aomap_fragment =
  55395. '#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'),
  55396. (n.ShaderChunk.aomap_pars_fragment =
  55397. '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  55398. (n.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  55399. (n.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  55400. (n.ShaderChunk.bsdfs =
  55401. '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'),
  55402. (n.ShaderChunk.bumpmap_pars_fragment =
  55403. '#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'),
  55404. (n.ShaderChunk.color_fragment =
  55405. '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  55406. (n.ShaderChunk.color_pars_fragment =
  55407. '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  55408. (n.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  55409. (n.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  55410. (n.ShaderChunk.common =
  55411. '#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'),
  55412. (n.ShaderChunk.cube_uv_reflection_fragment =
  55413. '#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'),
  55414. (n.ShaderChunk.defaultnormal_vertex =
  55415. '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  55416. (n.ShaderChunk.displacementmap_vertex =
  55417. '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  55418. (n.ShaderChunk.displacementmap_pars_vertex =
  55419. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  55420. (n.ShaderChunk.emissivemap_fragment =
  55421. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  55422. (n.ShaderChunk.emissivemap_pars_fragment =
  55423. '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  55424. (n.ShaderChunk.encodings_pars_fragment =
  55425. '\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'),
  55426. (n.ShaderChunk.encodings_fragment =
  55427. ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  55428. (n.ShaderChunk.envmap_fragment =
  55429. '#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'),
  55430. (n.ShaderChunk.envmap_pars_fragment =
  55431. '#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'),
  55432. (n.ShaderChunk.envmap_pars_vertex =
  55433. '#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'),
  55434. (n.ShaderChunk.envmap_vertex =
  55435. '#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'),
  55436. (n.ShaderChunk.fog_fragment =
  55437. '#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'),
  55438. (n.ShaderChunk.fog_pars_fragment =
  55439. '#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'),
  55440. (n.ShaderChunk.lightmap_fragment =
  55441. '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  55442. (n.ShaderChunk.lightmap_pars_fragment =
  55443. '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  55444. (n.ShaderChunk.lights_lambert_vertex =
  55445. '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'),
  55446. (n.ShaderChunk.lights_pars =
  55447. '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'),
  55448. (n.ShaderChunk.lights_phong_fragment =
  55449. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  55450. (n.ShaderChunk.lights_phong_pars_fragment =
  55451. '#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'),
  55452. (n.ShaderChunk.lights_phong_pars_vertex =
  55453. '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  55454. (n.ShaderChunk.lights_phong_vertex =
  55455. '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  55456. (n.ShaderChunk.lights_standard_fragment =
  55457. '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'),
  55458. (n.ShaderChunk.lights_standard_pars_fragment =
  55459. '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'),
  55460. (n.ShaderChunk.lights_template =
  55461. '\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'),
  55462. (n.ShaderChunk.logdepthbuf_fragment =
  55463. '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  55464. (n.ShaderChunk.logdepthbuf_pars_fragment =
  55465. '#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n'),
  55466. (n.ShaderChunk.logdepthbuf_pars_vertex =
  55467. '#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif'),
  55468. (n.ShaderChunk.logdepthbuf_vertex =
  55469. '#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'),
  55470. (n.ShaderChunk.map_fragment =
  55471. '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  55472. (n.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  55473. (n.ShaderChunk.map_particle_fragment =
  55474. '#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'),
  55475. (n.ShaderChunk.map_particle_pars_fragment =
  55476. '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  55477. (n.ShaderChunk.metalnessmap_fragment =
  55478. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  55479. (n.ShaderChunk.metalnessmap_pars_fragment =
  55480. '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  55481. (n.ShaderChunk.morphnormal_vertex =
  55482. '#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'),
  55483. (n.ShaderChunk.morphtarget_pars_vertex =
  55484. '#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')
  55485. n.ShaderChunk.morphtarget_vertex =
  55486. '#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'
  55487. ;(n.ShaderChunk.normal_fragment =
  55488. '#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'),
  55489. (n.ShaderChunk.normalmap_pars_fragment =
  55490. '#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'),
  55491. (n.ShaderChunk.premultiplied_alpha_fragment =
  55492. '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  55493. (n.ShaderChunk.project_vertex =
  55494. '#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'),
  55495. (n.ShaderChunk.roughnessmap_fragment =
  55496. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  55497. (n.ShaderChunk.roughnessmap_pars_fragment =
  55498. '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  55499. (n.ShaderChunk.shadowmap_pars_fragment =
  55500. '#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'),
  55501. (n.ShaderChunk.shadowmap_pars_vertex =
  55502. '#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'),
  55503. (n.ShaderChunk.shadowmap_vertex =
  55504. '#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'),
  55505. (n.ShaderChunk.shadowmask_pars_fragment =
  55506. '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'),
  55507. (n.ShaderChunk.skinbase_vertex =
  55508. '#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'),
  55509. (n.ShaderChunk.skinning_pars_vertex =
  55510. '#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'),
  55511. (n.ShaderChunk.skinning_vertex =
  55512. '#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'),
  55513. (n.ShaderChunk.skinnormal_vertex =
  55514. '#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'),
  55515. (n.ShaderChunk.specularmap_fragment =
  55516. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  55517. (n.ShaderChunk.specularmap_pars_fragment =
  55518. '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  55519. (n.ShaderChunk.tonemapping_fragment =
  55520. '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  55521. (n.ShaderChunk.tonemapping_pars_fragment =
  55522. '#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'),
  55523. (n.ShaderChunk.uv2_pars_fragment =
  55524. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  55525. (n.ShaderChunk.uv2_pars_vertex =
  55526. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  55527. (n.ShaderChunk.uv2_vertex =
  55528. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  55529. (n.ShaderChunk.uv_pars_fragment =
  55530. '#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'),
  55531. (n.ShaderChunk.uv_pars_vertex =
  55532. '#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'),
  55533. (n.ShaderChunk.uv_vertex =
  55534. '#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'),
  55535. (n.ShaderChunk.worldpos_vertex =
  55536. '#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'),
  55537. (n.UniformsUtils = {
  55538. merge: function (e) {
  55539. for (var t = {}, i = 0; i < e.length; i++) {
  55540. var n = this.clone(e[i])
  55541. for (var r in n) t[r] = n[r]
  55542. }
  55543. return t
  55544. },
  55545. clone: function (e) {
  55546. var t = {}
  55547. for (var i in e) {
  55548. t[i] = {}
  55549. for (var r in e[i]) {
  55550. var o = e[i][r]
  55551. o instanceof n.Color ||
  55552. o instanceof n.Vector2 ||
  55553. o instanceof n.Vector3 ||
  55554. o instanceof n.Vector4 ||
  55555. o instanceof n.Matrix3 ||
  55556. o instanceof n.Matrix4 ||
  55557. o instanceof n.Texture
  55558. ? (t[i][r] = o.clone())
  55559. : Array.isArray(o)
  55560. ? (t[i][r] = o.slice())
  55561. : (t[i][r] = o)
  55562. }
  55563. }
  55564. return t
  55565. }
  55566. }),
  55567. (n.UniformsLib = {
  55568. common: {
  55569. diffuse: {
  55570. type: 'c',
  55571. value: new n.Color(15658734)
  55572. },
  55573. opacity: {
  55574. type: 'f',
  55575. value: 1
  55576. },
  55577. map: {
  55578. type: 't',
  55579. value: null
  55580. },
  55581. offsetRepeat: {
  55582. type: 'v4',
  55583. value: new n.Vector4(0, 0, 1, 1)
  55584. },
  55585. specularMap: {
  55586. type: 't',
  55587. value: null
  55588. },
  55589. alphaMap: {
  55590. type: 't',
  55591. value: null
  55592. },
  55593. envMap: {
  55594. type: 't',
  55595. value: null
  55596. },
  55597. flipEnvMap: {
  55598. type: 'f',
  55599. value: -1
  55600. },
  55601. reflectivity: {
  55602. type: 'f',
  55603. value: 1
  55604. },
  55605. refractionRatio: {
  55606. type: 'f',
  55607. value: 0.98
  55608. }
  55609. },
  55610. aomap: {
  55611. aoMap: {
  55612. type: 't',
  55613. value: null
  55614. },
  55615. aoMapIntensity: {
  55616. type: 'f',
  55617. value: 1
  55618. }
  55619. },
  55620. lightmap: {
  55621. lightMap: {
  55622. type: 't',
  55623. value: null
  55624. },
  55625. lightMapIntensity: {
  55626. type: 'f',
  55627. value: 1
  55628. }
  55629. },
  55630. emissivemap: {
  55631. emissiveMap: {
  55632. type: 't',
  55633. value: null
  55634. }
  55635. },
  55636. bumpmap: {
  55637. bumpMap: {
  55638. type: 't',
  55639. value: null
  55640. },
  55641. bumpScale: {
  55642. type: 'f',
  55643. value: 1
  55644. }
  55645. },
  55646. normalmap: {
  55647. normalMap: {
  55648. type: 't',
  55649. value: null
  55650. },
  55651. normalScale: {
  55652. type: 'v2',
  55653. value: new n.Vector2(1, 1)
  55654. }
  55655. },
  55656. displacementmap: {
  55657. displacementMap: {
  55658. type: 't',
  55659. value: null
  55660. },
  55661. displacementScale: {
  55662. type: 'f',
  55663. value: 1
  55664. },
  55665. displacementBias: {
  55666. type: 'f',
  55667. value: 0
  55668. }
  55669. },
  55670. roughnessmap: {
  55671. roughnessMap: {
  55672. type: 't',
  55673. value: null
  55674. }
  55675. },
  55676. metalnessmap: {
  55677. metalnessMap: {
  55678. type: 't',
  55679. value: null
  55680. }
  55681. },
  55682. fog: {
  55683. fogDensity: {
  55684. type: 'f',
  55685. value: 25e-5
  55686. },
  55687. fogNear: {
  55688. type: 'f',
  55689. value: 1
  55690. },
  55691. fogFar: {
  55692. type: 'f',
  55693. value: 2e3
  55694. },
  55695. fogColor: {
  55696. type: 'c',
  55697. value: new n.Color(16777215)
  55698. }
  55699. },
  55700. lights: {
  55701. ambientLightColor: {
  55702. type: 'fv',
  55703. value: []
  55704. },
  55705. directionalLights: {
  55706. type: 'sa',
  55707. value: [],
  55708. properties: {
  55709. direction: {
  55710. type: 'v3'
  55711. },
  55712. color: {
  55713. type: 'c'
  55714. },
  55715. shadow: {
  55716. type: 'i'
  55717. },
  55718. shadowBias: {
  55719. type: 'f'
  55720. },
  55721. shadowRadius: {
  55722. type: 'f'
  55723. },
  55724. shadowMapSize: {
  55725. type: 'v2'
  55726. }
  55727. }
  55728. },
  55729. directionalShadowMap: {
  55730. type: 'tv',
  55731. value: []
  55732. },
  55733. directionalShadowMatrix: {
  55734. type: 'm4v',
  55735. value: []
  55736. },
  55737. spotLights: {
  55738. type: 'sa',
  55739. value: [],
  55740. properties: {
  55741. color: {
  55742. type: 'c'
  55743. },
  55744. position: {
  55745. type: 'v3'
  55746. },
  55747. direction: {
  55748. type: 'v3'
  55749. },
  55750. distance: {
  55751. type: 'f'
  55752. },
  55753. coneCos: {
  55754. type: 'f'
  55755. },
  55756. penumbraCos: {
  55757. type: 'f'
  55758. },
  55759. decay: {
  55760. type: 'f'
  55761. },
  55762. shadow: {
  55763. type: 'i'
  55764. },
  55765. shadowBias: {
  55766. type: 'f'
  55767. },
  55768. shadowRadius: {
  55769. type: 'f'
  55770. },
  55771. shadowMapSize: {
  55772. type: 'v2'
  55773. }
  55774. }
  55775. },
  55776. spotShadowMap: {
  55777. type: 'tv',
  55778. value: []
  55779. },
  55780. spotShadowMatrix: {
  55781. type: 'm4v',
  55782. value: []
  55783. },
  55784. pointLights: {
  55785. type: 'sa',
  55786. value: [],
  55787. properties: {
  55788. color: {
  55789. type: 'c'
  55790. },
  55791. position: {
  55792. type: 'v3'
  55793. },
  55794. decay: {
  55795. type: 'f'
  55796. },
  55797. distance: {
  55798. type: 'f'
  55799. },
  55800. shadow: {
  55801. type: 'i'
  55802. },
  55803. shadowBias: {
  55804. type: 'f'
  55805. },
  55806. shadowRadius: {
  55807. type: 'f'
  55808. },
  55809. shadowMapSize: {
  55810. type: 'v2'
  55811. }
  55812. }
  55813. },
  55814. pointShadowMap: {
  55815. type: 'tv',
  55816. value: []
  55817. },
  55818. pointShadowMatrix: {
  55819. type: 'm4v',
  55820. value: []
  55821. },
  55822. hemisphereLights: {
  55823. type: 'sa',
  55824. value: [],
  55825. properties: {
  55826. direction: {
  55827. type: 'v3'
  55828. },
  55829. skyColor: {
  55830. type: 'c'
  55831. },
  55832. groundColor: {
  55833. type: 'c'
  55834. }
  55835. }
  55836. }
  55837. },
  55838. points: {
  55839. diffuse: {
  55840. type: 'c',
  55841. value: new n.Color(15658734)
  55842. },
  55843. opacity: {
  55844. type: 'f',
  55845. value: 1
  55846. },
  55847. size: {
  55848. type: 'f',
  55849. value: 1
  55850. },
  55851. scale: {
  55852. type: 'f',
  55853. value: 1
  55854. },
  55855. map: {
  55856. type: 't',
  55857. value: null
  55858. },
  55859. offsetRepeat: {
  55860. type: 'v4',
  55861. value: new n.Vector4(0, 0, 1, 1)
  55862. }
  55863. }
  55864. }),
  55865. (n.ShaderChunk.cube_frag =
  55866. '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'),
  55867. (n.ShaderChunk.cube_vert =
  55868. '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'),
  55869. (n.ShaderChunk.depth_frag =
  55870. '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'),
  55871. (n.ShaderChunk.depth_vert =
  55872. '#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'),
  55873. (n.ShaderChunk.depthRGBA_frag =
  55874. '#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'),
  55875. (n.ShaderChunk.depthRGBA_vert =
  55876. '#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'),
  55877. (n.ShaderChunk.distanceRGBA_frag =
  55878. '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'),
  55879. (n.ShaderChunk.distanceRGBA_vert =
  55880. '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'),
  55881. (n.ShaderChunk.equirect_frag =
  55882. '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'),
  55883. (n.ShaderChunk.equirect_vert =
  55884. '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'),
  55885. (n.ShaderChunk.linedashed_frag =
  55886. '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'),
  55887. (n.ShaderChunk.linedashed_vert =
  55888. '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'),
  55889. (n.ShaderChunk.meshbasic_frag =
  55890. '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'),
  55891. (n.ShaderChunk.meshbasic_vert =
  55892. '#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'),
  55893. (n.ShaderChunk.meshlambert_frag =
  55894. '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'),
  55895. (n.ShaderChunk.meshlambert_vert =
  55896. '#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'),
  55897. (n.ShaderChunk.meshphong_frag =
  55898. '#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'),
  55899. (n.ShaderChunk.meshphong_vert =
  55900. '#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'),
  55901. (n.ShaderChunk.meshstandard_frag =
  55902. '#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'),
  55903. (n.ShaderChunk.meshstandard_vert =
  55904. '#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'),
  55905. (n.ShaderChunk.normal_frag =
  55906. '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'),
  55907. (n.ShaderChunk.normal_vert =
  55908. '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'),
  55909. (n.ShaderChunk.points_frag =
  55910. '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'),
  55911. (n.ShaderChunk.points_vert =
  55912. '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'),
  55913. (n.ShaderLib = {
  55914. basic: {
  55915. uniforms: n.UniformsUtils.merge([
  55916. n.UniformsLib.common,
  55917. n.UniformsLib.aomap,
  55918. n.UniformsLib.fog
  55919. ]),
  55920. vertexShader: n.ShaderChunk.meshbasic_vert,
  55921. fragmentShader: n.ShaderChunk.meshbasic_frag
  55922. },
  55923. lambert: {
  55924. uniforms: n.UniformsUtils.merge([
  55925. n.UniformsLib.common,
  55926. n.UniformsLib.aomap,
  55927. n.UniformsLib.lightmap,
  55928. n.UniformsLib.emissivemap,
  55929. n.UniformsLib.fog,
  55930. n.UniformsLib.lights,
  55931. {
  55932. emissive: {
  55933. type: 'c',
  55934. value: new n.Color(0)
  55935. }
  55936. }
  55937. ]),
  55938. vertexShader: n.ShaderChunk.meshlambert_vert,
  55939. fragmentShader: n.ShaderChunk.meshlambert_frag
  55940. },
  55941. phong: {
  55942. uniforms: n.UniformsUtils.merge([
  55943. n.UniformsLib.common,
  55944. n.UniformsLib.aomap,
  55945. n.UniformsLib.lightmap,
  55946. n.UniformsLib.emissivemap,
  55947. n.UniformsLib.bumpmap,
  55948. n.UniformsLib.normalmap,
  55949. n.UniformsLib.displacementmap,
  55950. n.UniformsLib.fog,
  55951. n.UniformsLib.lights,
  55952. {
  55953. emissive: {
  55954. type: 'c',
  55955. value: new n.Color(0)
  55956. },
  55957. specular: {
  55958. type: 'c',
  55959. value: new n.Color(1118481)
  55960. },
  55961. shininess: {
  55962. type: 'f',
  55963. value: 30
  55964. }
  55965. }
  55966. ]),
  55967. vertexShader: n.ShaderChunk.meshphong_vert,
  55968. fragmentShader: n.ShaderChunk.meshphong_frag
  55969. },
  55970. standard: {
  55971. uniforms: n.UniformsUtils.merge([
  55972. n.UniformsLib.common,
  55973. n.UniformsLib.aomap,
  55974. n.UniformsLib.lightmap,
  55975. n.UniformsLib.emissivemap,
  55976. n.UniformsLib.bumpmap,
  55977. n.UniformsLib.normalmap,
  55978. n.UniformsLib.displacementmap,
  55979. n.UniformsLib.roughnessmap,
  55980. n.UniformsLib.metalnessmap,
  55981. n.UniformsLib.fog,
  55982. n.UniformsLib.lights,
  55983. {
  55984. emissive: {
  55985. type: 'c',
  55986. value: new n.Color(0)
  55987. },
  55988. roughness: {
  55989. type: 'f',
  55990. value: 0.5
  55991. },
  55992. metalness: {
  55993. type: 'f',
  55994. value: 0
  55995. },
  55996. envMapIntensity: {
  55997. type: 'f',
  55998. value: 1
  55999. }
  56000. }
  56001. ]),
  56002. vertexShader: n.ShaderChunk.meshstandard_vert,
  56003. fragmentShader: n.ShaderChunk.meshstandard_frag
  56004. },
  56005. points: {
  56006. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  56007. vertexShader: n.ShaderChunk.points_vert,
  56008. fragmentShader: n.ShaderChunk.points_frag
  56009. },
  56010. dashed: {
  56011. uniforms: n.UniformsUtils.merge([
  56012. n.UniformsLib.common,
  56013. n.UniformsLib.fog,
  56014. {
  56015. scale: {
  56016. type: 'f',
  56017. value: 1
  56018. },
  56019. dashSize: {
  56020. type: 'f',
  56021. value: 1
  56022. },
  56023. totalSize: {
  56024. type: 'f',
  56025. value: 2
  56026. }
  56027. }
  56028. ]),
  56029. vertexShader: n.ShaderChunk.linedashed_vert,
  56030. fragmentShader: n.ShaderChunk.linedashed_frag
  56031. },
  56032. depth: {
  56033. uniforms: {
  56034. mNear: {
  56035. type: 'f',
  56036. value: 1
  56037. },
  56038. mFar: {
  56039. type: 'f',
  56040. value: 2e3
  56041. },
  56042. opacity: {
  56043. type: 'f',
  56044. value: 1
  56045. }
  56046. },
  56047. vertexShader: n.ShaderChunk.depth_vert,
  56048. fragmentShader: n.ShaderChunk.depth_frag
  56049. },
  56050. normal: {
  56051. uniforms: {
  56052. opacity: {
  56053. type: 'f',
  56054. value: 1
  56055. }
  56056. },
  56057. vertexShader: n.ShaderChunk.normal_vert,
  56058. fragmentShader: n.ShaderChunk.normal_frag
  56059. },
  56060. cube: {
  56061. uniforms: {
  56062. tCube: {
  56063. type: 't',
  56064. value: null
  56065. },
  56066. tFlip: {
  56067. type: 'f',
  56068. value: -1
  56069. }
  56070. },
  56071. vertexShader: n.ShaderChunk.cube_vert,
  56072. fragmentShader: n.ShaderChunk.cube_frag
  56073. },
  56074. equirect: {
  56075. uniforms: {
  56076. tEquirect: {
  56077. type: 't',
  56078. value: null
  56079. },
  56080. tFlip: {
  56081. type: 'f',
  56082. value: -1
  56083. }
  56084. },
  56085. vertexShader: n.ShaderChunk.equirect_vert,
  56086. fragmentShader: n.ShaderChunk.equirect_frag
  56087. },
  56088. depthRGBA: {
  56089. uniforms: {},
  56090. vertexShader: n.ShaderChunk.depthRGBA_vert,
  56091. fragmentShader: n.ShaderChunk.depthRGBA_frag
  56092. },
  56093. distanceRGBA: {
  56094. uniforms: {
  56095. lightPos: {
  56096. type: 'v3',
  56097. value: new n.Vector3(0, 0, 0)
  56098. }
  56099. },
  56100. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  56101. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  56102. }
  56103. }),
  56104. (n.WebGLRenderer = function (e) {
  56105. function t() {
  56106. return null === ye ? Oe : 1
  56107. }
  56108. function i(e, t, i, n) {
  56109. se === !0 && ((e *= n), (t *= n), (i *= n)), Ye.clearColor(e, t, i, n)
  56110. }
  56111. function r() {
  56112. Ye.init(),
  56113. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  56114. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  56115. i(Se.r, Se.g, Se.b, Me)
  56116. }
  56117. function o() {
  56118. ;(Ae = null), (be = null), (Ee = ''), (Ie = -1), Ye.reset()
  56119. }
  56120. function a(e) {
  56121. e.preventDefault(), o(), r(), Xe.clear()
  56122. }
  56123. function s(e) {
  56124. var t = e.target
  56125. t.removeEventListener('dispose', s), h(t), ke.textures--
  56126. }
  56127. function l(e) {
  56128. var t = e.target
  56129. t.removeEventListener('dispose', l), u(t), ke.textures--
  56130. }
  56131. function c(e) {
  56132. var t = e.target
  56133. t.removeEventListener('dispose', c), d(t)
  56134. }
  56135. function h(e) {
  56136. var t = Xe.get(e)
  56137. if (e.image && t.__image__webglTextureCube)
  56138. Ge.deleteTexture(t.__image__webglTextureCube)
  56139. else {
  56140. if (void 0 === t.__webglInit) return
  56141. Ge.deleteTexture(t.__webglTexture)
  56142. }
  56143. Xe.delete(e)
  56144. }
  56145. function u(e) {
  56146. var t = Xe.get(e),
  56147. i = Xe.get(e.texture)
  56148. if (e && void 0 !== i.__webglTexture) {
  56149. if ((Ge.deleteTexture(i.__webglTexture), e instanceof n.WebGLRenderTargetCube))
  56150. for (var r = 0; r < 6; r++)
  56151. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  56152. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r])
  56153. else
  56154. Ge.deleteFramebuffer(t.__webglFramebuffer),
  56155. Ge.deleteRenderbuffer(t.__webglDepthbuffer)
  56156. Xe.delete(e.texture), Xe.delete(e)
  56157. }
  56158. }
  56159. function d(e) {
  56160. p(e), Xe.delete(e)
  56161. }
  56162. function p(e) {
  56163. var t = Xe.get(e).program
  56164. ;(e.program = void 0), void 0 !== t && qe.releaseProgram(t)
  56165. }
  56166. function f(e, t, i, r) {
  56167. var o
  56168. if (
  56169. i instanceof n.InstancedBufferGeometry &&
  56170. ((o = We.get('ANGLE_instanced_arrays')), null === o)
  56171. )
  56172. return void console.error(
  56173. 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  56174. )
  56175. void 0 === r && (r = 0), Ye.initAttributes()
  56176. var a = i.attributes,
  56177. s = t.getAttributes(),
  56178. l = e.defaultAttributeValues
  56179. for (var c in s) {
  56180. var h = s[c]
  56181. if (h >= 0) {
  56182. var u = a[c]
  56183. if (void 0 !== u) {
  56184. var d = u.itemSize,
  56185. p = Ze.getAttributeBuffer(u)
  56186. if (u instanceof n.InterleavedBufferAttribute) {
  56187. var f = u.data,
  56188. g = f.stride,
  56189. m = u.offset
  56190. f instanceof n.InstancedInterleavedBuffer
  56191. ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  56192. void 0 === i.maxInstancedCount &&
  56193. (i.maxInstancedCount = f.meshPerAttribute * f.count))
  56194. : Ye.enableAttribute(h),
  56195. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56196. Ge.vertexAttribPointer(
  56197. h,
  56198. d,
  56199. Ge.FLOAT,
  56200. !1,
  56201. g * f.array.BYTES_PER_ELEMENT,
  56202. (r * g + m) * f.array.BYTES_PER_ELEMENT
  56203. )
  56204. } else
  56205. u instanceof n.InstancedBufferAttribute
  56206. ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  56207. void 0 === i.maxInstancedCount &&
  56208. (i.maxInstancedCount = u.meshPerAttribute * u.count))
  56209. : Ye.enableAttribute(h),
  56210. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56211. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  56212. } else if (void 0 !== l) {
  56213. var v = l[c]
  56214. if (void 0 !== v)
  56215. switch (v.length) {
  56216. case 2:
  56217. Ge.vertexAttrib2fv(h, v)
  56218. break
  56219. case 3:
  56220. Ge.vertexAttrib3fv(h, v)
  56221. break
  56222. case 4:
  56223. Ge.vertexAttrib4fv(h, v)
  56224. break
  56225. default:
  56226. Ge.vertexAttrib1fv(h, v)
  56227. }
  56228. }
  56229. }
  56230. }
  56231. Ye.disableUnusedAttributes()
  56232. }
  56233. function g(e, t) {
  56234. return Math.abs(t[0]) - Math.abs(e[0])
  56235. }
  56236. function m(e, t) {
  56237. return e.object.renderOrder !== t.object.renderOrder
  56238. ? e.object.renderOrder - t.object.renderOrder
  56239. : e.material.id !== t.material.id
  56240. ? e.material.id - t.material.id
  56241. : e.z !== t.z
  56242. ? e.z - t.z
  56243. : e.id - t.id
  56244. }
  56245. function v(e, t) {
  56246. return e.object.renderOrder !== t.object.renderOrder
  56247. ? e.object.renderOrder - t.object.renderOrder
  56248. : e.z !== t.z
  56249. ? t.z - e.z
  56250. : e.id - t.id
  56251. }
  56252. function A(e, t, i, n, r) {
  56253. var o, a
  56254. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue))
  56255. var s = o[a]
  56256. void 0 !== s
  56257. ? ((s.id = e.id),
  56258. (s.object = e),
  56259. (s.geometry = t),
  56260. (s.material = i),
  56261. (s.z = Ve.z),
  56262. (s.group = r))
  56263. : ((s = {
  56264. id: e.id,
  56265. object: e,
  56266. geometry: t,
  56267. material: i,
  56268. z: Ve.z,
  56269. group: r
  56270. }),
  56271. o.push(s))
  56272. }
  56273. function y(e, t) {
  56274. if (e.visible !== !1) {
  56275. if (e.layers.test(t.layers))
  56276. if (e instanceof n.Light) ce.push(e)
  56277. else if (e instanceof n.Sprite)
  56278. (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) || ge.push(e)
  56279. else if (e instanceof n.LensFlare) me.push(e)
  56280. else if (e instanceof n.ImmediateRenderObject)
  56281. ve.sortObjects === !0 &&
  56282. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe)),
  56283. A(e, null, e.material, Ve.z, null)
  56284. else if (
  56285. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  56286. (e instanceof n.SkinnedMesh && e.skeleton.update(),
  56287. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  56288. ) {
  56289. var i = e.material
  56290. if (i.visible === !0) {
  56291. ve.sortObjects === !0 &&
  56292. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe))
  56293. var r = Ze.update(e)
  56294. if (i instanceof n.MultiMaterial)
  56295. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  56296. var c = o[s],
  56297. h = a[c.materialIndex]
  56298. h.visible === !0 && A(e, r, h, Ve.z, c)
  56299. }
  56300. else A(e, r, i, Ve.z, null)
  56301. }
  56302. }
  56303. for (var u = e.children, s = 0, l = u.length; s < l; s++) y(u[s], t)
  56304. }
  56305. }
  56306. function C(e, t, i, r) {
  56307. for (var o = 0, a = e.length; o < a; o++) {
  56308. var s = e[o],
  56309. l = s.object,
  56310. c = s.geometry,
  56311. h = void 0 === r ? s.material : r,
  56312. u = s.group
  56313. if (
  56314. (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  56315. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  56316. l instanceof n.ImmediateRenderObject)
  56317. ) {
  56318. E(h)
  56319. var d = w(t, i, h, l)
  56320. ;(Ee = ''),
  56321. l.render(function (e) {
  56322. ve.renderBufferImmediate(e, d, h)
  56323. })
  56324. } else ve.renderBufferDirect(t, i, c, h, l, u)
  56325. }
  56326. }
  56327. function I(e, t, i) {
  56328. var r = Xe.get(e),
  56329. o = qe.getParameters(e, Ue, t, i),
  56330. a = qe.getProgramCode(e, o),
  56331. s = r.program,
  56332. l = !0
  56333. if (void 0 === s) e.addEventListener('dispose', c)
  56334. else if (s.code !== a) p(e)
  56335. else {
  56336. if (void 0 !== o.shaderID) return
  56337. l = !1
  56338. }
  56339. if (l) {
  56340. if (o.shaderID) {
  56341. var h = n.ShaderLib[o.shaderID]
  56342. r.__webglShader = {
  56343. name: e.type,
  56344. uniforms: n.UniformsUtils.clone(h.uniforms),
  56345. vertexShader: h.vertexShader,
  56346. fragmentShader: h.fragmentShader
  56347. }
  56348. } else
  56349. r.__webglShader = {
  56350. name: e.type,
  56351. uniforms: e.uniforms,
  56352. vertexShader: e.vertexShader,
  56353. fragmentShader: e.fragmentShader
  56354. }
  56355. ;(e.__webglShader = r.__webglShader),
  56356. (s = qe.acquireProgram(e, o, a)),
  56357. (r.program = s),
  56358. (e.program = s)
  56359. }
  56360. var u = s.getAttributes()
  56361. if (e.morphTargets) {
  56362. e.numSupportedMorphTargets = 0
  56363. for (var d = 0; d < ve.maxMorphTargets; d++)
  56364. u['morphTarget' + d] >= 0 && e.numSupportedMorphTargets++
  56365. }
  56366. if (e.morphNormals) {
  56367. e.numSupportedMorphNormals = 0
  56368. for (var d = 0; d < ve.maxMorphNormals; d++)
  56369. u['morphNormal' + d] >= 0 && e.numSupportedMorphNormals++
  56370. }
  56371. r.uniformsList = []
  56372. var f = r.__webglShader.uniforms,
  56373. g = r.program.getUniforms()
  56374. for (var m in f) {
  56375. var v = g[m]
  56376. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  56377. }
  56378. ;(e instanceof n.MeshPhongMaterial ||
  56379. e instanceof n.MeshLambertMaterial ||
  56380. e instanceof n.MeshStandardMaterial ||
  56381. e.lights) &&
  56382. ((r.lightsHash = Ue.hash),
  56383. (f.ambientLightColor.value = Ue.ambient),
  56384. (f.directionalLights.value = Ue.directional),
  56385. (f.spotLights.value = Ue.spot),
  56386. (f.pointLights.value = Ue.point),
  56387. (f.hemisphereLights.value = Ue.hemi),
  56388. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  56389. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  56390. (f.spotShadowMap.value = Ue.spotShadowMap),
  56391. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  56392. (f.pointShadowMap.value = Ue.pointShadowMap),
  56393. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  56394. (r.hasDynamicUniforms = !1)
  56395. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  56396. var C = r.uniformsList[A][0]
  56397. if (C.dynamic === !0) {
  56398. r.hasDynamicUniforms = !0
  56399. break
  56400. }
  56401. }
  56402. }
  56403. function E(e) {
  56404. b(e),
  56405. e.transparent === !0
  56406. ? Ye.setBlending(
  56407. e.blending,
  56408. e.blendEquation,
  56409. e.blendSrc,
  56410. e.blendDst,
  56411. e.blendEquationAlpha,
  56412. e.blendSrcAlpha,
  56413. e.blendDstAlpha,
  56414. e.premultipliedAlpha
  56415. )
  56416. : Ye.setBlending(n.NoBlending),
  56417. Ye.setDepthFunc(e.depthFunc),
  56418. Ye.setDepthTest(e.depthTest),
  56419. Ye.setDepthWrite(e.depthWrite),
  56420. Ye.setColorWrite(e.colorWrite),
  56421. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  56422. }
  56423. function b(e) {
  56424. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  56425. Ye.setFlipSided(e.side === n.BackSide)
  56426. }
  56427. function w(e, t, i, r) {
  56428. xe = 0
  56429. var o = Xe.get(i)
  56430. void 0 === o.program && (i.needsUpdate = !0),
  56431. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  56432. i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1))
  56433. var a = !1,
  56434. s = !1,
  56435. l = !1,
  56436. c = o.program,
  56437. h = c.getUniforms(),
  56438. u = o.__webglShader.uniforms
  56439. if (
  56440. (c.id !== Ae &&
  56441. (Ge.useProgram(c.program), (Ae = c.id), (a = !0), (s = !0), (l = !0)),
  56442. i.id !== Ie && ((Ie = i.id), (s = !0)),
  56443. (a || e !== be) &&
  56444. (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  56445. je.logarithmicDepthBuffer &&
  56446. Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  56447. e !== be && ((be = e), (s = !0), (l = !0)),
  56448. (i instanceof n.ShaderMaterial ||
  56449. i instanceof n.MeshPhongMaterial ||
  56450. i instanceof n.MeshStandardMaterial ||
  56451. i.envMap) &&
  56452. void 0 !== h.cameraPosition &&
  56453. (Ve.setFromMatrixPosition(e.matrixWorld),
  56454. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  56455. (i instanceof n.MeshPhongMaterial ||
  56456. i instanceof n.MeshLambertMaterial ||
  56457. i instanceof n.MeshBasicMaterial ||
  56458. i instanceof n.MeshStandardMaterial ||
  56459. i instanceof n.ShaderMaterial ||
  56460. i.skinning) &&
  56461. void 0 !== h.viewMatrix &&
  56462. Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  56463. void 0 !== h.toneMappingExposure &&
  56464. Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  56465. void 0 !== h.toneMappingWhitePoint &&
  56466. Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  56467. i.skinning)
  56468. )
  56469. if (
  56470. (r.bindMatrix &&
  56471. void 0 !== h.bindMatrix &&
  56472. Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  56473. r.bindMatrixInverse &&
  56474. void 0 !== h.bindMatrixInverse &&
  56475. Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  56476. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture)
  56477. ) {
  56478. if (void 0 !== h.boneTexture) {
  56479. var d = B()
  56480. Ge.uniform1i(h.boneTexture, d), ve.setTexture(r.skeleton.boneTexture, d)
  56481. }
  56482. void 0 !== h.boneTextureWidth &&
  56483. Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  56484. void 0 !== h.boneTextureHeight &&
  56485. Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  56486. } else
  56487. r.skeleton &&
  56488. r.skeleton.boneMatrices &&
  56489. void 0 !== h.boneGlobalMatrices &&
  56490. Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices)
  56491. return (
  56492. s &&
  56493. ((i instanceof n.MeshPhongMaterial ||
  56494. i instanceof n.MeshLambertMaterial ||
  56495. i instanceof n.MeshStandardMaterial ||
  56496. i.lights) &&
  56497. D(u, l),
  56498. t && i.fog && R(u, t),
  56499. (i instanceof n.MeshBasicMaterial ||
  56500. i instanceof n.MeshLambertMaterial ||
  56501. i instanceof n.MeshPhongMaterial ||
  56502. i instanceof n.MeshStandardMaterial) &&
  56503. T(u, i),
  56504. i instanceof n.LineBasicMaterial
  56505. ? x(u, i)
  56506. : i instanceof n.LineDashedMaterial
  56507. ? (x(u, i), S(u, i))
  56508. : i instanceof n.PointsMaterial
  56509. ? M(u, i)
  56510. : i instanceof n.MeshLambertMaterial
  56511. ? P(u, i)
  56512. : i instanceof n.MeshPhongMaterial
  56513. ? O(u, i)
  56514. : i instanceof n.MeshStandardMaterial
  56515. ? L(u, i)
  56516. : i instanceof n.MeshDepthMaterial
  56517. ? ((u.mNear.value = e.near),
  56518. (u.mFar.value = e.far),
  56519. (u.opacity.value = i.opacity))
  56520. : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  56521. V(o.uniformsList)),
  56522. N(h, r),
  56523. void 0 !== h.modelMatrix &&
  56524. Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  56525. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  56526. c
  56527. )
  56528. }
  56529. function _(e, t, i) {
  56530. for (var n = [], r = 0, o = e.length; r < o; r++) {
  56531. var a = e[r][0],
  56532. s = a.onUpdateCallback
  56533. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]))
  56534. }
  56535. V(n)
  56536. }
  56537. function T(e, t) {
  56538. ;(e.opacity.value = t.opacity),
  56539. (e.diffuse.value = t.color),
  56540. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  56541. (e.map.value = t.map),
  56542. (e.specularMap.value = t.specularMap),
  56543. (e.alphaMap.value = t.alphaMap),
  56544. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity))
  56545. var i
  56546. if (
  56547. (t.map
  56548. ? (i = t.map)
  56549. : t.specularMap
  56550. ? (i = t.specularMap)
  56551. : t.displacementMap
  56552. ? (i = t.displacementMap)
  56553. : t.normalMap
  56554. ? (i = t.normalMap)
  56555. : t.bumpMap
  56556. ? (i = t.bumpMap)
  56557. : t.roughnessMap
  56558. ? (i = t.roughnessMap)
  56559. : t.metalnessMap
  56560. ? (i = t.metalnessMap)
  56561. : t.alphaMap
  56562. ? (i = t.alphaMap)
  56563. : t.emissiveMap && (i = t.emissiveMap),
  56564. void 0 !== i)
  56565. ) {
  56566. i instanceof n.WebGLRenderTarget && (i = i.texture)
  56567. var r = i.offset,
  56568. o = i.repeat
  56569. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  56570. }
  56571. ;(e.envMap.value = t.envMap),
  56572. (e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  56573. (e.reflectivity.value = t.reflectivity),
  56574. (e.refractionRatio.value = t.refractionRatio)
  56575. }
  56576. function x(e, t) {
  56577. ;(e.diffuse.value = t.color), (e.opacity.value = t.opacity)
  56578. }
  56579. function S(e, t) {
  56580. ;(e.dashSize.value = t.dashSize),
  56581. (e.totalSize.value = t.dashSize + t.gapSize),
  56582. (e.scale.value = t.scale)
  56583. }
  56584. function M(e, t) {
  56585. if (
  56586. ((e.diffuse.value = t.color),
  56587. (e.opacity.value = t.opacity),
  56588. (e.size.value = t.size * Oe),
  56589. (e.scale.value = te.clientHeight / 2),
  56590. (e.map.value = t.map),
  56591. null !== t.map)
  56592. ) {
  56593. var i = t.map.offset,
  56594. n = t.map.repeat
  56595. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  56596. }
  56597. }
  56598. function R(e, t) {
  56599. ;(e.fogColor.value = t.color),
  56600. t instanceof n.Fog
  56601. ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far))
  56602. : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  56603. }
  56604. function P(e, t) {
  56605. t.lightMap &&
  56606. ((e.lightMap.value = t.lightMap),
  56607. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56608. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  56609. }
  56610. function O(e, t) {
  56611. ;(e.specular.value = t.specular),
  56612. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  56613. t.lightMap &&
  56614. ((e.lightMap.value = t.lightMap),
  56615. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56616. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56617. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56618. t.normalMap &&
  56619. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56620. t.displacementMap &&
  56621. ((e.displacementMap.value = t.displacementMap),
  56622. (e.displacementScale.value = t.displacementScale),
  56623. (e.displacementBias.value = t.displacementBias))
  56624. }
  56625. function L(e, t) {
  56626. ;(e.roughness.value = t.roughness),
  56627. (e.metalness.value = t.metalness),
  56628. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  56629. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  56630. t.lightMap &&
  56631. ((e.lightMap.value = t.lightMap),
  56632. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56633. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56634. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56635. t.normalMap &&
  56636. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56637. t.displacementMap &&
  56638. ((e.displacementMap.value = t.displacementMap),
  56639. (e.displacementScale.value = t.displacementScale),
  56640. (e.displacementBias.value = t.displacementBias)),
  56641. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  56642. }
  56643. function D(e, t) {
  56644. ;(e.ambientLightColor.needsUpdate = t),
  56645. (e.directionalLights.needsUpdate = t),
  56646. (e.pointLights.needsUpdate = t),
  56647. (e.spotLights.needsUpdate = t),
  56648. (e.hemisphereLights.needsUpdate = t)
  56649. }
  56650. function N(e, t) {
  56651. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  56652. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  56653. }
  56654. function B() {
  56655. var e = xe
  56656. return (
  56657. e >= je.maxTextures &&
  56658. console.warn(
  56659. 'WebGLRenderer: trying to use ' +
  56660. e +
  56661. ' texture units while this GPU supports only ' +
  56662. je.maxTextures
  56663. ),
  56664. (xe += 1),
  56665. e
  56666. )
  56667. }
  56668. function F(e, t, i, r) {
  56669. var o, a
  56670. if ('1i' === t) Ge.uniform1i(i, r)
  56671. else if ('1f' === t) Ge.uniform1f(i, r)
  56672. else if ('2f' === t) Ge.uniform2f(i, r[0], r[1])
  56673. else if ('3f' === t) Ge.uniform3f(i, r[0], r[1], r[2])
  56674. else if ('4f' === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3])
  56675. else if ('1iv' === t) Ge.uniform1iv(i, r)
  56676. else if ('3iv' === t) Ge.uniform3iv(i, r)
  56677. else if ('1fv' === t) Ge.uniform1fv(i, r)
  56678. else if ('2fv' === t) Ge.uniform2fv(i, r)
  56679. else if ('3fv' === t) Ge.uniform3fv(i, r)
  56680. else if ('4fv' === t) Ge.uniform4fv(i, r)
  56681. else if ('Matrix2fv' === t) Ge.uniformMatrix2fv(i, !1, r)
  56682. else if ('Matrix3fv' === t) Ge.uniformMatrix3fv(i, !1, r)
  56683. else if ('Matrix4fv' === t) Ge.uniformMatrix4fv(i, !1, r)
  56684. else if ('i' === t) Ge.uniform1i(i, r)
  56685. else if ('f' === t) Ge.uniform1f(i, r)
  56686. else if ('v2' === t) Ge.uniform2f(i, r.x, r.y)
  56687. else if ('v3' === t) Ge.uniform3f(i, r.x, r.y, r.z)
  56688. else if ('v4' === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w)
  56689. else if ('c' === t) Ge.uniform3f(i, r.r, r.g, r.b)
  56690. else if ('s' === t) {
  56691. var s = e.properties
  56692. for (var l in s) {
  56693. var c = s[l],
  56694. h = i[l],
  56695. u = r[l]
  56696. F(c, c.type, h, u)
  56697. }
  56698. } else if ('sa' === t)
  56699. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  56700. for (var l in s) {
  56701. var c = s[l],
  56702. h = i[d][l],
  56703. u = r[d][l]
  56704. F(c, c.type, h, u)
  56705. }
  56706. else if ('iv1' === t) Ge.uniform1iv(i, r)
  56707. else if ('iv' === t) Ge.uniform3iv(i, r)
  56708. else if ('fv1' === t) Ge.uniform1fv(i, r)
  56709. else if ('fv' === t) Ge.uniform3fv(i, r)
  56710. else if ('v2v' === t) {
  56711. void 0 === e._array && (e._array = new Float32Array(2 * r.length))
  56712. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2)
  56713. (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y)
  56714. Ge.uniform2fv(i, e._array)
  56715. } else if ('v3v' === t) {
  56716. void 0 === e._array && (e._array = new Float32Array(3 * r.length))
  56717. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3)
  56718. (e._array[m + 0] = r[d].x), (e._array[m + 1] = r[d].y), (e._array[m + 2] = r[d].z)
  56719. Ge.uniform3fv(i, e._array)
  56720. } else if ('v4v' === t) {
  56721. void 0 === e._array && (e._array = new Float32Array(4 * r.length))
  56722. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4)
  56723. (e._array[v + 0] = r[d].x),
  56724. (e._array[v + 1] = r[d].y),
  56725. (e._array[v + 2] = r[d].z),
  56726. (e._array[v + 3] = r[d].w)
  56727. Ge.uniform4fv(i, e._array)
  56728. } else if ('m2' === t) Ge.uniformMatrix2fv(i, !1, r.elements)
  56729. else if ('m3' === t) Ge.uniformMatrix3fv(i, !1, r.elements)
  56730. else if ('m3v' === t) {
  56731. void 0 === e._array && (e._array = new Float32Array(9 * r.length))
  56732. for (var d = 0, g = r.length; d < g; d++) r[d].flattenToArrayOffset(e._array, 9 * d)
  56733. Ge.uniformMatrix3fv(i, !1, e._array)
  56734. } else if ('m4' === t) Ge.uniformMatrix4fv(i, !1, r.elements)
  56735. else if ('m4v' === t) {
  56736. void 0 === e._array && (e._array = new Float32Array(16 * r.length))
  56737. for (var d = 0, g = r.length; d < g; d++)
  56738. r[d].flattenToArrayOffset(e._array, 16 * d)
  56739. Ge.uniformMatrix4fv(i, !1, e._array)
  56740. } else if ('t' === t) {
  56741. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return
  56742. o instanceof n.CubeTexture || (Array.isArray(o.image) && 6 === o.image.length)
  56743. ? Y(o, a)
  56744. : o instanceof n.WebGLRenderTargetCube
  56745. ? X(o.texture, a)
  56746. : o instanceof n.WebGLRenderTarget
  56747. ? ve.setTexture(o.texture, a)
  56748. : ve.setTexture(o, a)
  56749. } else if ('tv' === t) {
  56750. void 0 === e._array && (e._array = [])
  56751. for (var d = 0, g = e.value.length; d < g; d++) e._array[d] = B()
  56752. Ge.uniform1iv(i, e._array)
  56753. for (var d = 0, g = e.value.length; d < g; d++)
  56754. (o = e.value[d]),
  56755. (a = e._array[d]),
  56756. o &&
  56757. (o instanceof n.CubeTexture ||
  56758. (o.image instanceof Array && 6 === o.image.length)
  56759. ? Y(o, a)
  56760. : o instanceof n.WebGLRenderTarget
  56761. ? ve.setTexture(o.texture, a)
  56762. : o instanceof n.WebGLRenderTargetCube
  56763. ? X(o.texture, a)
  56764. : ve.setTexture(o, a))
  56765. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t)
  56766. }
  56767. function V(e) {
  56768. for (var t = 0, i = e.length; t < i; t++) {
  56769. var n = e[t][0]
  56770. if (n.needsUpdate !== !1) {
  56771. var r = n.type,
  56772. o = e[t][1],
  56773. a = n.value
  56774. F(n, r, o, a)
  56775. }
  56776. }
  56777. }
  56778. function U(e, t) {
  56779. var i,
  56780. r,
  56781. o,
  56782. a,
  56783. s,
  56784. l,
  56785. c = 0,
  56786. h = 0,
  56787. u = 0,
  56788. d = t.matrixWorldInverse,
  56789. p = 0,
  56790. f = 0,
  56791. g = 0,
  56792. m = 0,
  56793. v = 0
  56794. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  56795. if (
  56796. ((o = e[i]),
  56797. (a = o.color),
  56798. (s = o.intensity),
  56799. (l = o.distance),
  56800. o instanceof n.AmbientLight)
  56801. )
  56802. (c += a.r * s), (h += a.g * s), (u += a.b * s)
  56803. else if (o instanceof n.DirectionalLight) {
  56804. var A = Ke.get(o)
  56805. A.color.copy(o.color).multiplyScalar(o.intensity),
  56806. A.direction.setFromMatrixPosition(o.matrixWorld),
  56807. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56808. A.direction.sub(Ve),
  56809. A.direction.transformDirection(d),
  56810. (A.shadow = o.castShadow),
  56811. o.castShadow &&
  56812. ((A.shadowBias = o.shadow.bias),
  56813. (A.shadowRadius = o.shadow.radius),
  56814. (A.shadowMapSize = o.shadow.mapSize),
  56815. (Ue.shadows[v++] = o)),
  56816. (Ue.directionalShadowMap[p] = o.shadow.map),
  56817. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  56818. (Ue.directional[p++] = A)
  56819. } else if (o instanceof n.SpotLight) {
  56820. var A = Ke.get(o)
  56821. A.position.setFromMatrixPosition(o.matrixWorld),
  56822. A.position.applyMatrix4(d),
  56823. A.color.copy(a).multiplyScalar(s),
  56824. (A.distance = l),
  56825. A.direction.setFromMatrixPosition(o.matrixWorld),
  56826. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56827. A.direction.sub(Ve),
  56828. A.direction.transformDirection(d),
  56829. (A.coneCos = Math.cos(o.angle)),
  56830. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  56831. (A.decay = 0 === o.distance ? 0 : o.decay),
  56832. (A.shadow = o.castShadow),
  56833. o.castShadow &&
  56834. ((A.shadowBias = o.shadow.bias),
  56835. (A.shadowRadius = o.shadow.radius),
  56836. (A.shadowMapSize = o.shadow.mapSize),
  56837. (Ue.shadows[v++] = o)),
  56838. (Ue.spotShadowMap[g] = o.shadow.map),
  56839. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  56840. (Ue.spot[g++] = A)
  56841. } else if (o instanceof n.PointLight) {
  56842. var A = Ke.get(o)
  56843. A.position.setFromMatrixPosition(o.matrixWorld),
  56844. A.position.applyMatrix4(d),
  56845. A.color.copy(o.color).multiplyScalar(o.intensity),
  56846. (A.distance = o.distance),
  56847. (A.decay = 0 === o.distance ? 0 : o.decay),
  56848. (A.shadow = o.castShadow),
  56849. o.castShadow &&
  56850. ((A.shadowBias = o.shadow.bias),
  56851. (A.shadowRadius = o.shadow.radius),
  56852. (A.shadowMapSize = o.shadow.mapSize),
  56853. (Ue.shadows[v++] = o)),
  56854. (Ue.pointShadowMap[f] = o.shadow.map),
  56855. void 0 === Ue.pointShadowMatrix[f] &&
  56856. (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  56857. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  56858. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  56859. (Ue.point[f++] = A)
  56860. } else if (o instanceof n.HemisphereLight) {
  56861. var A = Ke.get(o)
  56862. A.direction.setFromMatrixPosition(o.matrixWorld),
  56863. A.direction.transformDirection(d),
  56864. A.direction.normalize(),
  56865. A.skyColor.copy(o.color).multiplyScalar(s),
  56866. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  56867. (Ue.hemi[m++] = A)
  56868. }
  56869. ;(Ue.ambient[0] = c),
  56870. (Ue.ambient[1] = h),
  56871. (Ue.ambient[2] = u),
  56872. (Ue.directional.length = p),
  56873. (Ue.spot.length = g),
  56874. (Ue.point.length = f),
  56875. (Ue.hemi.length = m),
  56876. (Ue.shadows.length = v),
  56877. (Ue.hash = p + ',' + f + ',' + g + ',' + m + ',' + v)
  56878. }
  56879. function k(e, t, i) {
  56880. var r
  56881. if (
  56882. (i
  56883. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  56884. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  56885. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  56886. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  56887. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  56888. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  56889. (t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping) ||
  56890. console.warn(
  56891. 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.',
  56892. t
  56893. ),
  56894. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  56895. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  56896. t.minFilter !== n.NearestFilter &&
  56897. t.minFilter !== n.LinearFilter &&
  56898. console.warn(
  56899. 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.',
  56900. t
  56901. )),
  56902. (r = We.get('EXT_texture_filter_anisotropic')))
  56903. ) {
  56904. if (t.type === n.FloatType && null === We.get('OES_texture_float_linear')) return
  56905. if (t.type === n.HalfFloatType && null === We.get('OES_texture_half_float_linear'))
  56906. return
  56907. ;(t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  56908. (Ge.texParameterf(
  56909. e,
  56910. r.TEXTURE_MAX_ANISOTROPY_EXT,
  56911. Math.min(t.anisotropy, ve.getMaxAnisotropy())
  56912. ),
  56913. (Xe.get(t).__currentAnisotropy = t.anisotropy))
  56914. }
  56915. }
  56916. function H(e, t, i) {
  56917. void 0 === e.__webglInit &&
  56918. ((e.__webglInit = !0),
  56919. t.addEventListener('dispose', s),
  56920. (e.__webglTexture = Ge.createTexture()),
  56921. ke.textures++),
  56922. Ye.activeTexture(Ge.TEXTURE0 + i),
  56923. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  56924. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  56925. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  56926. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment)
  56927. var r = G(t.image, je.maxTextureSize)
  56928. W(t) && z(r) === !1 && (r = j(r))
  56929. var o = z(r),
  56930. a = ee(t.format),
  56931. l = ee(t.type)
  56932. k(Ge.TEXTURE_2D, t, o)
  56933. var c,
  56934. h = t.mipmaps
  56935. if (t instanceof n.DataTexture)
  56936. if (h.length > 0 && o) {
  56937. for (var u = 0, d = h.length; u < d; u++)
  56938. (c = h[u]),
  56939. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  56940. t.generateMipmaps = !1
  56941. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data)
  56942. else if (t instanceof n.CompressedTexture)
  56943. for (var u = 0, d = h.length; u < d; u++)
  56944. (c = h[u]),
  56945. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  56946. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  56947. ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data)
  56948. : console.warn(
  56949. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()'
  56950. )
  56951. : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  56952. else if (h.length > 0 && o) {
  56953. for (var u = 0, d = h.length; u < d; u++)
  56954. (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c)
  56955. t.generateMipmaps = !1
  56956. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r)
  56957. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  56958. (e.__version = t.version),
  56959. t.onUpdate && t.onUpdate(t)
  56960. }
  56961. function G(e, t) {
  56962. if (e.width > t || e.height > t) {
  56963. var i = t / Math.max(e.width, e.height),
  56964. n = document.createElement('canvas')
  56965. ;(n.width = Math.floor(e.width * i)), (n.height = Math.floor(e.height * i))
  56966. var r = n.getContext('2d')
  56967. return (
  56968. r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  56969. console.warn(
  56970. 'THREE.WebGLRenderer: image is too big (' +
  56971. e.width +
  56972. 'x' +
  56973. e.height +
  56974. '). Resized to ' +
  56975. n.width +
  56976. 'x' +
  56977. n.height,
  56978. e
  56979. ),
  56980. n
  56981. )
  56982. }
  56983. return e
  56984. }
  56985. function z(e) {
  56986. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  56987. }
  56988. function W(e) {
  56989. return (
  56990. e.wrapS !== n.ClampToEdgeWrapping ||
  56991. e.wrapT !== n.ClampToEdgeWrapping ||
  56992. (e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter)
  56993. )
  56994. }
  56995. function j(e) {
  56996. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  56997. var t = document.createElement('canvas')
  56998. ;(t.width = n.Math.nearestPowerOfTwo(e.width)),
  56999. (t.height = n.Math.nearestPowerOfTwo(e.height))
  57000. var i = t.getContext('2d')
  57001. return (
  57002. i.drawImage(e, 0, 0, t.width, t.height),
  57003. console.warn(
  57004. 'THREE.WebGLRenderer: image is not power of two (' +
  57005. e.width +
  57006. 'x' +
  57007. e.height +
  57008. '). Resized to ' +
  57009. t.width +
  57010. 'x' +
  57011. t.height,
  57012. e
  57013. ),
  57014. t
  57015. )
  57016. }
  57017. return e
  57018. }
  57019. function Y(e, t) {
  57020. var i = Xe.get(e)
  57021. if (6 === e.image.length)
  57022. if (e.version > 0 && i.__version !== e.version) {
  57023. i.__image__webglTextureCube ||
  57024. (e.addEventListener('dispose', s),
  57025. (i.__image__webglTextureCube = Ge.createTexture()),
  57026. ke.textures++),
  57027. Ye.activeTexture(Ge.TEXTURE0 + t),
  57028. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  57029. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY)
  57030. for (
  57031. var r = e instanceof n.CompressedTexture,
  57032. o = e.image[0] instanceof n.DataTexture,
  57033. a = [],
  57034. l = 0;
  57035. l < 6;
  57036. l++
  57037. )
  57038. !ve.autoScaleCubemaps || r || o
  57039. ? (a[l] = o ? e.image[l].image : e.image[l])
  57040. : (a[l] = G(e.image[l], je.maxCubemapSize))
  57041. var c = a[0],
  57042. h = z(c),
  57043. u = ee(e.format),
  57044. d = ee(e.type)
  57045. k(Ge.TEXTURE_CUBE_MAP, e, h)
  57046. for (var l = 0; l < 6; l++)
  57047. if (r)
  57048. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  57049. (p = f[g]),
  57050. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  57051. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  57052. ? Ye.compressedTexImage2D(
  57053. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  57054. g,
  57055. u,
  57056. p.width,
  57057. p.height,
  57058. 0,
  57059. p.data
  57060. )
  57061. : console.warn(
  57062. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()'
  57063. )
  57064. : Ye.texImage2D(
  57065. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  57066. g,
  57067. u,
  57068. p.width,
  57069. p.height,
  57070. 0,
  57071. u,
  57072. d,
  57073. p.data
  57074. )
  57075. else
  57076. o
  57077. ? Ye.texImage2D(
  57078. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  57079. 0,
  57080. u,
  57081. a[l].width,
  57082. a[l].height,
  57083. 0,
  57084. u,
  57085. d,
  57086. a[l].data
  57087. )
  57088. : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l])
  57089. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  57090. (i.__version = e.version),
  57091. e.onUpdate && e.onUpdate(e)
  57092. } else
  57093. Ye.activeTexture(Ge.TEXTURE0 + t),
  57094. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  57095. }
  57096. function X(e, t) {
  57097. Ye.activeTexture(Ge.TEXTURE0 + t),
  57098. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  57099. }
  57100. function Z(e, t, i, n) {
  57101. var r = ee(t.texture.format),
  57102. o = ee(t.texture.type)
  57103. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  57104. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  57105. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  57106. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  57107. }
  57108. function q(e, t) {
  57109. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  57110. t.depthBuffer && !t.stencilBuffer
  57111. ? (Ge.renderbufferStorage(
  57112. Ge.RENDERBUFFER,
  57113. Ge.DEPTH_COMPONENT16,
  57114. t.width,
  57115. t.height
  57116. ),
  57117. Ge.framebufferRenderbuffer(
  57118. Ge.FRAMEBUFFER,
  57119. Ge.DEPTH_ATTACHMENT,
  57120. Ge.RENDERBUFFER,
  57121. e
  57122. ))
  57123. : t.depthBuffer && t.stencilBuffer
  57124. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  57125. Ge.framebufferRenderbuffer(
  57126. Ge.FRAMEBUFFER,
  57127. Ge.DEPTH_STENCIL_ATTACHMENT,
  57128. Ge.RENDERBUFFER,
  57129. e
  57130. ))
  57131. : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  57132. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  57133. }
  57134. function K(e) {
  57135. var t = Xe.get(e),
  57136. i = e instanceof n.WebGLRenderTargetCube
  57137. if (i) {
  57138. t.__webglDepthbuffer = []
  57139. for (var r = 0; r < 6; r++)
  57140. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  57141. (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()),
  57142. q(t.__webglDepthbuffer[r], e)
  57143. } else
  57144. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  57145. (t.__webglDepthbuffer = Ge.createRenderbuffer()),
  57146. q(t.__webglDepthbuffer, e)
  57147. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  57148. }
  57149. function Q(e) {
  57150. var t = Xe.get(e),
  57151. i = Xe.get(e.texture)
  57152. e.addEventListener('dispose', l),
  57153. (i.__webglTexture = Ge.createTexture()),
  57154. ke.textures++
  57155. var r = e instanceof n.WebGLRenderTargetCube,
  57156. o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  57157. if (r) {
  57158. t.__webglFramebuffer = []
  57159. for (var a = 0; a < 6; a++) t.__webglFramebuffer[a] = Ge.createFramebuffer()
  57160. } else t.__webglFramebuffer = Ge.createFramebuffer()
  57161. if (r) {
  57162. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  57163. k(Ge.TEXTURE_CUBE_MAP, e.texture, o)
  57164. for (var a = 0; a < 6; a++)
  57165. Z(
  57166. t.__webglFramebuffer[a],
  57167. e,
  57168. Ge.COLOR_ATTACHMENT0,
  57169. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a
  57170. )
  57171. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  57172. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  57173. } else
  57174. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  57175. k(Ge.TEXTURE_2D, e.texture, o),
  57176. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  57177. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  57178. Ye.bindTexture(Ge.TEXTURE_2D, null)
  57179. e.depthBuffer && K(e)
  57180. }
  57181. function J(e) {
  57182. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D,
  57183. i = Xe.get(e.texture).__webglTexture
  57184. Ye.bindTexture(t, i), Ge.generateMipmap(t), Ye.bindTexture(t, null)
  57185. }
  57186. function $(e) {
  57187. return e === n.NearestFilter ||
  57188. e === n.NearestMipMapNearestFilter ||
  57189. e === n.NearestMipMapLinearFilter
  57190. ? Ge.NEAREST
  57191. : Ge.LINEAR
  57192. }
  57193. function ee(e) {
  57194. var t
  57195. if (e === n.RepeatWrapping) return Ge.REPEAT
  57196. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE
  57197. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT
  57198. if (e === n.NearestFilter) return Ge.NEAREST
  57199. if (e === n.NearestMipMapNearestFilter) return Ge.NEAREST_MIPMAP_NEAREST
  57200. if (e === n.NearestMipMapLinearFilter) return Ge.NEAREST_MIPMAP_LINEAR
  57201. if (e === n.LinearFilter) return Ge.LINEAR
  57202. if (e === n.LinearMipMapNearestFilter) return Ge.LINEAR_MIPMAP_NEAREST
  57203. if (e === n.LinearMipMapLinearFilter) return Ge.LINEAR_MIPMAP_LINEAR
  57204. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE
  57205. if (e === n.UnsignedShort4444Type) return Ge.UNSIGNED_SHORT_4_4_4_4
  57206. if (e === n.UnsignedShort5551Type) return Ge.UNSIGNED_SHORT_5_5_5_1
  57207. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5
  57208. if (e === n.ByteType) return Ge.BYTE
  57209. if (e === n.ShortType) return Ge.SHORT
  57210. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT
  57211. if (e === n.IntType) return Ge.INT
  57212. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT
  57213. if (e === n.FloatType) return Ge.FLOAT
  57214. if (((t = We.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  57215. return t.HALF_FLOAT_OES
  57216. if (e === n.AlphaFormat) return Ge.ALPHA
  57217. if (e === n.RGBFormat) return Ge.RGB
  57218. if (e === n.RGBAFormat) return Ge.RGBA
  57219. if (e === n.LuminanceFormat) return Ge.LUMINANCE
  57220. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA
  57221. if (e === n.AddEquation) return Ge.FUNC_ADD
  57222. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT
  57223. if (e === n.ReverseSubtractEquation) return Ge.FUNC_REVERSE_SUBTRACT
  57224. if (e === n.ZeroFactor) return Ge.ZERO
  57225. if (e === n.OneFactor) return Ge.ONE
  57226. if (e === n.SrcColorFactor) return Ge.SRC_COLOR
  57227. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR
  57228. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA
  57229. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA
  57230. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA
  57231. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA
  57232. if (e === n.DstColorFactor) return Ge.DST_COLOR
  57233. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR
  57234. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE
  57235. if (((t = We.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  57236. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  57237. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  57238. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  57239. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  57240. }
  57241. if (((t = We.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  57242. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  57243. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  57244. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  57245. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  57246. }
  57247. if (
  57248. ((t = We.get('WEBGL_compressed_texture_etc1')),
  57249. null !== t && e === n.RGB_ETC1_Format)
  57250. )
  57251. return t.COMPRESSED_RGB_ETC1_WEBGL
  57252. if (((t = We.get('EXT_blend_minmax')), null !== t)) {
  57253. if (e === n.MinEquation) return t.MIN_EXT
  57254. if (e === n.MaxEquation) return t.MAX_EXT
  57255. }
  57256. return 0
  57257. }
  57258. console.log('THREE.WebGLRenderer', n.REVISION), (e = e || {})
  57259. var te = void 0 !== e.canvas ? e.canvas : document.createElement('canvas'),
  57260. ie = void 0 !== e.context ? e.context : null,
  57261. ne = void 0 !== e.alpha && e.alpha,
  57262. re = void 0 === e.depth || e.depth,
  57263. oe = void 0 === e.stencil || e.stencil,
  57264. ae = void 0 !== e.antialias && e.antialias,
  57265. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  57266. le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  57267. ce = [],
  57268. he = [],
  57269. ue = -1,
  57270. de = [],
  57271. pe = -1,
  57272. fe = new Float32Array(8),
  57273. ge = [],
  57274. me = []
  57275. ;(this.domElement = te),
  57276. (this.context = null),
  57277. (this.autoClear = !0),
  57278. (this.autoClearColor = !0),
  57279. (this.autoClearDepth = !0),
  57280. (this.autoClearStencil = !0),
  57281. (this.sortObjects = !0),
  57282. (this.gammaFactor = 2),
  57283. (this.gammaInput = !1),
  57284. (this.gammaOutput = !1),
  57285. (this.physicallyCorrectLights = !1),
  57286. (this.toneMapping = n.LinearToneMapping),
  57287. (this.toneMappingExposure = 1),
  57288. (this.toneMappingWhitePoint = 1),
  57289. (this.maxMorphTargets = 8),
  57290. (this.maxMorphNormals = 4),
  57291. (this.autoScaleCubemaps = !0)
  57292. var ve = this,
  57293. Ae = null,
  57294. ye = null,
  57295. Ce = null,
  57296. Ie = -1,
  57297. Ee = '',
  57298. be = null,
  57299. we = new n.Vector4(),
  57300. _e = null,
  57301. Te = new n.Vector4(),
  57302. xe = 0,
  57303. Se = new n.Color(0),
  57304. Me = 0,
  57305. Re = te.width,
  57306. Pe = te.height,
  57307. Oe = 1,
  57308. Le = new n.Vector4(0, 0, Re, Pe),
  57309. De = !1,
  57310. Ne = new n.Vector4(0, 0, Re, Pe),
  57311. Be = new n.Frustum(),
  57312. Fe = new n.Matrix4(),
  57313. Ve = new n.Vector3(),
  57314. Ue = {
  57315. hash: '',
  57316. ambient: [0, 0, 0],
  57317. directional: [],
  57318. directionalShadowMap: [],
  57319. directionalShadowMatrix: [],
  57320. spot: [],
  57321. spotShadowMap: [],
  57322. spotShadowMatrix: [],
  57323. point: [],
  57324. pointShadowMap: [],
  57325. pointShadowMatrix: [],
  57326. hemi: [],
  57327. shadows: [],
  57328. shadowsPointLight: 0
  57329. },
  57330. ke = {
  57331. geometries: 0,
  57332. textures: 0
  57333. },
  57334. He = {
  57335. calls: 0,
  57336. vertices: 0,
  57337. faces: 0,
  57338. points: 0
  57339. }
  57340. this.info = {
  57341. render: He,
  57342. memory: ke,
  57343. programs: null
  57344. }
  57345. var Ge
  57346. try {
  57347. var ze = {
  57348. alpha: ne,
  57349. depth: re,
  57350. stencil: oe,
  57351. antialias: ae,
  57352. premultipliedAlpha: se,
  57353. preserveDrawingBuffer: le
  57354. }
  57355. if (
  57356. ((Ge = ie || te.getContext('webgl', ze) || te.getContext('experimental-webgl', ze)),
  57357. null === Ge)
  57358. )
  57359. throw null !== te.getContext('webgl')
  57360. ? 'Error creating WebGL context with your selected attributes.'
  57361. : 'Error creating WebGL context.'
  57362. void 0 === Ge.getShaderPrecisionFormat &&
  57363. (Ge.getShaderPrecisionFormat = function () {
  57364. return {
  57365. rangeMin: 1,
  57366. rangeMax: 1,
  57367. precision: 1
  57368. }
  57369. }),
  57370. te.addEventListener('webglcontextlost', a, !1)
  57371. } catch (e) {
  57372. console.error('THREE.WebGLRenderer: ' + e)
  57373. }
  57374. var We = new n.WebGLExtensions(Ge)
  57375. We.get('OES_texture_float'),
  57376. We.get('OES_texture_float_linear'),
  57377. We.get('OES_texture_half_float'),
  57378. We.get('OES_texture_half_float_linear'),
  57379. We.get('OES_standard_derivatives'),
  57380. We.get('ANGLE_instanced_arrays'),
  57381. We.get('OES_element_index_uint') && (n.BufferGeometry.MaxIndex = 4294967296)
  57382. var je = new n.WebGLCapabilities(Ge, We, e),
  57383. Ye = new n.WebGLState(Ge, We, ee),
  57384. Xe = new n.WebGLProperties(),
  57385. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  57386. qe = new n.WebGLPrograms(this, je),
  57387. Ke = new n.WebGLLights()
  57388. this.info.programs = qe.programs
  57389. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  57390. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He)
  57391. r(),
  57392. (this.context = Ge),
  57393. (this.capabilities = je),
  57394. (this.extensions = We),
  57395. (this.properties = Xe),
  57396. (this.state = Ye)
  57397. var $e = new n.WebGLShadowMap(this, Ue, Ze)
  57398. this.shadowMap = $e
  57399. var et = new n.SpritePlugin(this, ge),
  57400. tt = new n.LensFlarePlugin(this, me)
  57401. ;(this.getContext = function () {
  57402. return Ge
  57403. }),
  57404. (this.getContextAttributes = function () {
  57405. return Ge.getContextAttributes()
  57406. }),
  57407. (this.forceContextLoss = function () {
  57408. We.get('WEBGL_lose_context').loseContext()
  57409. }),
  57410. (this.getMaxAnisotropy = (function () {
  57411. var e
  57412. return function () {
  57413. if (void 0 !== e) return e
  57414. var t = We.get('EXT_texture_filter_anisotropic')
  57415. return (e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0)
  57416. }
  57417. })()),
  57418. (this.getPrecision = function () {
  57419. return je.precision
  57420. }),
  57421. (this.getPixelRatio = function () {
  57422. return Oe
  57423. }),
  57424. (this.setPixelRatio = function (e) {
  57425. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1))
  57426. }),
  57427. (this.getSize = function () {
  57428. return {
  57429. width: Re,
  57430. height: Pe
  57431. }
  57432. }),
  57433. (this.setSize = function (e, t, i, devicePixelRatio) {
  57434. if (devicePixelRatio != void 0)
  57435. Oe = devicePixelRatio //xzw add 改分辨率 始终保持清晰
  57436. ;(Re = e),
  57437. (Pe = t),
  57438. (te.width = e * Oe),
  57439. (te.height = t * Oe),
  57440. i !== !1 && ((te.style.width = e + 'px'), (te.style.height = t + 'px')),
  57441. this.setViewport(0, 0, e, t)
  57442. }),
  57443. (this.setViewport = function (e, t, i, n) {
  57444. Ye.viewport(Ne.set(e, t, i, n))
  57445. }),
  57446. (this.setScissor = function (e, t, i, n) {
  57447. Ye.scissor(Le.set(e, t, i, n))
  57448. }),
  57449. (this.setScissorTest = function (e) {
  57450. Ye.setScissorTest((De = e))
  57451. }),
  57452. (this.getClearColor = function () {
  57453. return Se
  57454. }),
  57455. (this.setClearColor = function (e, t) {
  57456. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me)
  57457. }),
  57458. (this.getClearAlpha = function () {
  57459. return Me
  57460. }),
  57461. (this.setClearAlpha = function (e) {
  57462. ;(Me = e), i(Se.r, Se.g, Se.b, Me)
  57463. }),
  57464. (this.clear = function (e, t, i) {
  57465. var n = 0
  57466. ;(void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  57467. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  57468. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  57469. Ge.clear(n)
  57470. }),
  57471. (this.clearColor = function () {
  57472. this.clear(!0, !1, !1)
  57473. }),
  57474. (this.clearDepth = function () {
  57475. this.clear(!1, !0, !1)
  57476. }),
  57477. (this.clearStencil = function () {
  57478. this.clear(!1, !1, !0)
  57479. }),
  57480. (this.clearTarget = function (e, t, i, n) {
  57481. this.setRenderTarget(e), this.clear(t, i, n)
  57482. }),
  57483. (this.resetGLState = o),
  57484. (this.dispose = function () {
  57485. te.removeEventListener('webglcontextlost', a, !1)
  57486. }),
  57487. (this.renderBufferImmediate = function (e, t, i) {
  57488. Ye.initAttributes()
  57489. var r = Xe.get(e)
  57490. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  57491. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  57492. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  57493. e.hasColors && !r.color && (r.color = Ge.createBuffer())
  57494. var o = t.getAttributes()
  57495. if (
  57496. (e.hasPositions &&
  57497. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  57498. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  57499. Ye.enableAttribute(o.position),
  57500. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  57501. e.hasNormals)
  57502. ) {
  57503. if (
  57504. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  57505. 'MeshPhongMaterial' !== i.type &&
  57506. 'MeshStandardMaterial' !== i.type &&
  57507. i.shading === n.FlatShading)
  57508. )
  57509. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  57510. var l = e.normalArray,
  57511. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  57512. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  57513. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3
  57514. ;(l[a + 0] = c),
  57515. (l[a + 1] = h),
  57516. (l[a + 2] = u),
  57517. (l[a + 3] = c),
  57518. (l[a + 4] = h),
  57519. (l[a + 5] = u),
  57520. (l[a + 6] = c),
  57521. (l[a + 7] = h),
  57522. (l[a + 8] = u)
  57523. }
  57524. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  57525. Ye.enableAttribute(o.normal),
  57526. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  57527. }
  57528. e.hasUvs &&
  57529. i.map &&
  57530. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  57531. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  57532. Ye.enableAttribute(o.uv),
  57533. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  57534. e.hasColors &&
  57535. i.vertexColors !== n.NoColors &&
  57536. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  57537. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  57538. Ye.enableAttribute(o.color),
  57539. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  57540. Ye.disableUnusedAttributes(),
  57541. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  57542. (e.count = 0)
  57543. }),
  57544. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  57545. E(o)
  57546. var l = w(e, i, o, a),
  57547. c = !1,
  57548. h = r.id + '_' + l.id + '_' + o.wireframe
  57549. h !== Ee && ((Ee = h), (c = !0))
  57550. var u = a.morphTargetInfluences
  57551. if (void 0 !== u) {
  57552. for (var d = [], p = 0, m = u.length; p < m; p++) {
  57553. var v = u[p]
  57554. d.push([v, p])
  57555. }
  57556. d.sort(g), d.length > 8 && (d.length = 8)
  57557. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  57558. var v = d[p]
  57559. if (((fe[p] = v[0]), 0 !== v[0])) {
  57560. var y = v[1]
  57561. o.morphTargets === !0 &&
  57562. A.position &&
  57563. r.addAttribute('morphTarget' + p, A.position[y]),
  57564. o.morphNormals === !0 &&
  57565. A.normal &&
  57566. r.addAttribute('morphNormal' + p, A.normal[y])
  57567. } else
  57568. o.morphTargets === !0 && r.removeAttribute('morphTarget' + p),
  57569. o.morphNormals === !0 && r.removeAttribute('morphNormal' + p)
  57570. }
  57571. var C = l.getUniforms()
  57572. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  57573. (c = !0)
  57574. }
  57575. var y = r.index,
  57576. I = r.attributes.position
  57577. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r))
  57578. var b
  57579. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe),
  57580. c &&
  57581. (f(o, l, r),
  57582. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)))
  57583. var _ = 0,
  57584. T = 1 / 0
  57585. null !== y ? (T = y.count) : void 0 !== I && (T = I.count)
  57586. var x = r.drawRange.start,
  57587. S = r.drawRange.count,
  57588. M = null !== s ? s.start : 0,
  57589. R = null !== s ? s.count : 1 / 0,
  57590. P = Math.max(_, x, M),
  57591. O = Math.min(_ + T, x + S, M + R) - 1,
  57592. L = Math.max(0, O - P + 1)
  57593. if (a instanceof n.Mesh)
  57594. if (o.wireframe === !0)
  57595. Ye.setLineWidth(o.wireframeLinewidth * t()), b.setMode(Ge.LINES)
  57596. else
  57597. switch (a.drawMode) {
  57598. case n.TrianglesDrawMode:
  57599. b.setMode(Ge.TRIANGLES)
  57600. break
  57601. case n.TriangleStripDrawMode:
  57602. b.setMode(Ge.TRIANGLE_STRIP)
  57603. break
  57604. case n.TriangleFanDrawMode:
  57605. b.setMode(Ge.TRIANGLE_FAN)
  57606. }
  57607. else if (a instanceof n.Line) {
  57608. var D = o.linewidth
  57609. void 0 === D && (D = 1),
  57610. Ye.setLineWidth(D * t()),
  57611. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  57612. } else a instanceof n.Points && b.setMode(Ge.POINTS)
  57613. r instanceof n.InstancedBufferGeometry
  57614. ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L)
  57615. : b.render(P, L)
  57616. }),
  57617. (this.render = function (e, t, i, r) {
  57618. if (t instanceof n.Camera == !1)
  57619. return void console.error(
  57620. 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.'
  57621. )
  57622. var o = e.fog
  57623. if (
  57624. ((Ee = ''),
  57625. (Ie = -1),
  57626. (be = null),
  57627. e.autoUpdate === !0 && e.updateMatrixWorld(),
  57628. null === t.parent && t.updateMatrixWorld(),
  57629. t.matrixWorldInverse.getInverse(t.matrixWorld),
  57630. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  57631. Be.setFromMatrix(Fe),
  57632. (ce.length = 0),
  57633. (ue = -1),
  57634. (pe = -1),
  57635. (ge.length = 0),
  57636. (me.length = 0),
  57637. y(e, t),
  57638. (he.length = ue + 1),
  57639. (de.length = pe + 1),
  57640. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  57641. U(ce, t),
  57642. $e.render(e, t),
  57643. (He.calls = 0),
  57644. (He.vertices = 0),
  57645. (He.faces = 0),
  57646. (He.points = 0),
  57647. void 0 === i && (i = null),
  57648. this.setRenderTarget(i),
  57649. (this.autoClear || r) &&
  57650. this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  57651. e.overrideMaterial)
  57652. ) {
  57653. var a = e.overrideMaterial
  57654. C(he, t, o, a), C(de, t, o, a)
  57655. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o)
  57656. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  57657. var s = i.texture
  57658. s.generateMipmaps &&
  57659. z(i) &&
  57660. s.minFilter !== n.NearestFilter &&
  57661. s.minFilter !== n.LinearFilter &&
  57662. J(i)
  57663. }
  57664. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0)
  57665. }),
  57666. (this.setFaceCulling = function (e, t) {
  57667. e === n.CullFaceNone
  57668. ? Ye.disable(Ge.CULL_FACE)
  57669. : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  57670. e === n.CullFaceBack
  57671. ? Ge.cullFace(Ge.BACK)
  57672. : e === n.CullFaceFront
  57673. ? Ge.cullFace(Ge.FRONT)
  57674. : Ge.cullFace(Ge.FRONT_AND_BACK),
  57675. Ye.enable(Ge.CULL_FACE))
  57676. }),
  57677. (this.setTexture = function (e, t) {
  57678. var i = Xe.get(e)
  57679. if (e.version > 0 && i.__version !== e.version) {
  57680. var n = e.image
  57681. return void 0 === n
  57682. ? void console.warn(
  57683. 'THREE.WebGLRenderer: Texture marked for update but image is undefined',
  57684. e
  57685. )
  57686. : n.complete === !1
  57687. ? void console.warn(
  57688. 'THREE.WebGLRenderer: Texture marked for update but image is incomplete',
  57689. e
  57690. )
  57691. : void H(i, e, t)
  57692. }
  57693. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  57694. }),
  57695. (this.getCurrentRenderTarget = function () {
  57696. return ye
  57697. }),
  57698. (this.setRenderTargetFramebuffer = function (renderTarget, defaultFramebuffer) {
  57699. //add
  57700. const renderTargetProperties = Xe.get(renderTarget)
  57701. renderTargetProperties.__webglFramebuffer = defaultFramebuffer
  57702. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined
  57703. }),
  57704. (this.setFramebuffer = function (value) {
  57705. //add
  57706. if (Ce !== value && ye === null) Ge.bindFramebuffer(36160, value)
  57707. Ce = value
  57708. }),
  57709. (this.setRenderTarget = function (e) {
  57710. ;(ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e)
  57711. var t,
  57712. i = e instanceof n.WebGLRenderTargetCube
  57713. if (e) {
  57714. var r = Xe.get(e)
  57715. ;(t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer),
  57716. we.copy(e.scissor),
  57717. (_e = e.scissorTest),
  57718. Te.copy(e.viewport)
  57719. } else
  57720. (t = null),
  57721. we.copy(Le).multiplyScalar(Oe),
  57722. (_e = De),
  57723. Te.copy(Ne).multiplyScalar(Oe)
  57724. if (
  57725. (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)),
  57726. Ye.scissor(we),
  57727. Ye.setScissorTest(_e),
  57728. Ye.viewport(Te),
  57729. i)
  57730. ) {
  57731. var o = Xe.get(e.texture)
  57732. Ge.framebufferTexture2D(
  57733. Ge.FRAMEBUFFER,
  57734. Ge.COLOR_ATTACHMENT0,
  57735. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace,
  57736. o.__webglTexture,
  57737. e.activeMipMapLevel
  57738. )
  57739. }
  57740. }),
  57741. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  57742. if (e instanceof n.WebGLRenderTarget == !1)
  57743. return void console.error(
  57744. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.'
  57745. )
  57746. var s = Xe.get(e).__webglFramebuffer
  57747. if (s) {
  57748. var l = !1
  57749. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0))
  57750. try {
  57751. var c = e.texture
  57752. if (
  57753. c.format !== n.RGBAFormat &&
  57754. ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT)
  57755. )
  57756. return void console.error(
  57757. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.'
  57758. )
  57759. if (
  57760. !(
  57761. c.type === n.UnsignedByteType ||
  57762. ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  57763. (c.type === n.FloatType && We.get('WEBGL_color_buffer_float')) ||
  57764. (c.type === n.HalfFloatType && We.get('EXT_color_buffer_half_float'))
  57765. )
  57766. )
  57767. return void console.error(
  57768. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.'
  57769. )
  57770. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE
  57771. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  57772. : console.error(
  57773. 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.'
  57774. )
  57775. } finally {
  57776. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  57777. }
  57778. }
  57779. })
  57780. }),
  57781. (n.WebGLRenderTarget = function (e, t, i) {
  57782. ;(this.uuid = n.Math.generateUUID()),
  57783. (this.width = e),
  57784. (this.height = t),
  57785. (this.scissor = new n.Vector4(0, 0, e, t)),
  57786. (this.scissorTest = !1),
  57787. (this.viewport = new n.Vector4(0, 0, e, t)),
  57788. (i = i || {}),
  57789. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  57790. (this.texture = new n.Texture(
  57791. void 0,
  57792. void 0,
  57793. i.wrapS,
  57794. i.wrapT,
  57795. i.magFilter,
  57796. i.minFilter,
  57797. i.format,
  57798. i.type,
  57799. i.anisotropy
  57800. )),
  57801. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  57802. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer)
  57803. }),
  57804. (n.WebGLRenderTarget.prototype = {
  57805. constructor: n.WebGLRenderTarget,
  57806. setSize: function (e, t) {
  57807. ;(this.width === e && this.height === t) ||
  57808. ((this.width = e), (this.height = t), this.dispose()),
  57809. this.viewport.set(0, 0, e, t),
  57810. this.scissor.set(0, 0, e, t)
  57811. },
  57812. clone: function () {
  57813. return new this.constructor().copy(this)
  57814. },
  57815. copy: function (e) {
  57816. return (
  57817. (this.width = e.width),
  57818. (this.height = e.height),
  57819. this.viewport.copy(e.viewport),
  57820. (this.texture = e.texture.clone()),
  57821. (this.depthBuffer = e.depthBuffer),
  57822. (this.stencilBuffer = e.stencilBuffer),
  57823. this
  57824. )
  57825. },
  57826. dispose: function () {
  57827. this.dispatchEvent({
  57828. type: 'dispose'
  57829. })
  57830. }
  57831. }),
  57832. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  57833. (n.WebGLRenderTargetCube = function (e, t, i) {
  57834. n.WebGLRenderTarget.call(this, e, t, i),
  57835. (this.activeCubeFace = 0),
  57836. (this.activeMipMapLevel = 0)
  57837. }),
  57838. (n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype)),
  57839. (n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube),
  57840. (n.WebGLBufferRenderer = function (e, t, i) {
  57841. function r(e) {
  57842. s = e
  57843. }
  57844. function o(t, n) {
  57845. e.drawArrays(s, t, n),
  57846. i.calls++,
  57847. (i.vertices += n),
  57848. s === e.TRIANGLES && (i.faces += n / 3)
  57849. }
  57850. function a(r) {
  57851. var o = t.get('ANGLE_instanced_arrays')
  57852. if (null === o)
  57853. return void console.error(
  57854. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57855. )
  57856. var a = r.attributes.position,
  57857. l = 0
  57858. a instanceof n.InterleavedBufferAttribute
  57859. ? ((l = a.data.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  57860. : ((l = a.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  57861. i.calls++,
  57862. (i.vertices += l * r.maxInstancedCount),
  57863. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3)
  57864. }
  57865. var s
  57866. ;(this.setMode = r), (this.render = o), (this.renderInstances = a)
  57867. }),
  57868. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  57869. function n(e) {
  57870. s = e
  57871. }
  57872. function r(i) {
  57873. i.array instanceof Uint32Array && t.get('OES_element_index_uint')
  57874. ? ((l = e.UNSIGNED_INT), (c = 4))
  57875. : ((l = e.UNSIGNED_SHORT), (c = 2))
  57876. }
  57877. function o(t, n) {
  57878. e.drawElements(s, n, l, t * c),
  57879. i.calls++,
  57880. (i.vertices += n),
  57881. s === e.TRIANGLES && (i.faces += n / 3)
  57882. }
  57883. function a(n, r, o) {
  57884. var a = t.get('ANGLE_instanced_arrays')
  57885. return null === a
  57886. ? void console.error(
  57887. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57888. )
  57889. : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  57890. i.calls++,
  57891. (i.vertices += o * n.maxInstancedCount),
  57892. void (s === e.TRIANGLES && (i.faces += (n.maxInstancedCount * o) / 3)))
  57893. }
  57894. var s, l, c
  57895. ;(this.setMode = n), (this.setIndex = r), (this.render = o), (this.renderInstances = a)
  57896. }),
  57897. (n.WebGLExtensions = function (e) {
  57898. var t = {}
  57899. this.get = function (i) {
  57900. if (void 0 !== t[i]) return t[i]
  57901. var n
  57902. switch (i) {
  57903. case 'EXT_texture_filter_anisotropic':
  57904. n =
  57905. e.getExtension('EXT_texture_filter_anisotropic') ||
  57906. e.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
  57907. e.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
  57908. break
  57909. case 'WEBGL_compressed_texture_s3tc':
  57910. n =
  57911. e.getExtension('WEBGL_compressed_texture_s3tc') ||
  57912. e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') ||
  57913. e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')
  57914. break
  57915. case 'WEBGL_compressed_texture_pvrtc':
  57916. n =
  57917. e.getExtension('WEBGL_compressed_texture_pvrtc') ||
  57918. e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc')
  57919. break
  57920. case 'WEBGL_compressed_texture_etc1':
  57921. n = e.getExtension('WEBGL_compressed_texture_etc1')
  57922. break
  57923. default:
  57924. n = e.getExtension(i)
  57925. }
  57926. return (
  57927. null === n &&
  57928. console.warn('THREE.WebGLRenderer: ' + i + ' extension not supported.'),
  57929. (t[i] = n),
  57930. n
  57931. )
  57932. }
  57933. }),
  57934. (n.WebGLCapabilities = function (e, t, i) {
  57935. function n(t) {
  57936. if ('highp' === t) {
  57937. if (
  57938. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 &&
  57939. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0
  57940. )
  57941. return 'highp'
  57942. t = 'mediump'
  57943. }
  57944. return 'mediump' === t &&
  57945. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 &&
  57946. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0
  57947. ? 'mediump'
  57948. : 'lowp'
  57949. }
  57950. ;(this.getMaxPrecision = n),
  57951. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  57952. (this.logarithmicDepthBuffer =
  57953. void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  57954. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  57955. (this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  57956. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  57957. (this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),
  57958. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  57959. (this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),
  57960. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  57961. (this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),
  57962. (this.vertexTextures = this.maxVertexTextures > 0),
  57963. (this.floatFragmentTextures = !!t.get('OES_texture_float')),
  57964. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures)
  57965. var r = n(this.precision)
  57966. r !== this.precision &&
  57967. (console.warn(
  57968. 'THREE.WebGLRenderer:',
  57969. this.precision,
  57970. 'not supported, using',
  57971. r,
  57972. 'instead.'
  57973. ),
  57974. (this.precision = r)),
  57975. this.logarithmicDepthBuffer &&
  57976. (this.logarithmicDepthBuffer = !!t.get('EXT_frag_depth'))
  57977. }),
  57978. (n.WebGLGeometries = function (e, t, i) {
  57979. function r(e) {
  57980. var t = e.geometry
  57981. if (void 0 !== h[t.id]) return h[t.id]
  57982. t.addEventListener('dispose', o)
  57983. var r
  57984. return (
  57985. t instanceof n.BufferGeometry
  57986. ? (r = t)
  57987. : t instanceof n.Geometry &&
  57988. (void 0 === t._bufferGeometry &&
  57989. (t._bufferGeometry = new n.BufferGeometry().setFromObject(e)),
  57990. (r = t._bufferGeometry)),
  57991. (h[t.id] = r),
  57992. i.memory.geometries++,
  57993. r
  57994. )
  57995. }
  57996. function o(e) {
  57997. var n = e.target,
  57998. r = h[n.id]
  57999. null !== r.index && s(r.index),
  58000. l(r.attributes),
  58001. n.removeEventListener('dispose', o),
  58002. delete h[n.id]
  58003. var a = t.get(n)
  58004. a.wireframe && s(a.wireframe), t.delete(n)
  58005. var c = t.get(r)
  58006. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--
  58007. }
  58008. function a(e) {
  58009. return e instanceof n.InterleavedBufferAttribute
  58010. ? t.get(e.data).__webglBuffer
  58011. : t.get(e).__webglBuffer
  58012. }
  58013. function s(t) {
  58014. var i = a(t)
  58015. void 0 !== i && (e.deleteBuffer(i), c(t))
  58016. }
  58017. function l(e) {
  58018. for (var t in e) s(e[t])
  58019. }
  58020. function c(e) {
  58021. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  58022. }
  58023. var h = {}
  58024. this.get = r
  58025. }),
  58026. (n.WebGLLights = function () {
  58027. var e = {}
  58028. this.get = function (t) {
  58029. if (void 0 !== e[t.id]) return e[t.id]
  58030. var i
  58031. switch (t.type) {
  58032. case 'DirectionalLight':
  58033. i = {
  58034. direction: new n.Vector3(),
  58035. color: new n.Color(),
  58036. shadow: !1,
  58037. shadowBias: 0,
  58038. shadowRadius: 1,
  58039. shadowMapSize: new n.Vector2()
  58040. }
  58041. break
  58042. case 'SpotLight':
  58043. i = {
  58044. position: new n.Vector3(),
  58045. direction: new n.Vector3(),
  58046. color: new n.Color(),
  58047. distance: 0,
  58048. coneCos: 0,
  58049. penumbraCos: 0,
  58050. decay: 0,
  58051. shadow: !1,
  58052. shadowBias: 0,
  58053. shadowRadius: 1,
  58054. shadowMapSize: new n.Vector2()
  58055. }
  58056. break
  58057. case 'PointLight':
  58058. i = {
  58059. position: new n.Vector3(),
  58060. color: new n.Color(),
  58061. distance: 0,
  58062. decay: 0,
  58063. shadow: !1,
  58064. shadowBias: 0,
  58065. shadowRadius: 1,
  58066. shadowMapSize: new n.Vector2()
  58067. }
  58068. break
  58069. case 'HemisphereLight':
  58070. i = {
  58071. direction: new n.Vector3(),
  58072. skyColor: new n.Color(),
  58073. groundColor: new n.Color()
  58074. }
  58075. }
  58076. return (e[t.id] = i), i
  58077. }
  58078. }),
  58079. (n.WebGLObjects = function (e, t, i) {
  58080. function r(t) {
  58081. var i = u.get(t)
  58082. t.geometry instanceof n.Geometry && i.updateFromObject(t)
  58083. var r = i.index,
  58084. a = i.attributes
  58085. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER)
  58086. for (var s in a) o(a[s], e.ARRAY_BUFFER)
  58087. var l = i.morphAttributes
  58088. for (var s in l)
  58089. for (var c = l[s], h = 0, d = c.length; h < d; h++) o(c[h], e.ARRAY_BUFFER)
  58090. return i
  58091. }
  58092. function o(e, i) {
  58093. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  58094. o = t.get(r)
  58095. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  58096. }
  58097. function a(t, i, n) {
  58098. ;(t.__webglBuffer = e.createBuffer()), e.bindBuffer(n, t.__webglBuffer)
  58099. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW
  58100. e.bufferData(n, i.array, r), (t.version = i.version)
  58101. }
  58102. function s(t, i, n) {
  58103. e.bindBuffer(n, t.__webglBuffer),
  58104. i.dynamic === !1 || i.updateRange.count === -1
  58105. ? e.bufferSubData(n, 0, i.array)
  58106. : 0 === i.updateRange.count
  58107. ? console.error(
  58108. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  58109. )
  58110. : (e.bufferSubData(
  58111. n,
  58112. i.updateRange.offset * i.array.BYTES_PER_ELEMENT,
  58113. i.array.subarray(
  58114. i.updateRange.offset,
  58115. i.updateRange.offset + i.updateRange.count
  58116. )
  58117. ),
  58118. (i.updateRange.count = 0)),
  58119. (t.version = i.version)
  58120. }
  58121. function l(e) {
  58122. return e instanceof n.InterleavedBufferAttribute
  58123. ? t.get(e.data).__webglBuffer
  58124. : t.get(e).__webglBuffer
  58125. }
  58126. function c(i) {
  58127. var r = t.get(i)
  58128. if (void 0 !== r.wireframe) return r.wireframe
  58129. var a = [],
  58130. s = i.index,
  58131. l = i.attributes,
  58132. c = l.position
  58133. if (null !== s)
  58134. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  58135. var g = d[p + 0],
  58136. m = d[p + 1],
  58137. v = d[p + 2]
  58138. h(u, g, m) && a.push(g, m), h(u, m, v) && a.push(m, v), h(u, v, g) && a.push(v, g)
  58139. }
  58140. else
  58141. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  58142. var g = p + 0,
  58143. m = p + 1,
  58144. v = p + 2
  58145. a.push(g, m, m, v, v, g)
  58146. }
  58147. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  58148. y = new n.BufferAttribute(new A(a), 1)
  58149. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y
  58150. }
  58151. function h(e, t, i) {
  58152. if (t > i) {
  58153. var n = t
  58154. ;(t = i), (i = n)
  58155. }
  58156. var r = e[t]
  58157. return void 0 === r ? ((e[t] = [i]), !0) : r.indexOf(i) === -1 && (r.push(i), !0)
  58158. }
  58159. var u = new n.WebGLGeometries(e, t, i)
  58160. ;(this.getAttributeBuffer = l), (this.getWireframeAttribute = c), (this.update = r)
  58161. }),
  58162. (n.WebGLProgram = (function () {
  58163. function e(e) {
  58164. switch (e) {
  58165. case n.LinearEncoding:
  58166. return ['Linear', '( value )']
  58167. case n.sRGBEncoding:
  58168. return ['sRGB', '( value )']
  58169. case n.RGBEEncoding:
  58170. return ['RGBE', '( value )']
  58171. case n.RGBM7Encoding:
  58172. return ['RGBM', '( value, 7.0 )']
  58173. case n.RGBM16Encoding:
  58174. return ['RGBM', '( value, 16.0 )']
  58175. case n.RGBDEncoding:
  58176. return ['RGBD', '( value, 256.0 )']
  58177. case n.GammaEncoding:
  58178. return ['Gamma', '( value, float( GAMMA_FACTOR ) )']
  58179. default:
  58180. throw new Error('unsupported encoding: ' + e)
  58181. }
  58182. }
  58183. function t(t, i) {
  58184. var n = e(i)
  58185. return 'vec4 ' + t + '( vec4 value ) { return ' + n[0] + 'ToLinear' + n[1] + '; }'
  58186. }
  58187. function i(t, i) {
  58188. var n = e(i)
  58189. return 'vec4 ' + t + '( vec4 value ) { return LinearTo' + n[0] + n[1] + '; }'
  58190. }
  58191. function r(e, t) {
  58192. var i
  58193. switch (t) {
  58194. case n.LinearToneMapping:
  58195. i = 'Linear'
  58196. break
  58197. case n.ReinhardToneMapping:
  58198. i = 'Reinhard'
  58199. break
  58200. case n.Uncharted2ToneMapping:
  58201. i = 'Uncharted2'
  58202. break
  58203. case n.CineonToneMapping:
  58204. i = 'OptimizedCineon'
  58205. break
  58206. default:
  58207. throw new Error('unsupported toneMapping: ' + t)
  58208. }
  58209. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }'
  58210. }
  58211. function o(e, t, i) {
  58212. e = e || {}
  58213. var n = [
  58214. e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading
  58215. ? '#extension GL_OES_standard_derivatives : enable'
  58216. : '',
  58217. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth')
  58218. ? '#extension GL_EXT_frag_depth : enable'
  58219. : '',
  58220. e.drawBuffers && i.get('WEBGL_draw_buffers')
  58221. ? '#extension GL_EXT_draw_buffers : require'
  58222. : '',
  58223. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod')
  58224. ? '#extension GL_EXT_shader_texture_lod : enable'
  58225. : ''
  58226. ]
  58227. return n.filter(c).join('\n')
  58228. }
  58229. function a(e) {
  58230. var t = []
  58231. for (var i in e) {
  58232. var n = e[i]
  58233. n !== !1 && t.push('#define ' + i + ' ' + n)
  58234. }
  58235. return t.join('\n')
  58236. }
  58237. function s(e, t, i) {
  58238. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  58239. var a = e.getActiveUniform(t, o),
  58240. s = a.name,
  58241. l = e.getUniformLocation(t, s),
  58242. c = f.exec(s)
  58243. if (c) {
  58244. var h = c[1],
  58245. u = c[2],
  58246. d = n[h]
  58247. d || (d = n[h] = {}), (d[u] = l)
  58248. } else if ((c = g.exec(s))) {
  58249. var p = c[1],
  58250. v = c[2],
  58251. A = c[3],
  58252. y = n[p]
  58253. y || (y = n[p] = [])
  58254. var C = y[v]
  58255. C || (C = y[v] = {}), (C[A] = l)
  58256. } else if ((c = m.exec(s))) {
  58257. var p = c[1]
  58258. n[p] = l
  58259. } else n[s] = l
  58260. }
  58261. return n
  58262. }
  58263. function l(e, t, i) {
  58264. for (
  58265. var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0;
  58266. o < r;
  58267. o++
  58268. ) {
  58269. var a = e.getActiveAttrib(t, o),
  58270. s = a.name
  58271. n[s] = e.getAttribLocation(t, s)
  58272. }
  58273. return n
  58274. }
  58275. function c(e) {
  58276. return '' !== e
  58277. }
  58278. function h(e, t) {
  58279. return e
  58280. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  58281. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  58282. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  58283. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  58284. }
  58285. function u(e) {
  58286. function t(e, t) {
  58287. var i = n.ShaderChunk[t]
  58288. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>')
  58289. return u(i)
  58290. }
  58291. var i = /#include +<([\w\d.]+)>/g
  58292. return e.replace(i, t)
  58293. }
  58294. function d(e) {
  58295. function t(e, t, i, n) {
  58296. for (var r = '', o = parseInt(t); o < parseInt(i); o++)
  58297. r += n.replace(/\[ i \]/g, '[ ' + o + ' ]')
  58298. return r
  58299. }
  58300. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g
  58301. return e.replace(i, t)
  58302. }
  58303. var p = 0,
  58304. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  58305. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  58306. m = /^([\w\d_]+)\[0\]$/
  58307. return function (e, f, g, m) {
  58308. var v = e.context,
  58309. A = g.extensions,
  58310. y = g.defines,
  58311. C = g.__webglShader.vertexShader,
  58312. I = g.__webglShader.fragmentShader,
  58313. E = 'SHADOWMAP_TYPE_BASIC'
  58314. m.shadowMapType === n.PCFShadowMap
  58315. ? (E = 'SHADOWMAP_TYPE_PCF')
  58316. : m.shadowMapType === n.PCFSoftShadowMap && (E = 'SHADOWMAP_TYPE_PCF_SOFT')
  58317. var b = 'ENVMAP_TYPE_CUBE',
  58318. w = 'ENVMAP_MODE_REFLECTION',
  58319. _ = 'ENVMAP_BLENDING_MULTIPLY'
  58320. if (m.envMap) {
  58321. switch (g.envMap.mapping) {
  58322. case n.CubeReflectionMapping:
  58323. case n.CubeRefractionMapping:
  58324. b = 'ENVMAP_TYPE_CUBE'
  58325. break
  58326. case n.CubeUVReflectionMapping:
  58327. case n.CubeUVRefractionMapping:
  58328. b = 'ENVMAP_TYPE_CUBE_UV'
  58329. break
  58330. case n.EquirectangularReflectionMapping:
  58331. case n.EquirectangularRefractionMapping:
  58332. b = 'ENVMAP_TYPE_EQUIREC'
  58333. break
  58334. case n.SphericalReflectionMapping:
  58335. b = 'ENVMAP_TYPE_SPHERE'
  58336. }
  58337. switch (g.envMap.mapping) {
  58338. case n.CubeRefractionMapping:
  58339. case n.EquirectangularRefractionMapping:
  58340. w = 'ENVMAP_MODE_REFRACTION'
  58341. }
  58342. switch (g.combine) {
  58343. case n.MultiplyOperation:
  58344. _ = 'ENVMAP_BLENDING_MULTIPLY'
  58345. break
  58346. case n.MixOperation:
  58347. _ = 'ENVMAP_BLENDING_MIX'
  58348. break
  58349. case n.AddOperation:
  58350. _ = 'ENVMAP_BLENDING_ADD'
  58351. }
  58352. }
  58353. var T,
  58354. x,
  58355. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  58356. M = o(A, m, e.extensions),
  58357. R = a(y),
  58358. P = v.createProgram()
  58359. g instanceof n.RawShaderMaterial
  58360. ? ((T = ''), (x = ''))
  58361. : ((T = [
  58362. 'precision ' + m.precision + ' float;',
  58363. 'precision ' + m.precision + ' int;',
  58364. '#define SHADER_NAME ' + g.__webglShader.name,
  58365. R,
  58366. m.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  58367. '#define GAMMA_FACTOR ' + S,
  58368. '#define MAX_BONES ' + m.maxBones,
  58369. m.map ? '#define USE_MAP' : '',
  58370. m.envMap ? '#define USE_ENVMAP' : '',
  58371. m.envMap ? '#define ' + w : '',
  58372. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58373. m.aoMap ? '#define USE_AOMAP' : '',
  58374. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58375. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58376. m.normalMap ? '#define USE_NORMALMAP' : '',
  58377. m.displacementMap && m.supportsVertexTextures
  58378. ? '#define USE_DISPLACEMENTMAP'
  58379. : '',
  58380. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58381. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58382. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58383. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58384. m.vertexColors ? '#define USE_COLOR' : '',
  58385. m.flatShading ? '#define FLAT_SHADED' : '',
  58386. m.skinning ? '#define USE_SKINNING' : '',
  58387. m.useVertexTexture ? '#define BONE_TEXTURE' : '',
  58388. m.morphTargets ? '#define USE_MORPHTARGETS' : '',
  58389. m.morphNormals && m.flatShading === !1 ? '#define USE_MORPHNORMALS' : '',
  58390. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58391. m.flipSided ? '#define FLIP_SIDED' : '',
  58392. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58393. m.shadowMapEnabled ? '#define ' + E : '',
  58394. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58395. m.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  58396. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58397. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58398. ? '#define USE_LOGDEPTHBUF_EXT'
  58399. : '',
  58400. 'uniform mat4 modelMatrix;',
  58401. 'uniform mat4 modelViewMatrix;',
  58402. 'uniform mat4 projectionMatrix;',
  58403. 'uniform mat4 viewMatrix;',
  58404. 'uniform mat3 normalMatrix;',
  58405. 'uniform vec3 cameraPosition;',
  58406. 'attribute vec3 position;',
  58407. 'attribute vec3 normal;',
  58408. 'attribute vec2 uv;',
  58409. '#ifdef USE_COLOR',
  58410. '\tattribute vec3 color;',
  58411. '#endif',
  58412. '#ifdef USE_MORPHTARGETS',
  58413. '\tattribute vec3 morphTarget0;',
  58414. '\tattribute vec3 morphTarget1;',
  58415. '\tattribute vec3 morphTarget2;',
  58416. '\tattribute vec3 morphTarget3;',
  58417. '\t#ifdef USE_MORPHNORMALS',
  58418. '\t\tattribute vec3 morphNormal0;',
  58419. '\t\tattribute vec3 morphNormal1;',
  58420. '\t\tattribute vec3 morphNormal2;',
  58421. '\t\tattribute vec3 morphNormal3;',
  58422. '\t#else',
  58423. '\t\tattribute vec3 morphTarget4;',
  58424. '\t\tattribute vec3 morphTarget5;',
  58425. '\t\tattribute vec3 morphTarget6;',
  58426. '\t\tattribute vec3 morphTarget7;',
  58427. '\t#endif',
  58428. '#endif',
  58429. '#ifdef USE_SKINNING',
  58430. '\tattribute vec4 skinIndex;',
  58431. '\tattribute vec4 skinWeight;',
  58432. '#endif',
  58433. '\n'
  58434. ]
  58435. .filter(c)
  58436. .join('\n')),
  58437. (x = [
  58438. M,
  58439. 'precision ' + m.precision + ' float;',
  58440. 'precision ' + m.precision + ' int;',
  58441. '#define SHADER_NAME ' + g.__webglShader.name,
  58442. R,
  58443. m.alphaTest ? '#define ALPHATEST ' + m.alphaTest : '',
  58444. '#define GAMMA_FACTOR ' + S,
  58445. m.useFog && m.fog ? '#define USE_FOG' : '',
  58446. m.useFog && m.fogExp ? '#define FOG_EXP2' : '',
  58447. m.map ? '#define USE_MAP' : '',
  58448. m.envMap ? '#define USE_ENVMAP' : '',
  58449. m.envMap ? '#define ' + b : '',
  58450. m.envMap ? '#define ' + w : '',
  58451. m.envMap ? '#define ' + _ : '',
  58452. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58453. m.aoMap ? '#define USE_AOMAP' : '',
  58454. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58455. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58456. m.normalMap ? '#define USE_NORMALMAP' : '',
  58457. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58458. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58459. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58460. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58461. m.vertexColors ? '#define USE_COLOR' : '',
  58462. m.flatShading ? '#define FLAT_SHADED' : '',
  58463. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58464. m.flipSided ? '#define FLIP_SIDED' : '',
  58465. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58466. m.shadowMapEnabled ? '#define ' + E : '',
  58467. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58468. m.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  58469. m.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  58470. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58471. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58472. ? '#define USE_LOGDEPTHBUF_EXT'
  58473. : '',
  58474. m.envMap && e.extensions.get('EXT_shader_texture_lod')
  58475. ? '#define TEXTURE_LOD_EXT'
  58476. : '',
  58477. 'uniform mat4 viewMatrix;',
  58478. 'uniform vec3 cameraPosition;',
  58479. m.toneMapping !== n.NoToneMapping ? '#define TONE_MAPPING' : '',
  58480. m.toneMapping !== n.NoToneMapping
  58481. ? n.ShaderChunk.tonemapping_pars_fragment
  58482. : '',
  58483. m.toneMapping !== n.NoToneMapping ? r('toneMapping', m.toneMapping) : '',
  58484. m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding
  58485. ? n.ShaderChunk.encodings_pars_fragment
  58486. : '',
  58487. m.mapEncoding ? t('mapTexelToLinear', m.mapEncoding) : '',
  58488. m.envMapEncoding ? t('envMapTexelToLinear', m.envMapEncoding) : '',
  58489. m.emissiveMapEncoding
  58490. ? t('emissiveMapTexelToLinear', m.emissiveMapEncoding)
  58491. : '',
  58492. m.outputEncoding ? i('linearToOutputTexel', m.outputEncoding) : '',
  58493. '\n'
  58494. ]
  58495. .filter(c)
  58496. .join('\n'))),
  58497. (C = u(C, m)),
  58498. (C = h(C, m)),
  58499. (I = u(I, m)),
  58500. (I = h(I, m)),
  58501. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)))
  58502. var O = T + C,
  58503. L = x + I,
  58504. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  58505. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L)
  58506. v.attachShader(P, D),
  58507. v.attachShader(P, N),
  58508. void 0 !== g.index0AttributeName
  58509. ? v.bindAttribLocation(P, 0, g.index0AttributeName)
  58510. : m.morphTargets === !0 && v.bindAttribLocation(P, 0, 'position'),
  58511. v.linkProgram(P)
  58512. var B = v.getProgramInfoLog(P),
  58513. F = v.getShaderInfoLog(D),
  58514. V = v.getShaderInfoLog(N),
  58515. U = !0,
  58516. k = !0
  58517. v.getProgramParameter(P, v.LINK_STATUS) === !1
  58518. ? ((U = !1),
  58519. console.error(
  58520. 'THREE.WebGLProgram: shader error: ',
  58521. v.getError(),
  58522. 'gl.VALIDATE_STATUS',
  58523. v.getProgramParameter(P, v.VALIDATE_STATUS),
  58524. 'gl.getProgramInfoLog',
  58525. B,
  58526. F,
  58527. V
  58528. ))
  58529. : '' !== B
  58530. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', B)
  58531. : ('' !== F && '' !== V) || (k = !1),
  58532. k &&
  58533. (this.diagnostics = {
  58534. runnable: U,
  58535. material: g,
  58536. programLog: B,
  58537. vertexShader: {
  58538. log: F,
  58539. prefix: T
  58540. },
  58541. fragmentShader: {
  58542. log: V,
  58543. prefix: x
  58544. }
  58545. }),
  58546. v.deleteShader(D),
  58547. v.deleteShader(N)
  58548. var H
  58549. this.getUniforms = function () {
  58550. return void 0 === H && (H = s(v, P)), H
  58551. }
  58552. var G
  58553. return (
  58554. (this.getAttributes = function () {
  58555. return void 0 === G && (G = l(v, P)), G
  58556. }),
  58557. (this.destroy = function () {
  58558. v.deleteProgram(P), (this.program = void 0)
  58559. }),
  58560. Object.defineProperties(this, {
  58561. uniforms: {
  58562. get: function () {
  58563. return (
  58564. console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'),
  58565. this.getUniforms()
  58566. )
  58567. }
  58568. },
  58569. attributes: {
  58570. get: function () {
  58571. return (
  58572. console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'),
  58573. this.getAttributes()
  58574. )
  58575. }
  58576. }
  58577. }),
  58578. (this.id = p++),
  58579. (this.code = f),
  58580. (this.usedTimes = 1),
  58581. (this.program = P),
  58582. (this.vertexShader = D),
  58583. (this.fragmentShader = N),
  58584. this
  58585. )
  58586. }
  58587. })()),
  58588. (n.WebGLPrograms = function (e, t) {
  58589. function i(e) {
  58590. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  58591. return 1024
  58592. var i = t.maxVertexUniforms,
  58593. r = Math.floor((i - 20) / 4),
  58594. o = r
  58595. return (
  58596. void 0 !== e &&
  58597. e instanceof n.SkinnedMesh &&
  58598. ((o = Math.min(e.skeleton.bones.length, o)),
  58599. o < e.skeleton.bones.length &&
  58600. console.warn(
  58601. 'WebGLRenderer: too many bones - ' +
  58602. e.skeleton.bones.length +
  58603. ', this GPU supports just ' +
  58604. o +
  58605. ' (try OpenGL instead of ANGLE)'
  58606. )),
  58607. o
  58608. )
  58609. }
  58610. function r(e, t) {
  58611. var i
  58612. return (
  58613. e
  58614. ? e instanceof n.Texture
  58615. ? (i = e.encoding)
  58616. : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding)
  58617. : (i = n.LinearEncoding),
  58618. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  58619. i
  58620. )
  58621. }
  58622. var o = [],
  58623. a = {
  58624. MeshDepthMaterial: 'depth',
  58625. MeshNormalMaterial: 'normal',
  58626. MeshBasicMaterial: 'basic',
  58627. MeshLambertMaterial: 'lambert',
  58628. MeshPhongMaterial: 'phong',
  58629. MeshStandardMaterial: 'standard',
  58630. LineBasicMaterial: 'basic',
  58631. LineDashedMaterial: 'dashed',
  58632. PointsMaterial: 'points'
  58633. },
  58634. s = [
  58635. 'precision',
  58636. 'supportsVertexTextures',
  58637. 'map',
  58638. 'mapEncoding',
  58639. 'envMap',
  58640. 'envMapMode',
  58641. 'envMapEncoding',
  58642. 'lightMap',
  58643. 'aoMap',
  58644. 'emissiveMap',
  58645. 'emissiveMapEncoding',
  58646. 'bumpMap',
  58647. 'normalMap',
  58648. 'displacementMap',
  58649. 'specularMap',
  58650. 'roughnessMap',
  58651. 'metalnessMap',
  58652. 'alphaMap',
  58653. 'combine',
  58654. 'vertexColors',
  58655. 'fog',
  58656. 'useFog',
  58657. 'fogExp',
  58658. 'flatShading',
  58659. 'sizeAttenuation',
  58660. 'logarithmicDepthBuffer',
  58661. 'skinning',
  58662. 'maxBones',
  58663. 'useVertexTexture',
  58664. 'morphTargets',
  58665. 'morphNormals',
  58666. 'maxMorphTargets',
  58667. 'maxMorphNormals',
  58668. 'premultipliedAlpha',
  58669. 'numDirLights',
  58670. 'numPointLights',
  58671. 'numSpotLights',
  58672. 'numHemiLights',
  58673. 'shadowMapEnabled',
  58674. 'pointLightShadows',
  58675. 'toneMapping',
  58676. 'physicallyCorrectLights',
  58677. 'shadowMapType',
  58678. 'alphaTest',
  58679. 'doubleSided',
  58680. 'flipSided'
  58681. ]
  58682. ;(this.getParameters = function (o, s, l, c) {
  58683. var h = a[o.type],
  58684. u = i(c),
  58685. d = e.getPrecision()
  58686. null !== o.precision &&
  58687. ((d = t.getMaxPrecision(o.precision)),
  58688. d !== o.precision &&
  58689. console.warn(
  58690. 'THREE.WebGLProgram.getParameters:',
  58691. o.precision,
  58692. 'not supported, using',
  58693. d,
  58694. 'instead.'
  58695. ))
  58696. var p = {
  58697. shaderID: h,
  58698. precision: d,
  58699. supportsVertexTextures: t.vertexTextures,
  58700. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  58701. map: !!o.map,
  58702. mapEncoding: r(o.map, e.gammaInput),
  58703. envMap: !!o.envMap,
  58704. envMapMode: o.envMap && o.envMap.mapping,
  58705. envMapEncoding: r(o.envMap, e.gammaInput),
  58706. envMapCubeUV:
  58707. !!o.envMap &&
  58708. (o.envMap.mapping === n.CubeUVReflectionMapping ||
  58709. o.envMap.mapping === n.CubeUVRefractionMapping),
  58710. lightMap: !!o.lightMap,
  58711. aoMap: !!o.aoMap,
  58712. emissiveMap: !!o.emissiveMap,
  58713. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  58714. bumpMap: !!o.bumpMap,
  58715. normalMap: !!o.normalMap,
  58716. displacementMap: !!o.displacementMap,
  58717. roughnessMap: !!o.roughnessMap,
  58718. metalnessMap: !!o.metalnessMap,
  58719. specularMap: !!o.specularMap,
  58720. alphaMap: !!o.alphaMap,
  58721. combine: o.combine,
  58722. vertexColors: o.vertexColors,
  58723. fog: l,
  58724. useFog: o.fog,
  58725. fogExp: l instanceof n.FogExp2,
  58726. flatShading: o.shading === n.FlatShading,
  58727. sizeAttenuation: o.sizeAttenuation,
  58728. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  58729. skinning: o.skinning,
  58730. maxBones: u,
  58731. useVertexTexture:
  58732. t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  58733. morphTargets: o.morphTargets,
  58734. morphNormals: o.morphNormals,
  58735. maxMorphTargets: e.maxMorphTargets,
  58736. maxMorphNormals: e.maxMorphNormals,
  58737. numDirLights: s.directional.length,
  58738. numPointLights: s.point.length,
  58739. numSpotLights: s.spot.length,
  58740. numHemiLights: s.hemi.length,
  58741. pointLightShadows: s.shadowsPointLight,
  58742. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  58743. shadowMapType: e.shadowMap.type,
  58744. toneMapping: e.toneMapping,
  58745. physicallyCorrectLights: e.physicallyCorrectLights,
  58746. premultipliedAlpha: o.premultipliedAlpha,
  58747. alphaTest: o.alphaTest,
  58748. doubleSided: o.side === n.DoubleSide,
  58749. flipSided: o.side === n.BackSide
  58750. }
  58751. return p
  58752. }),
  58753. (this.getProgramCode = function (e, t) {
  58754. var i = []
  58755. if (
  58756. (t.shaderID
  58757. ? i.push(t.shaderID)
  58758. : (i.push(e.fragmentShader), i.push(e.vertexShader)),
  58759. void 0 !== e.defines)
  58760. )
  58761. for (var n in e.defines) i.push(n), i.push(e.defines[n])
  58762. for (var r = 0; r < s.length; r++) {
  58763. var o = s[r]
  58764. i.push(o), i.push(t[o])
  58765. }
  58766. return i.join()
  58767. }),
  58768. (this.acquireProgram = function (t, i, r) {
  58769. for (var a, s = 0, l = o.length; s < l; s++) {
  58770. var c = o[s]
  58771. if (c.code === r) {
  58772. ;(a = c), ++a.usedTimes
  58773. break
  58774. }
  58775. }
  58776. return void 0 === a && ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)), a
  58777. }),
  58778. (this.releaseProgram = function (e) {
  58779. if (0 === --e.usedTimes) {
  58780. var t = o.indexOf(e)
  58781. ;(o[t] = o[o.length - 1]), o.pop(), e.destroy()
  58782. }
  58783. }),
  58784. (this.programs = o)
  58785. }),
  58786. (n.WebGLProperties = function () {
  58787. var e = {}
  58788. ;(this.get = function (t) {
  58789. var i = t.uuid,
  58790. n = e[i]
  58791. return void 0 === n && ((n = {}), (e[i] = n)), n
  58792. }),
  58793. (this.delete = function (t) {
  58794. delete e[t.uuid]
  58795. }),
  58796. (this.clear = function () {
  58797. e = {}
  58798. })
  58799. }),
  58800. (n.WebGLShader = (function () {
  58801. function e(e) {
  58802. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i]
  58803. return t.join('\n')
  58804. }
  58805. return function (t, i, n) {
  58806. var r = t.createShader(i)
  58807. return (
  58808. t.shaderSource(r, n),
  58809. t.compileShader(r),
  58810. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 &&
  58811. console.error("THREE.WebGLShader: Shader couldn't compile."),
  58812. '' !== t.getShaderInfoLog(r) &&
  58813. console.warn(
  58814. 'THREE.WebGLShader: gl.getShaderInfoLog()',
  58815. i === t.VERTEX_SHADER ? 'vertex' : 'fragment',
  58816. t.getShaderInfoLog(r),
  58817. e(n)
  58818. ),
  58819. r
  58820. )
  58821. }
  58822. })()),
  58823. (n.WebGLShadowMap = function (e, t, i) {
  58824. function r(e, t, i, r) {
  58825. var o = e.geometry,
  58826. a = null,
  58827. s = v,
  58828. l = e.customDepthMaterial
  58829. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l
  58830. else {
  58831. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets,
  58832. h = e instanceof n.SkinnedMesh && t.skinning,
  58833. u = 0
  58834. c && (u |= f), h && (u |= g), (a = s[u])
  58835. }
  58836. return (
  58837. (a.visible = t.visible),
  58838. (a.wireframe = t.wireframe),
  58839. (a.wireframeLinewidth = t.wireframeLinewidth),
  58840. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  58841. a
  58842. )
  58843. }
  58844. function o(e, t, i) {
  58845. if (e.visible !== !1) {
  58846. if (
  58847. e.layers.test(t.layers) &&
  58848. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  58849. e.castShadow &&
  58850. (e.frustumCulled === !1 || l.intersectsObject(e) === !0)
  58851. ) {
  58852. var r = e.material
  58853. r.visible === !0 &&
  58854. (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  58855. p.push(e))
  58856. }
  58857. for (var a = e.children, s = 0, c = a.length; s < c; s++) o(a[s], t, i)
  58858. }
  58859. }
  58860. for (
  58861. var a = e.context,
  58862. s = e.state,
  58863. l = new n.Frustum(),
  58864. c = new n.Matrix4(),
  58865. h = new n.Vector2(),
  58866. u = new n.Vector3(),
  58867. d = new n.Vector3(),
  58868. p = [],
  58869. f = 1,
  58870. g = 2,
  58871. m = (f | g) + 1,
  58872. v = new Array(m),
  58873. A = new Array(m),
  58874. y = [
  58875. new n.Vector3(1, 0, 0),
  58876. new n.Vector3(-1, 0, 0),
  58877. new n.Vector3(0, 0, 1),
  58878. new n.Vector3(0, 0, -1),
  58879. new n.Vector3(0, 1, 0),
  58880. new n.Vector3(0, -1, 0)
  58881. ],
  58882. C = [
  58883. new n.Vector3(0, 1, 0),
  58884. new n.Vector3(0, 1, 0),
  58885. new n.Vector3(0, 1, 0),
  58886. new n.Vector3(0, 1, 0),
  58887. new n.Vector3(0, 0, 1),
  58888. new n.Vector3(0, 0, -1)
  58889. ],
  58890. I = [
  58891. new n.Vector4(),
  58892. new n.Vector4(),
  58893. new n.Vector4(),
  58894. new n.Vector4(),
  58895. new n.Vector4(),
  58896. new n.Vector4()
  58897. ],
  58898. E = n.ShaderLib.depthRGBA,
  58899. b = n.UniformsUtils.clone(E.uniforms),
  58900. w = n.ShaderLib.distanceRGBA,
  58901. _ = n.UniformsUtils.clone(w.uniforms),
  58902. T = 0;
  58903. T !== m;
  58904. ++T
  58905. ) {
  58906. var x = 0 !== (T & f),
  58907. S = 0 !== (T & g),
  58908. M = new n.ShaderMaterial({
  58909. uniforms: b,
  58910. vertexShader: E.vertexShader,
  58911. fragmentShader: E.fragmentShader,
  58912. morphTargets: x,
  58913. skinning: S
  58914. })
  58915. v[T] = M
  58916. var R = new n.ShaderMaterial({
  58917. defines: {
  58918. USE_SHADOWMAP: ''
  58919. },
  58920. uniforms: _,
  58921. vertexShader: w.vertexShader,
  58922. fragmentShader: w.fragmentShader,
  58923. morphTargets: x,
  58924. skinning: S
  58925. })
  58926. A[T] = R
  58927. }
  58928. var P = this
  58929. ;(this.enabled = !1),
  58930. (this.autoUpdate = !0),
  58931. (this.needsUpdate = !1),
  58932. (this.type = n.PCFShadowMap),
  58933. (this.cullFace = n.CullFaceFront),
  58934. (this.render = function (f, g) {
  58935. var m,
  58936. v,
  58937. A = t.shadows
  58938. if (
  58939. 0 !== A.length &&
  58940. P.enabled !== !1 &&
  58941. (P.autoUpdate !== !1 || P.needsUpdate !== !1)
  58942. ) {
  58943. s.clearColor(1, 1, 1, 1),
  58944. s.disable(a.BLEND),
  58945. s.enable(a.CULL_FACE),
  58946. a.frontFace(a.CCW),
  58947. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  58948. s.setDepthTest(!0),
  58949. s.setScissorTest(!1)
  58950. for (var E = 0, b = A.length; E < b; E++) {
  58951. var w = A[E],
  58952. _ = w.shadow,
  58953. T = _.camera
  58954. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  58955. ;(m = 6), (v = !0)
  58956. var x = h.x,
  58957. S = h.y
  58958. I[0].set(2 * x, S, x, S),
  58959. I[1].set(0, S, x, S),
  58960. I[2].set(3 * x, S, x, S),
  58961. I[3].set(x, S, x, S),
  58962. I[4].set(3 * x, 0, x, S),
  58963. I[5].set(x, 0, x, S),
  58964. (h.x *= 4),
  58965. (h.y *= 2)
  58966. } else (m = 1), (v = !1)
  58967. if (null === _.map) {
  58968. var M = {
  58969. minFilter: n.NearestFilter,
  58970. magFilter: n.NearestFilter,
  58971. format: n.RGBAFormat
  58972. }
  58973. ;(_.map = new n.WebGLRenderTarget(h.x, h.y, M)),
  58974. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  58975. T.updateProjectionMatrix()
  58976. }
  58977. var R = _.map,
  58978. O = _.matrix
  58979. d.setFromMatrixPosition(w.matrixWorld),
  58980. T.position.copy(d),
  58981. e.setRenderTarget(R),
  58982. e.clear()
  58983. for (var L = 0; L < m; L++) {
  58984. if (v) {
  58985. u.copy(T.position), u.add(y[L]), T.up.copy(C[L]), T.lookAt(u)
  58986. var D = I[L]
  58987. s.viewport(D)
  58988. } else u.setFromMatrixPosition(w.target.matrixWorld), T.lookAt(u)
  58989. T.updateMatrixWorld(),
  58990. T.matrixWorldInverse.getInverse(T.matrixWorld),
  58991. O.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  58992. O.multiply(T.projectionMatrix),
  58993. O.multiply(T.matrixWorldInverse),
  58994. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  58995. l.setFromMatrix(c),
  58996. (p.length = 0),
  58997. o(f, g, T)
  58998. for (var N = 0, B = p.length; N < B; N++) {
  58999. var F = p[N],
  59000. V = i.update(F),
  59001. U = F.material
  59002. if (U instanceof n.MultiMaterial)
  59003. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  59004. var W = k[G],
  59005. j = H[W.materialIndex]
  59006. if (j.visible === !0) {
  59007. var Y = r(F, j, v, d)
  59008. e.renderBufferDirect(T, null, V, Y, F, W)
  59009. }
  59010. }
  59011. else {
  59012. var Y = r(F, U, v, d)
  59013. e.renderBufferDirect(T, null, V, Y, F, null)
  59014. }
  59015. }
  59016. }
  59017. }
  59018. var X = e.getClearColor(),
  59019. Z = e.getClearAlpha()
  59020. e.setClearColor(X, Z),
  59021. s.enable(a.BLEND),
  59022. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  59023. (P.needsUpdate = !1)
  59024. }
  59025. })
  59026. }),
  59027. (n.WebGLState = function (e, t, i) {
  59028. var r = this,
  59029. o = new n.Vector4(),
  59030. a = new Uint8Array(16),
  59031. s = new Uint8Array(16),
  59032. l = new Uint8Array(16),
  59033. c = {},
  59034. h = null,
  59035. u = null,
  59036. d = null,
  59037. p = null,
  59038. f = null,
  59039. g = null,
  59040. m = null,
  59041. v = null,
  59042. A = !1,
  59043. y = null,
  59044. C = null,
  59045. I = null,
  59046. E = null,
  59047. b = null,
  59048. w = null,
  59049. _ = null,
  59050. T = null,
  59051. x = null,
  59052. S = null,
  59053. M = null,
  59054. R = null,
  59055. P = null,
  59056. O = null,
  59057. L = null,
  59058. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  59059. N = void 0,
  59060. B = {},
  59061. F = new n.Vector4(),
  59062. V = null,
  59063. U = null,
  59064. k = new n.Vector4(),
  59065. H = new n.Vector4(),
  59066. G = e.createTexture()
  59067. e.bindTexture(e.TEXTURE_2D, G),
  59068. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  59069. e.texImage2D(
  59070. e.TEXTURE_2D,
  59071. 0,
  59072. e.RGB,
  59073. 1,
  59074. 1,
  59075. 0,
  59076. e.RGB,
  59077. e.UNSIGNED_BYTE,
  59078. new Uint8Array(3)
  59079. ),
  59080. (this.init = function () {
  59081. this.clearColor(0, 0, 0, 1),
  59082. this.clearDepth(1),
  59083. this.clearStencil(0),
  59084. this.enable(e.DEPTH_TEST),
  59085. e.depthFunc(e.LEQUAL),
  59086. e.frontFace(e.CCW),
  59087. e.cullFace(e.BACK),
  59088. this.enable(e.CULL_FACE),
  59089. this.enable(e.BLEND),
  59090. e.blendEquation(e.FUNC_ADD),
  59091. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  59092. }),
  59093. (this.initAttributes = function () {
  59094. for (var e = 0, t = a.length; e < t; e++) a[e] = 0
  59095. }),
  59096. (this.enableAttribute = function (i) {
  59097. if (
  59098. ((a[i] = 1), 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)), 0 !== l[i])
  59099. ) {
  59100. var n = t.get('ANGLE_instanced_arrays')
  59101. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0)
  59102. }
  59103. }),
  59104. (this.enableAttributeAndDivisor = function (t, i, n) {
  59105. ;(a[t] = 1),
  59106. 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)),
  59107. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i))
  59108. }),
  59109. (this.disableUnusedAttributes = function () {
  59110. for (var t = 0, i = s.length; t < i; t++)
  59111. s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  59112. }),
  59113. (this.enable = function (t) {
  59114. c[t] !== !0 && (e.enable(t), (c[t] = !0))
  59115. }),
  59116. (this.disable = function (t) {
  59117. c[t] !== !1 && (e.disable(t), (c[t] = !1))
  59118. }),
  59119. (this.getCompressedTextureFormats = function () {
  59120. if (
  59121. null === h &&
  59122. ((h = []),
  59123. t.get('WEBGL_compressed_texture_pvrtc') ||
  59124. t.get('WEBGL_compressed_texture_s3tc') ||
  59125. t.get('WEBGL_compressed_texture_etc1'))
  59126. )
  59127. for (
  59128. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  59129. n < i.length;
  59130. n++
  59131. )
  59132. h.push(i[n])
  59133. return h
  59134. }),
  59135. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  59136. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  59137. (t === u && h === A) ||
  59138. (t === n.AdditiveBlending
  59139. ? h
  59140. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59141. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  59142. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  59143. : t === n.SubtractiveBlending
  59144. ? h
  59145. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59146. e.blendFuncSeparate(
  59147. e.ZERO,
  59148. e.ZERO,
  59149. e.ONE_MINUS_SRC_COLOR,
  59150. e.ONE_MINUS_SRC_ALPHA
  59151. ))
  59152. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  59153. : t === n.MultiplyBlending
  59154. ? h
  59155. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59156. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  59157. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  59158. : h
  59159. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59160. e.blendFuncSeparate(
  59161. e.ONE,
  59162. e.ONE_MINUS_SRC_ALPHA,
  59163. e.ONE,
  59164. e.ONE_MINUS_SRC_ALPHA
  59165. ))
  59166. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59167. e.blendFuncSeparate(
  59168. e.SRC_ALPHA,
  59169. e.ONE_MINUS_SRC_ALPHA,
  59170. e.ONE,
  59171. e.ONE_MINUS_SRC_ALPHA
  59172. )),
  59173. (u = t),
  59174. (A = h)),
  59175. t === n.CustomBlending
  59176. ? ((s = s || r),
  59177. (l = l || o),
  59178. (c = c || a),
  59179. (r === d && s === g) ||
  59180. (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  59181. (o === p && a === f && l === m && c === v) ||
  59182. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  59183. (p = o),
  59184. (f = a),
  59185. (m = l),
  59186. (v = c)))
  59187. : ((d = null), (p = null), (f = null), (g = null), (m = null), (v = null))
  59188. }),
  59189. (this.setDepthFunc = function (t) {
  59190. if (y !== t) {
  59191. if (t)
  59192. switch (t) {
  59193. case n.NeverDepth:
  59194. e.depthFunc(e.NEVER)
  59195. break
  59196. case n.AlwaysDepth:
  59197. e.depthFunc(e.ALWAYS)
  59198. break
  59199. case n.LessDepth:
  59200. e.depthFunc(e.LESS)
  59201. break
  59202. case n.LessEqualDepth:
  59203. e.depthFunc(e.LEQUAL)
  59204. break
  59205. case n.EqualDepth:
  59206. e.depthFunc(e.EQUAL)
  59207. break
  59208. case n.GreaterEqualDepth:
  59209. e.depthFunc(e.GEQUAL)
  59210. break
  59211. case n.GreaterDepth:
  59212. e.depthFunc(e.GREATER)
  59213. break
  59214. case n.NotEqualDepth:
  59215. e.depthFunc(e.NOTEQUAL)
  59216. break
  59217. default:
  59218. e.depthFunc(e.LEQUAL)
  59219. }
  59220. else e.depthFunc(e.LEQUAL)
  59221. y = t
  59222. }
  59223. }),
  59224. (this.setDepthTest = function (t) {
  59225. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  59226. }),
  59227. (this.setDepthWrite = function (t) {
  59228. C !== t && (e.depthMask(t), (C = t))
  59229. }),
  59230. (this.setColorWrite = function (t) {
  59231. I !== t && (e.colorMask(t, t, t, t), (I = t))
  59232. }),
  59233. (this.setStencilFunc = function (t, i, n) {
  59234. ;(b === t && w === i && _ === n) ||
  59235. (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n))
  59236. }),
  59237. (this.setStencilOp = function (t, i, n) {
  59238. ;(T === t && x === i && S === n) ||
  59239. (e.stencilOp(t, i, n), (T = t), (x = i), (S = n))
  59240. }),
  59241. (this.setStencilTest = function (t) {
  59242. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  59243. }),
  59244. (this.setStencilWrite = function (t) {
  59245. E !== t && (e.stencilMask(t), (E = t))
  59246. }),
  59247. (this.setFlipSided = function (t) {
  59248. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t))
  59249. }),
  59250. (this.setLineWidth = function (t) {
  59251. t !== R && (e.lineWidth(t), (R = t))
  59252. }),
  59253. (this.setPolygonOffset = function (t, i, n) {
  59254. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  59255. !t || (P === i && O === n) || (e.polygonOffset(i, n), (P = i), (O = n))
  59256. }),
  59257. (this.getScissorTest = function () {
  59258. return L
  59259. }),
  59260. (this.setScissorTest = function (t) {
  59261. ;(L = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  59262. }),
  59263. (this.activeTexture = function (t) {
  59264. void 0 === t && (t = e.TEXTURE0 + D - 1), N !== t && (e.activeTexture(t), (N = t))
  59265. }),
  59266. (this.bindTexture = function (t, i) {
  59267. void 0 === N && r.activeTexture()
  59268. var n = B[N]
  59269. void 0 === n &&
  59270. ((n = {
  59271. type: void 0,
  59272. texture: void 0
  59273. }),
  59274. (B[N] = n)),
  59275. (n.type === t && n.texture === i) ||
  59276. (e.bindTexture(t, i || G), (n.type = t), (n.texture = i))
  59277. }),
  59278. (this.compressedTexImage2D = function () {
  59279. try {
  59280. e.compressedTexImage2D.apply(e, arguments)
  59281. } catch (e) {
  59282. console.error(e)
  59283. }
  59284. }),
  59285. (this.texImage2D = function () {
  59286. try {
  59287. e.texImage2D.apply(e, arguments)
  59288. } catch (e) {
  59289. console.error(e)
  59290. }
  59291. }),
  59292. (this.clearColor = function (t, i, n, r) {
  59293. o.set(t, i, n, r), F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o))
  59294. }),
  59295. (this.clearDepth = function (t) {
  59296. V !== t && (e.clearDepth(t), (V = t))
  59297. }),
  59298. (this.clearStencil = function (t) {
  59299. U !== t && (e.clearStencil(t), (U = t))
  59300. }),
  59301. (this.scissor = function (t) {
  59302. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), k.copy(t))
  59303. }),
  59304. (this.viewport = function (t) {
  59305. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), H.copy(t))
  59306. }),
  59307. (this.reset = function () {
  59308. for (var t = 0; t < s.length; t++)
  59309. 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  59310. ;(c = {}),
  59311. (h = null),
  59312. (N = void 0),
  59313. (B = {}),
  59314. (u = null),
  59315. (I = null),
  59316. (C = null),
  59317. (E = null),
  59318. (M = null)
  59319. })
  59320. }),
  59321. (n.LensFlarePlugin = function (e, t) {
  59322. function i() {
  59323. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  59324. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  59325. ;(o = p.createBuffer()),
  59326. (a = p.createBuffer()),
  59327. p.bindBuffer(p.ARRAY_BUFFER, o),
  59328. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  59329. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59330. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  59331. (u = p.createTexture()),
  59332. (d = p.createTexture()),
  59333. f.bindTexture(p.TEXTURE_2D, u),
  59334. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  59335. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59336. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59337. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59338. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59339. f.bindTexture(p.TEXTURE_2D, d),
  59340. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  59341. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59342. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59343. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59344. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59345. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0)
  59346. var i
  59347. ;(i = h
  59348. ? {
  59349. vertexShader: [
  59350. 'uniform lowp int renderType;',
  59351. 'uniform vec3 screenPosition;',
  59352. 'uniform vec2 scale;',
  59353. 'uniform float rotation;',
  59354. 'uniform sampler2D occlusionMap;',
  59355. 'attribute vec2 position;',
  59356. 'attribute vec2 uv;',
  59357. 'varying vec2 vUV;',
  59358. 'varying float vVisibility;',
  59359. 'void main() {',
  59360. 'vUV = uv;',
  59361. 'vec2 pos = position;',
  59362. 'if ( renderType == 2 ) {',
  59363. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  59364. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  59365. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  59366. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  59367. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  59368. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  59369. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  59370. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  59371. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  59372. 'vVisibility = visibility.r / 9.0;',
  59373. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  59374. 'vVisibility *= visibility.b / 9.0;',
  59375. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  59376. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59377. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59378. '}',
  59379. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59380. '}'
  59381. ].join('\n'),
  59382. fragmentShader: [
  59383. 'uniform lowp int renderType;',
  59384. 'uniform sampler2D map;',
  59385. 'uniform float opacity;',
  59386. 'uniform vec3 color;',
  59387. 'varying vec2 vUV;',
  59388. 'varying float vVisibility;',
  59389. 'void main() {',
  59390. 'if ( renderType == 0 ) {',
  59391. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  59392. '} else if ( renderType == 1 ) {',
  59393. 'gl_FragColor = texture2D( map, vUV );',
  59394. '} else {',
  59395. 'vec4 texture = texture2D( map, vUV );',
  59396. 'texture.a *= opacity * vVisibility;',
  59397. 'gl_FragColor = texture;',
  59398. 'gl_FragColor.rgb *= color;',
  59399. '}',
  59400. '}'
  59401. ].join('\n')
  59402. }
  59403. : {
  59404. vertexShader: [
  59405. 'uniform lowp int renderType;',
  59406. 'uniform vec3 screenPosition;',
  59407. 'uniform vec2 scale;',
  59408. 'uniform float rotation;',
  59409. 'attribute vec2 position;',
  59410. 'attribute vec2 uv;',
  59411. 'varying vec2 vUV;',
  59412. 'void main() {',
  59413. 'vUV = uv;',
  59414. 'vec2 pos = position;',
  59415. 'if ( renderType == 2 ) {',
  59416. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59417. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59418. '}',
  59419. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59420. '}'
  59421. ].join('\n'),
  59422. fragmentShader: [
  59423. 'precision mediump float;',
  59424. 'uniform lowp int renderType;',
  59425. 'uniform sampler2D map;',
  59426. 'uniform sampler2D occlusionMap;',
  59427. 'uniform float opacity;',
  59428. 'uniform vec3 color;',
  59429. 'varying vec2 vUV;',
  59430. 'void main() {',
  59431. 'if ( renderType == 0 ) {',
  59432. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  59433. '} else if ( renderType == 1 ) {',
  59434. 'gl_FragColor = texture2D( map, vUV );',
  59435. '} else {',
  59436. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  59437. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  59438. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  59439. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  59440. 'visibility = ( 1.0 - visibility / 4.0 );',
  59441. 'vec4 texture = texture2D( map, vUV );',
  59442. 'texture.a *= opacity * visibility;',
  59443. 'gl_FragColor = texture;',
  59444. 'gl_FragColor.rgb *= color;',
  59445. '}',
  59446. '}'
  59447. ].join('\n')
  59448. }),
  59449. (s = r(i)),
  59450. (l = {
  59451. vertex: p.getAttribLocation(s, 'position'),
  59452. uv: p.getAttribLocation(s, 'uv')
  59453. }),
  59454. (c = {
  59455. renderType: p.getUniformLocation(s, 'renderType'),
  59456. map: p.getUniformLocation(s, 'map'),
  59457. occlusionMap: p.getUniformLocation(s, 'occlusionMap'),
  59458. opacity: p.getUniformLocation(s, 'opacity'),
  59459. color: p.getUniformLocation(s, 'color'),
  59460. scale: p.getUniformLocation(s, 'scale'),
  59461. rotation: p.getUniformLocation(s, 'rotation'),
  59462. screenPosition: p.getUniformLocation(s, 'screenPosition')
  59463. })
  59464. }
  59465. function r(t) {
  59466. var i = p.createProgram(),
  59467. n = p.createShader(p.FRAGMENT_SHADER),
  59468. r = p.createShader(p.VERTEX_SHADER),
  59469. o = 'precision ' + e.getPrecision() + ' float;\n'
  59470. return (
  59471. p.shaderSource(n, o + t.fragmentShader),
  59472. p.shaderSource(r, o + t.vertexShader),
  59473. p.compileShader(n),
  59474. p.compileShader(r),
  59475. p.attachShader(i, n),
  59476. p.attachShader(i, r),
  59477. p.linkProgram(i),
  59478. i
  59479. )
  59480. }
  59481. var o,
  59482. a,
  59483. s,
  59484. l,
  59485. c,
  59486. h,
  59487. u,
  59488. d,
  59489. p = e.context,
  59490. f = e.state
  59491. this.render = function (r, g, m) {
  59492. if (0 !== t.length) {
  59493. var v = new n.Vector3(),
  59494. A = m.w / m.z,
  59495. y = 0.5 * m.z,
  59496. C = 0.5 * m.w,
  59497. I = 16 / m.w,
  59498. E = new n.Vector2(I * A, I),
  59499. b = new n.Vector3(1, 1, 0),
  59500. w = new n.Vector2(1, 1)
  59501. void 0 === s && i(),
  59502. p.useProgram(s),
  59503. f.initAttributes(),
  59504. f.enableAttribute(l.vertex),
  59505. f.enableAttribute(l.uv),
  59506. f.disableUnusedAttributes(),
  59507. p.uniform1i(c.occlusionMap, 0),
  59508. p.uniform1i(c.map, 1),
  59509. p.bindBuffer(p.ARRAY_BUFFER, o),
  59510. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  59511. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  59512. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59513. f.disable(p.CULL_FACE),
  59514. f.setDepthWrite(!1)
  59515. for (var _ = 0, T = t.length; _ < T; _++) {
  59516. ;(I = 16 / m.w), E.set(I * A, I)
  59517. var x = t[_]
  59518. if (
  59519. (v.set(
  59520. x.matrixWorld.elements[12],
  59521. x.matrixWorld.elements[13],
  59522. x.matrixWorld.elements[14]
  59523. ),
  59524. v.applyMatrix4(g.matrixWorldInverse),
  59525. v.applyProjection(g.projectionMatrix),
  59526. b.copy(v),
  59527. (w.x = b.x * y + y),
  59528. (w.y = b.y * C + C),
  59529. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  59530. ) {
  59531. f.activeTexture(p.TEXTURE0),
  59532. f.bindTexture(p.TEXTURE_2D, null),
  59533. f.activeTexture(p.TEXTURE1),
  59534. f.bindTexture(p.TEXTURE_2D, u),
  59535. p.copyTexImage2D(
  59536. p.TEXTURE_2D,
  59537. 0,
  59538. p.RGB,
  59539. m.x + w.x - 8,
  59540. m.y + w.y - 8,
  59541. 16,
  59542. 16,
  59543. 0
  59544. ),
  59545. p.uniform1i(c.renderType, 0),
  59546. p.uniform2f(c.scale, E.x, E.y),
  59547. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59548. f.disable(p.BLEND),
  59549. f.enable(p.DEPTH_TEST),
  59550. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59551. f.activeTexture(p.TEXTURE0),
  59552. f.bindTexture(p.TEXTURE_2D, d),
  59553. p.copyTexImage2D(
  59554. p.TEXTURE_2D,
  59555. 0,
  59556. p.RGBA,
  59557. m.x + w.x - 8,
  59558. m.y + w.y - 8,
  59559. 16,
  59560. 16,
  59561. 0
  59562. ),
  59563. p.uniform1i(c.renderType, 1),
  59564. f.disable(p.DEPTH_TEST),
  59565. f.activeTexture(p.TEXTURE1),
  59566. f.bindTexture(p.TEXTURE_2D, u),
  59567. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59568. x.positionScreen.copy(b),
  59569. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  59570. p.uniform1i(c.renderType, 2),
  59571. f.enable(p.BLEND)
  59572. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  59573. var R = x.lensFlares[S]
  59574. R.opacity > 0.001 &&
  59575. R.scale > 0.001 &&
  59576. ((b.x = R.x),
  59577. (b.y = R.y),
  59578. (b.z = R.z),
  59579. (I = (R.size * R.scale) / m.w),
  59580. (E.x = I * A),
  59581. (E.y = I),
  59582. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59583. p.uniform2f(c.scale, E.x, E.y),
  59584. p.uniform1f(c.rotation, R.rotation),
  59585. p.uniform1f(c.opacity, R.opacity),
  59586. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  59587. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  59588. e.setTexture(R.texture, 1),
  59589. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  59590. }
  59591. }
  59592. }
  59593. f.enable(p.CULL_FACE), f.enable(p.DEPTH_TEST), f.setDepthWrite(!0), e.resetGLState()
  59594. }
  59595. }
  59596. }),
  59597. (n.SpritePlugin = function (e, t) {
  59598. function i() {
  59599. var e = new Float32Array([
  59600. -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1
  59601. ]),
  59602. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  59603. ;(a = d.createBuffer()),
  59604. (s = d.createBuffer()),
  59605. d.bindBuffer(d.ARRAY_BUFFER, a),
  59606. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  59607. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59608. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  59609. (l = r()),
  59610. (c = {
  59611. position: d.getAttribLocation(l, 'position'),
  59612. uv: d.getAttribLocation(l, 'uv')
  59613. }),
  59614. (h = {
  59615. uvOffset: d.getUniformLocation(l, 'uvOffset'),
  59616. uvScale: d.getUniformLocation(l, 'uvScale'),
  59617. rotation: d.getUniformLocation(l, 'rotation'),
  59618. scale: d.getUniformLocation(l, 'scale'),
  59619. color: d.getUniformLocation(l, 'color'),
  59620. map: d.getUniformLocation(l, 'map'),
  59621. opacity: d.getUniformLocation(l, 'opacity'),
  59622. modelViewMatrix: d.getUniformLocation(l, 'modelViewMatrix'),
  59623. projectionMatrix: d.getUniformLocation(l, 'projectionMatrix'),
  59624. fogType: d.getUniformLocation(l, 'fogType'),
  59625. fogDensity: d.getUniformLocation(l, 'fogDensity'),
  59626. fogNear: d.getUniformLocation(l, 'fogNear'),
  59627. fogFar: d.getUniformLocation(l, 'fogFar'),
  59628. fogColor: d.getUniformLocation(l, 'fogColor'),
  59629. alphaTest: d.getUniformLocation(l, 'alphaTest')
  59630. })
  59631. var i = document.createElement('canvas')
  59632. ;(i.width = 8), (i.height = 8)
  59633. var o = i.getContext('2d')
  59634. ;(o.fillStyle = 'white'),
  59635. o.fillRect(0, 0, 8, 8),
  59636. (u = new n.Texture(i)),
  59637. (u.needsUpdate = !0)
  59638. }
  59639. function r() {
  59640. var t = d.createProgram(),
  59641. i = d.createShader(d.VERTEX_SHADER),
  59642. n = d.createShader(d.FRAGMENT_SHADER)
  59643. return (
  59644. d.shaderSource(
  59645. i,
  59646. [
  59647. 'precision ' + e.getPrecision() + ' float;',
  59648. 'uniform mat4 modelViewMatrix;',
  59649. 'uniform mat4 projectionMatrix;',
  59650. 'uniform float rotation;',
  59651. 'uniform vec2 scale;',
  59652. 'uniform vec2 uvOffset;',
  59653. 'uniform vec2 uvScale;',
  59654. 'attribute vec2 position;',
  59655. 'attribute vec2 uv;',
  59656. 'varying vec2 vUV;',
  59657. 'void main() {',
  59658. 'vUV = uvOffset + uv * uvScale;',
  59659. 'vec2 alignedPosition = position * scale;',
  59660. 'vec2 rotatedPosition;',
  59661. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  59662. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  59663. 'vec4 finalPosition;',
  59664. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  59665. 'finalPosition.xy += rotatedPosition;',
  59666. 'finalPosition = projectionMatrix * finalPosition;',
  59667. 'gl_Position = finalPosition;',
  59668. '}'
  59669. ].join('\n')
  59670. ),
  59671. d.shaderSource(
  59672. n,
  59673. [
  59674. 'precision ' + e.getPrecision() + ' float;',
  59675. 'uniform vec3 color;',
  59676. 'uniform sampler2D map;',
  59677. 'uniform float opacity;',
  59678. 'uniform int fogType;',
  59679. 'uniform vec3 fogColor;',
  59680. 'uniform float fogDensity;',
  59681. 'uniform float fogNear;',
  59682. 'uniform float fogFar;',
  59683. 'uniform float alphaTest;',
  59684. 'varying vec2 vUV;',
  59685. 'void main() {',
  59686. 'vec4 texture = texture2D( map, vUV );',
  59687. 'if ( texture.a < alphaTest ) discard;',
  59688. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  59689. 'if ( fogType > 0 ) {',
  59690. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  59691. 'float fogFactor = 0.0;',
  59692. 'if ( fogType == 1 ) {',
  59693. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  59694. '} else {',
  59695. 'const float LOG2 = 1.442695;',
  59696. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  59697. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  59698. '}',
  59699. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  59700. '}',
  59701. '}'
  59702. ].join('\n')
  59703. ),
  59704. d.compileShader(i),
  59705. d.compileShader(n),
  59706. d.attachShader(t, i),
  59707. d.attachShader(t, n),
  59708. d.linkProgram(t),
  59709. t
  59710. )
  59711. }
  59712. function o(e, t) {
  59713. return e.renderOrder !== t.renderOrder
  59714. ? e.renderOrder - t.renderOrder
  59715. : e.z !== t.z
  59716. ? t.z - e.z
  59717. : t.id - e.id
  59718. }
  59719. var a,
  59720. s,
  59721. l,
  59722. c,
  59723. h,
  59724. u,
  59725. d = e.context,
  59726. p = e.state,
  59727. f = new n.Vector3(),
  59728. g = new n.Quaternion(),
  59729. m = new n.Vector3()
  59730. this.render = function (r, v) {
  59731. if (0 !== t.length) {
  59732. void 0 === l && i(),
  59733. d.useProgram(l),
  59734. p.initAttributes(),
  59735. p.enableAttribute(c.position),
  59736. p.enableAttribute(c.uv),
  59737. p.disableUnusedAttributes(),
  59738. p.disable(d.CULL_FACE),
  59739. p.enable(d.BLEND),
  59740. d.bindBuffer(d.ARRAY_BUFFER, a),
  59741. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  59742. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  59743. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59744. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  59745. p.activeTexture(d.TEXTURE0),
  59746. d.uniform1i(h.map, 0)
  59747. var A = 0,
  59748. y = 0,
  59749. C = r.fog
  59750. C
  59751. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  59752. C instanceof n.Fog
  59753. ? (d.uniform1f(h.fogNear, C.near),
  59754. d.uniform1f(h.fogFar, C.far),
  59755. d.uniform1i(h.fogType, 1),
  59756. (A = 1),
  59757. (y = 1))
  59758. : C instanceof n.FogExp2 &&
  59759. (d.uniform1f(h.fogDensity, C.density),
  59760. d.uniform1i(h.fogType, 2),
  59761. (A = 2),
  59762. (y = 2)))
  59763. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0))
  59764. for (var I = 0, E = t.length; I < E; I++) {
  59765. var b = t[I]
  59766. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  59767. (b.z = -b.modelViewMatrix.elements[14])
  59768. }
  59769. t.sort(o)
  59770. for (var w = [], I = 0, E = t.length; I < E; I++) {
  59771. var b = t[I],
  59772. _ = b.material
  59773. d.uniform1f(h.alphaTest, _.alphaTest),
  59774. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  59775. b.matrixWorld.decompose(f, g, m),
  59776. (w[0] = m.x),
  59777. (w[1] = m.y)
  59778. var T = 0
  59779. r.fog && _.fog && (T = y),
  59780. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  59781. null !== _.map
  59782. ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  59783. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  59784. : (d.uniform2f(h.uvOffset, 0, 0), d.uniform2f(h.uvScale, 1, 1)),
  59785. d.uniform1f(h.opacity, _.opacity),
  59786. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  59787. d.uniform1f(h.rotation, _.rotation),
  59788. d.uniform2fv(h.scale, w),
  59789. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  59790. p.setDepthTest(_.depthTest),
  59791. p.setDepthWrite(_.depthWrite),
  59792. _.map && _.map.image && _.map.image.width
  59793. ? e.setTexture(_.map, 0)
  59794. : e.setTexture(u, 0),
  59795. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  59796. }
  59797. p.enable(d.CULL_FACE), e.resetGLState()
  59798. }
  59799. }
  59800. }),
  59801. Object.defineProperties(n.Box2.prototype, {
  59802. empty: {
  59803. value: function () {
  59804. return (
  59805. console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'),
  59806. this.isEmpty()
  59807. )
  59808. }
  59809. },
  59810. isIntersectionBox: {
  59811. value: function (e) {
  59812. return (
  59813. console.warn(
  59814. 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'
  59815. ),
  59816. this.intersectsBox(e)
  59817. )
  59818. }
  59819. }
  59820. }),
  59821. Object.defineProperties(n.Box3.prototype, {
  59822. empty: {
  59823. value: function () {
  59824. return (
  59825. console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'),
  59826. this.isEmpty()
  59827. )
  59828. }
  59829. },
  59830. isIntersectionBox: {
  59831. value: function (e) {
  59832. return (
  59833. console.warn(
  59834. 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'
  59835. ),
  59836. this.intersectsBox(e)
  59837. )
  59838. }
  59839. },
  59840. isIntersectionSphere: {
  59841. value: function (e) {
  59842. return (
  59843. console.warn(
  59844. 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  59845. ),
  59846. this.intersectsSphere(e)
  59847. )
  59848. }
  59849. }
  59850. }),
  59851. Object.defineProperties(n.Matrix3.prototype, {
  59852. multiplyVector3: {
  59853. value: function (e) {
  59854. return (
  59855. console.warn(
  59856. 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'
  59857. ),
  59858. e.applyMatrix3(this)
  59859. )
  59860. }
  59861. },
  59862. multiplyVector3Array: {
  59863. value: function (e) {
  59864. return (
  59865. console.warn(
  59866. 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59867. ),
  59868. this.applyToVector3Array(e)
  59869. )
  59870. }
  59871. }
  59872. }),
  59873. Object.defineProperties(n.Matrix4.prototype, {
  59874. extractPosition: {
  59875. value: function (e) {
  59876. return (
  59877. console.warn(
  59878. 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'
  59879. ),
  59880. this.copyPosition(e)
  59881. )
  59882. }
  59883. },
  59884. setRotationFromQuaternion: {
  59885. value: function (e) {
  59886. return (
  59887. console.warn(
  59888. 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'
  59889. ),
  59890. this.makeRotationFromQuaternion(e)
  59891. )
  59892. }
  59893. },
  59894. multiplyVector3: {
  59895. value: function (e) {
  59896. return (
  59897. console.warn(
  59898. 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'
  59899. ),
  59900. e.applyProjection(this)
  59901. )
  59902. }
  59903. },
  59904. multiplyVector4: {
  59905. value: function (e) {
  59906. return (
  59907. console.warn(
  59908. 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59909. ),
  59910. e.applyMatrix4(this)
  59911. )
  59912. }
  59913. },
  59914. multiplyVector3Array: {
  59915. value: function (e) {
  59916. return (
  59917. console.warn(
  59918. 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59919. ),
  59920. this.applyToVector3Array(e)
  59921. )
  59922. }
  59923. },
  59924. rotateAxis: {
  59925. value: function (e) {
  59926. console.warn(
  59927. 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'
  59928. ),
  59929. e.transformDirection(this)
  59930. }
  59931. },
  59932. crossVector: {
  59933. value: function (e) {
  59934. return (
  59935. console.warn(
  59936. 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59937. ),
  59938. e.applyMatrix4(this)
  59939. )
  59940. }
  59941. },
  59942. translate: {
  59943. value: function (e) {
  59944. console.error('THREE.Matrix4: .translate() has been removed.')
  59945. }
  59946. },
  59947. rotateX: {
  59948. value: function (e) {
  59949. console.error('THREE.Matrix4: .rotateX() has been removed.')
  59950. }
  59951. },
  59952. rotateY: {
  59953. value: function (e) {
  59954. console.error('THREE.Matrix4: .rotateY() has been removed.')
  59955. }
  59956. },
  59957. rotateZ: {
  59958. value: function (e) {
  59959. console.error('THREE.Matrix4: .rotateZ() has been removed.')
  59960. }
  59961. },
  59962. rotateByAxis: {
  59963. value: function (e, t) {
  59964. console.error('THREE.Matrix4: .rotateByAxis() has been removed.')
  59965. }
  59966. }
  59967. }),
  59968. Object.defineProperties(n.Plane.prototype, {
  59969. isIntersectionLine: {
  59970. value: function (e) {
  59971. return (
  59972. console.warn(
  59973. 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'
  59974. ),
  59975. this.intersectsLine(e)
  59976. )
  59977. }
  59978. }
  59979. }),
  59980. Object.defineProperties(n.Quaternion.prototype, {
  59981. multiplyVector3: {
  59982. value: function (e) {
  59983. return (
  59984. console.warn(
  59985. 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'
  59986. ),
  59987. e.applyQuaternion(this)
  59988. )
  59989. }
  59990. }
  59991. }),
  59992. Object.defineProperties(n.Ray.prototype, {
  59993. isIntersectionBox: {
  59994. value: function (e) {
  59995. return (
  59996. console.warn(
  59997. 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'
  59998. ),
  59999. this.intersectsBox(e)
  60000. )
  60001. }
  60002. },
  60003. isIntersectionPlane: {
  60004. value: function (e) {
  60005. return (
  60006. console.warn(
  60007. 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'
  60008. ),
  60009. this.intersectsPlane(e)
  60010. )
  60011. }
  60012. },
  60013. isIntersectionSphere: {
  60014. value: function (e) {
  60015. return (
  60016. console.warn(
  60017. 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  60018. ),
  60019. this.intersectsSphere(e)
  60020. )
  60021. }
  60022. }
  60023. }),
  60024. Object.defineProperties(n.Vector3.prototype, {
  60025. setEulerFromRotationMatrix: {
  60026. value: function () {
  60027. console.error(
  60028. 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.'
  60029. )
  60030. }
  60031. },
  60032. setEulerFromQuaternion: {
  60033. value: function () {
  60034. console.error(
  60035. 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.'
  60036. )
  60037. }
  60038. },
  60039. getPositionFromMatrix: {
  60040. value: function (e) {
  60041. return (
  60042. console.warn(
  60043. 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'
  60044. ),
  60045. this.setFromMatrixPosition(e)
  60046. )
  60047. }
  60048. },
  60049. getScaleFromMatrix: {
  60050. value: function (e) {
  60051. return (
  60052. console.warn(
  60053. 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'
  60054. ),
  60055. this.setFromMatrixScale(e)
  60056. )
  60057. }
  60058. },
  60059. getColumnFromMatrix: {
  60060. value: function (e, t) {
  60061. return (
  60062. console.warn(
  60063. 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'
  60064. ),
  60065. this.setFromMatrixColumn(e, t)
  60066. )
  60067. }
  60068. }
  60069. }),
  60070. (n.Face4 = function (e, t, i, r, o, a, s) {
  60071. return (
  60072. console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'),
  60073. new n.Face3(e, t, i, o, a, s)
  60074. )
  60075. }),
  60076. (n.Vertex = function (e, t, i) {
  60077. return (
  60078. console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'),
  60079. new n.Vector3(e, t, i)
  60080. )
  60081. }),
  60082. Object.defineProperties(n.Object3D.prototype, {
  60083. eulerOrder: {
  60084. get: function () {
  60085. return (
  60086. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  60087. this.rotation.order
  60088. )
  60089. },
  60090. set: function (e) {
  60091. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  60092. (this.rotation.order = e)
  60093. }
  60094. },
  60095. getChildByName: {
  60096. value: function (e) {
  60097. return (
  60098. console.warn(
  60099. 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'
  60100. ),
  60101. this.getObjectByName(e)
  60102. )
  60103. }
  60104. },
  60105. renderDepth: {
  60106. set: function (e) {
  60107. console.warn(
  60108. 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.'
  60109. )
  60110. }
  60111. },
  60112. translate: {
  60113. value: function (e, t) {
  60114. return (
  60115. console.warn(
  60116. 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'
  60117. ),
  60118. this.translateOnAxis(t, e)
  60119. )
  60120. }
  60121. },
  60122. useQuaternion: {
  60123. get: function () {
  60124. console.warn(
  60125. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60126. )
  60127. },
  60128. set: function (e) {
  60129. console.warn(
  60130. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60131. )
  60132. }
  60133. }
  60134. }),
  60135. Object.defineProperties(n, {
  60136. PointCloud: {
  60137. value: function (e, t) {
  60138. return (
  60139. console.warn('THREE.PointCloud has been renamed to THREE.Points.'),
  60140. new n.Points(e, t)
  60141. )
  60142. }
  60143. },
  60144. ParticleSystem: {
  60145. value: function (e, t) {
  60146. return (
  60147. console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'),
  60148. new n.Points(e, t)
  60149. )
  60150. }
  60151. }
  60152. }),
  60153. Object.defineProperties(n.Light.prototype, {
  60154. onlyShadow: {
  60155. set: function (e) {
  60156. console.warn('THREE.Light: .onlyShadow has been removed.')
  60157. }
  60158. },
  60159. shadowCameraFov: {
  60160. set: function (e) {
  60161. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'),
  60162. (this.shadow.camera.fov = e)
  60163. }
  60164. },
  60165. shadowCameraLeft: {
  60166. set: function (e) {
  60167. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'),
  60168. (this.shadow.camera.left = e)
  60169. }
  60170. },
  60171. shadowCameraRight: {
  60172. set: function (e) {
  60173. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'),
  60174. (this.shadow.camera.right = e)
  60175. }
  60176. },
  60177. shadowCameraTop: {
  60178. set: function (e) {
  60179. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'),
  60180. (this.shadow.camera.top = e)
  60181. }
  60182. },
  60183. shadowCameraBottom: {
  60184. set: function (e) {
  60185. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'),
  60186. (this.shadow.camera.bottom = e)
  60187. }
  60188. },
  60189. shadowCameraNear: {
  60190. set: function (e) {
  60191. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'),
  60192. (this.shadow.camera.near = e)
  60193. }
  60194. },
  60195. shadowCameraFar: {
  60196. set: function (e) {
  60197. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'),
  60198. (this.shadow.camera.far = e)
  60199. }
  60200. },
  60201. shadowCameraVisible: {
  60202. set: function (e) {
  60203. console.warn(
  60204. 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.'
  60205. )
  60206. }
  60207. },
  60208. shadowBias: {
  60209. set: function (e) {
  60210. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'),
  60211. (this.shadow.bias = e)
  60212. }
  60213. },
  60214. shadowDarkness: {
  60215. set: function (e) {
  60216. console.warn('THREE.Light: .shadowDarkness has been removed.')
  60217. }
  60218. },
  60219. shadowMapWidth: {
  60220. set: function (e) {
  60221. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'),
  60222. (this.shadow.mapSize.width = e)
  60223. }
  60224. },
  60225. shadowMapHeight: {
  60226. set: function (e) {
  60227. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'),
  60228. (this.shadow.mapSize.height = e)
  60229. }
  60230. }
  60231. }),
  60232. Object.defineProperties(n.BufferAttribute.prototype, {
  60233. length: {
  60234. get: function () {
  60235. return (
  60236. console.warn(
  60237. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  60238. ),
  60239. this.array.length
  60240. )
  60241. }
  60242. }
  60243. }),
  60244. Object.defineProperties(n.BufferGeometry.prototype, {
  60245. drawcalls: {
  60246. get: function () {
  60247. return (
  60248. console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'),
  60249. this.groups
  60250. )
  60251. }
  60252. },
  60253. offsets: {
  60254. get: function () {
  60255. return (
  60256. console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'),
  60257. this.groups
  60258. )
  60259. }
  60260. },
  60261. addIndex: {
  60262. value: function (e) {
  60263. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'),
  60264. this.setIndex(e)
  60265. }
  60266. },
  60267. addDrawCall: {
  60268. value: function (e, t, i) {
  60269. void 0 !== i &&
  60270. console.warn(
  60271. 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'
  60272. ),
  60273. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  60274. this.addGroup(e, t)
  60275. }
  60276. },
  60277. clearDrawCalls: {
  60278. value: function () {
  60279. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'),
  60280. this.clearGroups()
  60281. }
  60282. },
  60283. computeTangents: {
  60284. value: function () {
  60285. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.')
  60286. }
  60287. },
  60288. computeOffsets: {
  60289. value: function () {
  60290. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.')
  60291. }
  60292. }
  60293. }),
  60294. Object.defineProperties(n.Material.prototype, {
  60295. wrapAround: {
  60296. get: function () {
  60297. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  60298. },
  60299. set: function (e) {
  60300. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  60301. }
  60302. },
  60303. wrapRGB: {
  60304. get: function () {
  60305. return (
  60306. console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new n.Color()
  60307. )
  60308. }
  60309. }
  60310. }),
  60311. Object.defineProperties(n, {
  60312. PointCloudMaterial: {
  60313. value: function (e) {
  60314. return (
  60315. console.warn(
  60316. 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'
  60317. ),
  60318. new n.PointsMaterial(e)
  60319. )
  60320. }
  60321. },
  60322. ParticleBasicMaterial: {
  60323. value: function (e) {
  60324. return (
  60325. console.warn(
  60326. 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'
  60327. ),
  60328. new n.PointsMaterial(e)
  60329. )
  60330. }
  60331. },
  60332. ParticleSystemMaterial: {
  60333. value: function (e) {
  60334. return (
  60335. console.warn(
  60336. 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'
  60337. ),
  60338. new n.PointsMaterial(e)
  60339. )
  60340. }
  60341. }
  60342. }),
  60343. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  60344. metal: {
  60345. get: function () {
  60346. return (
  60347. console.warn(
  60348. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'
  60349. ),
  60350. !1
  60351. )
  60352. },
  60353. set: function (e) {
  60354. console.warn(
  60355. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead'
  60356. )
  60357. }
  60358. }
  60359. }),
  60360. Object.defineProperties(n.ShaderMaterial.prototype, {
  60361. derivatives: {
  60362. get: function () {
  60363. return (
  60364. console.warn(
  60365. 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60366. ),
  60367. this.extensions.derivatives
  60368. )
  60369. },
  60370. set: function (e) {
  60371. console.warn(
  60372. 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60373. ),
  60374. (this.extensions.derivatives = e)
  60375. }
  60376. }
  60377. }),
  60378. Object.defineProperties(n.WebGLRenderer.prototype, {
  60379. supportsFloatTextures: {
  60380. value: function () {
  60381. return (
  60382. console.warn(
  60383. "THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."
  60384. ),
  60385. this.extensions.get('OES_texture_float')
  60386. )
  60387. }
  60388. },
  60389. supportsHalfFloatTextures: {
  60390. value: function () {
  60391. return (
  60392. console.warn(
  60393. "THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."
  60394. ),
  60395. this.extensions.get('OES_texture_half_float')
  60396. )
  60397. }
  60398. },
  60399. supportsStandardDerivatives: {
  60400. value: function () {
  60401. return (
  60402. console.warn(
  60403. "THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."
  60404. ),
  60405. this.extensions.get('OES_standard_derivatives')
  60406. )
  60407. }
  60408. },
  60409. supportsCompressedTextureS3TC: {
  60410. value: function () {
  60411. return (
  60412. console.warn(
  60413. "THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."
  60414. ),
  60415. this.extensions.get('WEBGL_compressed_texture_s3tc')
  60416. )
  60417. }
  60418. },
  60419. supportsCompressedTexturePVRTC: {
  60420. value: function () {
  60421. return (
  60422. console.warn(
  60423. "THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."
  60424. ),
  60425. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  60426. )
  60427. }
  60428. },
  60429. supportsBlendMinMax: {
  60430. value: function () {
  60431. return (
  60432. console.warn(
  60433. "THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."
  60434. ),
  60435. this.extensions.get('EXT_blend_minmax')
  60436. )
  60437. }
  60438. },
  60439. supportsVertexTextures: {
  60440. value: function () {
  60441. return this.capabilities.vertexTextures
  60442. }
  60443. },
  60444. supportsInstancedArrays: {
  60445. value: function () {
  60446. return (
  60447. console.warn(
  60448. "THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."
  60449. ),
  60450. this.extensions.get('ANGLE_instanced_arrays')
  60451. )
  60452. }
  60453. },
  60454. enableScissorTest: {
  60455. value: function (e) {
  60456. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'),
  60457. this.setScissorTest(e)
  60458. }
  60459. },
  60460. initMaterial: {
  60461. value: function () {
  60462. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.')
  60463. }
  60464. },
  60465. addPrePlugin: {
  60466. value: function () {
  60467. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.')
  60468. }
  60469. },
  60470. addPostPlugin: {
  60471. value: function () {
  60472. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.')
  60473. }
  60474. },
  60475. updateShadowMap: {
  60476. value: function () {
  60477. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.')
  60478. }
  60479. },
  60480. shadowMapEnabled: {
  60481. get: function () {
  60482. return this.shadowMap.enabled
  60483. },
  60484. set: function (e) {
  60485. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'),
  60486. (this.shadowMap.enabled = e)
  60487. }
  60488. },
  60489. shadowMapType: {
  60490. get: function () {
  60491. return this.shadowMap.type
  60492. },
  60493. set: function (e) {
  60494. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'),
  60495. (this.shadowMap.type = e)
  60496. }
  60497. },
  60498. shadowMapCullFace: {
  60499. get: function () {
  60500. return this.shadowMap.cullFace
  60501. },
  60502. set: function (e) {
  60503. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'),
  60504. (this.shadowMap.cullFace = e)
  60505. }
  60506. }
  60507. }),
  60508. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  60509. wrapS: {
  60510. get: function () {
  60511. return (
  60512. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60513. this.texture.wrapS
  60514. )
  60515. },
  60516. set: function (e) {
  60517. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60518. (this.texture.wrapS = e)
  60519. }
  60520. },
  60521. wrapT: {
  60522. get: function () {
  60523. return (
  60524. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60525. this.texture.wrapT
  60526. )
  60527. },
  60528. set: function (e) {
  60529. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60530. (this.texture.wrapT = e)
  60531. }
  60532. },
  60533. magFilter: {
  60534. get: function () {
  60535. return (
  60536. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60537. this.texture.magFilter
  60538. )
  60539. },
  60540. set: function (e) {
  60541. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60542. (this.texture.magFilter = e)
  60543. }
  60544. },
  60545. minFilter: {
  60546. get: function () {
  60547. return (
  60548. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60549. this.texture.minFilter
  60550. )
  60551. },
  60552. set: function (e) {
  60553. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60554. (this.texture.minFilter = e)
  60555. }
  60556. },
  60557. anisotropy: {
  60558. get: function () {
  60559. return (
  60560. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60561. this.texture.anisotropy
  60562. )
  60563. },
  60564. set: function (e) {
  60565. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60566. (this.texture.anisotropy = e)
  60567. }
  60568. },
  60569. offset: {
  60570. get: function () {
  60571. return (
  60572. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60573. this.texture.offset
  60574. )
  60575. },
  60576. set: function (e) {
  60577. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60578. (this.texture.offset = e)
  60579. }
  60580. },
  60581. repeat: {
  60582. get: function () {
  60583. return (
  60584. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60585. this.texture.repeat
  60586. )
  60587. },
  60588. set: function (e) {
  60589. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60590. (this.texture.repeat = e)
  60591. }
  60592. },
  60593. format: {
  60594. get: function () {
  60595. return (
  60596. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60597. this.texture.format
  60598. )
  60599. },
  60600. set: function (e) {
  60601. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60602. (this.texture.format = e)
  60603. }
  60604. },
  60605. type: {
  60606. get: function () {
  60607. return (
  60608. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60609. this.texture.type
  60610. )
  60611. },
  60612. set: function (e) {
  60613. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60614. (this.texture.type = e)
  60615. }
  60616. },
  60617. generateMipmaps: {
  60618. get: function () {
  60619. return (
  60620. console.warn(
  60621. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60622. ),
  60623. this.texture.generateMipmaps
  60624. )
  60625. },
  60626. set: function (e) {
  60627. console.warn(
  60628. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60629. ),
  60630. (this.texture.generateMipmaps = e)
  60631. }
  60632. }
  60633. }),
  60634. (n.GeometryUtils = {
  60635. merge: function (e, t, i) {
  60636. console.warn(
  60637. 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.'
  60638. )
  60639. var r
  60640. t instanceof n.Mesh &&
  60641. (t.matrixAutoUpdate && t.updateMatrix(), (r = t.matrix), (t = t.geometry)),
  60642. e.merge(t, r, i)
  60643. },
  60644. center: function (e) {
  60645. return (
  60646. console.warn(
  60647. 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'
  60648. ),
  60649. e.center()
  60650. )
  60651. }
  60652. }),
  60653. (n.ImageUtils = {
  60654. crossOrigin: void 0,
  60655. loadTexture: function (e, t, i, r) {
  60656. console.warn(
  60657. 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.'
  60658. )
  60659. var o = new n.TextureLoader()
  60660. o.setCrossOrigin(this.crossOrigin)
  60661. var a = o.load(e, i, void 0, r)
  60662. return t && (a.mapping = t), a
  60663. },
  60664. loadTextureCube: function (e, t, i, r) {
  60665. console.warn(
  60666. 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.'
  60667. )
  60668. var o = new n.CubeTextureLoader()
  60669. o.setCrossOrigin(this.crossOrigin)
  60670. var a = o.load(e, i, void 0, r)
  60671. return t && (a.mapping = t), a
  60672. },
  60673. loadCompressedTexture: function () {
  60674. console.error(
  60675. 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.'
  60676. )
  60677. },
  60678. loadCompressedTextureCube: function () {
  60679. console.error(
  60680. 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.'
  60681. )
  60682. }
  60683. }),
  60684. (n.Projector = function () {
  60685. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  60686. (this.projectVector = function (e, t) {
  60687. console.warn('THREE.Projector: .projectVector() is now vector.project().'),
  60688. e.project(t)
  60689. }),
  60690. (this.unprojectVector = function (e, t) {
  60691. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'),
  60692. e.unproject(t)
  60693. }),
  60694. (this.pickingRay = function (e, t) {
  60695. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')
  60696. })
  60697. }),
  60698. (n.CanvasRenderer = function () {
  60699. console.error(
  60700. 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'
  60701. ),
  60702. (this.domElement = document.createElement('canvas')),
  60703. (this.clear = function () {}),
  60704. (this.render = function () {}),
  60705. (this.setClearColor = function () {}),
  60706. (this.setSize = function () {})
  60707. }),
  60708. (n.MeshFaceMaterial = n.MultiMaterial),
  60709. (n.CurveUtils = {
  60710. tangentQuadraticBezier: function (e, t, i, n) {
  60711. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  60712. },
  60713. tangentCubicBezier: function (e, t, i, n, r) {
  60714. return (
  60715. -3 * t * (1 - e) * (1 - e) +
  60716. 3 * i * (1 - e) * (1 - e) -
  60717. 6 * e * i * (1 - e) +
  60718. 6 * e * n * (1 - e) -
  60719. 3 * e * e * n +
  60720. 3 * e * e * r
  60721. )
  60722. },
  60723. tangentSpline: function (e, t, i, n, r) {
  60724. var o = 6 * e * e - 6 * e,
  60725. a = 3 * e * e - 4 * e + 1,
  60726. s = -6 * e * e + 6 * e,
  60727. l = 3 * e * e - 2 * e
  60728. return o + a + s + l
  60729. },
  60730. interpolate: function (e, t, i, n, r) {
  60731. var o = 0.5 * (i - e),
  60732. a = 0.5 * (n - t),
  60733. s = r * r,
  60734. l = r * s
  60735. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  60736. }
  60737. }),
  60738. (n.SceneUtils = {
  60739. createMultiMaterialObject: function (e, t) {
  60740. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++)
  60741. i.add(new n.Mesh(e, t[r]))
  60742. return i
  60743. },
  60744. detach: function (e, t, i) {
  60745. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e)
  60746. },
  60747. attach: function (e, t, i) {
  60748. var r = new n.Matrix4()
  60749. r.getInverse(i.matrixWorld), e.applyMatrix(r), t.remove(e), i.add(e)
  60750. }
  60751. }),
  60752. (n.ShapeUtils = {
  60753. area: function (e) {
  60754. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  60755. i += e[n].x * e[r].y - e[r].x * e[n].y
  60756. return 0.5 * i
  60757. },
  60758. triangulate: (function () {
  60759. function e(e, t, i, n, r, o) {
  60760. var a, s, l, c, h, u, d, p, f
  60761. if (
  60762. ((s = e[o[t]].x),
  60763. (l = e[o[t]].y),
  60764. (c = e[o[i]].x),
  60765. (h = e[o[i]].y),
  60766. (u = e[o[n]].x),
  60767. (d = e[o[n]].y),
  60768. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  60769. )
  60770. return !1
  60771. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M
  60772. for (
  60773. g = u - c, m = d - h, v = s - u, A = l - d, y = c - s, C = h - l, a = 0;
  60774. a < r;
  60775. a++
  60776. )
  60777. if (
  60778. ((p = e[o[a]].x),
  60779. (f = e[o[a]].y),
  60780. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  60781. ((I = p - s),
  60782. (E = f - l),
  60783. (b = p - c),
  60784. (w = f - h),
  60785. (_ = p - u),
  60786. (T = f - d),
  60787. (M = g * w - m * b),
  60788. (x = y * E - C * I),
  60789. (S = v * T - A * _),
  60790. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  60791. )
  60792. return !1
  60793. return !0
  60794. }
  60795. return function (t, i) {
  60796. var r = t.length
  60797. if (r < 3) return null
  60798. var o,
  60799. a,
  60800. s,
  60801. l = [],
  60802. c = [],
  60803. h = []
  60804. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a
  60805. else for (a = 0; a < r; a++) c[a] = r - 1 - a
  60806. var u = r,
  60807. d = 2 * u
  60808. for (a = u - 1; u > 2; ) {
  60809. if (d-- <= 0)
  60810. return (
  60811. console.warn(
  60812. 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'
  60813. ),
  60814. i ? h : l
  60815. )
  60816. if (
  60817. ((o = a),
  60818. u <= o && (o = 0),
  60819. (a = o + 1),
  60820. u <= a && (a = 0),
  60821. (s = a + 1),
  60822. u <= s && (s = 0),
  60823. e(t, o, a, s, u, c))
  60824. ) {
  60825. var p, f, g, m, v
  60826. for (
  60827. p = c[o],
  60828. f = c[a],
  60829. g = c[s],
  60830. l.push([t[p], t[f], t[g]]),
  60831. h.push([c[o], c[a], c[s]]),
  60832. m = a,
  60833. v = a + 1;
  60834. v < u;
  60835. m++, v++
  60836. )
  60837. c[m] = c[v]
  60838. u--, (d = 2 * u)
  60839. }
  60840. }
  60841. return i ? h : l
  60842. }
  60843. })(),
  60844. triangulateShape: function (e, t) {
  60845. function i(e, t, i) {
  60846. return e.x !== t.x
  60847. ? e.x < t.x
  60848. ? e.x <= i.x && i.x <= t.x
  60849. : t.x <= i.x && i.x <= e.x
  60850. : e.y < t.y
  60851. ? e.y <= i.y && i.y <= t.y
  60852. : t.y <= i.y && i.y <= e.y
  60853. }
  60854. function r(e, t, n, r, o) {
  60855. var a = t.x - e.x,
  60856. s = t.y - e.y,
  60857. l = r.x - n.x,
  60858. c = r.y - n.y,
  60859. h = e.x - n.x,
  60860. u = e.y - n.y,
  60861. d = s * l - a * c,
  60862. p = s * h - a * u
  60863. if (Math.abs(d) > Number.EPSILON) {
  60864. var f
  60865. if (d > 0) {
  60866. if (p < 0 || p > d) return []
  60867. if (((f = c * h - l * u), f < 0 || f > d)) return []
  60868. } else {
  60869. if (p > 0 || p < d) return []
  60870. if (((f = c * h - l * u), f > 0 || f < d)) return []
  60871. }
  60872. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : []
  60873. if (f === d) return !o || (0 !== p && p !== d) ? [t] : []
  60874. if (0 === p) return [n]
  60875. if (p === d) return [r]
  60876. var g = f / d
  60877. return [
  60878. {
  60879. x: e.x + g * a,
  60880. y: e.y + g * s
  60881. }
  60882. ]
  60883. }
  60884. if (0 !== p || c * h !== l * u) return []
  60885. var m = 0 === a && 0 === s,
  60886. v = 0 === l && 0 === c
  60887. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e]
  60888. if (m) return i(n, r, e) ? [e] : []
  60889. if (v) return i(e, t, n) ? [n] : []
  60890. var A, y, C, I, E, b, w, _
  60891. return (
  60892. 0 !== a
  60893. ? (e.x < t.x
  60894. ? ((A = e), (C = e.x), (y = t), (I = t.x))
  60895. : ((A = t), (C = t.x), (y = e), (I = e.x)),
  60896. n.x < r.x
  60897. ? ((E = n), (w = n.x), (b = r), (_ = r.x))
  60898. : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  60899. : (e.y < t.y
  60900. ? ((A = e), (C = e.y), (y = t), (I = t.y))
  60901. : ((A = t), (C = t.y), (y = e), (I = e.y)),
  60902. n.y < r.y
  60903. ? ((E = n), (w = n.y), (b = r), (_ = r.y))
  60904. : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  60905. C <= w
  60906. ? I < w
  60907. ? []
  60908. : I === w
  60909. ? o
  60910. ? []
  60911. : [E]
  60912. : I <= _
  60913. ? [E, y]
  60914. : [E, b]
  60915. : C > _
  60916. ? []
  60917. : C === _
  60918. ? o
  60919. ? []
  60920. : [A]
  60921. : I <= _
  60922. ? [A, y]
  60923. : [A, b]
  60924. )
  60925. }
  60926. function o(e, t, i, n) {
  60927. var r = t.x - e.x,
  60928. o = t.y - e.y,
  60929. a = i.x - e.x,
  60930. s = i.y - e.y,
  60931. l = n.x - e.x,
  60932. c = n.y - e.y,
  60933. h = r * s - o * a,
  60934. u = r * c - o * l
  60935. if (Math.abs(h) > Number.EPSILON) {
  60936. var d = l * s - c * a
  60937. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  60938. }
  60939. return u > 0
  60940. }
  60941. function a(e, t) {
  60942. function i(e, t) {
  60943. var i = A.length - 1,
  60944. n = e - 1
  60945. n < 0 && (n = i)
  60946. var r = e + 1
  60947. r > i && (r = 0)
  60948. var a = o(A[e], A[n], A[r], s[t])
  60949. if (!a) return !1
  60950. var l = s.length - 1,
  60951. c = t - 1
  60952. c < 0 && (c = l)
  60953. var h = t + 1
  60954. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a
  60955. }
  60956. function n(e, t) {
  60957. var i, n, o
  60958. for (i = 0; i < A.length; i++)
  60959. if (((n = i + 1), (n %= A.length), (o = r(e, t, A[i], A[n], !0)), o.length > 0))
  60960. return !0
  60961. return !1
  60962. }
  60963. function a(e, i) {
  60964. var n, o, a, s, l
  60965. for (n = 0; n < y.length; n++)
  60966. for (o = t[y[n]], a = 0; a < o.length; a++)
  60967. if (
  60968. ((s = a + 1), (s %= o.length), (l = r(e, i, o[a], o[s], !0)), l.length > 0)
  60969. )
  60970. return !0
  60971. return !1
  60972. }
  60973. for (
  60974. var s,
  60975. l,
  60976. c,
  60977. h,
  60978. u,
  60979. d,
  60980. p,
  60981. f,
  60982. g,
  60983. m,
  60984. v,
  60985. A = e.concat(),
  60986. y = [],
  60987. C = [],
  60988. I = 0,
  60989. E = t.length;
  60990. I < E;
  60991. I++
  60992. )
  60993. y.push(I)
  60994. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  60995. if ((w--, w < 0)) {
  60996. console.log(
  60997. 'Infinite Loop! Holes left:' + y.length + ', Probably Hole outside Shape!'
  60998. )
  60999. break
  61000. }
  61001. for (c = b; c < A.length; c++) {
  61002. ;(h = A[c]), (l = -1)
  61003. for (var I = 0; I < y.length; I++)
  61004. if (((d = y[I]), (p = h.x + ':' + h.y + ':' + d), void 0 === C[p])) {
  61005. s = t[d]
  61006. for (var _ = 0; _ < s.length; _++)
  61007. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  61008. ;(l = _),
  61009. y.splice(I, 1),
  61010. (f = A.slice(0, c + 1)),
  61011. (g = A.slice(c)),
  61012. (m = s.slice(l)),
  61013. (v = s.slice(0, l + 1)),
  61014. (A = f.concat(m).concat(v).concat(g)),
  61015. (b = c)
  61016. break
  61017. }
  61018. if (l >= 0) break
  61019. C[p] = !0
  61020. }
  61021. if (l >= 0) break
  61022. }
  61023. }
  61024. return A
  61025. }
  61026. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  61027. Array.prototype.push.apply(f, t[g])
  61028. for (s = 0, l = f.length; s < l; s++)
  61029. (u = f[s].x + ':' + f[s].y),
  61030. void 0 !== p[u] && console.warn('THREE.Shape: Duplicate point', u),
  61031. (p[u] = s)
  61032. var v = a(e, t),
  61033. A = n.ShapeUtils.triangulate(v, !1)
  61034. for (s = 0, l = A.length; s < l; s++)
  61035. for (h = A[s], c = 0; c < 3; c++)
  61036. (u = h[c].x + ':' + h[c].y), (d = p[u]), void 0 !== d && (h[c] = d)
  61037. return A.concat()
  61038. },
  61039. isClockWise: function (e) {
  61040. return n.ShapeUtils.area(e) < 0
  61041. },
  61042. b2: (function () {
  61043. function e(e, t) {
  61044. var i = 1 - e
  61045. return i * i * t
  61046. }
  61047. function t(e, t) {
  61048. return 2 * (1 - e) * e * t
  61049. }
  61050. function i(e, t) {
  61051. return e * e * t
  61052. }
  61053. return function (n, r, o, a) {
  61054. return e(n, r) + t(n, o) + i(n, a)
  61055. }
  61056. })(),
  61057. b3: (function () {
  61058. function e(e, t) {
  61059. var i = 1 - e
  61060. return i * i * i * t
  61061. }
  61062. function t(e, t) {
  61063. var i = 1 - e
  61064. return 3 * i * i * e * t
  61065. }
  61066. function i(e, t) {
  61067. var i = 1 - e
  61068. return 3 * i * e * e * t
  61069. }
  61070. function n(e, t) {
  61071. return e * e * e * t
  61072. }
  61073. return function (r, o, a, s, l) {
  61074. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  61075. }
  61076. })()
  61077. }),
  61078. (n.Curve = function () {}),
  61079. (n.Curve.prototype = {
  61080. constructor: n.Curve,
  61081. getPoint: function (e) {
  61082. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null
  61083. },
  61084. getPointAt: function (e) {
  61085. var t = this.getUtoTmapping(e)
  61086. return this.getPoint(t)
  61087. },
  61088. getPoints: function (e) {
  61089. e || (e = 5)
  61090. var t,
  61091. i = []
  61092. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e))
  61093. return i
  61094. },
  61095. getSpacedPoints: function (e) {
  61096. e || (e = 5)
  61097. var t,
  61098. i = []
  61099. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e))
  61100. return i
  61101. },
  61102. getLength: function () {
  61103. var e = this.getLengths()
  61104. return e[e.length - 1]
  61105. },
  61106. getLengths: function (e) {
  61107. if (
  61108. (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  61109. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  61110. )
  61111. return this.cacheArcLengths
  61112. this.needsUpdate = !1
  61113. var t,
  61114. i,
  61115. n = [],
  61116. r = this.getPoint(0),
  61117. o = 0
  61118. for (n.push(0), i = 1; i <= e; i++)
  61119. (t = this.getPoint(i / e)), (o += t.distanceTo(r)), n.push(o), (r = t)
  61120. return (this.cacheArcLengths = n), n
  61121. },
  61122. updateArcLengths: function () {
  61123. ;(this.needsUpdate = !0), this.getLengths()
  61124. },
  61125. getUtoTmapping: function (e, t) {
  61126. var i,
  61127. n = this.getLengths(),
  61128. r = 0,
  61129. o = n.length
  61130. i = t ? t : e * n[o - 1]
  61131. for (var a, s = 0, l = o - 1; s <= l; )
  61132. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0)) s = r + 1
  61133. else {
  61134. if (!(a > 0)) {
  61135. l = r
  61136. break
  61137. }
  61138. l = r - 1
  61139. }
  61140. if (((r = l), n[r] === i)) {
  61141. var c = r / (o - 1)
  61142. return c
  61143. }
  61144. var h = n[r],
  61145. u = n[r + 1],
  61146. d = u - h,
  61147. p = (i - h) / d,
  61148. c = (r + p) / (o - 1)
  61149. return c
  61150. },
  61151. getTangent: function (e) {
  61152. var t = 1e-4,
  61153. i = e - t,
  61154. n = e + t
  61155. i < 0 && (i = 0), n > 1 && (n = 1)
  61156. var r = this.getPoint(i),
  61157. o = this.getPoint(n),
  61158. a = o.clone().sub(r)
  61159. return a.normalize()
  61160. },
  61161. getTangentAt: function (e) {
  61162. var t = this.getUtoTmapping(e)
  61163. return this.getTangent(t)
  61164. }
  61165. }),
  61166. (n.Curve.create = function (e, t) {
  61167. return (
  61168. (e.prototype = Object.create(n.Curve.prototype)),
  61169. (e.prototype.constructor = e),
  61170. (e.prototype.getPoint = t),
  61171. e
  61172. )
  61173. }),
  61174. (n.CurvePath = function () {
  61175. ;(this.curves = []), (this.autoClose = !1)
  61176. }),
  61177. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  61178. (n.CurvePath.prototype.constructor = n.CurvePath),
  61179. (n.CurvePath.prototype.add = function (e) {
  61180. this.curves.push(e)
  61181. }),
  61182. (n.CurvePath.prototype.closePath = function () {
  61183. var e = this.curves[0].getPoint(0),
  61184. t = this.curves[this.curves.length - 1].getPoint(1)
  61185. e.equals(t) || this.curves.push(new n.LineCurve(t, e))
  61186. }),
  61187. (n.CurvePath.prototype.getPoint = function (e) {
  61188. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  61189. if (i[n] >= t) {
  61190. var r = i[n] - t,
  61191. o = this.curves[n],
  61192. a = 1 - r / o.getLength()
  61193. return o.getPointAt(a)
  61194. }
  61195. n++
  61196. }
  61197. return null
  61198. }),
  61199. (n.CurvePath.prototype.getLength = function () {
  61200. var e = this.getCurveLengths()
  61201. return e[e.length - 1]
  61202. }),
  61203. (n.CurvePath.prototype.getCurveLengths = function () {
  61204. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  61205. return this.cacheLengths
  61206. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  61207. (t += this.curves[i].getLength()), e.push(t)
  61208. return (this.cacheLengths = e), e
  61209. }),
  61210. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  61211. var t = this.getPoints(e)
  61212. return this.createGeometry(t)
  61213. }),
  61214. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  61215. var t = this.getSpacedPoints(e)
  61216. return this.createGeometry(t)
  61217. }),
  61218. (n.CurvePath.prototype.createGeometry = function (e) {
  61219. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  61220. var o = e[i]
  61221. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0))
  61222. }
  61223. return t
  61224. }),
  61225. (n.Font = function (e) {
  61226. this.data = e
  61227. }),
  61228. (n.Font.prototype = {
  61229. constructor: n.Font,
  61230. generateShapes: function (e, t, i) {
  61231. function r(e) {
  61232. for (
  61233. var i = String(e).split(''), n = t / a.resolution, r = 0, s = [], l = 0;
  61234. l < i.length;
  61235. l++
  61236. ) {
  61237. var c = o(i[l], n, r)
  61238. ;(r += c.offset), s.push(c.path)
  61239. }
  61240. return s
  61241. }
  61242. function o(e, t, r) {
  61243. var o = a.glyphs[e] || a.glyphs['?']
  61244. if (o) {
  61245. var s,
  61246. l,
  61247. c,
  61248. h,
  61249. u,
  61250. d,
  61251. p,
  61252. f,
  61253. g,
  61254. m,
  61255. v,
  61256. A = new n.Path(),
  61257. y = [],
  61258. C = n.ShapeUtils.b2,
  61259. I = n.ShapeUtils.b3
  61260. if (o.o)
  61261. for (
  61262. var E = o._cachedOutline || (o._cachedOutline = o.o.split(' ')),
  61263. b = 0,
  61264. w = E.length;
  61265. b < w;
  61266. ) {
  61267. var _ = E[b++]
  61268. switch (_) {
  61269. case 'm':
  61270. ;(s = E[b++] * t + r), (l = E[b++] * t), A.moveTo(s, l)
  61271. break
  61272. case 'l':
  61273. ;(s = E[b++] * t + r), (l = E[b++] * t), A.lineTo(s, l)
  61274. break
  61275. case 'q':
  61276. if (
  61277. ((c = E[b++] * t + r),
  61278. (h = E[b++] * t),
  61279. (p = E[b++] * t + r),
  61280. (f = E[b++] * t),
  61281. A.quadraticCurveTo(p, f, c, h),
  61282. (v = y[y.length - 1]))
  61283. ) {
  61284. ;(u = v.x), (d = v.y)
  61285. for (var T = 1; T <= i; T++) {
  61286. var x = T / i
  61287. C(x, u, p, c), C(x, d, f, h)
  61288. }
  61289. }
  61290. break
  61291. case 'b':
  61292. if (
  61293. ((c = E[b++] * t + r),
  61294. (h = E[b++] * t),
  61295. (p = E[b++] * t + r),
  61296. (f = E[b++] * t),
  61297. (g = E[b++] * t + r),
  61298. (m = E[b++] * t),
  61299. A.bezierCurveTo(p, f, g, m, c, h),
  61300. (v = y[y.length - 1]))
  61301. ) {
  61302. ;(u = v.x), (d = v.y)
  61303. for (var T = 1; T <= i; T++) {
  61304. var x = T / i
  61305. I(x, u, p, g, c), I(x, d, f, m, h)
  61306. }
  61307. }
  61308. }
  61309. }
  61310. return {
  61311. offset: o.ha * t,
  61312. path: A
  61313. }
  61314. }
  61315. }
  61316. void 0 === t && (t = 100), void 0 === i && (i = 4)
  61317. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  61318. Array.prototype.push.apply(l, s[c].toShapes())
  61319. return l
  61320. }
  61321. }),
  61322. (n.Path = function (e) {
  61323. n.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e)
  61324. }),
  61325. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  61326. (n.Path.prototype.constructor = n.Path),
  61327. (n.Path.prototype.fromPoints = function (e) {
  61328. this.moveTo(e[0].x, e[0].y)
  61329. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y)
  61330. }),
  61331. (n.Path.prototype.moveTo = function (e, t) {
  61332. this.actions.push({
  61333. action: 'moveTo',
  61334. args: [e, t]
  61335. })
  61336. }),
  61337. (n.Path.prototype.lineTo = function (e, t) {
  61338. var i = this.actions[this.actions.length - 1].args,
  61339. r = i[i.length - 2],
  61340. o = i[i.length - 1],
  61341. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t))
  61342. this.curves.push(a),
  61343. this.actions.push({
  61344. action: 'lineTo',
  61345. args: [e, t]
  61346. })
  61347. }),
  61348. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  61349. var o = this.actions[this.actions.length - 1].args,
  61350. a = o[o.length - 2],
  61351. s = o[o.length - 1],
  61352. l = new n.QuadraticBezierCurve(
  61353. new n.Vector2(a, s),
  61354. new n.Vector2(e, t),
  61355. new n.Vector2(i, r)
  61356. )
  61357. this.curves.push(l),
  61358. this.actions.push({
  61359. action: 'quadraticCurveTo',
  61360. args: [e, t, i, r]
  61361. })
  61362. }),
  61363. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  61364. var s = this.actions[this.actions.length - 1].args,
  61365. l = s[s.length - 2],
  61366. c = s[s.length - 1],
  61367. h = new n.CubicBezierCurve(
  61368. new n.Vector2(l, c),
  61369. new n.Vector2(e, t),
  61370. new n.Vector2(i, r),
  61371. new n.Vector2(o, a)
  61372. )
  61373. this.curves.push(h),
  61374. this.actions.push({
  61375. action: 'bezierCurveTo',
  61376. args: [e, t, i, r, o, a]
  61377. })
  61378. }),
  61379. (n.Path.prototype.splineThru = function (e) {
  61380. var t = Array.prototype.slice.call(arguments),
  61381. i = this.actions[this.actions.length - 1].args,
  61382. r = i[i.length - 2],
  61383. o = i[i.length - 1],
  61384. a = [new n.Vector2(r, o)]
  61385. Array.prototype.push.apply(a, e)
  61386. var s = new n.SplineCurve(a)
  61387. this.curves.push(s),
  61388. this.actions.push({
  61389. action: 'splineThru',
  61390. args: t
  61391. })
  61392. }),
  61393. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  61394. var a = this.actions[this.actions.length - 1].args,
  61395. s = a[a.length - 2],
  61396. l = a[a.length - 1]
  61397. this.absarc(e + s, t + l, i, n, r, o)
  61398. }),
  61399. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  61400. this.absellipse(e, t, i, i, n, r, o)
  61401. }),
  61402. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  61403. var l = this.actions[this.actions.length - 1].args,
  61404. c = l[l.length - 2],
  61405. h = l[l.length - 1]
  61406. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  61407. }),
  61408. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  61409. var c = [e, t, i, r, o, a, s, l || 0],
  61410. h = new n.EllipseCurve(e, t, i, r, o, a, s, l)
  61411. this.curves.push(h)
  61412. var u = h.getPoint(1)
  61413. c.push(u.x),
  61414. c.push(u.y),
  61415. this.actions.push({
  61416. action: 'ellipse',
  61417. args: c
  61418. })
  61419. }),
  61420. (n.Path.prototype.getSpacedPoints = function (e) {
  61421. e || (e = 40)
  61422. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e))
  61423. return this.autoClose && t.push(t[0]), t
  61424. }),
  61425. (n.Path.prototype.getPoints = function (e) {
  61426. e = e || 12
  61427. for (
  61428. var t,
  61429. i,
  61430. r,
  61431. o,
  61432. a,
  61433. s,
  61434. l,
  61435. c,
  61436. h,
  61437. u,
  61438. d,
  61439. p = n.ShapeUtils.b2,
  61440. f = n.ShapeUtils.b3,
  61441. g = [],
  61442. m = 0,
  61443. v = this.actions.length;
  61444. m < v;
  61445. m++
  61446. ) {
  61447. var A = this.actions[m],
  61448. y = A.action,
  61449. C = A.args
  61450. switch (y) {
  61451. case 'moveTo':
  61452. g.push(new n.Vector2(C[0], C[1]))
  61453. break
  61454. case 'lineTo':
  61455. g.push(new n.Vector2(C[0], C[1]))
  61456. break
  61457. case 'quadraticCurveTo':
  61458. ;(t = C[2]),
  61459. (i = C[3]),
  61460. (a = C[0]),
  61461. (s = C[1]),
  61462. g.length > 0
  61463. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61464. : ((h = this.actions[m - 1].args),
  61465. (l = h[h.length - 2]),
  61466. (c = h[h.length - 1]))
  61467. for (var I = 1; I <= e; I++) {
  61468. var E = I / e
  61469. ;(u = p(E, l, a, t)), (d = p(E, c, s, i)), g.push(new n.Vector2(u, d))
  61470. }
  61471. break
  61472. case 'bezierCurveTo':
  61473. ;(t = C[4]),
  61474. (i = C[5]),
  61475. (a = C[0]),
  61476. (s = C[1]),
  61477. (r = C[2]),
  61478. (o = C[3]),
  61479. g.length > 0
  61480. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61481. : ((h = this.actions[m - 1].args),
  61482. (l = h[h.length - 2]),
  61483. (c = h[h.length - 1]))
  61484. for (var I = 1; I <= e; I++) {
  61485. var E = I / e
  61486. ;(u = f(E, l, a, r, t)), (d = f(E, c, s, o, i)), g.push(new n.Vector2(u, d))
  61487. }
  61488. break
  61489. case 'splineThru':
  61490. h = this.actions[m - 1].args
  61491. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  61492. w = [b],
  61493. _ = e * C[0].length
  61494. w = w.concat(C[0])
  61495. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++) g.push(T.getPointAt(I / _))
  61496. break
  61497. case 'arc':
  61498. for (
  61499. var x,
  61500. S = C[0],
  61501. M = C[1],
  61502. R = C[2],
  61503. P = C[3],
  61504. O = C[4],
  61505. L = !!C[5],
  61506. D = O - P,
  61507. N = 2 * e,
  61508. I = 1;
  61509. I <= N;
  61510. I++
  61511. ) {
  61512. var E = I / N
  61513. L || (E = 1 - E),
  61514. (x = P + E * D),
  61515. (u = S + R * Math.cos(x)),
  61516. (d = M + R * Math.sin(x)),
  61517. g.push(new n.Vector2(u, d))
  61518. }
  61519. break
  61520. case 'ellipse':
  61521. var x,
  61522. B,
  61523. F,
  61524. S = C[0],
  61525. M = C[1],
  61526. V = C[2],
  61527. U = C[3],
  61528. P = C[4],
  61529. O = C[5],
  61530. L = !!C[6],
  61531. k = C[7],
  61532. D = O - P,
  61533. N = 2 * e
  61534. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)))
  61535. for (var I = 1; I <= N; I++) {
  61536. var E = I / N
  61537. if (
  61538. (L || (E = 1 - E),
  61539. (x = P + E * D),
  61540. (u = S + V * Math.cos(x)),
  61541. (d = M + U * Math.sin(x)),
  61542. 0 !== k)
  61543. ) {
  61544. var H = u,
  61545. G = d
  61546. ;(u = (H - S) * B - (G - M) * F + S), (d = (H - S) * F + (G - M) * B + M)
  61547. }
  61548. g.push(new n.Vector2(u, d))
  61549. }
  61550. }
  61551. }
  61552. var z = g[g.length - 1]
  61553. return (
  61554. Math.abs(z.x - g[0].x) < Number.EPSILON &&
  61555. Math.abs(z.y - g[0].y) < Number.EPSILON &&
  61556. g.splice(g.length - 1, 1),
  61557. this.autoClose && g.push(g[0]),
  61558. g
  61559. )
  61560. }),
  61561. (n.Path.prototype.toShapes = function (e, t) {
  61562. function i(e) {
  61563. for (var t = [], i = new n.Path(), r = 0, o = e.length; r < o; r++) {
  61564. var a = e[r],
  61565. s = a.args,
  61566. l = a.action
  61567. 'moveTo' === l && 0 !== i.actions.length && (t.push(i), (i = new n.Path())),
  61568. i[l].apply(i, s)
  61569. }
  61570. return 0 !== i.actions.length && t.push(i), t
  61571. }
  61572. function r(e) {
  61573. for (var t = [], i = 0, r = e.length; i < r; i++) {
  61574. var o = e[i],
  61575. a = new n.Shape()
  61576. ;(a.actions = o.actions), (a.curves = o.curves), t.push(a)
  61577. }
  61578. return t
  61579. }
  61580. function o(e, t) {
  61581. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  61582. var a = t[r],
  61583. s = t[o],
  61584. l = s.x - a.x,
  61585. c = s.y - a.y
  61586. if (Math.abs(c) > Number.EPSILON) {
  61587. if (
  61588. (c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)
  61589. )
  61590. continue
  61591. if (e.y === a.y) {
  61592. if (e.x === a.x) return !0
  61593. } else {
  61594. var h = c * (e.x - a.x) - l * (e.y - a.y)
  61595. if (0 === h) return !0
  61596. if (h < 0) continue
  61597. n = !n
  61598. }
  61599. } else {
  61600. if (e.y !== a.y) continue
  61601. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0
  61602. }
  61603. }
  61604. return n
  61605. }
  61606. var a = n.ShapeUtils.isClockWise,
  61607. s = i(this.actions)
  61608. if (0 === s.length) return []
  61609. if (t === !0) return r(s)
  61610. var l,
  61611. c,
  61612. h,
  61613. u = []
  61614. if (1 === s.length)
  61615. return (
  61616. (c = s[0]),
  61617. (h = new n.Shape()),
  61618. (h.actions = c.actions),
  61619. (h.curves = c.curves),
  61620. u.push(h),
  61621. u
  61622. )
  61623. var d = !a(s[0].getPoints())
  61624. d = e ? !d : d
  61625. var p,
  61626. f = [],
  61627. g = [],
  61628. m = [],
  61629. v = 0
  61630. ;(g[v] = void 0), (m[v] = [])
  61631. for (var A = 0, y = s.length; A < y; A++)
  61632. (c = s[A]),
  61633. (p = c.getPoints()),
  61634. (l = a(p)),
  61635. (l = e ? !l : l),
  61636. l
  61637. ? (!d && g[v] && v++,
  61638. (g[v] = {
  61639. s: new n.Shape(),
  61640. p: p
  61641. }),
  61642. (g[v].s.actions = c.actions),
  61643. (g[v].s.curves = c.curves),
  61644. d && v++,
  61645. (m[v] = []))
  61646. : m[v].push({
  61647. h: c,
  61648. p: p[0]
  61649. })
  61650. if (!g[0]) return r(s)
  61651. if (g.length > 1) {
  61652. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++) f[E] = []
  61653. for (var E = 0, b = g.length; E < b; E++)
  61654. for (var w = m[E], _ = 0; _ < w.length; _++) {
  61655. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  61656. o(T.p, g[S].p) &&
  61657. (E !== S &&
  61658. I.push({
  61659. froms: E,
  61660. tos: S,
  61661. hole: _
  61662. }),
  61663. x ? ((x = !1), f[S].push(T)) : (C = !0))
  61664. x && f[E].push(T)
  61665. }
  61666. I.length > 0 && (C || (m = f))
  61667. }
  61668. for (var M, A = 0, R = g.length; A < R; A++) {
  61669. ;(h = g[A].s), u.push(h), (M = m[A])
  61670. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h)
  61671. }
  61672. return u
  61673. }),
  61674. (n.Shape = function () {
  61675. n.Path.apply(this, arguments), (this.holes = [])
  61676. }),
  61677. (n.Shape.prototype = Object.create(n.Path.prototype)),
  61678. (n.Shape.prototype.constructor = n.Shape),
  61679. (n.Shape.prototype.extrude = function (e) {
  61680. return new n.ExtrudeGeometry(this, e)
  61681. }),
  61682. (n.Shape.prototype.makeGeometry = function (e) {
  61683. return new n.ShapeGeometry(this, e)
  61684. }),
  61685. (n.Shape.prototype.getPointsHoles = function (e) {
  61686. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  61687. t[i] = this.holes[i].getPoints(e)
  61688. return t
  61689. }),
  61690. (n.Shape.prototype.extractAllPoints = function (e) {
  61691. return {
  61692. shape: this.getPoints(e),
  61693. holes: this.getPointsHoles(e)
  61694. }
  61695. }),
  61696. (n.Shape.prototype.extractPoints = function (e) {
  61697. return this.extractAllPoints(e)
  61698. }),
  61699. (n.LineCurve = function (e, t) {
  61700. ;(this.v1 = e), (this.v2 = t)
  61701. }),
  61702. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  61703. (n.LineCurve.prototype.constructor = n.LineCurve),
  61704. (n.LineCurve.prototype.getPoint = function (e) {
  61705. var t = this.v2.clone().sub(this.v1)
  61706. return t.multiplyScalar(e).add(this.v1), t
  61707. }),
  61708. (n.LineCurve.prototype.getPointAt = function (e) {
  61709. return this.getPoint(e)
  61710. }),
  61711. (n.LineCurve.prototype.getTangent = function (e) {
  61712. var t = this.v2.clone().sub(this.v1)
  61713. return t.normalize()
  61714. }),
  61715. (n.QuadraticBezierCurve = function (e, t, i) {
  61716. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  61717. }),
  61718. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61719. (n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve),
  61720. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  61721. var t = n.ShapeUtils.b2
  61722. return new n.Vector2(
  61723. t(e, this.v0.x, this.v1.x, this.v2.x),
  61724. t(e, this.v0.y, this.v1.y, this.v2.y)
  61725. )
  61726. }),
  61727. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  61728. var t = n.CurveUtils.tangentQuadraticBezier
  61729. return new n.Vector2(
  61730. t(e, this.v0.x, this.v1.x, this.v2.x),
  61731. t(e, this.v0.y, this.v1.y, this.v2.y)
  61732. ).normalize()
  61733. }),
  61734. (n.CubicBezierCurve = function (e, t, i, n) {
  61735. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  61736. }),
  61737. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61738. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  61739. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  61740. var t = n.ShapeUtils.b3
  61741. return new n.Vector2(
  61742. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61743. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61744. )
  61745. }),
  61746. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  61747. var t = n.CurveUtils.tangentCubicBezier
  61748. return new n.Vector2(
  61749. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61750. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61751. ).normalize()
  61752. }),
  61753. (n.SplineCurve = function (e) {
  61754. this.points = void 0 == e ? [] : e
  61755. }),
  61756. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  61757. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  61758. (n.SplineCurve.prototype.getPoint = function (e) {
  61759. var t = this.points,
  61760. i = (t.length - 1) * e,
  61761. r = Math.floor(i),
  61762. o = i - r,
  61763. a = t[0 === r ? r : r - 1],
  61764. s = t[r],
  61765. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61766. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61767. h = n.CurveUtils.interpolate
  61768. return new n.Vector2(h(a.x, s.x, l.x, c.x, o), h(a.y, s.y, l.y, c.y, o))
  61769. }),
  61770. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  61771. ;(this.aX = e),
  61772. (this.aY = t),
  61773. (this.xRadius = i),
  61774. (this.yRadius = n),
  61775. (this.aStartAngle = r),
  61776. (this.aEndAngle = o),
  61777. (this.aClockwise = a),
  61778. (this.aRotation = s || 0)
  61779. }),
  61780. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  61781. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  61782. (n.EllipseCurve.prototype.getPoint = function (e) {
  61783. var t = this.aEndAngle - this.aStartAngle
  61784. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI)
  61785. var i
  61786. i =
  61787. this.aClockwise === !0
  61788. ? this.aEndAngle + (1 - e) * (2 * Math.PI - t)
  61789. : this.aStartAngle + e * t
  61790. var r = this.aX + this.xRadius * Math.cos(i),
  61791. o = this.aY + this.yRadius * Math.sin(i)
  61792. if (0 !== this.aRotation) {
  61793. var a = Math.cos(this.aRotation),
  61794. s = Math.sin(this.aRotation),
  61795. l = r,
  61796. c = o
  61797. ;(r = (l - this.aX) * a - (c - this.aY) * s + this.aX),
  61798. (o = (l - this.aX) * s + (c - this.aY) * a + this.aY)
  61799. }
  61800. return new n.Vector2(r, o)
  61801. }),
  61802. (n.ArcCurve = function (e, t, i, r, o, a) {
  61803. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  61804. }),
  61805. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  61806. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  61807. (n.LineCurve3 = n.Curve.create(
  61808. function (e, t) {
  61809. ;(this.v1 = e), (this.v2 = t)
  61810. },
  61811. function (e) {
  61812. var t = new n.Vector3()
  61813. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t
  61814. }
  61815. )),
  61816. (n.QuadraticBezierCurve3 = n.Curve.create(
  61817. function (e, t, i) {
  61818. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  61819. },
  61820. function (e) {
  61821. var t = n.ShapeUtils.b2
  61822. return new n.Vector3(
  61823. t(e, this.v0.x, this.v1.x, this.v2.x),
  61824. t(e, this.v0.y, this.v1.y, this.v2.y),
  61825. t(e, this.v0.z, this.v1.z, this.v2.z)
  61826. )
  61827. }
  61828. )),
  61829. (n.CubicBezierCurve3 = n.Curve.create(
  61830. function (e, t, i, n) {
  61831. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  61832. },
  61833. function (e) {
  61834. var t = n.ShapeUtils.b3
  61835. return new n.Vector3(
  61836. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61837. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),
  61838. t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z)
  61839. )
  61840. }
  61841. )),
  61842. (n.SplineCurve3 = n.Curve.create(
  61843. function (e) {
  61844. console.warn(
  61845. 'THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'
  61846. ),
  61847. (this.points = void 0 == e ? [] : e)
  61848. },
  61849. function (e) {
  61850. var t = this.points,
  61851. i = (t.length - 1) * e,
  61852. r = Math.floor(i),
  61853. o = i - r,
  61854. a = t[0 == r ? r : r - 1],
  61855. s = t[r],
  61856. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61857. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61858. h = n.CurveUtils.interpolate
  61859. return new n.Vector3(
  61860. h(a.x, s.x, l.x, c.x, o),
  61861. h(a.y, s.y, l.y, c.y, o),
  61862. h(a.z, s.z, l.z, c.z, o)
  61863. )
  61864. }
  61865. )),
  61866. (n.CatmullRomCurve3 = (function () {
  61867. function e() {}
  61868. var t = new n.Vector3(),
  61869. i = new e(),
  61870. r = new e(),
  61871. o = new e()
  61872. return (
  61873. (e.prototype.init = function (e, t, i, n) {
  61874. ;(this.c0 = e),
  61875. (this.c1 = i),
  61876. (this.c2 = -3 * e + 3 * t - 2 * i - n),
  61877. (this.c3 = 2 * e - 2 * t + i + n)
  61878. }),
  61879. (e.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  61880. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  61881. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a
  61882. ;(s *= o), (l *= o), this.init(t, i, s, l)
  61883. }),
  61884. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  61885. this.init(t, i, r * (i - e), r * (n - t))
  61886. }),
  61887. (e.prototype.calc = function (e) {
  61888. var t = e * e,
  61889. i = t * e
  61890. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  61891. }),
  61892. n.Curve.create(
  61893. function (e) {
  61894. ;(this.points = e || []), (this.closed = !1)
  61895. },
  61896. function (e) {
  61897. var a,
  61898. s,
  61899. l,
  61900. c,
  61901. h = this.points
  61902. ;(c = h.length),
  61903. c < 2 && console.log('duh, you need at least 2 points'),
  61904. (a = (c - (this.closed ? 0 : 1)) * e),
  61905. (s = Math.floor(a)),
  61906. (l = a - s),
  61907. this.closed
  61908. ? (s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length)
  61909. : 0 === l && s === c - 1 && ((s = c - 2), (l = 1))
  61910. var u, d, p, f
  61911. if (
  61912. (this.closed || s > 0
  61913. ? (u = h[(s - 1) % c])
  61914. : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  61915. (d = h[s % c]),
  61916. (p = h[(s + 1) % c]),
  61917. this.closed || s + 2 < c
  61918. ? (f = h[(s + 2) % c])
  61919. : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]), (f = t)),
  61920. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  61921. ) {
  61922. var g = 'chordal' === this.type ? 0.5 : 0.25,
  61923. m = Math.pow(u.distanceToSquared(d), g),
  61924. v = Math.pow(d.distanceToSquared(p), g),
  61925. A = Math.pow(p.distanceToSquared(f), g)
  61926. v < 1e-4 && (v = 1),
  61927. m < 1e-4 && (m = v),
  61928. A < 1e-4 && (A = v),
  61929. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  61930. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  61931. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  61932. } else if ('catmullrom' === this.type) {
  61933. var y = void 0 !== this.tension ? this.tension : 0.5
  61934. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  61935. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  61936. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  61937. }
  61938. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l))
  61939. return C
  61940. }
  61941. )
  61942. )
  61943. })()),
  61944. (n.ClosedSplineCurve3 = function (e) {
  61945. console.warn(
  61946. 'THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'
  61947. ),
  61948. n.CatmullRomCurve3.call(this, e),
  61949. (this.type = 'catmullrom'),
  61950. (this.closed = !0)
  61951. }),
  61952. (n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype)),
  61953. (n.BoxGeometry = function (e, t, i, r, o, a) {
  61954. n.Geometry.call(this),
  61955. (this.type = 'BoxGeometry'),
  61956. (this.parameters = {
  61957. width: e,
  61958. height: t,
  61959. depth: i,
  61960. widthSegments: r,
  61961. heightSegments: o,
  61962. depthSegments: a
  61963. }),
  61964. this.fromBufferGeometry(new n.BoxBufferGeometry(e, t, i, r, o, a)),
  61965. this.mergeVertices()
  61966. }),
  61967. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  61968. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  61969. (n.CubeGeometry = n.BoxGeometry),
  61970. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  61971. function s(e, t, i) {
  61972. var n = 0
  61973. return (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n
  61974. }
  61975. function l(e, t, i, r, o, a, s, l, h, u, I) {
  61976. for (
  61977. var E = a / h,
  61978. b = s / u,
  61979. w = a / 2,
  61980. _ = s / 2,
  61981. T = l / 2,
  61982. x = h + 1,
  61983. S = u + 1,
  61984. M = 0,
  61985. R = 0,
  61986. P = new n.Vector3(),
  61987. O = 0;
  61988. O < S;
  61989. O++
  61990. )
  61991. for (var L = O * b - _, D = 0; D < x; D++) {
  61992. var N = D * E - w
  61993. ;(P[e] = N * r),
  61994. (P[t] = L * o),
  61995. (P[i] = T),
  61996. (p[m] = P.x),
  61997. (p[m + 1] = P.y),
  61998. (p[m + 2] = P.z),
  61999. (P[e] = 0),
  62000. (P[t] = 0),
  62001. (P[i] = l > 0 ? 1 : -1),
  62002. (f[m] = P.x),
  62003. (f[m + 1] = P.y),
  62004. (f[m + 2] = P.z),
  62005. (g[v] = D / h),
  62006. (g[v + 1] = 1 - O / u),
  62007. (m += 3),
  62008. (v += 2),
  62009. (M += 1)
  62010. }
  62011. for (O = 0; O < u; O++)
  62012. for (D = 0; D < h; D++) {
  62013. var B = y + D + x * O,
  62014. F = y + D + x * (O + 1),
  62015. V = y + (D + 1) + x * (O + 1),
  62016. U = y + (D + 1) + x * O
  62017. ;(d[A] = B),
  62018. (d[A + 1] = F),
  62019. (d[A + 2] = U),
  62020. (d[A + 3] = F),
  62021. (d[A + 4] = V),
  62022. (d[A + 5] = U),
  62023. (A += 6),
  62024. (R += 6)
  62025. }
  62026. c.addGroup(C, R, I), (C += R), (y += M)
  62027. }
  62028. n.BufferGeometry.call(this),
  62029. (this.type = 'BoxBufferGeometry'),
  62030. (this.parameters = {
  62031. width: e,
  62032. height: t,
  62033. depth: i,
  62034. widthSegments: r,
  62035. heightSegments: o,
  62036. depthSegments: a
  62037. })
  62038. var c = this
  62039. ;(r = Math.floor(r) || 1), (o = Math.floor(o) || 1), (a = Math.floor(a) || 1)
  62040. var h = s(r, o, a),
  62041. u = (h / 4) * 6,
  62042. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  62043. p = new Float32Array(3 * h),
  62044. f = new Float32Array(3 * h),
  62045. g = new Float32Array(2 * h),
  62046. m = 0,
  62047. v = 0,
  62048. A = 0,
  62049. y = 0,
  62050. C = 0
  62051. l('z', 'y', 'x', -1, -1, i, t, e, a, o, 0),
  62052. l('z', 'y', 'x', 1, -1, i, t, -e, a, o, 1),
  62053. l('x', 'z', 'y', 1, 1, e, i, t, r, a, 2),
  62054. l('x', 'z', 'y', 1, -1, e, i, -t, r, a, 3),
  62055. l('x', 'y', 'z', 1, -1, e, t, i, r, o, 4),
  62056. l('x', 'y', 'z', -1, -1, e, t, -i, r, o, 5),
  62057. this.setIndex(new n.BufferAttribute(d, 1)),
  62058. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  62059. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  62060. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  62061. }),
  62062. (n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62063. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  62064. (n.CircleGeometry = function (e, t, i, r) {
  62065. n.Geometry.call(this),
  62066. (this.type = 'CircleGeometry'),
  62067. (this.parameters = {
  62068. radius: e,
  62069. segments: t,
  62070. thetaStart: i,
  62071. thetaLength: r
  62072. }),
  62073. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r))
  62074. }),
  62075. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  62076. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  62077. (n.CircleBufferGeometry = function (e, t, i, r) {
  62078. n.BufferGeometry.call(this),
  62079. (this.type = 'CircleBufferGeometry'),
  62080. (this.parameters = {
  62081. radius: e,
  62082. segments: t,
  62083. thetaStart: i,
  62084. thetaLength: r
  62085. }),
  62086. (e = e || 50),
  62087. (t = void 0 !== t ? Math.max(3, t) : 8),
  62088. (i = void 0 !== i ? i : 0),
  62089. (r = void 0 !== r ? r : 2 * Math.PI)
  62090. var o = t + 2,
  62091. a = new Float32Array(3 * o),
  62092. s = new Float32Array(3 * o),
  62093. l = new Float32Array(2 * o)
  62094. ;(s[2] = 1), (l[0] = 0.5), (l[1] = 0.5)
  62095. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  62096. var d = i + (c / t) * r
  62097. ;(a[h] = e * Math.cos(d)),
  62098. (a[h + 1] = e * Math.sin(d)),
  62099. (s[h + 2] = 1),
  62100. (l[u] = (a[h] / e + 1) / 2),
  62101. (l[u + 1] = (a[h + 1] / e + 1) / 2)
  62102. }
  62103. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0)
  62104. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  62105. this.addAttribute('position', new n.BufferAttribute(a, 3)),
  62106. this.addAttribute('normal', new n.BufferAttribute(s, 3)),
  62107. this.addAttribute('uv', new n.BufferAttribute(l, 2)),
  62108. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  62109. }),
  62110. (n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62111. (n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry),
  62112. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  62113. function c() {
  62114. var e = (r + 1) * (o + 1)
  62115. return a === !1 && (e += 2 * (r + 1) + 2 * r), e
  62116. }
  62117. function h() {
  62118. var e = r * o * 2 * 3
  62119. return a === !1 && (e += 2 * r * 3), e
  62120. }
  62121. function u() {
  62122. var a,
  62123. c,
  62124. h = new n.Vector3(),
  62125. u = new n.Vector3(),
  62126. d = (t - e) / i
  62127. for (c = 0; c <= o; c++) {
  62128. var p = [],
  62129. f = c / o,
  62130. b = f * (t - e) + e
  62131. for (a = 0; a <= r; a++) {
  62132. var w = a / r
  62133. ;(u.x = b * Math.sin(w * l + s)),
  62134. (u.y = -f * i + E),
  62135. (u.z = b * Math.cos(w * l + s)),
  62136. m.setXYZ(y, u.x, u.y, u.z),
  62137. h.copy(u),
  62138. ((0 === e && 0 === c) || (0 === t && c === o)) &&
  62139. ((h.x = Math.sin(w * l + s)), (h.z = Math.cos(w * l + s))),
  62140. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  62141. v.setXYZ(y, h.x, h.y, h.z),
  62142. A.setXY(y, w, 1 - f),
  62143. p.push(y),
  62144. y++
  62145. }
  62146. I.push(p)
  62147. }
  62148. for (a = 0; a < r; a++)
  62149. for (c = 0; c < o; c++) {
  62150. var _ = I[c][a],
  62151. T = I[c + 1][a],
  62152. x = I[c + 1][a + 1],
  62153. S = I[c][a + 1]
  62154. g.setX(C, _),
  62155. C++,
  62156. g.setX(C, T),
  62157. C++,
  62158. g.setX(C, S),
  62159. C++,
  62160. g.setX(C, T),
  62161. C++,
  62162. g.setX(C, x),
  62163. C++,
  62164. g.setX(C, S),
  62165. C++
  62166. }
  62167. }
  62168. function d(i) {
  62169. var o,
  62170. a,
  62171. c,
  62172. h = new n.Vector2(),
  62173. u = new n.Vector3(),
  62174. d = i === !0 ? e : t,
  62175. p = i === !0 ? 1 : -1
  62176. for (a = y, o = 1; o <= r; o++)
  62177. m.setXYZ(y, 0, E * p, 0),
  62178. v.setXYZ(y, 0, p, 0),
  62179. i === !0 ? ((h.x = o / r), (h.y = 0)) : ((h.x = (o - 1) / r), (h.y = 1)),
  62180. A.setXY(y, h.x, h.y),
  62181. y++
  62182. for (c = y, o = 0; o <= r; o++) {
  62183. var f = o / r
  62184. ;(u.x = d * Math.sin(f * l + s)),
  62185. (u.y = E * p),
  62186. (u.z = d * Math.cos(f * l + s)),
  62187. m.setXYZ(y, u.x, u.y, u.z),
  62188. v.setXYZ(y, 0, p, 0),
  62189. A.setXY(y, f, i === !0 ? 1 : 0),
  62190. y++
  62191. }
  62192. for (o = 0; o < r; o++) {
  62193. var I = a + o,
  62194. b = c + o
  62195. i === !0
  62196. ? (g.setX(C, b), C++, g.setX(C, b + 1), C++, g.setX(C, I), C++)
  62197. : (g.setX(C, b + 1), C++, g.setX(C, b), C++, g.setX(C, I), C++)
  62198. }
  62199. }
  62200. n.BufferGeometry.call(this),
  62201. (this.type = 'CylinderBufferGeometry'),
  62202. (this.parameters = {
  62203. radiusTop: e,
  62204. radiusBottom: t,
  62205. height: i,
  62206. radialSegments: r,
  62207. heightSegments: o,
  62208. openEnded: a,
  62209. thetaStart: s,
  62210. thetaLength: l
  62211. }),
  62212. (e = void 0 !== e ? e : 20),
  62213. (t = void 0 !== t ? t : 20),
  62214. (i = void 0 !== i ? i : 100),
  62215. (r = Math.floor(r) || 8),
  62216. (o = Math.floor(o) || 1),
  62217. (a = void 0 !== a && a),
  62218. (s = void 0 !== s ? s : 0),
  62219. (l = void 0 !== l ? l : 2 * Math.PI)
  62220. var p = c(),
  62221. f = h(),
  62222. g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f), 1),
  62223. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62224. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62225. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  62226. y = 0,
  62227. C = 0,
  62228. I = [],
  62229. E = i / 2
  62230. u(),
  62231. a === !1 && (e > 0 && d(!0), t > 0 && d(!1)),
  62232. this.setIndex(g),
  62233. this.addAttribute('position', m),
  62234. this.addAttribute('normal', v),
  62235. this.addAttribute('uv', A)
  62236. }),
  62237. (n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62238. (n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry),
  62239. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  62240. n.Geometry.call(this),
  62241. (this.type = 'CylinderGeometry'),
  62242. (this.parameters = {
  62243. radiusTop: e,
  62244. radiusBottom: t,
  62245. height: i,
  62246. radialSegments: r,
  62247. heightSegments: o,
  62248. openEnded: a,
  62249. thetaStart: s,
  62250. thetaLength: l
  62251. }),
  62252. this.fromBufferGeometry(new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)),
  62253. this.mergeVertices()
  62254. }),
  62255. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  62256. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  62257. (n.EdgesGeometry = function (e, t) {
  62258. function i(e, t) {
  62259. return e - t
  62260. }
  62261. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1)
  62262. var r,
  62263. o = Math.cos(n.Math.degToRad(t)),
  62264. a = [0, 0],
  62265. s = {},
  62266. l = ['a', 'b', 'c']
  62267. e instanceof n.BufferGeometry
  62268. ? ((r = new n.Geometry()), r.fromBufferGeometry(e))
  62269. : (r = e.clone()),
  62270. r.mergeVertices(),
  62271. r.computeFaceNormals()
  62272. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  62273. for (var p = h[u], f = 0; f < 3; f++) {
  62274. ;(a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i)
  62275. var g = a.toString()
  62276. void 0 === s[g]
  62277. ? (s[g] = {
  62278. vert1: a[0],
  62279. vert2: a[1],
  62280. face1: u,
  62281. face2: void 0
  62282. })
  62283. : (s[g].face2 = u)
  62284. }
  62285. var m = []
  62286. for (var g in s) {
  62287. var v = s[g]
  62288. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  62289. var A = c[v.vert1]
  62290. m.push(A.x),
  62291. m.push(A.y),
  62292. m.push(A.z),
  62293. (A = c[v.vert2]),
  62294. m.push(A.x),
  62295. m.push(A.y),
  62296. m.push(A.z)
  62297. }
  62298. }
  62299. this.addAttribute('position', new n.BufferAttribute(new Float32Array(m), 3))
  62300. }),
  62301. (n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62302. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  62303. (n.ExtrudeGeometry = function (e, t) {
  62304. return 'undefined' == typeof e
  62305. ? void (e = [])
  62306. : (n.Geometry.call(this),
  62307. (this.type = 'ExtrudeGeometry'),
  62308. (e = Array.isArray(e) ? e : [e]),
  62309. this.addShapeList(e, t),
  62310. void this.computeFaceNormals())
  62311. })
  62312. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype)
  62313. ;(n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  62314. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  62315. for (var i = e.length, n = 0; n < i; n++) {
  62316. var r = e[n]
  62317. this.addShape(r, t)
  62318. }
  62319. }),
  62320. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  62321. function i(e, t, i) {
  62322. return (
  62323. t || console.error('THREE.ExtrudeGeometry: vec does not exist'),
  62324. t.clone().multiplyScalar(i).add(e)
  62325. )
  62326. }
  62327. function r(e, t, i) {
  62328. var r,
  62329. o,
  62330. a = 1,
  62331. s = e.x - t.x,
  62332. l = e.y - t.y,
  62333. c = i.x - e.x,
  62334. h = i.y - e.y,
  62335. u = s * s + l * l,
  62336. d = s * h - l * c
  62337. if (Math.abs(d) > Number.EPSILON) {
  62338. var p = Math.sqrt(u),
  62339. f = Math.sqrt(c * c + h * h),
  62340. g = t.x - l / p,
  62341. m = t.y + s / p,
  62342. v = i.x - h / f,
  62343. A = i.y + c / f,
  62344. y = ((v - g) * h - (A - m) * c) / (s * h - l * c)
  62345. ;(r = g + s * y - e.x), (o = m + l * y - e.y)
  62346. var C = r * r + o * o
  62347. if (C <= 2) return new n.Vector2(r, o)
  62348. a = Math.sqrt(C / 2)
  62349. } else {
  62350. var I = !1
  62351. s > Number.EPSILON
  62352. ? c > Number.EPSILON && (I = !0)
  62353. : s < -Number.EPSILON
  62354. ? c < -Number.EPSILON && (I = !0)
  62355. : Math.sign(l) === Math.sign(h) && (I = !0),
  62356. I
  62357. ? ((r = -l), (o = s), (a = Math.sqrt(u)))
  62358. : ((r = s), (o = l), (a = Math.sqrt(u / 2)))
  62359. }
  62360. return new n.Vector2(r / a, o / a)
  62361. }
  62362. function o() {
  62363. if (C) {
  62364. var e = 0,
  62365. t = z * e
  62366. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t)
  62367. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++)
  62368. (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t)
  62369. } else {
  62370. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0])
  62371. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  62372. }
  62373. }
  62374. function a() {
  62375. var e = 0
  62376. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++)
  62377. (T = L[x]), s(T, e), (e += T.length)
  62378. }
  62379. function s(e, t) {
  62380. var i, n
  62381. for (Y = e.length; --Y >= 0; ) {
  62382. ;(i = Y), (n = Y - 1), n < 0 && (n = e.length - 1)
  62383. var r = 0,
  62384. o = E + 2 * y
  62385. for (r = 0; r < o; r++) {
  62386. var a = z * r,
  62387. s = z * (r + 1),
  62388. l = t + i + a,
  62389. c = t + n + a,
  62390. u = t + n + s,
  62391. d = t + i + s
  62392. h(l, c, u, d, e, r, o, i, n)
  62393. }
  62394. }
  62395. }
  62396. function l(e, t, i) {
  62397. M.vertices.push(new n.Vector3(e, t, i))
  62398. }
  62399. function c(e, t, i) {
  62400. ;(e += R), (t += R), (i += R), M.faces.push(new n.Face3(e, t, i, null, null, 0))
  62401. var r = _.generateTopUV(M, e, t, i)
  62402. M.faceVertexUvs[0].push(r)
  62403. }
  62404. function h(e, t, i, r, o, a, s, l, c) {
  62405. ;(e += R),
  62406. (t += R),
  62407. (i += R),
  62408. (r += R),
  62409. M.faces.push(new n.Face3(e, t, r, null, null, 1)),
  62410. M.faces.push(new n.Face3(t, i, r, null, null, 1))
  62411. var h = _.generateSideWallUV(M, e, t, i, r)
  62412. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  62413. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  62414. }
  62415. var u,
  62416. d,
  62417. p,
  62418. f,
  62419. g,
  62420. m = void 0 !== t.amount ? t.amount : 100,
  62421. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  62422. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  62423. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  62424. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  62425. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62426. E = void 0 !== t.steps ? t.steps : 1,
  62427. b = t.extrudePath,
  62428. w = !1,
  62429. _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator
  62430. b &&
  62431. ((u = b.getSpacedPoints(E)),
  62432. (w = !0),
  62433. (C = !1),
  62434. (d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  62435. (p = new n.Vector3()),
  62436. (f = new n.Vector3()),
  62437. (g = new n.Vector3())),
  62438. C || ((y = 0), (v = 0), (A = 0))
  62439. var T,
  62440. x,
  62441. S,
  62442. M = this,
  62443. R = this.vertices.length,
  62444. P = e.extractPoints(I),
  62445. O = P.shape,
  62446. L = P.holes,
  62447. D = !n.ShapeUtils.isClockWise(O)
  62448. if (D) {
  62449. for (O = O.reverse(), x = 0, S = L.length; x < S; x++)
  62450. (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse())
  62451. D = !1
  62452. }
  62453. var N = n.ShapeUtils.triangulateShape(O, L),
  62454. B = O
  62455. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T))
  62456. for (
  62457. var F,
  62458. V,
  62459. U,
  62460. k,
  62461. H,
  62462. G,
  62463. z = O.length,
  62464. W = N.length,
  62465. j = [],
  62466. Y = 0,
  62467. X = B.length,
  62468. Z = X - 1,
  62469. q = Y + 1;
  62470. Y < X;
  62471. Y++, Z++, q++
  62472. )
  62473. Z === X && (Z = 0), q === X && (q = 0), (j[Y] = r(B[Y], B[Z], B[q]))
  62474. var K,
  62475. Q = [],
  62476. J = j.concat()
  62477. for (x = 0, S = L.length; x < S; x++) {
  62478. for (
  62479. T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1;
  62480. Y < X;
  62481. Y++, Z++, q++
  62482. )
  62483. Z === X && (Z = 0), q === X && (q = 0), (K[Y] = r(T[Y], T[Z], T[q]))
  62484. Q.push(K), (J = J.concat(K))
  62485. }
  62486. for (F = 0; F < y; F++) {
  62487. for (
  62488. U = F / y,
  62489. k = v * (1 - U),
  62490. V = A * Math.sin((U * Math.PI) / 2),
  62491. Y = 0,
  62492. X = B.length;
  62493. Y < X;
  62494. Y++
  62495. )
  62496. (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k)
  62497. for (x = 0, S = L.length; x < S; x++)
  62498. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62499. (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k)
  62500. }
  62501. for (V = A, Y = 0; Y < z; Y++)
  62502. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62503. w
  62504. ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  62505. p.copy(d.binormals[0]).multiplyScalar(H.y),
  62506. g.copy(u[0]).add(f).add(p),
  62507. l(g.x, g.y, g.z))
  62508. : l(H.x, H.y, 0)
  62509. var $
  62510. for ($ = 1; $ <= E; $++)
  62511. for (Y = 0; Y < z; Y++)
  62512. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62513. w
  62514. ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  62515. p.copy(d.binormals[$]).multiplyScalar(H.y),
  62516. g.copy(u[$]).add(f).add(p),
  62517. l(g.x, g.y, g.z))
  62518. : l(H.x, H.y, (m / E) * $)
  62519. for (F = y - 1; F >= 0; F--) {
  62520. for (
  62521. U = F / y,
  62522. k = v * (1 - U),
  62523. V = A * Math.sin((U * Math.PI) / 2),
  62524. Y = 0,
  62525. X = B.length;
  62526. Y < X;
  62527. Y++
  62528. )
  62529. (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k)
  62530. for (x = 0, S = L.length; x < S; x++)
  62531. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62532. (H = i(T[Y], K[Y], V)),
  62533. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  62534. }
  62535. o(), a()
  62536. }),
  62537. (n.ExtrudeGeometry.WorldUVGenerator = {
  62538. generateTopUV: function (e, t, i, r) {
  62539. var o = e.vertices,
  62540. a = o[t],
  62541. s = o[i],
  62542. l = o[r]
  62543. return [new n.Vector2(a.x, a.y), new n.Vector2(s.x, s.y), new n.Vector2(l.x, l.y)]
  62544. },
  62545. generateSideWallUV: function (e, t, i, r, o) {
  62546. var a = e.vertices,
  62547. s = a[t],
  62548. l = a[i],
  62549. c = a[r],
  62550. h = a[o]
  62551. return Math.abs(s.y - l.y) < 0.01
  62552. ? [
  62553. new n.Vector2(s.x, 1 - s.z),
  62554. new n.Vector2(l.x, 1 - l.z),
  62555. new n.Vector2(c.x, 1 - c.z),
  62556. new n.Vector2(h.x, 1 - h.z)
  62557. ]
  62558. : [
  62559. new n.Vector2(s.y, 1 - s.z),
  62560. new n.Vector2(l.y, 1 - l.z),
  62561. new n.Vector2(c.y, 1 - c.z),
  62562. new n.Vector2(h.y, 1 - h.z)
  62563. ]
  62564. }
  62565. }),
  62566. (n.ShapeGeometry = function (e, t) {
  62567. n.Geometry.call(this),
  62568. (this.type = 'ShapeGeometry'),
  62569. Array.isArray(e) === !1 && (e = [e]),
  62570. this.addShapeList(e, t),
  62571. this.computeFaceNormals()
  62572. }),
  62573. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  62574. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  62575. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  62576. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t)
  62577. return this
  62578. }),
  62579. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  62580. void 0 === t && (t = {})
  62581. var i,
  62582. r,
  62583. o,
  62584. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62585. s = t.material,
  62586. l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  62587. c = this.vertices.length,
  62588. h = e.extractPoints(a),
  62589. u = h.shape,
  62590. d = h.holes,
  62591. p = !n.ShapeUtils.isClockWise(u)
  62592. if (p) {
  62593. for (u = u.reverse(), i = 0, r = d.length; i < r; i++)
  62594. (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse())
  62595. p = !1
  62596. }
  62597. var f = n.ShapeUtils.triangulateShape(u, d)
  62598. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o))
  62599. var g,
  62600. m,
  62601. v = u.length,
  62602. A = f.length
  62603. for (i = 0; i < v; i++) (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0))
  62604. for (i = 0; i < A; i++) {
  62605. m = f[i]
  62606. var y = m[0] + c,
  62607. C = m[1] + c,
  62608. I = m[2] + c
  62609. this.faces.push(new n.Face3(y, C, I, null, null, s)),
  62610. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  62611. }
  62612. }),
  62613. (n.LatheBufferGeometry = function (e, t, i, r) {
  62614. n.BufferGeometry.call(this),
  62615. (this.type = 'LatheBufferGeometry'),
  62616. (this.parameters = {
  62617. points: e,
  62618. segments: t,
  62619. phiStart: i,
  62620. phiLength: r
  62621. }),
  62622. (t = Math.floor(t) || 12),
  62623. (i = i || 0),
  62624. (r = r || 2 * Math.PI),
  62625. (r = n.Math.clamp(r, 0, 2 * Math.PI))
  62626. var o,
  62627. a,
  62628. s,
  62629. l = (t + 1) * e.length,
  62630. c = t * e.length * 2 * 3,
  62631. h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c), 1),
  62632. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  62633. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  62634. p = 0,
  62635. f = 0,
  62636. g = (1 / (e.length - 1), 1 / t),
  62637. m = new n.Vector3(),
  62638. v = new n.Vector2()
  62639. for (a = 0; a <= t; a++) {
  62640. var A = i + a * g * r,
  62641. y = Math.sin(A),
  62642. C = Math.cos(A)
  62643. for (s = 0; s <= e.length - 1; s++)
  62644. (m.x = e[s].x * y),
  62645. (m.y = e[s].y),
  62646. (m.z = e[s].x * C),
  62647. u.setXYZ(p, m.x, m.y, m.z),
  62648. (v.x = a / t),
  62649. (v.y = s / (e.length - 1)),
  62650. d.setXY(p, v.x, v.y),
  62651. p++
  62652. }
  62653. for (a = 0; a < t; a++)
  62654. for (s = 0; s < e.length - 1; s++) {
  62655. o = s + a * e.length
  62656. var I = o,
  62657. E = o + e.length,
  62658. b = o + e.length + 1,
  62659. w = o + 1
  62660. h.setX(f, I),
  62661. f++,
  62662. h.setX(f, E),
  62663. f++,
  62664. h.setX(f, w),
  62665. f++,
  62666. h.setX(f, E),
  62667. f++,
  62668. h.setX(f, b),
  62669. f++,
  62670. h.setX(f, w),
  62671. f++
  62672. }
  62673. if (
  62674. (this.setIndex(h),
  62675. this.addAttribute('position', u),
  62676. this.addAttribute('uv', d),
  62677. this.computeVertexNormals(),
  62678. r === 2 * Math.PI)
  62679. ) {
  62680. var _ = this.attributes.normal.array,
  62681. T = new n.Vector3(),
  62682. x = new n.Vector3(),
  62683. S = new n.Vector3()
  62684. for (o = t * e.length * 3, a = 0, s = 0; a < e.length; a++, s += 3)
  62685. (T.x = _[s + 0]),
  62686. (T.y = _[s + 1]),
  62687. (T.z = _[s + 2]),
  62688. (x.x = _[o + s + 0]),
  62689. (x.y = _[o + s + 1]),
  62690. (x.z = _[o + s + 2]),
  62691. S.addVectors(T, x).normalize(),
  62692. (_[s + 0] = _[o + s + 0] = S.x),
  62693. (_[s + 1] = _[o + s + 1] = S.y),
  62694. (_[s + 2] = _[o + s + 2] = S.z)
  62695. }
  62696. }),
  62697. (n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62698. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  62699. (n.LatheGeometry = function (e, t, i, r) {
  62700. n.Geometry.call(this),
  62701. (this.type = 'LatheGeometry'),
  62702. (this.parameters = {
  62703. points: e,
  62704. segments: t,
  62705. phiStart: i,
  62706. phiLength: r
  62707. }),
  62708. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  62709. this.mergeVertices()
  62710. }),
  62711. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  62712. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  62713. (n.PlaneGeometry = function (e, t, i, r) {
  62714. n.Geometry.call(this),
  62715. (this.type = 'PlaneGeometry'),
  62716. (this.parameters = {
  62717. width: e,
  62718. height: t,
  62719. widthSegments: i,
  62720. heightSegments: r
  62721. }),
  62722. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r))
  62723. }),
  62724. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  62725. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  62726. (n.PlaneBufferGeometry = function (e, t, i, r) {
  62727. n.BufferGeometry.call(this),
  62728. (this.type = 'PlaneBufferGeometry'),
  62729. (this.parameters = {
  62730. width: e,
  62731. height: t,
  62732. widthSegments: i,
  62733. heightSegments: r
  62734. })
  62735. for (
  62736. var o = e / 2,
  62737. a = t / 2,
  62738. s = Math.floor(i) || 1,
  62739. l = Math.floor(r) || 1,
  62740. c = s + 1,
  62741. h = l + 1,
  62742. u = e / s,
  62743. d = t / l,
  62744. p = new Float32Array(c * h * 3),
  62745. f = new Float32Array(c * h * 3),
  62746. g = new Float32Array(c * h * 2),
  62747. m = 0,
  62748. v = 0,
  62749. A = 0;
  62750. A < h;
  62751. A++
  62752. )
  62753. for (var y = A * d - a, C = 0; C < c; C++) {
  62754. var I = C * u - o
  62755. ;(p[m] = I),
  62756. (p[m + 1] = -y),
  62757. (f[m + 2] = 1),
  62758. (g[v] = C / s),
  62759. (g[v + 1] = 1 - A / l),
  62760. (m += 3),
  62761. (v += 2)
  62762. }
  62763. m = 0
  62764. for (
  62765. var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0;
  62766. A < l;
  62767. A++
  62768. )
  62769. for (var C = 0; C < s; C++) {
  62770. var b = C + c * A,
  62771. w = C + c * (A + 1),
  62772. _ = C + 1 + c * (A + 1),
  62773. T = C + 1 + c * A
  62774. ;(E[m] = b),
  62775. (E[m + 1] = w),
  62776. (E[m + 2] = T),
  62777. (E[m + 3] = w),
  62778. (E[m + 4] = _),
  62779. (E[m + 5] = T),
  62780. (m += 6)
  62781. }
  62782. this.setIndex(new n.BufferAttribute(E, 1)),
  62783. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  62784. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  62785. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  62786. }),
  62787. (n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62788. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  62789. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  62790. n.BufferGeometry.call(this),
  62791. (this.type = 'RingBufferGeometry'),
  62792. (this.parameters = {
  62793. innerRadius: e,
  62794. outerRadius: t,
  62795. thetaSegments: i,
  62796. phiSegments: r,
  62797. thetaStart: o,
  62798. thetaLength: a
  62799. }),
  62800. (e = e || 20),
  62801. (t = t || 50),
  62802. (o = void 0 !== o ? o : 0),
  62803. (a = void 0 !== a ? a : 2 * Math.PI),
  62804. (i = void 0 !== i ? Math.max(3, i) : 8),
  62805. (r = void 0 !== r ? Math.max(1, r) : 1)
  62806. var s,
  62807. l,
  62808. c,
  62809. h = (i + 1) * (r + 1),
  62810. u = i * r * 2 * 3,
  62811. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  62812. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62813. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62814. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  62815. m = 0,
  62816. v = 0,
  62817. A = e,
  62818. y = (t - e) / r,
  62819. C = new n.Vector3(),
  62820. I = new n.Vector2()
  62821. for (l = 0; l <= r; l++) {
  62822. for (c = 0; c <= i; c++)
  62823. (s = o + (c / i) * a),
  62824. (C.x = A * Math.cos(s)),
  62825. (C.y = A * Math.sin(s)),
  62826. p.setXYZ(m, C.x, C.y, C.z),
  62827. f.setXYZ(m, 0, 0, 1),
  62828. (I.x = (C.x / t + 1) / 2),
  62829. (I.y = (C.y / t + 1) / 2),
  62830. g.setXY(m, I.x, I.y),
  62831. m++
  62832. A += y
  62833. }
  62834. for (l = 0; l < r; l++) {
  62835. var E = l * (i + 1)
  62836. for (c = 0; c < i; c++) {
  62837. s = c + E
  62838. var b = s,
  62839. w = s + i + 1,
  62840. _ = s + i + 2,
  62841. T = s + 1
  62842. d.setX(v, b),
  62843. v++,
  62844. d.setX(v, w),
  62845. v++,
  62846. d.setX(v, _),
  62847. v++,
  62848. d.setX(v, b),
  62849. v++,
  62850. d.setX(v, _),
  62851. v++,
  62852. d.setX(v, T),
  62853. v++
  62854. }
  62855. }
  62856. this.setIndex(d),
  62857. this.addAttribute('position', p),
  62858. this.addAttribute('normal', f),
  62859. this.addAttribute('uv', g)
  62860. }),
  62861. (n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62862. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  62863. (n.RingGeometry = function (e, t, i, r, o, a) {
  62864. n.Geometry.call(this),
  62865. (this.type = 'RingGeometry'),
  62866. (this.parameters = {
  62867. innerRadius: e,
  62868. outerRadius: t,
  62869. thetaSegments: i,
  62870. phiSegments: r,
  62871. thetaStart: o,
  62872. thetaLength: a
  62873. }),
  62874. this.fromBufferGeometry(new n.RingBufferGeometry(e, t, i, r, o, a))
  62875. }),
  62876. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  62877. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  62878. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  62879. n.Geometry.call(this),
  62880. (this.type = 'SphereGeometry'),
  62881. (this.parameters = {
  62882. radius: e,
  62883. widthSegments: t,
  62884. heightSegments: i,
  62885. phiStart: r,
  62886. phiLength: o,
  62887. thetaStart: a,
  62888. thetaLength: s
  62889. }),
  62890. this.fromBufferGeometry(new n.SphereBufferGeometry(e, t, i, r, o, a, s))
  62891. }),
  62892. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  62893. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  62894. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  62895. n.BufferGeometry.call(this),
  62896. (this.type = 'SphereBufferGeometry'),
  62897. (this.parameters = {
  62898. radius: e,
  62899. widthSegments: t,
  62900. heightSegments: i,
  62901. phiStart: r,
  62902. phiLength: o,
  62903. thetaStart: a,
  62904. thetaLength: s
  62905. }),
  62906. (e = e || 50),
  62907. (t = Math.max(3, Math.floor(t) || 8)),
  62908. (i = Math.max(2, Math.floor(i) || 6)),
  62909. (r = void 0 !== r ? r : 0),
  62910. (o = void 0 !== o ? o : 2 * Math.PI),
  62911. (a = void 0 !== a ? a : 0),
  62912. (s = void 0 !== s ? s : Math.PI)
  62913. for (
  62914. var l = a + s,
  62915. c = (t + 1) * (i + 1),
  62916. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62917. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62918. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  62919. p = 0,
  62920. f = [],
  62921. g = new n.Vector3(),
  62922. m = 0;
  62923. m <= i;
  62924. m++
  62925. ) {
  62926. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  62927. var C = y / t,
  62928. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  62929. E = e * Math.cos(a + A * s),
  62930. b = e * Math.sin(r + C * o) * Math.sin(a + A * s)
  62931. g.set(I, E, b).normalize(),
  62932. h.setXYZ(p, I, E, b),
  62933. u.setXYZ(p, g.x, g.y, g.z),
  62934. d.setXY(p, C, 1 - A),
  62935. v.push(p),
  62936. p++
  62937. }
  62938. f.push(v)
  62939. }
  62940. for (var w = [], m = 0; m < i; m++)
  62941. for (var y = 0; y < t; y++) {
  62942. var _ = f[m][y + 1],
  62943. T = f[m][y],
  62944. x = f[m + 1][y],
  62945. S = f[m + 1][y + 1]
  62946. ;(0 !== m || a > 0) && w.push(_, T, S),
  62947. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  62948. }
  62949. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w, 1)),
  62950. this.addAttribute('position', h),
  62951. this.addAttribute('normal', u),
  62952. this.addAttribute('uv', d),
  62953. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  62954. }),
  62955. (n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62956. (n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry),
  62957. (n.TextGeometry = function (e, t) {
  62958. t = t || {}
  62959. var i = t.font
  62960. if (i instanceof n.Font == !1)
  62961. return (
  62962. console.error(
  62963. 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.'
  62964. ),
  62965. new n.Geometry()
  62966. )
  62967. var r = i.generateShapes(e, t.size, t.curveSegments)
  62968. ;(t.amount = void 0 !== t.height ? t.height : 50),
  62969. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  62970. void 0 === t.bevelSize && (t.bevelSize = 8),
  62971. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  62972. n.ExtrudeGeometry.call(this, r, t),
  62973. (this.type = 'TextGeometry')
  62974. }),
  62975. (n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype)),
  62976. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  62977. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  62978. n.BufferGeometry.call(this),
  62979. (this.type = 'TorusBufferGeometry'),
  62980. (this.parameters = {
  62981. radius: e,
  62982. tube: t,
  62983. radialSegments: i,
  62984. tubularSegments: r,
  62985. arc: o
  62986. }),
  62987. (e = e || 100),
  62988. (t = t || 40),
  62989. (i = Math.floor(i) || 8),
  62990. (r = Math.floor(r) || 6),
  62991. (o = o || 2 * Math.PI)
  62992. var a,
  62993. s,
  62994. l = (i + 1) * (r + 1),
  62995. c = i * r * 2 * 3,
  62996. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  62997. u = new Float32Array(3 * l),
  62998. d = new Float32Array(3 * l),
  62999. p = new Float32Array(2 * l),
  63000. f = 0,
  63001. g = 0,
  63002. m = 0,
  63003. v = new n.Vector3(),
  63004. A = new n.Vector3(),
  63005. y = new n.Vector3()
  63006. for (a = 0; a <= i; a++)
  63007. for (s = 0; s <= r; s++) {
  63008. var C = (s / r) * o,
  63009. I = (a / i) * Math.PI * 2
  63010. ;(A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  63011. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  63012. (A.z = t * Math.sin(I)),
  63013. (u[f] = A.x),
  63014. (u[f + 1] = A.y),
  63015. (u[f + 2] = A.z),
  63016. (v.x = e * Math.cos(C)),
  63017. (v.y = e * Math.sin(C)),
  63018. y.subVectors(A, v).normalize(),
  63019. (d[f] = y.x),
  63020. (d[f + 1] = y.y),
  63021. (d[f + 2] = y.z),
  63022. (p[g] = s / r),
  63023. (p[g + 1] = a / i),
  63024. (f += 3),
  63025. (g += 2)
  63026. }
  63027. for (a = 1; a <= i; a++)
  63028. for (s = 1; s <= r; s++) {
  63029. var E = (r + 1) * a + s - 1,
  63030. b = (r + 1) * (a - 1) + s - 1,
  63031. w = (r + 1) * (a - 1) + s,
  63032. _ = (r + 1) * a + s
  63033. ;(h[m] = E),
  63034. (h[m + 1] = b),
  63035. (h[m + 2] = _),
  63036. (h[m + 3] = b),
  63037. (h[m + 4] = w),
  63038. (h[m + 5] = _),
  63039. (m += 6)
  63040. }
  63041. this.setIndex(new n.BufferAttribute(h, 1)),
  63042. this.addAttribute('position', new n.BufferAttribute(u, 3)),
  63043. this.addAttribute('normal', new n.BufferAttribute(d, 3)),
  63044. this.addAttribute('uv', new n.BufferAttribute(p, 2))
  63045. }),
  63046. (n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63047. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  63048. (n.TorusGeometry = function (e, t, i, r, o) {
  63049. n.Geometry.call(this),
  63050. (this.type = 'TorusGeometry'),
  63051. (this.parameters = {
  63052. radius: e,
  63053. tube: t,
  63054. radialSegments: i,
  63055. tubularSegments: r,
  63056. arc: o
  63057. }),
  63058. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o))
  63059. }),
  63060. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  63061. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  63062. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  63063. function s(e, t, i, n, r) {
  63064. var o = Math.cos(e),
  63065. a = Math.sin(e),
  63066. s = (i / t) * e,
  63067. l = Math.cos(s)
  63068. ;(r.x = n * (2 + l) * 0.5 * o),
  63069. (r.y = n * (2 + l) * a * 0.5),
  63070. (r.z = n * Math.sin(s) * 0.5)
  63071. }
  63072. n.BufferGeometry.call(this),
  63073. (this.type = 'TorusKnotBufferGeometry'),
  63074. (this.parameters = {
  63075. radius: e,
  63076. tube: t,
  63077. tubularSegments: i,
  63078. radialSegments: r,
  63079. p: o,
  63080. q: a
  63081. }),
  63082. (e = e || 100),
  63083. (t = t || 40),
  63084. (i = Math.floor(i) || 64),
  63085. (r = Math.floor(r) || 8),
  63086. (o = o || 2),
  63087. (a = a || 3)
  63088. var l,
  63089. c,
  63090. h = (r + 1) * (i + 1),
  63091. u = r * i * 2 * 3,
  63092. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  63093. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  63094. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  63095. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  63096. m = 0,
  63097. v = 0,
  63098. A = new n.Vector3(),
  63099. y = new n.Vector3(),
  63100. C = new n.Vector2(),
  63101. I = new n.Vector3(),
  63102. E = new n.Vector3(),
  63103. b = new n.Vector3(),
  63104. w = new n.Vector3(),
  63105. _ = new n.Vector3()
  63106. for (l = 0; l <= i; ++l) {
  63107. var T = (l / i) * o * Math.PI * 2
  63108. for (
  63109. s(T, o, a, e, I),
  63110. s(T + 0.01, o, a, e, E),
  63111. w.subVectors(E, I),
  63112. _.addVectors(E, I),
  63113. b.crossVectors(w, _),
  63114. _.crossVectors(b, w),
  63115. b.normalize(),
  63116. _.normalize(),
  63117. c = 0;
  63118. c <= r;
  63119. ++c
  63120. ) {
  63121. var x = (c / r) * Math.PI * 2,
  63122. S = -t * Math.cos(x),
  63123. M = t * Math.sin(x)
  63124. ;(A.x = I.x + (S * _.x + M * b.x)),
  63125. (A.y = I.y + (S * _.y + M * b.y)),
  63126. (A.z = I.z + (S * _.z + M * b.z)),
  63127. p.setXYZ(m, A.x, A.y, A.z),
  63128. y.subVectors(A, I).normalize(),
  63129. f.setXYZ(m, y.x, y.y, y.z),
  63130. (C.x = l / i),
  63131. (C.y = c / r),
  63132. g.setXY(m, C.x, C.y),
  63133. m++
  63134. }
  63135. }
  63136. for (c = 1; c <= i; c++)
  63137. for (l = 1; l <= r; l++) {
  63138. var R = (r + 1) * (c - 1) + (l - 1),
  63139. P = (r + 1) * c + (l - 1),
  63140. O = (r + 1) * c + l,
  63141. L = (r + 1) * (c - 1) + l
  63142. d.setX(v, R),
  63143. v++,
  63144. d.setX(v, P),
  63145. v++,
  63146. d.setX(v, L),
  63147. v++,
  63148. d.setX(v, P),
  63149. v++,
  63150. d.setX(v, O),
  63151. v++,
  63152. d.setX(v, L),
  63153. v++
  63154. }
  63155. this.setIndex(d),
  63156. this.addAttribute('position', p),
  63157. this.addAttribute('normal', f),
  63158. this.addAttribute('uv', g)
  63159. }),
  63160. (n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63161. (n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry),
  63162. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  63163. n.Geometry.call(this),
  63164. (this.type = 'TorusKnotGeometry'),
  63165. (this.parameters = {
  63166. radius: e,
  63167. tube: t,
  63168. tubularSegments: i,
  63169. radialSegments: r,
  63170. p: o,
  63171. q: a
  63172. }),
  63173. void 0 !== s &&
  63174. console.warn(
  63175. 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'
  63176. ),
  63177. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e, t, i, r, o, a)),
  63178. this.mergeVertices()
  63179. }),
  63180. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  63181. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  63182. (n.TubeGeometry = function (e, t, i, r, o, a) {
  63183. function s(e, t, i) {
  63184. return R.vertices.push(new n.Vector3(e, t, i)) - 1
  63185. }
  63186. n.Geometry.call(this),
  63187. (this.type = 'TubeGeometry'),
  63188. (this.parameters = {
  63189. path: e,
  63190. segments: t,
  63191. radius: i,
  63192. radialSegments: r,
  63193. closed: o,
  63194. taper: a
  63195. }),
  63196. (t = t || 64),
  63197. (i = i || 1),
  63198. (r = r || 8),
  63199. (o = o || !1),
  63200. (a = a || n.TubeGeometry.NoTaper)
  63201. var l,
  63202. c,
  63203. h,
  63204. u,
  63205. d,
  63206. p,
  63207. f,
  63208. g,
  63209. m,
  63210. v,
  63211. A,
  63212. y,
  63213. C,
  63214. I,
  63215. E,
  63216. b,
  63217. w,
  63218. _,
  63219. T,
  63220. x,
  63221. S,
  63222. M = [],
  63223. R = this,
  63224. P = t + 1,
  63225. O = new n.Vector3(),
  63226. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  63227. D = L.tangents,
  63228. N = L.normals,
  63229. B = L.binormals
  63230. for (this.tangents = D, this.normals = N, this.binormals = B, v = 0; v < P; v++)
  63231. for (
  63232. M[v] = [],
  63233. u = v / (P - 1),
  63234. m = e.getPointAt(u),
  63235. l = D[v],
  63236. c = N[v],
  63237. h = B[v],
  63238. p = i * a(u),
  63239. A = 0;
  63240. A < r;
  63241. A++
  63242. )
  63243. (d = (A / r) * 2 * Math.PI),
  63244. (f = -p * Math.cos(d)),
  63245. (g = p * Math.sin(d)),
  63246. O.copy(m),
  63247. (O.x += f * c.x + g * h.x),
  63248. (O.y += f * c.y + g * h.y),
  63249. (O.z += f * c.z + g * h.z),
  63250. (M[v][A] = s(O.x, O.y, O.z))
  63251. for (v = 0; v < t; v++)
  63252. for (A = 0; A < r; A++)
  63253. (y = o ? (v + 1) % t : v + 1),
  63254. (C = (A + 1) % r),
  63255. (I = M[v][A]),
  63256. (E = M[y][A]),
  63257. (b = M[y][C]),
  63258. (w = M[v][C]),
  63259. (_ = new n.Vector2(v / t, A / r)),
  63260. (T = new n.Vector2((v + 1) / t, A / r)),
  63261. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  63262. (S = new n.Vector2(v / t, (A + 1) / r)),
  63263. this.faces.push(new n.Face3(I, E, w)),
  63264. this.faceVertexUvs[0].push([_, T, S]),
  63265. this.faces.push(new n.Face3(E, b, w)),
  63266. this.faceVertexUvs[0].push([T.clone(), x, S.clone()])
  63267. this.computeFaceNormals(), this.computeVertexNormals()
  63268. }),
  63269. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  63270. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  63271. (n.TubeGeometry.NoTaper = function (e) {
  63272. return 1
  63273. }),
  63274. (n.TubeGeometry.SinusoidalTaper = function (e) {
  63275. return Math.sin(Math.PI * e)
  63276. }),
  63277. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  63278. function r() {
  63279. ;(f[0] = new n.Vector3()),
  63280. (g[0] = new n.Vector3()),
  63281. (a = Number.MAX_VALUE),
  63282. (s = Math.abs(p[0].x)),
  63283. (l = Math.abs(p[0].y)),
  63284. (c = Math.abs(p[0].z)),
  63285. s <= a && ((a = s), d.set(1, 0, 0)),
  63286. l <= a && ((a = l), d.set(0, 1, 0)),
  63287. c <= a && d.set(0, 0, 1),
  63288. m.crossVectors(p[0], d).normalize(),
  63289. f[0].crossVectors(p[0], m),
  63290. g[0].crossVectors(p[0], f[0])
  63291. }
  63292. var o,
  63293. a,
  63294. s,
  63295. l,
  63296. c,
  63297. h,
  63298. u,
  63299. d = new n.Vector3(),
  63300. p = [],
  63301. f = [],
  63302. g = [],
  63303. m = new n.Vector3(),
  63304. v = new n.Matrix4(),
  63305. A = t + 1
  63306. for (this.tangents = p, this.normals = f, this.binormals = g, h = 0; h < A; h++)
  63307. (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize()
  63308. for (r(), h = 1; h < A; h++)
  63309. (f[h] = f[h - 1].clone()),
  63310. (g[h] = g[h - 1].clone()),
  63311. m.crossVectors(p[h - 1], p[h]),
  63312. m.length() > Number.EPSILON &&
  63313. (m.normalize(),
  63314. (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))),
  63315. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  63316. g[h].crossVectors(p[h], f[h])
  63317. if (i)
  63318. for (
  63319. o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  63320. o /= A - 1,
  63321. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  63322. h = 1;
  63323. h < A;
  63324. h++
  63325. )
  63326. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)), g[h].crossVectors(p[h], f[h])
  63327. }),
  63328. (n.PolyhedronGeometry = function (e, t, i, r) {
  63329. function o(e) {
  63330. var t = e.normalize().clone()
  63331. t.index = u.vertices.push(t) - 1
  63332. var i = l(e) / 2 / Math.PI + 0.5,
  63333. r = c(e) / Math.PI + 0.5
  63334. return (t.uv = new n.Vector2(i, 1 - r)), t
  63335. }
  63336. function a(e, t, i, r) {
  63337. var o = new n.Face3(
  63338. e.index,
  63339. t.index,
  63340. i.index,
  63341. [e.clone(), t.clone(), i.clone()],
  63342. void 0,
  63343. r
  63344. )
  63345. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3)
  63346. var a = l(C)
  63347. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  63348. }
  63349. function s(e, t) {
  63350. for (
  63351. var i = Math.pow(2, t),
  63352. n = o(u.vertices[e.a]),
  63353. r = o(u.vertices[e.b]),
  63354. s = o(u.vertices[e.c]),
  63355. l = [],
  63356. c = e.materialIndex,
  63357. h = 0;
  63358. h <= i;
  63359. h++
  63360. ) {
  63361. l[h] = []
  63362. for (
  63363. var d = o(n.clone().lerp(s, h / i)),
  63364. p = o(r.clone().lerp(s, h / i)),
  63365. f = i - h,
  63366. g = 0;
  63367. g <= f;
  63368. g++
  63369. )
  63370. 0 === g && h === i ? (l[h][g] = d) : (l[h][g] = o(d.clone().lerp(p, g / f)))
  63371. }
  63372. for (var h = 0; h < i; h++)
  63373. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  63374. var m = Math.floor(g / 2)
  63375. g % 2 === 0
  63376. ? a(l[h][m + 1], l[h + 1][m], l[h][m], c)
  63377. : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  63378. }
  63379. }
  63380. function l(e) {
  63381. return Math.atan2(e.z, -e.x)
  63382. }
  63383. function c(e) {
  63384. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  63385. }
  63386. function h(e, t, i) {
  63387. return (
  63388. i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)),
  63389. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)),
  63390. e.clone()
  63391. )
  63392. }
  63393. n.Geometry.call(this),
  63394. (this.type = 'PolyhedronGeometry'),
  63395. (this.parameters = {
  63396. vertices: e,
  63397. indices: t,
  63398. radius: i,
  63399. detail: r
  63400. }),
  63401. (i = i || 1),
  63402. (r = r || 0)
  63403. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  63404. o(new n.Vector3(e[d], e[d + 1], e[d + 2]))
  63405. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3, m++) {
  63406. var v = f[t[d]],
  63407. A = f[t[d + 1]],
  63408. y = f[t[d + 2]]
  63409. g[m] = new n.Face3(
  63410. v.index,
  63411. A.index,
  63412. y.index,
  63413. [v.clone(), A.clone(), y.clone()],
  63414. void 0,
  63415. m
  63416. )
  63417. }
  63418. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++) s(g[d], r)
  63419. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  63420. var I = this.faceVertexUvs[0][d],
  63421. E = I[0].x,
  63422. b = I[1].x,
  63423. w = I[2].x,
  63424. _ = Math.max(E, b, w),
  63425. T = Math.min(E, b, w)
  63426. _ > 0.9 &&
  63427. T < 0.1 &&
  63428. (E < 0.2 && (I[0].x += 1), b < 0.2 && (I[1].x += 1), w < 0.2 && (I[2].x += 1))
  63429. }
  63430. for (var d = 0, p = this.vertices.length; d < p; d++) this.vertices[d].multiplyScalar(i)
  63431. this.mergeVertices(),
  63432. this.computeFaceNormals(),
  63433. (this.boundingSphere = new n.Sphere(new n.Vector3(), i))
  63434. }),
  63435. (n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype)),
  63436. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  63437. (n.DodecahedronGeometry = function (e, t) {
  63438. var i = (1 + Math.sqrt(5)) / 2,
  63439. r = 1 / i,
  63440. o = [
  63441. -1,
  63442. -1,
  63443. -1,
  63444. -1,
  63445. -1,
  63446. 1,
  63447. -1,
  63448. 1,
  63449. -1,
  63450. -1,
  63451. 1,
  63452. 1,
  63453. 1,
  63454. -1,
  63455. -1,
  63456. 1,
  63457. -1,
  63458. 1,
  63459. 1,
  63460. 1,
  63461. -1,
  63462. 1,
  63463. 1,
  63464. 1,
  63465. 0,
  63466. -r,
  63467. -i,
  63468. 0,
  63469. -r,
  63470. i,
  63471. 0,
  63472. r,
  63473. -i,
  63474. 0,
  63475. r,
  63476. i,
  63477. -r,
  63478. -i,
  63479. 0,
  63480. -r,
  63481. i,
  63482. 0,
  63483. r,
  63484. -i,
  63485. 0,
  63486. r,
  63487. i,
  63488. 0,
  63489. -i,
  63490. 0,
  63491. -r,
  63492. i,
  63493. 0,
  63494. -r,
  63495. -i,
  63496. 0,
  63497. r,
  63498. i,
  63499. 0,
  63500. r
  63501. ],
  63502. a = [
  63503. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10,
  63504. 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,
  63505. 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4,
  63506. 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19,
  63507. 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9
  63508. ]
  63509. n.PolyhedronGeometry.call(this, o, a, e, t),
  63510. (this.type = 'DodecahedronGeometry'),
  63511. (this.parameters = {
  63512. radius: e,
  63513. detail: t
  63514. })
  63515. }),
  63516. (n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63517. (n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry),
  63518. (n.IcosahedronGeometry = function (e, t) {
  63519. var i = (1 + Math.sqrt(5)) / 2,
  63520. r = [
  63521. -1,
  63522. i,
  63523. 0,
  63524. 1,
  63525. i,
  63526. 0,
  63527. -1,
  63528. -i,
  63529. 0,
  63530. 1,
  63531. -i,
  63532. 0,
  63533. 0,
  63534. -1,
  63535. i,
  63536. 0,
  63537. 1,
  63538. i,
  63539. 0,
  63540. -1,
  63541. -i,
  63542. 0,
  63543. 1,
  63544. -i,
  63545. i,
  63546. 0,
  63547. -1,
  63548. i,
  63549. 0,
  63550. 1,
  63551. -i,
  63552. 0,
  63553. -1,
  63554. -i,
  63555. 0,
  63556. 1
  63557. ],
  63558. o = [
  63559. 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,
  63560. 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,
  63561. 10, 8, 6, 7, 9, 8, 1
  63562. ]
  63563. n.PolyhedronGeometry.call(this, r, o, e, t),
  63564. (this.type = 'IcosahedronGeometry'),
  63565. (this.parameters = {
  63566. radius: e,
  63567. detail: t
  63568. })
  63569. }),
  63570. (n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63571. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  63572. (n.OctahedronGeometry = function (e, t) {
  63573. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  63574. 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]
  63575. n.PolyhedronGeometry.call(this, i, r, e, t),
  63576. (this.type = 'OctahedronGeometry'),
  63577. (this.parameters = {
  63578. radius: e,
  63579. detail: t
  63580. })
  63581. }),
  63582. (n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63583. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  63584. (n.TetrahedronGeometry = function (e, t) {
  63585. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  63586. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1]
  63587. n.PolyhedronGeometry.call(this, i, r, e, t),
  63588. (this.type = 'TetrahedronGeometry'),
  63589. (this.parameters = {
  63590. radius: e,
  63591. detail: t
  63592. })
  63593. }),
  63594. (n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63595. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  63596. (n.ParametricGeometry = function (e, t, i) {
  63597. n.Geometry.call(this),
  63598. (this.type = 'ParametricGeometry'),
  63599. (this.parameters = {
  63600. func: e,
  63601. slices: t,
  63602. stacks: i
  63603. })
  63604. var r,
  63605. o,
  63606. a,
  63607. s,
  63608. l,
  63609. c = this.vertices,
  63610. h = this.faces,
  63611. u = this.faceVertexUvs[0],
  63612. d = t + 1
  63613. for (r = 0; r <= i; r++)
  63614. for (l = r / i, o = 0; o <= t; o++) (s = o / t), (a = e(s, l)), c.push(a)
  63615. var p, f, g, m, v, A, y, C
  63616. for (r = 0; r < i; r++)
  63617. for (o = 0; o < t; o++)
  63618. (p = r * d + o),
  63619. (f = r * d + o + 1),
  63620. (g = (r + 1) * d + o + 1),
  63621. (m = (r + 1) * d + o),
  63622. (v = new n.Vector2(o / t, r / i)),
  63623. (A = new n.Vector2((o + 1) / t, r / i)),
  63624. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  63625. (C = new n.Vector2(o / t, (r + 1) / i)),
  63626. h.push(new n.Face3(p, f, m)),
  63627. u.push([v, A, C]),
  63628. h.push(new n.Face3(f, g, m)),
  63629. u.push([A.clone(), y, C.clone()])
  63630. this.computeFaceNormals(), this.computeVertexNormals()
  63631. }),
  63632. (n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype)),
  63633. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  63634. (n.WireframeGeometry = function (e) {
  63635. function t(e, t) {
  63636. return e - t
  63637. }
  63638. n.BufferGeometry.call(this)
  63639. var i = [0, 0],
  63640. r = {},
  63641. o = ['a', 'b', 'c']
  63642. if (e instanceof n.Geometry) {
  63643. for (
  63644. var a = e.vertices,
  63645. s = e.faces,
  63646. l = 0,
  63647. c = new Uint32Array(6 * s.length),
  63648. h = 0,
  63649. u = s.length;
  63650. h < u;
  63651. h++
  63652. )
  63653. for (var d = s[h], p = 0; p < 3; p++) {
  63654. ;(i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t)
  63655. var f = i.toString()
  63656. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  63657. }
  63658. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63659. for (var p = 0; p < 2; p++) {
  63660. var m = a[c[2 * h + p]],
  63661. v = 6 * h + 3 * p
  63662. ;(g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z)
  63663. }
  63664. this.addAttribute('position', new n.BufferAttribute(g, 3))
  63665. } else if (e instanceof n.BufferGeometry)
  63666. if (null !== e.index) {
  63667. var A = e.index.array,
  63668. a = e.attributes.position,
  63669. y = e.groups,
  63670. l = 0
  63671. 0 === y.length && e.addGroup(0, A.length)
  63672. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  63673. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  63674. for (var p = 0; p < 3; p++) {
  63675. ;(i[0] = A[h + p]), (i[1] = A[h + ((p + 1) % 3)]), i.sort(t)
  63676. var f = i.toString()
  63677. void 0 === r[f] &&
  63678. ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  63679. }
  63680. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63681. for (var p = 0; p < 2; p++) {
  63682. var v = 6 * h + 3 * p,
  63683. T = c[2 * h + p]
  63684. ;(g[v + 0] = a.getX(T)), (g[v + 1] = a.getY(T)), (g[v + 2] = a.getZ(T))
  63685. }
  63686. this.addAttribute('position', new n.BufferAttribute(g, 3))
  63687. } else {
  63688. for (
  63689. var a = e.attributes.position.array,
  63690. l = a.length / 3,
  63691. x = l / 3,
  63692. g = new Float32Array(2 * l * 3),
  63693. h = 0,
  63694. u = x;
  63695. h < u;
  63696. h++
  63697. )
  63698. for (var p = 0; p < 3; p++) {
  63699. var v = 18 * h + 6 * p,
  63700. S = 9 * h + 3 * p
  63701. ;(g[v + 0] = a[S]), (g[v + 1] = a[S + 1]), (g[v + 2] = a[S + 2])
  63702. var T = 9 * h + 3 * ((p + 1) % 3)
  63703. ;(g[v + 3] = a[T]), (g[v + 4] = a[T + 1]), (g[v + 5] = a[T + 2])
  63704. }
  63705. this.addAttribute('position', new n.BufferAttribute(g, 3))
  63706. }
  63707. }),
  63708. (n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63709. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  63710. (n.AxisHelper = function (e) {
  63711. e = e || 1
  63712. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  63713. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  63714. r = new n.BufferGeometry()
  63715. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  63716. r.addAttribute('color', new n.BufferAttribute(i, 3))
  63717. var o = new n.LineBasicMaterial({
  63718. vertexColors: n.VertexColors
  63719. })
  63720. n.LineSegments.call(this, r, o)
  63721. }),
  63722. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  63723. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  63724. (n.ArrowHelper = (function () {
  63725. var e = new n.Geometry()
  63726. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0))
  63727. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1)
  63728. return (
  63729. t.translate(0, -0.5, 0),
  63730. function (i, r, o, a, s, l) {
  63731. n.Object3D.call(this),
  63732. void 0 === a && (a = 16776960),
  63733. void 0 === o && (o = 1),
  63734. void 0 === s && (s = 0.2 * o),
  63735. void 0 === l && (l = 0.2 * s),
  63736. this.position.copy(r),
  63737. (this.line = new n.Line(
  63738. e,
  63739. new n.LineBasicMaterial({
  63740. color: a
  63741. })
  63742. )),
  63743. (this.line.matrixAutoUpdate = !1),
  63744. this.add(this.line),
  63745. (this.cone = new n.Mesh(
  63746. t,
  63747. new n.MeshBasicMaterial({
  63748. color: a
  63749. })
  63750. )),
  63751. (this.cone.matrixAutoUpdate = !1),
  63752. this.add(this.cone),
  63753. this.setDirection(i),
  63754. this.setLength(o, s, l)
  63755. }
  63756. )
  63757. })()),
  63758. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  63759. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  63760. (n.ArrowHelper.prototype.setDirection = (function () {
  63761. var e,
  63762. t = new n.Vector3()
  63763. return function (i) {
  63764. i.y > 0.99999
  63765. ? this.quaternion.set(0, 0, 0, 1)
  63766. : i.y < -0.99999
  63767. ? this.quaternion.set(1, 0, 0, 0)
  63768. : (t.set(i.z, 0, -i.x).normalize(),
  63769. (e = Math.acos(i.y)),
  63770. this.quaternion.setFromAxisAngle(t, e))
  63771. }
  63772. })()),
  63773. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  63774. void 0 === t && (t = 0.2 * e),
  63775. void 0 === i && (i = 0.2 * t),
  63776. this.line.scale.set(1, Math.max(0, e - t), 1),
  63777. this.line.updateMatrix(),
  63778. this.cone.scale.set(i, t, i),
  63779. (this.cone.position.y = e),
  63780. this.cone.updateMatrix()
  63781. }),
  63782. (n.ArrowHelper.prototype.setColor = function (e) {
  63783. this.line.material.color.set(e), this.cone.material.color.set(e)
  63784. }),
  63785. (n.BoxHelper = function (e) {
  63786. var t = new Uint16Array([
  63787. 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7
  63788. ]),
  63789. i = new Float32Array(24),
  63790. r = new n.BufferGeometry()
  63791. r.setIndex(new n.BufferAttribute(t, 1)),
  63792. r.addAttribute('position', new n.BufferAttribute(i, 3)),
  63793. n.LineSegments.call(
  63794. this,
  63795. r,
  63796. new n.LineBasicMaterial({
  63797. color: 16776960
  63798. })
  63799. ),
  63800. void 0 !== e && this.update(e)
  63801. }),
  63802. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  63803. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  63804. (n.BoxHelper.prototype.update = (function () {
  63805. var e = new n.Box3()
  63806. return function (t) {
  63807. if ((e.setFromObject(t), !e.isEmpty())) {
  63808. var i = e.min,
  63809. n = e.max,
  63810. r = this.geometry.attributes.position,
  63811. o = r.array
  63812. ;(o[0] = n.x),
  63813. (o[1] = n.y),
  63814. (o[2] = n.z),
  63815. (o[3] = i.x),
  63816. (o[4] = n.y),
  63817. (o[5] = n.z),
  63818. (o[6] = i.x),
  63819. (o[7] = i.y),
  63820. (o[8] = n.z),
  63821. (o[9] = n.x),
  63822. (o[10] = i.y),
  63823. (o[11] = n.z),
  63824. (o[12] = n.x),
  63825. (o[13] = n.y),
  63826. (o[14] = i.z),
  63827. (o[15] = i.x),
  63828. (o[16] = n.y),
  63829. (o[17] = i.z),
  63830. (o[18] = i.x),
  63831. (o[19] = i.y),
  63832. (o[20] = i.z),
  63833. (o[21] = n.x),
  63834. (o[22] = i.y),
  63835. (o[23] = i.z),
  63836. (r.needsUpdate = !0),
  63837. this.geometry.computeBoundingSphere()
  63838. }
  63839. }
  63840. })()),
  63841. (n.BoundingBoxHelper = function (e, t) {
  63842. var i = void 0 !== t ? t : 8947848
  63843. ;(this.object = e),
  63844. (this.box = new n.Box3()),
  63845. n.Mesh.call(
  63846. this,
  63847. new n.BoxGeometry(1, 1, 1),
  63848. new n.MeshBasicMaterial({
  63849. color: i,
  63850. wireframe: !0
  63851. })
  63852. )
  63853. }),
  63854. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  63855. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  63856. (n.BoundingBoxHelper.prototype.update = function () {
  63857. this.box.setFromObject(this.object),
  63858. this.box.size(this.scale),
  63859. this.box.center(this.position)
  63860. }),
  63861. (n.CameraHelper = function (e) {
  63862. function t(e, t, n) {
  63863. i(e, n), i(t, n)
  63864. }
  63865. function i(e, t) {
  63866. r.vertices.push(new n.Vector3()),
  63867. r.colors.push(new n.Color(t)),
  63868. void 0 === a[e] && (a[e] = []),
  63869. a[e].push(r.vertices.length - 1)
  63870. }
  63871. var r = new n.Geometry(),
  63872. o = new n.LineBasicMaterial({
  63873. color: 16777215,
  63874. vertexColors: n.FaceColors
  63875. }),
  63876. a = {},
  63877. s = 16755200,
  63878. l = 16711680,
  63879. c = 43775,
  63880. h = 16777215,
  63881. u = 3355443
  63882. t('n1', 'n2', s),
  63883. t('n2', 'n4', s),
  63884. t('n4', 'n3', s),
  63885. t('n3', 'n1', s),
  63886. t('f1', 'f2', s),
  63887. t('f2', 'f4', s),
  63888. t('f4', 'f3', s),
  63889. t('f3', 'f1', s),
  63890. t('n1', 'f1', s),
  63891. t('n2', 'f2', s),
  63892. t('n3', 'f3', s),
  63893. t('n4', 'f4', s),
  63894. t('p', 'n1', l),
  63895. t('p', 'n2', l),
  63896. t('p', 'n3', l),
  63897. t('p', 'n4', l),
  63898. t('u1', 'u2', c),
  63899. t('u2', 'u3', c),
  63900. t('u3', 'u1', c),
  63901. t('c', 't', h),
  63902. t('p', 'c', u),
  63903. t('cn1', 'cn2', u),
  63904. t('cn3', 'cn4', u),
  63905. t('cf1', 'cf2', u),
  63906. t('cf3', 'cf4', u),
  63907. n.LineSegments.call(this, r, o),
  63908. (this.camera = e),
  63909. this.camera.updateProjectionMatrix(),
  63910. (this.matrix = e.matrixWorld),
  63911. (this.matrixAutoUpdate = !1),
  63912. (this.pointMap = a),
  63913. this.update()
  63914. }),
  63915. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  63916. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  63917. (n.CameraHelper.prototype.update = (function () {
  63918. function e(e, n, a, s) {
  63919. r.set(n, a, s).unproject(o)
  63920. var l = i[e]
  63921. if (void 0 !== l) for (var c = 0, h = l.length; c < h; c++) t.vertices[l[c]].copy(r)
  63922. }
  63923. var t,
  63924. i,
  63925. r = new n.Vector3(),
  63926. o = new n.Camera()
  63927. return function () {
  63928. ;(t = this.geometry), (i = this.pointMap)
  63929. var n = 1,
  63930. r = 1
  63931. o.projectionMatrix.copy(this.camera.projectionMatrix),
  63932. e('c', 0, 0, -1),
  63933. e('t', 0, 0, 1),
  63934. e('n1', -n, -r, -1),
  63935. e('n2', n, -r, -1),
  63936. e('n3', -n, r, -1),
  63937. e('n4', n, r, -1),
  63938. e('f1', -n, -r, 1),
  63939. e('f2', n, -r, 1),
  63940. e('f3', -n, r, 1),
  63941. e('f4', n, r, 1),
  63942. e('u1', 0.7 * n, 1.1 * r, -1),
  63943. e('u2', 0.7 * -n, 1.1 * r, -1),
  63944. e('u3', 0, 2 * r, -1),
  63945. e('cf1', -n, 0, 1),
  63946. e('cf2', n, 0, 1),
  63947. e('cf3', 0, -r, 1),
  63948. e('cf4', 0, r, 1),
  63949. e('cn1', -n, 0, -1),
  63950. e('cn2', n, 0, -1),
  63951. e('cn3', 0, -r, -1),
  63952. e('cn4', 0, r, -1),
  63953. (t.verticesNeedUpdate = !0)
  63954. }
  63955. })()),
  63956. (n.DirectionalLightHelper = function (e, t) {
  63957. n.Object3D.call(this),
  63958. (this.light = e),
  63959. this.light.updateMatrixWorld(),
  63960. (this.matrix = e.matrixWorld),
  63961. (this.matrixAutoUpdate = !1),
  63962. (t = t || 1)
  63963. var i = new n.Geometry()
  63964. i.vertices.push(
  63965. new n.Vector3(-t, t, 0),
  63966. new n.Vector3(t, t, 0),
  63967. new n.Vector3(t, -t, 0),
  63968. new n.Vector3(-t, -t, 0),
  63969. new n.Vector3(-t, t, 0)
  63970. )
  63971. var r = new n.LineBasicMaterial({
  63972. fog: !1
  63973. })
  63974. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63975. (this.lightPlane = new n.Line(i, r)),
  63976. this.add(this.lightPlane),
  63977. (i = new n.Geometry()),
  63978. i.vertices.push(new n.Vector3(), new n.Vector3()),
  63979. (r = new n.LineBasicMaterial({
  63980. fog: !1
  63981. })),
  63982. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63983. (this.targetLine = new n.Line(i, r)),
  63984. this.add(this.targetLine),
  63985. this.update()
  63986. }),
  63987. (n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype)),
  63988. (n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper),
  63989. (n.DirectionalLightHelper.prototype.dispose = function () {
  63990. this.lightPlane.geometry.dispose(),
  63991. this.lightPlane.material.dispose(),
  63992. this.targetLine.geometry.dispose(),
  63993. this.targetLine.material.dispose()
  63994. }),
  63995. (n.DirectionalLightHelper.prototype.update = (function () {
  63996. var e = new n.Vector3(),
  63997. t = new n.Vector3(),
  63998. i = new n.Vector3()
  63999. return function () {
  64000. e.setFromMatrixPosition(this.light.matrixWorld),
  64001. t.setFromMatrixPosition(this.light.target.matrixWorld),
  64002. i.subVectors(t, e),
  64003. this.lightPlane.lookAt(i),
  64004. this.lightPlane.material.color
  64005. .copy(this.light.color)
  64006. .multiplyScalar(this.light.intensity),
  64007. this.targetLine.geometry.vertices[1].copy(i),
  64008. (this.targetLine.geometry.verticesNeedUpdate = !0),
  64009. this.targetLine.material.color.copy(this.lightPlane.material.color)
  64010. }
  64011. })()),
  64012. (n.EdgesHelper = function (e, t, i) {
  64013. var r = void 0 !== t ? t : 16777215
  64014. n.LineSegments.call(
  64015. this,
  64016. new n.EdgesGeometry(e.geometry, i),
  64017. new n.LineBasicMaterial({
  64018. color: r
  64019. })
  64020. ),
  64021. (this.matrix = e.matrixWorld),
  64022. (this.matrixAutoUpdate = !1)
  64023. }),
  64024. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  64025. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  64026. (n.FaceNormalsHelper = function (e, t, i, r) {
  64027. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  64028. var o = void 0 !== i ? i : 16776960,
  64029. a = void 0 !== r ? r : 1,
  64030. s = 0,
  64031. l = this.object.geometry
  64032. l instanceof n.Geometry
  64033. ? (s = l.faces.length)
  64034. : console.warn(
  64035. 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.'
  64036. )
  64037. var c = new n.BufferGeometry(),
  64038. h = new n.Float32Attribute(2 * s * 3, 3)
  64039. c.addAttribute('position', h),
  64040. n.LineSegments.call(
  64041. this,
  64042. c,
  64043. new n.LineBasicMaterial({
  64044. color: o,
  64045. linewidth: a
  64046. })
  64047. ),
  64048. (this.matrixAutoUpdate = !1),
  64049. this.update()
  64050. }),
  64051. (n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  64052. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  64053. (n.FaceNormalsHelper.prototype.update = (function () {
  64054. var e = new n.Vector3(),
  64055. t = new n.Vector3(),
  64056. i = new n.Matrix3()
  64057. return function () {
  64058. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  64059. for (
  64060. var n = this.object.matrixWorld,
  64061. r = this.geometry.attributes.position,
  64062. o = this.object.geometry,
  64063. a = o.vertices,
  64064. s = o.faces,
  64065. l = 0,
  64066. c = 0,
  64067. h = s.length;
  64068. c < h;
  64069. c++
  64070. ) {
  64071. var u = s[c],
  64072. d = u.normal
  64073. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  64074. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64075. r.setXYZ(l, e.x, e.y, e.z),
  64076. (l += 1),
  64077. r.setXYZ(l, t.x, t.y, t.z),
  64078. (l += 1)
  64079. }
  64080. return (r.needsUpdate = !0), this
  64081. }
  64082. })()),
  64083. (n.GridHelper = function (e, t) {
  64084. var i = new n.Geometry(),
  64085. r = new n.LineBasicMaterial({
  64086. vertexColors: n.VertexColors
  64087. })
  64088. ;(this.color1 = new n.Color(4473924)), (this.color2 = new n.Color(8947848))
  64089. for (var o = -e; o <= e; o += t) {
  64090. i.vertices.push(
  64091. new n.Vector3(-e, 0, o),
  64092. new n.Vector3(e, 0, o),
  64093. new n.Vector3(o, 0, -e),
  64094. new n.Vector3(o, 0, e)
  64095. )
  64096. var a = 0 === o ? this.color1 : this.color2
  64097. i.colors.push(a, a, a, a)
  64098. }
  64099. n.LineSegments.call(this, i, r)
  64100. }),
  64101. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  64102. (n.GridHelper.prototype.constructor = n.GridHelper),
  64103. (n.GridHelper.prototype.setColors = function (e, t) {
  64104. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0)
  64105. }),
  64106. (n.HemisphereLightHelper = function (e, t) {
  64107. n.Object3D.call(this),
  64108. (this.light = e),
  64109. this.light.updateMatrixWorld(),
  64110. (this.matrix = e.matrixWorld),
  64111. (this.matrixAutoUpdate = !1),
  64112. (this.colors = [new n.Color(), new n.Color()])
  64113. var i = new n.SphereGeometry(t, 4, 2)
  64114. i.rotateX(-Math.PI / 2)
  64115. for (var r = 0, o = 8; r < o; r++) i.faces[r].color = this.colors[r < 4 ? 0 : 1]
  64116. var a = new n.MeshBasicMaterial({
  64117. vertexColors: n.FaceColors,
  64118. wireframe: !0
  64119. })
  64120. ;(this.lightSphere = new n.Mesh(i, a)), this.add(this.lightSphere), this.update()
  64121. }),
  64122. (n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64123. (n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper),
  64124. (n.HemisphereLightHelper.prototype.dispose = function () {
  64125. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose()
  64126. }),
  64127. (n.HemisphereLightHelper.prototype.update = (function () {
  64128. var e = new n.Vector3()
  64129. return function () {
  64130. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  64131. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  64132. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  64133. (this.lightSphere.geometry.colorsNeedUpdate = !0)
  64134. }
  64135. })()),
  64136. (n.PointLightHelper = function (e, t) {
  64137. ;(this.light = e), this.light.updateMatrixWorld()
  64138. var i = new n.SphereGeometry(t, 4, 2),
  64139. r = new n.MeshBasicMaterial({
  64140. wireframe: !0,
  64141. fog: !1
  64142. })
  64143. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  64144. n.Mesh.call(this, i, r),
  64145. (this.matrix = this.light.matrixWorld),
  64146. (this.matrixAutoUpdate = !1)
  64147. }),
  64148. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  64149. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  64150. (n.PointLightHelper.prototype.dispose = function () {
  64151. this.geometry.dispose(), this.material.dispose()
  64152. }),
  64153. (n.PointLightHelper.prototype.update = function () {
  64154. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  64155. }),
  64156. (n.SkeletonHelper = function (e) {
  64157. this.bones = this.getBoneList(e)
  64158. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  64159. var r = this.bones[i]
  64160. r.parent instanceof n.Bone &&
  64161. (t.vertices.push(new n.Vector3()),
  64162. t.vertices.push(new n.Vector3()),
  64163. t.colors.push(new n.Color(0, 0, 1)),
  64164. t.colors.push(new n.Color(0, 1, 0)))
  64165. }
  64166. t.dynamic = !0
  64167. var o = new n.LineBasicMaterial({
  64168. vertexColors: n.VertexColors,
  64169. depthTest: !1,
  64170. depthWrite: !1,
  64171. transparent: !0
  64172. })
  64173. n.LineSegments.call(this, t, o),
  64174. (this.root = e),
  64175. (this.matrix = e.matrixWorld),
  64176. (this.matrixAutoUpdate = !1),
  64177. this.update()
  64178. }),
  64179. (n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype)),
  64180. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  64181. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  64182. var t = []
  64183. e instanceof n.Bone && t.push(e)
  64184. for (var i = 0; i < e.children.length; i++)
  64185. t.push.apply(t, this.getBoneList(e.children[i]))
  64186. return t
  64187. }),
  64188. (n.SkeletonHelper.prototype.update = function () {
  64189. for (
  64190. var e = this.geometry,
  64191. t = new n.Matrix4().getInverse(this.root.matrixWorld),
  64192. i = new n.Matrix4(),
  64193. r = 0,
  64194. o = 0;
  64195. o < this.bones.length;
  64196. o++
  64197. ) {
  64198. var a = this.bones[o]
  64199. a.parent instanceof n.Bone &&
  64200. (i.multiplyMatrices(t, a.matrixWorld),
  64201. e.vertices[r].setFromMatrixPosition(i),
  64202. i.multiplyMatrices(t, a.parent.matrixWorld),
  64203. e.vertices[r + 1].setFromMatrixPosition(i),
  64204. (r += 2))
  64205. }
  64206. ;(e.verticesNeedUpdate = !0), e.computeBoundingSphere()
  64207. }),
  64208. (n.SpotLightHelper = function (e) {
  64209. n.Object3D.call(this),
  64210. (this.light = e),
  64211. this.light.updateMatrixWorld(),
  64212. (this.matrix = e.matrixWorld),
  64213. (this.matrixAutoUpdate = !1)
  64214. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0)
  64215. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2)
  64216. var i = new n.MeshBasicMaterial({
  64217. wireframe: !0,
  64218. fog: !1
  64219. })
  64220. ;(this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update()
  64221. }),
  64222. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64223. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  64224. (n.SpotLightHelper.prototype.dispose = function () {
  64225. this.cone.geometry.dispose(), this.cone.material.dispose()
  64226. }),
  64227. (n.SpotLightHelper.prototype.update = (function () {
  64228. var e = new n.Vector3(),
  64229. t = new n.Vector3()
  64230. return function () {
  64231. var i = this.light.distance ? this.light.distance : 1e4,
  64232. n = i * Math.tan(this.light.angle)
  64233. this.cone.scale.set(n, n, i),
  64234. e.setFromMatrixPosition(this.light.matrixWorld),
  64235. t.setFromMatrixPosition(this.light.target.matrixWorld),
  64236. this.cone.lookAt(t.sub(e)),
  64237. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  64238. }
  64239. })()),
  64240. (n.VertexNormalsHelper = function (e, t, i, r) {
  64241. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  64242. var o = void 0 !== i ? i : 16711680,
  64243. a = void 0 !== r ? r : 1,
  64244. s = 0,
  64245. l = this.object.geometry
  64246. l instanceof n.Geometry
  64247. ? (s = 3 * l.faces.length)
  64248. : l instanceof n.BufferGeometry && (s = l.attributes.normal.count)
  64249. var c = new n.BufferGeometry(),
  64250. h = new n.Float32Attribute(2 * s * 3, 3)
  64251. c.addAttribute('position', h),
  64252. n.LineSegments.call(
  64253. this,
  64254. c,
  64255. new n.LineBasicMaterial({
  64256. color: o,
  64257. linewidth: a
  64258. })
  64259. ),
  64260. (this.matrixAutoUpdate = !1),
  64261. this.update()
  64262. }),
  64263. (n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  64264. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  64265. (n.VertexNormalsHelper.prototype.update = (function () {
  64266. var e = new n.Vector3(),
  64267. t = new n.Vector3(),
  64268. i = new n.Matrix3()
  64269. return function () {
  64270. var r = ['a', 'b', 'c']
  64271. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  64272. var o = this.object.matrixWorld,
  64273. a = this.geometry.attributes.position,
  64274. s = this.object.geometry
  64275. if (s instanceof n.Geometry)
  64276. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  64277. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  64278. var m = l[p[r[f]]],
  64279. v = p.vertexNormals[f]
  64280. e.copy(m).applyMatrix4(o),
  64281. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64282. a.setXYZ(h, e.x, e.y, e.z),
  64283. (h += 1),
  64284. a.setXYZ(h, t.x, t.y, t.z),
  64285. (h += 1)
  64286. }
  64287. else if (s instanceof n.BufferGeometry)
  64288. for (
  64289. var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count;
  64290. f < g;
  64291. f++
  64292. )
  64293. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  64294. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  64295. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64296. a.setXYZ(h, e.x, e.y, e.z),
  64297. (h += 1),
  64298. a.setXYZ(h, t.x, t.y, t.z),
  64299. (h += 1)
  64300. return (a.needsUpdate = !0), this
  64301. }
  64302. })()),
  64303. (n.WireframeHelper = function (e, t) {
  64304. var i = void 0 !== t ? t : 16777215
  64305. n.LineSegments.call(
  64306. this,
  64307. new n.WireframeGeometry(e.geometry),
  64308. new n.LineBasicMaterial({
  64309. color: i
  64310. })
  64311. ),
  64312. (this.matrix = e.matrixWorld),
  64313. (this.matrixAutoUpdate = !1)
  64314. }),
  64315. (n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype)),
  64316. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  64317. (n.ImmediateRenderObject = function (e) {
  64318. n.Object3D.call(this), (this.material = e), (this.render = function (e) {})
  64319. }),
  64320. (n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype)),
  64321. (n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject),
  64322. (n.MorphBlendMesh = function (e, t) {
  64323. n.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = [])
  64324. var i = this.geometry.morphTargets.length,
  64325. r = '__default',
  64326. o = 0,
  64327. a = i - 1,
  64328. s = i / 1
  64329. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1)
  64330. }),
  64331. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  64332. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  64333. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  64334. var r = {
  64335. start: t,
  64336. end: i,
  64337. length: i - t + 1,
  64338. fps: n,
  64339. duration: (i - t) / n,
  64340. lastFrame: 0,
  64341. currentFrame: 0,
  64342. active: !1,
  64343. time: 0,
  64344. direction: 1,
  64345. weight: 1,
  64346. directionBackwards: !1,
  64347. mirroredLoop: !1
  64348. }
  64349. ;(this.animationsMap[e] = r), this.animationsList.push(r)
  64350. }),
  64351. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  64352. for (
  64353. var t,
  64354. i = /([a-z]+)_?(\d+)/i,
  64355. n = {},
  64356. r = this.geometry,
  64357. o = 0,
  64358. a = r.morphTargets.length;
  64359. o < a;
  64360. o++
  64361. ) {
  64362. var s = r.morphTargets[o],
  64363. l = s.name.match(i)
  64364. if (l && l.length > 1) {
  64365. var c = l[1]
  64366. n[c] ||
  64367. (n[c] = {
  64368. start: 1 / 0,
  64369. end: -(1 / 0)
  64370. })
  64371. var h = n[c]
  64372. o < h.start && (h.start = o), o > h.end && (h.end = o), t || (t = c)
  64373. }
  64374. }
  64375. for (var c in n) {
  64376. var h = n[c]
  64377. this.createAnimation(c, h.start, h.end, e)
  64378. }
  64379. this.firstAnimation = t
  64380. }),
  64381. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  64382. var t = this.animationsMap[e]
  64383. t && ((t.direction = 1), (t.directionBackwards = !1))
  64384. }),
  64385. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  64386. var t = this.animationsMap[e]
  64387. t && ((t.direction = -1), (t.directionBackwards = !0))
  64388. }),
  64389. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  64390. var i = this.animationsMap[e]
  64391. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps))
  64392. }),
  64393. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  64394. var i = this.animationsMap[e]
  64395. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration))
  64396. }),
  64397. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  64398. var i = this.animationsMap[e]
  64399. i && (i.weight = t)
  64400. }),
  64401. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  64402. var i = this.animationsMap[e]
  64403. i && (i.time = t)
  64404. }),
  64405. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  64406. var t = 0,
  64407. i = this.animationsMap[e]
  64408. return i && (t = i.time), t
  64409. }),
  64410. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  64411. var t = -1,
  64412. i = this.animationsMap[e]
  64413. return i && (t = i.duration), t
  64414. }),
  64415. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  64416. var t = this.animationsMap[e]
  64417. t
  64418. ? ((t.time = 0), (t.active = !0))
  64419. : console.warn(
  64420. 'THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()'
  64421. )
  64422. }),
  64423. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  64424. var t = this.animationsMap[e]
  64425. t && (t.active = !1)
  64426. }),
  64427. (n.MorphBlendMesh.prototype.update = function (e) {
  64428. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  64429. var r = this.animationsList[t]
  64430. if (r.active) {
  64431. var o = r.duration / r.length
  64432. ;(r.time += r.direction * e),
  64433. r.mirroredLoop
  64434. ? (r.time > r.duration || r.time < 0) &&
  64435. ((r.direction *= -1),
  64436. r.time > r.duration && ((r.time = r.duration), (r.directionBackwards = !0)),
  64437. r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  64438. : ((r.time = r.time % r.duration), r.time < 0 && (r.time += r.duration))
  64439. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  64440. s = r.weight
  64441. a !== r.currentFrame &&
  64442. ((this.morphTargetInfluences[r.lastFrame] = 0),
  64443. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  64444. (this.morphTargetInfluences[a] = 0),
  64445. (r.lastFrame = r.currentFrame),
  64446. (r.currentFrame = a))
  64447. var l = (r.time % o) / o
  64448. r.directionBackwards && (l = 1 - l),
  64449. r.currentFrame !== r.lastFrame
  64450. ? ((this.morphTargetInfluences[r.currentFrame] = l * s),
  64451. (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  64452. : (this.morphTargetInfluences[r.currentFrame] = s)
  64453. }
  64454. }
  64455. }),
  64456. 'undefined' != typeof i
  64457. ? ('undefined' != typeof t && t.exports && (i = t.exports = n), (i.THREE = n))
  64458. : (this.THREE = n)
  64459. window.THREE = n
  64460. getObjLoader()
  64461. initByTHREE(THREE)
  64462. //getWebXRManager()
  64463. },
  64464. {}
  64465. ]
  64466. },
  64467. {},
  64468. [116]
  64469. )
  64470. /*
  64471. function getWebXRManager(){
  64472. class ArrayCamera extends THREE.PerspectiveCamera {
  64473. constructor(array = []) {
  64474. super();
  64475. this.isArrayCamera = true;
  64476. this.cameras = array;
  64477. }
  64478. }
  64479. function WebGLAnimation() {
  64480. let context = null;
  64481. let isAnimating = false;
  64482. let animationLoop = null;
  64483. let requestId = null;
  64484. function onAnimationFrame(time, frame) {
  64485. animationLoop(time, frame);
  64486. requestId = context.requestAnimationFrame(onAnimationFrame);
  64487. }
  64488. return {
  64489. start: function () {
  64490. if (isAnimating === true) return;
  64491. if (animationLoop === null) return;
  64492. requestId = context.requestAnimationFrame(onAnimationFrame);
  64493. isAnimating = true;
  64494. },
  64495. stop: function () {
  64496. context.cancelAnimationFrame(requestId);
  64497. isAnimating = false;
  64498. },
  64499. setAnimationLoop: function (callback) {
  64500. animationLoop = callback;
  64501. },
  64502. setContext: function (value) {
  64503. context = value;
  64504. }
  64505. };
  64506. }
  64507. function WebXRManager( renderer, gl ) {
  64508. var scope = this;
  64509. var session = null;
  64510. // var framebufferScaleFactor = 1.0;
  64511. var referenceSpace = null;
  64512. var referenceSpaceType = 'local-floor';
  64513. var pose = null;
  64514. var controllers = [];
  64515. var sortedInputSources = [];
  64516. function isPresenting() {
  64517. return session !== null && referenceSpace !== null;
  64518. }
  64519. //
  64520. var cameraL = new THREE.PerspectiveCamera();
  64521. cameraL.layers.enable( 1 );
  64522. cameraL.viewport = new THREE.Vector4();
  64523. var cameraR = new THREE.PerspectiveCamera();
  64524. cameraR.layers.enable( 2 );
  64525. cameraR.viewport = new THREE.Vector4();
  64526. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  64527. cameraVR.layers.enable( 1 );
  64528. cameraVR.layers.enable( 2 );
  64529. //
  64530. this.enabled = false;
  64531. this.getController = function ( id ) {
  64532. var controller = controllers[ id ];
  64533. if ( controller === undefined ) {
  64534. controller = new THREE.Group();
  64535. controller.matrixAutoUpdate = false;
  64536. controller.visible = false;
  64537. controllers[ id ] = controller;
  64538. }
  64539. return controller;
  64540. };
  64541. //
  64542. function onSessionEvent( event ) {
  64543. for ( var i = 0; i < controllers.length; i ++ ) {
  64544. if ( sortedInputSources[ i ] === event.inputSource ) {
  64545. controllers[ i ].dispatchEvent( { type: event.type } );
  64546. }
  64547. }
  64548. }
  64549. function onSessionEnd() {
  64550. renderer.setFramebuffer( null );
  64551. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  64552. animation.stop();
  64553. scope.dispatchEvent( { type: 'sessionend' } );
  64554. }
  64555. function onRequestReferenceSpace( value ) {
  64556. referenceSpace = value;
  64557. animation.setContext( session );
  64558. animation.start();
  64559. scope.dispatchEvent( { type: 'sessionstart' } );
  64560. }
  64561. this.setFramebufferScaleFactor = function ( ) {
  64562. // framebufferScaleFactor = value;
  64563. };
  64564. this.setReferenceSpaceType = function ( value ) {
  64565. referenceSpaceType = value;
  64566. };
  64567. this.getSession = function () {
  64568. return session;
  64569. };
  64570. this.setSession = function ( value ) {
  64571. session = value;
  64572. if ( session !== null ) {
  64573. session.addEventListener( 'select', onSessionEvent );
  64574. session.addEventListener( 'selectstart', onSessionEvent );
  64575. session.addEventListener( 'selectend', onSessionEvent );
  64576. session.addEventListener( 'end', onSessionEnd );
  64577. // eslint-disable-next-line no-undef
  64578. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  64579. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  64580. //
  64581. session.addEventListener( 'inputsourceschange', updateInputSources );
  64582. updateInputSources();
  64583. }
  64584. };
  64585. function updateInputSources() {
  64586. for ( var i = 0; i < controllers.length; i ++ ) {
  64587. sortedInputSources[ i ] = findInputSource( i );
  64588. }
  64589. }
  64590. function findInputSource( id ) {
  64591. var inputSources = session.inputSources;
  64592. for ( var i = 0; i < inputSources.length; i ++ ) {
  64593. var inputSource = inputSources[ i ];
  64594. var handedness = inputSource.handedness;
  64595. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  64596. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  64597. }
  64598. }
  64599. //
  64600. function updateCamera( camera, parent ) {
  64601. if ( parent === null ) {
  64602. camera.matrixWorld.copy( camera.matrix );
  64603. } else {
  64604. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  64605. }
  64606. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  64607. }
  64608. this.getCamera = function ( camera ) {
  64609. if ( isPresenting() ) {
  64610. var parent = camera.parent;
  64611. var cameras = cameraVR.cameras;
  64612. updateCamera( cameraVR, parent );
  64613. for ( var i = 0; i < cameras.length; i ++ ) {
  64614. updateCamera( cameras[ i ], parent );
  64615. }
  64616. // update camera and its children
  64617. camera.matrixWorld.copy( cameraVR.matrixWorld );
  64618. var children = camera.children;
  64619. for ( var i = 0, l = children.length; i < l; i ++ ) {
  64620. children[ i ].updateMatrixWorld( true );
  64621. }
  64622. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  64623. return cameraVR;
  64624. }
  64625. return camera;
  64626. };
  64627. this.isPresenting = isPresenting;
  64628. // Animation Loop
  64629. var onAnimationFrameCallback = null;
  64630. function onAnimationFrame( time, frame ) {
  64631. pose = frame.getViewerPose( referenceSpace );
  64632. if ( pose !== null ) {
  64633. var views = pose.views;
  64634. var baseLayer = session.renderState.baseLayer;
  64635. renderer.setFramebuffer( baseLayer.framebuffer );
  64636. for ( var i = 0; i < views.length; i ++ ) {
  64637. var view = views[ i ];
  64638. var viewport = baseLayer.getViewport( view );
  64639. var viewMatrix = view.transform.inverse.matrix;
  64640. var camera = cameraVR.cameras[ i ];
  64641. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  64642. camera.projectionMatrix.fromArray( view.projectionMatrix );
  64643. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  64644. if ( i === 0 ) {
  64645. cameraVR.matrix.copy( camera.matrix );
  64646. }
  64647. }
  64648. }
  64649. //
  64650. for ( var i = 0; i < controllers.length; i ++ ) {
  64651. var controller = controllers[ i ];
  64652. var inputSource = sortedInputSources[ i ];
  64653. if ( inputSource ) {
  64654. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  64655. if ( inputPose !== null ) {
  64656. controller.matrix.fromArray( inputPose.transform.matrix );
  64657. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  64658. controller.visible = true;
  64659. continue;
  64660. }
  64661. }
  64662. controller.visible = false;
  64663. }
  64664. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  64665. }
  64666. var animation = new WebGLAnimation();
  64667. animation.setAnimationLoop( onAnimationFrame );
  64668. this.setAnimationLoop = function ( callback ) {
  64669. onAnimationFrameCallback = callback;
  64670. };
  64671. this.dispose = function () {};
  64672. // DEPRECATED
  64673. this.getStandingMatrix = function () {
  64674. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  64675. return new THREE.Matrix4();
  64676. };
  64677. this.getDevice = function () {
  64678. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  64679. };
  64680. this.setDevice = function () {
  64681. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  64682. };
  64683. this.setFrameOfReferenceType = function () {
  64684. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  64685. };
  64686. this.submitFrame = function () {};
  64687. }
  64688. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  64689. THREE.WebXRManager = WebXRManager
  64690. }
  64691. function getWebXRManager(){
  64692. class ArrayCamera extends THREE.PerspectiveCamera {
  64693. constructor(array = []) {
  64694. super();
  64695. this.isArrayCamera = true;
  64696. this.cameras = array;
  64697. }
  64698. }
  64699. class WebXRController {
  64700. constructor() {
  64701. this._targetRay = null;
  64702. this._grip = null;
  64703. this._hand = null;
  64704. }
  64705. getHandSpace() {
  64706. if (this._hand === null) {
  64707. this._hand = new THREE.Group();
  64708. this._hand.matrixAutoUpdate = false;
  64709. this._hand.visible = false;
  64710. this._hand.joints = {};
  64711. this._hand.inputState = {
  64712. pinching: false
  64713. };
  64714. }
  64715. return this._hand;
  64716. }
  64717. getTargetRaySpace() {
  64718. if (this._targetRay === null) {
  64719. this._targetRay = new THREE.Group();
  64720. this._targetRay.matrixAutoUpdate = false;
  64721. this._targetRay.visible = false;
  64722. this._targetRay.hasLinearVelocity = false;
  64723. this._targetRay.linearVelocity = new THREE.Vector3();
  64724. this._targetRay.hasAngularVelocity = false;
  64725. this._targetRay.angularVelocity = new THREE.Vector3();
  64726. }
  64727. return this._targetRay;
  64728. }
  64729. getGripSpace() {
  64730. if (this._grip === null) {
  64731. this._grip = new THREE.Group();
  64732. this._grip.matrixAutoUpdate = false;
  64733. this._grip.visible = false;
  64734. this._grip.hasLinearVelocity = false;
  64735. this._grip.linearVelocity = new THREE.Vector3();
  64736. this._grip.hasAngularVelocity = false;
  64737. this._grip.angularVelocity = new THREE.Vector3();
  64738. }
  64739. return this._grip;
  64740. }
  64741. dispatchEvent(event) {
  64742. if (this._targetRay !== null) {
  64743. this._targetRay.dispatchEvent(event);
  64744. }
  64745. if (this._grip !== null) {
  64746. this._grip.dispatchEvent(event);
  64747. }
  64748. if (this._hand !== null) {
  64749. this._hand.dispatchEvent(event);
  64750. }
  64751. return this;
  64752. }
  64753. disconnect(inputSource) {
  64754. this.dispatchEvent({
  64755. type: 'disconnected',
  64756. data: inputSource
  64757. });
  64758. if (this._targetRay !== null) {
  64759. this._targetRay.visible = false;
  64760. }
  64761. if (this._grip !== null) {
  64762. this._grip.visible = false;
  64763. }
  64764. if (this._hand !== null) {
  64765. this._hand.visible = false;
  64766. }
  64767. return this;
  64768. }
  64769. update(inputSource, frame, referenceSpace) {
  64770. let inputPose = null;
  64771. let gripPose = null;
  64772. let handPose = null;
  64773. const targetRay = this._targetRay;
  64774. const grip = this._grip;
  64775. const hand = this._hand;
  64776. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  64777. if (hand && inputSource.hand) {
  64778. handPose = true;
  64779. for (const inputjoint of inputSource.hand.values()) {
  64780. // Update the joints groups with the XRJoint poses
  64781. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  64782. if (hand.joints[inputjoint.jointName] === undefined) {
  64783. // The transform of this joint will be updated with the joint pose on each frame
  64784. const joint = new THREE.Group();
  64785. joint.matrixAutoUpdate = false;
  64786. joint.visible = false;
  64787. hand.joints[inputjoint.jointName] = joint; // ??
  64788. hand.add(joint);
  64789. }
  64790. const joint = hand.joints[inputjoint.jointName];
  64791. if (jointPose !== null) {
  64792. joint.matrix.fromArray(jointPose.transform.matrix);
  64793. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  64794. joint.jointRadius = jointPose.radius;
  64795. }
  64796. joint.visible = jointPose !== null;
  64797. } // Custom events
  64798. // Check pinchz
  64799. const indexTip = hand.joints['index-finger-tip'];
  64800. const thumbTip = hand.joints['thumb-tip'];
  64801. const distance = indexTip.position.distanceTo(thumbTip.position);
  64802. const distanceToPinch = 0.02;
  64803. const threshold = 0.005;
  64804. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  64805. hand.inputState.pinching = false;
  64806. this.dispatchEvent({
  64807. type: 'pinchend',
  64808. handedness: inputSource.handedness,
  64809. target: this
  64810. });
  64811. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  64812. hand.inputState.pinching = true;
  64813. this.dispatchEvent({
  64814. type: 'pinchstart',
  64815. handedness: inputSource.handedness,
  64816. target: this
  64817. });
  64818. }
  64819. } else {
  64820. if (grip !== null && inputSource.gripSpace) {
  64821. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  64822. if (gripPose !== null) {
  64823. grip.matrix.fromArray(gripPose.transform.matrix);
  64824. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  64825. if (gripPose.linearVelocity) {
  64826. grip.hasLinearVelocity = true;
  64827. grip.linearVelocity.copy(gripPose.linearVelocity);
  64828. } else {
  64829. grip.hasLinearVelocity = false;
  64830. }
  64831. if (gripPose.angularVelocity) {
  64832. grip.hasAngularVelocity = true;
  64833. grip.angularVelocity.copy(gripPose.angularVelocity);
  64834. } else {
  64835. grip.hasAngularVelocity = false;
  64836. }
  64837. }
  64838. }
  64839. }
  64840. if (targetRay !== null) {
  64841. inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
  64842. if (inputPose === null && gripPose !== null) {
  64843. inputPose = gripPose;
  64844. }
  64845. if (inputPose !== null) {
  64846. targetRay.matrix.fromArray(inputPose.transform.matrix);
  64847. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  64848. if (inputPose.linearVelocity) {
  64849. targetRay.hasLinearVelocity = true;
  64850. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  64851. } else {
  64852. targetRay.hasLinearVelocity = false;
  64853. }
  64854. if (inputPose.angularVelocity) {
  64855. targetRay.hasAngularVelocity = true;
  64856. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  64857. } else {
  64858. targetRay.hasAngularVelocity = false;
  64859. }
  64860. this.dispatchEvent(_moveEvent);
  64861. }
  64862. }
  64863. }
  64864. if (targetRay !== null) {
  64865. targetRay.visible = inputPose !== null;
  64866. }
  64867. if (grip !== null) {
  64868. grip.visible = gripPose !== null;
  64869. }
  64870. if (hand !== null) {
  64871. hand.visible = handPose !== null;
  64872. }
  64873. return this;
  64874. }
  64875. }
  64876. function WebGLAnimation() {
  64877. let context = null;
  64878. let isAnimating = false;
  64879. let animationLoop = null;
  64880. let requestId = null;
  64881. function onAnimationFrame(time, frame) {
  64882. animationLoop(time, frame);
  64883. requestId = context.requestAnimationFrame(onAnimationFrame);
  64884. }
  64885. return {
  64886. start: function () {
  64887. if (isAnimating === true) return;
  64888. if (animationLoop === null) return;
  64889. requestId = context.requestAnimationFrame(onAnimationFrame);
  64890. isAnimating = true;
  64891. },
  64892. stop: function () {
  64893. context.cancelAnimationFrame(requestId);
  64894. isAnimating = false;
  64895. },
  64896. setAnimationLoop: function (callback) {
  64897. animationLoop = callback;
  64898. },
  64899. setContext: function (value) {
  64900. context = value;
  64901. }
  64902. };
  64903. }
  64904. class WebXRManager extends THREE.EventDispatcher {
  64905. constructor(renderer, gl) {
  64906. super();
  64907. const scope = this;
  64908. let session = null;
  64909. let framebufferScaleFactor = 1.0;
  64910. let referenceSpace = null;
  64911. let referenceSpaceType = 'local-floor';
  64912. let customReferenceSpace = null;
  64913. let pose = null;
  64914. let glBinding = null;
  64915. let glProjLayer = null;
  64916. let glBaseLayer = null;
  64917. let xrFrame = null;
  64918. const attributes = gl.getContextAttributes();
  64919. let initialRenderTarget = null;
  64920. let newRenderTarget = null;
  64921. const controllers = [];
  64922. const controllerInputSources = []; //
  64923. const cameraL = new THREE.PerspectiveCamera();
  64924. cameraL.layers.enable(1);
  64925. cameraL.viewport = new THREE.Vector4();
  64926. const cameraR = new THREE.PerspectiveCamera();
  64927. cameraR.layers.enable(2);
  64928. cameraR.viewport = new THREE.Vector4();
  64929. const cameras = [cameraL, cameraR];
  64930. const cameraVR = new ArrayCamera();
  64931. cameraVR.layers.enable(1);
  64932. cameraVR.layers.enable(2);
  64933. let _currentDepthNear = null;
  64934. let _currentDepthFar = null; //
  64935. this.cameraAutoUpdate = true;
  64936. this.enabled = false;
  64937. this.isPresenting = false;
  64938. this.getController = function (index) {
  64939. let controller = controllers[index];
  64940. if (controller === undefined) {
  64941. controller = new WebXRController();
  64942. controllers[index] = controller;
  64943. }
  64944. return controller.getTargetRaySpace();
  64945. };
  64946. this.getControllerGrip = function (index) {
  64947. let controller = controllers[index];
  64948. if (controller === undefined) {
  64949. controller = new WebXRController();
  64950. controllers[index] = controller;
  64951. }
  64952. return controller.getGripSpace();
  64953. };
  64954. this.getHand = function (index) {
  64955. let controller = controllers[index];
  64956. if (controller === undefined) {
  64957. controller = new WebXRController();
  64958. controllers[index] = controller;
  64959. }
  64960. return controller.getHandSpace();
  64961. }; //
  64962. function onSessionEvent(event) {
  64963. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  64964. if (controllerIndex === -1) {
  64965. return;
  64966. }
  64967. const controller = controllers[controllerIndex];
  64968. if (controller !== undefined) {
  64969. controller.dispatchEvent({
  64970. type: event.type,
  64971. data: event.inputSource
  64972. });
  64973. }
  64974. }
  64975. function onSessionEnd() {
  64976. session.removeEventListener('select', onSessionEvent);
  64977. session.removeEventListener('selectstart', onSessionEvent);
  64978. session.removeEventListener('selectend', onSessionEvent);
  64979. session.removeEventListener('squeeze', onSessionEvent);
  64980. session.removeEventListener('squeezestart', onSessionEvent);
  64981. session.removeEventListener('squeezeend', onSessionEvent);
  64982. session.removeEventListener('end', onSessionEnd);
  64983. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  64984. for (let i = 0; i < controllers.length; i++) {
  64985. const inputSource = controllerInputSources[i];
  64986. if (inputSource === null) continue;
  64987. controllerInputSources[i] = null;
  64988. controllers[i].disconnect(inputSource);
  64989. }
  64990. _currentDepthNear = null;
  64991. _currentDepthFar = null; // restore framebuffer/rendering state
  64992. renderer.setRenderTarget(initialRenderTarget);
  64993. glBaseLayer = null;
  64994. glProjLayer = null;
  64995. glBinding = null;
  64996. session = null;
  64997. newRenderTarget = null; //
  64998. animation.stop();
  64999. scope.isPresenting = false;
  65000. scope.dispatchEvent({
  65001. type: 'sessionend'
  65002. });
  65003. }
  65004. this.setFramebufferScaleFactor = function (value) {
  65005. framebufferScaleFactor = value;
  65006. if (scope.isPresenting === true) {
  65007. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  65008. }
  65009. };
  65010. this.setReferenceSpaceType = function (value) {
  65011. referenceSpaceType = value;
  65012. if (scope.isPresenting === true) {
  65013. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  65014. }
  65015. };
  65016. this.getReferenceSpace = function () {
  65017. return customReferenceSpace || referenceSpace;
  65018. };
  65019. this.setReferenceSpace = function (space) {
  65020. customReferenceSpace = space;
  65021. };
  65022. this.getBaseLayer = function () {
  65023. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  65024. };
  65025. this.getBinding = function () {
  65026. return glBinding;
  65027. };
  65028. this.getFrame = function () {
  65029. return xrFrame;
  65030. };
  65031. this.getSession = function () {
  65032. return session;
  65033. };
  65034. this.setSession = async function (value) {
  65035. session = value;
  65036. if (session !== null) {
  65037. initialRenderTarget = renderer.getCurrentRenderTarget();
  65038. session.addEventListener('select', onSessionEvent);
  65039. session.addEventListener('selectstart', onSessionEvent);
  65040. session.addEventListener('selectend', onSessionEvent);
  65041. session.addEventListener('squeeze', onSessionEvent);
  65042. session.addEventListener('squeezestart', onSessionEvent);
  65043. session.addEventListener('squeezeend', onSessionEvent);
  65044. session.addEventListener('end', onSessionEnd);
  65045. session.addEventListener('inputsourceschange', onInputSourcesChange);
  65046. if (attributes.xrCompatible !== true) {
  65047. await gl.makeXRCompatible();
  65048. }
  65049. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  65050. const layerInit = {
  65051. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  65052. alpha: attributes.alpha,
  65053. depth: attributes.depth,
  65054. stencil: attributes.stencil,
  65055. framebufferScaleFactor: framebufferScaleFactor
  65056. };
  65057. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  65058. session.updateRenderState({
  65059. baseLayer: glBaseLayer
  65060. });
  65061. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  65062. format: THREE.RGBAFormat,
  65063. type: THREE.UnsignedByteType,
  65064. encoding: renderer.outputEncoding
  65065. });
  65066. } else {
  65067. let depthFormat = null;
  65068. let depthType = null;
  65069. let glDepthFormat = null;
  65070. if (attributes.depth) {
  65071. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  65072. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  65073. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  65074. }
  65075. const projectionlayerInit = {
  65076. colorFormat: gl.RGBA8,
  65077. depthFormat: glDepthFormat,
  65078. scaleFactor: framebufferScaleFactor
  65079. };
  65080. glBinding = new XRWebGLBinding(session, gl);
  65081. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  65082. session.updateRenderState({
  65083. layers: [glProjLayer]
  65084. });
  65085. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  65086. format: THREE.RGBAFormat,
  65087. type: THREE.UnsignedByteType,
  65088. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  65089. stencilBuffer: attributes.stencil,
  65090. encoding: renderer.outputEncoding,
  65091. samples: attributes.antialias ? 4 : 0
  65092. });
  65093. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  65094. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  65095. }
  65096. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  65097. // Set foveation to maximum.
  65098. this.setFoveation(1.0);
  65099. customReferenceSpace = null;
  65100. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  65101. animation.setContext(session);
  65102. animation.start();
  65103. scope.isPresenting = true;
  65104. scope.dispatchEvent({
  65105. type: 'sessionstart'
  65106. });
  65107. }
  65108. };
  65109. function onInputSourcesChange(event) {
  65110. // Notify disconnected
  65111. for (let i = 0; i < event.removed.length; i++) {
  65112. const inputSource = event.removed[i];
  65113. const index = controllerInputSources.indexOf(inputSource);
  65114. if (index >= 0) {
  65115. controllerInputSources[index] = null;
  65116. controllers[index].dispatchEvent({
  65117. type: 'disconnected',
  65118. data: inputSource
  65119. });
  65120. }
  65121. } // Notify connected
  65122. for (let i = 0; i < event.added.length; i++) {
  65123. const inputSource = event.added[i];
  65124. let controllerIndex = controllerInputSources.indexOf(inputSource);
  65125. if (controllerIndex === -1) {
  65126. // Assign input source a controller that currently has no input source
  65127. for (let i = 0; i < controllers.length; i++) {
  65128. if (i >= controllerInputSources.length) {
  65129. controllerInputSources.push(inputSource);
  65130. controllerIndex = i;
  65131. break;
  65132. } else if (controllerInputSources[i] === null) {
  65133. controllerInputSources[i] = inputSource;
  65134. controllerIndex = i;
  65135. break;
  65136. }
  65137. } // If all controllers do currently receive input we ignore new ones
  65138. if (controllerIndex === -1) break;
  65139. }
  65140. const controller = controllers[controllerIndex];
  65141. if (controller) {
  65142. controller.dispatchEvent({
  65143. type: 'connected',
  65144. data: inputSource
  65145. });
  65146. }
  65147. }
  65148. } //
  65149. const cameraLPos = new THREE.Vector3();
  65150. const cameraRPos = new THREE.Vector3();
  65151. function setProjectionFromUnion(camera, cameraL, cameraR) {
  65152. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  65153. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  65154. const ipd = cameraLPos.distanceTo(cameraRPos);
  65155. const projL = cameraL.projectionMatrix.elements;
  65156. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  65157. // most likely identical top and bottom frustum extents.
  65158. // Use the left camera for these values.
  65159. const near = projL[14] / (projL[10] - 1);
  65160. const far = projL[14] / (projL[10] + 1);
  65161. const topFov = (projL[9] + 1) / projL[5];
  65162. const bottomFov = (projL[9] - 1) / projL[5];
  65163. const leftFov = (projL[8] - 1) / projL[0];
  65164. const rightFov = (projR[8] + 1) / projR[0];
  65165. const left = near * leftFov;
  65166. const right = near * rightFov; // Calculate the new camera's position offset from the
  65167. // left camera. xOffset should be roughly half `ipd`.
  65168. const zOffset = ipd / (-leftFov + rightFov);
  65169. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  65170. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  65171. camera.translateX(xOffset);
  65172. camera.translateZ(zOffset);
  65173. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  65174. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  65175. // the values so that the near plane's position does not change in world space,
  65176. // although must now be relative to the new union camera.
  65177. const near2 = near + zOffset;
  65178. const far2 = far + zOffset;
  65179. const left2 = left - xOffset;
  65180. const right2 = right + (ipd - xOffset);
  65181. const top2 = topFov * far / far2 * near2;
  65182. const bottom2 = bottomFov * far / far2 * near2;
  65183. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  65184. }
  65185. function updateCamera(camera, parent) {
  65186. if (parent === null) {
  65187. camera.matrixWorld.copy(camera.matrix);
  65188. } else {
  65189. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  65190. }
  65191. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  65192. }
  65193. this.updateCamera = function (camera) {
  65194. if (session === null) return;
  65195. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  65196. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  65197. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  65198. // Note that the new renderState won't apply until the next frame. See #18320
  65199. session.updateRenderState({
  65200. depthNear: cameraVR.near,
  65201. depthFar: cameraVR.far
  65202. });
  65203. _currentDepthNear = cameraVR.near;
  65204. _currentDepthFar = cameraVR.far;
  65205. }
  65206. const parent = camera.parent;
  65207. const cameras = cameraVR.cameras;
  65208. updateCamera(cameraVR, parent);
  65209. for (let i = 0; i < cameras.length; i++) {
  65210. updateCamera(cameras[i], parent);
  65211. }
  65212. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  65213. camera.position.copy(cameraVR.position);
  65214. camera.quaternion.copy(cameraVR.quaternion);
  65215. camera.scale.copy(cameraVR.scale);
  65216. camera.matrix.copy(cameraVR.matrix);
  65217. camera.matrixWorld.copy(cameraVR.matrixWorld);
  65218. const children = camera.children;
  65219. for (let i = 0, l = children.length; i < l; i++) {
  65220. children[i].updateMatrixWorld(true);
  65221. } // update projection matrix for proper view frustum culling
  65222. if (cameras.length === 2) {
  65223. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  65224. } else {
  65225. // assume single camera setup (AR)
  65226. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  65227. }
  65228. };
  65229. this.getCamera = function () {
  65230. return cameraVR;
  65231. };
  65232. this.getFoveation = function () {
  65233. if (glProjLayer !== null) {
  65234. return glProjLayer.fixedFoveation;
  65235. }
  65236. if (glBaseLayer !== null) {
  65237. return glBaseLayer.fixedFoveation;
  65238. }
  65239. return undefined;
  65240. };
  65241. this.setFoveation = function (foveation) {
  65242. // 0 = no foveation = full resolution
  65243. // 1 = maximum foveation = the edges render at lower resolution
  65244. if (glProjLayer !== null) {
  65245. glProjLayer.fixedFoveation = foveation;
  65246. }
  65247. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  65248. glBaseLayer.fixedFoveation = foveation;
  65249. }
  65250. }; // Animation Loop
  65251. let onAnimationFrameCallback = null;
  65252. function onAnimationFrame(time, frame) {
  65253. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  65254. xrFrame = frame;
  65255. if (pose !== null) {
  65256. const views = pose.views;
  65257. if (glBaseLayer !== null) {
  65258. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  65259. renderer.setRenderTarget(newRenderTarget);
  65260. }
  65261. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  65262. if (views.length !== cameraVR.cameras.length) {
  65263. cameraVR.cameras.length = 0;
  65264. cameraVRNeedsUpdate = true;
  65265. }
  65266. for (let i = 0; i < views.length; i++) {
  65267. const view = views[i];
  65268. let viewport = null;
  65269. if (glBaseLayer !== null) {
  65270. viewport = glBaseLayer.getViewport(view);
  65271. } else {
  65272. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  65273. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  65274. if (i === 0) {
  65275. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  65276. renderer.setRenderTarget(newRenderTarget);
  65277. }
  65278. }
  65279. let camera = cameras[i];
  65280. if (camera === undefined) {
  65281. camera = new THREE.PerspectiveCamera();
  65282. camera.layers.enable(i);
  65283. camera.viewport = new THREE.Vector4();
  65284. cameras[i] = camera;
  65285. }
  65286. camera.matrix.fromArray(view.transform.matrix);
  65287. camera.projectionMatrix.fromArray(view.projectionMatrix);
  65288. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  65289. if (i === 0) {
  65290. cameraVR.matrix.copy(camera.matrix);
  65291. }
  65292. if (cameraVRNeedsUpdate === true) {
  65293. cameraVR.cameras.push(camera);
  65294. }
  65295. }
  65296. } //
  65297. for (let i = 0; i < controllers.length; i++) {
  65298. const inputSource = controllerInputSources[i];
  65299. const controller = controllers[i];
  65300. if (inputSource !== null && controller !== undefined) {
  65301. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  65302. }
  65303. }
  65304. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  65305. xrFrame = null;
  65306. }
  65307. const animation = new WebGLAnimation();
  65308. animation.setAnimationLoop(onAnimationFrame);
  65309. this.setAnimationLoop = function (callback) {
  65310. onAnimationFrameCallback = callback;
  65311. };
  65312. this.dispose = function () {};
  65313. }
  65314. }
  65315. THREE.WebXRManager = WebXRManager
  65316. } */
  65317. /*
  65318. var addMagnifier = function(){
  65319. class Magnifier extends THREE.Object3D {
  65320. constructor () {
  65321. super()
  65322. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  65323. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  65324. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  65325. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  65326. format: THREE.RGBAFormat ,
  65327. //type: THREE.FloatType,
  65328. //minFilter: THREE.NearestFilter,
  65329. //magFilter: THREE.NearestFilter,
  65330. } )
  65331. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65332. side: THREE.DoubleSide ,
  65333. map: this.renderTarget.texture ,
  65334. transparent:true,
  65335. depthTest: !1,
  65336. depthWrite: !1,
  65337. }))
  65338. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65339. side: THREE.DoubleSide ,
  65340. map: Texture.load('images/crosshair.png') ,
  65341. transparent:true,
  65342. depthTest: !1,
  65343. depthWrite: !1,
  65344. }))
  65345. this.add(this.mesh)
  65346. this.add(this.overlayMesh)
  65347. player.model.add(this);
  65348. player.magnifier = this;
  65349. }
  65350. update(aimPos){
  65351. const magDistance_ = 0.3;
  65352. var playerPos = player.position
  65353. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  65354. this.camera.position.copy(aimPos.clone().add(vec))
  65355. this.camera.lookAt(aimPos)
  65356. var playerCamera = player.camera
  65357. this.quaternion.copy(playerCamera.quaternion);
  65358. var pos2d = player.mouse.clone();
  65359. var shift = 400;
  65360. var clientHeight = player.domElement.clientHeight
  65361. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  65362. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  65363. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  65364. this.position.copy(newPos)
  65365. var renderer = player.sceneRenderer.renderer
  65366. var oldAutoClear = renderer.autoClear
  65367. renderer.autoClear = false
  65368. //renderer.clear( true, true, true );
  65369. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  65370. renderer.autoClear = oldAutoClear
  65371. }
  65372. }
  65373. new Magnifier()
  65374. }
  65375. */
  65376. /*
  65377. 笔记:
  65378. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  65379. {
  65380. //到导览中某个点位(假设点位不重复)
  65381. var id = 73
  65382. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  65383. var i = player.model.heroLocations.indexOf(p)
  65384. var p1 = p.heroLocations.find(e=>e.panoId == id)
  65385. var j = p.heroLocations.indexOf(p1)
  65386. player.director.goToHighlight([i,j])
  65387. }
  65388. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  65389. 关于pc-nav 4k
  65390. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  65391. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  65392. 如果body使用transform旋转90度,需要改的地方:
  65393. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  65394. return i = i || new n.Vector2,
  65395. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  65396. i.x = t / $("#player").width() * 2 - 1,
  65397. i
  65398. },
  65399. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  65400. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  65401. 还有
  65402. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  65403. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  65404. ===================
  65405. 一些事件
  65406. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  65407. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  65408. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后
  65409. 一些后缀
  65410. &panoLabel 加pano标签
  65411. */