mainEdit.js.bak 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693
  1. /* 许钟文修改的 标记 xzw 有的加了”改“字
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. 几乎所有window.innerWidth、innerHeight都变成 $('#player').width()、 height() 原因:1编辑页面canvas显示区域非全屏 2为了放大显示时不会模糊
  4. */
  5. !function() {
  6. "use strict";
  7. function t(t, i) {
  8. return typeof t === i
  9. }
  10. function i(t, i) {
  11. return t instanceof i
  12. }
  13. function n(t) {
  14. return t && t.nodeType
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0
  18. }
  19. function o(t, i, n) {
  20. return g.each(t, function(t, e) {
  21. n = i.call(e, n, t, e)
  22. }),
  23. n
  24. }
  25. function r(t, i, n) {
  26. var e, o, r;
  27. if (t === i)
  28. return !0;
  29. if (!t || !i || t.constructor !== i.constructor)
  30. return !1;
  31. for (e = 0,
  32. o = n.length; o > e; e += 1) {
  33. if (r = n[e],
  34. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  35. return !1;
  36. if (t[r] !== i[r])
  37. return !1
  38. }
  39. return !0
  40. }
  41. function s(t, i, n, e) {
  42. this.left = E(t),
  43. this.top = E(i),
  44. this.width = E(n),
  45. this.height = E(e),
  46. this.right = this.left + this.width,
  47. this.bottom = this.top + this.height
  48. }
  49. function h(t, i, n, e) {
  50. this.visible = t || 0,
  51. this.viewport = i || 0,
  52. this.possible = n || 0,
  53. this.rects = e && T({}, e) || null
  54. }
  55. function l(t, i) {
  56. this.els = t,
  57. this.viewport = i
  58. }
  59. function c(t, i, n) {
  60. var e;
  61. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  62. e ? e[n] : 0
  63. }
  64. function u(t, i) {
  65. return t.val - i.val
  66. }
  67. function a(t, i) {
  68. return i.val - t.val
  69. }
  70. function f(t) {
  71. var i = s.ofContent(t, !0)
  72. , n = s.ofViewport(t, !0)
  73. , e = i.width - n.width
  74. , o = i.height - n.height;
  75. this.content = i,
  76. this.viewport = n,
  77. this.width = 0 >= e ? null : n.left / e,
  78. this.height = 0 >= o ? null : n.top / o,
  79. this.left = n.left,
  80. this.top = n.top,
  81. this.right = i.right - n.right,
  82. this.bottom = i.bottom - n.bottom
  83. }
  84. function p(t) {
  85. this.el = t || window
  86. }
  87. function d(t, i) {
  88. this.context = t,
  89. this.viewport = i,
  90. this.init()
  91. }
  92. function v(t, i, n, e) {
  93. this.context = new l(t,i),
  94. this.property = n,
  95. this.descending = e,
  96. this.init()
  97. }
  98. function w(t) {
  99. t && t !== window && t !== document ? (this.context = t,
  100. this.$autoTarget = g(t)) : this.context = window,
  101. this.init()
  102. }
  103. var g = jQuery
  104. , m = g(window)
  105. , b = g(document)
  106. , T = g.extend
  107. , y = g.isFunction
  108. , k = Math.max
  109. , V = Math.min
  110. , E = Math.round
  111. , x = function() {
  112. var t = {}
  113. , i = 1;
  114. return function(n) {
  115. return n ? (t[n] || (t[n] = i,
  116. i += 1),
  117. t[n]) : 0
  118. }
  119. }();
  120. T(s.prototype, {
  121. equals: function(t) {
  122. return r(this, t, ["left", "top", "width", "height"])
  123. },
  124. area: function() {
  125. return this.width * this.height
  126. },
  127. relativeTo: function(t) {
  128. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  129. },
  130. intersection: function(t) {
  131. if (!i(t, s))
  132. return null;
  133. var n = k(this.left, t.left)
  134. , e = V(this.right, t.right)
  135. , o = k(this.top, t.top)
  136. , r = V(this.bottom, t.bottom)
  137. , h = e - n
  138. , l = r - o;
  139. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  140. },
  141. envelope: function(t) {
  142. if (!i(t, s))
  143. return this;
  144. var n = V(this.left, t.left)
  145. , e = k(this.right, t.right)
  146. , o = V(this.top, t.top)
  147. , r = k(this.bottom, t.bottom)
  148. , h = e - n
  149. , l = r - o;
  150. return new s(n,o,h,l)
  151. }
  152. }),
  153. T(s, {
  154. ofContent: function(t, i) {
  155. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  156. },
  157. ofViewport: function(t, i) {
  158. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  159. },
  160. ofElement: function(t) {
  161. var i = g(t);
  162. if (!i.is(":visible"))
  163. return null;
  164. var n = i.offset();
  165. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  166. }
  167. }),
  168. T(h.prototype, {
  169. equals: function(t) {
  170. return this.fracsEqual(t) && this.rectsEqual(t)
  171. },
  172. fracsEqual: function(t) {
  173. return r(this, t, ["visible", "viewport", "possible"])
  174. },
  175. rectsEqual: function(t) {
  176. return r(this.rects, t.rects, ["document", "element", "viewport"])
  177. }
  178. }),
  179. T(h, {
  180. of: function(t, i) {
  181. var e, o, r;
  182. return t = n(t) && s.ofElement(t) || t,
  183. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  184. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  185. r = V(t.width, i.width) * V(t.height, i.height),
  186. new h(o / t.area(),o / i.area(),o / r,{
  187. document: e,
  188. element: e.relativeTo(t),
  189. viewport: e.relativeTo(i)
  190. })) : new h
  191. }
  192. });
  193. var q = ["width", "height", "left", "right", "top", "bottom"]
  194. , S = ["possible", "visible", "viewport"];
  195. T(l.prototype, {
  196. sorted: function(t, i) {
  197. var n = this.viewport;
  198. return g.map(this.els, function(i) {
  199. return {
  200. el: i,
  201. val: c(i, n, t)
  202. }
  203. }).sort(i ? a : u)
  204. },
  205. best: function(t, i) {
  206. return this.els.length ? this.sorted(t, i)[0] : null
  207. }
  208. }),
  209. T(f.prototype, {
  210. equals: function(t) {
  211. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  212. }
  213. }),
  214. T(p.prototype, {
  215. equals: function(t) {
  216. return r(this, t, ["el"])
  217. },
  218. scrollState: function() {
  219. return new f(this.el)
  220. },
  221. scrollTo: function(t, i, n) {
  222. var e = g(this.el === window ? "html,body" : this.el);
  223. t = t || 0,
  224. i = i || 0,
  225. n = isNaN(n) ? 1e3 : n,
  226. e.stop(!0).animate({
  227. scrollLeft: t,
  228. scrollTop: i
  229. }, n)
  230. },
  231. scroll: function(t, i, n) {
  232. var e = this.el === window ? m : g(this.el);
  233. t = t || 0,
  234. i = i || 0,
  235. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  236. },
  237. scrollToRect: function(t, i, n, e) {
  238. i = i || 0,
  239. n = n || 0,
  240. this.scrollTo(t.left - i, t.top - n, e)
  241. },
  242. scrollToElement: function(t, i, n, e) {
  243. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  244. this.scrollToRect(o, i, n, e)
  245. }
  246. });
  247. var C = {
  248. init: function() {
  249. this.callbacks = g.Callbacks("memory unique"),
  250. this.currVal = null,
  251. this.prevVal = null,
  252. this.checkProxy = g.proxy(this.check, this),
  253. this.autoCheck()
  254. },
  255. bind: function(t) {
  256. this.callbacks.add(t)
  257. },
  258. unbind: function(t) {
  259. t ? this.callbacks.remove(t) : this.callbacks.empty()
  260. },
  261. trigger: function() {
  262. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  263. },
  264. check: function(t) {
  265. var i = this.updatedValue(t);
  266. return void 0 !== i && (this.prevVal = this.currVal,
  267. this.currVal = i,
  268. this.trigger(),
  269. !0)
  270. },
  271. $autoTarget: m,
  272. autoEvents: "load resize scroll",
  273. autoCheck: function(t) {
  274. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  275. }
  276. };
  277. T(d.prototype, C, {
  278. updatedValue: function() {
  279. var t = h.of(this.context, this.viewport);
  280. return this.currVal && this.currVal.equals(t) ? void 0 : t
  281. }
  282. }),
  283. T(v.prototype, C, {
  284. updatedValue: function() {
  285. var t = this.context.best(this.property, this.descending);
  286. return t && (t = t.val > 0 ? t.el : null,
  287. this.currVal !== t) ? t : void 0
  288. }
  289. }),
  290. T(w.prototype, C, {
  291. updatedValue: function() {
  292. var t = new f(this.context);
  293. return this.currVal && this.currVal.equals(t) ? void 0 : t
  294. }
  295. });
  296. var L = function(t, i) {
  297. var n = [].slice
  298. , e = jQuery
  299. , o = e.extend
  300. , r = e.isFunction
  301. , s = o({}, i)
  302. , h = function(i, n, o, s) {
  303. return o = r(o) ? o.apply(i, n) : o,
  304. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  305. }
  306. , l = function() {
  307. return h(this, n.call(arguments), s.defaultStatic, l)
  308. }
  309. , c = function(t) {
  310. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  311. }
  312. , u = function(t) {
  313. t && (o(l, t.statics),
  314. o(c, t.methods)),
  315. l.modplug = u
  316. };
  317. u.prev = {
  318. statics: e[t],
  319. methods: e.fn[t]
  320. },
  321. u(i),
  322. e[t] = l,
  323. e.fn[t] = c
  324. }
  325. , M = "fracs";
  326. L(M, {
  327. statics: {
  328. version: "0.15.0",
  329. Rect: s,
  330. Fractions: h,
  331. Group: l,
  332. ScrollState: f,
  333. Viewport: p,
  334. FracsCallbacks: d,
  335. GroupCallbacks: v,
  336. ScrollStateCallbacks: w,
  337. fracs: function(t, i) {
  338. return h.of(t, i)
  339. }
  340. },
  341. methods: {
  342. content: function(t) {
  343. return this.length ? s.ofContent(this[0], t) : null
  344. },
  345. envelope: function() {
  346. return o(this, function(t) {
  347. var i = s.ofElement(this);
  348. return t ? t.envelope(i) : i
  349. })
  350. },
  351. fracs: function(i, n, o) {
  352. t(i, "string") || (o = n,
  353. n = i,
  354. i = null),
  355. y(n) || (o = n,
  356. n = null),
  357. o = e(o);
  358. var r = M + ".fracs." + x(o);
  359. return "unbind" === i ? this.each(function() {
  360. var t = g(this).data(r);
  361. t && t.unbind(n)
  362. }) : "check" === i ? this.each(function() {
  363. var t = g(this).data(r);
  364. t && t.check()
  365. }) : y(n) ? this.each(function() {
  366. var t = g(this)
  367. , i = t.data(r);
  368. i || (i = new d(this,o),
  369. t.data(r, i)),
  370. i.bind(n)
  371. }) : this.length ? h.of(this[0], o) : null
  372. },
  373. intersection: function() {
  374. return o(this, function(t) {
  375. var i = s.ofElement(this);
  376. return t ? t.intersection(i) : i
  377. })
  378. },
  379. max: function(t, i, n) {
  380. return y(i) || (n = i,
  381. i = null),
  382. n = e(n),
  383. i ? (new v(this,n,t,!0).bind(i),
  384. this) : this.pushStack(new l(this,n).best(t, !0).el)
  385. },
  386. min: function(t, i, n) {
  387. return y(i) || (n = i,
  388. i = null),
  389. n = e(n),
  390. i ? (new v(this,n,t).bind(i),
  391. this) : this.pushStack(new l(this,n).best(t).el)
  392. },
  393. rect: function() {
  394. return this.length ? s.ofElement(this[0]) : null
  395. },
  396. scrollState: function(i, n) {
  397. var e = M + ".scrollState";
  398. return t(i, "string") || (n = i,
  399. i = null),
  400. "unbind" === i ? this.each(function() {
  401. var t = g(this).data(e);
  402. t && t.unbind(n)
  403. }) : "check" === i ? this.each(function() {
  404. var t = g(this).data(e);
  405. t && t.check()
  406. }) : y(n) ? this.each(function() {
  407. var t = g(this)
  408. , i = t.data(e);
  409. i || (i = new w(this),
  410. t.data(e, i)),
  411. i.bind(n)
  412. }) : this.length ? new f(this[0]) : null
  413. },
  414. scroll: function(t, i, n) {
  415. return this.each(function() {
  416. new p(this).scroll(t, i, n)
  417. })
  418. },
  419. scrollTo: function(t, i, n, o) {
  420. return g.isNumeric(t) && (o = n,
  421. n = i,
  422. i = t,
  423. t = null),
  424. t = e(t),
  425. this.each(function() {
  426. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  427. })
  428. },
  429. scrollToThis: function(t, i, n, o) {
  430. return o = new p(e(o)),
  431. o.scrollToElement(this[0], t, i, n),
  432. this
  433. },
  434. softLink: function(t, i, n, o) {
  435. return o = new p(e(o)),
  436. this.filter("a[href^=#]").each(function() {
  437. var e = g(this);
  438. e.on("click", function() {
  439. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  440. })
  441. })
  442. },
  443. sort: function(i, n, o) {
  444. return t(n, "boolean") || (o = n,
  445. n = null),
  446. o = e(o),
  447. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  448. return t.el
  449. }))
  450. },
  451. viewport: function(t) {
  452. return this.length ? s.ofViewport(this[0], t) : null
  453. }
  454. },
  455. defaultStatic: "fracs",
  456. defaultMethod: "fracs"
  457. })
  458. }();
  459. if ("undefined" == typeof jQuery)
  460. throw new Error("Bootstrap's JavaScript requires jQuery");
  461. +function(t) {
  462. "use strict";
  463. function e(e) {
  464. return this.each(function() {
  465. var o = t(this)
  466. , s = o.data("bs.tooltip")
  467. , n = "object" == typeof e && e;
  468. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  469. "string" == typeof e && s[e]())
  470. })
  471. }
  472. var i = function(t, e) {
  473. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  474. this.init("tooltip", t, e)
  475. };
  476. i.VERSION = "3.2.0",
  477. i.DEFAULTS = {
  478. animation: !0,
  479. placement: "top",
  480. selector: !1,
  481. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  482. trigger: "hover focus",
  483. title: "",
  484. delay: 0,
  485. html: !1,
  486. container: !1,
  487. viewport: {
  488. selector: "body",
  489. padding: 0
  490. }
  491. },
  492. i.prototype.init = function(e, i, o) {
  493. this.enabled = !0,
  494. this.type = e,
  495. this.$element = t(i),
  496. this.options = this.getOptions(o),
  497. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  498. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  499. var r = s[n];
  500. if ("click" == r)
  501. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  502. else if ("manual" != r) {
  503. var a = "hover" == r ? "mouseenter" : "focusin"
  504. , l = "hover" == r ? "mouseleave" : "focusout";
  505. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  506. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  507. }
  508. }
  509. this.options.selector ? this._options = t.extend({}, this.options, {
  510. trigger: "manual",
  511. selector: ""
  512. }) : this.fixTitle()
  513. }
  514. ,
  515. i.prototype.getDefaults = function() {
  516. return i.DEFAULTS
  517. }
  518. ,
  519. i.prototype.getOptions = function(e) {
  520. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  521. e.delay && "number" == typeof e.delay && (e.delay = {
  522. show: e.delay,
  523. hide: e.delay
  524. }),
  525. e
  526. }
  527. ,
  528. i.prototype.getDelegateOptions = function() {
  529. var e = {}
  530. , i = this.getDefaults();
  531. return this._options && t.each(this._options, function(t, o) {
  532. i[t] != o && (e[t] = o)
  533. }),
  534. e
  535. }
  536. ,
  537. i.prototype.enter = function(e) {
  538. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  539. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  540. t(e.currentTarget).data("bs." + this.type, i)),
  541. clearTimeout(i.timeout),
  542. i.hoverState = "in",
  543. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  544. "in" == i.hoverState && i.show()
  545. }, i.options.delay.show)) : i.show()
  546. }
  547. ,
  548. i.prototype.leave = function(e) {
  549. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  550. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  551. t(e.currentTarget).data("bs." + this.type, i)),
  552. clearTimeout(i.timeout),
  553. i.hoverState = "out",
  554. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  555. "out" == i.hoverState && i.hide()
  556. }, i.options.delay.hide)) : i.hide()
  557. }
  558. ,
  559. i.prototype.show = function() {
  560. var e = t.Event("show.bs." + this.type);
  561. if (this.hasContent() && this.enabled) {
  562. this.$element.trigger(e);
  563. var i = t.contains(document.documentElement, this.$element[0]);
  564. if (e.isDefaultPrevented() || !i)
  565. return;
  566. var o = this
  567. , s = this.tip()
  568. , n = this.getUID(this.type);
  569. this.setContent(),
  570. s.attr("id", n),
  571. this.$element.attr("aria-describedby", n),
  572. this.options.animation && s.addClass("fade");
  573. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  574. , a = /\s?auto?\s?/i
  575. , l = a.test(r);
  576. l && (r = r.replace(a, "") || "top"),
  577. s.detach().css({
  578. top: 0,
  579. left: 0,
  580. display: "block"
  581. }).addClass(r).data("bs." + this.type, this),
  582. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  583. var p = this.getPosition()
  584. , h = s[0].offsetWidth
  585. , f = s[0].offsetHeight;
  586. if (l) {
  587. var u = r
  588. , c = this.$element.parent()
  589. , d = this.getPosition(c);
  590. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  591. s.removeClass(u).addClass(r)
  592. }
  593. var g = this.getCalculatedOffset(r, p, h, f);
  594. this.applyPlacement(g, r);
  595. var y = function() {
  596. o.$element.trigger("shown.bs." + o.type),
  597. o.hoverState = null
  598. };
  599. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  600. }
  601. }
  602. ,
  603. i.prototype.applyPlacement = function(e, i) {
  604. var o = this.tip()
  605. , s = o[0].offsetWidth
  606. , n = o[0].offsetHeight
  607. , r = parseInt(o.css("margin-top"), 10)
  608. , a = parseInt(o.css("margin-left"), 10);
  609. isNaN(r) && (r = 0),
  610. isNaN(a) && (a = 0),
  611. e.top = e.top + r,
  612. e.left = e.left + a,
  613. t.offset.setOffset(o[0], t.extend({
  614. using: function(t) {
  615. o.css({
  616. top: Math.round(t.top),
  617. left: Math.round(t.left)
  618. })
  619. }
  620. }, e), 0),
  621. o.addClass("in");
  622. var l = o[0].offsetWidth
  623. , p = o[0].offsetHeight;
  624. "top" == i && p != n && (e.top = e.top + n - p);
  625. var h = this.getViewportAdjustedDelta(i, e, l, p);
  626. h.left ? e.left += h.left : e.top += h.top;
  627. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  628. , u = h.left ? "left" : "top"
  629. , c = h.left ? "offsetWidth" : "offsetHeight";
  630. o.offset(e),
  631. this.replaceArrow(f, o[0][c], u)
  632. }
  633. ,
  634. i.prototype.replaceArrow = function(t, e, i) {
  635. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  636. }
  637. ,
  638. i.prototype.setContent = function() {
  639. var t = this.tip()
  640. , e = this.getTitle();
  641. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  642. t.removeClass("fade in top bottom left right")
  643. }
  644. ,
  645. i.prototype.hide = function() {
  646. function e() {
  647. "in" != i.hoverState && o.detach(),
  648. i.$element.trigger("hidden.bs." + i.type)
  649. }
  650. var i = this
  651. , o = this.tip()
  652. , s = t.Event("hide.bs." + this.type);
  653. if (this.$element.removeAttr("aria-describedby"),
  654. this.$element.trigger(s),
  655. !s.isDefaultPrevented())
  656. return o.removeClass("in"),
  657. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  658. this.hoverState = null,
  659. this
  660. }
  661. ,
  662. i.prototype.fixTitle = function() {
  663. var t = this.$element;
  664. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  665. }
  666. ,
  667. i.prototype.hasContent = function() {
  668. return this.getTitle()
  669. }
  670. ,
  671. i.prototype.getPosition = function(e) {
  672. e = e || this.$element;
  673. var i = e[0]
  674. , o = "BODY" == i.tagName;
  675. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  676. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  677. width: o ? t(window).width() : e.outerWidth(),
  678. height: o ? t(window).height() : e.outerHeight()
  679. }, o ? {
  680. top: 0,
  681. left: 0
  682. } : e.offset())
  683. }
  684. ,
  685. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  686. return "bottom" == t ? {
  687. top: e.top + e.height,
  688. left: e.left + e.width / 2 - i / 2
  689. } : "top" == t ? {
  690. top: e.top - o,
  691. left: e.left + e.width / 2 - i / 2
  692. } : "left" == t ? {
  693. top: e.top + e.height / 2 - o / 2,
  694. left: e.left - i
  695. } : {
  696. top: e.top + e.height / 2 - o / 2,
  697. left: e.left + e.width
  698. }
  699. }
  700. ,
  701. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  702. var s = {
  703. top: 0,
  704. left: 0
  705. };
  706. if (!this.$viewport)
  707. return s;
  708. var n = this.options.viewport && this.options.viewport.padding || 0
  709. , r = this.getPosition(this.$viewport);
  710. if (/right|left/.test(t)) {
  711. var a = e.top - n - r.scroll
  712. , l = e.top + n - r.scroll + o;
  713. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  714. } else {
  715. var p = e.left - n
  716. , h = e.left + n + i;
  717. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  718. }
  719. return s
  720. }
  721. ,
  722. i.prototype.getTitle = function() {
  723. var t, e = this.$element, i = this.options;
  724. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  725. }
  726. ,
  727. i.prototype.getUID = function(t) {
  728. do
  729. t += ~~(1e6 * Math.random());
  730. while (document.getElementById(t));return t
  731. }
  732. ,
  733. i.prototype.tip = function() {
  734. return this.$tip = this.$tip || t(this.options.template)
  735. }
  736. ,
  737. i.prototype.arrow = function() {
  738. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  739. }
  740. ,
  741. i.prototype.validate = function() {
  742. this.$element[0].parentNode || (this.hide(),
  743. this.$element = null,
  744. this.options = null)
  745. }
  746. ,
  747. i.prototype.enable = function() {
  748. this.enabled = !0
  749. }
  750. ,
  751. i.prototype.disable = function() {
  752. this.enabled = !1
  753. }
  754. ,
  755. i.prototype.toggleEnabled = function() {
  756. this.enabled = !this.enabled
  757. }
  758. ,
  759. i.prototype.toggle = function(e) {
  760. var i = this;
  761. e && (i = t(e.currentTarget).data("bs." + this.type),
  762. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  763. t(e.currentTarget).data("bs." + this.type, i))),
  764. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  765. }
  766. ,
  767. i.prototype.destroy = function() {
  768. clearTimeout(this.timeout),
  769. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  770. }
  771. ;
  772. var o = t.fn.tooltip;
  773. t.fn.tooltip = e,
  774. t.fn.tooltip.Constructor = i,
  775. t.fn.tooltip.noConflict = function() {
  776. return t.fn.tooltip = o,
  777. this
  778. }
  779. }(jQuery);
  780. !function(e, t, n) {
  781. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  782. }("Keen", this, function() {
  783. "use strict";
  784. function Keen() {
  785. return _init.apply(this, arguments)
  786. }
  787. function _init(e) {
  788. if (_isUndefined(e))
  789. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  790. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  791. throw new Error("Please provide a projectId");
  792. this.configure(e)
  793. }
  794. function _extend(e) {
  795. for (var t = 1; t < arguments.length; t++)
  796. for (var n in arguments[t])
  797. e[n] = arguments[t][n];
  798. return e
  799. }
  800. function _isUndefined(e) {
  801. return void 0 === e
  802. }
  803. function _type(e) {
  804. var t = e && e.constructor ? e.constructor.toString() : void 0;
  805. return t ? t.match(/function (.*)\(/)[1] : "Null"
  806. }
  807. function _each(e, t, n) {
  808. var r;
  809. if (!e)
  810. return 0;
  811. if (n = n ? n : e,
  812. "array" === _type(e)) {
  813. for (r = 0; r < e.length; r++)
  814. if (t.call(n, e[r], r, e) === !1)
  815. return 0
  816. } else
  817. for (r in e)
  818. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  819. return 0;
  820. return 1
  821. }
  822. function _parse_params(e) {
  823. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  824. return decodeURIComponent(e.replace(r, " "))
  825. }, a = e.split("?")[1]; t = i.exec(a); )
  826. n[o(t[1])] = o(t[2]);
  827. return n
  828. }
  829. function _set_protocol(e) {
  830. switch (e) {
  831. case "http":
  832. return "http";
  833. case "auto":
  834. return location.protocol.replace(/:/g, "");
  835. case "https":
  836. case void 0:
  837. default:
  838. return "https"
  839. }
  840. }
  841. function _set_request_type(e) {
  842. var t = e || "jsonp"
  843. , n = !1;
  844. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  845. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  846. }
  847. function _build_url(e) {
  848. return this.client.endpoint + "/projects/" + this.client.projectId + e
  849. }
  850. function _uploadEvent(e, t, n, r, i) {
  851. var o = _build_url.apply(this, ["/events/" + e])
  852. , a = {};
  853. n = n !== !1,
  854. this.client.globalProperties && (a = this.client.globalProperties(e));
  855. for (var c in t)
  856. t.hasOwnProperty(c) && (a[c] = t[c]);
  857. switch (this.client.requestType) {
  858. case "xhr":
  859. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  860. break;
  861. case "jsonp":
  862. var s = JSON.stringify(a)
  863. , l = Keen.Base64.encode(s);
  864. o = o + "?api_key=" + this.client.writeKey,
  865. o = o + "&data=" + l,
  866. o = o + "&modified=" + (new Date).getTime(),
  867. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  868. break;
  869. case "beacon":
  870. var s = JSON.stringify(a)
  871. , l = Keen.Base64.encode(s);
  872. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  873. o = o + "&data=" + encodeURIComponent(l),
  874. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  875. o += "&c=clv1",
  876. _request.beacon.apply(this, [o, null, r, i])
  877. }
  878. }
  879. Keen.prototype.configure = function(e) {
  880. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  881. e.protocol = _set_protocol(e.protocol),
  882. e.requestType = _set_request_type(e.requestType),
  883. this.client = {
  884. projectId: e.projectId,
  885. writeKey: e.writeKey,
  886. readKey: e.readKey,
  887. globalProperties: null,
  888. endpoint: e.protocol + "://" + e.host,
  889. requestType: e.requestType
  890. },
  891. Keen.trigger("client", this, e),
  892. this.trigger("ready"),
  893. this
  894. }
  895. ;
  896. var _request = {
  897. xhr: function(e, t, n, r, i, o, a, c) {
  898. if (!i)
  899. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  900. var s = new XMLHttpRequest;
  901. if (s.onreadystatechange = function() {
  902. if (4 == s.readyState)
  903. if (s.status >= 200 && s.status < 300) {
  904. var e;
  905. try {
  906. e = JSON.parse(s.responseText)
  907. } catch (e) {
  908. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  909. c && c(s, e)
  910. }
  911. a && e && a(e)
  912. } else
  913. Keen.log("HTTP request failed."),
  914. c && c(s, null)
  915. }
  916. ,
  917. s.open(e, t, o),
  918. i && s.setRequestHeader("Authorization", i),
  919. r && s.setRequestHeader("Content-Type", "application/json"),
  920. n)
  921. for (var l in n)
  922. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  923. var u = r ? JSON.stringify(r) : null;
  924. s.send(u)
  925. },
  926. jsonp: function(e, t, n, r) {
  927. if (!t)
  928. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  929. if (t && e.indexOf("api_key") < 0) {
  930. var i = e.indexOf("?") > 0 ? "&" : "?";
  931. e = e + i + "api_key=" + t
  932. }
  933. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  934. o += "a";
  935. var a = !1;
  936. window[o] = function(e) {
  937. a = !0,
  938. n && e && n(e),
  939. window[o] = void 0
  940. }
  941. ,
  942. e = e + "&jsonp=" + o;
  943. var c = document.createElement("script");
  944. c.id = "keen-jsonp",
  945. c.src = e,
  946. document.getElementsByTagName("head")[0].appendChild(c),
  947. c.onreadystatechange = function() {
  948. a === !1 && "loaded" === this.readyState && (a = !0,
  949. r && r())
  950. }
  951. ,
  952. c.onerror = function() {
  953. a === !1 && (a = !0,
  954. r && r())
  955. }
  956. },
  957. beacon: function(e, t, n, r) {
  958. if (t && e.indexOf("api_key") < 0) {
  959. var i = e.indexOf("?") > 0 ? "&" : "?";
  960. e = e + i + "api_key=" + t
  961. }
  962. var o = !1
  963. , a = document.createElement("img");
  964. a.onload = function() {
  965. if (o = !0,
  966. "naturalHeight"in this) {
  967. if (this.naturalHeight + this.naturalWidth === 0)
  968. return void this.onerror()
  969. } else if (this.width + this.height === 0)
  970. return void this.onerror();
  971. n && n({
  972. created: !0
  973. })
  974. }
  975. ,
  976. a.onerror = function() {
  977. o = !0,
  978. r && r()
  979. }
  980. ,
  981. a.src = e
  982. }
  983. }
  984. , Events = Keen.Events = {
  985. on: function(e, t) {
  986. this.listeners || (this.listeners = {});
  987. var n = this.listeners[e] || (this.listeners[e] = []);
  988. return n.push({
  989. callback: t
  990. }),
  991. this
  992. },
  993. off: function(e, t) {
  994. if (!e && !t)
  995. return this.listeners = void 0,
  996. delete this.listeners,
  997. this;
  998. for (var n = this.listeners[e] || [], r = n.length; r--; )
  999. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1000. t && 0 != n.length || (this.listeners[e] = void 0,
  1001. delete this.listeners[e]);
  1002. return this
  1003. },
  1004. trigger: function(e) {
  1005. if (!this.listeners)
  1006. return this;
  1007. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1008. n[r].callback.apply(this, t);
  1009. return this
  1010. }
  1011. };
  1012. _extend(Keen.prototype, Events),
  1013. _extend(Keen, Events),
  1014. Keen.loaded = !0,
  1015. Keen.utils = {
  1016. each: _each,
  1017. extend: _extend,
  1018. parseParams: _parse_params
  1019. },
  1020. Keen.ready = function(e) {
  1021. Keen.loaded ? e() : Keen.on("ready", e)
  1022. }
  1023. ,
  1024. Keen.log = function(e) {
  1025. "object" == typeof console && console.log("[Keen IO]", e)
  1026. }
  1027. ;
  1028. var Plugins = Keen.Plugins = {};
  1029. Keen.prototype.addEvent = function() {
  1030. _uploadEvent.apply(this, arguments)
  1031. }
  1032. ,
  1033. Keen.prototype.addEventSync = function(e, t, n, r) {
  1034. _uploadEvent.apply(this, [e, t, !1, n, r])
  1035. }
  1036. ,
  1037. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1038. var o = e
  1039. , a = o.metaKey
  1040. , c = o.target
  1041. , s = !1
  1042. , l = function() {};
  1043. return void 0 === r && (r = 500),
  1044. "A" === c.nodeName ? l = function() {
  1045. a || s || (s = !0,
  1046. window.location = c.href)
  1047. }
  1048. : "FORM" === c.nodeName && (l = function() {
  1049. s || (s = !0,
  1050. c.submit())
  1051. }
  1052. ),
  1053. i && (l = function() {
  1054. s || (s = !0,
  1055. i())
  1056. }
  1057. ),
  1058. _uploadEvent.call(this, t, n, l, l),
  1059. setTimeout(function() {
  1060. l()
  1061. }, r),
  1062. !!a && void 0
  1063. }
  1064. ,
  1065. Keen.prototype.setGlobalProperties = function(e) {
  1066. if (!this.client)
  1067. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1068. if (!e || "function" != typeof e)
  1069. throw new Error("Invalid value for global properties: " + e);
  1070. this.client.globalProperties = e
  1071. }
  1072. ,
  1073. Keen.Base64 = {
  1074. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1075. encode: function(e) {
  1076. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1077. for (e = this.utf8.encode(e); l < e.length; )
  1078. t = e.charCodeAt(l++),
  1079. n = e.charCodeAt(l++),
  1080. r = e.charCodeAt(l++),
  1081. i = t >> 2,
  1082. o = (3 & t) << 4 | n >> 4,
  1083. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1084. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1085. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1086. return s
  1087. },
  1088. decode: function(e) {
  1089. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1090. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1091. t = u.indexOf(e.charAt(l++)),
  1092. n = u.indexOf(e.charAt(l++)),
  1093. r = u.indexOf(e.charAt(l++)),
  1094. i = u.indexOf(e.charAt(l++)),
  1095. o = t << 2 | n >> 4,
  1096. a = (15 & n) << 4 | r >> 2,
  1097. c = (3 & r) << 6 | i,
  1098. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1099. return this.utf8.decode(s)
  1100. },
  1101. utf8: {
  1102. encode: function(e) {
  1103. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1104. t = e.charCodeAt(r++),
  1105. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1106. return n
  1107. },
  1108. decode: function(e) {
  1109. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1110. n = e.charCodeAt(i),
  1111. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1112. return r
  1113. }
  1114. }
  1115. },
  1116. "object" != typeof JSON && (JSON = {}),
  1117. function() {
  1118. function f(e) {
  1119. return 10 > e ? "0" + e : e
  1120. }
  1121. function quote(e) {
  1122. return escapable.lastIndex = 0,
  1123. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1124. var t = meta[e];
  1125. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1126. }) + '"' : '"' + e + '"'
  1127. }
  1128. function str(e, t) {
  1129. var n, r, i, o, a, c = gap, s = t[e];
  1130. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1131. "function" == typeof rep && (s = rep.call(t, e, s)),
  1132. typeof s) {
  1133. case "string":
  1134. return quote(s);
  1135. case "number":
  1136. return isFinite(s) ? String(s) : "null";
  1137. case "boolean":
  1138. case "null":
  1139. return String(s);
  1140. case "object":
  1141. if (!s)
  1142. return "null";
  1143. if (gap += indent,
  1144. a = [],
  1145. "[object Array]" === Object.prototype.toString.apply(s)) {
  1146. for (o = s.length,
  1147. n = 0; o > n; n += 1)
  1148. a[n] = str(n, s) || "null";
  1149. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1150. gap = c,
  1151. i
  1152. }
  1153. if (rep && "object" == typeof rep)
  1154. for (o = rep.length,
  1155. n = 0; o > n; n += 1)
  1156. "string" == typeof rep[n] && (r = rep[n],
  1157. i = str(r, s),
  1158. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1159. else
  1160. for (r in s)
  1161. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1162. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1163. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1164. gap = c,
  1165. i
  1166. }
  1167. }
  1168. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1169. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1170. }
  1171. ,
  1172. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1173. return this.valueOf()
  1174. }
  1175. );
  1176. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1177. "\b": "\\b",
  1178. "\t": "\\t",
  1179. "\n": "\\n",
  1180. "\f": "\\f",
  1181. "\r": "\\r",
  1182. '"': '\\"',
  1183. "\\": "\\\\"
  1184. }, rep;
  1185. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1186. var r;
  1187. if (gap = "",
  1188. indent = "",
  1189. "number" == typeof n)
  1190. for (r = 0; n > r; r += 1)
  1191. indent += " ";
  1192. else
  1193. "string" == typeof n && (indent = n);
  1194. if (rep = t,
  1195. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1196. throw new Error("JSON.stringify");
  1197. return str("", {
  1198. "": e
  1199. })
  1200. }
  1201. ),
  1202. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1203. function walk(e, t) {
  1204. var n, r, i = e[t];
  1205. if (i && "object" == typeof i)
  1206. for (n in i)
  1207. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1208. void 0 !== r ? i[n] = r : delete i[n]);
  1209. return reviver.call(e, t, i)
  1210. }
  1211. var j;
  1212. if (text = String(text),
  1213. cx.lastIndex = 0,
  1214. cx.test(text) && (text = text.replace(cx, function(e) {
  1215. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1216. })),
  1217. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1218. return j = eval("(" + text + ")"),
  1219. "function" == typeof reviver ? walk({
  1220. "": j
  1221. }, "") : j;
  1222. throw new SyntaxError("JSON.parse")
  1223. }
  1224. )
  1225. }(),
  1226. !function(e, t, n) {
  1227. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1228. }("domready", Keen.utils, function(e) {
  1229. function t(e) {
  1230. for (d = 1; e = r.shift(); )
  1231. e()
  1232. }
  1233. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1234. return o[l] && o[l](s, n = function() {
  1235. o.removeEventListener(s, n, i),
  1236. t()
  1237. }
  1238. , i),
  1239. c && o.attachEvent(u, n = function() {
  1240. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1241. t())
  1242. }
  1243. ),
  1244. e = c ? function(t) {
  1245. self != top ? d ? t() : r.push(t) : function() {
  1246. try {
  1247. a.doScroll("left")
  1248. } catch (n) {
  1249. return setTimeout(function() {
  1250. e(t)
  1251. }, 50)
  1252. }
  1253. t()
  1254. }()
  1255. }
  1256. : function(e) {
  1257. d ? e() : r.push(e)
  1258. }
  1259. });
  1260. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1261. if (loaded && cached) {
  1262. clients = cached.clients || {},
  1263. ready = cached.ready || [];
  1264. for (var instance in clients)
  1265. if (clients.hasOwnProperty(instance)) {
  1266. var client = clients[instance];
  1267. for (var method in Keen.prototype)
  1268. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1269. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1270. ,
  1271. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1272. ,
  1273. client._config && (client.configure.call(client, client._config),
  1274. delete client._config),
  1275. client._setGlobalProperties) {
  1276. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1277. client.setGlobalProperties.apply(client, globals[i]);
  1278. delete client._setGlobalProperties
  1279. }
  1280. if (client._addEvent) {
  1281. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1282. client.addEvent.apply(client, queue[i]);
  1283. delete client._addEvent
  1284. }
  1285. var callback = client._on || [];
  1286. if (client._on) {
  1287. for (var i = 0; i < callback.length; i++)
  1288. client.on.apply(client, callback[i]);
  1289. client.trigger("ready"),
  1290. delete client._on
  1291. }
  1292. }
  1293. for (var i = 0; i < ready.length; i++) {
  1294. var callback = ready[i];
  1295. Keen.on("ready", function() {
  1296. callback()
  1297. })
  1298. }
  1299. }
  1300. return Keen.loaded && setTimeout(function() {
  1301. Keen.utils.domready(function() {
  1302. Keen.trigger("ready")
  1303. })
  1304. }, 0),
  1305. Keen
  1306. });
  1307. !function() {
  1308. var t = window.analytics = window.analytics || [];
  1309. if (!t.initialize) {
  1310. if (t.invoked)
  1311. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1312. t.invoked = !0,
  1313. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1314. t.factory = function(e) {
  1315. return function() {
  1316. var n = Array.prototype.slice.call(arguments);
  1317. return n.unshift(e),
  1318. t.push(n),
  1319. t
  1320. }
  1321. }
  1322. ;
  1323. for (var e = 0; e < t.methods.length; e++) {
  1324. var n = t.methods[e];
  1325. t[n] = t.factory(n)
  1326. }
  1327. t.load = function(t) {
  1328. var e = document.createElement("script");
  1329. e.type = "text/javascript",
  1330. e.async = !0,
  1331. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1332. var n = document.getElementsByTagName("script")[0];
  1333. n.parentNode.insertBefore(e, n)
  1334. }
  1335. ,
  1336. t.SNIPPET_VERSION = "4.0.0"
  1337. }
  1338. }();
  1339. !function(i, e) {
  1340. "use strict";
  1341. var s = ""
  1342. , r = "?"
  1343. , o = "function"
  1344. , a = "undefined"
  1345. , n = "object"
  1346. , t = "major"
  1347. , d = "model"
  1348. , w = "name"
  1349. , l = "type"
  1350. , p = "vendor"
  1351. , m = "version"
  1352. , c = "architecture"
  1353. , u = "console"
  1354. , g = "mobile"
  1355. , f = "tablet"
  1356. , h = "smarttv"
  1357. , b = {
  1358. has: function(i, e) {
  1359. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1360. },
  1361. lowerize: function(i) {
  1362. return i.toLowerCase()
  1363. }
  1364. }
  1365. , y = {
  1366. rgx: function() {
  1367. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1368. var c = m[p]
  1369. , u = m[p + 1];
  1370. if (typeof i === a) {
  1371. i = {};
  1372. for (t in u)
  1373. d = u[t],
  1374. typeof d === n ? i[d[0]] = e : i[d] = e
  1375. }
  1376. for (s = r = 0; s < c.length; s++)
  1377. if (w = c[s].exec(this.getUA())) {
  1378. for (t = 0; t < u.length; t++)
  1379. l = w[++r],
  1380. d = u[t],
  1381. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1382. break
  1383. }
  1384. if (w)
  1385. break
  1386. }
  1387. return i
  1388. },
  1389. str: function(i, s) {
  1390. for (var o in s)
  1391. if (typeof s[o] === n && s[o].length > 0) {
  1392. for (var a = 0; a < s[o].length; a++)
  1393. if (b.has(s[o][a], i))
  1394. return o === r ? e : o
  1395. } else if (b.has(s[o], i))
  1396. return o === r ? e : o;
  1397. return i
  1398. }
  1399. }
  1400. , v = {
  1401. browser: {
  1402. oldsafari: {
  1403. major: {
  1404. 1: ["/8", "/1", "/3"],
  1405. 2: "/4",
  1406. "?": "/"
  1407. },
  1408. version: {
  1409. "1.0": "/8",
  1410. 1.2: "/1",
  1411. 1.3: "/3",
  1412. "2.0": "/412",
  1413. "2.0.2": "/416",
  1414. "2.0.3": "/417",
  1415. "2.0.4": "/419",
  1416. "?": "/"
  1417. }
  1418. }
  1419. },
  1420. device: {
  1421. sprint: {
  1422. model: {
  1423. "Evo Shift 4G": "7373KT"
  1424. },
  1425. vendor: {
  1426. HTC: "APA",
  1427. Sprint: "Sprint"
  1428. }
  1429. }
  1430. },
  1431. os: {
  1432. windows: {
  1433. version: {
  1434. ME: "4.90",
  1435. "NT 3.11": "NT3.51",
  1436. "NT 4.0": "NT4.0",
  1437. 2e3: "NT 5.0",
  1438. XP: ["NT 5.1", "NT 5.2"],
  1439. Vista: "NT 6.0",
  1440. 7: "NT 6.1",
  1441. 8: "NT 6.2",
  1442. 8.1: "NT 6.3",
  1443. RT: "ARM"
  1444. }
  1445. }
  1446. }
  1447. }
  1448. , k = {
  1449. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1450. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1451. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1452. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1453. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1454. }
  1455. , x = function(e) {
  1456. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1457. return this instanceof x ? (this.getBrowser = function() {
  1458. return y.rgx.apply(this, k.browser)
  1459. }
  1460. ,
  1461. this.getCPU = function() {
  1462. return y.rgx.apply(this, k.cpu)
  1463. }
  1464. ,
  1465. this.getDevice = function() {
  1466. return y.rgx.apply(this, k.device)
  1467. }
  1468. ,
  1469. this.getEngine = function() {
  1470. return y.rgx.apply(this, k.engine)
  1471. }
  1472. ,
  1473. this.getOS = function() {
  1474. return y.rgx.apply(this, k.os)
  1475. }
  1476. ,
  1477. this.getResult = function() {
  1478. return {
  1479. ua: this.getUA(),
  1480. browser: this.getBrowser(),
  1481. engine: this.getEngine(),
  1482. os: this.getOS(),
  1483. device: this.getDevice(),
  1484. cpu: this.getCPU()
  1485. }
  1486. }
  1487. ,
  1488. this.getUA = function() {
  1489. return r
  1490. }
  1491. ,
  1492. this.setUA = function(i) {
  1493. return r = i,
  1494. this
  1495. }
  1496. ,
  1497. void this.setUA(r)) : new x(e).getResult()
  1498. };
  1499. if (typeof exports !== a)
  1500. typeof module !== a && module.exports && (exports = module.exports = x),
  1501. exports.UAParser = x;
  1502. else if (i.UAParser = x,
  1503. typeof define === o && define.amd && define(function() {
  1504. return x
  1505. }),
  1506. typeof i.jQuery !== a) {
  1507. var A = i.jQuery
  1508. , _ = new x;
  1509. A.ua = _.getResult(),
  1510. A.ua.get = function() {
  1511. return _.getUA()
  1512. }
  1513. ,
  1514. A.ua.set = function(i) {
  1515. _.setUA(i);
  1516. var e = _.getResult();
  1517. for (var s in e)
  1518. A.ua[s] = e[s]
  1519. }
  1520. }
  1521. }(this);
  1522. window.Modernizr = function(n, e, t) {
  1523. function o(n) {
  1524. d.cssText = n
  1525. }
  1526. function r(n, e) {
  1527. return typeof n === e
  1528. }
  1529. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1530. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1531. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1532. return e in n && r(n.constructor.prototype[e], "undefined")
  1533. }
  1534. : function(n, e) {
  1535. return v.call(n, e)
  1536. }
  1537. ,
  1538. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1539. var e = this;
  1540. if ("function" != typeof e)
  1541. throw new TypeError;
  1542. var t = b.call(arguments, 1)
  1543. , o = function() {
  1544. if (this instanceof o) {
  1545. var r = function() {};
  1546. r.prototype = e.prototype;
  1547. var i = new r
  1548. , c = e.apply(i, t.concat(b.call(arguments)));
  1549. return Object(c) === c ? c : i
  1550. }
  1551. return e.apply(n, t.concat(b.call(arguments)))
  1552. };
  1553. return o
  1554. }
  1555. ),
  1556. y.webgl = function() {
  1557. return !!n.WebGLRenderingContext
  1558. }
  1559. ;
  1560. for (var h in y)
  1561. u(y, h) && (c = h.toLowerCase(),
  1562. f[c] = y[h](),
  1563. w.push((f[c] ? "" : "no-") + c));
  1564. return f.addTest = function(n, e) {
  1565. if ("object" == typeof n)
  1566. for (var o in n)
  1567. u(n, o) && f.addTest(o, n[o]);
  1568. else {
  1569. if (n = n.toLowerCase(),
  1570. f[n] !== t)
  1571. return f;
  1572. e = "function" == typeof e ? e() : e,
  1573. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1574. f[n] = e
  1575. }
  1576. return f
  1577. }
  1578. ,
  1579. o(""),
  1580. p = i = null,
  1581. f._version = a,
  1582. f
  1583. }(this, this.document);
  1584. !function(e, t, a) {
  1585. "use strict";
  1586. function n(t, h, m) {
  1587. function H(a) {
  1588. var n = 0
  1589. , i = Ee.length;
  1590. if (Ce.old = e.extend({}, Ce),
  1591. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1592. ke = Be[ge.horizontal ? "width" : "height"](),
  1593. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1594. Ee.length = 0,
  1595. Ce.start = 0,
  1596. Ce.end = q(ze - Ie, 0),
  1597. Re) {
  1598. n = Ne.length,
  1599. qe = Pe.children(ge.itemSelector),
  1600. Ne.length = 0;
  1601. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1602. ze = 0,
  1603. qe.each(function(t, a) {
  1604. var n = e(a)
  1605. , i = a.getBoundingClientRect()
  1606. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1607. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1608. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1609. , h = l + d + p
  1610. , m = !d || !p
  1611. , g = {};
  1612. g.el = a,
  1613. g.size = m ? l : h,
  1614. g.half = g.size / 2,
  1615. g.start = ze + (m ? d : 0),
  1616. g.center = g.start - E(Ie / 2 - g.size / 2),
  1617. g.end = g.start - Ie + g.size,
  1618. t || (ze += s),
  1619. ze += h,
  1620. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1621. t === v && (g.end += o,
  1622. ze += o,
  1623. f = m ? p : 0),
  1624. Ne.push(g),
  1625. r = g
  1626. }),
  1627. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1628. ze -= f,
  1629. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1630. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1631. }
  1632. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1633. Q(),
  1634. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1635. Te = d(Te, ge.minHandleSize, ke),
  1636. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1637. xe.end = ke - Te,
  1638. it || j()),
  1639. !we && Ie > 0) {
  1640. var p = Ce.start
  1641. , h = "";
  1642. if (Re)
  1643. e.each(Ne, function(e, t) {
  1644. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1645. Ee.push(p),
  1646. p += Ie,
  1647. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1648. });
  1649. else
  1650. for (; p - Ie < Ce.end; )
  1651. Ee.push(p),
  1652. p += Ie;
  1653. if (De[0] && i !== Ee.length) {
  1654. for (var m = 0; m < Ee.length; m++)
  1655. h += ge.pageBuilder.call(ye, m);
  1656. Ae = De.html(h).children(),
  1657. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1658. }
  1659. }
  1660. if (Oe.slideeSize = ze,
  1661. Oe.frameSize = Ie,
  1662. Oe.sbSize = ke,
  1663. Oe.handleSize = Te,
  1664. Re) {
  1665. a && null != ge.startAt && (W(ge.startAt),
  1666. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1667. var g = Ne[Oe.activeItem];
  1668. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1669. } else
  1670. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1671. pe("load")
  1672. }
  1673. function X(e, t, a) {
  1674. if (Re && at.released && !a) {
  1675. var n = $(e)
  1676. , i = e > Ce.start && e < Ce.end;
  1677. Le ? (i && (e = Ne[n.centerItem].center),
  1678. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1679. }
  1680. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1681. et.start = +new Date,
  1682. et.time = 0,
  1683. et.from = Ce.cur,
  1684. et.to = e,
  1685. et.delta = e - Ce.cur,
  1686. et.tweesing = at.tweese || at.init && !at.slidee,
  1687. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1688. at.tweese = 0,
  1689. e !== Ce.dest && (Ce.dest = e,
  1690. pe("change"),
  1691. it || Y()),
  1692. K(),
  1693. Q(),
  1694. Z(),
  1695. F()
  1696. }
  1697. function Y() {
  1698. if (ye.initialized) {
  1699. if (!it)
  1700. return it = w(Y),
  1701. void (at.released && pe("moveStart"));
  1702. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1703. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1704. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1705. et.to === Ce.cur ? (Ce.cur = et.to,
  1706. at.tweese = it = 0) : it = w(Y),
  1707. pe("move"),
  1708. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1709. !it && at.released && pe("moveEnd"),
  1710. j()
  1711. }
  1712. }
  1713. function j() {
  1714. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1715. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1716. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1717. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1718. }
  1719. function F() {
  1720. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1721. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1722. pe("activePage", _e.page))
  1723. }
  1724. function M() {
  1725. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1726. ot = at.init ? w(M) : 0,
  1727. tt.now = +new Date,
  1728. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1729. X(at.init ? tt.pos : E(tt.pos)),
  1730. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1731. tt.lastTime = tt.now
  1732. }
  1733. function L(e, t, n) {
  1734. if ("boolean" === i(t) && (n = t,
  1735. t = a),
  1736. t === a)
  1737. X(Ce[e], n);
  1738. else {
  1739. if (Le && "center" !== e)
  1740. return;
  1741. var r = ye.getPos(t);
  1742. r && X(r[e], n, !Le)
  1743. }
  1744. }
  1745. function R(e) {
  1746. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1747. }
  1748. function U(e) {
  1749. return R(l(e) && 0 > e ? e + Ne.length : e)
  1750. }
  1751. function W(e, t) {
  1752. var a = R(e);
  1753. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1754. qe.eq(a).addClass(ge.activeClass),
  1755. _e.active = Oe.activeItem = a,
  1756. Z(),
  1757. pe("active", a)),
  1758. a)
  1759. }
  1760. function $(e) {
  1761. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1762. var t = {}
  1763. , a = Me ? 0 : Ie / 2;
  1764. if (!we)
  1765. for (var n = 0, i = Ee.length; i > n; n++) {
  1766. if (e >= Ce.end || n === Ee.length - 1) {
  1767. t.activePage = Ee.length - 1;
  1768. break
  1769. }
  1770. if (e <= Ee[n] + a) {
  1771. t.activePage = n;
  1772. break
  1773. }
  1774. }
  1775. if (Re) {
  1776. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1777. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1778. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1779. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1780. s = c;
  1781. break
  1782. }
  1783. t.firstItem = l(r) ? r : 0,
  1784. t.centerItem = l(o) ? o : t.firstItem,
  1785. t.lastItem = l(s) ? s : t.centerItem
  1786. }
  1787. return t
  1788. }
  1789. function Q(t) {
  1790. e.extend(Oe, $(t))
  1791. }
  1792. function Z() {
  1793. var e = Ce.dest <= Ce.start
  1794. , t = Ce.dest >= Ce.end
  1795. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1796. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1797. Je.is("button,input") && Je.prop("disabled", e),
  1798. Ke.is("button,input") && Ke.prop("disabled", t),
  1799. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1800. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1801. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1802. Qe.is("button,input") && Qe.prop("disabled", e),
  1803. $e.is("button,input") && $e.prop("disabled", t)),
  1804. Re && null != Oe.activeItem) {
  1805. var n = 0 === Oe.activeItem
  1806. , i = Oe.activeItem >= Ne.length - 1
  1807. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1808. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1809. Ze.is("button,input") && Ze.prop("disabled", n),
  1810. Ge.is("button,input") && Ge.prop("disabled", i),
  1811. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1812. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1813. }
  1814. }
  1815. function G(e, t, a) {
  1816. if (e = U(e),
  1817. t = U(t),
  1818. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1819. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1820. var n = t > e ? e : a ? t : t - 1
  1821. , i = e > t ? e : a ? t + 1 : t
  1822. , r = e > t;
  1823. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1824. H()
  1825. }
  1826. }
  1827. function J(e, t) {
  1828. for (var a = 0, n = Ve[e].length; n > a; a++)
  1829. if (Ve[e][a] === t)
  1830. return a;
  1831. return -1
  1832. }
  1833. function K() {
  1834. at.released && !ye.isPaused && ye.resume()
  1835. }
  1836. function V(e) {
  1837. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1838. }
  1839. function _() {
  1840. at.history[0] = at.history[1],
  1841. at.history[1] = at.history[2],
  1842. at.history[2] = at.history[3],
  1843. at.history[3] = at.delta
  1844. }
  1845. function ee(e) {
  1846. at.released = 0,
  1847. at.source = e,
  1848. at.slidee = "slidee" === e
  1849. }
  1850. function te(t) {
  1851. var a = "touchstart" === t.type
  1852. , n = t.data.source
  1853. , i = "slidee" === n;
  1854. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1855. ee(n),
  1856. at.init = 0,
  1857. at.$source = e(t.target),
  1858. at.touch = a,
  1859. at.pointer = a ? t.originalEvent.touches[0] : t,
  1860. at.initX = at.pointer.pageX,
  1861. at.initY = at.pointer.pageY,
  1862. at.initPos = i ? Ce.cur : xe.cur,
  1863. at.start = +new Date,
  1864. at.time = 0,
  1865. at.path = 0,
  1866. at.delta = 0,
  1867. at.locked = 0,
  1868. at.history = [0, 0, 0, 0],
  1869. at.pathToLock = i ? a ? 30 : 10 : 0,
  1870. b.on(a ? z : I, ae),
  1871. ye.pause(1),
  1872. (i ? Pe : Se).addClass(ge.draggedClass),
  1873. pe("moveStart"),
  1874. i && (rt = setInterval(_, 10)))
  1875. }
  1876. function ae(e) {
  1877. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1878. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1879. at.pathX = at.pointer.pageX - at.initX,
  1880. at.pathY = at.pointer.pageY - at.initY,
  1881. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1882. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1883. at.released || !(at.path < 1)) {
  1884. if (!at.init) {
  1885. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1886. return ne();
  1887. at.init = 1
  1888. }
  1889. r(e),
  1890. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1891. at.$source.on(B, s)),
  1892. at.released && (ne(),
  1893. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1894. at.delta += at.swing,
  1895. at.tweese = x(at.swing) > 10)),
  1896. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1897. }
  1898. }
  1899. function ne() {
  1900. clearInterval(rt),
  1901. at.released = !0,
  1902. b.off(at.touch ? z : I, ae),
  1903. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1904. setTimeout(function() {
  1905. at.$source.off(B, s)
  1906. }),
  1907. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1908. ye.resume(1),
  1909. at.init = 0
  1910. }
  1911. function ie(t) {
  1912. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1913. }
  1914. function re() {
  1915. ye.stop(),
  1916. b.off("mouseup", re)
  1917. }
  1918. function se(e) {
  1919. switch (r(e),
  1920. this) {
  1921. case $e[0]:
  1922. case Qe[0]:
  1923. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1924. b.on("mouseup", re);
  1925. break;
  1926. case Ze[0]:
  1927. ye.prev();
  1928. break;
  1929. case Ge[0]:
  1930. ye.next();
  1931. break;
  1932. case Je[0]:
  1933. ye.prevPage();
  1934. break;
  1935. case Ke[0]:
  1936. ye.nextPage()
  1937. }
  1938. }
  1939. function oe(e) {
  1940. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1941. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1942. Re ? (p = +new Date,
  1943. nt.last < p - nt.resetTime && (nt.delta = 0),
  1944. nt.last = p,
  1945. nt.delta += nt.curDelta,
  1946. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1947. nt.delta %= 1),
  1948. nt.finalDelta) : nt.curDelta
  1949. }
  1950. function le(e) {
  1951. e.originalEvent[g] = ye;
  1952. var t = +new Date;
  1953. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1954. return void (O = t);
  1955. if (ge.scrollBy && Ce.start !== Ce.end) {
  1956. var a = oe(e.originalEvent);
  1957. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1958. ye.slideBy(ge.scrollBy * a)
  1959. }
  1960. }
  1961. function ce(e) {
  1962. ge.clickBar && e.target === Be[0] && (r(e),
  1963. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1964. }
  1965. function de(e) {
  1966. if (ge.keyboardNavBy)
  1967. switch (e.which) {
  1968. case ge.horizontal ? 37 : 38:
  1969. r(e),
  1970. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1971. break;
  1972. case ge.horizontal ? 39 : 40:
  1973. r(e),
  1974. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1975. }
  1976. }
  1977. function ue(e) {
  1978. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1979. }
  1980. function fe() {
  1981. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1982. }
  1983. function ve(e) {
  1984. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1985. }
  1986. function pe(e, t) {
  1987. if (Ve[e]) {
  1988. for (me = Ve[e].length,
  1989. T.length = 0,
  1990. he = 0; me > he; he++)
  1991. T.push(Ve[e][he]);
  1992. for (he = 0; me > he; he++)
  1993. T[he].call(ye, e, t)
  1994. }
  1995. }
  1996. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  1997. start: 0,
  1998. center: 0,
  1999. end: 0,
  2000. cur: 0,
  2001. dest: 0
  2002. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2003. start: 0,
  2004. end: 0,
  2005. cur: 0
  2006. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2007. firstItem: 0,
  2008. lastItem: 0,
  2009. centerItem: 0,
  2010. activeItem: null,
  2011. activePage: 0
  2012. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2013. released: 1
  2014. }, nt = {
  2015. last: 0,
  2016. delta: 0,
  2017. resetTime: 200
  2018. }, it = 0, rt = 0, st = 0, ot = 0;
  2019. we || (t = be[0]),
  2020. ye.initialized = 0,
  2021. ye.frame = t,
  2022. ye.slidee = Pe[0],
  2023. ye.pos = Ce,
  2024. ye.rel = Oe,
  2025. ye.items = Ne,
  2026. ye.pages = Ee,
  2027. ye.isPaused = 0,
  2028. ye.options = ge,
  2029. ye.dragging = at,
  2030. ye.reload = function() {
  2031. H()
  2032. }
  2033. ,
  2034. ye.getPos = function(e) {
  2035. if (Re) {
  2036. var t = R(e);
  2037. return -1 !== t && Ne[t]
  2038. }
  2039. var a = Pe.find(e).eq(0);
  2040. if (a[0]) {
  2041. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2042. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2043. return {
  2044. start: n,
  2045. center: n - Ie / 2 + i / 2,
  2046. end: n - Ie + i,
  2047. size: i
  2048. }
  2049. }
  2050. return !1
  2051. }
  2052. ,
  2053. ye.moveBy = function(e) {
  2054. tt.speed = e,
  2055. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2056. tt.startPos = Ce.cur,
  2057. ee("button"),
  2058. at.init = 1,
  2059. pe("moveStart"),
  2060. y(ot),
  2061. M())
  2062. }
  2063. ,
  2064. ye.stop = function() {
  2065. "button" === at.source && (at.init = 0,
  2066. at.released = 1)
  2067. }
  2068. ,
  2069. ye.prev = function() {
  2070. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2071. }
  2072. ,
  2073. ye.next = function() {
  2074. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2075. }
  2076. ,
  2077. ye.prevPage = function() {
  2078. ye.activatePage(Oe.activePage - 1)
  2079. }
  2080. ,
  2081. ye.nextPage = function() {
  2082. ye.activatePage(Oe.activePage + 1)
  2083. }
  2084. ,
  2085. ye.slideBy = function(e, t) {
  2086. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2087. }
  2088. ,
  2089. ye.slideTo = function(e, t) {
  2090. X(e, t)
  2091. }
  2092. ,
  2093. ye.toStart = function(e, t) {
  2094. L("start", e, t)
  2095. }
  2096. ,
  2097. ye.toEnd = function(e, t) {
  2098. L("end", e, t)
  2099. }
  2100. ,
  2101. ye.toCenter = function(e, t) {
  2102. L("center", e, t)
  2103. }
  2104. ,
  2105. ye.getIndex = R,
  2106. ye.activate = function(e, t) {
  2107. var a = W(e);
  2108. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2109. }
  2110. ,
  2111. ye.activatePage = function(e, t) {
  2112. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2113. }
  2114. ,
  2115. ye.resume = function(e) {
  2116. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2117. st ? st = clearTimeout(st) : pe("resume"),
  2118. st = setTimeout(function() {
  2119. switch (pe("cycle"),
  2120. ge.cycleBy) {
  2121. case "items":
  2122. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2123. break;
  2124. case "pages":
  2125. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2126. }
  2127. }, ge.cycleInterval))
  2128. }
  2129. ,
  2130. ye.pause = function(e) {
  2131. e < ye.isPaused || (ye.isPaused = e || 100,
  2132. st && (st = clearTimeout(st),
  2133. pe("pause")))
  2134. }
  2135. ,
  2136. ye.toggle = function() {
  2137. ye[st ? "pause" : "resume"]()
  2138. }
  2139. ,
  2140. ye.set = function(t, a) {
  2141. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2142. }
  2143. ,
  2144. ye.add = function(t, a) {
  2145. var n = e(t);
  2146. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2147. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2148. H()
  2149. }
  2150. ,
  2151. ye.remove = function(t) {
  2152. if (Re) {
  2153. var a = U(t);
  2154. if (a > -1) {
  2155. qe.eq(a).remove();
  2156. var n = a === Oe.activeItem;
  2157. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2158. H(),
  2159. n && (_e.active = null,
  2160. ye.activate(Oe.activeItem))
  2161. }
  2162. } else
  2163. e(t).remove(),
  2164. H()
  2165. }
  2166. ,
  2167. ye.moveAfter = function(e, t) {
  2168. G(e, t, 1)
  2169. }
  2170. ,
  2171. ye.moveBefore = function(e, t) {
  2172. G(e, t)
  2173. }
  2174. ,
  2175. ye.on = function(e, t) {
  2176. if ("object" === i(e))
  2177. for (var a in e)
  2178. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2179. else if ("function" === i(t))
  2180. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2181. Ve[n[r]] = Ve[n[r]] || [],
  2182. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2183. else if ("array" === i(t))
  2184. for (var o = 0, l = t.length; l > o; o++)
  2185. ye.on(e, t[o])
  2186. }
  2187. ,
  2188. ye.one = function(e, t) {
  2189. function a() {
  2190. t.apply(ye, arguments),
  2191. ye.off(e, a)
  2192. }
  2193. ye.on(e, a)
  2194. }
  2195. ,
  2196. ye.off = function(e, t) {
  2197. if (t instanceof Array)
  2198. for (var a = 0, n = t.length; n > a; a++)
  2199. ye.off(e, t[a]);
  2200. else
  2201. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2202. if (Ve[i[r]] = Ve[i[r]] || [],
  2203. null == t)
  2204. Ve[i[r]].length = 0;
  2205. else {
  2206. var o = J(i[r], t);
  2207. -1 !== o && Ve[i[r]].splice(o, 1)
  2208. }
  2209. }
  2210. ,
  2211. ye.destroy = function() {
  2212. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2213. b.off("keydown", de),
  2214. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2215. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2216. De.empty(),
  2217. we || (be.off("." + g),
  2218. He.restore(),
  2219. Xe.restore(),
  2220. Ye.restore(),
  2221. je.restore(),
  2222. e.removeData(t, g)),
  2223. Ne.length = Ee.length = 0,
  2224. _e = {},
  2225. ye.initialized = 0,
  2226. ye
  2227. }
  2228. ,
  2229. ye.init = function() {
  2230. if (!ye.initialized) {
  2231. ye.on(m);
  2232. var e = ["overflow", "position"]
  2233. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2234. He.save.apply(He, e),
  2235. Ye.save.apply(Ye, e),
  2236. Xe.save.apply(Xe, t),
  2237. je.save.apply(je, t);
  2238. var a = Se;
  2239. return we || (a = a.add(Pe),
  2240. be.css("overflow", "hidden"),
  2241. f || "static" !== be.css("position") || be.css("position", "relative")),
  2242. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2243. a.css({
  2244. position: "absolute"
  2245. })),
  2246. ge.forward && $e.on(S, se),
  2247. ge.backward && Qe.on(S, se),
  2248. ge.prev && Ze.on(B, se),
  2249. ge.next && Ge.on(B, se),
  2250. ge.prevPage && Je.on(B, se),
  2251. ge.nextPage && Ke.on(B, se),
  2252. Ue.on(C, le),
  2253. Be[0] && Be.on(B, ce),
  2254. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2255. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2256. We.on(P, {
  2257. source: "slidee"
  2258. }, te),
  2259. Se && Se.on(P, {
  2260. source: "handle"
  2261. }, te),
  2262. b.on("keydown", de),
  2263. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2264. be.on("scroll." + g, o)),
  2265. ye.initialized = 1,
  2266. H(!0),
  2267. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2268. ye
  2269. }
  2270. }
  2271. }
  2272. function i(e) {
  2273. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2274. }
  2275. function r(e, t) {
  2276. e.preventDefault(),
  2277. t && e.stopPropagation()
  2278. }
  2279. function s(t) {
  2280. r(t, 1),
  2281. e(this).off(t.type, s)
  2282. }
  2283. function o() {
  2284. this.scrollLeft = 0,
  2285. this.scrollTop = 0
  2286. }
  2287. function l(e) {
  2288. return !isNaN(parseFloat(e)) && isFinite(e)
  2289. }
  2290. function c(e, t) {
  2291. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2292. }
  2293. function d(e, t, a) {
  2294. return t > e ? t : e > a ? a : e
  2295. }
  2296. function u(e) {
  2297. var t = {};
  2298. return t.style = {},
  2299. t.save = function() {
  2300. if (e && e.nodeType) {
  2301. for (var a = 0; a < arguments.length; a++)
  2302. t.style[arguments[a]] = e.style[arguments[a]];
  2303. return t
  2304. }
  2305. }
  2306. ,
  2307. t.restore = function() {
  2308. if (e && e.nodeType) {
  2309. for (var a in t.style)
  2310. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2311. return t
  2312. }
  2313. }
  2314. ,
  2315. t
  2316. }
  2317. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2318. b.on(C, function(e) {
  2319. var t = e.originalEvent[g]
  2320. , a = +new Date;
  2321. (!t || t.options.scrollHijack < a - O) && (O = a)
  2322. }),
  2323. function(e) {
  2324. function t(e) {
  2325. var t = (new Date).getTime()
  2326. , n = Math.max(0, 16 - (t - a))
  2327. , i = setTimeout(e, n);
  2328. return a = t,
  2329. i
  2330. }
  2331. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2332. var a = (new Date).getTime()
  2333. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2334. y = function(t) {
  2335. n.call(e, t)
  2336. }
  2337. }(window),
  2338. function() {
  2339. function e(e) {
  2340. for (var n = 0, i = t.length; i > n; n++) {
  2341. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2342. if (null != a.style[r])
  2343. return r
  2344. }
  2345. }
  2346. var t = ["", "webkit", "moz", "ms", "o"]
  2347. , a = document.createElement("div");
  2348. f = e("transform"),
  2349. v = e("perspective") ? "translateZ(0) " : ""
  2350. }(),
  2351. t[m] = n,
  2352. e.fn[h] = function(t, a) {
  2353. var r, s;
  2354. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2355. s = Array.prototype.slice.call(arguments, 1)),
  2356. t = {}),
  2357. this.each(function(i, o) {
  2358. var l = e.data(o, g);
  2359. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2360. })
  2361. }
  2362. ,
  2363. n.defaults = {
  2364. slidee: null,
  2365. horizontal: !1,
  2366. itemNav: null,
  2367. itemSelector: null,
  2368. smart: !1,
  2369. activateOn: null,
  2370. activateMiddle: !1,
  2371. scrollSource: null,
  2372. scrollBy: 0,
  2373. scrollHijack: 300,
  2374. scrollTrap: !1,
  2375. dragSource: null,
  2376. mouseDragging: !1,
  2377. touchDragging: !1,
  2378. releaseSwing: !1,
  2379. swingSpeed: .2,
  2380. elasticBounds: !1,
  2381. interactive: null,
  2382. scrollBar: null,
  2383. dragHandle: !1,
  2384. dynamicHandle: !1,
  2385. minHandleSize: 50,
  2386. clickBar: !1,
  2387. syncSpeed: .5,
  2388. pagesBar: null,
  2389. activatePageOn: null,
  2390. pageBuilder: function(e) {
  2391. return "<li>" + (e + 1) + "</li>"
  2392. },
  2393. forward: null,
  2394. backward: null,
  2395. prev: null,
  2396. next: null,
  2397. prevPage: null,
  2398. nextPage: null,
  2399. cycleBy: null,
  2400. cycleInterval: 5e3,
  2401. pauseOnHover: !1,
  2402. startPaused: !1,
  2403. moveBy: 300,
  2404. speed: 0,
  2405. easing: "swing",
  2406. startAt: null,
  2407. keyboardNavBy: null,
  2408. draggedClass: "dragged",
  2409. activeClass: "active",
  2410. disabledClass: "disabled"
  2411. }
  2412. }(jQuery, window);
  2413. !function e(t, i, n) {
  2414. function r(a, s) {
  2415. if (!i[a]) {
  2416. if (!t[a]) {
  2417. var l = "function" == typeof require && require;
  2418. if (!s && l)
  2419. return l(a, !0);
  2420. if (o)
  2421. return o(a, !0);
  2422. var c = new Error("Cannot find module '" + a + "'");
  2423. throw c.code = "MODULE_NOT_FOUND",
  2424. c
  2425. }
  2426. var h = i[a] = {
  2427. exports: {}
  2428. };
  2429. t[a][0].call(h.exports, function(e) {
  2430. var i = t[a][1][e];
  2431. return r(i ? i : e)
  2432. }, h, h.exports, e, t, i, n)
  2433. }
  2434. return i[a].exports
  2435. }
  2436. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2437. r(n[a]);
  2438. return r
  2439. }({
  2440. 1: [function(e, t, i) {///js/DisplayController.js
  2441. (function(i) {
  2442. "use strict";
  2443. function n(e) {
  2444. this.player = null,
  2445. this.director = null,
  2446. this.modelManager = null,
  2447. this.container = null,
  2448. this.tagManager = null,
  2449. this.fadeInSpeed = e,
  2450. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2451. }
  2452. var r = e("three")
  2453. , o = e("./util/logger")
  2454. , a = (e("./util/common"),
  2455. e("./enum/PlayerEvents"))
  2456. , s = e("./enum/DirectorEvents")
  2457. , l = e("./settings")
  2458. , c = e("./enum/Viewmode")
  2459. , h = (e("./enum/WarpStyle"),
  2460. e("./enum/BlackoutStyle"),
  2461. e("./enum/ModelManagerEvents"))
  2462. , u = e("./enum/tagEvents")
  2463. , d = e("./util/transitions")
  2464. , p = e("./util/lerp")
  2465. , f = new o(i);
  2466. n.prototype.init = function(e, t, i, n, r) {
  2467. this.player = t,
  2468. this.director = e,
  2469. this.modelManager = i,
  2470. this.tagManager = n,
  2471. this.container = r,
  2472. this.updateModel(),
  2473. this.bindEvents()
  2474. }
  2475. ,
  2476. n.prototype.bindEvents = function() {
  2477. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2478. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2479. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2480. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2481. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2482. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2483. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2484. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2485. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2486. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2487. }
  2488. ,
  2489. n.prototype.updateModel = function() {
  2490. this.model = this.modelManager.getActiveModel()
  2491. }
  2492. ,
  2493. n.prototype.handleWarpStarted = function() {
  2494. this.hidePlayerReticule()
  2495. }
  2496. ,
  2497. n.prototype.ontagActivated = function() {
  2498. this.hidePlayerReticule()
  2499. }
  2500. ,
  2501. n.prototype.onNavigationTotag = function() {
  2502. this.hidePlayerReticule()
  2503. }
  2504. ,
  2505. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2506. var n = this.modelManager.getActiveModel()
  2507. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2508. //n.fadePanoMarkers(r),//MP
  2509. n.fadePanoMarkers(r,null,{player:this.player}),//xzw改
  2510. n.setMode(t)
  2511. }
  2512. ,
  2513. n.prototype.handlePlayerModeChanged = function(e, t) {
  2514. var i = this.modelManager.getActiveModel()
  2515. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2516. i.setSide(n),
  2517. i.setMode(t)
  2518. }
  2519. ,
  2520. /* n.prototype.handleClosestPanoChanging = function(e, t, i) {//MP
  2521. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2522. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2523. }
  2524. ,*/
  2525. n.prototype.handleClosestPanoChanging = function(e, t, player, posget1,posget2) {//xzw 改 e是closestPano,t是新的closestPano
  2526. if(player.mode !== h.TRANSITIONING) {
  2527. if(e && player.currentPano && !this.director.tourIsPlaying ){
  2528. var off;
  2529. if(posget1){
  2530. off = player.disablePanos.indexOf(e)==-1;
  2531. }else if(posget2){
  2532. off = player.posGets.list.indexOf(e.id)>-1;
  2533. }else{
  2534. off = player.currentPano.seeMarkers.indexOf(e.id)>-1
  2535. }
  2536. if(off)e.hoverOff(player.mode);
  2537. }
  2538. t && !this.director.tourIsPlaying && player.currentPano && (posget1 ? 1 : player.currentPano.seeMarkers.indexOf(t.id)>-1) && t.hoverOn(player.mode);
  2539. }
  2540. }
  2541. ,
  2542. n.prototype.handleActionInterruption = function() {}
  2543. ,
  2544. n.prototype.handleStartInside = function(e) {
  2545. var t = l[this.player.mode]
  2546. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2547. this.fadeIn(this.fadeInSpeed),
  2548. this.model.alpha = 0,
  2549. this.model.skybox.material.uniforms.opacity.value = 1,
  2550. //this.model.fadePanoMarkers(e ? 0 : t.markerOpacity); //MP
  2551. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity,null,{player:this.player}); //xzw改
  2552. var n = this.player.reticule;
  2553. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2554. }
  2555. ,
  2556. n.prototype.handleStartOutside = function(e) {
  2557. this.fadeIn(e)
  2558. }
  2559. ,
  2560. n.prototype.fadeIn = function(e) {
  2561. null !== e && void 0 !== e || (e = 2e3,
  2562. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2563. $(this.container).fadeIn(e)
  2564. }
  2565. ,
  2566. n.prototype.hidePlayerReticule = function() {
  2567. this.player.reticule.hide()
  2568. }
  2569. ,
  2570. t.exports = n
  2571. }
  2572. ).call(this, "/js/DisplayController.js")
  2573. }
  2574. , {
  2575. "./enum/BlackoutStyle": 18,
  2576. "./enum/DirectorEvents": 23,
  2577. "./enum/tagEvents": 32,
  2578. "./enum/ModelManagerEvents": 33,
  2579. "./enum/PlayerEvents": 40,
  2580. "./enum/Viewmode": 51,
  2581. "./enum/WarpStyle": 52,
  2582. "./settings": 166,
  2583. "./util/common": 185,
  2584. "./util/lerp": 188,
  2585. "./util/logger": 189,
  2586. "./util/transitions": 195,
  2587. three: 217
  2588. }],
  2589. 2: [function(e, t, i) {//"./TimingData"
  2590. "use strict";
  2591. function n() {
  2592. this.baseStartTime = performance.timing.navigationStart,
  2593. this.loadingStartTime = null,
  2594. this.waitingStartTime = null,
  2595. this.appReadyTime = null
  2596. }
  2597. n.prototype.setBaseStartTime = function(e) {
  2598. this.baseStartTime = e || Date.now()
  2599. }
  2600. ,
  2601. n.prototype.setWaitingStartTime = function(e) {
  2602. this.waitingStartTime = e || Date.now()
  2603. }
  2604. ,
  2605. n.prototype.setLoadingStartTime = function(e) {
  2606. this.loadingStartTime = e || Date.now()
  2607. }
  2608. ,
  2609. n.prototype.setAppReadyTime = function(e) {
  2610. this.appReadyTime = e || Date.now()
  2611. }
  2612. ,
  2613. n.prototype.calcFullLoadingTime = function() {
  2614. var e = this.appReadyTime - this.baseStartTime;
  2615. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2616. e
  2617. }
  2618. ,
  2619. t.exports = n
  2620. }
  2621. , {}],
  2622. 3: [function(e, t, i) {///js/ab.js
  2623. (function(i) {
  2624. "use strict";
  2625. function n() {
  2626. return 100 * Math.random()
  2627. }
  2628. var r = e("./util/logger")
  2629. , o = e("./util/browser")
  2630. , a = new r(i)
  2631. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2632. initialized: !1,
  2633. init: function(e, t) {
  2634. if (t = t || {},
  2635. !this.initialized) {
  2636. this.initialized = !0,
  2637. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2638. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2639. for (var i in e) {
  2640. var r = i.match("^sc_tilegen_([0-9]+)$");
  2641. r && (s.tilegen = n() < parseInt(r[1]));
  2642. var l = i.match("^sc_imgopt_([0-9]+)$");
  2643. l && (s.imgopt = n() < parseInt(l[1]))
  2644. }
  2645. for (var c in t)
  2646. s[c] = t[c],
  2647. a.debug("A/B override:", c, s[c])
  2648. }
  2649. },
  2650. changeIfTileGenerating: function(e) {
  2651. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2652. e += "imgopt=1"),
  2653. e
  2654. },
  2655. changeIfImageOptimzing: function(e) {
  2656. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2657. e += "imgopt=1"),
  2658. e
  2659. },
  2660. tilegen: !1,
  2661. imgopt: !1
  2662. };
  2663. t.exports = s
  2664. }
  2665. ).call(this, "/js/ab.js")
  2666. }
  2667. , {
  2668. "./util/browser": 182,
  2669. "./util/logger": 189
  2670. }],
  2671. 4: [function(e, t, i) {///js/analytics.js
  2672. (function(i) {
  2673. "use strict";
  2674. function n() {
  2675. return {
  2676. addons: [{
  2677. name: "keen:ua_parser",
  2678. input: {
  2679. ua_string: "user_agent"
  2680. },
  2681. output: "parsed_user_agent"
  2682. }]
  2683. }
  2684. }
  2685. function r(e, t, i, n) {
  2686. function r(t) {
  2687. l[t.sid] = !0;
  2688. var i = t.billboard.media && t.billboard.media.type
  2689. , n = {
  2690. tag_id: t.sid,
  2691. tags_visited: Object.keys(l).length,
  2692. tag_count: Object.keys(e.tags).length,
  2693. tag_view_count: ++E,
  2694. has_media: !!i
  2695. };
  2696. i && (n.media_type = i),
  2697. u("tag_opened", n)
  2698. }
  2699. var l = {}
  2700. , h = Date.now() - N
  2701. , f = null;
  2702. n && (f = Date.now() - window.navigationStart);
  2703. var g;
  2704. try {
  2705. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2706. } catch (e) {
  2707. g = !1
  2708. }
  2709. var v, A = e.supportsVR;
  2710. A || (v = "VR disabled at the model/account level",
  2711. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2712. u("model_loaded", {
  2713. duration: h,
  2714. duration_from_navigation_start: f,
  2715. has_hlr: g,
  2716. has_vr: A,
  2717. vr_reason: v
  2718. });
  2719. var I = 0;
  2720. e.panos.forEach(function(e) {
  2721. e.on("enter", function() {
  2722. c("pano_viewed", {
  2723. pano_id: e.id,
  2724. pano_view_count: ++I,
  2725. alignment_type: e.alignmentType,
  2726. interaction_source: O,
  2727. navigation_source: p
  2728. })
  2729. })
  2730. });
  2731. var E = 0;
  2732. for (var T in e.tags)
  2733. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2734. t.on("tour_auto", function(e) {
  2735. p = "tour_" + e
  2736. }),
  2737. t.on("tour_manual", function(e) {
  2738. O = "gui-" + e,
  2739. p = "tour_manual"
  2740. }),
  2741. i.on(C.InteractionKey, function() {
  2742. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2743. }),
  2744. i.on(C.InteractionDirect, function() {
  2745. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2746. }),
  2747. o(t),
  2748. a(),
  2749. s()
  2750. }
  2751. function o(e) {
  2752. I.on(T.OPENED, function() {
  2753. c("showcase_share_intent", {
  2754. pano_id: e.currentPano && e.currentPano.id
  2755. })
  2756. }),
  2757. I.on(T.LINK_CLICKED, function(t) {
  2758. c("showcase_share_action", {
  2759. channel: t.channel,
  2760. pano_id: e.currentPano && e.currentPano.id
  2761. })
  2762. }),
  2763. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2764. c("showcase_share_origin_link_clicked")
  2765. })
  2766. }
  2767. function a() {}
  2768. function s() {
  2769. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2770. gui_action: "click_vr_button"
  2771. })),
  2772. b.on(S.LAUNCH, function(e) {
  2773. c("showcase_gui", {
  2774. gui_action: "launch_vr",
  2775. vr_platform: e.vr_platform,
  2776. vr_app: e.vr_app
  2777. })
  2778. }),
  2779. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2780. gui_action: "vr_modal_prev"
  2781. })),
  2782. b.on(S.NEXT, function(e) {
  2783. c("showcase_gui", {
  2784. gui_action: e.nextAction
  2785. })
  2786. }),
  2787. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2788. gui_action: "vr_modal_close"
  2789. })),
  2790. b.on(S.falseICECHOSEN, function(e) {
  2791. c("showcase_gui", {
  2792. gui_action: e.name + " "
  2793. })
  2794. }),
  2795. b.on(S.STORE, function(e) {
  2796. c("showcase_gui", {
  2797. gui_action: "launch_store",
  2798. store: e
  2799. })
  2800. })
  2801. }
  2802. function l(e, t) {
  2803. if (f)
  2804. try {
  2805. f.addEvent(e, v.extendObject({
  2806. host: window.location.host,
  2807. keen: n(),
  2808. user_agent: "${keen.user_agent}",
  2809. referrer: {
  2810. url: v.normalizeUrl(document.referrer),
  2811. domain: v.domainFromUrl(document.referrer),
  2812. url_original: document.referrer
  2813. },
  2814. embedded: m.inIframe(),
  2815. is_mobile: m.isMobile(),
  2816. version: "2.25.6-0-gd87e5b1"
  2817. }, t))
  2818. } catch (e) {
  2819. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2820. }
  2821. }
  2822. function c(e, t) {
  2823. if (t = t || {},
  2824. L)
  2825. try {
  2826. window.analytics.track(e, v.extendObject(t, B), {
  2827. context: {
  2828. app: {
  2829. name: "showcase",
  2830. version: "2.25.6-0-gd87e5b1"
  2831. },
  2832. screen: {
  2833. width: window.screen.width,
  2834. height: window.screen.height,
  2835. density: window.devicePixelRatio
  2836. }
  2837. }
  2838. })
  2839. } catch (t) {
  2840. console.warn("Failed to send data to segment for " + e)
  2841. }
  2842. }
  2843. function h(e, t) {
  2844. if (t = t || {},
  2845. navigator.sendBeacon && L)
  2846. try {
  2847. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2848. event: e,
  2849. anonymousId: window.analytics.user().anonymousId(),
  2850. properties: v.extendObject(t, B),
  2851. writeKey: L,
  2852. sentAt: Date.now(),
  2853. type: "track",
  2854. context: {
  2855. userAgent: m.userAgent(),
  2856. library: {
  2857. name: "showcase-beacon",
  2858. version: "2.25.6-0-gd87e5b1"
  2859. },
  2860. app: {
  2861. name: "showcase",
  2862. version: "2.25.6-0-gd87e5b1"
  2863. }
  2864. }
  2865. }))
  2866. } catch (e) {
  2867. console.warn("Failed to send async segment request")
  2868. }
  2869. }
  2870. function u(e, t) {
  2871. t = t || {},
  2872. c(e, t)
  2873. }
  2874. function d(e, t) {
  2875. O = e === C.InteractionGui ? "gui-" + t : e,
  2876. p = "self_guided"
  2877. }
  2878. var p, f, g = (e("three"),
  2879. e("./util/ajax"),
  2880. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2881. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2882. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2883. t.exports = {
  2884. report: function(e, t, i, n) {
  2885. l("Session starts", {
  2886. model: e,
  2887. status: t,
  2888. loadtime: Date.now() - (N || Date.now()),
  2889. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2890. autoplay: i,
  2891. quickstart: n,
  2892. ab_tilegen: g.tilegen,
  2893. ab_imgopt: g.imgopt
  2894. })
  2895. },
  2896. impression: function(e) {
  2897. e = e || {};
  2898. var t = void 0 === e.isVisible || e.isVisible
  2899. , i = (void 0 !== e.immediate && e.immediate,
  2900. window.location.search.substr(1).split("&"));
  2901. u("impression", {
  2902. visible: t,
  2903. url_params: i
  2904. })
  2905. },
  2906. initKeen: function(e) {
  2907. return e.token && e.appId ? void (f = new Keen({
  2908. projectId: e.appId,
  2909. writeKey: e.token,
  2910. readKey: "",
  2911. requestType: "xhr"
  2912. })) : void P.warn("no keen token/appId")
  2913. },
  2914. initSegment: function(e) {
  2915. return e.token ? (L = e.token,
  2916. window.analytics.load(e.token),
  2917. B = {
  2918. model_id: e.model,
  2919. start_source: e.startSource,
  2920. autoplay: e.autoplay,
  2921. quickstart: e.quickstart,
  2922. language_tag: A.languageTag,
  2923. is_mobile: m.isMobile(),
  2924. iframe: m.inIframe(),
  2925. aspect_ratio: m.aspectRatio(),
  2926. session_id: F,
  2927. window: {
  2928. width: $('#player').width(),
  2929. height: $('#player').height()
  2930. },
  2931. platform: {
  2932. browser: {
  2933. name: $.ua.browser.name,
  2934. major: $.ua.browser.major,
  2935. version: $.ua.browser.version
  2936. },
  2937. os: {
  2938. name: $.ua.os.name,
  2939. version: $.ua.os.version
  2940. },
  2941. device: {
  2942. vendor: $.ua.device.vendor,
  2943. model: $.ua.device.model,
  2944. type: $.ua.device.type
  2945. }
  2946. }
  2947. },
  2948. D = Math.random() < A.analytics.sessionTrackingRate,
  2949. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2950. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2951. },
  2952. sessionStart: function(e) {
  2953. P.debug("analytics user_session_start"),
  2954. c("session_started"),
  2955. N = Date.now(),
  2956. window.addEventListener("unload", function() {
  2957. h("session_ended", {
  2958. duration: Date.now() - N
  2959. })
  2960. })
  2961. },
  2962. modelLoaded: function(e, t, i, n) {
  2963. r(e, t, i, n)
  2964. },
  2965. loadComplete: function(e) {
  2966. var t = {
  2967. time_to_app_start: e
  2968. };
  2969. c("load_times", t)
  2970. },
  2971. track: function(e, t) {
  2972. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2973. c(e, t))
  2974. },
  2975. trackAlways: function(e, t) {
  2976. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2977. c(e, t)
  2978. },
  2979. getSessionId: function() {
  2980. return F
  2981. },
  2982. updateInteraction: d
  2983. }
  2984. }
  2985. ).call(this, "/js/analytics.js")
  2986. }
  2987. , {
  2988. "./ab": 3,
  2989. "./enum/ControlEvents": 21,
  2990. "./enum/PlayerEvents": 40,
  2991. "./enum/VROption": 47,
  2992. "./enum/VRPlatforms": 49,
  2993. "./enum/Viewmode": 51,
  2994. "./gui/sharing/ShareEvents": 76,
  2995. "./gui/sharing/modal": 77,
  2996. "./gui/title/TitleEvents": 80,
  2997. "./gui/title/titleBar": 82,
  2998. "./gui/vr/vrEvent": 85,
  2999. "./gui/vr/vrModal": 87,
  3000. "./localization/localize": 108,
  3001. "./tag/Billboard/BillboardEvent": 120,
  3002. "./settings": 166,
  3003. "./util/ajax": 181,
  3004. "./util/browser": 182,
  3005. "./util/common": 185,
  3006. "./util/logger": 189,
  3007. three: 217
  3008. }],
  3009. 5: [function(e, t, i) {//"../cameras/DollhouseCamera"
  3010. "use strict";
  3011. function n() {
  3012. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $('#player').width() / $('#player').height(), o.dollhouseNear, o.dollhouseFar),
  3013. this.controls = null
  3014. }
  3015. var r = e("three")
  3016. , o = e("../constants")
  3017. , a = e("../util/cameraLight");
  3018. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3019. n.prototype.updateAspect = function(e) {
  3020. this.aspect = e,
  3021. this.updateProjectionMatrix()
  3022. }
  3023. ,
  3024. t.exports = n
  3025. }
  3026. , {
  3027. "../constants": 8,
  3028. "../util/cameraLight": 184,
  3029. three: 217
  3030. }],
  3031. 6: [function(e, t, i) {//"../cameras/FloorplanCamera"
  3032. "use strict";
  3033. function n() {
  3034. var e = $('#player').width() / $('#player').height();
  3035. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3036. this.controls = null,
  3037. this.updateAspect(e)
  3038. }
  3039. var r = e("three")
  3040. , o = e("../constants");
  3041. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3042. n.prototype.updateAspect = function(e) {
  3043. this.aspect = e,
  3044. this.top = o.orthoBase / e,
  3045. this.bottom = -o.orthoBase / e,
  3046. this.updateProjectionMatrix()
  3047. }
  3048. ,
  3049. t.exports = n
  3050. }
  3051. , {
  3052. "../constants": 8,
  3053. three: 217
  3054. }],
  3055. 7: [function(e, t, i) {//"./cameras/PanoramaCamera"
  3056. "use strict";
  3057. function n() {
  3058. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $('#player').width() / $('#player').height(), o.insideNear, o.insideFar),
  3059. this.controls = null
  3060. }
  3061. var r = e("three")
  3062. , o = e("../settings")
  3063. , a = e("../util/cameraLight");
  3064. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3065. n.prototype.updateAspect = function(e) {
  3066. this.aspect = e,
  3067. this.updateProjectionMatrix()
  3068. }
  3069. ,
  3070. t.exports = n
  3071. }
  3072. , {
  3073. "../settings": 166,
  3074. "../util/cameraLight": 184,
  3075. three: 217
  3076. }],
  3077. 8: [function(e, t, i) {//"../../constants"
  3078. "use strict";
  3079. t.exports = {
  3080. signedUrlDefaultExpireTime: 24e4,
  3081. signedUrlCheckInterval: 1e4,
  3082. signedUrlRefreshBuffer: 15e3,
  3083. dollhouseFOV: 70,
  3084. dollhouseNear: 1,
  3085. dollhouseFar: 5e3,
  3086. insideFOV: 70,
  3087. insideFOVMax: 120,
  3088. insideNear: .1,
  3089. insideFar: 5e3,
  3090. insideLookSpeed: .12,
  3091. insideLookLimitUp: 40,
  3092. insideLookLimitDown: -40,
  3093. orthoNear: 1,
  3094. orthoFar: 5e3,
  3095. orthoBase: 10,
  3096. narrowLandscapeHeight: 290,
  3097. reallyNarrowLandscapeHeight: 250,
  3098. visionTilingStartDate: new Date("8/26/2016"),
  3099. visionTilingStartVersion: "1.1.407.13667",
  3100. windowHeightHighQualityThreshold: 900,
  3101. tourStepDelayDefault: 3500,
  3102. tourStepDelaySlideShow: 5e3,
  3103. workshopApsect: 9 / 16,
  3104. highQualityMaxZoom: 2,
  3105. ultraHighQualityMaxZoom: 3
  3106. }
  3107. }
  3108. , {}],
  3109. 9: [function(e, t, i) {//"./controls/CameraControls"
  3110. "use strict";
  3111. function n() {
  3112. this.activeControl = null,
  3113. this.controls = {},
  3114. this.cameras = {}
  3115. }
  3116. var r = e("./PanoramaControls")
  3117. , o = e("./DollhouseControls")
  3118. , a = e("./FloorplanControls")
  3119. , s = e("../cameras/PanoramaCamera")
  3120. , l = e("../cameras/DollhouseCamera")
  3121. , c = e("../cameras/FloorplanCamera")
  3122. , h = e("events").EventEmitter
  3123. , u = e("../enum/ControlEvents")
  3124. , d = e("../enum/ModelManagerEvents")
  3125. , p = e("../enum/Viewmode")
  3126. , f = e("../settings");
  3127. n.prototype = Object.create(h.prototype),
  3128. n.prototype.init = function(e, t) {
  3129. this.setUpControls(),
  3130. this.bindEvents(e, t)
  3131. }
  3132. ,
  3133. n.prototype.activateControls = function(e) {
  3134. this.activeControl && (this.activeControl.reset(),
  3135. this.activeControl.enabled = !1),
  3136. this.controls[e] && (this.controls[e].enabled = !0),
  3137. this.activeControl = this.controls[e]
  3138. }
  3139. ,
  3140. n.prototype.setUpControls = function() {
  3141. var e = {}
  3142. , t = {}
  3143. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3144. , n = [s, l, c]
  3145. , h = [r, o, a];
  3146. i.forEach(function(i, r) {
  3147. e[i] = new n[r],
  3148. t[i] = new h[r](e[i]),
  3149. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3150. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3151. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3152. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3153. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3154. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3155. }
  3156. .bind(this)),
  3157. this.controls = t,
  3158. this.cameras = e
  3159. }
  3160. ,
  3161. n.prototype.bindEvents = function(e, t) {
  3162. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3163. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3164. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3165. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3166. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3167. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3168. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3169. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3170. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3171. e.addEventListener("contextmenu", function(e) {
  3172. e.preventDefault()
  3173. }),
  3174. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3175. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3176. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3177. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3178. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3179. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3180. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3181. t.on(d.ActiveModelChanged, function(e) {
  3182. this.setModelForControls(e.model)
  3183. }
  3184. .bind(this))
  3185. }
  3186. ,
  3187. n.prototype.setModelForControls = function(e) {
  3188. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3189. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3190. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3191. this.controls[e].setBounds(t)
  3192. }
  3193. .bind(this))
  3194. }
  3195. ,
  3196. n.prototype.onMouseDown = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && this.activeControl.onMouseDown(e)
  3199. }
  3200. ,
  3201. n.prototype.onMouseMove = function(e) {
  3202. e.preventDefault(),
  3203. this.activeControl && this.activeControl.onMouseMove(e)
  3204. }
  3205. ,
  3206. n.prototype.onMouseUp = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onMouseUp(e)
  3209. }
  3210. ,
  3211. n.prototype.onMouseOver = function(e) {
  3212. e.preventDefault(),
  3213. this.activeControl && this.activeControl.onMouseOver(e)
  3214. }
  3215. ,
  3216. n.prototype.onMouseWheel = function(e) {
  3217. e.preventDefault(),
  3218. this.activeControl && this.activeControl.onMouseWheel(e)
  3219. }
  3220. ,
  3221. n.prototype.onTouchStart = function(e) {
  3222. e.preventDefault(),
  3223. this.activeControl && this.activeControl.onTouchStart(e)
  3224. }
  3225. ,
  3226. n.prototype.onTouchMove = function(e) {
  3227. e.preventDefault(),
  3228. this.activeControl && this.activeControl.onTouchMove(e)
  3229. }
  3230. ,
  3231. n.prototype.onTouchEnd = function(e) {
  3232. e.preventDefault(),
  3233. this.activeControl && this.activeControl.onTouchEnd(e)
  3234. }
  3235. ,
  3236. n.prototype.onPointerDown = function(e) {
  3237. if (e.preventDefault(),
  3238. this.activeControl)
  3239. switch (e.pointerType) {
  3240. case "mouse":
  3241. this.activeControl.onMouseDown(e);
  3242. break;
  3243. default:
  3244. this.activeControl.onPointerDown(e)
  3245. }
  3246. }
  3247. ,
  3248. n.prototype.onPointerMove = function(e) {
  3249. if (e.preventDefault(),
  3250. this.activeControl)
  3251. switch (e.pointerType) {
  3252. case "mouse":
  3253. this.activeControl.onMouseMove(e);
  3254. break;
  3255. default:
  3256. this.activeControl.onPointerMove(e)
  3257. }
  3258. }
  3259. ,
  3260. n.prototype.onPointerUp = function(e) {
  3261. if (e.preventDefault(),
  3262. this.activeControl)
  3263. switch (e.pointerType) {
  3264. case "mouse":
  3265. this.activeControl.onMouseUp(e);
  3266. break;
  3267. default:
  3268. this.activeControl.onPointerUp(e)
  3269. }
  3270. }
  3271. ,
  3272. n.prototype.onPointerCancel = function(e) {
  3273. e.preventDefault(),
  3274. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3275. }
  3276. ,
  3277. n.prototype.onKeyDown = function(e) {
  3278. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3279. this.activeControl && this.activeControl.onKeyDown(e))
  3280. }
  3281. ,
  3282. n.prototype.onKeyUp = function(e) {
  3283. e.preventDefault(),
  3284. this.activeControl && this.activeControl.onKeyUp(e)
  3285. }
  3286. ,
  3287. t.exports = n
  3288. }
  3289. , {
  3290. "../cameras/DollhouseCamera": 5,
  3291. "../cameras/FloorplanCamera": 6,
  3292. "../cameras/PanoramaCamera": 7,
  3293. "../enum/ControlEvents": 21,
  3294. "../enum/ModelManagerEvents": 33,
  3295. "../enum/Viewmode": 51,
  3296. "../settings": 166,
  3297. "./DollhouseControls": 10,
  3298. "./FloorplanControls": 11,
  3299. "./PanoramaControls": 13,
  3300. events: 202
  3301. }],
  3302. 10: [function(e, t, i) {//"./DollhouseControls"
  3303. "use strict";
  3304. function n(e) {
  3305. a.call(this, e),
  3306. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3307. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3308. this.minDistance = o.dollhouseDefault.minDistance,
  3309. this.maxDistance = o.dollhouseDefault.maxDistance,
  3310. this.adjustedMinDistance = this.minDistance,
  3311. this.adjustedMaxDistance = this.maxDistance
  3312. }
  3313. var r = e("three")
  3314. , o = e("../settings")
  3315. , a = e("./OutsideControls");
  3316. n.prototype = Object.create(a.prototype),
  3317. n.prototype.pan = function(e, t) {
  3318. this.camera.updateMatrix();
  3319. var i = this.camera.position.clone().sub(this.target).length();
  3320. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3321. this.panLeft(2 * e * i / window.innerHeight),
  3322. this.panUp(-2 * t * i / window.innerHeight)
  3323. }
  3324. ,
  3325. n.prototype.updateZoom = function() {
  3326. var e = this.offset.length();
  3327. return e * this.scale
  3328. }
  3329. ,
  3330. n.prototype.setZoomBounds = function(e) {
  3331. var t = e.min.distanceTo(e.max);
  3332. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3333. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3334. this.minDistance = this.adjustedMinDistance,
  3335. this.maxDistance = this.adjustedMaxDistance
  3336. }
  3337. ,
  3338. n.prototype.resetRanges = function(e, t) {
  3339. e ? (this.minDistance = Math.min(e, this.minDistance),
  3340. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3341. this.maxDistance = this.adjustedMaxDistance),
  3342. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3343. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3344. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3345. }
  3346. ,
  3347. n.prototype.toJSON = function() {
  3348. return a.prototype.toJSON.call(this)
  3349. }
  3350. ,
  3351. t.exports = n
  3352. }
  3353. , {
  3354. "../settings": 166,
  3355. "./OutsideControls": 12,
  3356. three: 217
  3357. }],
  3358. 11: [function(e, t, i) {//"./FloorplanControls"
  3359. "use strict";
  3360. function n(e) {
  3361. a.call(this, e),
  3362. this.minDistance = 15,
  3363. this.maxDistance = 50,
  3364. this.noRotateUpDown = !0,
  3365. this.minPolarAngle = 0,
  3366. this.maxPolarAngle = 0,
  3367. this.mouseActions[l.LEFT] = s.PAN,
  3368. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3369. this.mouseActions[l.RIGHT] = s.ROTATE,
  3370. this.touchActions[1] = s.PAN,
  3371. this.touchActions[2] = s.ROTATE_DOLLY,
  3372. this.absoluteScale = 1,
  3373. this.currentScale = 1
  3374. }
  3375. var r = e("three")
  3376. , o = e("../settings")
  3377. , a = e("./OutsideControls")
  3378. , s = e("../enum/ControlActions")
  3379. , l = e("../enum/MouseButton")
  3380. , c = e("../util/math")
  3381. , h = e("../util/browser");
  3382. n.prototype = Object.create(a.prototype),
  3383. n.prototype.zoomToContain = function(e) {
  3384. var t = Math.max(e.x, e.z)
  3385. , i = Math.min(e.x, e.z)
  3386. , n = Math.max(t, i * this.camera.aspect)
  3387. , r = Math.max(i, t * this.camera.aspect);
  3388. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3389. this.currentScale = this.absoluteScale
  3390. }
  3391. ,
  3392. n.prototype.rotateToView = function(e, t) {
  3393. var i = 0
  3394. , n = h.aspectRatio() < 1
  3395. , r = e.x < e.z;
  3396. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3397. this.rotateLeft(i),
  3398. this.update(0)
  3399. }
  3400. ,
  3401. n.prototype.pan = function(e, t) {
  3402. this.camera.updateMatrix(),
  3403. this.panLeft(e * (this.camera.right - this.camera.left) / $('#player').width()),
  3404. this.panUp(-t * (this.camera.top - this.camera.bottom) / $('#player').height())
  3405. }
  3406. ,
  3407. n.prototype.updateZoom = function() {
  3408. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3409. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3410. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3411. this.camera.left = -o.orthoBase * this.currentScale,
  3412. this.camera.right = o.orthoBase * this.currentScale,
  3413. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3414. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3415. this.camera.updateProjectionMatrix(),
  3416. this.offset.length()
  3417. }
  3418. ,
  3419. n.prototype.toJSON = function() {
  3420. var e = new r.Quaternion
  3421. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3422. , i = new r.Quaternion;
  3423. return function() {
  3424. var n = a.prototype.toJSON.call(this);
  3425. return e.copy(n.camera_quaternion),
  3426. i.copy(t),
  3427. i.multiply(e),
  3428. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3429. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3430. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3431. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3432. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3433. n
  3434. }
  3435. }(),
  3436. t.exports = n
  3437. }
  3438. , {
  3439. "../enum/ControlActions": 20,
  3440. "../enum/MouseButton": 34,
  3441. "../settings": 166,
  3442. "../util/browser": 182,
  3443. "../util/math": 190,
  3444. "./OutsideControls": 12,
  3445. three: 217
  3446. }],
  3447. 12: [function(e, t, i) {//"./OutsideControls"
  3448. "use strict";
  3449. function n(e) {
  3450. this.camera = e,
  3451. this.camera.controls = this,
  3452. this.enabled = !1,
  3453. this.target = new r.Vector3,
  3454. this.targetBounds = new r.Box3,
  3455. this.zoomSpeed = 1,
  3456. this.minDistance = 0,
  3457. this.maxDistance = 1 / 0,
  3458. this.noRotateUpDown = !1,
  3459. this.rotateSpeed = 1,
  3460. this.keyboardZoomSpeed = 0,
  3461. this.keyPanSpeed = 7,
  3462. this.autoRotate = !1,
  3463. this.autoRotateSpeed = 2,
  3464. this.autoPan = !1,
  3465. this.autoPanPosition = new r.Vector3,
  3466. this.minPolarAngle = r.Math.degToRad(25),
  3467. this.maxPolarAngle = r.Math.degToRad(65),
  3468. this.rotationAcceleration = new r.Vector2,
  3469. this.rotationSpeed = new r.Vector2,
  3470. this.panAcceleration = new r.Vector2,
  3471. this.panSpeed = new r.Vector2,
  3472. this.rotateStart = new r.Vector2,
  3473. this.rotateEnd = new r.Vector2,
  3474. this.rotateDelta = new r.Vector2,
  3475. this.panStart = new r.Vector2,
  3476. this.panEnd = new r.Vector2,
  3477. this.panDelta = new r.Vector2,
  3478. this.panOffset = new r.Vector3,
  3479. this.offset = new r.Vector3,
  3480. this.dollyStart = new r.Vector2,
  3481. this.dollyEnd = new r.Vector2,
  3482. this.dollyDelta = new r.Vector2,
  3483. this.phiDelta = 0,
  3484. this.thetaDelta = 0,
  3485. this.scale = 1,
  3486. this.panVector = new r.Vector3,
  3487. this.lastPosition = new r.Vector3,
  3488. this.state = c.NONE,
  3489. this.mouseActions = {},
  3490. this.mouseActions[h.LEFT] = c.ROTATE,
  3491. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3492. this.mouseActions[h.RIGHT] = c.PAN,
  3493. this.touchActions = {},
  3494. this.touchActions[1] = c.ROTATE,
  3495. this.touchActions[2] = c.PAN_DOLLY,
  3496. this.lastMoveTime = 0,
  3497. this.pointersLimit = 2,
  3498. this.pointers = []
  3499. }
  3500. var r = e("three")
  3501. , o = e("../settings")
  3502. , a = e("../util/common")
  3503. , s = e("../util/math")
  3504. , l = e("../enum/Vectors")
  3505. , c = e("../enum/ControlActions")
  3506. , h = e("../enum/MouseButton")
  3507. , u = e("../enum/Keys")
  3508. , d = e("../enum/ControlEvents")
  3509. , p = e("events").EventEmitter
  3510. , f = 1e-6;
  3511. n.prototype = Object.create(p.prototype),
  3512. n.prototype.setBounds = function(e) {
  3513. this.targetBounds = e
  3514. }
  3515. ,
  3516. n.prototype.isEngaged = function() {
  3517. return this.state !== c.NONE
  3518. }
  3519. ,
  3520. n.prototype.rotateLeft = function(e) {
  3521. void 0 === e && (e = this.getAutoRotationAngle()),
  3522. this.thetaDelta -= e
  3523. }
  3524. ,
  3525. n.prototype.rotateUp = function(e) {
  3526. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3527. this.phiDelta -= e)
  3528. }
  3529. ,
  3530. n.prototype.panLeft = function(e) {
  3531. var t = this.camera.matrix.elements;
  3532. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3533. this.panOffset.multiplyScalar(-e),
  3534. this.panVector.add(this.panOffset)
  3535. }
  3536. ,
  3537. n.prototype.panUp = function(e) {
  3538. var t = this.camera.matrix.elements;
  3539. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3540. this.panOffset.multiplyScalar(-e),
  3541. this.panVector.add(this.panOffset)
  3542. }
  3543. ,
  3544. n.prototype.startRotating = function(e, t) {
  3545. e && this.navRotationAcc("x", e),
  3546. t && this.navRotationAcc("y", t)
  3547. }
  3548. ,
  3549. n.prototype.stopRotating = function(e) {
  3550. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3551. this.navRotationAcc("x", 0),
  3552. this.navRotationAcc("y", 0)
  3553. }
  3554. ,
  3555. n.prototype.setAutoPanPosition = function(e, t) {
  3556. var i = new r.Vector3
  3557. , n = new r.Vector3;
  3558. return function(e, t) {
  3559. i.copy(this.camera.position),
  3560. void 0 === e && null === e || i.setX(e),
  3561. void 0 === t && null === t || i.setZ(t);
  3562. var r = this.camera.position.distanceTo(this.target)
  3563. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3564. this.targetClamped = !1,
  3565. n.copy(i).addScaledVector(o, r),
  3566. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3567. i.copy(n).addScaledVector(o, -r),
  3568. this.targetClamped = !0),
  3569. this.autoPanPosition.x = i.x,
  3570. this.autoPanPosition.z = i.z,
  3571. this.autoPan && this.stopAutoPanning()
  3572. }
  3573. }(),
  3574. n.prototype.stopAutoPanning = function() {
  3575. var e = this.autoPan;
  3576. this.autoPan = !1,
  3577. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3578. }
  3579. ,
  3580. n.prototype.dollyIn = function(e) {
  3581. void 0 === e && (e = this.getZoomScale()),
  3582. this.scale /= e
  3583. }
  3584. ,
  3585. n.prototype.dollyOut = function(e) {
  3586. void 0 === e && (e = this.getZoomScale()),
  3587. this.scale *= e
  3588. }
  3589. ,
  3590. n.prototype.updatePan = function(e) {
  3591. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3592. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3593. this.autoPan) {
  3594. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3595. t.setY(0).clampLength(0, 50 * e),
  3596. this.target.add(t),
  3597. this.camera.position.add(t),
  3598. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3599. this.stopAutoPanning())
  3600. }
  3601. }
  3602. ,
  3603. n.prototype.update = function(e) {
  3604. e || (e = 1 / 60),
  3605. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3606. this.rotateLeft(-this.rotationSpeed.x),
  3607. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3608. this.updatePan(e);
  3609. var t = this.camera.position;
  3610. this.offset.copy(t).sub(this.target);
  3611. var i = Math.atan2(this.offset.x, this.offset.z)
  3612. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3613. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3614. i += this.thetaDelta,
  3615. n += this.phiDelta,
  3616. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3617. n = Math.max(f, Math.min(Math.PI - f, n));
  3618. var r = this.updateZoom();
  3619. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3620. this.target.add(this.panVector),
  3621. this.targetBounds.clampPoint(this.target, this.target),
  3622. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3623. this.offset.y = r * Math.cos(n),
  3624. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3625. t.copy(this.target).add(this.offset),
  3626. this.camera.lookAt(this.target),
  3627. this.thetaDelta = 0,
  3628. this.phiDelta = 0,
  3629. this.scale = 1,
  3630. this.panVector.set(0, 0, 0),
  3631. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3632. }
  3633. ,
  3634. n.prototype.getAutoRotationAngle = function() {
  3635. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3636. }
  3637. ,
  3638. n.prototype.getZoomScale = function() {
  3639. return Math.pow(.95, this.zoomSpeed)
  3640. }
  3641. ,
  3642. n.prototype.onMouseDown = function(e) {
  3643. if (this.enabled) {
  3644. switch (e.preventDefault(),
  3645. this.stopAutoPanning(),
  3646. this.mouseDown = !0,
  3647. this.state = this.mouseActions[e.button],
  3648. this.state) {
  3649. case c.ROTATE:
  3650. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3651. this.rotationSpeed.set(0, 0);
  3652. break;
  3653. case c.DOLLY:
  3654. this.dollyStart.set(e.clientX, e.clientY);
  3655. break;
  3656. case c.PAN:
  3657. this.panStart.set(e.clientX, e.clientY)
  3658. }
  3659. this.emit(d.InputStart, "mouse")
  3660. }
  3661. }
  3662. ,
  3663. n.prototype.onMouseMove = function(e) {
  3664. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3665. switch (e.preventDefault(),
  3666. this.state) {
  3667. case c.ROTATE:
  3668. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3669. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3670. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $('#player').width() * this.rotateSpeed),
  3671. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $('#player').height() * this.rotateSpeed),
  3672. this.rotateStart.copy(this.rotateEnd);
  3673. break;
  3674. case c.DOLLY:
  3675. this.dollyEnd.set(e.clientX, e.clientY),
  3676. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3677. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3678. t.call(this),
  3679. this.dollyStart.copy(this.dollyEnd);
  3680. break;
  3681. case c.PAN:
  3682. this.panEnd.set(e.clientX, e.clientY),
  3683. this.panDelta.subVectors(this.panEnd, this.panStart),
  3684. this.pan(this.panDelta.x, this.panDelta.y),
  3685. this.panStart.copy(this.panEnd)
  3686. }
  3687. this.emit(d.Move, "mouse"),
  3688. this.lastMoveTime = e.timeStamp,
  3689. this.update()
  3690. }
  3691. }
  3692. ,
  3693. n.prototype.onMouseUp = function(e) {
  3694. this.enabled && (this.mouseDown = !1,
  3695. this.state = c.NONE,
  3696. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3697. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3698. this.update(),
  3699. this.rotationAcceleration.set(0, 0),
  3700. this.rotateDelta.set(0, 0)))
  3701. }
  3702. ,
  3703. n.prototype.onMouseOver = function(e) {
  3704. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3705. }
  3706. ,
  3707. n.prototype.onMouseWheel = function(e) {
  3708. if (this.enabled && o.useWheel) {
  3709. this.emit(d.Move, "wheel");
  3710. var t = e.wheelDelta || -e.detail
  3711. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3712. i.call(this),
  3713. this.update()
  3714. }
  3715. }
  3716. ,
  3717. n.prototype.onKeyDown = function(e) {
  3718. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3719. this.handleKeyDown(e.which)))
  3720. }
  3721. ,
  3722. n.prototype.navRotationAcc = function(e, t) {
  3723. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3724. }
  3725. ,
  3726. n.prototype.navPanAcc = function(e, t) {
  3727. this.stopAutoPanning(),
  3728. this.panAcceleration[e] = t
  3729. }
  3730. ,
  3731. n.prototype.handleKeyDown = function(e) {
  3732. var t = !0;
  3733. switch (e) {
  3734. case u.UPARROW:
  3735. case u.I:
  3736. this.navRotationAcc("y", 1);
  3737. break;
  3738. case u.DOWNARROW:
  3739. case u.K:
  3740. this.navRotationAcc("y", -1);
  3741. break;
  3742. case u.LEFTARROW:
  3743. case u.J:
  3744. this.navRotationAcc("x", -1);
  3745. break;
  3746. case u.RIGHTARROW:
  3747. case u.L:
  3748. this.navRotationAcc("x", 1);
  3749. break;
  3750. case u.W:
  3751. this.navPanAcc("y", 1);
  3752. break;
  3753. case u.S:
  3754. this.navPanAcc("y", -1);
  3755. break;
  3756. case u.A:
  3757. this.navPanAcc("x", -1);
  3758. break;
  3759. case u.D:
  3760. this.navPanAcc("x", 1);
  3761. break;
  3762. default:
  3763. t = !1
  3764. }
  3765. t && this.emit(d.Move, "key")
  3766. }
  3767. ,
  3768. n.prototype.onKeyUp = function(e) {
  3769. this.enabled && (e.preventDefault(),
  3770. e.stopPropagation(),
  3771. this.handleKeyUp(e.which))
  3772. }
  3773. ,
  3774. n.prototype.handleKeyUp = function(e) {
  3775. switch (e) {
  3776. case u.I:
  3777. case u.K:
  3778. case u.UPARROW:
  3779. case u.DOWNARROW:
  3780. this.keyboardZoomSpeed = 0,
  3781. this.rotationAcceleration.y = 0;
  3782. break;
  3783. case u.J:
  3784. case u.L:
  3785. case u.LEFTARROW:
  3786. case u.RIGHTARROW:
  3787. this.rotationAcceleration.x = 0;
  3788. break;
  3789. case u.S:
  3790. case u.W:
  3791. this.panAcceleration.y = 0;
  3792. break;
  3793. case u.A:
  3794. case u.D:
  3795. this.panAcceleration.x = 0
  3796. }
  3797. }
  3798. ,
  3799. n.prototype.onTouchStart = function(e) {
  3800. if (this.enabled || this.state === c.NONE) {
  3801. e.preventDefault(),
  3802. e.stopPropagation(),
  3803. this.stopAutoPanning();
  3804. var t = function() {
  3805. if (2 === e.touches.length) {
  3806. var t = e.touches[0].pageX - e.touches[1].pageX
  3807. , i = e.touches[0].pageY - e.touches[1].pageY;
  3808. this.dollyStart.set(t, i)
  3809. }
  3810. }
  3811. .bind(this)
  3812. , i = function() {
  3813. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3814. }
  3815. .bind(this)
  3816. , n = function() {
  3817. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3818. }
  3819. .bind(this);
  3820. switch (this.state = this.touchActions[e.touches.length],
  3821. this.state) {
  3822. case c.PAN_DOLLY:
  3823. t();
  3824. case c.PAN:
  3825. i();
  3826. break;
  3827. case c.ROTATE_DOLLY:
  3828. t();
  3829. case c.ROTATE:
  3830. n()
  3831. }
  3832. this.rotationSpeed.set(0, 0),
  3833. this.emit(d.InputStart, "touch")
  3834. }
  3835. }
  3836. ,
  3837. n.prototype.onTouchMove = function(e) {
  3838. if (this.enabled && this.state !== c.NONE) {
  3839. e.preventDefault(),
  3840. e.stopPropagation();
  3841. var t = function() {
  3842. var t = e.touches[0].pageX - e.touches[1].pageX
  3843. , i = e.touches[0].pageY - e.touches[1].pageY;
  3844. this.dollyEnd.set(t, i);
  3845. var n = this.dollyStart.length() - this.dollyEnd.length();
  3846. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3847. this.dollyStart.copy(this.dollyEnd)
  3848. }
  3849. .bind(this)
  3850. , i = function() {
  3851. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3852. this.panDelta.subVectors(this.panEnd, this.panStart),
  3853. this.pan(this.panDelta.x, this.panDelta.y),
  3854. this.panStart.copy(this.panEnd),
  3855. this.rotateDelta.set(0, 0)
  3856. }
  3857. .bind(this)
  3858. , n = function() {
  3859. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3860. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3861. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $('#player').width() * this.rotateSpeed),
  3862. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $('#player').height() * this.rotateSpeed),
  3863. this.rotateStart.copy(this.rotateEnd)
  3864. }
  3865. .bind(this)
  3866. , r = function() {
  3867. if (2 === e.touches.length) {
  3868. var i = window.devicePixelRatio || 1
  3869. , r = e.touches[1].pageX - e.touches[0].pageX
  3870. , s = e.touches[1].pageY - e.touches[0].pageY
  3871. , l = Math.sqrt(r * r + s * s)
  3872. , h = Math.abs(this.dollyStart.length() - l);
  3873. if (h > o.input.touchMoveThreshold * i)
  3874. this.state = c.DOLLY,
  3875. t();
  3876. else {
  3877. var u = a.average(e.touches, "pageX")
  3878. , d = a.average(e.touches, "pageY")
  3879. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3880. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3881. this.rotateStart.set(u, d),
  3882. n())
  3883. }
  3884. }
  3885. }
  3886. .bind(this);
  3887. switch (this.state) {
  3888. case c.PAN_DOLLY:
  3889. t();
  3890. case c.PAN:
  3891. i();
  3892. break;
  3893. case c.ROTATE_DOLLY:
  3894. r();
  3895. break;
  3896. case c.DOLLY:
  3897. t();
  3898. break;
  3899. case c.ROTATE:
  3900. n();
  3901. break;
  3902. default:
  3903. this.state = c.NONE
  3904. }
  3905. this.lastMoveTime = e.timeStamp,
  3906. this.emit(d.Move, "touch")
  3907. }
  3908. }
  3909. ,
  3910. n.prototype.onTouchEnd = function(e) {
  3911. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3912. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3913. this.state = c.NONE,
  3914. this.update(),
  3915. this.rotationAcceleration.set(0, 0),
  3916. this.rotateDelta.set(0, 0))
  3917. }
  3918. ,
  3919. n.prototype.onPointerDown = function(e) {
  3920. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3921. id: e.pointerId,
  3922. pageX: e.pageX,
  3923. pageY: e.pageY
  3924. }),
  3925. e.touches = this.pointers,
  3926. this.onTouchStart(e)),
  3927. this.emit(d.InputStart, "pointer"))
  3928. }
  3929. ,
  3930. n.prototype.onPointerMove = function(e) {
  3931. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3932. e.pointerId === t.id && (t.pageX = e.pageX,
  3933. t.pageY = e.pageY)
  3934. }),
  3935. e.touches = this.pointers,
  3936. this.onTouchMove(e))
  3937. }
  3938. ,
  3939. n.prototype.onPointerUp = function(e) {
  3940. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3941. e.pointerId === t.id && this.pointers.splice(i, 1)
  3942. }
  3943. .bind(this)),
  3944. e.touches = this.pointers,
  3945. this.onTouchEnd(e))
  3946. }
  3947. ,
  3948. n.prototype.reset = function() {
  3949. this.state = c.NONE,
  3950. this.stopAutoPanning(),
  3951. this.rotationSpeed.set(0, 0),
  3952. this.rotationAcceleration.set(0, 0),
  3953. this.panSpeed.set(0, 0),
  3954. this.panAcceleration.set(0, 0)
  3955. }
  3956. ,
  3957. n.prototype.toJSON = function() {
  3958. var e = {
  3959. camera_position: {
  3960. x: s.toPrecision(this.camera.position.x, 4),
  3961. y: s.toPrecision(this.camera.position.y, 4),
  3962. z: s.toPrecision(this.camera.position.z, 4)
  3963. },
  3964. camera_quaternion: {
  3965. x: s.toPrecision(this.camera.quaternion.x, 4),
  3966. y: s.toPrecision(this.camera.quaternion.y, 4),
  3967. z: s.toPrecision(this.camera.quaternion.z, 4),
  3968. w: s.toPrecision(this.camera.quaternion.w, 4)
  3969. }
  3970. };
  3971. return e
  3972. }
  3973. ,
  3974. t.exports = n
  3975. }
  3976. , {
  3977. "../enum/ControlActions": 20,
  3978. "../enum/ControlEvents": 21,
  3979. "../enum/Keys": 30,
  3980. "../enum/MouseButton": 34,
  3981. "../enum/Vectors": 50,
  3982. "../settings": 166,
  3983. "../util/common": 185,
  3984. "../util/math": 190,
  3985. events: 202,
  3986. three: 217
  3987. }],
  3988. 13: [function(e, t, i) {///js/controls/PanoramaControls.js
  3989. (function(i) {
  3990. "use strict";
  3991. function n(e) {
  3992. this.camera = e,
  3993. this.camera.controls = this,
  3994. this.target = new r.Vector3(0,0,0),
  3995. this.lookVector = new r.Vector3,
  3996. this.lookSpeed = .05,
  3997. this.rotationAcc = new r.Vector2,
  3998. this.rotationSpeed = new r.Vector2,
  3999. this.lat = 0,
  4000. this.lon = 0,
  4001. this.phi = 0,
  4002. this.theta = 0,
  4003. this.enabled = !1,
  4004. this.locked = !1,
  4005. this.pointer = new r.Vector2(0,0),
  4006. this.rotationHistory = [],
  4007. this.rotationDifference = new r.Vector2,
  4008. this.pointerDragOn = !1,
  4009. this.pointerDragStart = new r.Vector2(0,0),
  4010. this.pinchDistance = 0,
  4011. this.moveStart = new r.Vector2,
  4012. this.moveTolerance = .01,
  4013. this.pointersLimit = 2,
  4014. this.pointers = []
  4015. }
  4016. var r = e("three")
  4017. , o = e("../util/logger")
  4018. , a = e("../settings")
  4019. , s = e("../util/common")
  4020. , l = e("../util/math")
  4021. , c = (e("../enum/Vectors"),
  4022. e("../enum/MouseButton"))
  4023. , h = e("../enum/Keys")
  4024. , u = e("../enum/ControlEvents")
  4025. , d = e("events").EventEmitter;
  4026. new o(i);
  4027. n.prototype = Object.create(d.prototype),
  4028. n.prototype.usable = function() {
  4029. return this.enabled && !this.locked
  4030. }
  4031. ,
  4032. n.prototype.lookAt = function(e) {
  4033. var t = this.camera.position.clone().sub(e)
  4034. , i = Math.atan(t.z / t.x);
  4035. i += t.x < 0 ? Math.PI : 0,
  4036. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4037. this.lon = r.Math.radToDeg(i) + 180;
  4038. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4039. , o = Math.atan(t.y / n);
  4040. this.lat = -r.Math.radToDeg(o)
  4041. }
  4042. ,
  4043. n.prototype.startLookAt = function(t,m,p,f, cameraPos){//xzw 加 看向热点的markspot
  4044. var e = cameraPos? cameraPos.clone().sub(t) : this.object.position.clone().sub(t)
  4045. , o = Math.atan(e.z / e.x);
  4046. o += e.x < 0 ? Math.PI : 0,
  4047. o += e.x > 0 && e.z < 0 ? 2 * Math.PI : 0;
  4048. var lon = r.Math.radToDeg(o) + 180;
  4049. var n = Math.sqrt(e.x * e.x + e.z * e.z)
  4050. , i = Math.atan(e.y / n);
  4051. var lat = -r.Math.radToDeg(i);
  4052. var add = (lon - this.lon)%360;
  4053. Math.abs(add) > 180 && ( add>0 ? add-=360 : add+=360 );
  4054. lon = this.lon + add;
  4055. var add = (lat - this.lat)%360;
  4056. Math.abs(add) > 180 && ( add>0 ? add-=360 : add+=360 );
  4057. lat = this.lat + add;
  4058. m.start(p.property(this, "lon", lon), 1200, null, 0,f["easeInOutQuad"]);
  4059. m.start(p.property(this, "lat", lat), 1200, null, 0,f["easeInOutQuad"]);
  4060. }
  4061. ,
  4062. n.prototype.startRotationFrom = function(e, t) {
  4063. l.convertScreenPositionToNDC(e, t, this.pointer),
  4064. this.pointerDragOn = !0,
  4065. this.pointerDragStart.copy(this.pointer),
  4066. this.moveStart.copy(this.pointer),
  4067. this.rotationHistory = [],
  4068. this.rotationSpeed.set(0, 0)
  4069. }
  4070. ,
  4071. n.prototype.onMouseOver = function(e) {
  4072. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4073. }
  4074. ,
  4075. n.prototype.onTouchStart = function(e) {
  4076. if (this.usable()) {
  4077. switch (e.preventDefault(),
  4078. e.stopPropagation(),
  4079. e.touches.length) {
  4080. case 1:
  4081. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4082. break;
  4083. case 2:
  4084. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width()
  4085. , i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height();
  4086. this.pinchDistance = Math.sqrt(t * t + i * i)
  4087. }
  4088. this.emit(u.InputStart, "touch")
  4089. }
  4090. }
  4091. ,
  4092. n.prototype.onPointerDown = function(e) {
  4093. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4094. id: e.pointerId,
  4095. clientX: e.clientX,
  4096. clientY: e.clientY
  4097. }),
  4098. e.touches = this.pointers,
  4099. this.onTouchStart(e),
  4100. this.emit(u.InputStart, "pointer"))
  4101. }
  4102. ,
  4103. n.prototype.onMouseDown = function(e) {
  4104. if (this.usable()) {
  4105. switch (e.preventDefault(),
  4106. e.stopPropagation(),
  4107. e.button) {
  4108. case c.LEFT:
  4109. this.startRotationFrom(e.clientX, e.clientY)
  4110. }
  4111. this.emit(u.InputStart, "mouse")
  4112. }
  4113. }
  4114. ,
  4115. n.prototype.updateRotation = function() {
  4116. if (this.usable() && this.pointerDragOn) {
  4117. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4118. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4119. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4120. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4121. , o = Math.atan2(e.y, i)
  4122. , a = Math.atan2(t.y, n);
  4123. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4124. e.y = 0,
  4125. t.y = 0;
  4126. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4127. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4128. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4129. this.pointerDragStart.copy(this.pointer)
  4130. }
  4131. }
  4132. ,
  4133. n.prototype.onMouseMove = function(e) {
  4134. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4135. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4136. }
  4137. ,
  4138. n.prototype.onTouchMove = function(e) {
  4139. if (this.usable())
  4140. switch (this.emit(u.Move, "touch"),
  4141. e.touches.length) {
  4142. case 1:
  4143. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4144. break;
  4145. case 2:
  4146. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width()
  4147. , i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4148. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4149. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4150. this.emit(u.Pinch, n),
  4151. this.pinchDistance -= n)
  4152. }
  4153. }
  4154. ,
  4155. n.prototype.onPointerMove = function(e) {
  4156. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4157. e.pointerId === t.id && (t.clientX = e.clientX,
  4158. t.clientY = e.clientY)
  4159. }),
  4160. e.touches = this.pointers,
  4161. this.onTouchMove(e))
  4162. }
  4163. ,
  4164. n.prototype.endRotation = function() {
  4165. this.pointerDragOn = !1;
  4166. var e = s.averageVectors(this.rotationHistory);
  4167. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4168. }
  4169. ,
  4170. n.prototype.onTouchEnd = function(e) {
  4171. this.usable() && (e.preventDefault(),
  4172. e.stopPropagation(),
  4173. this.endRotation())
  4174. }
  4175. ,
  4176. n.prototype.onMouseUp = function(e) {
  4177. this.usable() && (e.preventDefault(),
  4178. e.stopPropagation(),
  4179. this.endRotation())
  4180. }
  4181. ,
  4182. n.prototype.onPointerUp = function(e) {
  4183. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4184. e.pointerId === t.id && this.pointers.splice(i, 1)
  4185. }
  4186. .bind(this)),
  4187. e.touches = this.pointers,
  4188. this.onTouchEnd(e))
  4189. }
  4190. ,
  4191. n.prototype.update = function(e) {
  4192. this.lon,
  4193. this.lat;
  4194. for (this.updateRotation(),
  4195. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4196. this.rotationHistory.shift();
  4197. this.lon += this.rotationDifference.x,
  4198. this.lat += this.rotationDifference.y,
  4199. this.rotationDifference.set(0, 0),
  4200. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4201. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4202. this.lon += this.rotationSpeed.x * e,
  4203. this.lat += this.rotationSpeed.y * e,
  4204. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4205. this.phi = r.Math.degToRad(90 - this.lat),
  4206. this.theta = r.Math.degToRad(this.lon),
  4207. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4208. this.lookVector.y = Math.cos(this.phi),
  4209. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4210. this.target.copy(this.lookVector).add(this.camera.position),
  4211. this.camera.lookAt(this.target)
  4212. }
  4213. ,
  4214. n.prototype.onMouseWheel = function(e) {
  4215. if (this.usable()) {
  4216. var t = e.wheelDelta || -e.detail;
  4217. this.emit(u.InteractionDirect),
  4218. this.emit(u.Scroll, t)
  4219. }
  4220. }
  4221. ,
  4222. n.prototype.onKeyDown = function(e) {
  4223. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4224. this.handleKeyDown(e.which)))
  4225. }
  4226. ,
  4227. n.prototype.handleKeyDown = function(e) {
  4228. var t = function(e, t) {
  4229. this.rotationAcc[e] = t
  4230. }
  4231. .bind(this);
  4232. this.emit(u.InteractionKey);
  4233. var i = !0;
  4234. switch (e) {
  4235. case h.LEFTARROW:
  4236. case h.J:
  4237. t("x", -1);
  4238. break;
  4239. case h.RIGHTARROW:
  4240. case h.L:
  4241. t("x", 1);
  4242. break;
  4243. case h.I:
  4244. t("y", 1);
  4245. break;
  4246. case h.K:
  4247. t("y", -1);
  4248. break;
  4249. default:
  4250. i = !1
  4251. }
  4252. i && this.emit(u.Move, "key")
  4253. }
  4254. ,
  4255. n.prototype.onKeyUp = function(e) {
  4256. this.usable() && (e.preventDefault(),
  4257. e.stopPropagation(),
  4258. this.handleKeyUp(e.which))
  4259. }
  4260. ,
  4261. n.prototype.handleKeyUp = function(e) {
  4262. switch (e) {
  4263. case h.LEFTARROW:
  4264. case h.J:
  4265. case h.RIGHTARROW:
  4266. case h.L:
  4267. this.rotationAcc.x = 0;
  4268. break;
  4269. case h.I:
  4270. case h.K:
  4271. this.rotationAcc.y = 0
  4272. }
  4273. }
  4274. ,
  4275. n.prototype.startRotating = function(e, t) {
  4276. e && (this.rotationAcc.x = e),
  4277. t && (this.rotationAcc.y = t)
  4278. }
  4279. ,
  4280. n.prototype.stopRotating = function(e) {
  4281. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4282. this.rotationAcc.set(0, 0)
  4283. }
  4284. ,
  4285. n.prototype.reset = function() {
  4286. this.pointerDragOn = !1,
  4287. this.rotationAcc.set(0, 0),
  4288. this.rotationSpeed.set(0, 0),
  4289. this.pointers = []
  4290. }
  4291. ,
  4292. n.prototype.toJSON = function() {
  4293. var e = {
  4294. camera_position: {
  4295. x: l.toPrecision(this.camera.position.x, 4),
  4296. y: l.toPrecision(this.camera.position.y, 4),
  4297. z: l.toPrecision(this.camera.position.z, 4)
  4298. },
  4299. camera_quaternion: {
  4300. x: l.toPrecision(this.camera.quaternion.x, 4),
  4301. y: l.toPrecision(this.camera.quaternion.y, 4),
  4302. z: l.toPrecision(this.camera.quaternion.z, 4),
  4303. w: l.toPrecision(this.camera.quaternion.w, 4)
  4304. }
  4305. };
  4306. return e
  4307. }
  4308. ,
  4309. n.prototype.setStateFromJSON = function(e) {
  4310. this.camera.position.copy(e.camera_position),
  4311. this.camera.quaternion.copy(e.camera_quaternion)
  4312. }
  4313. ,
  4314. t.exports = n
  4315. }
  4316. ).call(this, "/js/controls/PanoramaControls.js")
  4317. }
  4318. , {
  4319. "../enum/ControlEvents": 21,
  4320. "../enum/Keys": 30,
  4321. "../enum/MouseButton": 34,
  4322. "../enum/Vectors": 50,
  4323. "../settings": 166,
  4324. "../util/common": 185,
  4325. "../util/logger": 189,
  4326. "../util/math": 190,
  4327. events: 202,
  4328. three: 217
  4329. }],
  4330. 14: [function(e, t, i) {///js/controls/serializer.js
  4331. (function(i) {
  4332. "use strict";
  4333. var n = e("three")
  4334. , r = e("../enum/Viewmode")
  4335. , o = e("../util/logger")
  4336. , a = new o(i);
  4337. t.exports = {
  4338. serialize: function(e) {
  4339. return encodeURI(JSON.stringify(e))
  4340. },
  4341. deserialize: function(e) {
  4342. function t(e) {
  4343. function t(e, t) {
  4344. return e && "number" == typeof t && !isNaN(t)
  4345. }
  4346. return e.reduce(t, !0)
  4347. }
  4348. try {
  4349. var i = JSON.parse(decodeURI(e))
  4350. , o = {
  4351. mode: r.fromInt(i.camera_mode),
  4352. panoId: i.scan_id,
  4353. position: (new n.Vector3).copy(i.camera_position),
  4354. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4355. zoom: i.ortho_zoom,
  4356. floorVisibility: i.floor_visibility
  4357. }
  4358. , s = o.position;
  4359. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4360. var l = o.quaternion;
  4361. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4362. o
  4363. } catch (i) {
  4364. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4365. try {
  4366. var c = e.split(",")
  4367. , h = {
  4368. x: parseFloat(c[2]),
  4369. y: parseFloat(c[3]),
  4370. z: parseFloat(c[4])
  4371. }
  4372. , u = {
  4373. x: parseFloat(c[5]),
  4374. y: parseFloat(c[6]),
  4375. z: parseFloat(c[7]),
  4376. w: parseFloat(c[8])
  4377. };
  4378. return t([h.x, h.y, h.z]) || (h.x = 0,
  4379. h.y = 0,
  4380. h.z = 0),
  4381. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4382. u.y = 0,
  4383. u.z = 0,
  4384. u.w = 1),
  4385. {
  4386. mode: r.fromInt(c[0]),
  4387. panoId: c[1],
  4388. position: (new n.Vector3).copy(h),
  4389. quaternion: (new n.Quaternion).copy(u)
  4390. }
  4391. } catch (t) {
  4392. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4393. }
  4394. }
  4395. return null
  4396. }
  4397. }
  4398. }
  4399. ).call(this, "/js/controls/serializer.js")
  4400. }
  4401. , {
  4402. "../enum/Viewmode": 51,
  4403. "../util/logger": 189,
  4404. three: 217
  4405. }],
  4406. 15: [function(e, t, i) {///js/director.js
  4407. (function(i) {
  4408. "use strict";
  4409. function n() {
  4410. this.endlessLoop = a.warp.loop,
  4411. this.clock = new r.Clock(!0),
  4412. this.model = null,
  4413. this.player = null,
  4414. this.currentItem = null,
  4415. this.destinationItem = null,
  4416. this.tourIsPlaying = !1,
  4417. this.transitionStage = y.None,
  4418. this.nextFunc = null,
  4419. this.onTheBus = !1,
  4420. this.tourInProgress = !1,
  4421. this.reachSource = null,
  4422. this.interrupted = !1,
  4423. this.nItems = 0,
  4424. this.walkingSectionPaused = !1
  4425. }
  4426. var r = e("three")
  4427. , o = e("./util/logger")
  4428. , a = e("./settings")
  4429. , s = e("./util/transitions")
  4430. , l = e("events").EventEmitter
  4431. , c = e("./enum/Viewmode")
  4432. , h = e("./analytics")
  4433. , u = e("./enum/WarpStyle")
  4434. , s = e("./util/transitions")
  4435. , d = (e("./model/ModelManager"),
  4436. e("./enum/ModelManagerEvents"))
  4437. , p = e("./enum/DirectorEvents")
  4438. , f = e("./enum/PlayerEvents")
  4439. , g = (e("./enum/ControlEvents"),
  4440. e("./enum/BlackoutStyle"))
  4441. , m = e("./enum/PathDiscardMode")
  4442. , v = e("./enum/PathDisplayMode")
  4443. , editor = e('editor')
  4444. , A = (e("./player"),
  4445. new o(i))
  4446. , y = Object.freeze({
  4447. None: 0,
  4448. Moving: 1,
  4449. Aiming: 2,
  4450. Interlude: 3
  4451. })
  4452. , C = Object.freeze({
  4453. Forward: 1,
  4454. NoChange: 0,
  4455. Backwards: -1
  4456. })
  4457. , I = s.getUniqueId();
  4458. n.prototype = Object.create(l.prototype),
  4459. n.prototype.init = function(e, t) {
  4460. this.player = e,
  4461. this.modelManager = t,
  4462. this.updateModel(),
  4463. this.resetAll(),
  4464. this.bindEvents()
  4465. }
  4466. ,
  4467. n.prototype.resetAll = function() {
  4468. if (this.currentItem = null,
  4469. this.destinationItem = null,
  4470. this.tourIsPlaying = !1,
  4471. this.transitionStage = y.None,
  4472. this.nextFunc = null,
  4473. this.onTheBus = !1,
  4474. this.reachSource = null,
  4475. this.interrupted = !1,
  4476. this.model) {
  4477. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4478. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4479. } else
  4480. this.defaultWarpStyle = u.BLACK,
  4481. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4482. this.resetSpecialTransition()
  4483. }
  4484. ,
  4485. n.prototype.updateModel = function() {
  4486. this.model = this.modelManager.getActiveModel(),
  4487. this.nItems = this.model.heroLocations.length
  4488. }
  4489. ,
  4490. n.prototype.bindEvents = function() {
  4491. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4492. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4493. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4494. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4495. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4496. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4497. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4498. this.player.once(f.Move, function() {
  4499. s.cancelById(I)
  4500. })
  4501. }
  4502. ,
  4503. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4504. return e === u.WALK && (this.interrupt(g.NONE),
  4505. this.pauseWalkingSection(),
  4506. this.player.fastForwardActivePanoFlight(),
  4507. !0)
  4508. }
  4509. ,
  4510. n.prototype.handlePlayerMove = function(e) {
  4511. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4512. this.emit("update.controls")
  4513. }
  4514. ,
  4515. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4516. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4517. this.emit("update.controls"))
  4518. }
  4519. ,
  4520. n.prototype.handlePlayerModeChanged = function(e, t) {
  4521. this.intermediateState() || e === t || (this.onTheBus = !1,
  4522. this.emit("update.controls"))
  4523. }
  4524. ,
  4525. n.prototype.handlePlayerInputStart = function(e) {
  4526. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4527. }
  4528. ,
  4529. n.prototype.handlePlayerFlyingStarted = function() {
  4530. this.clearWalkingSectionPaused()
  4531. }
  4532. ,
  4533. n.prototype.describe = function() {
  4534. return {
  4535. nItems: this.nItems,
  4536. currentItem: this.currentItem,
  4537. destinationItem: this.destinationItem,
  4538. tourIsPlaying: this.tourIsPlaying,
  4539. onTheBus: this.onTheBus,
  4540. endlessLoop: this.endlessLoop,
  4541. viewMode: this.player.mode,
  4542. inTransition: this._inTransition(),
  4543. transitionStage: this.transitionStage,
  4544. tourInProgress: this.tourInProgress
  4545. }
  4546. }
  4547. ,
  4548. n.prototype._inTransition = function() {
  4549. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4550. }
  4551. ,
  4552. n.prototype.bounceable = function() {
  4553. var e = this.clock.getDelta();
  4554. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4555. }
  4556. ,
  4557. n.prototype.currentMoveDirection = function() {
  4558. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4559. }
  4560. ,
  4561. n.prototype.clearPath = function() {
  4562. this._inTransition() || this.player.path.discardPathObject()
  4563. }
  4564. ,
  4565. n.prototype.allFloors = function() {
  4566. this.model.toggleAllFloors()
  4567. }
  4568. ,
  4569. n.prototype.actionComplete = function(e) {
  4570. if (this.interrupted = !1,
  4571. this.transitionStage = y.None,
  4572. this.resetSpecialTransition(),
  4573. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4574. this.tourIsPlaying || (this.player.disablePreRendering(),
  4575. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers(null,null,{player:this.player})),
  4576. this.emit("update.controls"),
  4577. this.nextFunc) {
  4578. var t = this.nextFunc;
  4579. this.nextFunc = null,
  4580. t()
  4581. }
  4582. }
  4583. ,
  4584. n.prototype.awaitCompletion = function(e, t) {
  4585. this.nextFunc = t,
  4586. e()
  4587. }
  4588. ,
  4589. n.prototype.updateSuccessFunction = function(e) {
  4590. this.nextFunc = e
  4591. }
  4592. ,
  4593. n.prototype.interrupt = function(e, t) {
  4594. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4595. this.tourIsPlaying = !1,
  4596. this.interrupted = !0,
  4597. this.nextFunc = null,
  4598. this.emit(p.ActionInterrupted),
  4599. null !== e && void 0 !== e || (e = g.BEGINNING),
  4600. this.player.interruptAndFastForward(e, t),
  4601. !0)
  4602. }
  4603. ,
  4604. n.prototype.wouldInterrupt = function() {
  4605. return this.transitionStage !== y.None
  4606. }
  4607. ,
  4608. n.prototype.intermediateState = function() {
  4609. return this.transitionStage !== y.None
  4610. }
  4611. ,
  4612. n.prototype.isInterrupted = function() {
  4613. return this.interrupted
  4614. }
  4615. ,
  4616. n.prototype.pauseWalkingSection = function() {
  4617. this.walkingSectionPaused = !0
  4618. }
  4619. ,
  4620. n.prototype.clearWalkingSectionPaused = function() {
  4621. this.walkingSectionPaused = !1
  4622. }
  4623. ,
  4624. n.prototype.autoTour = function() {
  4625. var e = Date.now();
  4626. this.model.auxDataPromise.then(function() {
  4627. e = Date.now() - e;
  4628. var t = a.warp.auto
  4629. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4630. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4631. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4632. done: function() {
  4633. this.playTour()
  4634. }
  4635. .bind(this),
  4636. name: "_atr",
  4637. id: I
  4638. })
  4639. }
  4640. .bind(this))
  4641. }
  4642. ,
  4643. n.prototype.atDestinationPano = function() {
  4644. if (!this.player.currentPano || null === this.destinationItem)
  4645. return !1;
  4646. var e = this.player.currentPano.id;
  4647. if (void 0 === e)
  4648. return !1;
  4649. var t = this.model.heroLocations;
  4650. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4651. }
  4652. ,
  4653. n.prototype.redirectToItem = function(e, t) {
  4654. if (null === e || void 0 === e)
  4655. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4656. if (!this.wouldInterrupt())
  4657. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4658. if (this.player.mode === c.TRANSITIONING)
  4659. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4660. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4661. var i = function() {
  4662. s.setTimeout(function() {
  4663. this.setDestinationItem(e),
  4664. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4665. }
  4666. .bind(this), 0)
  4667. }
  4668. .bind(this);
  4669. this.interrupt(g.END, 0),
  4670. this.updateSuccessFunction(i)
  4671. }
  4672. ,
  4673. n.prototype.useSpecialTransition = function(e) {
  4674. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4675. this.nextWarpStyle = u.BLACK
  4676. }
  4677. ,
  4678. n.prototype.resetSpecialTransition = function() {
  4679. this.nextWarpStyle = this.defaultWarpStyle
  4680. }
  4681. ,
  4682. n.prototype.arrivedAtDestination = function(e) {
  4683. if (this.player.flying || this.player.isWarping())
  4684. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4685. else {
  4686. this.transitionStage = y.Aiming;
  4687. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4688. this.player.model.fadePanoMarkers(0),
  4689. this.awaitCompletion(function() {
  4690. this.resetSpecialTransition(),
  4691. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4692. }
  4693. .bind(this), t)
  4694. }
  4695. }
  4696. ,
  4697. n.prototype.goToDestination = function(e, t, i, n) {
  4698. this.onTheBus = !0,
  4699. this.emit("update.controls");
  4700. this.player.updateLastView();
  4701. if (!n && this.atDestinationPano())//已到达 只需要旋转
  4702. return void this.arrivedAtDestination(!0);
  4703. if (this.player.flying || this.player.isWarping())
  4704. A.warn("Cannot go to new destination while player is flying or warping.");
  4705. else {
  4706. var r = this.model.getHeroDescriptorByIndex(this.destinationItem) //只是确保一下 获取heroLocations
  4707. , o = null
  4708. , a = null;
  4709. if (r.isPano()) {
  4710. var s = (0 === this.destinationItem || e ) ? u.BLACK : this.nextWarpStyle;//点击列表时、以及第一个与最后一个切换是黑色渐变 否则是walk
  4711. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4712. o = this.arrivedAtDestination.bind(this, !0)
  4713. } else{
  4714. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4715. o = this.arrivedAtDestination.bind(this, !1);
  4716. }
  4717. this.transitionStage = y.Moving;
  4718. this.model.fadePanoMarkers(0);
  4719. this.awaitCompletion( function() { a() }.bind(this), o);
  4720. this.emit("update.controls")
  4721. }
  4722. }
  4723. ,
  4724. n.prototype.tourInterlude = function() {
  4725. if (h.trackAlways("reach_highlight", {
  4726. reach_source: this.reachSource
  4727. }),
  4728. this.model.fadePanoMarkers(0),
  4729. this.emit("update.controls"),
  4730. this.tourIsPlaying)
  4731. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4732. this.stopTour(),
  4733. this.emit(p.TourEnd),
  4734. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity,null,{player:this}))) : void this.awaitCompletion(function() {//xzw改 fadePanoMarker加了后俩参数
  4735. this.transitionStage = y.Interlude,
  4736. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4737. }
  4738. .bind(this), this.goNext.bind(this))
  4739. }
  4740. ,
  4741. n.prototype.playTour = function() {
  4742. if (!this.bounceable())
  4743. return this.tourIsPlaying ? void A.info("tour is already playing") :
  4744. void (this.wouldInterrupt() ||
  4745. (this.player.emit("tour_auto", this.defaultWarpStyle),
  4746. this.tourInProgress = !0,
  4747. this.reachSource = "play",
  4748. this.tourIsPlaying = !0,
  4749. this.wasZoomEnabled = this.player.zoomEnabled,
  4750. this.player.zoomEnabled = !1,
  4751. this.resetSpecialTransition(),
  4752. this.emit("update.controls"),
  4753. this.emit(p.TourStart),
  4754. this.player.enablePreRendering(),
  4755. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : this.goNext()))
  4756. }
  4757. ,
  4758. n.prototype.bgmReplay = function() {
  4759. }
  4760. ,
  4761. n.prototype.stopTour = function() {
  4762. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4763. this.tourIsPlaying = !1,
  4764. this.interrupt(),
  4765. this.clearWalkingSectionPaused(),
  4766. this.resetSpecialTransition(),
  4767. this.emit("update.controls"))
  4768. }
  4769. ,
  4770. n.prototype.endTourProgress = function() {
  4771. this.tourInProgress = !1,
  4772. this.emit("update.controls"),
  4773. this.emit(p.TourEnd)
  4774. }
  4775. ,
  4776. n.prototype.goToHighlight = function(e) {
  4777. if (this.wouldInterrupt())
  4778. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4779. else {
  4780. if (A.debug("<tour.goto " + e + ">"),
  4781. this.isInterrupted())
  4782. return;
  4783. this.clearWalkingSectionPaused(),
  4784. this.setDestinationItem(e),
  4785. this.useSpecialTransition("Hilight"),
  4786. this.goToDestination(),
  4787. h.trackAlways("reach_highlight", {
  4788. reach_source: "thumb"
  4789. })
  4790. }
  4791. }
  4792. ,
  4793. n.prototype.prevHighlight = function() {
  4794. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4795. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4796. this.reachSource = "prev",
  4797. this.goPrev()))
  4798. }
  4799. ,
  4800. n.prototype.nextHighlight = function() {
  4801. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4802. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4803. this.reachSource = "next",
  4804. this.goNext()))
  4805. }
  4806. ,
  4807. /* n.prototype.op = function(i,option) {//改
  4808. return function(){
  4809. option && option.openPanel && editor.openPanel(option.openPanel);
  4810. i();
  4811. }
  4812. }
  4813. , */
  4814. n.prototype.changeMode = function(e,option) {//模式转换
  4815. var t = $.Deferred()
  4816. , i = t.resolve.bind(t)
  4817. , n = t.reject.bind(t);
  4818. this.emit(p.StartModeChange);
  4819. var r = function() {
  4820. return this.clearWalkingSectionPaused(),
  4821. !!this.wouldInterrupt() && (this.interrupt(),
  4822. !0)
  4823. }
  4824. .bind(this);
  4825. if (!r()) {
  4826. switch (e) {
  4827. case c.PANORAMA:
  4828. this.player.mode === c.PANORAMA ?
  4829. ( this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(this.op(i, option )).fail(n) )
  4830. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4831. break;
  4832. case c.DOLLHOUSE:
  4833. case c.FLOORPLAN:
  4834. this.player.flyToNewMode({
  4835. mode: e
  4836. }).done(i).fail(n);
  4837. break;
  4838. case c.OUTDOOR:
  4839. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA
  4840. && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4841. }
  4842. return t.promise()
  4843. }
  4844. }
  4845. ,
  4846. n.prototype.atEndOfTour = function() {
  4847. var e = this.currentItem >= this.nItems - 1;
  4848. return e
  4849. }
  4850. ,
  4851. n.prototype.firstDestination = function() {
  4852. return this.nItems > 0 ? 0 : null
  4853. }
  4854. ,
  4855. n.prototype.finalDestination = function() {
  4856. return this.nItems > 0 ? this.nItems - 1 : null
  4857. }
  4858. ,
  4859. n.prototype.goPrev = function() {
  4860. this.tourAdvance(-1)
  4861. }
  4862. ,
  4863. n.prototype.goNext = function() {
  4864. this.tourAdvance(1)
  4865. }
  4866. ,
  4867. n.prototype.setDestinationItem = function(e) {
  4868. this.destinationItem = e,
  4869. this.emit("update.controls")
  4870. }
  4871. ,
  4872. n.prototype.setCurrentItem = function(e) {
  4873. this.currentItem = e,
  4874. this.emit("update.controls")
  4875. }
  4876. ,
  4877. n.prototype.nextItem = function(e) {
  4878. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4879. }
  4880. ,
  4881. n.prototype.prevItem = function(e) {
  4882. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4883. }
  4884. ,
  4885. n.prototype.tourAdvance = function(e) {//向前或向后
  4886. A.debug("tourAdvance(" + e + ")");
  4887. /* null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4888. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4889. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4890. this.useSpecialTransition("looping back to start")),
  4891. this.goToDestination() */
  4892. if( this.currentItem === null || void 0 === this.currentItem){//----重构
  4893. this.setDestinationItem(this.firstDestination())
  4894. }else{
  4895. this.setDestinationItem(this.currentItem + e);
  4896. if(this.destinationItem < 0){
  4897. this.setDestinationItem(this.finalDestination());
  4898. this.useSpecialTransition("reverse-looping to end")
  4899. }else{
  4900. if(this.destinationItem >= this.nItems){
  4901. this.setDestinationItem(this.firstDestination());
  4902. this.useSpecialTransition("looping back to start");
  4903. }
  4904. }
  4905. }
  4906. this.goToDestination()
  4907. }
  4908. ,
  4909. t.exports = n
  4910. }
  4911. ).call(this, "/js/director.js")
  4912. }
  4913. , {
  4914. "./analytics": 4,
  4915. "./enum/BlackoutStyle": 18,
  4916. "./enum/ControlEvents": 21,
  4917. "./enum/DirectorEvents": 23,
  4918. "./enum/ModelManagerEvents": 33,
  4919. "./enum/PathDiscardMode": 38,
  4920. "./enum/PathDisplayMode": 39,
  4921. "./enum/PlayerEvents": 40,
  4922. "./enum/Viewmode": 51,
  4923. "./enum/WarpStyle": 52,
  4924. "./model/ModelManager": 140,
  4925. "./player": 155,
  4926. "./settings": 166,
  4927. "./util/logger": 189,
  4928. "./util/transitions": 195,
  4929. events: 202,
  4930. three: 217,
  4931. editor : "Editor"
  4932. }],
  4933. 16: [function(e, t, i) {//"./effects"
  4934. "use strict";
  4935. var n = e("three")
  4936. , r = e("./enum/Viewmode")
  4937. , o = (e("./settings"),
  4938. e("./util/transitions"))
  4939. , a = e("./enum/PlayerEvents")
  4940. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4941. , l = new n.ShaderPass(n.VerticalBlurShader);
  4942. l.renderToScreen = !0;
  4943. var c = $('#player').width() / $('#player').height();
  4944. isNaN(c) && (c = 1);
  4945. var h = {
  4946. currentBlur: 0,
  4947. aspect: c,
  4948. blurStrength: 1,
  4949. hblurPass: s,
  4950. vblurPass: l,
  4951. bindEvents: function(e) {
  4952. e.on(a.ModeChanged, function(e, t) {
  4953. e === r.PANORAMA && (o.cancel(h.blur),
  4954. o.cancel(h.addBlur),
  4955. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4956. })
  4957. },
  4958. blur: function(e) {
  4959. h.currentBlur = e;
  4960. var t = e * h.blurStrength;
  4961. l.uniforms.v.value = t / 512 * h.aspect,
  4962. s.uniforms.h.value = t / 512
  4963. },
  4964. addBlur: function(e) {
  4965. e = Math.max(e, h.currentBlur),
  4966. h.blur(e)
  4967. },
  4968. removeBlur: function(e) {
  4969. e = Math.min(1 - e, h.currentBlur),
  4970. h.blur(e)
  4971. }
  4972. };
  4973. h.blur(0),
  4974. t.exports = h
  4975. }
  4976. , {
  4977. "./enum/PlayerEvents": 40,
  4978. "./enum/Viewmode": 51,
  4979. "./settings": 166,
  4980. "./util/transitions": 195,
  4981. three: 217
  4982. }],
  4983. 17: [function(e, t, i) {//"../enum/AlignmentType
  4984. "use strict";
  4985. t.exports = {
  4986. UNKNOWN: 0,
  4987. ALIGNED: 1,
  4988. UNALIGNED: 2,
  4989. PLACED: 3
  4990. }
  4991. }
  4992. , {}],
  4993. 18: [function(e, t, i) {//"../enum/BlackoutStyle"
  4994. "use strict";
  4995. t.exports = {
  4996. NONE: 0,
  4997. MIDDLE: 1,
  4998. END: 2,
  4999. BEGINNING: 3,
  5000. FADEIN: 4
  5001. }
  5002. }
  5003. , {}],
  5004. 19: [function(e, t, i) {//"../enum/Colors"
  5005. "use strict";
  5006. var n = e("three");
  5007. t.exports = {
  5008. newBlue: new n.Color(4967932),
  5009. altBlue: new n.Color(47355),
  5010. tagDefault: new n.Color(223357),
  5011. classicBlue: new n.Color(53759),
  5012. mpYellow: new n.Color(16502016),
  5013. mpOrange: new n.Color(16428055),
  5014. mpBlue: new n.Color(12096),
  5015. mpLtGrey: new n.Color(13751252),
  5016. mpDkGrey: new n.Color(10000019),
  5017. mpRed: new n.Color(12525854),
  5018. mpOrangeDesat: new n.Color(16764529),
  5019. mpBlueDesat: new n.Color(4034734),
  5020. mpRedDesat: new n.Color(14705505),
  5021. white: new n.Color(16777215),
  5022. black: new n.Color(0),
  5023. _desat: function(e, t) {
  5024. var i = t || .3
  5025. , r = (new n.Color).copy(e).getHSL();
  5026. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5027. },
  5028. _darken: function(e, t) {
  5029. var i = t || .2
  5030. , r = e.getHSL();
  5031. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5032. }
  5033. }
  5034. }
  5035. , {
  5036. three: 217
  5037. }],
  5038. 20: [function(e, t, i) {//"../enum/ControlActions"
  5039. "use strict";
  5040. t.exports = {
  5041. NONE: -1,
  5042. ROTATE: 0,
  5043. DOLLY: 1,
  5044. PAN: 2,
  5045. ROTATE_DOLLY: 3,
  5046. PAN_DOLLY: 4
  5047. }
  5048. }
  5049. , {}],
  5050. 21: [function(e, t, i) {//"./enum/ControlEvents"
  5051. "use strict";
  5052. t.exports = {
  5053. Move: "move",
  5054. InteractionDirect: "interaction.direct",
  5055. InteractionKey: "interaction.key",
  5056. InteractionGui: "interaction.gui",
  5057. FlyInDirection: "fly.direction",
  5058. InputStart: "input.start",
  5059. Pinch: "input.pinch",
  5060. Scroll: "input.scroll",
  5061. AutoPanInterrupt: "autopan.interrupt",
  5062. AutoPanComplete: "autopan.complete",
  5063. AutoPanClamped: "autopan.clamped",
  5064. LongTap: "longtap"
  5065. }
  5066. }
  5067. , {}],
  5068. 22: [function(e, t, i) {//"../enum/Direction"
  5069. "use strict";
  5070. t.exports = Object.freeze({
  5071. FORWARD: "FORWARD",
  5072. LEFT: "LEFT",
  5073. RIGHT: "RIGHT",
  5074. BACK: "BACK",
  5075. UP: "UP",
  5076. DOWN: "DOWN"
  5077. })
  5078. }
  5079. , {}],
  5080. 23: [function(e, t, i) {//"../enum/DirectorEvents"
  5081. "use strict";
  5082. t.exports = {
  5083. ActionInterrupted: "action.interrupted",
  5084. TourStart: "tour.start",
  5085. TourEnd: "tour.end",
  5086. StartModeChange: "mode.startChange"
  5087. }
  5088. }
  5089. , {}],
  5090. 24: [function(e, t, i) {//"../enum/DownloadStatus"
  5091. "use strict";
  5092. t.exports = Object.freeze({
  5093. None: 0,
  5094. Queued: 1,
  5095. ForceQueued: 2,
  5096. Downloading: 3,
  5097. Downloaded: 4,
  5098. DownloadFailed: 5
  5099. })
  5100. }
  5101. , {}],
  5102. 25: [function(e, t, i) {//"../enum/GLCubeFaces"
  5103. "use strict";
  5104. t.exports = {
  5105. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5106. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5107. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5108. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5109. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5110. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5111. }
  5112. }
  5113. , {}],
  5114. 26: [function(e, t, i) {//"../enum/GLTextureType"
  5115. "use strict";
  5116. t.exports = {
  5117. Texture2D: 0,
  5118. TextureCube: 1
  5119. }
  5120. }
  5121. , {}],
  5122. 27: [function(e, t, i) {//"../enum/HelpModalSize
  5123. "use strict";
  5124. t.exports = {
  5125. SMALL: "small",
  5126. LARGE: "large"
  5127. }
  5128. }
  5129. , {}],
  5130. 28: [function(e, t, i) {//"../enum/HelpModalType"
  5131. "use strict";
  5132. var n = e("./Viewmode")
  5133. , r = {
  5134. LANDING: {},
  5135. NAVIGATION: "navigation",
  5136. MORE_HELP: "moreHelp",
  5137. TOUR_INTERACTION: {}
  5138. };
  5139. r.LANDING[n.PANORAMA] = "panorama.landing",
  5140. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5141. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5142. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5143. r.TOUR_INTERACTION.standard = "standard.tour",
  5144. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5145. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5146. t.exports = r
  5147. }
  5148. , {
  5149. "./Viewmode": 51
  5150. }],
  5151. 29: [function(e, t, i) {//"../enum/Joystick"
  5152. "use strict";
  5153. var n = {
  5154. UP: 1,
  5155. DOWN: -1,
  5156. LEFT: "L",
  5157. RIGHT: "R",
  5158. FORWARD: "F",
  5159. BACK: "B",
  5160. reverse: {},
  5161. opposite: function(e) {
  5162. return this.reverse[e.toString()]
  5163. }
  5164. };
  5165. !function() {
  5166. n.reverse[n.UP] = n.DOWN,
  5167. n.reverse[n.DOWN] = n.UP,
  5168. n.reverse[n.LEFT] = n.RIGHT,
  5169. n.reverse[n.RIGHT] = n.LEFT,
  5170. n.reverse[n.FORWARD] = n.BACK,
  5171. n.reverse[n.BACK] = n.FORWARD
  5172. }(),
  5173. t.exports = n
  5174. }
  5175. , {}],
  5176. 30: [function(e, t, i) {//"../enum/Keys"
  5177. "use strict";
  5178. var n = e("../util/browser")
  5179. , r = {
  5180. ZERO: 48,
  5181. ONE: 49,
  5182. TWO: 50,
  5183. THREE: 51,
  5184. FOUR: 52,
  5185. FIVE: 53,
  5186. SIX: 54,
  5187. SEVEN: 55,
  5188. EIGHT: 56,
  5189. NINE: 57,
  5190. LEFTARROW: 37,
  5191. UPARROW: 38,
  5192. RIGHTARROW: 39,
  5193. DOWNARROW: 40,
  5194. A: 65,
  5195. B: 66,
  5196. C: 67,
  5197. D: 68,
  5198. E: 69,
  5199. F: 70,
  5200. G: 71,
  5201. H: 72,
  5202. I: 73,
  5203. J: 74,
  5204. K: 75,
  5205. L: 76,
  5206. M: 77,
  5207. N: 78,
  5208. O: 79,
  5209. P: 80,
  5210. Q: 81,
  5211. R: 82,
  5212. S: 83,
  5213. T: 84,
  5214. U: 85,
  5215. V: 86,
  5216. W: 87,
  5217. X: 88,
  5218. Y: 89,
  5219. Z: 90,
  5220. SPACE: 32,
  5221. RETURN: 13,
  5222. SEMICOLON: 186,
  5223. PLUSEQUALS: 187,
  5224. DASHUNDERSCORE: 189,
  5225. OPENBRACKET: 219
  5226. };
  5227. n.detectFirefox() && (r.SEMICOLON = 59,
  5228. r.PLUSEQUALS = 61,
  5229. r.DASHUNDERSCORE = 173),
  5230. t.exports = r
  5231. }
  5232. , {
  5233. "../util/browser": 182
  5234. }],
  5235. 31: [function(e, t, i) {//"../enum/Locale"
  5236. "use strict";
  5237. t.exports = {
  5238. EN_US: "en-US",
  5239. ES_MX: "es-MX",
  5240. FR_FR: "fr-FR",
  5241. DE_DE: "de-DE",
  5242. RU_RU: "ru-RU",
  5243. CN_CN: "cn-CN",
  5244. JP_JP: "jp-JP"
  5245. }
  5246. }
  5247. , {}],
  5248. 32: [function(e, t, i) {//"../enum/tagEvents"
  5249. "use strict";
  5250. t.exports = {
  5251. TagActivated: "tag.activated",
  5252. TagDismissed: "tag.dismissed",
  5253. TagNavigation: "tag.navigation"
  5254. }
  5255. }
  5256. , {}],
  5257. 33: [function(e, t, i) {//../enum/ModelManagerEvents"
  5258. "use strict";
  5259. t.exports = {
  5260. ModelAdded: "model-added",
  5261. ActiveModelChanged: "active-model-changed"
  5262. }
  5263. }
  5264. , {}],
  5265. 34: [function(e, t, i) {//"../enum/MouseButton"
  5266. "use strict";
  5267. t.exports = {
  5268. LEFT: 0,
  5269. MIDDLE: 1,
  5270. RIGHT: 2
  5271. }
  5272. }
  5273. , {}],
  5274. 35: [function(e, t, i) {//"../enum/PanoRendererEvents"
  5275. "use strict";
  5276. t.exports = {
  5277. PanoRenderComplete: "panorama.render.complete",
  5278. TileRenderFailure: "panorama.tile.render.failed",
  5279. TileRenderSuccess: "panorama.tile.render.success",
  5280. TileUploadAttempted: "panorama.tile.upload.attempted",
  5281. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5282. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5283. }
  5284. }
  5285. , {}],
  5286. 36: [function(e, t, i) {//"./enum/PanoSizeClass"
  5287. "use strict";
  5288. t.exports = {
  5289. BASE: 1,
  5290. STANDARD: 2,
  5291. HIGH: 3,
  5292. ULTRAHIGH: 4
  5293. }
  5294. }
  5295. , {}],
  5296. 37: [function(e, t, i) {//"./enum/PanoramaEvents"
  5297. "use strict";
  5298. t.exports = {
  5299. LoadComplete: "panorama.load.complete",
  5300. LoadFailed: "panorama.load.failed",
  5301. TileLoaded: "panorama.tile.loaded"
  5302. }
  5303. }
  5304. , {}],
  5305. 38: [function(e, t, i) {//"../enum/PathDiscardMode"
  5306. "use strict";
  5307. t.exports = Object.freeze({
  5308. Standard: 0,
  5309. Slow: 1,
  5310. Retain: 2
  5311. })
  5312. }
  5313. , {}],
  5314. 39: [function(e, t, i) {//"../enum/PathDisplayMode
  5315. "use strict";
  5316. t.exports = Object.freeze({
  5317. Show: 0,
  5318. Hide: 1,
  5319. Retain: 2
  5320. })
  5321. }
  5322. , {}],
  5323. 40: [function(e, t, i) {//"./enum/PlayerEvents"
  5324. "use strict";
  5325. t.exports = {
  5326. Move: "move",
  5327. MoveComplete: "move.complete",
  5328. ModeChanged: "mode.changed",
  5329. ModeChanging: "mode.changing",
  5330. PanoChosen: "pano.chosen",
  5331. ClosestPanoChanging: "closest.pano.changing",
  5332. WarpStarted: "warp.started",
  5333. WarpInterrupted: "warp.interrupted",
  5334. WarpEnded: "warp.ended",
  5335. FlyinFinished: "flyin.finished",
  5336. FlyingStarted: "flying.started",
  5337. FlyingInterrupted: "flying.interrupted",
  5338. FlyingEnded: "flying.ended",
  5339. Ready: "ready",
  5340. StartInside: "start.inside",
  5341. StartOutside: "start.outside",
  5342. ViewChanged: "view.changed",
  5343. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5344. InputStart: "input.start"
  5345. }
  5346. }
  5347. , {}],
  5348. 41: [function(e, t, i) {//"./enum/RenderLayers"
  5349. "use strict";
  5350. t.exports = Object.freeze({
  5351. DEFAULT: 0,
  5352. PANOMARKERS: 1,
  5353. RETICULE: 2,
  5354. TAG: 3
  5355. })
  5356. }
  5357. , {}],
  5358. 42: [function(e, t, i) {//"../enum/RenderOrder"
  5359. "use strict";
  5360. t.exports = {
  5361. visibleFloor: 1,
  5362. ghostFloor: 3,
  5363. boundingSkybox: 1,
  5364. panoMarker: 2,
  5365. reticule: 3,
  5366. tagStem: 4,
  5367. tagDisc: 5,
  5368. ribbon: 100
  5369. }
  5370. }
  5371. , {}],
  5372. 43: [function(e, t, i) {//"../enum/SceneRendererEvents"
  5373. "use strict";
  5374. t.exports = {
  5375. ContextCreated: "scene-renderer-context-created",
  5376. AfterRender: "after-render",
  5377. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5378. }
  5379. }
  5380. , {}],
  5381. 44: [function(e, t, i) {//"../enum/TagStates"
  5382. "use strict";
  5383. t.exports = {
  5384. IDLE: "idle",
  5385. BROWSE: "browse",
  5386. EXAMINE: "examine"
  5387. }
  5388. }
  5389. , {}],
  5390. 45: [function(e, t, i) {//"../enum/TileDownloaderEvents"
  5391. "use strict";
  5392. t.exports = {
  5393. TileDownloadSuccess: "tiledownloader.download.success",
  5394. TileDownloadFailure: "tiledownloader.download.failure",
  5395. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5396. }
  5397. }
  5398. , {}],
  5399. 46: [function(e, t, i) {//"../../enum/VRApps"
  5400. "use strict";
  5401. t.exports = {
  5402. CardboardAndroid: "googlevr",
  5403. GearVR: "gearvr",
  5404. CardboardIOS: "googlevrios",
  5405. Cardboard: "googlevr"
  5406. }
  5407. }
  5408. , {}],
  5409. 47: [function(e, t, i) {//"../enum/VROption"
  5410. "use strict";
  5411. t.exports = {
  5412. NONE: 0,
  5413. CONTEXTUAL: 1,
  5414. ANDROID: 2
  5415. }
  5416. }
  5417. , {}],
  5418. 48: [function(e, t, i) {//"../../enum/VRPages"
  5419. "use strict";
  5420. var n = {
  5421. Title: 0,
  5422. Cardboard: 1
  5423. }
  5424. , r = {
  5425. Title: 0,
  5426. Cardboard: 1,
  5427. Gear: 2
  5428. };
  5429. !function() {
  5430. [n, r].forEach(function(e) {
  5431. e.pageCount = Object.keys(e).length
  5432. })
  5433. }(),
  5434. t.exports.ios = n,
  5435. t.exports.standard = r
  5436. }
  5437. , {}],
  5438. 49: [function(e, t, i) {//"../../enum/VRPlatforms"
  5439. "use strict";
  5440. t.exports = {
  5441. Android: "android",
  5442. IOS: "ios",
  5443. Desktop: "desktop",
  5444. UnsupportedAndroid: "android-unsupported"
  5445. }
  5446. }
  5447. , {}],
  5448. 50: [function(e, t, i) {//"../enum/Vectors"
  5449. "use strict";
  5450. var n = e("three");
  5451. t.exports = {
  5452. UP: new n.Vector3(0,1,0),
  5453. DOWN: new n.Vector3(0,-1,0),
  5454. LEFT: new n.Vector3(-1,0,0),
  5455. RIGHT: new n.Vector3(1,0,0),
  5456. FORWARD: new n.Vector3(0,0,-1),
  5457. BACK: new n.Vector3(0,0,1)
  5458. }
  5459. }
  5460. , {
  5461. three: 217
  5462. }],
  5463. 51: [function(e, t, i) {//"./enum/Viewmode"
  5464. "use strict";
  5465. var n = e("../exception/ViewmodeConvertException")
  5466. , r = e("./coreViewmodes")
  5467. , o = e("../util/common")
  5468. , a = {
  5469. MESH: "mesh",
  5470. OUTDOOR: "outdoor",
  5471. TRANSITIONING: "transitioning",
  5472. toInt: function(e) {
  5473. switch (e) {
  5474. case this.PANORAMA:
  5475. return 1;
  5476. case this.DOLLHOUSE:
  5477. return 2;
  5478. case this.FLOORPLAN:
  5479. return 3;
  5480. case this.OUTDOOR:
  5481. return 4;
  5482. case this.TRANSITIONING:
  5483. return -1
  5484. }
  5485. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5486. },
  5487. fromInt: function(e) {
  5488. switch (e) {
  5489. case "1":
  5490. case 1:
  5491. return this.PANORAMA;
  5492. case "2":
  5493. case 2:
  5494. return this.DOLLHOUSE;
  5495. case "3":
  5496. case 3:
  5497. return this.FLOORPLAN;
  5498. case "4":
  5499. case 4:
  5500. return this.OUTDOOR
  5501. }
  5502. throw new n("No known conversion for int to viewmode for int: " + e)
  5503. },
  5504. convertWorkshopModeInt: function(e) {
  5505. switch (e) {
  5506. case "0":
  5507. case 0:
  5508. return this.PANORAMA;
  5509. case "1":
  5510. case 1:
  5511. return this.FLOORPLAN;
  5512. case "2":
  5513. case 2:
  5514. return this.DOLLHOUSE;
  5515. case "3":
  5516. case 3:
  5517. return this.MESH
  5518. }
  5519. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5520. }
  5521. };
  5522. o.extendObject(a, r),
  5523. t.exports = a
  5524. }
  5525. , {
  5526. "../exception/ViewmodeConvertException": 58,
  5527. "../util/common": 185,
  5528. "./coreViewmodes": 54
  5529. }],
  5530. 52: [function(e, t, i) {//"./enum/WarpStyle"
  5531. "use strict";
  5532. t.exports = {
  5533. BLACK: "black",
  5534. STD: "std",
  5535. WALK: "walk"
  5536. }
  5537. }
  5538. , {}],
  5539. 53: [function(e, t, i) {//"../enum/ZoomEvents"
  5540. "use strict";
  5541. t.exports = {
  5542. ZoomIn: "zoom.in",
  5543. ZoomOut: "zoom.out",
  5544. ZoomMax: "zoom.max",
  5545. ZoomMin: "zoom.min"
  5546. }
  5547. }
  5548. , {}],
  5549. 54: [function(e, t, i) {//"./coreViewmodes"
  5550. "use strict";
  5551. t.exports = {
  5552. PANORAMA: "panorama",
  5553. DOLLHOUSE: "dollhouse",
  5554. FLOORPLAN: "floorplan"
  5555. }
  5556. }
  5557. , {}],
  5558. 55: [function(e, t, i) {//"./BasicException"
  5559. "use strict";
  5560. function n(e) {
  5561. this.message = e
  5562. }
  5563. t.exports = n
  5564. }
  5565. , {}],
  5566. 56: [function(e, t, i) {//"../exception/DeviceMismatchException"
  5567. "use strict";
  5568. function n(e) {
  5569. r.call(this, e)
  5570. }
  5571. var r = e("./BasicException");
  5572. n.prototype = Object.create(r.prototype),
  5573. t.exports = n
  5574. }
  5575. , {
  5576. "./BasicException": 55
  5577. }],
  5578. 57: [function(e, t, i) {//"../exception/RendererCreationException"
  5579. "use strict";
  5580. function n(e) {
  5581. r.call(this, e)
  5582. }
  5583. var r = e("./BasicException");
  5584. n.prototype = Object.create(r.prototype),
  5585. t.exports = n
  5586. }
  5587. , {
  5588. "./BasicException": 55
  5589. }],
  5590. 58: [function(e, t, i) {//"../exception/ViewmodeConvertException"
  5591. "use strict";
  5592. function n(e) {
  5593. r.call(this, e)
  5594. }
  5595. var r = e("./BasicException");
  5596. n.prototype = Object.create(r.prototype),
  5597. t.exports = n
  5598. }
  5599. , {
  5600. "./BasicException": 55
  5601. }],
  5602. 59: [function(e, t, i) {///js/featureflags.js
  5603. (function(i) {
  5604. "use strict";
  5605. function n(e) {
  5606. var t = {};
  5607. if (e) {
  5608. var i = e.flags;
  5609. if (i)
  5610. for (var n in i)
  5611. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5612. return t
  5613. }
  5614. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5615. null
  5616. }
  5617. var r = e("./util/ajax")
  5618. , o = e("./util/showcase")
  5619. , a = e("./util/logger")
  5620. //, s = "/api/v1/user/"
  5621. , s = "/data/"
  5622. , l = new a(i)
  5623. , c = {};
  5624. t.exports = {
  5625. loadFeatureFlags: function(e) {
  5626. var t = $.Deferred();
  5627. return r.get(e.urlBase + s, {
  5628. responseType: "json",
  5629. prefetchFrom: "user",
  5630. auth: o.getAuthorizationHeader()
  5631. }).done(function(e) {
  5632. c = n(e),
  5633. c ? t.resolve(c) : t.reject("loading-failed")
  5634. }).fail(function() {
  5635. l.debug("Retrieval of feature flags failed."),
  5636. t.reject("loading-failed")
  5637. }),
  5638. t.promise()
  5639. },
  5640. getFlags: function() {
  5641. return c
  5642. },
  5643. updateDependentSettings: function(e, t) {
  5644. e = e || c,
  5645. e.labels && (t.labels.enabled = !0),
  5646. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5647. e.showcase_sdk && (t.sdkInit = !0),
  5648. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5649. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5650. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5651. e.hide_sc_sharing && (t.share.enabled = !1)
  5652. }
  5653. }
  5654. }
  5655. ).call(this, "/js/featureflags.js")
  5656. }
  5657. , {
  5658. "./util/ajax": 181,
  5659. "./util/logger": 189,
  5660. "./util/showcase": 193
  5661. }],
  5662. 60: [function(e, t, i) {//../util/common
  5663. "use strict";
  5664. var n = (e("../util/common"),
  5665. {
  5666. status: 0,
  5667. set: function(e) {
  5668. var t = e
  5669. , i = $("#bar");
  5670. if (isNaN(t))
  5671. return !1;
  5672. var n = i.attr("r")
  5673. , r = Math.PI * (2 * n);
  5674. t = Math.max(Math.min(t, 100), 0);
  5675. var o = (100 - t) / 100 * r;
  5676. o = Math.max(Math.min(o, 295.3), 0),
  5677. i.css({
  5678. strokeDashoffset: o
  5679. }),
  5680. $("#cont").attr("data-pct", t),
  5681. this.status = e
  5682. },
  5683. done: function(e) {
  5684. return e || this.status ? (this.status = null,
  5685. this.set(100)) : this
  5686. }
  5687. });
  5688. t.exports.circleLoader = n
  5689. }
  5690. , {
  5691. "../util/common": 185
  5692. }],
  5693. 61: [function(e, t, i) {//"./closer/ModalCloserEvent"
  5694. "use strict";
  5695. t.exports = Object.freeze({
  5696. CLOSE: "modal.closer.close"
  5697. })
  5698. }
  5699. , {}],
  5700. 62: [function(e, t, i) {//"./closer/modalCloser"
  5701. "use strict";
  5702. function n(e, t) {
  5703. t && (t.stopPropagation(),
  5704. t.preventDefault()),
  5705. e && this.emit(l.CLOSE, e),
  5706. g.reset()
  5707. }
  5708. function r(e, t) {
  5709. function i() {
  5710. var t = e.offsetHeight >= $('#player').width() && e.offsetWidth >= $('#player').height();
  5711. t !== f && (f = t,
  5712. t ? (e.classList.add("closeByFooter"),
  5713. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5714. h.classList.remove("closeByFooter")))
  5715. }
  5716. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5717. }
  5718. var o = e("../../settings")
  5719. , a = (e("../../tag/Media/MediaEvent"),
  5720. e("../../util/browser"))
  5721. , s = e("../../util/common")
  5722. , l = e("./ModalCloserEvent")
  5723. , c = e("events").EventEmitter
  5724. , h = document.getElementsByClassName("footer")[0]
  5725. , u = h.querySelectorAll(".close")[0]
  5726. , d = null
  5727. , p = null
  5728. , f = null
  5729. , g = (a.isMobile(),
  5730. {
  5731. open: function(e) {
  5732. e && (r(e),
  5733. d && u.removeEventListener("click", d, !0),
  5734. d = n.bind(this, e.id),
  5735. u.addEventListener("click", d, !0),
  5736. p && window.removeEventListener("resize", p, !0),
  5737. p = r.bind(this, e),
  5738. window.addEventListener("resize", p, !0))
  5739. },
  5740. reset: function() {
  5741. h.classList.remove("closeByFooter"),
  5742. u.removeEventListener("click", d, !0),
  5743. window.removeEventListener("resize", p, !0),
  5744. d = p = f = null
  5745. }
  5746. });
  5747. s.extendObject(g, c.prototype),
  5748. t.exports = g
  5749. }
  5750. , {
  5751. "../../tag/Media/MediaEvent": 131,
  5752. "../../settings": 166,
  5753. "../../util/browser": 182,
  5754. "../../util/common": 185,
  5755. "./ModalCloserEvent": 61,
  5756. events: 202
  5757. }],
  5758. 63: [function(e, t, i) {//"./debug"
  5759. "use strict";
  5760. function n(e, t, i) {
  5761. var n = new r.GUI({
  5762. width: 400
  5763. })
  5764. , u = n.addFolder("Flydown from Dollhouse");
  5765. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5766. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5767. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5768. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5769. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5770. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5771. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5772. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5773. var d = n.addFolder("Transition between panos");
  5774. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5775. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5776. h.transition.flyTime = 0,
  5777. d.__controllers.forEach(function(e) {
  5778. e.updateDisplay()
  5779. })
  5780. }),
  5781. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5782. h.transition.flySpeed = 0,
  5783. d.__controllers.forEach(function(e) {
  5784. e.updateDisplay()
  5785. })
  5786. }),
  5787. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5788. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5789. d.add(h.transition, "movementEasing", Object.keys(a));
  5790. var p = n.addFolder("Path Display");
  5791. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5792. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5793. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5794. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5795. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5796. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5797. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5798. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5799. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5800. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5801. h.path.color = l[h.path.color],
  5802. h.path.colorUp = l._desat(h.path.color),
  5803. h.path.colorDown = l.darken(h.path.color)
  5804. }),
  5805. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5806. h.reticuleColor = l[h.reticuleColor]
  5807. });
  5808. var f = n.addFolder("Warping")
  5809. , g = f.addFolder("Warp/Teleport");
  5810. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5811. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5812. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5813. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5814. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5815. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5816. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5817. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5818. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5819. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5820. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5821. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5822. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5823. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5824. h.path.typ = c[h.path.typ]
  5825. }),
  5826. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5827. t.endlessLoop = h.warp.loop
  5828. }),
  5829. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5830. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5831. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5832. var m = f.addFolder("Long Warp Only");
  5833. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5834. h.warp.flySpeed = 0,
  5835. m.__controllers.forEach(function(e) {
  5836. e.updateDisplay()
  5837. })
  5838. }),
  5839. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5840. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5841. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5842. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5843. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5844. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5845. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5846. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5847. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5848. var v = n.addFolder("Warp Esoterica");
  5849. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5850. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5851. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5852. h.warp.minWarpTime = 0,
  5853. v.__controllers.forEach(function(e) {
  5854. e.updateDisplay()
  5855. })
  5856. }),
  5857. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5858. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5859. v.add(h.warp, "movementEasing", Object.keys(a));
  5860. var A = n.addFolder("Misc");
  5861. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5862. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5863. }),
  5864. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5865. i.cameras[s.PANORAMA].fov = h.insideFOV
  5866. }),
  5867. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5868. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5869. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5870. var y = n.addFolder("Navigation");
  5871. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5872. h.navigation.panoScores || e.panos.forEach(function(e) {
  5873. e.floor.remove(e.text3d),
  5874. e.text3d = null
  5875. })
  5876. }),
  5877. y.add(h.navigation, "mouseDirection"),
  5878. y.add(h.navigation, "filterStrictness", 0, 1),
  5879. y.add(h.navigation, "angleFactor", -60, 0),
  5880. y.add(h.navigation, "directionFactor", 1, 20),
  5881. y.add(h.navigation, "distanceFactor", -5, 5),
  5882. y.add(h.navigation, "optionalityFactor", .1, 10);
  5883. var C = n.addFolder("tags")
  5884. , I = C.addFolder("Tag Creation");
  5885. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5886. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5887. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5888. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5889. var E = C.addFolder("Visibility");
  5890. E.add(h.tags.visibility, "anyDistance"),
  5891. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5892. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5893. E.add(h.tags.visibility, "hideViaFloor"),
  5894. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5895. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5896. var b = C.addFolder("Disc Parameters");
  5897. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5898. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5899. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5900. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5901. }),
  5902. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5903. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5904. }),
  5905. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5906. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5907. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5908. var w = C.addFolder("Navigate");
  5909. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5910. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5911. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5912. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5913. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5914. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5915. var _ = n.addFolder("Debug");
  5916. _.add(h, "wireframe").onFinishChange(function() {
  5917. e.chunks.forEach(function(t) {
  5918. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5919. t.wireframeTwin.material.depthWrite = !1,
  5920. t.wireframeTwin.material.depthTest = !1,
  5921. t.wireframeTwin.material.opacity = .5,
  5922. t.wireframeTwin.material.transparent = !0),
  5923. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5924. })
  5925. }),
  5926. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5927. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5928. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5929. e.skybox.wireframe = null)
  5930. }),
  5931. _.add(h, "showSweeps").onFinishChange(function() {
  5932. e.setSweepVisibility(h.showSweeps)
  5933. }),
  5934. _.add(h, "showMesh").onFinishChange(function() {
  5935. e.chunks.forEach(function(e) {
  5936. e.visible = h.showMesh
  5937. })
  5938. }),
  5939. _.add(h, "showFloors").onFinishChange(function() {
  5940. e.floors.forEach(function(e) {
  5941. e.collider.children.forEach(function(e) {
  5942. e.material.visible = h.showFloors
  5943. })
  5944. })
  5945. }),
  5946. _.add(h, "showSkyboxes").onFinishChange(function() {
  5947. e.panos.forEach(function(e) {
  5948. e.skyboxMesh.visible = h.showSkyboxes
  5949. })
  5950. }),
  5951. _.add(h, "showNeighbors").onChange(function() {}),
  5952. _.add(e, "alpha", 0, 1)
  5953. }
  5954. var r = e("../lib/dat.gui")
  5955. , o = e("three")
  5956. , a = e("../util/easing")
  5957. , s = e("../enum/Viewmode")
  5958. , l = e("../enum/Colors")
  5959. , c = e("../enum/WarpStyle")
  5960. , h = e("../settings");
  5961. e("../tag/tag");
  5962. r.GUI.prototype.removeFolder = function(e) {
  5963. var t = this.__folders[e];
  5964. t && (t.close(),
  5965. this.__ul.removeChild(t.domElement.parentNode),
  5966. delete this.__folders[e],
  5967. this.onResize())
  5968. }
  5969. ,
  5970. t.exports.toggle = n
  5971. }
  5972. , {
  5973. "../enum/Colors": 19,
  5974. "../enum/Viewmode": 51,
  5975. "../enum/WarpStyle": 52,
  5976. "../lib/dat.gui": 93,
  5977. "../tag/tag": 123,
  5978. "../settings": 166,
  5979. "../util/easing": 186,
  5980. three: 217
  5981. }],
  5982. 64: [function(e, t, i) {///js/gui/error.js
  5983. (function(i) {
  5984. "use strict";
  5985. function n(e, t, i, n) {
  5986. $(".gui-error .error-problem-text").text(e),
  5987. $(".gui-error .error-solution-text").text(t),
  5988. $(".gui-error .error-explanation").text(i),
  5989. $(".gui-error .error-actions").html(n),
  5990. $(window).resize(),
  5991. $(".gui-error").fadeIn(),
  5992. $("#bottom-logo").fadeIn()
  5993. }
  5994. function r(e) {
  5995. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  5996. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5997. s.isMobile() || $("[rel=tiletip]").tooltip({
  5998. placement: "bottom",
  5999. delay: {
  6000. show: 50,
  6001. hide: 0
  6002. },
  6003. trigger: "hover",
  6004. viewport: {
  6005. selector: "body",
  6006. padding: 10
  6007. }
  6008. })
  6009. }
  6010. function o() {
  6011. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6012. , t = [h.ERROR_GENERIC_ACTIONS_1, e, '<a class="link" target="_blank" href=', p, ">" + h.ERROR_GENERIC_ACTIONS_4 + "</a>."].join("");
  6013. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6014. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6015. e.preventDefault(),
  6016. e.stopPropagation(),
  6017. r(" ")
  6018. })
  6019. }
  6020. function a(e) {
  6021. if ($("head title").text(c.pageTitle),
  6022. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6023. $("#gui-loading").fadeOut(250),
  6024. $("#quick-blackout").hide(),
  6025. l.track("showcase_error", {
  6026. error_key: e
  6027. }),
  6028. h.locale || h.init(),
  6029. "webgl-unsupported" === e)
  6030. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6031. else if ("webgl-ios" === e)
  6032. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6033. else if ("webgl-safari" === e)
  6034. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6035. else if ("webgl-generic" === e)
  6036. o();
  6037. else if ("missing-urls" === e)
  6038. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6039. else if ("loading-failed" === e)
  6040. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6041. else {
  6042. if ("loading-failed-maintenance" !== e)
  6043. return void d.error("Unhandled error: " + e);
  6044. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6045. }
  6046. }
  6047. var s = e("./../util/browser")
  6048. , l = e("./../analytics")
  6049. , c = e("./../settings")
  6050. , h = e("../localization/localize")
  6051. , u = e("./../util/logger")
  6052. , d = new u(i)
  6053. , p = '"https://support.port.com/hc/articles/208220058"';
  6054. t.exports.error = a
  6055. }
  6056. ).call(this, "/js/gui/error.js")
  6057. }
  6058. , {
  6059. "../localization/localize": 108,
  6060. "./../analytics": 4,
  6061. "./../settings": 166,
  6062. "./../util/browser": 182,
  6063. "./../util/logger": 189
  6064. }],
  6065. 65: [function(e, t, i) {//"./gui"
  6066. (function(i) {
  6067. "use strict";
  6068. function n() {
  6069. Ue = [],
  6070. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6071. Ue.push(".hideTarget", ".pinTop.right")
  6072. }
  6073. function r() {
  6074. for (var e in je)
  6075. if (je.hasOwnProperty(e)) {
  6076. var t = je[e];
  6077. if (!t.visible)
  6078. for (var i = 0; i < t.elements.length; i++)
  6079. $(t.elements[i]).hide()
  6080. }
  6081. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6082. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6083. n()
  6084. }
  6085. function o(e, t) {
  6086. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6087. $("#gui-zoomin").toggle(i),
  6088. $("#gui-zoomout").toggle(i)
  6089. }
  6090. function a() {
  6091. c(),
  6092. $(".pinBottom").toggleClass("open"),
  6093. $("#drawer").toggleClass("open"),
  6094. $(".footer").toggleClass("open"),
  6095. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6096. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6097. ie.resetDrawer()),
  6098. setTimeout(function() {
  6099. $("#pullTab").toggleClass("opened")
  6100. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6101. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6102. }
  6103. function s(e) {
  6104. var t;
  6105. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6106. t = e.position().top + e.outerHeight(),
  6107. e.attr("style", "display: none"));
  6108. var i = $("#player").outerHeight()
  6109. , n = i - 130;
  6110. return n < t + 25
  6111. }
  6112. function l(e) {
  6113. "touchstart" === e.type && e.preventDefault(),
  6114. e.stopPropagation()
  6115. }
  6116. function c() {
  6117. W && (W.reload(),
  6118. W.init())
  6119. }
  6120. function h(e) {
  6121. ne.show(e),
  6122. r()
  6123. }
  6124. function u(e) {
  6125. ne.progress(e)
  6126. }
  6127. function d(e, t, i) {
  6128. var n = t.player;
  6129. $("#gui-thumb").fadeOut(2500),
  6130. ne.hide(function() {
  6131. Ge = !1
  6132. }),
  6133. me.init(e, i),
  6134. de.finishSetup(Object.keys(e.tags).length),
  6135. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6136. var s = function() {
  6137. i.dismissExaminedTag(),
  6138. i.disableHovering()
  6139. };
  6140. Ae.on(ye.OPENED, s),
  6141. Ce.on(Me.OPENED, s),
  6142. he.on(ue.OPENED, s),
  6143. fe.on(ge.OPENED, s);
  6144. var l = i.enableHovering.bind(i);
  6145. if (Ae.on(ye.CLOSED, l),
  6146. Ce.on(Me.CLOSED, l),
  6147. he.on(ue.CLOSED, l),
  6148. fe.on(ge.CLOSED, l),
  6149. Q.labels.enabled && Object.keys(e.labels).length,
  6150. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6151. C(e.currentFloor, n.mode)),
  6152. r(),
  6153. o(t, t.player),
  6154. $("#gui").fadeIn(1500),
  6155. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6156. a(),
  6157. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6158. }, 2e3),
  6159. !K.isMobile())
  6160. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6161. $(c[h]).addClass("hasHover");
  6162. O(e),
  6163. de.setupToggling()
  6164. }
  6165. function p(e) {
  6166. e || (e = 0),
  6167. We = !1,
  6168. window.setTimeout(function() {
  6169. We || (ze = !0,
  6170. $("#gui-spinner").stop(!0, !0).show())
  6171. }
  6172. .bind(this), e)
  6173. }
  6174. function f() {
  6175. $("#gui-spinner").stop(!0, !0),
  6176. $("#gui-spinner").fadeOut(1e3),
  6177. We = !0,
  6178. ze = !1
  6179. }
  6180. function g(e, t) {
  6181. var i = e.mode
  6182. , n = t || e.currentPano;
  6183. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6184. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6185. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6186. Q.show360Views.enabled && !n.isAligned() ? ($("#gui-modes-inside").removeClass("hidden"),
  6187. $(".gui-floor").addClass("hidden"),
  6188. $("#gui-modes-outside").addClass("desktop-only")) : ($("#gui-modes-inside").addClass("hidden"),
  6189. $(".gui-floor").removeClass("hidden"),
  6190. $("#gui-modes-outside").removeClass("desktop-only")),
  6191. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6192. Be = i,
  6193. $("#gui-modes-outside").addClass("hidden"),
  6194. $("#gui-modes-inside").removeClass("hidden"),
  6195. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6196. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6197. }
  6198. var editor = e("editor")
  6199. /* function m(e, t) { // MP
  6200. var i = t.player;
  6201. $("#gui-modes-inside").find("a").on("click", function(e) {
  6202. l(e),
  6203. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6204. J.track("showcase_gui", {
  6205. gui_action: "click_inside_mode_button"
  6206. }),
  6207. t.changeMode(_e.PANORAMA)
  6208. }),
  6209. $("#gui-modes-outside").find("a").on("click", function(e) {
  6210. l(e),
  6211. J.track("showcase_gui", {
  6212. gui_action: "click_outside_mode_button"
  6213. }),
  6214. t.changeMode(Be)
  6215. }),
  6216. $("#gui-modes-floorplan").on("click", function(e) {
  6217. l(e),
  6218. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6219. gui_action: "click_floorplan_mode_button"
  6220. }),
  6221. t.changeMode(_e.FLOORPLAN))
  6222. }),
  6223. $("#gui-modes-dollhouse").on("click", function(e) {
  6224. l(e),
  6225. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6226. gui_action: "click_dollhouse_mode_button"
  6227. }),
  6228. t.changeMode(_e.DOLLHOUSE))
  6229. })
  6230. }
  6231. */
  6232. function m(e, t) {//模式转换 xzw
  6233. var i = t.player;
  6234. var open = function(option){
  6235. if(i.mode != "transitioning" && option && option.openPanel!=void 0) editor.openPanel(option.openPanel);
  6236. //else console.log(i.mode)
  6237. }
  6238. var inside = function(e, o){
  6239. e && l(e);
  6240. open(o);
  6241. J.updateInteraction(Se.InteractionGui, "inside-button"), //删掉似乎也没影响?
  6242. J.track("showcase_gui", {
  6243. gui_action: "click_inside_mode_button"
  6244. }),
  6245. t.changeMode(_e.PANORAMA, o);
  6246. }
  6247. var floorplan = function(e, o){
  6248. e && l(e),
  6249. open(o),
  6250. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6251. gui_action: "click_floorplan_mode_button"
  6252. }),
  6253. t.changeMode(_e.FLOORPLAN));
  6254. }
  6255. var dollhouse = function(e, o){
  6256. e && l(e),
  6257. open(o),
  6258. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6259. gui_action: "click_dollhouse_mode_button"
  6260. }),
  6261. t.changeMode(_e.DOLLHOUSE, o));
  6262. };
  6263. var outside = function(e ){
  6264. e && l(e);
  6265. if(Be == _e.DOLLHOUSE) open({openPanel:1})
  6266. else open({openPanel:2})
  6267. J.track("showcase_gui", {
  6268. gui_action: "click_outside_mode_button"
  6269. })
  6270. t.changeMode(Be)
  6271. }
  6272. //modes
  6273. $("#gui-modes-inside").find("a").on("click", function(e){ inside(e, {openPanel:3})}),
  6274. $("#gui-modes-outside").find("a").on("click", function(e){ outside(e )}),
  6275. $("#gui-modes-dollhouse").on("click", function(e){ dollhouse(e, {openPanel:1})})
  6276. $("#gui-modes-floorplan").on("click", function(e){ floorplan(e, {openPanel:2})})
  6277. //tabs
  6278. $("#hotPoint").click( function(){ inside(null, {openPanel:0})} )// 和点击 #gui-modes-inside 不同
  6279. $("#myStyleZ").click( function(){ dollhouse(null, {openPanel:1})} )// 相当于点 #gui-modes-dollhouse
  6280. $("#drawWall").click( function(){ floorplan(null, {openPanel:2})} )// 相当于点 #gui-modes-floorplan
  6281. $("#information").click( function(){ inside(null, {openPanel:3})} ) // 相当于点 #gui-modes-inside
  6282. }
  6283. function v(e, t) {
  6284. function i() {
  6285. document.getElementById("vr").classList.remove("hidden"),
  6286. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6287. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6288. $(".improper-embed").toggleClass("hidden", !1),
  6289. r())
  6290. }, function(e) {
  6291. r()
  6292. }) : r()
  6293. }
  6294. function n(i) {
  6295. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6296. Ie.init(e.data, t, i, q),
  6297. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6298. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6299. }
  6300. function r() {
  6301. De.info("WebVR support not found, VR button activates native app VR modal"),
  6302. Ae.init(e.data, q),
  6303. Ae.on(ye.OPENED, function() {
  6304. var e = document.getElementById("vr-modal");
  6305. return function() {
  6306. Ze("vr"),
  6307. le.open(e)
  6308. }
  6309. }()),
  6310. Ae.on(ye.CLOSED, le.reset)
  6311. }
  6312. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6313. switch (Q.vr.option) {
  6314. case Pe.CONTEXTUAL:
  6315. i();
  6316. break;
  6317. case Pe.ANDROID:
  6318. K.detectAndroid() && i();
  6319. break;
  6320. case Pe.NONE:
  6321. }
  6322. }
  6323. function A(e, t) {
  6324. $("#play").find("a").on("mousedown touchstart", function(e) {
  6325. l(e),
  6326. Ze("tour"),
  6327. ve.play(),
  6328. J.trackAlways("showcase_gui", {
  6329. gui_action: "play_highlights"
  6330. })
  6331. }),
  6332. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6333. l(e),
  6334. ve.pause(),
  6335. J.trackAlways("showcase_gui", {
  6336. gui_action: "pause_highlights"
  6337. })
  6338. }),
  6339. $("#gui-zoomin").find("a").on("click", function(e) {
  6340. l(e),
  6341. t.player.zoomInIncrementally()
  6342. }),
  6343. $("#gui-zoomout").find("a").on("click", function(e) {
  6344. l(e),
  6345. t.player.zoomOutIncrementally()
  6346. })
  6347. }
  6348. function y(e, t) {
  6349. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6350. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6351. $(".gui-floor").find(".container").prepend(r)
  6352. }
  6353. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6354. i.on("click", function(e) {
  6355. l(e),
  6356. Ze("floor"),
  6357. i.toggleClass("open")
  6358. }),
  6359. $(".floorChoice").on("click", function(e) {
  6360. l(e);
  6361. var n = $(this).data("index");
  6362. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6363. t.player.gotoFloor(n),
  6364. J.track("showcase_gui", {
  6365. gui_action: "click_floor_select_button",
  6366. interaction_source: "gui"
  6367. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6368. Ze("move"),
  6369. t.allFloors(),
  6370. J.track("showcase_gui", {
  6371. gui_action: "click_toggle_all_floors_button",
  6372. interaction_source: "gui"
  6373. })),
  6374. i.removeClass("open")
  6375. })
  6376. }
  6377. function C(e, t) {
  6378. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? $(".allFloorBtn").show() : $(".allFloorBtn").hide(),
  6379. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6380. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6381. $(".floorChoice").removeClass("active"),
  6382. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6383. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6384. $(".floorChoice").removeClass("active"),
  6385. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6386. }
  6387. function I(e) {
  6388. return e.describe().inTransition
  6389. }
  6390. function E(e) {
  6391. $("<img/>").attr("src", e).on("load", function() {
  6392. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6393. $(this).remove()
  6394. })
  6395. }
  6396. function b(e, t, i) {
  6397. Fe = e.heroLocations.length;
  6398. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6399. , r = 100 / Fe + "%"
  6400. , o = $("#thumb-container")
  6401. , a = $("#progressBar");
  6402. $("#status").find(".totalSteps").text(Fe);
  6403. for (var s = 0; s < Fe; s++) {
  6404. var c = e.heroLocations[s]
  6405. , h = $(n);
  6406. if (h.attr("data-index", s),
  6407. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6408. c.name) {
  6409. var u = $('<div class="overlay"></div>').text(c.name);
  6410. h.prepend(u)
  6411. }
  6412. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6413. var d = e.panos.get(c.panoId)
  6414. , p = d && !d.isAligned()
  6415. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6416. h.prepend(f)
  6417. }
  6418. o.append(h),
  6419. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6420. }
  6421. j = 144 * Fe,
  6422. Y = 111 * Fe,
  6423. $(".thumbImg").on("mouseover", function() {
  6424. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6425. }),
  6426. $(".thumbImg").on("mouseout", function() {
  6427. t.clearPath()
  6428. }),
  6429. $(".thumbImg").on("click", function(e) {
  6430. l(e);
  6431. var i = $(this);
  6432. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6433. J.trackAlways("showcase_gui", {
  6434. gui_action: "click_highlight"
  6435. }),
  6436. t.goToHighlight(i.data("index"))
  6437. }),
  6438. $(".previous").find("a").on("click", function(e) {
  6439. l(e),
  6440. J.trackAlways("showcase_gui", {
  6441. gui_action: "prev_highlight"
  6442. }),
  6443. t.prevHighlight()
  6444. }),
  6445. $(".next").find("a").on("click", function(e) {
  6446. l(e),
  6447. J.trackAlways("showcase_gui", {
  6448. gui_action: "next_highlight"
  6449. }),
  6450. t.nextHighlight()
  6451. }),
  6452. $("#drawer").on("mouseleave", function(e) {
  6453. l(e);
  6454. var t;
  6455. try {
  6456. t = new MouseEvent("mouseup",{
  6457. clientX: e.clientX,
  6458. clientY: e.clientY,
  6459. screenX: e.screenX,
  6460. screenY: e.screenY
  6461. })
  6462. } catch (i) {
  6463. t = document.createEvent("MouseEvents"),
  6464. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  6465. }
  6466. document.dispatchEvent(t)
  6467. }),
  6468. W = new Sly($("#scrollFrame"),{
  6469. horizontal: !0,
  6470. itemNav: "centered",
  6471. smart: !0,
  6472. scrollTrap: !0,
  6473. scrollBy: 1,
  6474. mouseDragging: !0,
  6475. touchDragging: !0,
  6476. speed: 300,
  6477. dragHandle: !0,
  6478. dynamicHandle: !0,
  6479. clickBar: !0,
  6480. scrollBar: $("#scroller"),
  6481. activateOn: null
  6482. }).init(),
  6483. W.on("active", function(e, t) {
  6484. Ve = t,
  6485. Ze("tour"),
  6486. $(".step").removeClass("active"),
  6487. $("#status").find(".curIdx").text(t + 1);
  6488. for (var i = 0; i <= t; i++)
  6489. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6490. }),
  6491. w()
  6492. }
  6493. function w() {
  6494. var e = $('#player').width() - 20
  6495. , t = $("#scroller")
  6496. , i = $("#drawer")
  6497. , n = $(".pinBottom");
  6498. if ($('#player').width() < 488 || $('#player').height() < 488)
  6499. t.addClass("hidden"),
  6500. i.addClass("noScroll"),
  6501. n.addClass("noScroll");
  6502. else {
  6503. var r = j > e
  6504. , o = !i.hasClass("noScroll")
  6505. , a = r !== o;
  6506. a && (t.toggleClass("hidden"),
  6507. i.toggleClass("noScroll"),
  6508. n.toggleClass("noScroll"))
  6509. }
  6510. }
  6511. function _(e) {
  6512. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6513. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6514. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6515. }
  6516. function T(e) {
  6517. function t(t, i) {
  6518. return !!e.player_options[t] && e[i || t]
  6519. }
  6520. $(".model-title").text(e.name);
  6521. var i = Q.pageTitle;
  6522. 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6523. document.title = i,
  6524. K.isMobile() ? $("#gui-fullscreen").toggleClass("hidden") : ($("[rel=tooltip]").tooltip({
  6525. delay: {
  6526. show: 50,
  6527. hide: 0
  6528. },
  6529. trigger: "hover",
  6530. html: !1,
  6531. viewport: {
  6532. selector: "body",
  6533. padding: 10
  6534. }
  6535. }),
  6536. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6537. 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"),
  6538. de.populate({
  6539. name: t("model_name", "name"),
  6540. coBrand: t("presented_by"),
  6541. description: t("model_summary", "summary"),
  6542. contactName: t("contact_name"),
  6543. address: t("address"),
  6544. phone: t("contact_phone"),
  6545. formattedPhone: e.formatted_contact_phone,
  6546. email: t("contact_email"),
  6547. url: t("external_url"),
  6548. socialSharing: e.enable_social_sharing && e.is_public
  6549. })
  6550. }
  6551. function x(e, t, i, n, r, o) {
  6552. function a() {
  6553. o.setLoadingStartTime(),
  6554. H(),
  6555. r ? (re.showMessage(t, i, je.coBrand.visible),
  6556. l()) : h(l)
  6557. }
  6558. var s = $.Deferred()
  6559. , l = s.resolve.bind(s);
  6560. return Ge = !0,
  6561. O(e),
  6562. e.data.player_options && _(e.data.player_options),
  6563. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6564. Re.localizeGUI(),
  6565. T(e.data),
  6566. r || $(".quick").addClass("hidden"),
  6567. e.data.image && !r && E(e.data.image),
  6568. n ? (J.impression(),
  6569. a()) : (o.setWaitingStartTime(),
  6570. oe.show(r, a)),
  6571. s
  6572. }
  6573. function S(e, t, i, n, r, a, s) {
  6574. q = s,
  6575. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6576. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6577. ae.init(),
  6578. re.init(e, a),
  6579. Oe.init(e, t, n),
  6580. $(".icon").on("mouseover", function() {
  6581. t.player && t.player.reticule.hide()
  6582. }),
  6583. m(e, t),
  6584. A(e, t),
  6585. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6586. Ce.on(Me.OPENED, function() {
  6587. var e = document.getElementById("share-modal");
  6588. return function() {
  6589. Ze("share"),
  6590. le.open(e)
  6591. }
  6592. }()),
  6593. Ce.on(Me.CLOSED, le.reset)),
  6594. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6595. je.tourControls.visible = !1),
  6596. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6597. z(),
  6598. g(i),
  6599. v(e, r),
  6600. e.on("floor.changed", C),
  6601. e.on("waiting", R.bind(this, e)),
  6602. e.on("waiting-done", P.bind(this, e)),
  6603. i.on(xe.ModeChanged, function(e, n) {
  6604. g(i),
  6605. o(t, i),
  6606. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6607. he.updateMode(n)
  6608. }),
  6609. n.on(Se.Move, Ze.bind(this, "move")),
  6610. i.on(xe.Ready, function() {
  6611. ie.init(n, i, i.tagManager, t),
  6612. i.on(xe.ModeChanged, function(e, t) {
  6613. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6614. })
  6615. }),
  6616. i.on(xe.PanoChosen, function(e, t) {
  6617. g(i, t),
  6618. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6619. }),
  6620. le.on(ce.CLOSE, function(e) {
  6621. switch (e) {
  6622. case "vr-modal":
  6623. Ae.dismiss();
  6624. break;
  6625. case "share-modal":
  6626. Ce.hide();
  6627. break;
  6628. case "terms-modal":
  6629. fe.hide()
  6630. }
  6631. });
  6632. var l = $("#play").eq(0)
  6633. , c = $("#pause").eq(0)
  6634. , h = $(".pinBottom").toArray()
  6635. , u = $("#drawer").eq(0)
  6636. , d = $("#playHead").eq(0)
  6637. , p = $("#progressBar").eq(0)
  6638. , f = $("#thumb-container").eq(0)
  6639. , y = f.children()
  6640. , I = p.children();
  6641. t.on("update.controls", function() {
  6642. var n = t.describe();
  6643. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6644. c.show()),
  6645. n.tourInProgress && (h.forEach(function(e) {
  6646. e.classList.add("playing")
  6647. }),
  6648. u.addClass("playing"),
  6649. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6650. c.hide()),
  6651. n.tourInProgress || (ve.stopTour(),
  6652. h.forEach(function(e) {
  6653. e.classList.remove("playing")
  6654. }),
  6655. u.removeClass("playing"),
  6656. d.removeClass("playing")));
  6657. var r, a, s;
  6658. if (null !== n.currentItem) {
  6659. var p, f;
  6660. $("#status").find(".curIdx").text(n.currentItem + 1),
  6661. n.onTheBus ? (p = "active",
  6662. f = "recent") : (f = "active",
  6663. p = "recent");
  6664. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6665. for (r = 0; r < e.heroLocations.length; r += 1)
  6666. s = y.eq(r),
  6667. a = I.eq(r),
  6668. s.removeClass(f),
  6669. a.removeClass(f),
  6670. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6671. a.addClass(p),
  6672. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6673. a.addClass(p)) : (s.removeClass(p),
  6674. a.removeClass(p))
  6675. } else
  6676. for (r = 0; r < e.heroLocations.length; r += 1)
  6677. s = y.eq(r),
  6678. a = I.eq(r),
  6679. s.removeClass("active recent"),
  6680. a.removeClass("active recent");
  6681. o(t, i)
  6682. }),
  6683. document.addEventListener("keydown", function(n) {
  6684. if(!window.keyCon) return; //xzw add
  6685. switch (J.updateInteraction(Se.InteractionKey),
  6686. n.which) {
  6687. case we.ZERO:
  6688. Q.debug && e.toggleAlpha();
  6689. break;
  6690. case we.NINE:
  6691. Q.debug && se.toggle();
  6692. break;
  6693. case we.ONE:
  6694. i.isInMode(_e.TRANSITIONING) || (editor.openPanel(3), t.changeMode(_e.PANORAMA));//xzw 都加了openPanel 打开编辑面板
  6695. break;
  6696. case we.TWO:
  6697. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && (editor.openPanel(1), t.changeMode(_e.DOLLHOUSE)) ;//xzw
  6698. break;
  6699. case we.THREE:
  6700. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && (editor.openPanel(2), t.changeMode(_e.FLOORPLAN));//xzw
  6701. break;
  6702. case we.FOUR:
  6703. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR) ;
  6704. break;
  6705. case we.SPACE:
  6706. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6707. break;
  6708. case we.RETURN:
  6709. Q.debug && e.toggleExplodeUp();
  6710. break;
  6711. case we.P:
  6712. k();
  6713. break;
  6714. case we.U:
  6715. B();
  6716. break;
  6717. case we.X:
  6718. Q.debug && e.toggleExplode();
  6719. break;
  6720. case we.PLUSEQUALS:
  6721. t.player.activatePersistentZooming(!0),
  6722. ie.hideUi();
  6723. break;
  6724. case we.DASHUNDERSCORE:
  6725. t.player.activatePersistentZooming(!1),
  6726. ie.hideUi();
  6727. break;
  6728. case we.SEVEN:
  6729. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6730. break;
  6731. case we.EIGHT:
  6732. t.player.decreaseZoomSpeed();
  6733. break;
  6734. case we.NINE:
  6735. t.player.increaseZoomSpeed()
  6736. }
  6737. return i && i.reticule.hide(),
  6738. !0
  6739. }
  6740. .bind(this)),
  6741. document.addEventListener("keyup", function(e) {
  6742. switch (e.which) {
  6743. case we.PLUSEQUALS:
  6744. t.player.deactivatePersistentZooming();
  6745. break;
  6746. case we.DASHUNDERSCORE:
  6747. t.player.deactivatePersistentZooming()
  6748. }
  6749. }
  6750. .bind(this)),
  6751. F(e),
  6752. L(e, t.player),
  6753. M(i),
  6754. te.setAutoPlay(e.heroCount()),
  6755. he.init(i, a.mode),
  6756. he.on(ue.OPENED, Ze.bind(this, "help")),
  6757. fe.init(),
  6758. fe.on(ge.OPENED, function() {
  6759. var e = document.getElementById("terms-modal");
  6760. return function() {
  6761. Ze("terms"),
  6762. le.open(e)
  6763. }
  6764. }()),
  6765. fe.on(ge.CLOSED, le.reset),
  6766. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6767. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6768. Q.profiling.enabled && se.show(),
  6769. ve.init(t)
  6770. }
  6771. function M(e) {
  6772. var t = function(e, t) {
  6773. $(e).find("a").each(function(e, i) {
  6774. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6775. i.style.pointerEvents = t ? "auto" : "none"
  6776. })
  6777. }
  6778. , i = function() {
  6779. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6780. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6781. };
  6782. e.on(Ne.ZoomMax, function() {
  6783. t("#gui-zoomin", !1),
  6784. t("#gui-zoomout", !0)
  6785. }),
  6786. e.on(Ne.ZoomMin, function() {
  6787. t("#gui-zoomin", !0),
  6788. t("#gui-zoomout", !1)
  6789. }),
  6790. e.on(Ne.ZoomIn, function() {
  6791. t("#gui-zoomout", !0)
  6792. }),
  6793. e.on(Ne.ZoomOut, function() {
  6794. t("#gui-zoomin", !0)
  6795. }),
  6796. i()
  6797. }
  6798. function R(e) {
  6799. O(e)
  6800. }
  6801. function P(e) {
  6802. O(e)
  6803. }
  6804. function O(e) {
  6805. var t = e.waitQueue.length;
  6806. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6807. }
  6808. function L(e, t) {
  6809. He = {
  6810. gui: null,
  6811. visible: !1,
  6812. model: e,
  6813. player: t
  6814. }
  6815. }
  6816. function D(e, t) {
  6817. function i() {
  6818. var i = t.toJSON();
  6819. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6820. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6821. }
  6822. var n = {}
  6823. , r = new Le.GUI({
  6824. autoPlace: !0,
  6825. width: "60%"
  6826. });
  6827. i(),
  6828. t.on(xe.ViewChanged, i),
  6829. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6830. r.domElement.id = "datLinks";
  6831. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6832. return o.forEach(function(e) {
  6833. if (!K.detectSafari()) {
  6834. var t = document.createElement("button");
  6835. t.classList.add("btn-deep-link"),
  6836. t.innerText = Re.MENU_COPY,
  6837. e.nextSibling.appendChild(t);
  6838. var i = function() {
  6839. alert(Re.LINK_ALERT_COPY),
  6840. t.hide()
  6841. };
  6842. t.addEventListener("click", function(e) {
  6843. try {
  6844. var t = e.target.parentNode.childNodes[0];
  6845. t.select();
  6846. var n = document.execCommand("copy");
  6847. t.blur(),
  6848. n || i()
  6849. } catch (e) {
  6850. i()
  6851. }
  6852. })
  6853. }
  6854. }),
  6855. $(r.__closeButton).hide(),
  6856. r
  6857. }
  6858. function N(e) {
  6859. He.gui || (He.gui = D(He.model, He.player)),
  6860. He.visible = e,
  6861. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6862. }
  6863. function B() {
  6864. N(!He.visible)
  6865. }
  6866. function F(e) {
  6867. ke = {
  6868. gui: null,
  6869. visible: !1,
  6870. model: e
  6871. }
  6872. }
  6873. function V(e) {
  6874. var t = new Le.GUI;
  6875. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6876. e.setSweepVisibility(Q.showSweeps)
  6877. }),
  6878. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6879. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6880. Q.transition.flySpeed = 0,
  6881. t.__controllers.forEach(function(e) {
  6882. e.updateDisplay()
  6883. })
  6884. }),
  6885. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6886. $(t.__closeButton).hide(),
  6887. t
  6888. }
  6889. function U(e) {
  6890. ke.gui || (ke.gui = V(ke.model)),
  6891. ke.visible = e,
  6892. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6893. }
  6894. function k() {
  6895. U(!ke.visible)
  6896. }
  6897. function H() {
  6898. function e(e) {
  6899. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) || e.preventDefault()
  6900. }
  6901. $("body").css("touch-action", "none"),
  6902. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6903. e.preventDefault()
  6904. });
  6905. var t = document.getElementById("terms-text")
  6906. , i = document.getElementById("more-help-wrapper")
  6907. , n = (document.getElementById("navigation-help-wrapper"),
  6908. document.getElementById("help-dialog"),
  6909. document.getElementById("tag-billboards"));
  6910. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  6911. document.body.addEventListener("DOMMouseScroll", e)),
  6912. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6913. e.stopPropagation()
  6914. })
  6915. }
  6916. function G(e, t) {
  6917. for (var i = []; e; )
  6918. i.push(e),
  6919. e = e.parentNode;
  6920. for (; t && i.indexOf(t) === -1; )
  6921. t = t.parentNode;
  6922. return t
  6923. }
  6924. function z() {
  6925. var e, t = function(t) {
  6926. e = 0 === t.button || 1 === t.which ? t.target : null
  6927. }, i = function(t) {
  6928. e !== t.target && (e = G(e, t.target));
  6929. var i = document.getElementById("gui-parent");
  6930. if (G(i, e) !== i && (e = null),
  6931. e) {
  6932. var n;
  6933. try {
  6934. n = new MouseEvent("click",t)
  6935. } catch (e) {
  6936. n = document.createEvent("MouseEvents"),
  6937. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6938. }
  6939. n.syntheticClick = !0,
  6940. e.dispatchEvent(n),
  6941. e = null
  6942. }
  6943. };
  6944. document.body.addEventListener("mousedown", t, !0),
  6945. document.body.addEventListener("mouseup", i, !0),
  6946. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6947. e.syntheticClick || (e.stopPropagation(),
  6948. "A" === e.target.nodeName && e.preventDefault())
  6949. }, !0)
  6950. }
  6951. var W, j, Y, X, Z, q, K = (e("three"),
  6952. e("../util/ajax"),
  6953. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6954. e("../util/camera"),
  6955. e("../util/logger")), te = (e("../objects/Snapshot"),
  6956. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  6957. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6958. e("../enum/PathDisplayMode"),
  6959. e("../enum/DirectorEvents"),
  6960. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6961. e("../enum/WarpStyle"),
  6962. e("../enum/AlignmentType"),
  6963. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6964. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6965. coBrand: {
  6966. visible: !0,
  6967. elements: [".co-brand", "#loaderCoBrand"]
  6968. },
  6969. help: {
  6970. visible: !0,
  6971. elements: [".nav-help", "#nav-help"]
  6972. },
  6973. tourControls: {
  6974. visible: !0,
  6975. elements: [".next", ".previous", "#play"]
  6976. },
  6977. highlight: {
  6978. visible: !0,
  6979. elements: ["#drawer", "#pullTab"]
  6980. },
  6981. share: {
  6982. visible: !0,
  6983. elements: [".socialButton", "#share"]
  6984. },
  6985. fullScreen: {
  6986. visible: !0,
  6987. elements: ["#gui-fullscreen"]
  6988. },
  6989. floors: {
  6990. visible: !0,
  6991. elements: [".gui-floor"]
  6992. }
  6993. }, Ye = function() {
  6994. var e = document.getElementById("drawer");
  6995. return function() {
  6996. window.innerHeight < 400 && e.classList.contains("open") && a()
  6997. }
  6998. }(), Xe = function() {
  6999. var e = document.getElementById("meta-info");
  7000. return function() {
  7001. window.innerHeight < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7002. }
  7003. }(), Ze = function(e) {
  7004. function t() {
  7005. u.classList.contains("expand") && de.toggleMeta(!0)
  7006. }
  7007. function i() {
  7008. fe.hide()
  7009. }
  7010. function n() {
  7011. he.close()
  7012. }
  7013. function r() {
  7014. Ae.dismiss()
  7015. }
  7016. function o() {
  7017. p.hasClass("open") && a(!0)
  7018. }
  7019. function l() {
  7020. Ce.hide()
  7021. }
  7022. function c() {
  7023. f.hasClass("open") && f.removeClass("open")
  7024. }
  7025. function h() {
  7026. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7027. }
  7028. var u = document.getElementById("meta-info")
  7029. , d = document.getElementById("interaction-modal")
  7030. , p = $("#drawer").eq(0)
  7031. , f = $(".gui-floor").eq(0)
  7032. , g = $(".vr-popup").eq(0);
  7033. return function(e) {
  7034. switch (e) {
  7035. case "info":
  7036. i(),
  7037. n(),
  7038. Ye(),
  7039. l(),
  7040. c(),
  7041. r(),
  7042. h();
  7043. break;
  7044. case "terms":
  7045. t(),
  7046. n(),
  7047. o(),
  7048. l(),
  7049. c(),
  7050. r(),
  7051. h();
  7052. break;
  7053. case "help":
  7054. t(),
  7055. i(),
  7056. l(),
  7057. c(),
  7058. r(),
  7059. h();
  7060. break;
  7061. case "vr":
  7062. t(),
  7063. i(),
  7064. l(),
  7065. c(),
  7066. n(),
  7067. h(),
  7068. s(g) && o();
  7069. break;
  7070. case "highlights":
  7071. Xe(),
  7072. i(),
  7073. l(),
  7074. c();
  7075. break;
  7076. case "share":
  7077. t(),
  7078. i(),
  7079. n(),
  7080. c(),
  7081. r(),
  7082. h();
  7083. break;
  7084. case "floor":
  7085. i(),
  7086. l(),
  7087. r();
  7088. break;
  7089. case "view":
  7090. c(),
  7091. l(),
  7092. i(),
  7093. r();
  7094. break;
  7095. case "tour":
  7096. i(),
  7097. l(),
  7098. c(),
  7099. r();
  7100. break;
  7101. case "move":
  7102. i(),
  7103. l(),
  7104. c(),
  7105. r();
  7106. break;
  7107. case "resize":
  7108. t(),
  7109. Ye(),
  7110. c();
  7111. break;
  7112. case "tag":
  7113. i(),
  7114. n(),
  7115. l(),
  7116. c(),
  7117. r()
  7118. }
  7119. }
  7120. }();
  7121. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7122. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7123. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7124. setTimeout(function() {
  7125. $(".icon:visible").hide().show(0)
  7126. }, 100)
  7127. }),
  7128. $("#gui-fullscreen").find("a").on("click", function(e) {
  7129. l(e),
  7130. K.requestFullscreen($("body")[0]),
  7131. J.track("showcase_gui", {
  7132. gui_action: "click_enter_fullscreen",
  7133. interaction_source: "gui"
  7134. }),
  7135. W.reload()
  7136. }),
  7137. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7138. l(e),
  7139. K.exitFullscreen(),
  7140. J.track("showcase_gui", {
  7141. gui_action: "click_exit_fullscreen",
  7142. interaction_source: "gui"
  7143. })
  7144. }),
  7145. $(window).on("resize", function(e) {
  7146. var t = e.target.innerHeight
  7147. , i = e.target.innerWidth;
  7148. t === X && i === Z || (je.highlight.visible && w(),
  7149. Ze("resize"),
  7150. $(".pinTop.right").removeClass("hideUnderMeta"),
  7151. c(),
  7152. X = t,
  7153. Z = i)
  7154. }).resize(),
  7155. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7156. $("#pullTab").on("click", function(e) {
  7157. l(e),
  7158. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7159. gui_action: "hide_highlight_reel"
  7160. }),
  7161. $(this).addClass("open")) : (J.trackAlways("showcase_gui", {
  7162. gui_action: "show_highlight_reel"
  7163. }),
  7164. $(this).removeClass("open")),
  7165. a()
  7166. }),
  7167. $("#more-menu-button").on("click", function(e) {
  7168. l(e);
  7169. var t = $("#more-menu");
  7170. t.toggleClass("open")
  7171. }),
  7172. t.exports.init = S,
  7173. t.exports.startLoading = x,
  7174. t.exports.endLoading = d,
  7175. t.exports.onProgress = u
  7176. }
  7177. ).call(this, "/js/gui/gui.js")
  7178. }
  7179. , {
  7180. "../analytics": 4,
  7181. "../controls/serializer": 14,
  7182. "../enum/AlignmentType": 17,
  7183. "../enum/BlackoutStyle": 18,
  7184. "../enum/ControlEvents": 21,
  7185. "../enum/DirectorEvents": 23,
  7186. "../enum/Keys": 30,
  7187. "../enum/PathDiscardMode": 38,
  7188. "../enum/PathDisplayMode": 39,
  7189. "../enum/PlayerEvents": 40,
  7190. "../enum/VROption": 47,
  7191. "../enum/Vectors": 50,
  7192. "../enum/Viewmode": 51,
  7193. "../enum/WarpStyle": 52,
  7194. "../enum/ZoomEvents": 53,
  7195. "../lib/dat.gui": 93,
  7196. "../localization/localize": 108,
  7197. "../tag/Media/MediaEvent": 131,
  7198. "../objects/Snapshot": 153,
  7199. "../settings": 166,
  7200. "../util/ajax": 181,
  7201. "../util/browser": 182,
  7202. "../util/camera": 183,
  7203. "../util/logger": 189,
  7204. "../util/showcase": 193,
  7205. "../util/transitions": 195,
  7206. "./closer/ModalCloserEvent": 61,
  7207. "./closer/modalCloser": 62,
  7208. "./help/HelpEvent": 66,
  7209. "./help/help": 67,
  7210. "./helpManager": 68,
  7211. "./immersiveMode": 69,
  7212. "./konami": 70,
  7213. "./landingScreen": 71,
  7214. "./loadingScreen": 72,
  7215. "./memoryUsage": 73,
  7216. "./playButton": 74,
  7217. "./populateModal": 75,
  7218. "./sharing/ShareEvents": 76,
  7219. "./sharing/modal": 77,
  7220. "./terms/TermsEvent": 78,
  7221. "./terms/terms": 79,
  7222. "./title/TitleEvents": 80,
  7223. "./title/tagToggle": 81,
  7224. "./title/titleBar": 82,
  7225. "./tourInteraction": 84,
  7226. "./vr/vrEvent": 85,
  7227. "./vr/vrModal": 87,
  7228. "./webvr/WebVrEvent": 88,
  7229. "./webvr/webVRgui": 89,
  7230. three: 217,
  7231. "editor" : "Editor"
  7232. }],
  7233. 66: [function(e, t, i) {//"./help/HelpEvent"
  7234. "use strict";
  7235. t.exports = Object.freeze({
  7236. OPENED: "help.opened",
  7237. CLOSED: "help.closed"
  7238. })
  7239. }
  7240. , {}],
  7241. 67: [function(e, t, i) {//"./help/help"
  7242. "use strict";
  7243. function n() {
  7244. g.on("click", function(e) {
  7245. if (S && S !== l.TRANSITIONING) {
  7246. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7247. t && !M ? R.close() : r()
  7248. }
  7249. }),
  7250. w.on("click", function(e) {
  7251. R.close()
  7252. }),
  7253. E.on("click", function(e) {
  7254. S && S !== l.TRANSITIONING && (s(),
  7255. o())
  7256. }),
  7257. b.on("click", function(e) {
  7258. s(),
  7259. a()
  7260. })
  7261. }
  7262. function r() {
  7263. S && S !== l.TRANSITIONING && (M = !0,
  7264. setTimeout(function() {
  7265. M = !1
  7266. }, d.help.modalStayDuration),
  7267. R.emit(h.OPENED),
  7268. m.addClass("open " + S),
  7269. g.addClass("open"),
  7270. s(),
  7271. o(),
  7272. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7273. y.classList.add("fadeIn"))
  7274. }
  7275. function o() {
  7276. E.addClass("underline-tab"),
  7277. u.fill(_, c.NAVIGATION, S),
  7278. m.addClass(S)
  7279. }
  7280. function a() {
  7281. b.addClass("underline-tab"),
  7282. u.fill(T, c.MORE_HELP),
  7283. m.addClass("more-help")
  7284. }
  7285. function s(e, t) {
  7286. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7287. I.forEach(function(e) {
  7288. e.classList.remove("underline-tab")
  7289. })
  7290. }
  7291. var l = e("../../enum/Viewmode")
  7292. , c = e("../../enum/HelpModalType")
  7293. , h = e("./HelpEvent")
  7294. , u = (e("../helpManager"),
  7295. e("./../populateModal"))
  7296. , d = e("../../settings")
  7297. , p = e("../../util/common")
  7298. , f = e("events").EventEmitter
  7299. , g = $(".footer-help").eq(0)
  7300. , m = $("#help-dialog").eq(0)
  7301. , v = document.querySelector("#quick-logo")
  7302. , A = document.querySelector("#loaderCoBrand")
  7303. , y = document.querySelector("#help-dialog")
  7304. , C = document.querySelector(".footer")
  7305. , I = $(".help-tabs").children().toArray()
  7306. , E = $(".navigation-tab").eq(0)
  7307. , b = $(".more-help-tab").eq(0)
  7308. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7309. m.find(".close").eq(0))
  7310. , _ = m.find(".interactions").toArray()
  7311. , T = m.find(".ui-instructions").toArray()
  7312. , x = l.PANORAMA
  7313. , S = l.PANORAMA
  7314. , M = !1
  7315. , R = {
  7316. init: function(e, t) {
  7317. S = t,
  7318. x = t,
  7319. [y, A, v, C].forEach(function(e) {
  7320. e.classList.add(u.deviceType)
  7321. }),
  7322. n()
  7323. },
  7324. close: function() {
  7325. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7326. g.removeClass("open"),
  7327. m.removeClass("open"),
  7328. y.classList.contains("fadeIn"))) {
  7329. y.classList.remove("fadeIn");
  7330. var e = S === l.TRANSITIONING ? x : S;
  7331. u.clear(_, c.NAVIGATION, e)
  7332. }
  7333. },
  7334. updateMode: function(e) {
  7335. x = S,
  7336. S = e
  7337. }
  7338. };
  7339. p.extendObject(R, f.prototype),
  7340. t.exports = R
  7341. }
  7342. , {
  7343. "../../enum/HelpModalType": 28,
  7344. "../../enum/Viewmode": 51,
  7345. "../../settings": 166,
  7346. "../../util/common": 185,
  7347. "../helpManager": 68,
  7348. "./../populateModal": 75,
  7349. "./HelpEvent": 66,
  7350. events: 202
  7351. }],
  7352. 68: [function(e, t, i) {///js/gui/helpManager.js
  7353. (function(i) {
  7354. "use strict";
  7355. var n = e("../util/browser")
  7356. , r = e("./../util/logger")
  7357. , o = e("./../settings")
  7358. , a = new r(i)
  7359. , s = function() {
  7360. var e;
  7361. try {
  7362. return e = window.localStorage.getItem("visitCount") || "0",
  7363. e = (parseFloat(e) + 1).toString(),
  7364. window.localStorage.setItem("visitCount", e),
  7365. a.debug("visitCount = " + e),
  7366. e
  7367. } catch (t) {
  7368. e = "1",
  7369. a.debug("couldn't set local storage")
  7370. }
  7371. }()
  7372. , l = !1;
  7373. t.exports = {
  7374. isHelpDisabled: function() {
  7375. return "0" === n.valueFromHash("help", null) || l
  7376. },
  7377. isLargeHelpEnabled: function() {
  7378. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7379. },
  7380. isSmallHelpEnabled: function() {
  7381. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7382. },
  7383. isHelpEnabled: function() {
  7384. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7385. },
  7386. setAutoPlay: function(e) {
  7387. l = o.warp.auto >= 0 && e > 1
  7388. }
  7389. }
  7390. }
  7391. ).call(this, "/js/gui/helpManager.js")
  7392. }
  7393. , {
  7394. "../util/browser": 182,
  7395. "./../settings": 166,
  7396. "./../util/logger": 189
  7397. }],
  7398. 69: [function(e, t, i) {//"./immersiveMode"
  7399. "use strict";
  7400. function n(e, t, i, n) {
  7401. F = n,
  7402. r(e, t, i, F),
  7403. o(),
  7404. N = t.mode
  7405. }
  7406. function r(e, t, i, n) {
  7407. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7408. e.controls[t].on(v.Move, a),
  7409. e.controls[t].on(v.LongTap, c)
  7410. }),
  7411. M.on("mousewheel DOMMouseScroll", a),
  7412. i.on(m.TagActivated, a),
  7413. i.on(m.TagNavigation, a),
  7414. t.on(A.FlyingEnded, s),
  7415. t.on(A.ModeChanging, function(e, t) {
  7416. B = t !== C.PANORAMA && e !== C.PANORAMA
  7417. }),
  7418. t.on(A.ModeChanged, function(e, i) {
  7419. N = t.mode,
  7420. i !== C.TRANSITIONING ? l() : a("modeChange")
  7421. }),
  7422. n.on(y.TourStart, function() {
  7423. L = !0,
  7424. a()
  7425. }),
  7426. n.on(y.TourEnd, function() {
  7427. L = !1,
  7428. l()
  7429. }),
  7430. n.on(y.ActionInterrupted, function() {
  7431. L = !1
  7432. }),
  7433. R.addEventListener("touchend", function() {
  7434. $("#pullTab").hasClass("opened") && !L && l()
  7435. }, !0)
  7436. }
  7437. function o() {
  7438. p.isMobile() ? (b.forEach(function(e) {
  7439. e.classList.add("mobile")
  7440. }),
  7441. w.click(l)) : (b.forEach(function(e) {
  7442. e.addEventListener("mouseleave", function() {
  7443. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7444. }, !0)
  7445. }),
  7446. M.mouseleave(function() {
  7447. b[0].classList.contains("detectHover") && l()
  7448. }))
  7449. }
  7450. function a(e) {
  7451. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7452. P = !0,
  7453. g.close(),
  7454. h(e),
  7455. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) || S.addClass("fadeOut"),
  7456. _.hasClass("playing") || (b.forEach(function(e) {
  7457. e.classList.add("detectHover")
  7458. }),
  7459. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7460. }
  7461. function s() {
  7462. _.hasClass("playing") || (clearTimeout(O),
  7463. O = setTimeout(l, f.immersive.timeToShowAgain))
  7464. }
  7465. function l() {
  7466. clearTimeout(O),
  7467. P = !1,
  7468. I.forEach(function(e) {
  7469. e.classList.remove("fadeOut"),
  7470. e.classList.remove("drawerOpen")
  7471. }),
  7472. L || E.forEach(function(e) {
  7473. e.classList.remove("duringTour")
  7474. }),
  7475. b.forEach(function(e) {
  7476. e.classList.remove("detectHover")
  7477. })
  7478. }
  7479. function c() {
  7480. P ? l() : a(),
  7481. D = !0,
  7482. setTimeout(function() {
  7483. D = !1
  7484. }, f.immersive.uiStayDuration)
  7485. }
  7486. function h(e) {
  7487. !d(e) && L ? E.forEach(function(e) {
  7488. e.classList.remove("drawerOpen"),
  7489. e.classList.add("duringTour")
  7490. }) : _.hasClass("open") ? E.forEach(function(e) {
  7491. e.classList.remove("duringTour"),
  7492. e.classList.add("drawerOpen")
  7493. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7494. e.classList.add("fadeOut")
  7495. })
  7496. }
  7497. function u() {
  7498. T.hasClass("duringTour") || (L = !1,
  7499. a("gui"),
  7500. l())
  7501. }
  7502. function d(e) {
  7503. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7504. }
  7505. var p = e("../util/browser")
  7506. , f = e("../settings")
  7507. , g = e("./help/help")
  7508. , m = e("../enum/tagEvents")
  7509. , v = e("../enum/ControlEvents")
  7510. , A = e("../enum/PlayerEvents")
  7511. , y = e("../enum/DirectorEvents")
  7512. , A = e("../enum/PlayerEvents")
  7513. , C = e("../enum/Viewmode")
  7514. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7515. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7516. , b = $("#hover-bottom, #hover-top").toArray()
  7517. , w = ($("#pullTab").eq(0),
  7518. $("#playHead").eq(0),
  7519. $(".pinBottom-container").eq(0))
  7520. , _ = $("#drawer").eq(0)
  7521. , T = $("#drawer-container").eq(0)
  7522. , x = $("#meta-info").eq(0)
  7523. , S = $(".pinTop.left").eq(0)
  7524. , M = $("#player").eq(0)
  7525. , R = document.getElementById("pullTab")
  7526. , P = !1
  7527. , O = null
  7528. , L = !1
  7529. , D = !1
  7530. , N = null
  7531. , B = !1
  7532. , F = null;
  7533. t.exports.init = n,
  7534. t.exports.hideUi = a,
  7535. t.exports.resetDrawer = u
  7536. }
  7537. , {
  7538. "../enum/ControlEvents": 21,
  7539. "../enum/DirectorEvents": 23,
  7540. "../enum/tagEvents": 32,
  7541. "../enum/PlayerEvents": 40,
  7542. "../enum/Viewmode": 51,
  7543. "../settings": 166,
  7544. "../util/browser": 182,
  7545. "./help/help": 67
  7546. }],
  7547. 70: [function(e, t, i) {///js/gui/konami.js
  7548. (function(i) {
  7549. "use strict";
  7550. function n(e, t, i) {
  7551. l.debug("konami has the modelInstance");
  7552. var n = [];
  7553. $(window).on("keydown", function(e) {
  7554. n.push(e.which),
  7555. n.length > o.secretPanelWord.length && n.shift(),
  7556. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7557. o.debug = !0)
  7558. }),
  7559. $(window).on("keydown", function n(r) {
  7560. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7561. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7562. })
  7563. }
  7564. var r = e("./../util/logger")
  7565. , o = e("./../settings")
  7566. , a = e("./debug")
  7567. , s = e("./../util/common")
  7568. , l = (e("./gui"),
  7569. new r(i));
  7570. o.console && $("body").append('<div id="debug-console"></div>'),
  7571. t.exports.init = n
  7572. }
  7573. ).call(this, "/js/gui/konami.js")
  7574. }
  7575. , {
  7576. "./../settings": 166,
  7577. "./../util/common": 185,
  7578. "./../util/logger": 189,
  7579. "./debug": 63,
  7580. "./gui": 65
  7581. }],
  7582. 71: [function(e, t, i) {//"./landingScreen"
  7583. "use strict";
  7584. function n(e, t) {
  7585. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7586. }
  7587. function r(e) {
  7588. var t = $.Deferred();
  7589. e || t.resolve();
  7590. var i = c.startupFlyinDelay;
  7591. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7592. setTimeout(t.resolve.bind(t), i),
  7593. t
  7594. }
  7595. function o(e, t, i) {
  7596. var n = 0;
  7597. c.quickstart.enabled && (a(i),
  7598. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7599. var r = function() {
  7600. e.once(g.Move, l),
  7601. t.once(f.TourStart, l)
  7602. };
  7603. s(n, r)
  7604. }
  7605. function a(e) {
  7606. return e && (y.addClass("quick-brand"),
  7607. v.before(y),
  7608. A = $(".quick-brand").toArray()),
  7609. m.addClass("fadeOut"),
  7610. setTimeout(function() {
  7611. A.forEach(function(e) {
  7612. e.classList.add("fadeIn")
  7613. })
  7614. }, c.quickstart.showTextDelay),
  7615. setTimeout(function() {
  7616. A.forEach(function(e) {
  7617. e.classList.add("fadeOut")
  7618. })
  7619. }, c.quickstart.fadeOutDelay),
  7620. !0
  7621. }
  7622. function s(e, t) {
  7623. setTimeout(function() {
  7624. if (h.isHelpEnabled()) {
  7625. if (t(),
  7626. u.init(),
  7627. C.addClass("fadeIn landing " + u.deviceType),
  7628. h.isSmallHelpEnabled())
  7629. return void C.addClass("small");
  7630. u.fill(I, d.LANDING[E]),
  7631. C.addClass(E)
  7632. }
  7633. }, e)
  7634. }
  7635. function l() {
  7636. u.clear(I, d.LANDING[E]),
  7637. C.removeClass("fadeIn")
  7638. }
  7639. var c = e("../settings")
  7640. , h = (e("./help/help"),
  7641. e("./helpManager"))
  7642. , u = e("./populateModal")
  7643. , d = e("../enum/HelpModalType")
  7644. , p = e("../enum/Viewmode")
  7645. , f = e("../enum/DirectorEvents")
  7646. , g = e("../enum/PlayerEvents")
  7647. , m = $("#quick-blackout").eq(0)
  7648. , v = $("#quick-logo").eq(0)
  7649. , A = $(".quick-brand").toArray()
  7650. , y = $("#loaderCoBrand").eq(0)
  7651. , C = $("#interaction-modal").eq(0)
  7652. , I = C.find(".interaction").toArray()
  7653. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7654. "");
  7655. t.exports.delayLanding = r,
  7656. t.exports.showMessage = o,
  7657. t.exports.init = n,
  7658. t.exports.dismissModal = l
  7659. }
  7660. , {
  7661. "../enum/DirectorEvents": 23,
  7662. "../enum/HelpModalType": 28,
  7663. "../enum/PlayerEvents": 40,
  7664. "../enum/Viewmode": 51,
  7665. "../settings": 166,
  7666. "./help/help": 67,
  7667. "./helpManager": 68,
  7668. "./populateModal": 75
  7669. }],
  7670. 72: [function(e, t, i) {//"./loadingScreen"
  7671. "use strict";
  7672. var n = e("./circleLoader").circleLoader;
  7673. t.exports = {
  7674. element: $("#gui-loading"),
  7675. hide: function(e) {
  7676. n.done(),
  7677. this.element.fadeOut(2500, e)
  7678. },
  7679. show: function(e) {
  7680. this.element.fadeIn(500, function() {
  7681. this.element.css("display", "table"),
  7682. e && e()
  7683. }
  7684. .bind(this))
  7685. },
  7686. progress: function(e) {
  7687. n.set(e)
  7688. }
  7689. }
  7690. }
  7691. , {
  7692. "./circleLoader": 60
  7693. }],
  7694. 73: [function(e, t, i) {//./memoryUsage
  7695. "use strict";
  7696. var n = e("../settings")
  7697. , r = $("#memory-info")
  7698. , o = r.find("#memory-gpu")
  7699. , a = !1;
  7700. t.exports = {
  7701. show: function() {
  7702. n.profiling.enabled && (r.show(),
  7703. a = !0)
  7704. },
  7705. hide: function() {
  7706. r.hide(),
  7707. a = !1
  7708. },
  7709. toggle: function() {
  7710. a ? this.hide() : this.show()
  7711. },
  7712. update: function(e) {
  7713. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7714. }
  7715. }
  7716. }
  7717. , {
  7718. "../settings": 166
  7719. }],
  7720. 74: [function(e, t, i) {//./playButton
  7721. "use strict";
  7722. var n = e("../util/browser")
  7723. , r = e("../analytics");
  7724. e("../settings");
  7725. t.exports = {
  7726. show: function(e, t) {
  7727. $("#gui-message").fadeIn(250, function() {
  7728. $(this).css("display", "table");
  7729. var e = $("#gui-message").fracs().visible >= .5;
  7730. r.impression({
  7731. visible: e,
  7732. immediate: !0
  7733. })
  7734. }),
  7735. e && $("#quick-blackout").addClass("fadeOut"),
  7736. $("#button-play").on("click", function(i) {
  7737. return n.inIframe() && n.isMobile() ? n.valueFromHash("nt", !1) ? window.open(self.location.href, "_blank") : void (top.location.href = self.location.href) : e ? (i.stopPropagation(),
  7738. $("#quick-blackout").removeClass("fadeOut"),
  7739. $("#gui-message").hide(),
  7740. void t()) : void $("#gui-message").fadeOut(500, function() {
  7741. t()
  7742. })
  7743. })
  7744. }
  7745. }
  7746. }
  7747. , {
  7748. "../analytics": 4,
  7749. "../settings": 166,
  7750. "../util/browser": 182
  7751. }],
  7752. 75: [function(e, t, i) {//"./populateModal"
  7753. "use strict";
  7754. function n(e, t, i, n) {
  7755. function r(e) {
  7756. return e.classList.contains(a)
  7757. }
  7758. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7759. for (var a in o) {
  7760. var s = e.find(r);
  7761. for (var l in o[a]) {
  7762. var c = o[a][l];
  7763. if ("top-info" === l || "bottom-info" === l) {
  7764. var h = n ? c : "";
  7765. s.querySelector("." + l).textContent = h
  7766. } else {
  7767. var u = n ? c : ""
  7768. , d = s.querySelector("." + l);
  7769. d.src = u,
  7770. n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7771. }
  7772. }
  7773. }
  7774. var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7775. p.forEach(function(e) {
  7776. n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7777. })
  7778. }
  7779. var r = e("../util/browser")
  7780. , o = e("../localization/localize")
  7781. , a = e("../enum/HelpModalType")
  7782. , s = (e("../enum/HelpModalSize"),
  7783. e("../enum/Viewmode"));
  7784. t.exports = {
  7785. init: function() {
  7786. if (!this.hasInitialized) {
  7787. this.hasInitialized = !0,
  7788. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7789. this.assets = {},
  7790. this.assets[a.LANDING[s.PANORAMA]] = {
  7791. desktop: {
  7792. left: {
  7793. "top-info": o.ROTATE,
  7794. "big-image": "images/nav_help_mouse_drag_left.png",
  7795. keyboard: "images/nav_help_keyboard_left_right.png"
  7796. },
  7797. middle: {
  7798. "top-info": o.MOVE,
  7799. "big-image": "images/nav_help_mouse_click.png",
  7800. keyboard: "images/nav_help_keyboard_up_down.png"
  7801. },
  7802. right: {
  7803. "top-info": o.ZOOM,
  7804. "big-image": "images/nav_help_mouse_zoom.png",
  7805. keyboard: "images/nav_help_zoom_keys.png"
  7806. }
  7807. },
  7808. mobile: {
  7809. left: {
  7810. "top-info": o.ROTATE,
  7811. "big-image": "images/nav_help_gesture_drag.png"
  7812. },
  7813. middle: {
  7814. "top-info": o.MOVE,
  7815. "big-image": "images/nav_help_gesture_tap.png"
  7816. },
  7817. right: {
  7818. "top-info": o.ZOOM,
  7819. "big-image": "images/nav_help_gesture_pinch.png"
  7820. }
  7821. }
  7822. },
  7823. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7824. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7825. desktop: {
  7826. left: {
  7827. "top-info": o.ROTATE,
  7828. "big-image": "images/nav_help_mouse_drag_left.png",
  7829. keyboard: "images/nav_help_keyboard_left_right.png"
  7830. },
  7831. middle: {
  7832. "top-info": o.MOVE,
  7833. "big-image": "images/nav_help_mouse_position_right.png"
  7834. }
  7835. },
  7836. mobile: {
  7837. left: {
  7838. "top-info": o.ROTATE,
  7839. "big-image": "images/nav_help_gesture_drag.png"
  7840. },
  7841. middle: {
  7842. "top-info": o.MOVE,
  7843. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7844. }
  7845. }
  7846. },
  7847. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7848. desktop: {
  7849. left: {
  7850. "top-info": o.MOVE,
  7851. "big-image": "images/nav_help_mouse_position_left.png"
  7852. },
  7853. middle: {
  7854. "top-info": o.ROTATE,
  7855. "big-image": "images/nav_help_mouse_drag_right.png",
  7856. keyboard: "images/nav_help_keyboard_left_right.png"
  7857. }
  7858. },
  7859. mobile: {
  7860. left: {
  7861. "top-info": o.MOVE,
  7862. "big-image": "images/nav_help_gesture_position.png"
  7863. },
  7864. middle: {
  7865. "top-info": o.ROTATE,
  7866. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7867. }
  7868. }
  7869. };
  7870. var e = {
  7871. "top-info": o.INSIDE,
  7872. "big-image": "images/nav_help_click_inside.png",
  7873. keyboard: "images/nav_help_inside_key.png"
  7874. };
  7875. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7876. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7877. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7878. var t = {
  7879. "top-info": o.INSIDE,
  7880. "big-image": "images/nav_help_tap_inside.png"
  7881. };
  7882. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7883. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7884. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7885. this.assets[a.NAVIGATION] = {},
  7886. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7887. desktop: {
  7888. left: {
  7889. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7890. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7891. "big-image": "images/nav_help_mouse_drag_left.png",
  7892. keyboard: "images/nav_help_keyboard_left_right.png"
  7893. },
  7894. middle: {
  7895. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7896. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7897. "big-image": "images/nav_help_mouse_click.png",
  7898. keyboard: "images/nav_help_keyboard_up_down.png"
  7899. },
  7900. right: {
  7901. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7902. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7903. "big-image": "images/nav_help_mouse_zoom.png",
  7904. keyboard: "images/nav_help_zoom_keys.png"
  7905. }
  7906. },
  7907. mobile: {
  7908. left: {
  7909. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7910. "big-image": "images/nav_help_gesture_drag.png"
  7911. },
  7912. middle: {
  7913. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7914. "big-image": "images/nav_help_gesture_tap.png"
  7915. },
  7916. right: {
  7917. "top-info": o.HELP_MOBILE_3,
  7918. "big-image": "images/nav_help_gesture_pinch.png"
  7919. }
  7920. }
  7921. },
  7922. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7923. desktop: {
  7924. left: {
  7925. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7926. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7927. "big-image": "images/nav_help_mouse_drag_left.png",
  7928. keyboard: "images/nav_help_keyboard_all.png"
  7929. },
  7930. middle: {
  7931. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7932. "big-image": "images/nav_help_mouse_position_right.png"
  7933. },
  7934. right: {
  7935. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7936. "big-image": "images/nav_help_mouse_zoom.png"
  7937. }
  7938. },
  7939. mobile: {
  7940. left: {
  7941. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7942. "big-image": "images/nav_help_gesture_drag.png"
  7943. },
  7944. middle: {
  7945. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7946. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7947. },
  7948. right: {
  7949. "top-info": o.HELP_MOBILE_3,
  7950. "big-image": "images/nav_help_gesture_pinch.png"
  7951. }
  7952. }
  7953. },
  7954. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7955. desktop: {
  7956. left: {
  7957. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7958. "big-image": "images/nav_help_mouse_position_left.png"
  7959. },
  7960. middle: {
  7961. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7962. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7963. "big-image": "images/nav_help_mouse_drag_right.png",
  7964. keyboard: "images/nav_help_keyboard_left_right.png"
  7965. },
  7966. right: {
  7967. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7968. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7969. "big-image": "images/nav_help_mouse_zoom.png",
  7970. keyboard: "images/nav_help_keyboard_up_down.png"
  7971. }
  7972. },
  7973. mobile: {
  7974. left: {
  7975. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7976. "big-image": "images/nav_help_gesture_position.png"
  7977. },
  7978. middle: {
  7979. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7980. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7981. },
  7982. right: {
  7983. "top-info": o.HELP_MOBILE_3,
  7984. "big-image": "images/nav_help_gesture_pinch.png"
  7985. }
  7986. }
  7987. },
  7988. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7989. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7990. "top-info": o.HELP_DESKTOP_360_2A,
  7991. "bottom-info": o.HELP_DESKTOP_360_2B,
  7992. "big-image": "images/nav_help_click_inside.png",
  7993. keyboard: "images/nav_help_inside_key.png"
  7994. },
  7995. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7996. "top-info": o.HELP_MOBILE_360_2,
  7997. "big-image": "images/nav_help_tap_inside.png"
  7998. },
  7999. this.assets[a.MORE_HELP] = {
  8000. desktop: {
  8001. "more-help-hlr": {
  8002. "top-info": o.HELP_MORE_HLR_A,
  8003. "big-image": "images/nav_help_expand.svg",
  8004. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8005. },
  8006. "more-help-dollhouse": {
  8007. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8008. "big-image": "images/nav_help_dollhouse.svg",
  8009. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8010. },
  8011. "more-help-floors": {
  8012. "top-info": o.HELP_MORE_FLOORS_A,
  8013. "big-image": "images/nav_help_floor picker.svg",
  8014. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8015. },
  8016. "more-help-tag": {
  8017. "top-info": o.HELP_MORE_TAG_A,
  8018. "big-image": "images/nav_help_tag.svg",
  8019. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8020. },
  8021. "more-help-zoom": {
  8022. "top-info": o.HELP_MORE_ZOOM_A,
  8023. "big-image": "images/nav_help_zoom.svg",
  8024. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8025. },
  8026. "more-help-tour": {
  8027. "top-info": o.HELP_MORE_TOUR_A,
  8028. "big-image": "images/nav_help_play.png",
  8029. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8030. },
  8031. "more-help-inside": {
  8032. "top-info": o.HELP_MORE_INSIDE_A,
  8033. "big-image": "images/nav_help_inside.svg",
  8034. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8035. },
  8036. "more-help-vr": {
  8037. "top-info": o.HELP_MORE_VR_A,
  8038. "big-image": "images/nav_help_vr.svg",
  8039. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8040. },
  8041. "more-help-360": {
  8042. "top-info": o.HELP_MORE_360_A,
  8043. "big-image": "images/nav_help_360.svg",
  8044. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8045. },
  8046. "more-help-fullscreen": {
  8047. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8048. "big-image": "images/nav_help_fullscreen.svg",
  8049. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8050. }
  8051. },
  8052. mobile: {
  8053. "more-help-hlr": {
  8054. "top-info": o.HELP_MORE_HLR_A,
  8055. "big-image": "images/nav_help_expand.svg",
  8056. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8057. },
  8058. "more-help-dollhouse": {
  8059. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8060. "big-image": "images/nav_help_dollhouse.svg",
  8061. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8062. },
  8063. "more-help-floors": {
  8064. "top-info": o.HELP_MORE_FLOORS_A,
  8065. "big-image": "images/nav_help_floor picker.svg",
  8066. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8067. },
  8068. "more-help-tag": {
  8069. "top-info": o.HELP_MORE_TAG_A,
  8070. "big-image": "images/nav_help_tag.svg",
  8071. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8072. },
  8073. "more-help-tour": {
  8074. "top-info": o.HELP_MORE_TOUR_A,
  8075. "big-image": "images/nav_help_play.png",
  8076. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8077. },
  8078. "more-help-inside": {
  8079. "top-info": o.HELP_MORE_INSIDE_A,
  8080. "big-image": "images/nav_help_inside.svg",
  8081. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8082. },
  8083. "more-help-vr": {
  8084. "top-info": o.HELP_MORE_VR_A,
  8085. "big-image": "images/webvr.svg",
  8086. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8087. },
  8088. "more-help-360": {
  8089. "top-info": o.HELP_MORE_360_A,
  8090. "big-image": "images/nav_help_360.svg",
  8091. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8092. }
  8093. }
  8094. },
  8095. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8096. desktop: {
  8097. left: {
  8098. "top-info": o.ROTATE,
  8099. "big-image": "images/nav_help_mouse_drag_left.png",
  8100. keyboard: "images/nav_help_keyboard_left_right.png"
  8101. },
  8102. middle: {
  8103. "top-info": o.MOVE,
  8104. "big-image": "images/nav_help_mouse_click.png",
  8105. keyboard: "images/nav_help_keyboard_up_down.png"
  8106. },
  8107. right: {
  8108. "top-info": o.PLAY,
  8109. "big-image": "images/Desktop-help-play-button.svg",
  8110. keyboard: "images/Desktop-help-spacebar-2.svg"
  8111. }
  8112. },
  8113. mobile: {
  8114. left: {
  8115. "top-info": o.ROTATE,
  8116. "big-image": "images/nav_help_gesture_drag.png"
  8117. },
  8118. middle: {
  8119. "top-info": o.MOVE,
  8120. "big-image": "images/nav_help_gesture_tap.png"
  8121. },
  8122. right: {
  8123. "top-info": o.PLAY,
  8124. "big-image": "images/mobile-help-play-button.svg"
  8125. }
  8126. }
  8127. },
  8128. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8129. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8130. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8131. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8132. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8133. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8134. }
  8135. },
  8136. fill: function(e, t, i) {
  8137. n.call(this, e, t, i, !0)
  8138. },
  8139. clear: function(e, t, i) {
  8140. n.call(this, e, t, i, !1)
  8141. }
  8142. }
  8143. }
  8144. , {
  8145. "../enum/HelpModalSize": 27,
  8146. "../enum/HelpModalType": 28,
  8147. "../enum/Viewmode": 51,
  8148. "../localization/localize": 108,
  8149. "../util/browser": 182
  8150. }],
  8151. 76: [function(e, t, i) {//"./gui/sharing/ShareEvents"
  8152. "use strict";
  8153. t.exports = Object.freeze({
  8154. OPENED: "share.open",
  8155. CLOSED: "share.closed",
  8156. LINK_CLICKED: "share.linked"
  8157. })
  8158. }
  8159. , {}],
  8160. 77: [function(e, t, i) {//"./gui/sharing/modal"
  8161. "use strict";
  8162. function n(e) { //?
  8163. function t(t, i) {
  8164. var n = window.screenY + (window.innerHeight - i) / 2
  8165. , r = window.screenX + (window.innerWidth - t) / 2
  8166. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8167. I.emit(l.LINK_CLICKED, {
  8168. channel: e
  8169. }),
  8170. window.open(C[e], "shareWindow", o)
  8171. }
  8172. switch (e) {
  8173. case y.FACEBOOK:
  8174. t(580, 420);
  8175. break;
  8176. case y.TWITTER:
  8177. t(550, 440);
  8178. break;
  8179. case y.MAIL:
  8180. I.emit(l.LINK_CLICKED, {
  8181. channel: "email"
  8182. }),
  8183. window.open(C[e], "_blank");
  8184. break;
  8185. case y.LINKEDIN:
  8186. }
  8187. }
  8188. function r(e) {
  8189. I.emit(l.LINK_CLICKED, {
  8190. channel: "copylink"
  8191. });
  8192. var t = document.createRange();
  8193. t.selectNodeContents(v);
  8194. var i = window.getSelection();
  8195. i.removeAllRanges(),
  8196. i.addRange(t),
  8197. document.execCommand("copy"),
  8198. A.classList.remove("hidden"),
  8199. v.classList.add("highlighted")
  8200. }
  8201. function o(e) {
  8202. e && (e.stopPropagation(),
  8203. e.target === v) || (window.getSelection().removeAllRanges(),
  8204. v.classList.remove("highlighted"),
  8205. A.classList.add("hidden"))
  8206. }
  8207. var a = e("../../util/browser")
  8208. , s = e("../../localization/localize")
  8209. , l = e("./ShareEvents")
  8210. , c = e("../../util/common")
  8211. , h = e("events").EventEmitter
  8212. , u = document.getElementById("sharing")
  8213. , d = document.getElementById("share-modal")
  8214. , p = document.getElementById("share-close")
  8215. , f = document.getElementById("facebook-share")
  8216. , g = document.getElementById("twitter-share")
  8217. , m = document.getElementById("mail-share")
  8218. , v = document.getElementById("share-url-text")
  8219. , A = document.getElementById("copy-success")
  8220. , y = Object.freeze({
  8221. FACEBOOK: "facebook",
  8222. TWITTER: "twitter",
  8223. MAIL: "mail",
  8224. LINKEDIN: "linkedin"
  8225. })
  8226. , C = {};
  8227. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8228. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8229. C[y.MAIL] = "mailto:?subject=";
  8230. var I = {
  8231. init: function(e) {
  8232. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8233. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8234. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8235. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8236. u.addEventListener("click", this.toggle.bind(this)),
  8237. p.addEventListener("click", this.hide.bind(this)),
  8238. v.addEventListener("click", r),
  8239. d.addEventListener("click", o),
  8240. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8241. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8242. m.addEventListener("click", n.bind(this, y.MAIL)),
  8243. v.textContent = window.location.href + "&utm_source=4",
  8244. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8245. u.classList.remove("hidden")
  8246. },
  8247. show: function() {
  8248. this.emit(l.OPENED),
  8249. d.classList.add("fadeIn")
  8250. },
  8251. hide: function() {
  8252. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8253. document.selection && document.selection.empty(),
  8254. window.getSelection().removeAllRanges(),
  8255. o(),
  8256. d.classList.remove("fadeIn"))
  8257. },
  8258. toggle: function() {
  8259. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8260. }
  8261. };
  8262. c.extendObject(I, h.prototype),
  8263. t.exports = I
  8264. }
  8265. , {
  8266. "../../localization/localize": 108,
  8267. "../../util/browser": 182,
  8268. "../../util/common": 185,
  8269. "./ShareEvents": 76,
  8270. events: 202
  8271. }],
  8272. 78: [function(e, t, i) {//"./terms/TermsEvent"
  8273. "use strict";
  8274. t.exports = Object.freeze({
  8275. OPENED: "terms.opened",
  8276. CLOSED: "terms.closed"
  8277. })
  8278. }
  8279. , {}],
  8280. 79: [function(e, t, i) {///"./terms/terms"
  8281. "use strict";
  8282. var n = e("./TermsEvent")
  8283. , r = e("../../localization/localize")
  8284. , o = e("../../analytics")
  8285. , a = e("../../util/ajax")
  8286. , s = e("../../util/common")
  8287. , l = e("events").EventEmitter
  8288. , c = document.getElementById("terms-modal")
  8289. , h = {
  8290. init: function() {
  8291. $(".footer-terms").on("click", function(e) {
  8292. e.preventDefault(),
  8293. this.show()
  8294. }
  8295. .bind(this)),
  8296. $("#terms-modal .close").on("click", this.hide.bind(this))
  8297. },
  8298. show: function() {
  8299. this.emit(n.OPENED),
  8300. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8301. var t = $("#terms-text").html(e);
  8302. o.track("showcase_gui", {
  8303. gui_action: "click_terms_button",
  8304. interaction_source: "gui"
  8305. }),
  8306. t.find("a").attr("target", "_blank")
  8307. }).fail(function() {
  8308. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8309. }),
  8310. c.classList.add("fadeIn")
  8311. },
  8312. hide: function(e) {
  8313. e && e.preventDefault(),
  8314. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8315. c.classList.remove("fadeIn")
  8316. }
  8317. };
  8318. s.extendObject(h, l.prototype),
  8319. t.exports = h
  8320. }
  8321. , {
  8322. "../../analytics": 4,
  8323. "../../localization/localize": 108,
  8324. "../../util/ajax": 181,
  8325. "../../util/common": 185,
  8326. "./TermsEvent": 78,
  8327. events: 202
  8328. }],
  8329. 80: [function(e, t, i) {//"./title/TitleEvents"
  8330. "use strict";
  8331. t.exports = Object.freeze({
  8332. OPEN_INFO: "title.open.info",
  8333. CLOSE_INFO: "title.close.info",
  8334. SHOW_INFO: "title.show.info",
  8335. HIDE_INFO: "title.hide.info",
  8336. LINK_CLICKED: "title.link.click",
  8337. CONTACT_LINK_CLICKED: "title.contact.click",
  8338. ORIGIN_LINK_CLICKED: "title.origin.click"
  8339. })
  8340. }
  8341. , {}],
  8342. 81: [function(e, t, i) {//"./title/tagToggle"
  8343. "use strict";
  8344. function n(e, t) {
  8345. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8346. }
  8347. function r(e, t) {
  8348. function i(i) {
  8349. e.shouldShowtags = "show" === this.value,
  8350. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8351. }
  8352. document.getElementById("tag-toggles").classList.remove("hidden"),
  8353. document.getElementById("radio-tag-show").checked = !0;
  8354. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8355. n[r].addEventListener("change", i)
  8356. }
  8357. var o = e("../../settings");
  8358. t.exports.init = n
  8359. }
  8360. , {
  8361. "../../settings": 166
  8362. }],
  8363. 82: [function(e, t, i) {//"./gui/title/titleBar"
  8364. (function(i) {
  8365. "use strict";
  8366. function n(e, t) {
  8367. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8368. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8369. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8370. document.getElementById("gui-name").classList.add("noCoBrand"),
  8371. document.getElementById("cobrandTitle").classList.add("hidden")),
  8372. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8373. !1)
  8374. }
  8375. function r(e) {
  8376. return e ? (L = !0,
  8377. void (_.innerText = e)) : void _.classList.add("hidden")
  8378. }
  8379. function o(e, t, i, n) {
  8380. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8381. return void T.classList.add("hidden");
  8382. L = !0;
  8383. var r = []
  8384. , o = c(r, "<br>");
  8385. if (e && o('<span id="contactName">' + e + "</span>"),
  8386. t) {
  8387. var a = n || t
  8388. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8389. o(s)
  8390. }
  8391. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8392. r[0] = "",
  8393. x.innerHTML = r.join("")
  8394. }
  8395. function a(e) {
  8396. if ("string" == typeof e)
  8397. try {
  8398. e = JSON.parse(e)
  8399. } catch (e) {
  8400. return y.warn("Unable to parse address data"),
  8401. void S.parentElement.classList.add("hidden")
  8402. }
  8403. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8404. return void S.parentElement.classList.add("hidden");
  8405. L = !0;
  8406. var t = []
  8407. , i = c(t, " ");
  8408. e.address_1 && i(e.address_1),
  8409. e.address_2 && i(e.address_2),
  8410. e.city && i(e.city, ", "),
  8411. e.state && i(e.state, ", "),
  8412. e.zip && i(e.zip, e.state ? " " : ", "),
  8413. t[0] = "",
  8414. S.innerText = t.join("")
  8415. }
  8416. function s(e) {
  8417. var t = document.createElement("a");
  8418. return t.id = "url",
  8419. t.target = "_blank",
  8420. t.href = e,
  8421. t.innerText = e,
  8422. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8423. t
  8424. }
  8425. function l(e) {
  8426. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8427. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8428. P.appendChild(s(e)),
  8429. O.forEach(function(e) {
  8430. e.classList.add("share-link")
  8431. }),
  8432. !0)
  8433. }
  8434. function c(e, t) {
  8435. var i = e
  8436. , n = t;
  8437. return function(e, t) {
  8438. i.push(t || n, e)
  8439. }
  8440. }
  8441. function h() {
  8442. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8443. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8444. var e = [].slice.call(_.querySelectorAll("a"));
  8445. e.forEach(function(e) {
  8446. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8447. });
  8448. var t = [].slice.call(T.querySelectorAll("a"));
  8449. t.forEach(function(e) {
  8450. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8451. contact_type: e.getAttribute("id")
  8452. }))
  8453. })
  8454. }
  8455. var u = e("../../util/browser")
  8456. , d = e("../../util/common")
  8457. , p = e("../../util/logger")
  8458. , f = e("../../localization/localize")
  8459. , g = e("./titleBarSettings")
  8460. , m = e("../../settings")
  8461. , v = e("./TitleEvents")
  8462. , A = e("events").EventEmitter
  8463. , y = new p(i)
  8464. , C = document.querySelector(".pinTop.left")
  8465. , I = document.getElementsByClassName("title-container")[0]
  8466. , E = document.getElementById("title-toggle").querySelector("i")
  8467. , b = document.getElementById("meta-info-wrapper")
  8468. , w = document.getElementById("meta-info")
  8469. , _ = document.getElementById("meta-description")
  8470. , T = document.getElementsByClassName("contact-info")[0]
  8471. , x = document.getElementById("contact-data")
  8472. , S = document.getElementById("addressTxt")
  8473. , M = document.getElementById("tag-toggles")
  8474. , R = document.getElementById("share-origin")
  8475. , P = document.getElementById("share-link-wrapper")
  8476. , O = [w, b, I]
  8477. , L = !1
  8478. , D = !1
  8479. , N = {
  8480. populate: function(e) {
  8481. if (n(e.name, e.coBrand)) {
  8482. if (r(e.description),
  8483. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8484. a(e.address),
  8485. L) {
  8486. var t = document.createElement("br");
  8487. M.insertBefore(t, M.firstElementChild)
  8488. }
  8489. e.socialSharing && m.share.enabled && (D = l(e.url))
  8490. }
  8491. },
  8492. finishSetup: function(e) {
  8493. L = L || !!e,
  8494. h(),
  8495. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8496. },
  8497. toggleMeta: function(e, t) {
  8498. t && t.preventDefault();
  8499. var i = w.classList.contains("expand");
  8500. e && !i || (i ? (O.forEach(function(e) {
  8501. e.classList.remove("expand")
  8502. }),
  8503. this.emit(v.CLOSE_INFO)) : (O.forEach(function(e) {
  8504. e.classList.add("expand")
  8505. }),
  8506. this.emit(v.OPEN_INFO)))
  8507. },
  8508. setupToggling: function() {
  8509. b.style.height = w.offsetHeight + "px",
  8510. w.addEventListener("transitionend", function() {
  8511. b.style.height = w.offsetHeight + "px"
  8512. })
  8513. },
  8514. toggleTitle: function(e) {
  8515. e && e.preventDefault(),
  8516. C.classList.contains("closed") ? (C.classList.add("open"),
  8517. E.classList.remove("icon-dpad-right"),
  8518. E.classList.add("icon-dpad-left"),
  8519. this.emit(v.SHOW_INFO),
  8520. setTimeout(function() {
  8521. C.classList.remove("closed"),
  8522. C.classList.remove("open")
  8523. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8524. E.classList.remove("icon-dpad-left"),
  8525. E.classList.add("icon-dpad-right"),
  8526. this.emit(v.HIDE_INFO))
  8527. }
  8528. };
  8529. d.extendObject(N, A.prototype),
  8530. t.exports = N
  8531. }
  8532. ).call(this, "/js/gui/title/titleBar.js")
  8533. }
  8534. , {
  8535. "../../localization/localize": 108,
  8536. "../../settings": 166,
  8537. "../../util/browser": 182,
  8538. "../../util/common": 185,
  8539. "../../util/logger": 189,
  8540. "./TitleEvents": 80,
  8541. "./titleBarSettings": 83,
  8542. events: 202
  8543. }],
  8544. 83: [function(e, t, i) {//"./titleBarSettings"
  8545. "use strict";
  8546. t.exports = Object.freeze({
  8547. minTooltipCharacters: 19,
  8548. removeAnimationClasses: 500
  8549. })
  8550. }
  8551. , {}],
  8552. 84: [function(e, t, i) {//"./tourInteraction"
  8553. "use strict";
  8554. function n(e) {
  8555. C = e,
  8556. P.forEach(function(e) {
  8557. b.addEventListener(e, u.bind(this, !1), !0),
  8558. w.addEventListener(e, u.bind(this, !0), !0),
  8559. E.addEventListener(e, o, !0),
  8560. S.forEach(function(t) {
  8561. t.addEventListener(e, a, !0)
  8562. }),
  8563. $("#drawer img").on(e, a)
  8564. }),
  8565. //document.addEventListener("keydown", u.bind(this, !1), !0), //----MP
  8566. document.addEventListener("keydown", function(e){ //xzw 为了判断keyCon
  8567. if(window.keyCon == false)return;
  8568. u(!1,e);
  8569. }.bind(this), !0),
  8570. C.on(v.TourStart, function() {
  8571. E.classList.add("playing")
  8572. })
  8573. }
  8574. function r() {
  8575. C.playTour(),
  8576. I && clearTimeout(I),
  8577. d(),
  8578. _.removeClass("fadeIn")
  8579. }
  8580. function o() {
  8581. E.classList.contains("playing") && (C.stopTour(),
  8582. _.addClass("fadeIn"),
  8583. setTimeout(function() {
  8584. _.removeClass("fadeIn")
  8585. }, p.tourInteraction.showPauseButton),
  8586. O || (clearTimeout(I),
  8587. I = setTimeout(h, p.tourInteraction.showModal)),
  8588. setTimeout(function() {
  8589. E.classList.remove("playing")
  8590. }, p.tourInteraction.allowNextClick))
  8591. }
  8592. function a() {
  8593. C.tourInProgress && (C.stopTour(),
  8594. C.endTourProgress(),
  8595. E.classList.remove("playing"))
  8596. }
  8597. function s() {
  8598. T.is(":visible") ? r() : o()
  8599. }
  8600. function l() {
  8601. x.hasClass("playing") && (clearTimeout(I),
  8602. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8603. }
  8604. function c() {
  8605. E.classList.remove("playing"),
  8606. h()
  8607. }
  8608. function h() {
  8609. if (!p.tourInteraction.disabled) {
  8610. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8611. M.addClass("fadeIn tour " + m.deviceType);
  8612. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8613. if (!p.tourInteraction.smallModal) {
  8614. var t;
  8615. 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,
  8616. m.fill(R, A.TOUR_INTERACTION[t]),
  8617. M.addClass(t)
  8618. }
  8619. M.addClass(e)
  8620. }
  8621. }
  8622. function u(e, t) { //自动播放相关
  8623. if (t) {
  8624. var i = "keydown" === t.type
  8625. , n = t.which === f.SPACE || C.tourIsPlaying;
  8626. i && n || e || (O = !0),
  8627. C.atEndOfTour() && d(),
  8628. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8629. d(),
  8630. t.which !== f.SPACE && a()),
  8631. i && n && s()
  8632. }
  8633. }
  8634. function d() {
  8635. M.removeClass("fadeIn")
  8636. }
  8637. var p = (e("../util/browser"),
  8638. e("../settings"))
  8639. , f = e("../enum/Keys")
  8640. , g = e("../enum/Viewmode")
  8641. , m = (e("./helpManager"),
  8642. e("./populateModal"))
  8643. , v = e("../enum/DirectorEvents")
  8644. , A = e("../enum/HelpModalType")
  8645. , y = e("../enum/HelpModalSize")
  8646. , C = null
  8647. , I = null
  8648. , E = document.getElementById("pause-overlay")
  8649. , b = document.getElementById("player")
  8650. , w = document.getElementById("gui")
  8651. , _ = $("#pause-icon").eq(0)
  8652. , T = $("#play").eq(0)
  8653. , x = $("#playHead").eq(0)
  8654. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8655. , M = $("#interaction-modal").eq(0)
  8656. , R = $("#interaction-modal .interaction").toArray()
  8657. , P = ["touchstart", "mousedown", "pointerdown"]
  8658. , O = !1;
  8659. t.exports.init = n,
  8660. t.exports.play = r,
  8661. t.exports.pause = o,
  8662. t.exports.pauseWithoutCTA = a,
  8663. t.exports.togglePlay = s,
  8664. t.exports.stopTour = l,
  8665. t.exports.dismissModal = d
  8666. }
  8667. , {
  8668. "../enum/DirectorEvents": 23,
  8669. "../enum/HelpModalSize": 27,
  8670. "../enum/HelpModalType": 28,
  8671. "../enum/Keys": 30,
  8672. "../enum/Viewmode": 51,
  8673. "../settings": 166,
  8674. "../util/browser": 182,
  8675. "./helpManager": 68,
  8676. "./populateModal": 75
  8677. }],
  8678. 85: [function(e, t, i) {//"./gui/vr/vrEvent"
  8679. "use strict";
  8680. t.exports = Object.freeze({
  8681. OPENED: "vr.modal.opened",
  8682. LAUNCH: "vr.modal.launch",
  8683. CLOSED: "vr.modal.closed",
  8684. NEXT: "vr.modal.next",
  8685. PREV: "vr.modal.prev",
  8686. STORE: "vr.modal.store",
  8687. falseICECHOSEN: "vr.modal.device"
  8688. })
  8689. }
  8690. , {}],
  8691. 86: [function(e, t, i) {//"./../vr/vrLink"
  8692. "use strict";
  8693. function n(e, t, i) {
  8694. function n(e, t, n, r) {
  8695. function o() {
  8696. return p + "&m=" + t + "&display=" + e
  8697. }
  8698. function s() {
  8699. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8700. , t = "&utm_source=" + u
  8701. , n = "&utm_showcase_session_id=" + i;
  8702. return e + t + n
  8703. }
  8704. function l() {
  8705. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8706. }
  8707. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8708. }
  8709. function r(e, t, i, r) {
  8710. var o = "https://api.branch.io/v1/url"
  8711. , a = n(e, t, i, r)
  8712. , s = {
  8713. responseType: "json",
  8714. data: {
  8715. branch_key: h.appConfig.branch_key,
  8716. data: {
  8717. m: t,
  8718. full_url: a,
  8719. $desktop_url: m,
  8720. $og_app_id: "331853976762864119",
  8721. $og_title: i,
  8722. $og_description: r,
  8723. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8724. $canonical_url: window.location.href
  8725. }
  8726. }
  8727. };
  8728. c.post(o, s).done(function(t) {
  8729. f[e] = t.url
  8730. }).fail(function(t) {
  8731. f[e] = t
  8732. }
  8733. .bind(this, a))
  8734. }
  8735. function o(e, t, i) {
  8736. for (var r in s) {
  8737. var o = s[r]
  8738. , a = n(o, e, t, i);
  8739. f[o] = a
  8740. }
  8741. }
  8742. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8743. , d = g + "/vr/dlist/?ret=" + u
  8744. , p = g + "/vr/show/?ret=" + u
  8745. , m = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
  8746. switch (e) {
  8747. case l.IOS:
  8748. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8749. break;
  8750. default:
  8751. o(t.sid, t.name, t.summary)
  8752. }
  8753. }
  8754. function r(e) {
  8755. var t = f[e];
  8756. window.open(t, "_blank")
  8757. }
  8758. function o(e) {
  8759. var t = u[e];
  8760. window.open(t, "_blank")
  8761. }
  8762. var a = e("../../util/browser")
  8763. , s = e("../../enum/VRApps")
  8764. , l = e("../../enum/VRPlatforms")
  8765. , c = e("../../util/ajax")
  8766. , h = e("../../settings")
  8767. , u = {};
  8768. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8769. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8770. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8771. for (var d in s) {
  8772. var p = s[d];
  8773. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8774. }
  8775. var f = {}
  8776. , g = function() {
  8777. var e = window.location.host;
  8778. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8779. "https://" + e
  8780. }();
  8781. t.exports.init = n,
  8782. t.exports.launch = r,
  8783. t.exports.launchStore = o
  8784. }
  8785. , {
  8786. "../../enum/VRApps": 46,
  8787. "../../enum/VRPlatforms": 49,
  8788. "../../settings": 166,
  8789. "../../util/ajax": 181,
  8790. "../../util/browser": 182
  8791. }],
  8792. 87: [function(e, t, i) {//"./vr/vrModal"
  8793. "use strict";
  8794. function n(e) {
  8795. var t;
  8796. switch (e) {
  8797. case m.IOS:
  8798. return t = p.iosVersion(),
  8799. t.major > 9 || 9 === t.major && t.minor >= 1;
  8800. case m.Android:
  8801. return t = p.androidVersion(),
  8802. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8803. }
  8804. return !1
  8805. }
  8806. function r(e, t) {
  8807. function i(e) {
  8808. K.emit(A.STORE, {
  8809. type: e
  8810. }),
  8811. f.launchStore(e)
  8812. }
  8813. function r(e) {
  8814. switch (e !== _.pageCount && (a(e),
  8815. N.text(e + 1 + " / " + _.pageCount)),
  8816. e) {
  8817. case _.Title:
  8818. O.css("display", "none"),
  8819. L.text(u[e]),
  8820. o(s);
  8821. break;
  8822. case _.Cardboard:
  8823. O.css("display", "block"),
  8824. L.text(u[e]),
  8825. M.filter(".cardboard").off(),
  8826. M.filter(".gearvr").off(),
  8827. c(e, s),
  8828. h(H, X, Z);
  8829. break;
  8830. case _.Gear:
  8831. L.text(u[e]),
  8832. c(e, s),
  8833. T.addClass("lastPage"),
  8834. h(G, X, Z);
  8835. break;
  8836. case _.pageCount:
  8837. T.removeClass("fadeIn"),
  8838. K.emit(A.CLOSED)
  8839. }
  8840. B.filter("[src='']").hide()
  8841. }
  8842. var s = function() {
  8843. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8844. w = ".show-supported",
  8845. m.Android) : (T.addClass("unsupported"),
  8846. w = ".show-unsupported",
  8847. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8848. w = ".show-ios",
  8849. _ = v.ios,
  8850. m.IOS) : (T.addClass("desktop"),
  8851. w = ".show-desktop",
  8852. m.Desktop)
  8853. }();
  8854. f.init(s, e, t),
  8855. s !== m.Desktop && T.addClass("mobile");
  8856. var l = function(e) {
  8857. K.emit(A.LAUNCH, {
  8858. vr_platform: s,
  8859. vr_app: e
  8860. }),
  8861. f.launch(e)
  8862. };
  8863. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8864. q.gear = l.bind(this, g.GearVR),
  8865. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8866. d(),
  8867. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8868. $(w).show();
  8869. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8870. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8871. s === m.IOS && (u.splice(1, 1),
  8872. y.splice(1, 1)),
  8873. $("#vr").on("click", function(e) {
  8874. e.preventDefault(),
  8875. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8876. r(b),
  8877. T.addClass("fadeIn"),
  8878. K.emit(A.OPENED))
  8879. });
  8880. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8881. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8882. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8883. $("span.modelLink").text(I),
  8884. O.on("click", function(e) {
  8885. K.emit(A.PREV),
  8886. b--,
  8887. r(b)
  8888. }),
  8889. L.on("click", function(e) {
  8890. L.text();
  8891. K.emit(A.NEXT, {
  8892. nextAction: y[b]
  8893. }),
  8894. b++,
  8895. r(b)
  8896. }),
  8897. T.find(".close").on("click", K.dismiss)
  8898. }
  8899. function o(e) {
  8900. switch (e) {
  8901. case m.Android:
  8902. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8903. M.filter(".gearvr").off().on("click", q.gear),
  8904. s(H, G, "logo-button", "same-line");
  8905. break;
  8906. case m.UnsupportedAndroid:
  8907. s("", z, "", "");
  8908. break;
  8909. case m.IOS:
  8910. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8911. s(H, "", "logo-button", "");
  8912. break;
  8913. case m.Desktop:
  8914. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8915. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8916. s(H, G, "logo-button", "same-line"),
  8917. Q.cardboard()
  8918. }
  8919. }
  8920. function a(e) {
  8921. $(".p1, .p2, .p3").hide(),
  8922. x.insertAfter(S),
  8923. T.removeClass("front-page"),
  8924. T.removeClass("details-page"),
  8925. T.removeClass("lastPage"),
  8926. M.removeClass("logo-button"),
  8927. M.removeClass("same-line"),
  8928. S.removeClass("headsetOptions"),
  8929. R.attr("src", ""),
  8930. R.filter(".second").removeClass("gear"),
  8931. R.css("display", "inline-block"),
  8932. R.off(),
  8933. P.filter(".second").css("display", ""),
  8934. D.css("display", "none"),
  8935. $(".p" + (e + 1) + w).show(),
  8936. R.filter(".third").insertBefore(P.filter(".third"))
  8937. }
  8938. function s(e, t, i, n) {
  8939. T.addClass("front-page"),
  8940. R.filter(".first").attr("src", e),
  8941. R.filter(".second").attr("src", t),
  8942. M.filter(".first").addClass(i),
  8943. M.filter(".second").addClass(i),
  8944. M.addClass(n),
  8945. ".show-desktop" === w && S.insertAfter(x)
  8946. }
  8947. function l(e, t, i) {
  8948. S.addClass("headsetOptions"),
  8949. M.off(),
  8950. R.filter(".second").attr("src", t),
  8951. D.css("display", "block"),
  8952. P.filter(".second").css("display", "none"),
  8953. D.on("click", function() {
  8954. a(_.Title),
  8955. o(m.Desktop)
  8956. }),
  8957. e && (K.emit(A.falseICECHOSEN, {
  8958. name: g.GearVR
  8959. }),
  8960. R.filter(".first").attr("src", e),
  8961. R.filter(".second").addClass("gear"),
  8962. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8963. Q.gearvr()),
  8964. i && (K.emit(A.falseICECHOSEN, {
  8965. name: g.Cardboard
  8966. }),
  8967. R.filter(".third").attr("src", i),
  8968. R.filter(".third").show(),
  8969. R.filter(".third").insertAfter(R.filter(".second")),
  8970. R.filter(".third").addClass("link"),
  8971. R.filter(".second").addClass("link"),
  8972. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8973. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8974. Q.cardboard())
  8975. }
  8976. function c(e, t) {
  8977. switch (t) {
  8978. case m.IOS:
  8979. X = Y,
  8980. Z = j;
  8981. break;
  8982. case m.Desktop:
  8983. e === _.Cardboard ? (X = F,
  8984. Z = U,
  8985. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8986. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8987. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8988. Z = "");
  8989. break;
  8990. default:
  8991. e === _.Cardboard ? (X = z,
  8992. Z = j) : (X = k,
  8993. Z = W)
  8994. }
  8995. }
  8996. function h(e, t, i) {
  8997. T.find(".inner").addClass("details-page"),
  8998. T.addClass("details-page"),
  8999. R.filter(".first").attr("src", e),
  9000. R.filter(".second").attr("src", t),
  9001. R.filter(".third").attr("src", i)
  9002. }
  9003. function u() {
  9004. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9005. K.emit(A.CLOSED))
  9006. }
  9007. function d() {
  9008. var e = p.aspectRatio() > 1 && p.isMobile();
  9009. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9010. T.toggleClass("tiny", window.innerHeight <= y.narrowLandscapeHeight),
  9011. T.toggleClass("tinier", window.innerHeight <= y.reallyNarrowLandscapeHeight)
  9012. }
  9013. var p = e("../../util/browser")
  9014. , f = e("./vrLink")
  9015. , g = e("../../enum/VRApps")
  9016. , m = e("../../enum/VRPlatforms")
  9017. , v = e("../../enum/VRPages")
  9018. , A = e("./vrEvent")
  9019. , y = (e("../../settings"),
  9020. e("../../constants"))
  9021. , C = e("../../localization/localize")
  9022. , I = e("../../util/common")
  9023. , E = e("events").EventEmitter
  9024. , b = 0
  9025. , w = null
  9026. , _ = v.standard
  9027. , T = $(".vr-popup")
  9028. , x = T.find(".vr-popup-body")
  9029. , S = T.find(".vr-images")
  9030. , M = T.find(".img-container")
  9031. , R = T.find(".vr-sm-image")
  9032. , P = M.find(".vr-img-caption")
  9033. , O = $(".vr-buttons").find(".prev-button")
  9034. , L = $(".vr-buttons").find(".next-button")
  9035. , D = S.find(".front-close")
  9036. , N = $(".vr-page")
  9037. , B = T.find("img")
  9038. , F = "images/apple-store.png"
  9039. , V = "images/badge-oculus.png"
  9040. , U = "images/badge-cardboard.png"
  9041. , k = "images/logo-samsung.png"
  9042. , H = "images/headset-cardboard.png"
  9043. , G = "images/headset-gearvr.png"
  9044. , z = "images/ico-android-robot.png"
  9045. , W = "images/ico-gearvr.png"
  9046. , j = "images/ico-vr.png"
  9047. , Y = "images/apple-logo-white.svg"
  9048. , X = null
  9049. , Z = null
  9050. , q = {}
  9051. , K = {
  9052. init: r,
  9053. dismiss: u,
  9054. isDeviceSupported: n
  9055. };
  9056. I.extendObject(K, E.prototype),
  9057. $(window).resize(d);
  9058. var Q = function() {
  9059. var e = P.filter(".first").find(".cardboard")
  9060. , t = P.filter(".first").find(".gearvr");
  9061. return {
  9062. cardboard: function() {
  9063. t.addClass("hidden"),
  9064. e.removeClass("hidden")
  9065. },
  9066. gearvr: function() {
  9067. e.addClass("hidden"),
  9068. t.removeClass("hidden")
  9069. }
  9070. }
  9071. }();
  9072. t.exports = K
  9073. }
  9074. , {
  9075. "../../constants": 8,
  9076. "../../enum/VRApps": 46,
  9077. "../../enum/VRPages": 48,
  9078. "../../enum/VRPlatforms": 49,
  9079. "../../localization/localize": 108,
  9080. "../../settings": 166,
  9081. "../../util/browser": 182,
  9082. "../../util/common": 185,
  9083. "./vrEvent": 85,
  9084. "./vrLink": 86,
  9085. events: 202
  9086. }],
  9087. 88: [function(e, t, i) {//"./webvr/WebVrEvent"
  9088. "use strict";
  9089. t.exports = Object.freeze({
  9090. OPENED: "webvr.modal.opened",
  9091. SHOW_TERMS: "webvr.footer.show.terms"
  9092. })
  9093. }
  9094. , {}],
  9095. 89: [function(e, t, i) {///js/gui/webvr/webVRgui.js
  9096. (function(i) {
  9097. "use strict";
  9098. function n(e, t, i, n) {
  9099. function r(e) {
  9100. e.preventDefault(),
  9101. a(e.currentTarget.id)
  9102. }
  9103. function a(e) {
  9104. ne[e](),
  9105. Object.keys(ne).map(function(t, i) {
  9106. $("#" + t).toggleClass("tabs-underlined", t === e)
  9107. })
  9108. }
  9109. y = i,
  9110. v = t,
  9111. w.init(E.Android, e, n),
  9112. m();
  9113. var l = new RegExp("daydream","i")
  9114. , c = l.test(y.displayName);
  9115. c ? (a("tabdaydream"),
  9116. B.filter(".device-headset-side").attr("src", H),
  9117. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9118. B.filter(".device-headset-side").attr("src", Y),
  9119. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9120. $("#vr").on("click", function(e) {
  9121. e.preventDefault(),
  9122. g("click_webvr_button"),
  9123. L.is(":hidden") && (ie.emit(_.OPENED),
  9124. o())
  9125. }),
  9126. $(".webvr-popup .close").on("click", function(e) {
  9127. e.preventDefault(),
  9128. D.hasClass("hidden") ? (g("webvr_help_close"),
  9129. p()) : s()
  9130. }),
  9131. $("#tabcardboard").on("click", r),
  9132. $("#tabdaydream").on("click", r),
  9133. $("#tabnative").on("click", r),
  9134. $(".webvr-popup .open-with-app").on("click", function(e) {
  9135. e.preventDefault(),
  9136. g("webvr_learn_more"),
  9137. a("tabnative"),
  9138. p()
  9139. }),
  9140. $(".webvr-popup .help").on("click", function(e) {
  9141. e.preventDefault(),
  9142. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9143. p()
  9144. }),
  9145. $(".webvr-popup .terms").on("click", function(e) {
  9146. e.preventDefault(),
  9147. g("webvr_click_terms"),
  9148. s(),
  9149. ie.emit(_.SHOW_TERMS)
  9150. }),
  9151. F.on("click", function(e) {
  9152. e.preventDefault(),
  9153. g(ee),
  9154. window.open(J, "_blank")
  9155. }),
  9156. V.on("click", function(e) {
  9157. e.preventDefault(),
  9158. g("webvr_phone_link"),
  9159. window.open(te, "_blank")
  9160. }),
  9161. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9162. e.preventDefault(),
  9163. g("webvr_cardboard_link"),
  9164. w.launch(b.CardboardAndroid)
  9165. }),
  9166. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9167. e.preventDefault(),
  9168. g("webvr_oculus_link"),
  9169. w.launch(b.GearVR)
  9170. })
  9171. }
  9172. function r() {
  9173. function e() {
  9174. y.isPresenting || (f(),
  9175. window.removeEventListener("vrdisplaypresentchange", e))
  9176. }
  9177. R.info("Headset mounted"),
  9178. v.suspend();
  9179. var t = document.createElement("canvas");
  9180. for (t.getContext("webgl"),
  9181. t.className = "webvr-canvas",
  9182. document.bgColor = "#000",
  9183. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9184. document.body.removeChild(document.body.firstChild);
  9185. document.body.appendChild(t),
  9186. g("webvr_enter_app"),
  9187. y.requestPresent([{
  9188. source: t,
  9189. predistorted: !0
  9190. }]).catch(function(t) {
  9191. R.error("Failed to present: " + t),
  9192. g("webvr_exit_calibrate"),
  9193. e()
  9194. }),
  9195. A.then(function() {
  9196. window.dispatchEvent(new Event("vrapp-start"))
  9197. }),
  9198. window.addEventListener("vrdisplaypresentchange", e)
  9199. }
  9200. function o() {
  9201. O.fadeOut(I.guiAnimationSpeed),
  9202. L.fadeIn(I.guiAnimationSpeed),
  9203. a()
  9204. }
  9205. function a() {
  9206. if (!A) {
  9207. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9208. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9209. A = new Promise(function(e, i) {
  9210. var n = document.createElement("script");
  9211. n.type = "text/javascript",
  9212. n.src = t,
  9213. n.onload = e,
  9214. document.head.appendChild(n)
  9215. }
  9216. )
  9217. }
  9218. D.find(".enter-button").on("click", r)
  9219. }
  9220. function s() {
  9221. g("webvr_modal_close"),
  9222. D.find(".enter-button").off("click", r),
  9223. L.fadeOut(I.guiAnimationSpeed, function() {
  9224. D.toggleClass("hidden", !1),
  9225. N.toggleClass("hidden", !0),
  9226. C.exitFullscreen()
  9227. }),
  9228. O.fadeIn(I.guiAnimationSpeed)
  9229. }
  9230. function l() {
  9231. k.toggleClass("hidden", !1),
  9232. U.toggleClass("hidden", !0)
  9233. }
  9234. function c() {
  9235. k.toggleClass("hidden", !0),
  9236. U.toggleClass("hidden", !1)
  9237. }
  9238. function h() {
  9239. B.filter(".device-headset").attr("src", G),
  9240. B.filter(".device-phone").attr("src", z),
  9241. J = Z,
  9242. ee = K,
  9243. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9244. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9245. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9246. c()
  9247. }
  9248. function u() {
  9249. B.filter(".badge-cardboard").attr("src", j),
  9250. B.filter(".badge-oculus").attr("src", X),
  9251. l()
  9252. }
  9253. function d() {
  9254. B.filter(".device-headset").attr("src", Y),
  9255. B.filter(".device-phone").attr("src", W),
  9256. J = q,
  9257. ee = Q,
  9258. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9259. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9260. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9261. c()
  9262. }
  9263. function p() {
  9264. D.toggleClass("hidden"),
  9265. N.toggleClass("hidden")
  9266. }
  9267. function f() {
  9268. R.info("exiting webVR"),
  9269. g("webvr_exit_app"),
  9270. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9271. }
  9272. function g(e) {
  9273. var t = C.isLandscape() ? "landscape" : "portrait";
  9274. T.trackAlways("showcase_gui", {
  9275. gui_action: e,
  9276. orientation: t
  9277. })
  9278. }
  9279. function m() {
  9280. var e = C.isLandscape();
  9281. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9282. }
  9283. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9284. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9285. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9286. init: n
  9287. }, ne = {
  9288. tabcardboard: d,
  9289. tabdaydream: h,
  9290. tabnative: u
  9291. };
  9292. S.extendObject(ie, P.prototype),
  9293. $(window).resize(m),
  9294. t.exports = ie
  9295. }
  9296. ).call(this, "/js/gui/webvr/webVRgui.js")
  9297. }
  9298. , {
  9299. "../../analytics": 4,
  9300. "../../constants": 8,
  9301. "../../enum/VRApps": 46,
  9302. "../../enum/VRPlatforms": 49,
  9303. "../../localization/localize": 108,
  9304. "../../settings": 166,
  9305. "../../util/browser": 182,
  9306. "../../util/common": 185,
  9307. "../../util/logger": 189,
  9308. "./../gui": 65,
  9309. "./../vr/vrLink": 86,
  9310. "./WebVrEvent": 88,
  9311. events: 202
  9312. }],
  9313. 90: [function(e, t, i) {//"../label/Label"
  9314. "use strict";
  9315. function n(e, t, i, n, o) {
  9316. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9317. this.roomId = o || "",
  9318. this.labelId = e,
  9319. this.position = (new r.Vector3).copy(t),
  9320. this.text = i
  9321. }
  9322. var r = e("three")
  9323. , o = e("../util/browser");
  9324. n.prototype.build = function() {
  9325. var e = window.document.createElement("div");
  9326. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9327. var t = window.document.createElement("div");
  9328. t.setAttribute("class", "gui-floorplan-label-text");
  9329. var i = window.document.createTextNode(this.text);
  9330. t.appendChild(i),
  9331. e.appendChild(t),
  9332. window.document.body.appendChild(e),
  9333. this.labelGui = e,
  9334. this.textBlock = t,
  9335. $(this.labelGui).hide();
  9336. var n = window.getComputedStyle(this.labelGui);
  9337. this.initialTransform = n.transform || n.webkitTransform
  9338. }
  9339. ,
  9340. t.exports = n
  9341. }
  9342. , {
  9343. "../util/browser": 182,
  9344. three: 217
  9345. }],
  9346. 91: [function(e, t, i) {//"./label/LabelDisplayController"
  9347. "use strict";
  9348. function n() {
  9349. this.player = null,
  9350. this.modelManager = null,
  9351. this.container = null
  9352. }
  9353. var r = e("three")
  9354. , o = (e("../util/common"),
  9355. e("../enum/PlayerEvents"))
  9356. , a = (e("../enum/DirectorEvents"),
  9357. e("../enum/ModelManagerEvents"))
  9358. , s = e("../settings")
  9359. , l = e("../enum/Viewmode")
  9360. , c = (e("../enum/WarpStyle"),
  9361. e("../util/transitions"),
  9362. e("../util/lerp"),
  9363. e("../util/browser"));
  9364. n.prototype.init = function(e, t, i) {
  9365. this.player = e,
  9366. this.modelManager = t,
  9367. this.container = i,
  9368. this.updateModel(),
  9369. this.bindEvents()
  9370. }
  9371. ,
  9372. n.prototype.bindEvents = function() {
  9373. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9374. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9375. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9376. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9377. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9378. }
  9379. ,
  9380. n.prototype.updateModel = function() {
  9381. this.model = this.modelManager.getActiveModel()
  9382. }
  9383. ,
  9384. n.prototype.handlePlayerViewChanged = function() {
  9385. this.updateLabelVisibility(),
  9386. this.updateLabelDisplay()
  9387. }
  9388. ,
  9389. n.prototype.getLabelsForFloor = function(e, t) {
  9390. return t = t || [],
  9391. t.length = 0,
  9392. this.model.labels.forEach(function(i) {
  9393. this.labelVisibleForFloor(i, e) && t.push(i)
  9394. }
  9395. .bind(this)),
  9396. t
  9397. }
  9398. ,
  9399. n.prototype.getLabelsForCurrentFloor = function(e) {
  9400. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9401. }
  9402. ,
  9403. n.prototype.labelVisibleForFloor = function(e, t) {
  9404. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9405. if (!this.model.showingLabels || !e.labelGui || !i)
  9406. return !1;
  9407. var n = e.floorId === this.model.floors.size() - 1;
  9408. return this.model.allFloorsVisible ? n : e.floorId === t
  9409. }
  9410. ,
  9411. n.prototype.updateLabelVisibility = function(e) {
  9412. this.model.labels.forEach(function(e) {
  9413. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9414. }
  9415. .bind(this))
  9416. }
  9417. ,
  9418. n.prototype.showAllLabels = function(e, t) {
  9419. this.model.labels.forEach(function(i) {
  9420. this.showLabel(i, e, t)
  9421. }
  9422. .bind(this))
  9423. }
  9424. ,
  9425. n.prototype.hideAllLabels = function(e, t) {
  9426. this.model.labels.forEach(function(i) {
  9427. this.hideLabel(i, e, t)
  9428. }
  9429. .bind(this))
  9430. }
  9431. ,
  9432. n.prototype.showLabel = function(e, t, i) {
  9433. this.model.showingLabels && (e.visible || (e.visible = !0,
  9434. e.labelGui.style.display = "block",
  9435. e.labelGui.style.opacity = 0,
  9436. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9437. }
  9438. ,
  9439. n.prototype.hideLabel = function(e, t, i) {
  9440. e.visible && (e.visible = !1,
  9441. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9442. }
  9443. ,
  9444. n.prototype.supportedMode = function() {
  9445. return this.player.mode === l.FLOORPLAN
  9446. }
  9447. ,
  9448. n.prototype.updateLabelDisplay = function() {
  9449. var e = (new r.Vector3,
  9450. new r.Vector3,
  9451. []);
  9452. return function() {
  9453. var t = this.player.getLabelScaleFactor()
  9454. , i = .6
  9455. , n = 1.2
  9456. , r = (1 - t) * n + i
  9457. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9458. this.getLabelsForCurrentFloor(e);
  9459. for (var a = 0; a < e.length; a++) {
  9460. var l = e[a];
  9461. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9462. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9463. }
  9464. }
  9465. }(),
  9466. n.prototype.updateProjectedGuiElement = function() {
  9467. var e = new r.Vector3;
  9468. new r.Vector3;
  9469. return function(t, i, n, r, o) {
  9470. i.style.fontSize = 100 * o + "%";
  9471. var a = $('#player').width()
  9472. , s = $('#player').height()
  9473. , l = .5 * a
  9474. , c = .5 * s;
  9475. e.copy(n),
  9476. e.project(this.player.camera);
  9477. var h = e.x * l + l
  9478. , u = -(e.y * c) + c;
  9479. h -= t.offsetWidth / 2,
  9480. u -= t.offsetHeight / 2,
  9481. t.style.left = h + "px",
  9482. t.style.top = u + "px"
  9483. }
  9484. }(),
  9485. n.prototype.handleStartInside = function(e) {
  9486. this.updateLabelVisibility()
  9487. }
  9488. ,
  9489. n.prototype.handleStartOutside = function() {
  9490. this.updateLabelVisibility()
  9491. }
  9492. ,
  9493. t.exports = n
  9494. }
  9495. , {
  9496. "../enum/DirectorEvents": 23,
  9497. "../enum/ModelManagerEvents": 33,
  9498. "../enum/PlayerEvents": 40,
  9499. "../enum/Viewmode": 51,
  9500. "../enum/WarpStyle": 52,
  9501. "../settings": 166,
  9502. "../util/browser": 182,
  9503. "../util/common": 185,
  9504. "../util/lerp": 188,
  9505. "../util/transitions": 195,
  9506. three: 217
  9507. }],
  9508. 92: [function(e, t, i) {//"./lib/array-polyfill"
  9509. "use strict";
  9510. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9511. if (null == this)
  9512. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9513. if ("function" != typeof e)
  9514. throw new TypeError("predicate must be a function");
  9515. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9516. if (t = i[o],
  9517. e.call(r, t, o, i))
  9518. return o;
  9519. return -1
  9520. }
  9521. ),
  9522. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9523. value: function(e) {
  9524. if (null == this)
  9525. throw new TypeError('"this" is null or not defined');
  9526. var t = Object(this)
  9527. , i = t.length >>> 0;
  9528. if ("function" != typeof e)
  9529. throw new TypeError("predicate must be a function");
  9530. for (var n = arguments[1], r = 0; r < i; ) {
  9531. var o = t[r];
  9532. if (e.call(n, o, r, t))
  9533. return o;
  9534. r++
  9535. }
  9536. }
  9537. })
  9538. }
  9539. , {}],
  9540. 93: [function(e, t, i) {//"../lib/dat.gui"
  9541. "use strict";
  9542. var n = n || {};
  9543. t.exports = n,
  9544. n.gui = n.gui || {},
  9545. n.utils = n.utils || {},
  9546. n.controllers = n.controllers || {},
  9547. n.dom = n.dom || {},
  9548. n.color = n.color || {},
  9549. n.utils.css = function() {
  9550. return {
  9551. load: function(e, t) {
  9552. t = t || document;
  9553. var i = t.createElement("link");
  9554. i.type = "text/css",
  9555. i.rel = "stylesheet",
  9556. i.href = e,
  9557. t.getElementsByTagName("head")[0].appendChild(i)
  9558. },
  9559. inject: function(e, t) {
  9560. t = t || document;
  9561. var i = document.createElement("style");
  9562. i.type = "text/css",
  9563. i.innerHTML = e,
  9564. t.getElementsByTagName("head")[0].appendChild(i)
  9565. }
  9566. }
  9567. }(),
  9568. n.utils.common = function() {
  9569. var e = Array.prototype.forEach
  9570. , t = Array.prototype.slice;
  9571. return {
  9572. BREAK: {},
  9573. extend: function(e) {
  9574. return this.each(t.call(arguments, 1), function(t) {
  9575. for (var i in t)
  9576. this.isUndefined(t[i]) || (e[i] = t[i])
  9577. }, this),
  9578. e
  9579. },
  9580. defaults: function(e) {
  9581. return this.each(t.call(arguments, 1), function(t) {
  9582. for (var i in t)
  9583. this.isUndefined(e[i]) && (e[i] = t[i])
  9584. }, this),
  9585. e
  9586. },
  9587. compose: function() {
  9588. var e = t.call(arguments);
  9589. return function() {
  9590. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9591. i = [e[n].apply(this, i)];
  9592. return i[0]
  9593. }
  9594. },
  9595. each: function(t, i, n) {
  9596. if (t)
  9597. if (e && t.forEach && t.forEach === e)
  9598. t.forEach(i, n);
  9599. else if (t.length === t.length + 0) {
  9600. for (var r = 0, o = t.length; r < o; r++)
  9601. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9602. return
  9603. } else
  9604. for (var r in t)
  9605. if (i.call(n, t[r], r) === this.BREAK)
  9606. return
  9607. },
  9608. defer: function(e) {
  9609. setTimeout(e, 0)
  9610. },
  9611. toArray: function(e) {
  9612. return e.toArray ? e.toArray() : t.call(e)
  9613. },
  9614. isUndefined: function(e) {
  9615. return void 0 === e
  9616. },
  9617. isNull: function(e) {
  9618. return null === e
  9619. },
  9620. isNaN: function(e) {
  9621. return e !== e
  9622. },
  9623. isArray: Array.isArray || function(e) {
  9624. return e.constructor === Array
  9625. }
  9626. ,
  9627. isObject: function(e) {
  9628. return e === Object(e)
  9629. },
  9630. isNumber: function(e) {
  9631. return e === e + 0
  9632. },
  9633. isString: function(e) {
  9634. return e === e + ""
  9635. },
  9636. isBoolean: function(e) {
  9637. return e === !1 || e === !0
  9638. },
  9639. isFunction: function(e) {
  9640. return "[object Function]" === Object.prototype.toString.call(e)
  9641. }
  9642. }
  9643. }(),
  9644. n.controllers.Controller = function(e) {
  9645. var t = function(e, t) {
  9646. this.initialValue = e[t],
  9647. this.domElement = document.createElement("div"),
  9648. this.object = e,
  9649. this.property = t,
  9650. this.__onChange = void 0,
  9651. this.__onFinishChange = void 0
  9652. };
  9653. return e.extend(t.prototype, {
  9654. onChange: function(e) {
  9655. return this.__onChange = e,
  9656. this
  9657. },
  9658. onFinishChange: function(e) {
  9659. return this.__onFinishChange = e,
  9660. this
  9661. },
  9662. setValue: function(e) {
  9663. return this.object[this.property] = e,
  9664. this.__onChange && this.__onChange.call(this, e),
  9665. this.updateDisplay(),
  9666. this
  9667. },
  9668. getValue: function() {
  9669. return this.object[this.property]
  9670. },
  9671. updateDisplay: function() {
  9672. return this
  9673. },
  9674. isModified: function() {
  9675. return this.initialValue !== this.getValue()
  9676. }
  9677. }),
  9678. t
  9679. }(n.utils.common),
  9680. n.dom.dom = function(e) {
  9681. function t(t) {
  9682. if ("0" === t || e.isUndefined(t))
  9683. return 0;
  9684. var i = t.match(r);
  9685. return e.isNull(i) ? 0 : parseFloat(i[1])
  9686. }
  9687. var i = {
  9688. HTMLEvents: ["change"],
  9689. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9690. KeyboardEvents: ["keydown"]
  9691. }
  9692. , n = {};
  9693. e.each(i, function(t, i) {
  9694. e.each(t, function(e) {
  9695. n[e] = i
  9696. })
  9697. });
  9698. var r = /(\d+(\.\d+)?)px/
  9699. , o = {
  9700. makeSelectable: function(e, t) {
  9701. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9702. return !1
  9703. }
  9704. : function() {}
  9705. ,
  9706. e.style.MozUserSelect = t ? "auto" : "none",
  9707. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9708. e.unselectable = t ? "on" : "off")
  9709. },
  9710. makeFullscreen: function(t, i, n) {
  9711. e.isUndefined(i) && (i = !0),
  9712. e.isUndefined(n) && (n = !0),
  9713. t.style.position = "absolute",
  9714. i && (t.style.left = 0,
  9715. t.style.right = 0),
  9716. n && (t.style.top = 0,
  9717. t.style.bottom = 0)
  9718. },
  9719. fakeEvent: function(t, i, r, o) {
  9720. r = r || {};
  9721. var a = n[i];
  9722. if (!a)
  9723. throw new Error("Event type " + i + " not supported.");
  9724. var s = document.createEvent(a);
  9725. switch (a) {
  9726. case "MouseEvents":
  9727. var l = r.x || r.clientX || 0
  9728. , c = r.y || r.clientY || 0;
  9729. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9730. break;
  9731. case "KeyboardEvents":
  9732. var h = s.initKeyboardEvent || s.initKeyEvent;
  9733. e.defaults(r, {
  9734. cancelable: !0,
  9735. ctrlKey: !1,
  9736. altKey: !1,
  9737. shiftKey: !1,
  9738. metaKey: !1,
  9739. keyCode: void 0,
  9740. charCode: void 0
  9741. }),
  9742. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9743. break;
  9744. default:
  9745. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9746. }
  9747. e.defaults(s, o),
  9748. t.dispatchEvent(s)
  9749. },
  9750. bind: function(e, t, i, n) {
  9751. return n = n || !1,
  9752. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9753. o
  9754. },
  9755. unbind: function(e, t, i, n) {
  9756. return n = n || !1,
  9757. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9758. o
  9759. },
  9760. addClass: function(e, t) {
  9761. if (void 0 === e.className)
  9762. e.className = t;
  9763. else if (e.className !== t) {
  9764. var i = e.className.split(/ +/);
  9765. i.indexOf(t) == -1 && (i.push(t),
  9766. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9767. }
  9768. return o
  9769. },
  9770. removeClass: function(e, t) {
  9771. if (t)
  9772. if (void 0 === e.className)
  9773. ;
  9774. else if (e.className === t)
  9775. e.removeAttribute("class");
  9776. else {
  9777. var i = e.className.split(/ +/)
  9778. , n = i.indexOf(t);
  9779. n != -1 && (i.splice(n, 1),
  9780. e.className = i.join(" "))
  9781. }
  9782. else
  9783. e.className = void 0;
  9784. return o
  9785. },
  9786. hasClass: function(e, t) {
  9787. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9788. },
  9789. getWidth: function(e) {
  9790. var i = getComputedStyle(e);
  9791. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9792. },
  9793. getHeight: function(e) {
  9794. var i = getComputedStyle(e);
  9795. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9796. },
  9797. getOffset: function(e) {
  9798. var t = {
  9799. left: 0,
  9800. top: 0
  9801. };
  9802. if (e.offsetParent)
  9803. do
  9804. t.left += e.offsetLeft,
  9805. t.top += e.offsetTop;
  9806. while (e = e.offsetParent);return t
  9807. },
  9808. isActive: function(e) {
  9809. return e === document.activeElement && (e.type || e.href)
  9810. }
  9811. };
  9812. return o
  9813. }(n.utils.common),
  9814. n.controllers.OptionController = function(e, t, i) {
  9815. var n = function(e, r, o) {
  9816. n.superclass.call(this, e, r);
  9817. var a = this;
  9818. if (this.__select = document.createElement("select"),
  9819. i.isArray(o)) {
  9820. var s = {};
  9821. i.each(o, function(e) {
  9822. s[e] = e
  9823. }),
  9824. o = s
  9825. }
  9826. i.each(o, function(e, t) {
  9827. var i = document.createElement("option");
  9828. i.innerHTML = t,
  9829. i.setAttribute("value", e),
  9830. a.__select.appendChild(i)
  9831. }),
  9832. this.updateDisplay(),
  9833. t.bind(this.__select, "change", function() {
  9834. var e = this.options[this.selectedIndex].value;
  9835. a.setValue(e)
  9836. }),
  9837. this.domElement.appendChild(this.__select)
  9838. };
  9839. return n.superclass = e,
  9840. i.extend(n.prototype, e.prototype, {
  9841. setValue: function(e) {
  9842. var t = n.superclass.prototype.setValue.call(this, e);
  9843. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9844. t
  9845. },
  9846. updateDisplay: function() {
  9847. return this.__select.value = this.getValue(),
  9848. n.superclass.prototype.updateDisplay.call(this)
  9849. }
  9850. }),
  9851. n
  9852. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9853. n.controllers.NumberController = function(e, t) {
  9854. function i(e) {
  9855. return e = e.toString(),
  9856. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9857. }
  9858. var n = function(e, r, o) {
  9859. n.superclass.call(this, e, r),
  9860. o = o || {},
  9861. this.__min = o.min,
  9862. this.__max = o.max,
  9863. this.__step = o.step,
  9864. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9865. this.__precision = i(this.__impliedStep)
  9866. };
  9867. return n.superclass = e,
  9868. t.extend(n.prototype, e.prototype, {
  9869. setValue: function(e) {
  9870. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9871. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9872. n.superclass.prototype.setValue.call(this, e)
  9873. },
  9874. min: function(e) {
  9875. return this.__min = e,
  9876. this
  9877. },
  9878. max: function(e) {
  9879. return this.__max = e,
  9880. this
  9881. },
  9882. step: function(e) {
  9883. return this.__step = e,
  9884. this.__impliedStep = e,
  9885. this.__precision = i(e),
  9886. this
  9887. }
  9888. }),
  9889. n
  9890. }(n.controllers.Controller, n.utils.common),
  9891. n.controllers.NumberControllerBox = function(e, t, i) {
  9892. function n(e, t) {
  9893. var i = Math.pow(10, t);
  9894. return Math.round(e * i) / i
  9895. }
  9896. var r = function(e, n, o) {
  9897. function a() {
  9898. var e = parseFloat(d.__input.value);
  9899. i.isNaN(e) || d.setValue(e)
  9900. }
  9901. function s() {
  9902. a(),
  9903. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9904. }
  9905. function l(e) {
  9906. t.bind(window, "mousemove", c),
  9907. t.bind(window, "mouseup", h),
  9908. u = e.clientY
  9909. }
  9910. function c(e) {
  9911. var t = u - e.clientY;
  9912. d.setValue(d.getValue() + t * d.__impliedStep),
  9913. u = e.clientY
  9914. }
  9915. function h() {
  9916. t.unbind(window, "mousemove", c),
  9917. t.unbind(window, "mouseup", h)
  9918. }
  9919. this.__truncationSuspended = !1,
  9920. r.superclass.call(this, e, n, o);
  9921. var u, d = this;
  9922. this.__input = document.createElement("input"),
  9923. this.__input.setAttribute("type", "text"),
  9924. t.bind(this.__input, "change", a),
  9925. t.bind(this.__input, "blur", s),
  9926. t.bind(this.__input, "mousedown", l),
  9927. t.bind(this.__input, "keydown", function(e) {
  9928. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9929. this.blur(),
  9930. d.__truncationSuspended = !1)
  9931. }),
  9932. this.updateDisplay(),
  9933. this.domElement.appendChild(this.__input)
  9934. };
  9935. return r.superclass = e,
  9936. i.extend(r.prototype, e.prototype, {
  9937. updateDisplay: function() {
  9938. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9939. r.superclass.prototype.updateDisplay.call(this)
  9940. }
  9941. }),
  9942. r
  9943. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9944. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9945. function o(e, t, i, n, r) {
  9946. return n + (r - n) * ((e - t) / (i - t))
  9947. }
  9948. var a = function(e, i, n, r, s) {
  9949. function l(e) {
  9950. t.bind(window, "mousemove", c),
  9951. t.bind(window, "mouseup", h),
  9952. c(e)
  9953. }
  9954. function c(e) {
  9955. e.preventDefault();
  9956. var i = t.getOffset(u.__background)
  9957. , n = t.getWidth(u.__background);
  9958. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9959. !1
  9960. }
  9961. function h() {
  9962. t.unbind(window, "mousemove", c),
  9963. t.unbind(window, "mouseup", h),
  9964. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9965. }
  9966. a.superclass.call(this, e, i, {
  9967. min: n,
  9968. max: r,
  9969. step: s
  9970. });
  9971. var u = this;
  9972. this.__background = document.createElement("div"),
  9973. this.__foreground = document.createElement("div"),
  9974. t.bind(this.__background, "mousedown", l),
  9975. t.addClass(this.__background, "slider"),
  9976. t.addClass(this.__foreground, "slider-fg"),
  9977. this.updateDisplay(),
  9978. this.__background.appendChild(this.__foreground),
  9979. this.domElement.appendChild(this.__background)
  9980. };
  9981. return a.superclass = e,
  9982. a.useDefaultStyles = function() {
  9983. i.inject(r)
  9984. }
  9985. ,
  9986. n.extend(a.prototype, e.prototype, {
  9987. updateDisplay: function() {
  9988. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9989. return this.__foreground.style.width = 100 * e + "%",
  9990. a.superclass.prototype.updateDisplay.call(this)
  9991. }
  9992. }),
  9993. a
  9994. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"),
  9995. n.controllers.FunctionController = function(e, t, i) {
  9996. var n = function(e, i, r) {
  9997. n.superclass.call(this, e, i);
  9998. var o = this;
  9999. this.__button = document.createElement("div"),
  10000. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10001. t.bind(this.__button, "click", function(e) {
  10002. return e.preventDefault(),
  10003. o.fire(),
  10004. !1
  10005. }),
  10006. t.addClass(this.__button, "button"),
  10007. this.domElement.appendChild(this.__button)
  10008. };
  10009. return n.superclass = e,
  10010. i.extend(n.prototype, e.prototype, {
  10011. fire: function() {
  10012. this.__onChange && this.__onChange.call(this),
  10013. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10014. this.getValue().call(this.object)
  10015. }
  10016. }),
  10017. n
  10018. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10019. n.controllers.BooleanController = function(e, t, i) {
  10020. var n = function(e, i) {
  10021. function r() {
  10022. o.setValue(!o.__prev)
  10023. }
  10024. n.superclass.call(this, e, i);
  10025. var o = this;
  10026. this.__prev = this.getValue(),
  10027. this.__checkbox = document.createElement("input"),
  10028. this.__checkbox.setAttribute("type", "checkbox"),
  10029. t.bind(this.__checkbox, "change", r, !1),
  10030. this.domElement.appendChild(this.__checkbox),
  10031. this.updateDisplay()
  10032. };
  10033. return n.superclass = e,
  10034. i.extend(n.prototype, e.prototype, {
  10035. setValue: function(e) {
  10036. var t = n.superclass.prototype.setValue.call(this, e);
  10037. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10038. this.__prev = this.getValue(),
  10039. t
  10040. },
  10041. updateDisplay: function() {
  10042. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10043. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10044. n.superclass.prototype.updateDisplay.call(this)
  10045. }
  10046. }),
  10047. n
  10048. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10049. n.color.toString = function(e) {
  10050. return function(t) {
  10051. if (1 == t.a || e.isUndefined(t.a)) {
  10052. for (var i = t.hex.toString(16); i.length < 6; )
  10053. i = "0" + i;
  10054. return "#" + i
  10055. }
  10056. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10057. }
  10058. }(n.utils.common),
  10059. n.color.interpret = function(e, t) {
  10060. var i, n, r = function() {
  10061. n = !1;
  10062. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10063. return t.each(o, function(r) {
  10064. if (r.litmus(e))
  10065. return t.each(r.conversions, function(r, o) {
  10066. if (i = r.read(e),
  10067. n === !1 && i !== !1)
  10068. return n = i,
  10069. i.conversionName = o,
  10070. i.conversion = r,
  10071. t.BREAK
  10072. }),
  10073. t.BREAK
  10074. }),
  10075. n
  10076. }, o = [{
  10077. litmus: t.isString,
  10078. conversions: {
  10079. THREE_CHAR_HEX: {
  10080. read: function(e) {
  10081. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10082. return null !== t && {
  10083. space: "HEX",
  10084. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10085. }
  10086. },
  10087. write: e
  10088. },
  10089. SIX_CHAR_HEX: {
  10090. read: function(e) {
  10091. var t = e.match(/^#([A-F0-9]{6})$/i);
  10092. return null !== t && {
  10093. space: "HEX",
  10094. hex: parseInt("0x" + t[1].toString())
  10095. }
  10096. },
  10097. write: e
  10098. },
  10099. CSS_RGB: {
  10100. read: function(e) {
  10101. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10102. return null !== t && {
  10103. space: "RGB",
  10104. r: parseFloat(t[1]),
  10105. g: parseFloat(t[2]),
  10106. b: parseFloat(t[3])
  10107. }
  10108. },
  10109. write: e
  10110. },
  10111. CSS_RGBA: {
  10112. read: function(e) {
  10113. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10114. return null !== t && {
  10115. space: "RGB",
  10116. r: parseFloat(t[1]),
  10117. g: parseFloat(t[2]),
  10118. b: parseFloat(t[3]),
  10119. a: parseFloat(t[4])
  10120. }
  10121. },
  10122. write: e
  10123. }
  10124. }
  10125. }, {
  10126. litmus: t.isNumber,
  10127. conversions: {
  10128. HEX: {
  10129. read: function(e) {
  10130. return {
  10131. space: "HEX",
  10132. hex: e,
  10133. conversionName: "HEX"
  10134. }
  10135. },
  10136. write: function(e) {
  10137. return e.hex
  10138. }
  10139. }
  10140. }
  10141. }, {
  10142. litmus: t.isArray,
  10143. conversions: {
  10144. RGB_ARRAY: {
  10145. read: function(e) {
  10146. return 3 == e.length && {
  10147. space: "RGB",
  10148. r: e[0],
  10149. g: e[1],
  10150. b: e[2]
  10151. }
  10152. },
  10153. write: function(e) {
  10154. return [e.r, e.g, e.b]
  10155. }
  10156. },
  10157. RGBA_ARRAY: {
  10158. read: function(e) {
  10159. return 4 == e.length && {
  10160. space: "RGB",
  10161. r: e[0],
  10162. g: e[1],
  10163. b: e[2],
  10164. a: e[3]
  10165. }
  10166. },
  10167. write: function(e) {
  10168. return [e.r, e.g, e.b, e.a]
  10169. }
  10170. }
  10171. }
  10172. }, {
  10173. litmus: t.isObject,
  10174. conversions: {
  10175. RGBA_OBJ: {
  10176. read: function(e) {
  10177. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10178. space: "RGB",
  10179. r: e.r,
  10180. g: e.g,
  10181. b: e.b,
  10182. a: e.a
  10183. }
  10184. },
  10185. write: function(e) {
  10186. return {
  10187. r: e.r,
  10188. g: e.g,
  10189. b: e.b,
  10190. a: e.a
  10191. }
  10192. }
  10193. },
  10194. RGB_OBJ: {
  10195. read: function(e) {
  10196. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10197. space: "RGB",
  10198. r: e.r,
  10199. g: e.g,
  10200. b: e.b
  10201. }
  10202. },
  10203. write: function(e) {
  10204. return {
  10205. r: e.r,
  10206. g: e.g,
  10207. b: e.b
  10208. }
  10209. }
  10210. },
  10211. HSVA_OBJ: {
  10212. read: function(e) {
  10213. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10214. space: "HSV",
  10215. h: e.h,
  10216. s: e.s,
  10217. v: e.v,
  10218. a: e.a
  10219. }
  10220. },
  10221. write: function(e) {
  10222. return {
  10223. h: e.h,
  10224. s: e.s,
  10225. v: e.v,
  10226. a: e.a
  10227. }
  10228. }
  10229. },
  10230. HSV_OBJ: {
  10231. read: function(e) {
  10232. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10233. space: "HSV",
  10234. h: e.h,
  10235. s: e.s,
  10236. v: e.v
  10237. }
  10238. },
  10239. write: function(e) {
  10240. return {
  10241. h: e.h,
  10242. s: e.s,
  10243. v: e.v
  10244. }
  10245. }
  10246. }
  10247. }
  10248. }];
  10249. return r
  10250. }(n.color.toString, n.utils.common),
  10251. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10252. function g(e, t, i, o) {
  10253. if (void 0 === t[i])
  10254. throw new Error("Object " + t + ' has no property "' + i + '"');
  10255. var a;
  10256. if (o.color)
  10257. a = new h(t,i);
  10258. else {
  10259. var s = [t, i].concat(o.factoryArgs);
  10260. a = n.apply(e, s)
  10261. }
  10262. o.before instanceof r && (o.before = o.before.__li),
  10263. A(e, a),
  10264. p.addClass(a.domElement, "c");
  10265. var l = document.createElement("span");
  10266. p.addClass(l, "property-name"),
  10267. l.innerHTML = a.property;
  10268. var c = document.createElement("div");
  10269. c.appendChild(l),
  10270. c.appendChild(a.domElement);
  10271. var u = m(e, c, o.before);
  10272. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10273. p.addClass(u, typeof a.getValue()),
  10274. v(e, u, a),
  10275. e.__controllers.push(a),
  10276. a
  10277. }
  10278. function m(e, t, i) {
  10279. var n = document.createElement("li");
  10280. return t && n.appendChild(t),
  10281. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10282. e.onResize(),
  10283. n
  10284. }
  10285. function v(e, t, i) {
  10286. if (i.__li = t,
  10287. i.__gui = e,
  10288. f.extend(i, {
  10289. options: function(t) {
  10290. return arguments.length > 1 ? (i.remove(),
  10291. g(e, i.object, i.property, {
  10292. before: i.__li.nextElementSibling,
  10293. factoryArgs: [f.toArray(arguments)]
  10294. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10295. g(e, i.object, i.property, {
  10296. before: i.__li.nextElementSibling,
  10297. factoryArgs: [t]
  10298. })) : void 0
  10299. },
  10300. name: function(e) {
  10301. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10302. i
  10303. },
  10304. listen: function() {
  10305. return i.__gui.listen(i),
  10306. i
  10307. },
  10308. remove: function() {
  10309. return i.__gui.remove(i),
  10310. i
  10311. }
  10312. }),
  10313. i instanceof l) {
  10314. var n = new s(i.object,i.property,{
  10315. min: i.__min,
  10316. max: i.__max,
  10317. step: i.__step
  10318. });
  10319. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10320. var t = i[e]
  10321. , r = n[e];
  10322. i[e] = n[e] = function() {
  10323. var e = Array.prototype.slice.call(arguments);
  10324. return t.apply(i, e),
  10325. r.apply(n, e)
  10326. }
  10327. }),
  10328. p.addClass(t, "has-slider"),
  10329. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10330. } else if (i instanceof s) {
  10331. var r = function(t) {
  10332. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10333. g(e, i.object, i.property, {
  10334. before: i.__li.nextElementSibling,
  10335. factoryArgs: [i.__min, i.__max, i.__step]
  10336. })) : t
  10337. };
  10338. i.min = f.compose(r, i.min),
  10339. i.max = f.compose(r, i.max)
  10340. } else
  10341. i instanceof o ? (p.bind(t, "click", function() {
  10342. p.fakeEvent(i.__checkbox, "click")
  10343. }),
  10344. p.bind(i.__checkbox, "click", function(e) {
  10345. e.stopPropagation()
  10346. })) : i instanceof a ? (p.bind(t, "click", function() {
  10347. p.fakeEvent(i.__button, "click")
  10348. }),
  10349. p.bind(t, "mouseover", function() {
  10350. p.addClass(i.__button, "hover")
  10351. }),
  10352. p.bind(t, "mouseout", function() {
  10353. p.removeClass(i.__button, "hover")
  10354. })) : i instanceof h && (p.addClass(t, "color"),
  10355. i.updateDisplay = f.compose(function(e) {
  10356. return t.style.borderLeftColor = i.__color.toString(),
  10357. e
  10358. }, i.updateDisplay),
  10359. i.updateDisplay());
  10360. i.setValue = f.compose(function(t) {
  10361. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10362. t
  10363. }, i.setValue)
  10364. }
  10365. function A(e, t) {
  10366. var i = e.getRoot()
  10367. , n = i.__rememberedObjects.indexOf(t.object);
  10368. if (n != -1) {
  10369. var r = i.__rememberedObjectIndecesToControllers[n];
  10370. if (void 0 === r && (r = {},
  10371. i.__rememberedObjectIndecesToControllers[n] = r),
  10372. r[t.property] = t,
  10373. i.load && i.load.remembered) {
  10374. var o, a = i.load.remembered;
  10375. if (a[e.preset])
  10376. o = a[e.preset];
  10377. else {
  10378. if (!a[L])
  10379. return;
  10380. o = a[L]
  10381. }
  10382. if (o[n] && void 0 !== o[n][t.property]) {
  10383. var s = o[n][t.property];
  10384. t.initialValue = s,
  10385. t.setValue(s)
  10386. }
  10387. }
  10388. }
  10389. }
  10390. function y(e, t) {
  10391. return document.location.href + "." + t
  10392. }
  10393. function C(e) {
  10394. var t = e.__save_row = document.createElement("li");
  10395. p.addClass(e.domElement, "has-save"),
  10396. e.__ul.insertBefore(t, e.__ul.firstChild),
  10397. p.addClass(t, "save-row");
  10398. var i = document.createElement("span");
  10399. i.innerHTML = "&nbsp;",
  10400. p.addClass(i, "button gears");
  10401. var n = document.createElement("span");
  10402. n.innerHTML = "Save",
  10403. p.addClass(n, "button"),
  10404. p.addClass(n, "save");
  10405. var r = document.createElement("span");
  10406. r.innerHTML = "New",
  10407. p.addClass(r, "button"),
  10408. p.addClass(r, "save-as");
  10409. var o = document.createElement("span");
  10410. o.innerHTML = "Revert",
  10411. p.addClass(o, "button"),
  10412. p.addClass(o, "revert");
  10413. var a = e.__preset_select = document.createElement("select");
  10414. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10415. w(e, i, i == e.preset)
  10416. }) : w(e, L, !1),
  10417. p.bind(a, "change", function() {
  10418. for (var t = 0; t < e.__preset_select.length; t++)
  10419. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10420. e.preset = this.value
  10421. }),
  10422. t.appendChild(a),
  10423. t.appendChild(i),
  10424. t.appendChild(n),
  10425. t.appendChild(r),
  10426. t.appendChild(o),
  10427. D) {
  10428. var s = document.getElementById("dg-save-locally")
  10429. , l = document.getElementById("dg-local-explain");
  10430. s.style.display = "block";
  10431. var c = document.getElementById("dg-local-storage");
  10432. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10433. var h = function() {
  10434. l.style.display = e.useLocalStorage ? "block" : "none"
  10435. };
  10436. h(),
  10437. p.bind(c, "change", function() {
  10438. e.useLocalStorage = !e.useLocalStorage,
  10439. h()
  10440. })
  10441. }
  10442. var u = document.getElementById("dg-new-constructor");
  10443. p.bind(u, "keydown", function(e) {
  10444. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10445. }),
  10446. p.bind(i, "click", function() {
  10447. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10448. S.show(),
  10449. u.focus(),
  10450. u.select()
  10451. }),
  10452. p.bind(n, "click", function() {
  10453. e.save()
  10454. }),
  10455. p.bind(r, "click", function() {
  10456. var t = prompt("Enter a new preset name.");
  10457. t && e.saveAs(t)
  10458. }),
  10459. p.bind(o, "click", function() {
  10460. e.revert()
  10461. })
  10462. }
  10463. function I(e) {
  10464. function t(t) {
  10465. return t.preventDefault(),
  10466. r = t.clientX,
  10467. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10468. p.bind(window, "mousemove", i),
  10469. p.bind(window, "mouseup", n),
  10470. !1
  10471. }
  10472. function i(t) {
  10473. return t.preventDefault(),
  10474. e.width += r - t.clientX,
  10475. e.onResize(),
  10476. r = t.clientX,
  10477. !1
  10478. }
  10479. function n() {
  10480. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10481. p.unbind(window, "mousemove", i),
  10482. p.unbind(window, "mouseup", n)
  10483. }
  10484. e.__resize_handle = document.createElement("div"),
  10485. f.extend(e.__resize_handle.style, {
  10486. width: "6px",
  10487. marginLeft: "-3px",
  10488. height: "200px",
  10489. cursor: "ew-resize",
  10490. position: "absolute"
  10491. });
  10492. var r;
  10493. p.bind(e.__resize_handle, "mousedown", t),
  10494. p.bind(e.__closeButton, "mousedown", t),
  10495. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10496. }
  10497. function E(e, t) {
  10498. e.domElement.style.width = t + "px",
  10499. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10500. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10501. }
  10502. function b(e, t) {
  10503. var i = {};
  10504. return f.each(e.__rememberedObjects, function(n, r) {
  10505. var o = {}
  10506. , a = e.__rememberedObjectIndecesToControllers[r];
  10507. f.each(a, function(e, i) {
  10508. o[i] = t ? e.initialValue : e.getValue()
  10509. }),
  10510. i[r] = o
  10511. }),
  10512. i
  10513. }
  10514. function w(e, t, i) {
  10515. var n = document.createElement("option");
  10516. n.innerHTML = t,
  10517. n.value = t,
  10518. e.__preset_select.appendChild(n),
  10519. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10520. }
  10521. function _(e) {
  10522. for (var t = 0; t < e.__preset_select.length; t++)
  10523. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10524. }
  10525. function T(e, t) {
  10526. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10527. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10528. }
  10529. function x(e) {
  10530. 0 != e.length && u(function() {
  10531. x(e)
  10532. }),
  10533. f.each(e, function(e) {
  10534. e.updateDisplay()
  10535. })
  10536. }
  10537. e.inject(i);
  10538. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10539. try {
  10540. return "localStorage"in window && null !== window.localStorage
  10541. } catch (e) {
  10542. return !1
  10543. }
  10544. }(), N = !0, B = !1, F = [], V = function(e) {
  10545. function t() {
  10546. var e = i.getRoot();
  10547. e.width += 1,
  10548. f.defer(function() {
  10549. e.width -= 1
  10550. })
  10551. }
  10552. var i = this;
  10553. this.domElement = document.createElement("div"),
  10554. this.__ul = document.createElement("ul"),
  10555. this.domElement.appendChild(this.__ul),
  10556. p.addClass(this.domElement, R),
  10557. this.__folders = {},
  10558. this.__controllers = [],
  10559. this.__rememberedObjects = [],
  10560. this.__rememberedObjectIndecesToControllers = [],
  10561. this.__listening = [],
  10562. e = e || {},
  10563. e = f.defaults(e, {
  10564. autoPlace: !0,
  10565. width: V.DEFAULT_WIDTH
  10566. }),
  10567. e = f.defaults(e, {
  10568. resizable: e.autoPlace,
  10569. hideable: e.autoPlace
  10570. }),
  10571. f.isUndefined(e.load) ? e.load = {
  10572. preset: L
  10573. } : e.preset && (e.load.preset = e.preset),
  10574. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10575. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10576. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10577. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10578. if (Object.defineProperties(this, {
  10579. parent: {
  10580. get: function() {
  10581. return e.parent
  10582. }
  10583. },
  10584. scrollable: {
  10585. get: function() {
  10586. return e.scrollable
  10587. }
  10588. },
  10589. autoPlace: {
  10590. get: function() {
  10591. return e.autoPlace
  10592. }
  10593. },
  10594. preset: {
  10595. get: function() {
  10596. return i.parent ? i.getRoot().preset : e.load.preset
  10597. },
  10598. set: function(t) {
  10599. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10600. _(this),
  10601. i.revert()
  10602. }
  10603. },
  10604. width: {
  10605. get: function() {
  10606. return e.width
  10607. },
  10608. set: function(t) {
  10609. e.width = t,
  10610. E(i, t)
  10611. }
  10612. },
  10613. name: {
  10614. get: function() {
  10615. return e.name
  10616. },
  10617. set: function(t) {
  10618. e.name = t,
  10619. a && (a.innerHTML = e.name)
  10620. }
  10621. },
  10622. closed: {
  10623. get: function() {
  10624. return e.closed
  10625. },
  10626. set: function(t) {
  10627. e.closed = t,
  10628. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10629. this.onResize(),
  10630. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10631. }
  10632. },
  10633. load: {
  10634. get: function() {
  10635. return e.load
  10636. }
  10637. },
  10638. useLocalStorage: {
  10639. get: function() {
  10640. return r
  10641. },
  10642. set: function(e) {
  10643. D && (r = e,
  10644. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10645. localStorage.setItem(y(i, "isLocal"), e))
  10646. }
  10647. }
  10648. }),
  10649. f.isUndefined(e.parent)) {
  10650. if (e.closed = !1,
  10651. p.addClass(this.domElement, V.CLASS_MAIN),
  10652. p.makeSelectable(this.domElement, !1),
  10653. D && r) {
  10654. i.useLocalStorage = !0;
  10655. var o = localStorage.getItem(y(this, "gui"));
  10656. o && (e.load = JSON.parse(o))
  10657. }
  10658. this.__closeButton = document.createElement("div"),
  10659. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10660. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10661. this.domElement.appendChild(this.__closeButton),
  10662. p.bind(this.__closeButton, "click", function() {
  10663. i.closed = !i.closed
  10664. })
  10665. } else {
  10666. void 0 === e.closed && (e.closed = !0);
  10667. var a = document.createTextNode(e.name);
  10668. p.addClass(a, "controller-name");
  10669. var s = m(i, a)
  10670. , l = function(e) {
  10671. return e.preventDefault(),
  10672. i.closed = !i.closed,
  10673. !1
  10674. };
  10675. p.addClass(this.__ul, V.CLASS_CLOSED),
  10676. p.addClass(s, "title"),
  10677. p.bind(s, "click", l),
  10678. e.closed || (this.closed = !1)
  10679. }
  10680. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10681. p.addClass(M, R),
  10682. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10683. document.body.appendChild(M),
  10684. N = !1),
  10685. M.appendChild(this.domElement),
  10686. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10687. this.parent || E(i, e.width)),
  10688. p.bind(window, "resize", function() {
  10689. i.onResize()
  10690. }),
  10691. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10692. i.onResize()
  10693. }),
  10694. p.bind(this.__ul, "transitionend", function() {
  10695. i.onResize()
  10696. }),
  10697. p.bind(this.__ul, "oTransitionEnd", function() {
  10698. i.onResize()
  10699. }),
  10700. this.onResize(),
  10701. e.resizable && I(this),
  10702. n = function() {
  10703. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10704. }
  10705. ,
  10706. this.saveToLocalStorageIfPossible = n;
  10707. i.getRoot();
  10708. e.parent || t()
  10709. };
  10710. return V.toggleHide = function() {
  10711. B = !B,
  10712. f.each(F, function(e) {
  10713. e.domElement.style.zIndex = B ? -999 : 999,
  10714. e.domElement.style.opacity = B ? 0 : 1
  10715. })
  10716. }
  10717. ,
  10718. V.CLASS_AUTO_PLACE = "a",
  10719. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10720. V.CLASS_MAIN = "main",
  10721. V.CLASS_CONTROLLER_ROW = "cr",
  10722. V.CLASS_TOO_TALL = "taller-than-window",
  10723. V.CLASS_CLOSED = "closed",
  10724. V.CLASS_CLOSE_BUTTON = "close-button",
  10725. V.CLASS_DRAG = "drag",
  10726. V.DEFAULT_WIDTH = 245,
  10727. V.TEXT_CLOSED = "Close Controls",
  10728. V.TEXT_OPEN = "Open Controls",
  10729. p.bind(window, "keydown", function(e) {
  10730. if(window.keyCon == false)return;
  10731. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10732. }, !1),
  10733. f.extend(V.prototype, {
  10734. add: function(e, t) {
  10735. return g(this, e, t, {
  10736. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10737. })
  10738. },
  10739. addColor: function(e, t) {
  10740. return g(this, e, t, {
  10741. color: !0
  10742. })
  10743. },
  10744. remove: function(e) {
  10745. this.__ul.removeChild(e.__li),
  10746. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10747. var t = this;
  10748. f.defer(function() {
  10749. t.onResize()
  10750. })
  10751. },
  10752. destroy: function() {
  10753. this.autoPlace && M.removeChild(this.domElement)
  10754. },
  10755. addFolder: function(e) {
  10756. if (void 0 !== this.__folders[e])
  10757. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10758. var t = {
  10759. name: e,
  10760. parent: this
  10761. };
  10762. t.autoPlace = this.autoPlace,
  10763. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10764. t.load = this.load.folders[e]);
  10765. var i = new V(t);
  10766. this.__folders[e] = i;
  10767. var n = m(this, i.domElement);
  10768. return p.addClass(n, "folder"),
  10769. i
  10770. },
  10771. open: function() {
  10772. this.closed = !1
  10773. },
  10774. close: function() {
  10775. this.closed = !0
  10776. },
  10777. onResize: function() {
  10778. var e = this.getRoot();
  10779. if (e.scrollable) {
  10780. var t = p.getOffset(e.__ul).top
  10781. , i = 0;
  10782. f.each(e.__ul.childNodes, function(t) {
  10783. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10784. }),
  10785. window.innerHeight - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10786. e.__ul.style.height = window.innerHeight - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10787. e.__ul.style.height = "auto")
  10788. }
  10789. e.__resize_handle && f.defer(function() {
  10790. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10791. }),
  10792. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10793. },
  10794. remember: function() {
  10795. if (f.isUndefined(S) && (S = new d,
  10796. S.domElement.innerHTML = t),
  10797. this.parent)
  10798. throw new Error("You can only call remember on a top level GUI.");
  10799. var e = this;
  10800. f.each(Array.prototype.slice.call(arguments), function(t) {
  10801. 0 == e.__rememberedObjects.length && C(e),
  10802. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10803. }),
  10804. this.autoPlace && E(this, this.width)
  10805. },
  10806. getRoot: function() {
  10807. for (var e = this; e.parent; )
  10808. e = e.parent;
  10809. return e
  10810. },
  10811. getSaveObject: function() {
  10812. var e = this.load;
  10813. return e.closed = this.closed,
  10814. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10815. e.remembered || (e.remembered = {}),
  10816. e.remembered[this.preset] = b(this)),
  10817. e.folders = {},
  10818. f.each(this.__folders, function(t, i) {
  10819. e.folders[i] = t.getSaveObject()
  10820. }),
  10821. e
  10822. },
  10823. save: function() {
  10824. this.load.remembered || (this.load.remembered = {}),
  10825. this.load.remembered[this.preset] = b(this),
  10826. T(this, !1),
  10827. this.saveToLocalStorageIfPossible()
  10828. },
  10829. saveAs: function(e) {
  10830. this.load.remembered || (this.load.remembered = {},
  10831. this.load.remembered[L] = b(this, !0)),
  10832. this.load.remembered[e] = b(this),
  10833. this.preset = e,
  10834. w(this, e, !0),
  10835. this.saveToLocalStorageIfPossible()
  10836. },
  10837. revert: function(e) {
  10838. f.each(this.__controllers, function(t) {
  10839. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10840. }, this),
  10841. f.each(this.__folders, function(e) {
  10842. e.revert(e)
  10843. }),
  10844. e || T(this.getRoot(), !1)
  10845. },
  10846. listen: function(e) {
  10847. var t = 0 == this.__listening.length;
  10848. this.__listening.push(e),
  10849. t && x(this.__listening)
  10850. }
  10851. }),
  10852. V //xzw 下面debug样式改了点
  10853. }(n.utils.css, '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>', ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 1000; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: left;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", n.controllers.factory = function(e, t, i, n, r, o, a) {
  10854. return function(s, l) {
  10855. var c = s[l];
  10856. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  10857. min: arguments[2],
  10858. max: arguments[3]
  10859. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10860. }
  10861. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10862. var n = function(e, i) {
  10863. function r() {
  10864. a.setValue(a.__input.value)
  10865. }
  10866. function o() {
  10867. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10868. }
  10869. n.superclass.call(this, e, i);
  10870. var a = this;
  10871. this.__input = document.createElement("input"),
  10872. this.__input.setAttribute("type", "text"),
  10873. t.bind(this.__input, "keyup", r),
  10874. t.bind(this.__input, "change", r),
  10875. t.bind(this.__input, "blur", o),
  10876. t.bind(this.__input, "keydown", function(e) {
  10877. 13 === e.keyCode && this.blur()
  10878. }),
  10879. this.updateDisplay(),
  10880. this.domElement.appendChild(this.__input)
  10881. };
  10882. return n.superclass = e,
  10883. i.extend(n.prototype, e.prototype, {
  10884. updateDisplay: function() {
  10885. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10886. n.superclass.prototype.updateDisplay.call(this)
  10887. }
  10888. }),
  10889. n
  10890. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  10891. function o(e, t, i, n) {
  10892. e.style.background = "",
  10893. r.each(l, function(r) {
  10894. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10895. })
  10896. }
  10897. function a(e) {
  10898. e.style.background = "",
  10899. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10900. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10901. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10902. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10903. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10904. }
  10905. var s = function(e, l) {
  10906. function c(e) {
  10907. p(e),
  10908. t.bind(window, "mousemove", p),
  10909. t.bind(window, "mouseup", h)
  10910. }
  10911. function h() {
  10912. t.unbind(window, "mousemove", p),
  10913. t.unbind(window, "mouseup", h)
  10914. }
  10915. function u() {
  10916. var e = n(this.value);
  10917. e !== !1 ? (g.__color.__state = e,
  10918. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10919. }
  10920. function d() {
  10921. t.unbind(window, "mousemove", f),
  10922. t.unbind(window, "mouseup", d)
  10923. }
  10924. function p(e) {
  10925. e.preventDefault();
  10926. var i = t.getWidth(g.__saturation_field)
  10927. , n = t.getOffset(g.__saturation_field)
  10928. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10929. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10930. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10931. r > 1 ? r = 1 : r < 0 && (r = 0),
  10932. g.__color.v = o,
  10933. g.__color.s = r,
  10934. g.setValue(g.__color.toOriginal()),
  10935. !1
  10936. }
  10937. function f(e) {
  10938. e.preventDefault();
  10939. var i = t.getHeight(g.__hue_field)
  10940. , n = t.getOffset(g.__hue_field)
  10941. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10942. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10943. g.__color.h = 360 * r,
  10944. g.setValue(g.__color.toOriginal()),
  10945. !1
  10946. }
  10947. s.superclass.call(this, e, l),
  10948. this.__color = new i(this.getValue()),
  10949. this.__temp = new i(0);
  10950. var g = this;
  10951. this.domElement = document.createElement("div"),
  10952. t.makeSelectable(this.domElement, !1),
  10953. this.__selector = document.createElement("div"),
  10954. this.__selector.className = "selector",
  10955. this.__saturation_field = document.createElement("div"),
  10956. this.__saturation_field.className = "saturation-field",
  10957. this.__field_knob = document.createElement("div"),
  10958. this.__field_knob.className = "field-knob",
  10959. this.__field_knob_border = "2px solid ",
  10960. this.__hue_knob = document.createElement("div"),
  10961. this.__hue_knob.className = "hue-knob",
  10962. this.__hue_field = document.createElement("div"),
  10963. this.__hue_field.className = "hue-field",
  10964. this.__input = document.createElement("input"),
  10965. this.__input.type = "text",
  10966. this.__input_textShadow = "0 1px 1px ",
  10967. t.bind(this.__input, "keydown", function(e) {
  10968. 13 === e.keyCode && u.call(this)
  10969. }),
  10970. t.bind(this.__input, "blur", u),
  10971. t.bind(this.__selector, "mousedown", function(e) {
  10972. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10973. t.removeClass(g.__selector, "drag")
  10974. })
  10975. });
  10976. var m = document.createElement("div");
  10977. r.extend(this.__selector.style, {
  10978. width: "122px",
  10979. height: "102px",
  10980. padding: "3px",
  10981. backgroundColor: "#222",
  10982. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10983. }),
  10984. r.extend(this.__field_knob.style, {
  10985. position: "absolute",
  10986. width: "12px",
  10987. height: "12px",
  10988. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10989. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10990. borderRadius: "12px",
  10991. zIndex: 1
  10992. }),
  10993. r.extend(this.__hue_knob.style, {
  10994. position: "absolute",
  10995. width: "15px",
  10996. height: "2px",
  10997. borderRight: "4px solid #fff",
  10998. zIndex: 1
  10999. }),
  11000. r.extend(this.__saturation_field.style, {
  11001. width: "100px",
  11002. height: "100px",
  11003. border: "1px solid #555",
  11004. marginRight: "3px",
  11005. display: "inline-block",
  11006. cursor: "pointer"
  11007. }),
  11008. r.extend(m.style, {
  11009. width: "100%",
  11010. height: "100%",
  11011. background: "none"
  11012. }),
  11013. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11014. r.extend(this.__hue_field.style, {
  11015. width: "15px",
  11016. height: "100px",
  11017. display: "inline-block",
  11018. border: "1px solid #555",
  11019. cursor: "ns-resize"
  11020. }),
  11021. a(this.__hue_field),
  11022. r.extend(this.__input.style, {
  11023. outline: "none",
  11024. textAlign: "center",
  11025. color: "#fff",
  11026. border: 0,
  11027. fontWeight: "bold",
  11028. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11029. }),
  11030. t.bind(this.__saturation_field, "mousedown", c),
  11031. t.bind(this.__field_knob, "mousedown", c),
  11032. t.bind(this.__hue_field, "mousedown", function(e) {
  11033. f(e),
  11034. t.bind(window, "mousemove", f),
  11035. t.bind(window, "mouseup", d)
  11036. }),
  11037. this.__saturation_field.appendChild(m),
  11038. this.__selector.appendChild(this.__field_knob),
  11039. this.__selector.appendChild(this.__saturation_field),
  11040. this.__selector.appendChild(this.__hue_field),
  11041. this.__hue_field.appendChild(this.__hue_knob),
  11042. this.domElement.appendChild(this.__input),
  11043. this.domElement.appendChild(this.__selector),
  11044. this.updateDisplay()
  11045. };
  11046. s.superclass = e,
  11047. r.extend(s.prototype, e.prototype, {
  11048. updateDisplay: function() {
  11049. var e = n(this.getValue());
  11050. if (e !== !1) {
  11051. var t = !1;
  11052. r.each(i.COMPONENTS, function(i) {
  11053. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11054. return t = !0,
  11055. {}
  11056. }, this),
  11057. t && r.extend(this.__color.__state, e)
  11058. }
  11059. r.extend(this.__temp.__state, this.__color.__state),
  11060. this.__temp.a = 1;
  11061. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11062. , s = 255 - a;
  11063. r.extend(this.__field_knob.style, {
  11064. marginLeft: 100 * this.__color.s - 7 + "px",
  11065. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11066. backgroundColor: this.__temp.toString(),
  11067. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11068. }),
  11069. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11070. this.__temp.s = 1,
  11071. this.__temp.v = 1,
  11072. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11073. r.extend(this.__input.style, {
  11074. backgroundColor: this.__input.value = this.__color.toString(),
  11075. color: "rgb(" + a + "," + a + "," + a + ")",
  11076. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11077. })
  11078. }
  11079. });
  11080. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11081. return s
  11082. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11083. function r(e, t, i) {
  11084. Object.defineProperty(e, t, {
  11085. get: function() {
  11086. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11087. this.__state[t])
  11088. },
  11089. set: function(e) {
  11090. "RGB" !== this.__state.space && (a(this, t, i),
  11091. this.__state.space = "RGB"),
  11092. this.__state[t] = e
  11093. }
  11094. })
  11095. }
  11096. function o(e, t) {
  11097. Object.defineProperty(e, t, {
  11098. get: function() {
  11099. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11100. this.__state[t])
  11101. },
  11102. set: function(e) {
  11103. "HSV" !== this.__state.space && (s(this),
  11104. this.__state.space = "HSV"),
  11105. this.__state[t] = e
  11106. }
  11107. })
  11108. }
  11109. function a(e, i, r) {
  11110. if ("HEX" === e.__state.space)
  11111. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11112. else {
  11113. if ("HSV" !== e.__state.space)
  11114. throw "Corrupted color state";
  11115. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11116. }
  11117. }
  11118. function s(e) {
  11119. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11120. n.extend(e.__state, {
  11121. s: i.s,
  11122. v: i.v
  11123. }),
  11124. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11125. }
  11126. var l = function() {
  11127. if (this.__state = e.apply(this, arguments),
  11128. this.__state === !1)
  11129. throw "Failed to interpret color arguments";
  11130. this.__state.a = this.__state.a || 1
  11131. };
  11132. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11133. n.extend(l.prototype, {
  11134. toString: function() {
  11135. return i(this)
  11136. },
  11137. toOriginal: function() {
  11138. return this.__state.conversion.write(this)
  11139. }
  11140. }),
  11141. r(l.prototype, "r", 2),
  11142. r(l.prototype, "g", 1),
  11143. r(l.prototype, "b", 0),
  11144. o(l.prototype, "h"),
  11145. o(l.prototype, "s"),
  11146. o(l.prototype, "v"),
  11147. Object.defineProperty(l.prototype, "a", {
  11148. get: function() {
  11149. return this.__state.a
  11150. },
  11151. set: function(e) {
  11152. this.__state.a = e
  11153. }
  11154. }),
  11155. Object.defineProperty(l.prototype, "hex", {
  11156. get: function() {
  11157. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11158. this.__state.hex
  11159. },
  11160. set: function(e) {
  11161. this.__state.space = "HEX",
  11162. this.__state.hex = e
  11163. }
  11164. }),
  11165. l
  11166. }(n.color.interpret, n.color.math = function() {
  11167. var e;
  11168. return {
  11169. hsv_to_rgb: function(e, t, i) {
  11170. var n = Math.floor(e / 60) % 6
  11171. , r = e / 60 - Math.floor(e / 60)
  11172. , o = i * (1 - t)
  11173. , a = i * (1 - r * t)
  11174. , s = i * (1 - (1 - r) * t)
  11175. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11176. return {
  11177. r: 255 * l[0],
  11178. g: 255 * l[1],
  11179. b: 255 * l[2]
  11180. }
  11181. },
  11182. rgb_to_hsv: function(e, t, i) {
  11183. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11184. return 0 == a ? {
  11185. h: NaN,
  11186. s: 0,
  11187. v: 0
  11188. } : (r = s / a,
  11189. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11190. n /= 6,
  11191. n < 0 && (n += 1),
  11192. {
  11193. h: 360 * n,
  11194. s: r,
  11195. v: a / 255
  11196. })
  11197. },
  11198. rgb_to_hex: function(e, t, i) {
  11199. var n = this.hex_with_component(0, 2, e);
  11200. return n = this.hex_with_component(n, 1, t),
  11201. n = this.hex_with_component(n, 0, i)
  11202. },
  11203. component_from_hex: function(e, t) {
  11204. return e >> 8 * t & 255
  11205. },
  11206. hex_with_component: function(t, i, n) {
  11207. return n << (e = 8 * i) | t & ~(255 << e)
  11208. }
  11209. }
  11210. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11211. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11212. window.setTimeout(e, 1e3 / 60)
  11213. }
  11214. }(), n.dom.CenteredDiv = function(e, t) {
  11215. var i = function() {
  11216. this.backgroundElement = document.createElement("div"),
  11217. t.extend(this.backgroundElement.style, {
  11218. backgroundColor: "rgba(0,0,0,0.8)",
  11219. top: 0,
  11220. left: 0,
  11221. display: "none",
  11222. zIndex: "1000",
  11223. opacity: 0,
  11224. WebkitTransition: "opacity 0.2s linear"
  11225. }),
  11226. e.makeFullscreen(this.backgroundElement),
  11227. this.backgroundElement.style.position = "fixed",
  11228. this.domElement = document.createElement("div"),
  11229. t.extend(this.domElement.style, {
  11230. position: "fixed",
  11231. display: "none",
  11232. zIndex: "1001",
  11233. opacity: 0,
  11234. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11235. }),
  11236. document.body.appendChild(this.backgroundElement),
  11237. document.body.appendChild(this.domElement);
  11238. var i = this;
  11239. e.bind(this.backgroundElement, "click", function() {
  11240. i.hide()
  11241. })
  11242. };
  11243. return i.prototype.show = function() {
  11244. var e = this;
  11245. this.backgroundElement.style.display = "block",
  11246. this.domElement.style.display = "block",
  11247. this.domElement.style.opacity = 0,
  11248. this.domElement.style.webkitTransform = "scale(1.1)",
  11249. this.layout(),
  11250. t.defer(function() {
  11251. e.backgroundElement.style.opacity = 1,
  11252. e.domElement.style.opacity = 1,
  11253. e.domElement.style.webkitTransform = "scale(1)"
  11254. })
  11255. }
  11256. ,
  11257. i.prototype.hide = function() {
  11258. var t = this
  11259. , i = function() {
  11260. t.domElement.style.display = "none",
  11261. t.backgroundElement.style.display = "none",
  11262. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11263. e.unbind(t.domElement, "transitionend", i),
  11264. e.unbind(t.domElement, "oTransitionEnd", i)
  11265. };
  11266. e.bind(this.domElement, "webkitTransitionEnd", i),
  11267. e.bind(this.domElement, "transitionend", i),
  11268. e.bind(this.domElement, "oTransitionEnd", i),
  11269. this.backgroundElement.style.opacity = 0,
  11270. this.domElement.style.opacity = 0,
  11271. this.domElement.style.webkitTransform = "scale(1.1)"
  11272. }
  11273. ,
  11274. i.prototype.layout = function() {
  11275. this.domElement.style.left = $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11276. this.domElement.style.top = $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11277. }
  11278. ,
  11279. i
  11280. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11281. }
  11282. , {}],
  11283. 94: [function(e, t, i) {//"../lib/jpeg_encoder"
  11284. (function(e) {
  11285. "use strict";
  11286. function i(t) {
  11287. function i(e) {
  11288. for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], i = 0; i < 64; i++) {
  11289. var n = _((t[i] * e + 50) / 100);
  11290. n < 1 ? n = 1 : n > 255 && (n = 255),
  11291. T[G[i]] = n
  11292. }
  11293. for (var r = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {
  11294. var a = _((r[o] * e + 50) / 100);
  11295. a < 1 ? a = 1 : a > 255 && (a = 255),
  11296. x[G[o]] = a
  11297. }
  11298. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11299. for (var h = 0; h < 8; h++)
  11300. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11301. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11302. l++
  11303. }
  11304. function n(e, t) {
  11305. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11306. for (var a = 1; a <= e[o]; a++)
  11307. r[t[n]] = [],
  11308. r[t[n]][0] = i,
  11309. r[t[n]][1] = o,
  11310. n++,
  11311. i++;
  11312. i *= 2
  11313. }
  11314. return r
  11315. }
  11316. function r() {
  11317. C = n(z, W),
  11318. I = n(X, Z),
  11319. E = n(j, Y),
  11320. b = n(q, K)
  11321. }
  11322. function o() {
  11323. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11324. for (var n = e; n < t; n++)
  11325. P[32767 + n] = i,
  11326. R[32767 + n] = [],
  11327. R[32767 + n][1] = i,
  11328. R[32767 + n][0] = n;
  11329. for (var r = -(t - 1); r <= -e; r++)
  11330. P[32767 + r] = i,
  11331. R[32767 + r] = [],
  11332. R[32767 + r][1] = i,
  11333. R[32767 + r][0] = t - 1 + r;
  11334. e <<= 1,
  11335. t <<= 1
  11336. }
  11337. }
  11338. function a() {
  11339. for (var e = 0; e < 256; e++)
  11340. H[e] = 19595 * e,
  11341. H[e + 256 >> 0] = 38470 * e,
  11342. H[e + 512 >> 0] = 7471 * e + 32768,
  11343. H[e + 768 >> 0] = -11059 * e,
  11344. H[e + 1024 >> 0] = -21709 * e,
  11345. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11346. H[e + 1536 >> 0] = -27439 * e,
  11347. H[e + 1792 >> 0] = -5329 * e
  11348. }
  11349. function s(e) {
  11350. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11351. t & 1 << i && (N |= 1 << B),
  11352. i--,
  11353. B--,
  11354. B < 0 && (255 == N ? (l(255),
  11355. l(0)) : l(N),
  11356. B = 7,
  11357. N = 0)
  11358. }
  11359. function l(e) {
  11360. D.push(e)
  11361. }
  11362. function c(e) {
  11363. l(e >> 8 & 255),
  11364. l(255 & e)
  11365. }
  11366. function h(e, t) {
  11367. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11368. for (h = 0; h < d; ++h) {
  11369. i = e[u],
  11370. n = e[u + 1],
  11371. r = e[u + 2],
  11372. o = e[u + 3],
  11373. a = e[u + 4],
  11374. s = e[u + 5],
  11375. l = e[u + 6],
  11376. c = e[u + 7];
  11377. var f = i + c
  11378. , g = i - c
  11379. , m = n + l
  11380. , v = n - l
  11381. , A = r + s
  11382. , y = r - s
  11383. , C = o + a
  11384. , I = o - a
  11385. , E = f + C
  11386. , b = f - C
  11387. , w = m + A
  11388. , _ = m - A;
  11389. e[u] = E + w,
  11390. e[u + 4] = E - w;
  11391. var T = .707106781 * (_ + b);
  11392. e[u + 2] = b + T,
  11393. e[u + 6] = b - T,
  11394. E = I + y,
  11395. w = y + v,
  11396. _ = v + g;
  11397. var x = .382683433 * (E - _)
  11398. , S = .5411961 * E + x
  11399. , M = 1.306562965 * _ + x
  11400. , R = .707106781 * w
  11401. , P = g + R
  11402. , L = g - R;
  11403. e[u + 5] = L + S,
  11404. e[u + 3] = L - S,
  11405. e[u + 1] = P + M,
  11406. e[u + 7] = P - M,
  11407. u += 8
  11408. }
  11409. for (u = 0,
  11410. h = 0; h < d; ++h) {
  11411. i = e[u],
  11412. n = e[u + 8],
  11413. r = e[u + 16],
  11414. o = e[u + 24],
  11415. a = e[u + 32],
  11416. s = e[u + 40],
  11417. l = e[u + 48],
  11418. c = e[u + 56];
  11419. var D = i + c
  11420. , N = i - c
  11421. , B = n + l
  11422. , F = n - l
  11423. , V = r + s
  11424. , U = r - s
  11425. , k = o + a
  11426. , H = o - a
  11427. , G = D + k
  11428. , z = D - k
  11429. , W = B + V
  11430. , j = B - V;
  11431. e[u] = G + W,
  11432. e[u + 32] = G - W;
  11433. var Y = .707106781 * (j + z);
  11434. e[u + 16] = z + Y,
  11435. e[u + 48] = z - Y,
  11436. G = H + U,
  11437. W = U + F,
  11438. j = F + N;
  11439. var X = .382683433 * (G - j)
  11440. , Z = .5411961 * G + X
  11441. , q = 1.306562965 * j + X
  11442. , K = .707106781 * W
  11443. , Q = N + K
  11444. , J = N - K;
  11445. e[u + 40] = J + Z,
  11446. e[u + 24] = J - Z,
  11447. e[u + 8] = Q + q,
  11448. e[u + 56] = Q - q,
  11449. u++
  11450. }
  11451. var $;
  11452. for (h = 0; h < p; ++h)
  11453. $ = e[h] * t[h],
  11454. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11455. return O
  11456. }
  11457. function u() {
  11458. c(65504),
  11459. c(16),
  11460. l(74),
  11461. l(70),
  11462. l(73),
  11463. l(70),
  11464. l(0),
  11465. l(1),
  11466. l(1),
  11467. l(0),
  11468. c(1),
  11469. c(1),
  11470. l(0),
  11471. l(0)
  11472. }
  11473. function d(e, t) {
  11474. c(65472),
  11475. c(17),
  11476. l(8),
  11477. c(t),
  11478. c(e),
  11479. l(3),
  11480. l(1),
  11481. l(17),
  11482. l(0),
  11483. l(2),
  11484. l(17),
  11485. l(1),
  11486. l(3),
  11487. l(17),
  11488. l(1)
  11489. }
  11490. function p() {
  11491. c(65499),
  11492. c(132),
  11493. l(0);
  11494. for (var e = 0; e < 64; e++)
  11495. l(T[e]);
  11496. l(1);
  11497. for (var t = 0; t < 64; t++)
  11498. l(x[t])
  11499. }
  11500. function f() {
  11501. c(65476),
  11502. c(418),
  11503. l(0);
  11504. for (var e = 0; e < 16; e++)
  11505. l(z[e + 1]);
  11506. for (var t = 0; t <= 11; t++)
  11507. l(W[t]);
  11508. l(16);
  11509. for (var i = 0; i < 16; i++)
  11510. l(j[i + 1]);
  11511. for (var n = 0; n <= 161; n++)
  11512. l(Y[n]);
  11513. l(1);
  11514. for (var r = 0; r < 16; r++)
  11515. l(X[r + 1]);
  11516. for (var o = 0; o <= 11; o++)
  11517. l(Z[o]);
  11518. l(17);
  11519. for (var a = 0; a < 16; a++)
  11520. l(q[a + 1]);
  11521. for (var s = 0; s <= 161; s++)
  11522. l(K[s])
  11523. }
  11524. function g() {
  11525. c(65498),
  11526. c(12),
  11527. l(3),
  11528. l(1),
  11529. l(0),
  11530. l(2),
  11531. l(17),
  11532. l(3),
  11533. l(17),
  11534. l(0),
  11535. l(63),
  11536. l(0)
  11537. }
  11538. function m(e, t, i, n, r) {
  11539. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11540. L[G[f]] = p[f];
  11541. var g = L[0] - i;
  11542. i = L[0],
  11543. 0 == g ? s(n[0]) : (o = 32767 + g,
  11544. s(n[P[o]]),
  11545. s(R[o]));
  11546. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11547. ;
  11548. if (0 == m)
  11549. return s(a),
  11550. i;
  11551. for (var v, A = 1; A <= m; ) {
  11552. for (var y = A; 0 == L[A] && A <= m; ++A)
  11553. ;
  11554. var C = A - y;
  11555. if (C >= c) {
  11556. v = C >> 4;
  11557. for (var I = 1; I <= v; ++I)
  11558. s(l);
  11559. C &= 15
  11560. }
  11561. o = 32767 + L[A],
  11562. s(r[(C << 4) + P[o]]),
  11563. s(R[o]),
  11564. A++
  11565. }
  11566. return m != u && s(a),
  11567. i
  11568. }
  11569. function v() {
  11570. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11571. k[t] = e(t)
  11572. }
  11573. function A(e) {
  11574. if (e <= 0 && (e = 1),
  11575. e > 100 && (e = 100),
  11576. w != e) {
  11577. var t = 0;
  11578. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11579. i(t),
  11580. w = e
  11581. }
  11582. }
  11583. function y() {
  11584. var e = (new Date).getTime();
  11585. t || (t = 50),
  11586. v(),
  11587. r(),
  11588. o(),
  11589. a(),
  11590. A(t);
  11591. (new Date).getTime() - e
  11592. }
  11593. var C, I, E, b, w, _ = (Math.round,
  11594. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11595. this.encode = function(t, i) {
  11596. var n = ((new Date).getTime(),
  11597. i.quality);
  11598. n && A(n),
  11599. D = new Array,
  11600. N = 0,
  11601. B = 7,
  11602. c(65496),
  11603. u(),
  11604. p(),
  11605. d(t.width, t.height),
  11606. f(),
  11607. g();
  11608. var r = 0
  11609. , o = 0
  11610. , a = 0;
  11611. N = 0,
  11612. B = 7,
  11613. this.encode.displayName = "_encode_";
  11614. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  11615. for (l = 0; l < G; ) {
  11616. for (w = G * z + l,
  11617. _ = w,
  11618. T = -1,
  11619. x = 0,
  11620. R = 0; R < 64; R++)
  11621. x = (k ? 63 - R : R) >> 3,
  11622. T = 4 * (7 & R),
  11623. _ = w + x * G + T,
  11624. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11625. l + T >= G && (_ -= l + T - G + 4),
  11626. h = P[_++],
  11627. v = P[_++],
  11628. y = P[_++],
  11629. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11630. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11631. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11632. r = m(F, S, r, C, E),
  11633. o = m(V, M, o, I, b),
  11634. a = m(U, M, a, I, b),
  11635. l += 32
  11636. }
  11637. z += W
  11638. }
  11639. if (B >= 0) {
  11640. var j = [];
  11641. j[1] = B + 1,
  11642. j[0] = (1 << B + 1) - 1,
  11643. s(j)
  11644. }
  11645. return c(65497),
  11646. new e(D)
  11647. }
  11648. ,
  11649. y()
  11650. }
  11651. function n(e, t) {
  11652. t = t || {},
  11653. t.quality = t.quality || 50;
  11654. var n = t.quality
  11655. , r = new i(n)
  11656. , o = r.encode(e, t);
  11657. return {
  11658. data: o,
  11659. width: e.width,
  11660. height: e.height
  11661. }
  11662. }
  11663. t.exports.encode = n
  11664. }
  11665. ).call(this, e("buffer").Buffer)
  11666. }
  11667. , {
  11668. buffer: 198
  11669. }],
  11670. 95: [function(e, t, i) {//"./lib/performance-polyfill"
  11671. "use strict";
  11672. !function() {
  11673. if ("performance"in window == !1 && (window.performance = {}),
  11674. Date.now = Date.now || function() {
  11675. return (new Date).getTime()
  11676. }
  11677. ,
  11678. "now"in window.performance == !1) {
  11679. var e = Date.now();
  11680. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11681. window.performance.now = function() {
  11682. return Date.now() - e
  11683. }
  11684. }
  11685. }()
  11686. }
  11687. , {}],
  11688. 96: [function(e, t, i) {//"./lib/postprocessing/EffectComposer.js"
  11689. "use strict";
  11690. var n = e("three");
  11691. n.EffectComposer = function(e, t) {
  11692. if (this.renderer = e,
  11693. void 0 === t) {
  11694. var i = {
  11695. minFilter: n.LinearFilter,
  11696. magFilter: n.LinearFilter,
  11697. format: n.RGBAFormat,
  11698. stencilBuffer: !1
  11699. }
  11700. , r = e.getSize();
  11701. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11702. }
  11703. this.renderTarget1 = t,
  11704. this.renderTarget2 = t.clone(),
  11705. this.writeBuffer = this.renderTarget1,
  11706. this.readBuffer = this.renderTarget2,
  11707. this.passes = [],
  11708. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11709. this.copyPass = new n.ShaderPass(n.CopyShader)
  11710. }
  11711. ,
  11712. n.EffectComposer.prototype = {
  11713. swapBuffers: function() {
  11714. var e = this.readBuffer;
  11715. this.readBuffer = this.writeBuffer,
  11716. this.writeBuffer = e
  11717. },
  11718. addPass: function(e) {
  11719. this.passes.push(e)
  11720. },
  11721. insertPass: function(e, t) {
  11722. this.passes.splice(t, 0, e)
  11723. },
  11724. render: function(e) {
  11725. this.writeBuffer = this.renderTarget1,
  11726. this.readBuffer = this.renderTarget2;
  11727. var t, i, r = !1, o = this.passes.length;
  11728. for (i = 0; i < o; i++)
  11729. if (t = this.passes[i],
  11730. t.enabled) {
  11731. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11732. t.needsSwap) {
  11733. if (r) {
  11734. var a = this.renderer.context;
  11735. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11736. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11737. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11738. }
  11739. this.swapBuffers()
  11740. }
  11741. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11742. }
  11743. },
  11744. reset: function(e) {
  11745. if (void 0 === e) {
  11746. var t = this.renderer.getSize();
  11747. e = this.renderTarget1.clone(),
  11748. e.setSize(t.width, t.height)
  11749. }
  11750. this.renderTarget1.dispose(),
  11751. this.renderTarget2.dispose(),
  11752. this.renderTarget1 = e,
  11753. this.renderTarget2 = e.clone(),
  11754. this.writeBuffer = this.renderTarget1,
  11755. this.readBuffer = this.renderTarget2
  11756. },
  11757. setSize: function(e, t) {
  11758. this.renderTarget1.setSize(e, t),
  11759. this.renderTarget2.setSize(e, t)
  11760. }
  11761. }
  11762. }
  11763. , {
  11764. three: 217
  11765. }],
  11766. 97: [function(e, t, i) {//"./lib/postprocessing/MaskPass.js"
  11767. "use strict";
  11768. var n = e("three");
  11769. n.MaskPass = function(e, t) {
  11770. this.scene = e,
  11771. this.camera = t,
  11772. this.enabled = !0,
  11773. this.clear = !0,
  11774. this.needsSwap = !1,
  11775. this.inverse = !1
  11776. }
  11777. ,
  11778. n.MaskPass.prototype = {
  11779. render: function(e, t, i, n) {
  11780. var r = e.context;
  11781. r.colorMask(!1, !1, !1, !1),
  11782. r.depthMask(!1);
  11783. var o, a;
  11784. this.inverse ? (o = 0,
  11785. a = 1) : (o = 1,
  11786. a = 0),
  11787. r.enable(r.STENCIL_TEST),
  11788. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11789. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11790. r.clearStencil(a),
  11791. e.render(this.scene, this.camera, i, this.clear),
  11792. e.render(this.scene, this.camera, t, this.clear),
  11793. r.colorMask(!0, !0, !0, !0),
  11794. r.depthMask(!0),
  11795. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11796. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11797. }
  11798. },
  11799. n.ClearMaskPass = function() {
  11800. this.enabled = !0
  11801. }
  11802. ,
  11803. n.ClearMaskPass.prototype = {
  11804. render: function(e, t, i, n) {
  11805. var r = e.context;
  11806. r.disable(r.STENCIL_TEST)
  11807. }
  11808. }
  11809. }
  11810. , {
  11811. three: 217
  11812. }],
  11813. 98: [function(e, t, i) {//"./lib/postprocessing/RenderPass.js"
  11814. "use strict";
  11815. var n = e("three");
  11816. n.RenderPass = function(e, t, i, r, o) {
  11817. this.scene = e,
  11818. this.camera = t,
  11819. this.overrideMaterial = i,
  11820. this.clearColor = r,
  11821. this.clearAlpha = void 0 !== o ? o : 1,
  11822. this.oldClearColor = new n.Color,
  11823. this.oldClearAlpha = 1,
  11824. this.enabled = !0,
  11825. this.clear = !0,
  11826. this.needsSwap = !1
  11827. }
  11828. ,
  11829. n.RenderPass.prototype = {
  11830. render: function(e, t, i, n) {
  11831. this.scene.overrideMaterial = this.overrideMaterial,
  11832. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11833. this.oldClearAlpha = e.getClearAlpha(),
  11834. e.setClearColor(this.clearColor, this.clearAlpha)),
  11835. e.render(this.scene, this.camera, i, this.clear),
  11836. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11837. this.scene.overrideMaterial = null
  11838. }
  11839. }
  11840. }
  11841. , {
  11842. three: 217
  11843. }],
  11844. 99: [function(e, t, i) {//"./lib/postprocessing/ShaderPass.js"
  11845. "use strict";
  11846. var n = e("three");
  11847. n.ShaderPass = function(e, t) {
  11848. this.textureID = void 0 !== t ? t : "tDiffuse",
  11849. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11850. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11851. this.material = new n.ShaderMaterial({
  11852. defines: e.defines || {},
  11853. uniforms: this.uniforms,
  11854. vertexShader: e.vertexShader,
  11855. fragmentShader: e.fragmentShader
  11856. })),
  11857. this.renderToScreen = !1,
  11858. this.enabled = !0,
  11859. this.needsSwap = !0,
  11860. this.clear = !1,
  11861. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11862. this.scene = new n.Scene,
  11863. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11864. this.scene.add(this.quad)
  11865. }
  11866. ,
  11867. n.ShaderPass.prototype = {
  11868. render: function(e, t, i, n) {
  11869. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11870. this.quad.material = this.material,
  11871. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11872. }
  11873. }
  11874. }
  11875. , {
  11876. three: 217
  11877. }],
  11878. 100: [function(e, t, i) {//"./lib/shaders/CopyShader.js"
  11879. "use strict";
  11880. var n = e("three");
  11881. n.CopyShader = {
  11882. uniforms: {
  11883. tDiffuse: {
  11884. type: "t",
  11885. value: null
  11886. },
  11887. opacity: {
  11888. type: "f",
  11889. value: 1
  11890. }
  11891. },
  11892. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11893. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11894. }
  11895. }
  11896. , {
  11897. three: 217
  11898. }],
  11899. 101: [function(e, t, i) {//"./lib/shaders/HorizontalBlurShader.js"
  11900. "use strict";
  11901. var n = e("three");
  11902. n.HorizontalBlurShader = {
  11903. uniforms: {
  11904. tDiffuse: {
  11905. type: "t",
  11906. value: null
  11907. },
  11908. h: {
  11909. type: "f",
  11910. value: 1 / 512
  11911. }
  11912. },
  11913. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11914. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  11915. }
  11916. }
  11917. , {
  11918. three: 217
  11919. }],
  11920. 102: [function(e, t, i) {//"./lib/shaders/VerticalBlurShader.js"
  11921. "use strict";
  11922. var n = e("three");
  11923. n.VerticalBlurShader = {
  11924. uniforms: {
  11925. tDiffuse: {
  11926. type: "t",
  11927. value: null
  11928. },
  11929. v: {
  11930. type: "f",
  11931. value: 1 / 512
  11932. }
  11933. },
  11934. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11935. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  11936. }
  11937. }
  11938. , {
  11939. three: 217
  11940. }],
  11941. 103: [function(e, t, i) {//"./lib/three75-shim"
  11942. "use strict";
  11943. var n = e("three");
  11944. !function() {
  11945. if ("performance"in window == 0 && (window.performance = {}),
  11946. "now"in window.performance == 0) {
  11947. var e = Date.now();
  11948. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11949. window.performance.now = function() {
  11950. return Date.now() - e
  11951. }
  11952. }
  11953. }(),
  11954. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11955. var t, i = this.extensions, r = this.context;
  11956. if (e === n.RepeatWrapping)
  11957. return r.REPEAT;
  11958. if (e === n.ClampToEdgeWrapping)
  11959. return r.CLAMP_TO_EDGE;
  11960. if (e === n.MirroredRepeatWrapping)
  11961. return r.MIRRORED_REPEAT;
  11962. if (e === n.NearestFilter)
  11963. return r.NEAREST;
  11964. if (e === n.NearestMipMapNearestFilter)
  11965. return r.NEAREST_MIPMAP_NEAREST;
  11966. if (e === n.NearestMipMapLinearFilter)
  11967. return r.NEAREST_MIPMAP_LINEAR;
  11968. if (e === n.LinearFilter)
  11969. return r.LINEAR;
  11970. if (e === n.LinearMipMapNearestFilter)
  11971. return r.LINEAR_MIPMAP_NEAREST;
  11972. if (e === n.LinearMipMapLinearFilter)
  11973. return r.LINEAR_MIPMAP_LINEAR;
  11974. if (e === n.UnsignedByteType)
  11975. return r.UNSIGNED_BYTE;
  11976. if (e === n.UnsignedShort4444Type)
  11977. return r.UNSIGNED_SHORT_4_4_4_4;
  11978. if (e === n.UnsignedShort5551Type)
  11979. return r.UNSIGNED_SHORT_5_5_5_1;
  11980. if (e === n.UnsignedShort565Type)
  11981. return r.UNSIGNED_SHORT_5_6_5;
  11982. if (e === n.ByteType)
  11983. return r.BYTE;
  11984. if (e === n.ShortType)
  11985. return r.SHORT;
  11986. if (e === n.UnsignedShortType)
  11987. return r.UNSIGNED_SHORT;
  11988. if (e === n.IntType)
  11989. return r.INT;
  11990. if (e === n.UnsignedIntType)
  11991. return r.UNSIGNED_INT;
  11992. if (e === n.FloatType)
  11993. return r.FLOAT;
  11994. if (t = i.get("OES_texture_half_float"),
  11995. null !== t && e === n.HalfFloatType)
  11996. return t.HALF_FLOAT_OES;
  11997. if (e === n.AlphaFormat)
  11998. return r.ALPHA;
  11999. if (e === n.RGBFormat)
  12000. return r.RGB;
  12001. if (e === n.RGBAFormat)
  12002. return r.RGBA;
  12003. if (e === n.LuminanceFormat)
  12004. return r.LUMINANCE;
  12005. if (e === n.LuminanceAlphaFormat)
  12006. return r.LUMINANCE_ALPHA;
  12007. if (e === n.AddEquation)
  12008. return r.FUNC_ADD;
  12009. if (e === n.SubtractEquation)
  12010. return r.FUNC_SUBTRACT;
  12011. if (e === n.ReverseSubtractEquation)
  12012. return r.FUNC_REVERSE_SUBTRACT;
  12013. if (e === n.ZeroFactor)
  12014. return r.ZERO;
  12015. if (e === n.OneFactor)
  12016. return r.ONE;
  12017. if (e === n.SrcColorFactor)
  12018. return r.SRC_COLOR;
  12019. if (e === n.OneMinusSrcColorFactor)
  12020. return r.ONE_MINUS_SRC_COLOR;
  12021. if (e === n.SrcAlphaFactor)
  12022. return r.SRC_ALPHA;
  12023. if (e === n.OneMinusSrcAlphaFactor)
  12024. return r.ONE_MINUS_SRC_ALPHA;
  12025. if (e === n.DstAlphaFactor)
  12026. return r.DST_ALPHA;
  12027. if (e === n.OneMinusDstAlphaFactor)
  12028. return r.ONE_MINUS_DST_ALPHA;
  12029. if (e === n.DstColorFactor)
  12030. return r.DST_COLOR;
  12031. if (e === n.OneMinusDstColorFactor)
  12032. return r.ONE_MINUS_DST_COLOR;
  12033. if (e === n.SrcAlphaSaturateFactor)
  12034. return r.SRC_ALPHA_SATURATE;
  12035. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12036. null !== t) {
  12037. if (e === n.RGB_S3TC_DXT1_Format)
  12038. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12039. if (e === n.RGBA_S3TC_DXT1_Format)
  12040. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12041. if (e === n.RGBA_S3TC_DXT3_Format)
  12042. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12043. if (e === n.RGBA_S3TC_DXT5_Format)
  12044. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12045. }
  12046. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12047. null !== t) {
  12048. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12049. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12050. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12051. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12052. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12053. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12054. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12055. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12056. }
  12057. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12058. null !== t && e === n.RGB_ETC1_Format)
  12059. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12060. if (t = i.get("EXT_blend_minmax"),
  12061. null !== t) {
  12062. if (e === n.MinEquation)
  12063. return t.MIN_EXT;
  12064. if (e === n.MaxEquation)
  12065. return t.MAX_EXT
  12066. }
  12067. return 0
  12068. }
  12069. ,
  12070. n.WebGLState = function(e, t, i) {
  12071. var r = this
  12072. , o = new n.Vector4
  12073. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12074. , s = new Uint8Array(a)
  12075. , l = new Uint8Array(a)
  12076. , c = new Uint8Array(a)
  12077. , h = {}
  12078. , u = null
  12079. , d = null
  12080. , p = null
  12081. , f = null
  12082. , g = null
  12083. , m = null
  12084. , v = null
  12085. , A = null
  12086. , y = !1
  12087. , C = null
  12088. , I = null
  12089. , E = null
  12090. , b = null
  12091. , w = null
  12092. , _ = null
  12093. , T = null
  12094. , x = null
  12095. , S = null
  12096. , M = null
  12097. , R = null
  12098. , P = null
  12099. , O = null
  12100. , L = null
  12101. , D = null
  12102. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12103. , B = void 0
  12104. , F = {}
  12105. , V = new n.Vector4
  12106. , U = null
  12107. , k = null
  12108. , H = new n.Vector4
  12109. , G = new n.Vector4;
  12110. this.init = function() {
  12111. this.clearColor(0, 0, 0, 1),
  12112. this.clearDepth(1),
  12113. this.clearStencil(0),
  12114. this.enable(e.DEPTH_TEST),
  12115. e.depthFunc(e.LEQUAL),
  12116. e.frontFace(e.CCW),
  12117. e.cullFace(e.BACK),
  12118. this.enable(e.CULL_FACE),
  12119. this.enable(e.BLEND),
  12120. e.blendEquation(e.FUNC_ADD),
  12121. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12122. }
  12123. ,
  12124. this.initAttributes = function() {
  12125. for (var e = 0, t = s.length; e < t; e++)
  12126. s[e] = 0
  12127. }
  12128. ,
  12129. this.enableAttribute = function(i) {
  12130. if (s[i] = 1,
  12131. 0 === l[i] && (e.enableVertexAttribArray(i),
  12132. l[i] = 1),
  12133. 0 !== c[i]) {
  12134. var n = t.get("ANGLE_instanced_arrays");
  12135. n.vertexAttribDivisorANGLE(i, 0),
  12136. c[i] = 0
  12137. }
  12138. }
  12139. ,
  12140. this.enableAttributeAndDivisor = function(t, i, n) {
  12141. s[t] = 1,
  12142. 0 === l[t] && (e.enableVertexAttribArray(t),
  12143. l[t] = 1),
  12144. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12145. c[t] = i)
  12146. }
  12147. ,
  12148. this.disableUnusedAttributes = function() {
  12149. for (var t = 0, i = l.length; t < i; t++)
  12150. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12151. l[t] = 0)
  12152. }
  12153. ,
  12154. this.enable = function(t) {
  12155. h[t] !== !0 && (e.enable(t),
  12156. h[t] = !0)
  12157. }
  12158. ,
  12159. this.disable = function(t) {
  12160. h[t] !== !1 && (e.disable(t),
  12161. h[t] = !1)
  12162. }
  12163. ,
  12164. this.getCompressedTextureFormats = function() {
  12165. if (null === u && (u = [],
  12166. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12167. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12168. u.push(i[n]);
  12169. return u
  12170. }
  12171. ,
  12172. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12173. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12174. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12175. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12176. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12177. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12178. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12179. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12180. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12181. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12182. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12183. d = t,
  12184. y = h),
  12185. t === n.CustomBlending ? (s = s || r,
  12186. l = l || o,
  12187. c = c || a,
  12188. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12189. p = r,
  12190. m = s),
  12191. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12192. f = o,
  12193. g = a,
  12194. v = l,
  12195. A = c)) : (p = null,
  12196. f = null,
  12197. g = null,
  12198. m = null,
  12199. v = null,
  12200. A = null)
  12201. }
  12202. ,
  12203. this.setDepthFunc = function(t) {
  12204. if (C !== t) {
  12205. if (t)
  12206. switch (t) {
  12207. case n.NeverDepth:
  12208. e.depthFunc(e.NEVER);
  12209. break;
  12210. case n.AlwaysDepth:
  12211. e.depthFunc(e.ALWAYS);
  12212. break;
  12213. case n.LessDepth:
  12214. e.depthFunc(e.LESS);
  12215. break;
  12216. case n.LessEqualDepth:
  12217. e.depthFunc(e.LEQUAL);
  12218. break;
  12219. case n.EqualDepth:
  12220. e.depthFunc(e.EQUAL);
  12221. break;
  12222. case n.GreaterEqualDepth:
  12223. e.depthFunc(e.GEQUAL);
  12224. break;
  12225. case n.GreaterDepth:
  12226. e.depthFunc(e.GREATER);
  12227. break;
  12228. case n.NotEqualDepth:
  12229. e.depthFunc(e.NOTEQUAL);
  12230. break;
  12231. default:
  12232. e.depthFunc(e.LEQUAL)
  12233. }
  12234. else
  12235. e.depthFunc(e.LEQUAL);
  12236. C = t
  12237. }
  12238. }
  12239. ,
  12240. this.setDepthTest = function(t) {
  12241. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12242. }
  12243. ,
  12244. this.setDepthWrite = function(t) {
  12245. I !== t && (e.depthMask(t),
  12246. I = t)
  12247. }
  12248. ,
  12249. this.setColorWrite = function(t) {
  12250. E !== t && (e.colorMask(t, t, t, t),
  12251. E = t)
  12252. }
  12253. ,
  12254. this.setStencilFunc = function(t, i, n) {
  12255. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12256. w = t,
  12257. _ = i,
  12258. T = n)
  12259. }
  12260. ,
  12261. this.setStencilOp = function(t, i, n) {
  12262. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12263. x = t,
  12264. S = i,
  12265. M = n)
  12266. }
  12267. ,
  12268. this.setStencilTest = function(t) {
  12269. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12270. }
  12271. ,
  12272. this.setStencilWrite = function(t) {
  12273. b !== t && (e.stencilMask(t),
  12274. b = t)
  12275. }
  12276. ,
  12277. this.setFlipSided = function(t) {
  12278. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12279. R = t)
  12280. }
  12281. ,
  12282. this.setLineWidth = function(t) {
  12283. t !== P && (e.lineWidth(t),
  12284. P = t)
  12285. }
  12286. ,
  12287. this.setPolygonOffset = function(t, i, n) {
  12288. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12289. !t || O === i && L === n || (e.polygonOffset(i, n),
  12290. O = i,
  12291. L = n)
  12292. }
  12293. ,
  12294. this.getScissorTest = function() {
  12295. return D
  12296. }
  12297. ,
  12298. this.setScissorTest = function(t) {
  12299. D = t,
  12300. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12301. }
  12302. ,
  12303. this.activeTexture = function(t) {
  12304. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12305. B !== t && (e.activeTexture(t),
  12306. B = t)
  12307. }
  12308. ,
  12309. this.bindTexture = function(t, i) {
  12310. void 0 === B && r.activeTexture();
  12311. var n = F[B];
  12312. void 0 === n && (n = {
  12313. type: void 0,
  12314. texture: void 0
  12315. },
  12316. F[B] = n),
  12317. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12318. n.type = t,
  12319. n.texture = i)
  12320. }
  12321. ,
  12322. this.compressedTexImage2D = function() {
  12323. try {
  12324. e.compressedTexImage2D.apply(e, arguments)
  12325. } catch (e) {
  12326. console.error(e)
  12327. }
  12328. }
  12329. ,
  12330. this.texImage2D = function() {
  12331. try {
  12332. e.texImage2D.apply(e, arguments)
  12333. } catch (e) {
  12334. console.error(e)
  12335. }
  12336. }
  12337. ,
  12338. this.clearColor = function(t, i, n, r) {
  12339. o.set(t, i, n, r),
  12340. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12341. V.copy(o))
  12342. }
  12343. ,
  12344. this.clearDepth = function(t) {
  12345. U !== t && (e.clearDepth(t),
  12346. U = t)
  12347. }
  12348. ,
  12349. this.clearStencil = function(t) {
  12350. k !== t && (e.clearStencil(t),
  12351. k = t)
  12352. }
  12353. ,
  12354. this.scissor = function(t) {
  12355. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12356. H.copy(t))
  12357. }
  12358. ,
  12359. this.viewport = function(t) {
  12360. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12361. G.copy(t))
  12362. }
  12363. ,
  12364. this.reset = function() {
  12365. for (var t = 0; t < l.length; t++)
  12366. 1 === l[t] && (e.disableVertexAttribArray(t),
  12367. l[t] = 0);
  12368. h = {},
  12369. u = null,
  12370. B = void 0,
  12371. F = {},
  12372. d = null,
  12373. E = null,
  12374. I = null,
  12375. b = null,
  12376. R = null
  12377. }
  12378. }
  12379. }
  12380. , {
  12381. three: 217
  12382. }],
  12383. 104: [function(e, t, i) {///js/loaders/DamLoader.js
  12384. (function(i, n) {
  12385. "use strict";
  12386. function r(e) {
  12387. this.urls = e;
  12388. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12389. this.builder = a.loadProto(t),
  12390. this.decoder = this.builder.build("binary_mesh")
  12391. }
  12392. var o = e("three")
  12393. , a = e("protobufjs")
  12394. , s = e("../util/logger")
  12395. , l = (e("../util/common"),
  12396. e("../util/ajax"))
  12397. , c = e("../objects/Chunk")
  12398. , h = new s(n);
  12399. r.prototype = {
  12400. constructor: r,
  12401. load: function(e, t, i, n) {
  12402. return h.time("download"),
  12403. l.get(e, {
  12404. responseType: "arraybuffer"
  12405. }).done(function(r) {
  12406. h.timeEnd("download"),
  12407. this.parse(r, e, t, i, n)
  12408. }
  12409. .bind(this)).fail(n)
  12410. },
  12411. parse: function(e, t, i, n, r) {
  12412. var o = this.readProtobuf(e);
  12413. if (!o)
  12414. return r();
  12415. try {
  12416. h.time("convert to webgl"),
  12417. this.convertProtobufToSceneObject(o, t, i, n, r),
  12418. h.timeEnd("convert to webgl")
  12419. } catch (e) {
  12420. return h.error("failed parsing .dam"),
  12421. h.error(e.message),
  12422. r()
  12423. }
  12424. },
  12425. readProtobuf: function(e) {
  12426. var t;
  12427. try {
  12428. h.time("parse proto"),
  12429. t = this.decoder.decode(e),
  12430. h.timeEnd("parse proto")
  12431. } catch (e) {
  12432. return h.error("failed parsing proto for .dam"),
  12433. h.error(e.message),
  12434. null
  12435. }
  12436. return t
  12437. },
  12438. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12439. function a(e) {
  12440. var i = new o.BufferGeometry;
  12441. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12442. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12443. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12444. i.applyMatrix(s),
  12445. i.computeBoundingBox(),
  12446. new c({
  12447. geometry: i,
  12448. textureName: e.material_name,
  12449. name: e.chunk_name,
  12450. meshUrl: t
  12451. })
  12452. }
  12453. if (0 === e.chunk.length)
  12454. return h.warn("No chunks in damfile..."),
  12455. i([]);
  12456. var s = new o.Matrix4;
  12457. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12458. var l = e.chunk.map(a);
  12459. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12460. r())
  12461. }
  12462. },
  12463. t.exports = r
  12464. }
  12465. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12466. }
  12467. , {
  12468. "../objects/Chunk": 144,
  12469. "../util/ajax": 181,
  12470. "../util/common": 185,
  12471. "../util/logger": 189,
  12472. buffer: 198,
  12473. protobufjs: 214,
  12474. three: 217
  12475. }],
  12476. 105: [function(e, t, i) {///js/loaders/ModelLoader.js
  12477. (function(i) {
  12478. "use strict";
  12479. var n = (e("three"),
  12480. e("../settings"),
  12481. e("../util/browser"),
  12482. e("./DamLoader"))
  12483. , r = e("../util/logger")
  12484. , o = (e("../ab"),
  12485. new r(i));
  12486. t.exports = {
  12487. getLoaders: function() {
  12488. return [["_50k", ".dam", n], ["", ".dam", n]]
  12489. },
  12490. load: function(e, t, i, n, r, a) {
  12491. var s = this.getLoaders();
  12492. a = a || 0;
  12493. var l = s[a];
  12494. if (!l)
  12495. return void (r && r("No suitable model file found..."));
  12496. var c = l[0]
  12497. , h = l[1]
  12498. , u = new l[2](t)
  12499. , d = t.get(e + c + h);
  12500. d ? (o.debug("Trying " + c + h),
  12501. u.load(d, i, n, function() {
  12502. this.load(e, t, i, n, r, ++a)
  12503. }
  12504. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12505. this.load(e, t, i, n, r, ++a))
  12506. }
  12507. }
  12508. }
  12509. ).call(this, "/js/loaders/ModelLoader.js")
  12510. }
  12511. , {
  12512. "../ab": 3,
  12513. "../settings": 166,
  12514. "../util/browser": 182,
  12515. "../util/logger": 189,
  12516. "./DamLoader": 104,
  12517. three: 217
  12518. }],
  12519. 106: [function(e, t, i) {///js/loaders/ModelTextureLoader.js
  12520. (function(i) {
  12521. "use strict";
  12522. var n = e("../util/common")
  12523. , r = e("../util/texture")
  12524. , o = e("../util/browser")
  12525. , a = e("../util/logger")
  12526. , s = e("../settings")
  12527. , l = new a(i);
  12528. t.exports = {
  12529. load: function(e, t) {
  12530. function i(e, i) {
  12531. e || (t.push(i),
  12532. p++,
  12533. d.notify(p, a),
  12534. p === a && d.resolve())
  12535. }
  12536. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12537. return $.when();
  12538. var a = n.countUnique(e.chunks.map(function(e) {
  12539. return e.textureName
  12540. }))
  12541. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12542. , h = "_50k" === c ? "high" : "low";
  12543. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12544. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12545. h = "low"));
  12546. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12547. , d = $.Deferred()
  12548. , p = 0;
  12549. return e.chunks.forEach(function(t) {
  12550. if (!t.material.map && t.textureName) {
  12551. var n = e.urls.get(u + t.textureName);
  12552. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12553. }
  12554. }),
  12555. d.promise()
  12556. }
  12557. }
  12558. }
  12559. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12560. }
  12561. , {
  12562. "../settings": 166,
  12563. "../util/browser": 182,
  12564. "../util/common": 185,
  12565. "../util/logger": 189,
  12566. "../util/texture": 194
  12567. }],
  12568. 107: [function(e, t, i) {///js/loaders/SweepDataLoader.js
  12569. (function(i, n) {
  12570. "use strict";
  12571. function r(e) {
  12572. this.model = e,
  12573. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12574. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12575. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12576. , n = o.loadProto(t);
  12577. this.decoder = n.build("VisionModeldata")
  12578. }
  12579. var o = e("protobufjs")
  12580. , a = e("../util/ajax")
  12581. , s = (e("../util/common"),
  12582. e("../util/math"))
  12583. , l = e("../util/logger")
  12584. , c = new l(n);
  12585. r.prototype.load = function() {
  12586. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12587. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12588. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12589. $.when([]))
  12590. }
  12591. ,
  12592. r.prototype.loadVisionModelData = function() {
  12593. return a.get(this.modelDataPath, {
  12594. responseType: "arraybuffer"
  12595. }).then(function(e) {
  12596. var t;
  12597. try {
  12598. t = this.decoder.decode(e)
  12599. } catch (e) {
  12600. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12601. this.loadSweepLocationsCSV()
  12602. }
  12603. var i = t.sweepLocations.map(function(e) {
  12604. return {
  12605. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12606. position: {
  12607. x: e.pose.translation.x,
  12608. y: e.pose.translation.y,
  12609. z: e.pose.translation.z
  12610. },
  12611. quaternion: {
  12612. x: e.pose.rotation.x,
  12613. y: e.pose.rotation.y,
  12614. z: e.pose.rotation.z,
  12615. w: e.pose.rotation.w
  12616. },
  12617. puck: {
  12618. x: e.puck.x,
  12619. y: e.puck.y,
  12620. z: e.puck.z
  12621. },
  12622. floor: e.group,
  12623. neighbours: isSpecialScene ? e.visibles : (e.visibles3 || e.visibles),//可以通行的点
  12624. noBlocks: e.visibles2,// 过渡时出模型的点
  12625. seeMarkers : e.visibles //可以看见marker及热点的点
  12626. }
  12627. }).map(function(e) {
  12628. return e.position = s.convertVisionVector(e.position),
  12629. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12630. e.puck = s.convertVisionVector(e.puck),
  12631. e
  12632. });
  12633. return i.forEach(function(e) {
  12634. e.neighbours = e.neighbours.map(function(e) {
  12635. return i[e].uuid
  12636. })
  12637. }),
  12638. i.forEach(function(t) {//xzw
  12639. if(t.noBlocks)
  12640. t.noBlocks = t.noBlocks.map(function(t) {
  12641. return i[t].uuid
  12642. })
  12643. }),
  12644. i.forEach(function(t) {//xzw
  12645. if(t.seeMarkers)
  12646. t.seeMarkers = t.seeMarkers.map(function(t) {
  12647. return i[t].uuid
  12648. })
  12649. }),
  12650. i
  12651. }
  12652. .bind(this), function() {
  12653. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12654. this.loadSweepLocationsCSV()
  12655. }
  12656. .bind(this))
  12657. }
  12658. ,
  12659. r.prototype.loadSweepLocationsCSV = function() {
  12660. return a.get(this.sweepLocationsPath).then(function(e) {
  12661. var t = e.split("\n").map(function(e) {
  12662. return e.split(", ")
  12663. }).filter(function(e) {
  12664. return e.length > 1
  12665. }).map(function(e) {
  12666. return {
  12667. uuid: e[0],
  12668. position: {
  12669. x: parseFloat(e[1]),
  12670. y: parseFloat(e[2]),
  12671. z: parseFloat(e[3])
  12672. },
  12673. quaternion: {
  12674. x: parseFloat(e[4]),
  12675. y: parseFloat(e[5]),
  12676. z: parseFloat(e[6]),
  12677. w: parseFloat(e[7])
  12678. }
  12679. }
  12680. }).map(function(e) {
  12681. return e.position = s.convertVisionVector(e.position),
  12682. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12683. e
  12684. });
  12685. return t
  12686. }).fail(function() {
  12687. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12688. })
  12689. }
  12690. ,
  12691. t.exports = r
  12692. }
  12693. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12694. }
  12695. , {
  12696. "../util/ajax": 181,
  12697. "../util/common": 185,
  12698. "../util/logger": 189,
  12699. "../util/math": 190,
  12700. buffer: 198,
  12701. protobufjs: 214
  12702. }],
  12703. 108: [function(e, t, i) {////js/localization/localize.js
  12704. (function(i) {
  12705. "use strict";
  12706. function n() {
  12707. this.locale = null
  12708. }
  12709. var r = e("../settings")
  12710. , o = e("../util/common")
  12711. , a = e("../util/logger")
  12712. , s = e("../enum/Locale")
  12713. , l = new a(i);
  12714. n.prototype.init = function() {
  12715. var t;
  12716. switch (r.languageTag) {
  12717. case null:
  12718. case "en":
  12719. case s.EN_US:
  12720. this.locale = s.EN_US,
  12721. t = e("./strings-en-US");
  12722. break;
  12723. case "es":
  12724. case s.ES_MX:
  12725. this.locale = s.ES_MX,
  12726. t = e("./strings-es-MX");
  12727. break;
  12728. case "fr":
  12729. case s.FR_FR:
  12730. this.locale = s.FR_FR,
  12731. t = e("./strings-fr-FR");
  12732. break;
  12733. case "de":
  12734. case s.DE_DE:
  12735. this.locale = s.DE_DE,
  12736. t = e("./strings-de-DE");
  12737. break;
  12738. case "ru":
  12739. case s.RU_RU:
  12740. this.locale = s.RU_RU,
  12741. t = e("./strings-ru-RU");
  12742. break;
  12743. case "cn":
  12744. case s.CN_CN:
  12745. this.locale = s.CN_CN,
  12746. t = e("./strings-cn-CN");
  12747. break;
  12748. case "jp":
  12749. case s.JP_JP:
  12750. this.locale = s.JP_JP,
  12751. t = e("./strings-jp-JP");
  12752. break;
  12753. default:
  12754. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12755. this.locale = s.EN_US,
  12756. t = e("./strings-en-US")
  12757. }
  12758. l.info("Using locale '" + this.locale + "'"),
  12759. o.extendObject(this, t)
  12760. }
  12761. ,
  12762. n.prototype.localizeGUI = function() {
  12763. var e = document.querySelector("#gui-parent");
  12764. this.localizeTree(e),
  12765. this.localizeLoadingText()
  12766. }
  12767. ,
  12768. n.prototype.localizeLoadingText = function() {
  12769. var e = document.querySelector("#loader-cont")
  12770. , t = e.getAttribute("title");
  12771. e.removeAttribute("title"),
  12772. e.setAttribute("data-status", t),
  12773. e.classList.add(this.locale),
  12774. document.querySelector("#help-dialog").classList.add(this.locale),
  12775. document.querySelector("#interaction-modal").classList.add(this.locale),
  12776. document.querySelector("#gui").classList.add(this.locale)
  12777. }
  12778. ,
  12779. n.prototype.localizeTree = function(e) {
  12780. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12781. if (e.nodeType === Node.TEXT_NODE)
  12782. t = e.data.match(n),
  12783. t && (i = t[1],
  12784. e.data = this.localizeText(i) || i);
  12785. else if (e.nodeType === Node.ELEMENT_NODE) {
  12786. var r = e.getAttribute("title");
  12787. r && (t = r.match(n),
  12788. t && (i = t[1],
  12789. e.setAttribute("title", this.localizeText(i) || i)))
  12790. }
  12791. for (e = e.firstChild; e; )
  12792. this.localizeTree(e),
  12793. e = e.nextSibling
  12794. }
  12795. ,
  12796. n.prototype.localizeText = function(t) {
  12797. var i = this[t];
  12798. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12799. i = e("./strings-en-US")[t]),
  12800. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12801. i
  12802. }
  12803. ,
  12804. t.exports = new n
  12805. }
  12806. ).call(this, "/js/localization/localize.js")
  12807. }
  12808. , {
  12809. "../enum/Locale": 31,
  12810. "../settings": 166,
  12811. "../util/common": 185,
  12812. "../util/logger": 189,
  12813. "./strings-cn-CN": 109,
  12814. "./strings-de-DE": 110,
  12815. "./strings-en-US": 111,
  12816. "./strings-es-MX": 112,
  12817. "./strings-fr-FR": 113,
  12818. "./strings-jp-JP": 114,
  12819. "./strings-ru-RU": 115
  12820. }],
  12821. 109: [function(e, t, i) {//"./strings-cn-CN"
  12822. "use strict";
  12823. t.exports = {
  12824. PAGE_TITLE: "port 3D Showcase",
  12825. LOADING: "正在加载",
  12826. PRESENTED_BY_CAPS: "呈现者:",
  12827. POWERED_BY: "技术支持:",
  12828. POWERED_BY_CAPS: "技术支持:",
  12829. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12830. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12831. PRESENTED_BY: "呈现者:",
  12832. MORE: "更多 ",
  12833. LESS: "更少 ",
  12834. TAG_CONTENT: "tag™ 内容",
  12835. SHOW: "显示",
  12836. HIDE: "隐藏",
  12837. DOLLHOUSE: "场景屋",
  12838. FLOOR_PLAN: "楼层平面图",
  12839. OPEN_HIGHLIGHTS: "打开精彩片段",
  12840. CLOSE_HIGHLIGHTS: "关闭",
  12841. PREVIOUS: "上一个",
  12842. PLAY: "播放",
  12843. PAUSE: "暂停",
  12844. NEXT: "下一个",
  12845. EXPLORE_3D_SPACE: "探索 3D 空间",
  12846. VIEW_DOLLHOUSE: "观看场景屋",
  12847. SOCIAL_SHARING: "分享这个空间",
  12848. VIEW_IN_VR: "以 VR 观看",
  12849. VIEW_FULLSCREEN: "全屏观看",
  12850. EXIT_FULLSCREEN: " 退出全屏",
  12851. ZOOM_IN: "放大",
  12852. ZOOM_OUT: "缩小",
  12853. FLOOR_NAME: "楼层",
  12854. FLOOR_ALL: "全部",
  12855. TERMS: "条款",
  12856. PORT_TERMS: "port 条款",
  12857. TERMS_OF_USE: "使用条款",
  12858. CLOSE_TERMS: "关闭",
  12859. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12860. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12861. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12862. WEBVR_ENTER_WEBVR: "进入 VR",
  12863. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12864. WEBVR_LEARN_MORE: "了解更多",
  12865. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12866. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12867. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12868. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12869. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12870. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12871. VR_LEARN_MORE_CAPS: "了解更多",
  12872. VR_PREVIOUS_CAPS: "上一个’,",
  12873. VR_NEXT_CAPS: "下一个",
  12874. VR_GOT_IT_CAPS: "明白了",
  12875. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12876. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12877. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12878. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12879. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12880. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12881. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12882. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12883. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12884. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12885. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12886. VR_APP: "port VR 应用程序",
  12887. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12888. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12889. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12890. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12891. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12892. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12893. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12894. VR_ANDROID_DVICES: "Android 设备",
  12895. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12896. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12897. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12898. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12899. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12900. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12901. VR_DOWNLOAD_HERE: "在此下载",
  12902. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12903. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12904. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12905. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12906. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12907. SHARE_TO: "分享到",
  12908. SHARE_LINK: "直接链接",
  12909. SHARE_EXPLORE: "探索",
  12910. SHARE_AT: "在",
  12911. SHARE_WITH: "使用",
  12912. SHARE_3D: "以 3D",
  12913. SHARE_COPIED: "已复制!",
  12914. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12915. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12916. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12917. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12918. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12919. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12920. ERROR_GENERIC_ACTIONS_3: " 或",
  12921. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12922. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12923. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12924. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12925. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12926. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12927. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12928. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12929. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12930. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12931. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12932. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12933. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12934. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12935. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12936. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12937. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12938. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12939. LINK_TO_LOCATION: "地点链接",
  12940. MENU_COPY: "复制",
  12941. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12942. ROTATE: "旋转",
  12943. MOVE: "移动",
  12944. INSIDE: "内部",
  12945. ZOOM: "缩放",
  12946. HELP: "小帮手",
  12947. HELP_NAVIGATION_TAB: "导航",
  12948. HELP_MORE_HELP_TAB: "更多帮助",
  12949. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12950. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12951. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12952. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12953. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12954. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12955. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12956. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12957. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12958. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12959. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12960. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12961. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12962. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12963. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12964. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12965. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12966. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12967. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12968. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12969. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12970. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12971. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12972. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12973. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12974. HELP_MORE_HLR_A: "精彩片段集锦",
  12975. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12976. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12977. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12978. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12979. HELP_MORE_FLOORS_A: "楼层选择器",
  12980. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12981. HELP_MORE_TAG_A: "tag™ 贴文",
  12982. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12983. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12984. HELP_MORE_ZOOM_A: "缩放控件",
  12985. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12986. HELP_MORE_TOUR_A: "导览控件",
  12987. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12988. HELP_MORE_INSIDE_A: "内部视图",
  12989. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12990. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12991. HELP_MORE_VR_A: "VR 模式",
  12992. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12993. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12994. HELP_MORE_360_A: "360° 视图",
  12995. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12996. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12997. HELP_MORE_FULLSCREEN_A: "全屏",
  12998. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12999. CLOSE: "关闭"
  13000. }
  13001. }
  13002. , {}],
  13003. 110: [function(e, t, i) {//"./strings-de-DE"
  13004. "use strict";
  13005. t.exports = {
  13006. PAGE_TITLE: "port 3D Showcase",
  13007. LOADING: "Lädt",
  13008. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13009. POWERED_BY: "Angetrieben von",
  13010. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13011. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13012. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13013. PRESENTED_BY: "Präsentiert von ",
  13014. MORE: "Mehr ",
  13015. LESS: "Weniger ",
  13016. TAG_CONTENT: "tag™ Inhalt",
  13017. SHOW: "Anzeigen",
  13018. HIDE: "Verbergen",
  13019. DOLLHOUSE: "Puppenhaus",
  13020. FLOOR_PLAN: "Grundriss",
  13021. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13022. CLOSE_HIGHLIGHTS: "Schließen",
  13023. PREVIOUS: "Vorheriges",
  13024. PLAY: "Abspielen",
  13025. PAUSE: "Pausieren",
  13026. NEXT: "Nächstes",
  13027. EXPLORE_3D_SPACE: "Innenraum betreten",
  13028. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13029. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13030. VIEW_IN_VR: "In VR ansehen",
  13031. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13032. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13033. ZOOM_IN: "Vergrößern",
  13034. ZOOM_OUT: "Verkleinern",
  13035. FLOOR_NAME: "Etage ",
  13036. FLOOR_ALL: "Alle",
  13037. TERMS: "Bedingungen",
  13038. PORT_TERMS: "port Bedingungen",
  13039. TERMS_OF_USE: "Nutzungsbedingungen",
  13040. TERMS_TEXT_FILE: "terms-de-DE.html",
  13041. CLOSE_TERMS: "Schließen",
  13042. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13043. HELP: "Hilfe",
  13044. HELP_NAVIGATION_TAB: "Navigation",
  13045. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13046. CLOSE: "Schließen",
  13047. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13048. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13049. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13050. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13051. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13052. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13053. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13054. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13055. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13056. HELP_DESKTOP_DOLLHOUSE_2A: "Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.",
  13057. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13058. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13059. HELP_DESKTOP_FLOORPLAN_1A: "Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.",
  13060. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13061. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13062. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13063. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13064. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13065. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13066. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13067. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13068. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13069. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13070. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13071. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13072. HELP_MORE_HLR_A: "Liste das Highlight",
  13073. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13074. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13075. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13076. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13077. HELP_MORE_FLOORS_A: "Etage auswählen",
  13078. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13079. HELP_MORE_TAG_A: "tag™ Posts",
  13080. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13081. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13082. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13083. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13084. HELP_MORE_TOUR_A: "Tour Steuerung",
  13085. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13086. HELP_MORE_INSIDE_A: "Innenansicht",
  13087. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13088. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13089. HELP_MORE_VR_A: "VR Modus",
  13090. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13091. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13092. HELP_MORE_360_A: "360° Views Ansicht ",
  13093. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13094. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13095. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13096. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13097. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13098. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13099. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13100. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13101. WEBVR_LEARN_MORE: "Mehr Infos",
  13102. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13103. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13104. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13105. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13106. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13107. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13108. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13109. VR_APP: "port VR App",
  13110. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13111. VR_COMPATIBLE_ANDROID_LONG: "Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13112. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13113. VR_APP_FOR_ANDROID: "port VR app für Android",
  13114. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13115. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13116. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13117. VR_PREVIOUS_CAPS: "ZURÜCK",
  13118. VR_NEXT_CAPS: "WEITER",
  13119. VR_GOT_IT_CAPS: "VERSTANDEN",
  13120. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13121. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13122. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13123. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13124. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13125. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13126. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13127. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13128. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13129. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13130. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13131. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13132. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13133. VR_ANDROID_DVICES: "Android Geräte",
  13134. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13135. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13136. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13137. VR_DOWNLOAD_HERE: "Hier runterladen",
  13138. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13139. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13140. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13141. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13142. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13143. SHARE_TO: "Teilen auf",
  13144. SHARE_LINK: "Direkter Link",
  13145. SHARE_EXPLORE: "Umsehen",
  13146. SHARE_AT: "auf",
  13147. SHARE_WITH: "mit",
  13148. SHARE_3D: "in 3D",
  13149. SHARE_COPIED: "Kopiert!",
  13150. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13151. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13152. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13153. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13154. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13155. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13156. ERROR_GENERIC_ACTIONS_3: " oder ",
  13157. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13158. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13159. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13160. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13161. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13162. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13163. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13164. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13165. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13166. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13167. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13168. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13169. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13170. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13171. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13172. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13173. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13174. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13175. LINK_TO_LOCATION: "Link zu",
  13176. MENU_COPY: "Kopieren",
  13177. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13178. ROTATE: "Drehen",
  13179. INSIDE: "Drinnen",
  13180. MOVE: "Bewegen",
  13181. ZOOM: "Vergrößern"
  13182. }
  13183. }
  13184. , {}],
  13185. 111: [function(e, t, i) {//"./strings-en-US"
  13186. "use strict";
  13187. t.exports = {
  13188. PAGE_TITLE: "port 3D Showcase",
  13189. LOADING: "Loading",
  13190. PRESENTED_BY_CAPS: "PRESENTED BY",
  13191. POWERED_BY: "powered by ",
  13192. POWERED_BY_CAPS: "POWERED BY",
  13193. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13194. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13195. PRESENTED_BY: "Presented by ",
  13196. MORE: "More ",
  13197. LESS: "Less ",
  13198. TAG_CONTENT: "tag™ Content",
  13199. SHOW: "Show",
  13200. HIDE: "Hide",
  13201. DOLLHOUSE: "Dollhouse",
  13202. FLOOR_PLAN: "Floor plan",
  13203. OPEN_HIGHLIGHTS: "Open Highlights",
  13204. CLOSE_HIGHLIGHTS: "Close",
  13205. PREVIOUS: "Previous",
  13206. PLAY: "Play",
  13207. PAUSE: "Pause",
  13208. NEXT: "Next",
  13209. EXPLORE_3D_SPACE: "Explore 3D Space",
  13210. VIEW_DOLLHOUSE: "View dollhouse",
  13211. SOCIAL_SHARING: "Share this Space",
  13212. VIEW_IN_VR: "View in VR",
  13213. VIEW_FULLSCREEN: "View Fullscreen",
  13214. EXIT_FULLSCREEN: "Exit Fullscreen",
  13215. ZOOM_IN: "Zoom in",
  13216. ZOOM_OUT: "Zoom out",
  13217. FLOOR_NAME: "Floor ",
  13218. FLOOR_ALL: "All",
  13219. TERMS: "Terms",
  13220. PORT_TERMS: "4dage terms",
  13221. TERMS_OF_USE: "Terms of Use",
  13222. TERMS_TEXT_FILE: "terms-en-US.html",
  13223. CLOSE_TERMS: "Close",
  13224. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13225. HELP: "Help",
  13226. HELP_NAVIGATION_TAB: "Navigation",
  13227. HELP_MORE_HELP_TAB: "More Help",
  13228. CLOSE: "Close",
  13229. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13230. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13231. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13232. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13233. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13234. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13235. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13236. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13237. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13238. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13239. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13240. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13241. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13242. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13243. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13244. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13245. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13246. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13247. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13248. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13249. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13250. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13251. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13252. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13253. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13254. HELP_MORE_HLR_A: "Highlight Reel",
  13255. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13256. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13257. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13258. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13259. HELP_MORE_FLOORS_A: "Floor Selector",
  13260. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13261. HELP_MORE_TAG_A: "tag™ Posts",
  13262. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13263. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13264. HELP_MORE_ZOOM_A: "Zoom Controls",
  13265. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13266. HELP_MORE_TOUR_A: "Tour Controls",
  13267. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13268. HELP_MORE_INSIDE_A: "Inside View",
  13269. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13270. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13271. HELP_MORE_VR_A: "VR Mode",
  13272. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13273. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13274. HELP_MORE_360_A: "360° Views",
  13275. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13276. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13277. HELP_MORE_FULLSCREEN_A: "Full screen",
  13278. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13279. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13280. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13281. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13282. WEBVR_ENTER_WEBVR: "ENTER VR",
  13283. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13284. WEBVR_LEARN_MORE: "Learn more",
  13285. WEBVR_VIEW_SPACE: "View Space in VR",
  13286. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13287. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13288. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13289. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13290. VR_PREVIOUS_CAPS: "PREVIOUS",
  13291. VR_NEXT_CAPS: "NEXT",
  13292. VR_GOT_IT_CAPS: "GOT IT",
  13293. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13294. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13295. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13296. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13297. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13298. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13299. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13300. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13301. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13302. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13303. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13304. VR_APP: "port VR App",
  13305. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13306. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13307. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13308. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13309. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13310. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13311. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13312. VR_ANDROID_DVICES: "Android Devices",
  13313. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13314. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13315. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13316. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13317. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13318. VR_APP_OPEN: "Open with the port VR app instead",
  13319. VR_DOWNLOAD_HERE: "Download here",
  13320. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13321. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13322. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13323. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13324. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13325. SHARE_TO: "Share to",
  13326. SHARE_LINK: "Direct Link",
  13327. SHARE_EXPLORE: "Explore ",
  13328. SHARE_AT: "at",
  13329. SHARE_WITH: "with",
  13330. SHARE_3D: " in 3D",
  13331. SHARE_COPIED: "Copied!",
  13332. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13333. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13334. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13335. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13336. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13337. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13338. ERROR_GENERIC_ACTIONS_3: " or ",
  13339. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13340. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13341. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13342. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13343. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13344. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13345. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13346. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13347. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13348. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13349. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13350. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13351. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13352. ERROR_LOADING_FAILED_PROBLEM: "Oops, model not available.",
  13353. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13354. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13355. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13356. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13357. LINK_TO_LOCATION: "Link to location",
  13358. MENU_COPY: "Copy",
  13359. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13360. ROTATE: "Rotate",
  13361. INSIDE: "Inside",
  13362. MOVE: "Move",
  13363. ZOOM: "Zoom"
  13364. }
  13365. }
  13366. , {}],
  13367. 112: [function(e, t, i) {//"./strings-es-MX"
  13368. "use strict";
  13369. t.exports = {
  13370. PAGE_TITLE: "port 3D Showcase",
  13371. LOADING: "Cargando",
  13372. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13373. POWERED_BY: "potenciando por ",
  13374. POWERED_BY_CAPS: "POTENCIADO POR ",
  13375. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13376. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13377. PRESENTED_BY: "Presentado por ",
  13378. MORE: "Más ",
  13379. LESS: "Menos ",
  13380. TAG_CONTENT: "Contenido de tag™",
  13381. SHOW: "Mostrar",
  13382. HIDE: "Ocultar",
  13383. DOLLHOUSE: "Dollhouse",
  13384. FLOOR_PLAN: "Planos",
  13385. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13386. CLOSE_HIGHLIGHTS: "Cerrar",
  13387. PREVIOUS: "Anterior",
  13388. PLAY: "Play",
  13389. PAUSE: "Pausa",
  13390. NEXT: "Siguiente",
  13391. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13392. VIEW_DOLLHOUSE: "Ver dollhouse",
  13393. SOCIAL_SHARING: "Compartir este espacio",
  13394. VIEW_IN_VR: "Ver en realidad virtual",
  13395. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13396. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13397. ZOOM_IN: "Acercar",
  13398. ZOOM_OUT: "Alejar",
  13399. FLOOR_NAME: "Piso ",
  13400. FLOOR_ALL: "Todas",
  13401. TERMS: "Condiciones",
  13402. PORT_TERMS: "port términos de uso",
  13403. TERMS_OF_USE: "Términos de uso",
  13404. TERMS_TEXT_FILE: "terms-es-MX.html",
  13405. CLOSE_TERMS: "Cerrar",
  13406. TERMS_FAIL: "No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.",
  13407. HELP: "Ayuda",
  13408. HELP_NAVIGATION_TAB: "Navegación",
  13409. HELP_MORE_HELP_TAB: "Más Ayuda",
  13410. CLOSE: "Cerrar",
  13411. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13412. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13413. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13414. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13415. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13416. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13417. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13418. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13419. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13420. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13421. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13422. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13423. HELP_DESKTOP_FLOORPLAN_1A: "Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.",
  13424. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13425. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13426. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13427. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13428. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13429. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13430. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13431. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13432. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13433. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13434. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13435. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13436. HELP_MORE_HLR_A: "Galería destacada",
  13437. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13438. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13439. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13440. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13441. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13442. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13443. HELP_MORE_TAG_A: "tag™ Posts",
  13444. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13445. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13446. HELP_MORE_ZOOM_A: "Controles de zoom",
  13447. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13448. HELP_MORE_TOUR_A: "Controles de recorrido",
  13449. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13450. HELP_MORE_INSIDE_A: "Vista interior",
  13451. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13452. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13453. HELP_MORE_VR_A: "Modo de realidad virtual",
  13454. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13455. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13456. HELP_MORE_360_A: "360° Views",
  13457. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13458. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13459. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13460. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13461. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13462. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13463. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13464. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13465. WEBVR_LEARN_MORE: "Más información",
  13466. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13467. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13468. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13469. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13470. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13471. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13472. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13473. VR_APP: "port VR App",
  13474. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13475. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13476. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13477. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13478. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13479. VR_PREVIOUS_CAPS: "ANTERIOR",
  13480. VR_NEXT_CAPS: "SIGUIENTE",
  13481. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13482. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13483. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13484. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13485. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13486. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13487. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13488. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13489. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13490. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13491. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13492. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13493. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13494. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13495. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13496. VR_ANDROID_DVICES: "Dispositivos Android",
  13497. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13498. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13499. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13500. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13501. VR_DOWNLOAD_HERE: "Descargar aquí",
  13502. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13503. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13504. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13505. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13506. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13507. SHARE_TO: "Compartir en",
  13508. SHARE_LINK: "Enlace directo",
  13509. SHARE_EXPLORE: "Explorar ",
  13510. SHARE_AT: "en",
  13511. SHARE_WITH: "con",
  13512. SHARE_3D: " en 3D",
  13513. SHARE_COPIED: "¡Copiado!",
  13514. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13515. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13516. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13517. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13518. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13519. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13520. ERROR_GENERIC_ACTIONS_3: " o ",
  13521. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13522. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13523. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13524. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13525. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13526. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13527. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13528. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13529. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13530. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13531. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13532. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13533. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13534. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13535. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13536. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13537. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13538. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13539. LINK_TO_LOCATION: "Enlace a la ubicación",
  13540. MENU_COPY: "Copiar",
  13541. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13542. ROTATE: "Girar",
  13543. INSIDE: "Interior",
  13544. MOVE: "Moverse",
  13545. ZOOM: "Acercar o alejar"
  13546. }
  13547. }
  13548. , {}],
  13549. 113: [function(e, t, i) {//"./strings-fr-FR"
  13550. "use strict";
  13551. t.exports = {
  13552. PAGE_TITLE: "port 3D Showcase",
  13553. LOADING: "Chargement",
  13554. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13555. POWERED_BY: "alimenté par ",
  13556. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13557. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13558. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13559. PRESENTED_BY: "Présenté par ",
  13560. MORE: "Plus ",
  13561. LESS: "Moins ",
  13562. TAG_CONTENT: "Contenu tag™",
  13563. SHOW: "Montrer",
  13564. HIDE: "Cacher",
  13565. DOLLHOUSE: "Dollhouse",
  13566. FLOOR_PLAN: "Plan de sol",
  13567. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13568. CLOSE_HIGHLIGHTS: "Fermer",
  13569. PREVIOUS: "Précédent",
  13570. PLAY: "Lecture",
  13571. PAUSE: "Pause",
  13572. NEXT: "Suivant",
  13573. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13574. VIEW_DOLLHOUSE: "Voir dollhouse",
  13575. SOCIAL_SHARING: "Partager cet espace",
  13576. VIEW_IN_VR: "Voir en VR",
  13577. VIEW_FULLSCREEN: "Plein écran",
  13578. EXIT_FULLSCREEN: "Fermer plein écran",
  13579. ZOOM_IN: "Zoom avant",
  13580. ZOOM_OUT: "Zoom arrière",
  13581. FLOOR_NAME: "Étage ",
  13582. FLOOR_ALL: "Tous",
  13583. TERMS: "Mentions légales",
  13584. PORT_TERMS: "port mentions légales",
  13585. TERMS_OF_USE: "Conditions d'utilisation",
  13586. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13587. CLOSE_TERMS: "Fermer",
  13588. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13589. HELP: "Aide",
  13590. HELP_NAVIGATION_TAB: "Navigation",
  13591. HELP_MORE_HELP_TAB: "Aide",
  13592. CLOSE: "Fermer",
  13593. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13594. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13595. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13596. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13597. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13598. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13599. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13600. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13601. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13602. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13603. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13604. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13605. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13606. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13607. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13608. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13609. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13610. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13611. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13612. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13613. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13614. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13615. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13616. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13617. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13618. HELP_MORE_HLR_A: "Carrousel",
  13619. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13620. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13621. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13622. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13623. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13624. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13625. HELP_MORE_TAG_A: "tag™ Posts",
  13626. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13627. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13628. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13629. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13630. HELP_MORE_TOUR_A: "Commandes de la visite",
  13631. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13632. HELP_MORE_INSIDE_A: "Vue intérieure",
  13633. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13634. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13635. HELP_MORE_VR_A: "Mode RV",
  13636. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13637. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13638. HELP_MORE_360_A: "Vues 360°",
  13639. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13640. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13641. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13642. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13643. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13644. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13645. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13646. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13647. WEBVR_LEARN_MORE: "En savoir plus",
  13648. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13649. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13650. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13651. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13652. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13653. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13654. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13655. VR_NEXT_CAPS: "SUIVANT",
  13656. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13657. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13658. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13659. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13660. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13661. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13662. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13663. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13664. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13665. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13666. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13667. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13668. VR_APP: "port VR App",
  13669. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13670. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13671. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13672. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13673. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13674. VR_COMPATIBLE_ANDROID_LONG: "Compatible avec les écrans des appareils Android de 11,5 à 14 cm (4,5 à 5,5 po) fonctionnant sous Android OS 4.4.4 et plus",
  13675. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13676. VR_ANDROID_DVICES: "Appareils Android",
  13677. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13678. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13679. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13680. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13681. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13682. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13683. VR_DOWNLOAD_HERE: "Télécharger ici",
  13684. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13685. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13686. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13687. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13688. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13689. SHARE_TO: "Partager sur",
  13690. SHARE_LINK: "Lien direct",
  13691. SHARE_EXPLORE: "Explorer ",
  13692. SHARE_AT: "à",
  13693. SHARE_WITH: "avec",
  13694. SHARE_3D: " en 3D",
  13695. SHARE_COPIED: "Copié!",
  13696. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13697. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13698. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13699. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13700. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13701. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13702. ERROR_GENERIC_ACTIONS_3: " ou ",
  13703. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13704. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13705. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13706. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13707. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13708. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13709. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13710. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13711. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13712. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13713. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13714. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13715. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13716. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13717. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13718. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13719. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13720. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13721. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13722. MENU_COPY: "Copie",
  13723. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13724. ROTATE: "Faire pivoter",
  13725. INSIDE: "Intérieure",
  13726. MOVE: "Se déplacer",
  13727. ZOOM: "Zoom"
  13728. }
  13729. }
  13730. , {}],
  13731. 114: [function(e, t, i) {//"./strings-jp-JP"
  13732. "use strict";
  13733. t.exports = {
  13734. PAGE_TITLE: "port 3D Showcase",
  13735. LOADING: "読み込み中",
  13736. PRESENTED_BY_CAPS: "PRESENTED BY",
  13737. POWERED_BY: "powered by",
  13738. POWERED_BY_CAPS: "POWERED BY",
  13739. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13740. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13741. PRESENTED_BY: "Presented by ",
  13742. MORE: "全て表示 ",
  13743. LESS: "閉じる ",
  13744. TAG_CONTENT: "tag™コンテンツ ",
  13745. SHOW: "表示",
  13746. HIDE: "非表示",
  13747. DOLLHOUSE: "ドールハウス",
  13748. FLOOR_PLAN: "フロアプラン",
  13749. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13750. CLOSE_HIGHLIGHTS: "閉じる",
  13751. PREVIOUS: "前へ",
  13752. PLAY: "再生",
  13753. PAUSE: "一時停止",
  13754. NEXT: "次へ",
  13755. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13756. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13757. SOCIAL_SHARING: "このSpaceを共有する",
  13758. VIEW_IN_VR: "VRで表示",
  13759. VIEW_FULLSCREEN: "フルスクリーン表示",
  13760. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13761. ZOOM_IN: "ズームイン",
  13762. ZOOM_OUT: "ズームアウト",
  13763. FLOOR_NAME: "フロア ",
  13764. FLOOR_ALL: "すべて",
  13765. TERMS: "規約",
  13766. PORT_TERMS: "port規約",
  13767. TERMS_OF_USE: "利用規約",
  13768. CLOSE_TERMS: "閉じる",
  13769. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13770. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13771. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13772. WEBVR_ENTER_WEBVR: "VRに入る",
  13773. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13774. WEBVR_LEARN_MORE: "もっと詳しく",
  13775. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13776. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13777. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13778. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13779. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13780. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13781. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13782. VR_PREVIOUS_CAPS: "前へ",
  13783. VR_NEXT_CAPS: "次へ",
  13784. VR_GOT_IT_CAPS: "了解",
  13785. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13786. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13787. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13788. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13789. VR_WHAT_YOU_NEED: "必要なもの",
  13790. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13791. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13792. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13793. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13794. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13795. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13796. VR_APP: "port VRアプリ",
  13797. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13798. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13799. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13800. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13801. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13802. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13803. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13804. VR_ANDROID_DVICES: "Androidデバイス",
  13805. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13806. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13807. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13808. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13809. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13810. VR_APP_OPEN: "port VRアプリで開く",
  13811. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13812. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13813. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13814. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13815. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13816. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13817. SHARE_TO: "共有先",
  13818. SHARE_LINK: "ダイレクトリンク",
  13819. SHARE_EXPLORE: "探索",
  13820. SHARE_AT: "場所",
  13821. SHARE_WITH: "使用アプリ",
  13822. SHARE_3D: "3Dで",
  13823. SHARE_COPIED: "コピーされました!",
  13824. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13825. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13826. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13827. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13828. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13829. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13830. ERROR_GENERIC_ACTIONS_3: "または",
  13831. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13832. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13833. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13834. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13835. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13836. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13837. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13838. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13839. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13840. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13841. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13842. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13843. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13844. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13845. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13846. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13847. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13848. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13849. LINK_TO_LOCATION: "ロケーションへのリンク",
  13850. MENU_COPY: "コピー",
  13851. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13852. ROTATE: "回転",
  13853. MOVE: "移動",
  13854. INSIDE: "内側",
  13855. ZOOM: "ズーム",
  13856. HELP: "ヘルプ",
  13857. HELP_NAVIGATION_TAB: "ナビゲーション",
  13858. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13859. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13860. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13861. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13862. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13863. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13864. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13865. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13866. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13867. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13868. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13869. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13870. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13871. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13872. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13873. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13874. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13875. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13876. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13877. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13878. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13879. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13880. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13881. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13882. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13883. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13884. HELP_MORE_HLR_A: "ハイライト",
  13885. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13886. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13887. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13888. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13889. HELP_MORE_FLOORS_A: "フロアセレクター",
  13890. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13891. HELP_MORE_TAG_A: "tag™ Posts",
  13892. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13893. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13894. HELP_MORE_ZOOM_A: "ズームコントロール",
  13895. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13896. HELP_MORE_TOUR_A: "ツアーコントロール",
  13897. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13898. HELP_MORE_INSIDE_A: "内側ビュー",
  13899. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13900. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13901. HELP_MORE_VR_A: "VRモード",
  13902. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13903. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13904. HELP_MORE_360_A: "360° Views",
  13905. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13906. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13907. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13908. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13909. CLOSE: "閉じる"
  13910. }
  13911. }
  13912. , {}],
  13913. 115: [function(e, t, i) {//"./strings-ru-RU"
  13914. "use strict";
  13915. t.exports = {
  13916. PAGE_TITLE: "port 3D Showcase",
  13917. LOADING: "Загрузка",
  13918. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13919. POWERED_BY: "разработано на платформе ",
  13920. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13921. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13922. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13923. PRESENTED_BY: "Представлено ",
  13924. MORE: "Больше ",
  13925. LESS: "Меньше ",
  13926. TAG_CONTENT: "tag™ Контент",
  13927. SHOW: "Показать",
  13928. HIDE: "Скрыть",
  13929. DOLLHOUSE: "Dollhouse",
  13930. FLOOR_PLAN: "Планировка",
  13931. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13932. CLOSE_HIGHLIGHTS: "Закрыть",
  13933. PREVIOUS: "Предыдущий",
  13934. PLAY: "Воспроизвести",
  13935. PAUSE: "Пауза",
  13936. NEXT: "Следующий",
  13937. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13938. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13939. SOCIAL_SHARING: "Поделиться этой моделью",
  13940. VIEW_IN_VR: "Посмотреть в VR",
  13941. VIEW_FULLSCREEN: "Полный экран",
  13942. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13943. ZOOM_IN: "Увеличить",
  13944. ZOOM_OUT: "Уменьшить",
  13945. FLOOR_NAME: "Этаж ",
  13946. FLOOR_ALL: "Все",
  13947. TERMS: "Условия",
  13948. PORT_TERMS: "Правила пользования",
  13949. TERMS_OF_USE: "Условия использования",
  13950. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13951. CLOSE_TERMS: "Закрыть",
  13952. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13953. HELP: "Помощь",
  13954. HELP_NAVIGATION_TAB: "Навигация",
  13955. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13956. CLOSE: "Закрыть",
  13957. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13958. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13959. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13960. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13961. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13962. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13963. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13964. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13965. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13966. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13967. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13968. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13969. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13970. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13971. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13972. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13973. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13974. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13975. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13976. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13977. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13978. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13979. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13980. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13981. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13982. HELP_MORE_HLR_A: "Фотоколлаж",
  13983. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13984. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13985. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13986. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13987. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13988. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13989. HELP_MORE_TAG_A: "tag™ Posts",
  13990. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13991. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13992. HELP_MORE_ZOOM_A: "Масштаб",
  13993. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13994. HELP_MORE_TOUR_A: "Управление Туром",
  13995. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13996. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13997. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13998. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13999. HELP_MORE_VR_A: "Режим VR",
  14000. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14001. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14002. HELP_MORE_360_A: "360° Views",
  14003. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14004. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14005. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14006. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14007. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14008. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14009. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14010. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14011. WEBVR_LEARN_MORE: "Узнать больше",
  14012. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14013. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14014. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14015. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14016. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14017. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14018. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14019. VR_APP: "port VR App",
  14020. VR_APP_OPEN: "Или открыть через приложение port VR",
  14021. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14022. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14023. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14024. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14025. VR_VIEW_SPACE: "Запустить модель в VR",
  14026. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14027. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14028. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14029. VR_GOT_IT_CAPS: "ЯСНО",
  14030. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14031. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14032. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14033. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14034. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14035. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14036. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14037. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14038. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14039. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14040. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14041. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14042. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14043. VR_ANDROID_DVICES: "Android устройства",
  14044. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14045. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14046. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14047. VR_DOWNLOAD_HERE: "Скачать здесь",
  14048. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14049. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14050. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14051. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14052. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14053. SHARE_TO: "Поделиться",
  14054. SHARE_LINK: "Прямая ссылка",
  14055. SHARE_EXPLORE: "просмотреть",
  14056. SHARE_AT: "на",
  14057. SHARE_WITH: "с",
  14058. SHARE_3D: "в 3D",
  14059. SHARE_COPIED: "Скопировано!",
  14060. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14061. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14062. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14063. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14064. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14065. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14066. ERROR_GENERIC_ACTIONS_3: " или ",
  14067. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14068. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14069. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14070. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14071. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14072. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14073. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14074. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14075. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14076. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14077. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14078. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14079. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14080. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14081. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14082. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14083. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14084. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14085. LINK_TO_LOCATION: "Ссылка на местоположение",
  14086. MENU_COPY: "Копировать",
  14087. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14088. ROTATE: "Вращать",
  14089. MOVE: "Передвигаться",
  14090. INSIDE: "Вид изнутри",
  14091. ZOOM: "Масштаб"
  14092. }
  14093. }
  14094. , {}],
  14095. "dom":[function(t, e){//改 xzw
  14096. e.exports = {
  14097. addClass:function(elem,className){if(elem.className===undefined){elem.className=className;}else if(elem.className!==className){var classes=elem.className.split(/ +/);if(classes.indexOf(className)==-1){classes.push(className);elem.className=classes.join(' ').replace(/^\s+/,'').replace(/\s+$/,'');}}}
  14098. ,removeClass:function(elem,className){if(className){if(elem.className===undefined){}else if(elem.className===className){elem.removeAttribute('class');}else{var classes=elem.className.split(/ +/);var index=classes.indexOf(className);if(index!=-1){classes.splice(index,1);elem.className=classes.join(' ');}}}else{elem.className=undefined;}}
  14099. ,hasClass:function(elem,className){return new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)').test(elem.className)||false;}
  14100. ,bind:function(elem,event,func,bool){bool=bool||false;if(elem.addEventListener)elem.addEventListener(event,func,bool);else if(elem.attachEvent)elem.attachEvent('on'+event,func);}
  14101. ,unbind:function(elem,event,func,bool){bool=bool||false;if(elem.removeEventListener)elem.removeEventListener(event,func,bool);else if(elem.detachEvent)elem.detachEvent('on'+event,func);}
  14102. ,id:function(id,elem){elem=elem||document;var result=elem.getElementById&&elem.getElementById(id);return result||document.getElementById(id);}
  14103. ,Tag:function(name,elem){elem=elem||document;return elem.getElementsByTagName(name);}
  14104. ,cla:function(name,elem){elem=elem||document;return elem.getElementsByClassName(name);}
  14105. ,ifVoid:function(v,b){if(v==void 0){return b;}else{return v;}}
  14106. ,clamp:function(value,min,max){if(min===void 0){min=0;}if(max===void 0){max=1;}return Math.min(max,Math.max(min,value));}
  14107. ,getIndex:function(elem,index){index=index||'index';return elem.getAttributeNode(index)&&elem.getAttributeNode(index).nodeValue;}
  14108. ,setIndex:function(elem,name){elem.setAttribute('index',name);}
  14109. ,findParent:function(child,parent){ var a = child; do{ if(a == parent)return true; a = a.parentElement; }while(a); return false; }
  14110. ,findParents:function(child,o){var a=child;do{for(var i=0;i<o.length;i++){switch(o[i].type){case"node":if(a==o[i].obj)return true;break; case"class":if(a.className==o[i].obj)return true;break; case"tag":/* if(a.nodeName)console.log(a.nodeName);else console.log(a); */ if(a.nodeName.toUpperCase()==o[i].obj.toUpperCase())return true;}}a=a.parentElement;}while(a);return false;}
  14111. };
  14112. }, {}
  14113. ],
  14114. "scaleImg":[function(t, e){//改 xzw
  14115. var OUTPUT = e;
  14116. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  14117. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  14118. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  14119. return G.getImageData(0,0,s,f)}
  14120. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  14121. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  14122. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  14123. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  14124. else
  14125. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  14126. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  14127. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  14128. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  14129. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  14130. W=new Float32Array(at);else
  14131. for(W=[],et=0;at>et;++et)
  14132. W[et]=0;for(b=0;w>b;b++)
  14133. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  14134. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  14135. delete p,h(),J=n(W)}
  14136. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  14137. if("png-src"===i||"jpeg-src"===i)
  14138. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  14139. return B}
  14140. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  14141. OUTPUT.exports = c;
  14142. }, {}
  14143. ],
  14144. "ScrollBar":[function(t, e){//改 xzw
  14145. var dom = t("dom");
  14146. var ScrollBar = function(root,value,min,max,name,unitStr,onchange){//unitStr是单位字符串,比如角度的°。不能是数字
  14147. var scope = this;
  14148. this.name = name;
  14149. this.value = value;
  14150. this.min = min || 0;
  14151. this.max = max || 100;
  14152. var div = document.createElement('div');
  14153. div.innerHTML = '<div class="Main"><div class="scrollBar"><div class="scroll_Track"></div><div class="scroll_Thumb"></div></div><div class="BarTxt"><input class="scrollBarTxt"></div>';
  14154. dom.addClass(div,"slider");
  14155. root.appendChild(div);
  14156. this.line = dom.cla("scrollBar", div)[0];
  14157. this.knot = dom.cla("scroll_Thumb",div)[0];
  14158. this.textArea = dom.cla("scrollBarTxt",div)[0];
  14159. this.track = dom.cla("scroll_Track",div)[0];
  14160. this.unitStr = unitStr;
  14161. this.onchange = onchange;
  14162. this.percent = null;
  14163. this.dragStart = false;
  14164. this.offsetToBody = null;
  14165. this.getOffset();
  14166. this.checkError();
  14167. this.percent = this.getPercent();
  14168. this.displayValue(value);
  14169. this.moveKnot();
  14170. this.knotWidth = 0;
  14171. this.lineWidth = 0;
  14172. dom.bind(this.line,"mousedown",function(event){
  14173. scope.dragStart = true;
  14174. scope.dragChange(event);
  14175. });
  14176. dom.bind(document,"mouseup",function(event){
  14177. if(scope.dragStart){
  14178. scope.dragStart = false;
  14179. //webview.updateView(false,false)//为了抗锯齿
  14180. }
  14181. })
  14182. dom.bind(document,"mousemove",function(event){
  14183. if(scope.dragStart){
  14184. scope.dragChange(event);
  14185. }
  14186. });
  14187. dom.bind(this.line,"touchstart",function(event){
  14188. scope.dragStart = true;
  14189. scope.dragChange(event);
  14190. });
  14191. dom.bind(document,"touchend",function(event){
  14192. if(scope.dragStart){
  14193. scope.dragStart = false;
  14194. //webview.updateView(false,false)//为了抗锯齿
  14195. }
  14196. })
  14197. dom.bind(document,"touchmove",function(event){
  14198. if(scope.dragStart){
  14199. scope.dragChange(event);
  14200. }
  14201. });
  14202. dom.bind(this.textArea,"change",function(){
  14203. var v = parseFloat(scope.textArea.value);
  14204. if(v!=v) return; //NaN
  14205. scope.setValueFromOutside(v);
  14206. });
  14207. }
  14208. ScrollBar.prototype.getOffset = function(){ //用prototype减少了内存近5M
  14209. var left = this.line.offsetLeft;
  14210. var element = this.line;
  14211. while(element = element.offsetParent){
  14212. left += element.offsetLeft;
  14213. }
  14214. this.offsetToBody = (left==0)?(this.offsetToBody||0):left;//如果left为0,很可能是它不可见,那么最好使用旧的offsetToBody
  14215. }
  14216. ScrollBar.prototype.checkError = function(){
  14217. if(this.min>=this.max){
  14218. console.log("scrollbar值有误 "+name);
  14219. return;
  14220. }
  14221. }
  14222. ScrollBar.prototype.getPercent = function(){
  14223. return (this.value-this.min)/(this.max-this.min);
  14224. }
  14225. ScrollBar.prototype.displayValue = function(){
  14226. this.textArea.value = this.value + ( this.unitStr ? " "+this.unitStr : "");
  14227. }
  14228. ScrollBar.prototype.getWidth = function(){//不可见时clientWidth=0
  14229. this.knotWidth ||(this.knotWidth = this.knot.clientWidth);
  14230. this.lineWidth ||(this.lineWidth = this.line.clientWidth - this.knotWidth);
  14231. }
  14232. ScrollBar.prototype.moveKnot = function(){
  14233. this.getWidth();
  14234. var width = this.percent * this.lineWidth;
  14235. this.knot.style.left = width + "px";
  14236. if(this.track) this.track.style.width = width + this.knotWidth/2 + "px";
  14237. };
  14238. ScrollBar.prototype.bind = function(f){
  14239. this.onchange = f;
  14240. }
  14241. ScrollBar.prototype.setValue = function(v){
  14242. //if(this.value==v)return; //因为换选材质需要执行后面onchange才会带动preview的改变,所以这里一样还是执行,而拉动滑动条的部分值不变就不执行
  14243. this.value = Math.round(v);
  14244. this.percent = this.getPercent();
  14245. this.moveKnot();
  14246. if(this.onchange) this.onchange(this.value);
  14247. this.displayValue();
  14248. //webview.drawScene2();
  14249. //webview.updateView(true,false,1);
  14250. }
  14251. ScrollBar.prototype.dragChange = function(event){
  14252. this.getWidth();
  14253. if(!this.offsetToBody)this.getOffset();
  14254. if(event.clientX != void 0){
  14255. this.percent = (event.clientX - this.knotWidth/2 - this.offsetToBody) / this.lineWidth ;
  14256. }
  14257. else{
  14258. this.percent = (event.touches[0].clientX - this.knotWidth/2 - this.offsetToBody) / this.lineWidth ;
  14259. }
  14260. if( this.percent < 0) this.percent = 0;
  14261. else if( this.percent > 1) this.percent = 1;
  14262. //var v = this.percent * this.max;
  14263. var v = Math.round(this.percent * (this.max-this.min) + this.min);
  14264. //var v = Math.round(this.percent * this.max * 10)/10; //精度为0.1
  14265. if(this.value==v)return;
  14266. this.setValue(v);
  14267. }
  14268. ScrollBar.prototype.setValueFromOutside = function(v){ //外面的事件触发的
  14269. if(this.line.clientWidth == 0) return;//不可见就不执行。
  14270. //v = Math.round(v*10)/10;
  14271. v = dom.clamp(v, this.min, this.max);
  14272. this.setValue(v);
  14273. //webview.updateView(false,false);//drawScene4times();
  14274. }
  14275. e.exports = ScrollBar;
  14276. }, {
  14277. "dom": "dom"
  14278. }],
  14279. "List":[function(t, e){//改 xzw
  14280. var dom = t("dom");
  14281. var List = function(list, select, fuc, o){
  14282. var options = dom.Tag("ul",select.parentNode)[0];
  14283. var removeExtraStr = function(str){//针对ie
  14284. return str.replace("\r","").replace("\n","").replace("\t","");
  14285. }
  14286. if(list.length === 0) list.push("空");
  14287. for(var i=0; i<list.length; i++){
  14288. var li = document.createElement("li");
  14289. //getIndex(li) = matList[i];
  14290. li.innerHTML = list[i];
  14291. options.appendChild(li);
  14292. }
  14293. if(o && o.option){
  14294. select.innerHTML = o.option;
  14295. }else if(o && !o.option && o.initOption){
  14296. select.innerHTML = o.initOption;
  14297. }else
  14298. select.innerHTML = list[0];
  14299. var over1 = false;
  14300. var over2 = false;
  14301. var focus = false; //标记标题是否要高亮
  14302. var over3 = false; //标记options的子物体
  14303. var headDown = false; //标记标题是否被按下且未离开标题,准备松开
  14304. //for(var i=0; i<)
  14305. dom.bind(select,"mouseover",function(){
  14306. dom.addClass(select,"focus");
  14307. over1 = true;
  14308. })
  14309. dom.bind(select,"mouseout",function(){
  14310. if(!focus)dom.removeClass(select,"focus");
  14311. over1 = false;
  14312. headDown = false;
  14313. })
  14314. dom.bind(options,"mouseover",function(event){
  14315. over2 = true;
  14316. for(var i=0; i<options.children.length; i++){//不直接用:hover是因为在拖动时不起作用
  14317. dom.removeClass(options.children[i],"hover");
  14318. }
  14319. var elem = event.target;
  14320. over3 = false;
  14321. while(elem.nodeName != "LI"){
  14322. elem = elem.parentElement;
  14323. over3 = true; //标记一下在子元素内
  14324. }
  14325. dom.addClass(elem,"hover");
  14326. })
  14327. dom.bind(options,"mouseout",function(){
  14328. over2 = false;
  14329. over3 = false;
  14330. })
  14331. dom.bind(document,"mousedown",function(event){
  14332. if(over1){ //在标题处
  14333. headDown = true;
  14334. focus = true;
  14335. dom.addClass(select,"focus");
  14336. }
  14337. else if(!over2 && !over3){ //在标题和选项(包括选项子元素)以外的地方 一旦点下即消失
  14338. dom.addClass(options,"hide");
  14339. dom.removeClass(select,"focus");
  14340. focus = false;
  14341. }
  14342. })
  14343. dom.bind(document,"mouseup",function(event){
  14344. if(over1){ //在标题处
  14345. if(dom.hasClass(options,"hide") && headDown){//只有在标题已经按下再松开才能显示子项
  14346. dom.removeClass(options,"hide");
  14347. for(var i=0; i<options.children.length; i++){ //下次打开时高亮选中项
  14348. if(options.children[i].innerText === select.innerText){
  14349. dom.addClass(options.children[i],"hover");
  14350. }else{
  14351. dom.removeClass(options.children[i],"hover");
  14352. }
  14353. }
  14354. }
  14355. else if(!dom.hasClass(options,"hide")){//消失则无headDown限制
  14356. dom.addClass(options,"hide");
  14357. }
  14358. }
  14359. else if( over2 || over3){ //在选项处松开鼠标
  14360. //if(select.innerText !== event.target.innerText){//注释掉的话即使点击的和当前的相同也执行,主要是高亮要执行,其他不用。这样分开两个函数其实也可以
  14361. var elem = event.target;
  14362. while(elem.nodeName != "LI"){
  14363. elem = elem.parentElement;
  14364. }
  14365. if(!fuc || elem.innerText == "空" || (o&&o.noCallback))select.innerText = removeExtraStr(elem.innerText);
  14366. if(elem.innerText !== "空"){
  14367. if(fuc) fuc(removeExtraStr(elem.innerText),dom.getIndex(select),function(){select.innerText = removeExtraStr(elem.innerText);})
  14368. }
  14369. //}
  14370. dom.removeClass(elem,"hover");
  14371. dom.addClass(options,"hide");
  14372. dom.removeClass(select,"focus");
  14373. focus = false;
  14374. }
  14375. else if(!over2 && !over3){ //在标题和选项(包括选项子元素)以外的地方 松开也消失
  14376. dom.addClass(options,"hide");
  14377. dom.removeClass(select,"focus");
  14378. focus = false;
  14379. }
  14380. })
  14381. this.getValue = function(){
  14382. return select.innerHTML;
  14383. }
  14384. this.selectFromOutSide = function(name){//不通过点击,由于其他操作而选择
  14385. select.innerText = name;
  14386. if(fuc) fuc(name);//fuc(o,dom.getIndex(select),function(){select.innerText = name;})
  14387. }
  14388. }
  14389. e.exports = List;
  14390. }, {
  14391. "dom": "dom"
  14392. }],
  14393. "Hotspot":[//改 xzw
  14394. function(t, e){
  14395. function Hotspot(o){
  14396. this.pos3d = o.pos3d;
  14397. this.player = o.player;
  14398. this.state = "static";//即hover时不会展开
  14399. this.clickFuc = false;
  14400. this.elem = document.createElement('div');
  14401. this.title = o.title || "";
  14402. this.content = o.content || "";
  14403. this.type = o.type;
  14404. //this.setElemType(o.type);
  14405. dom.addClass(this.elem, "markspot");
  14406. dom.id('hotspot').appendChild(this.elem);
  14407. this.player.allHotspots.push(this);
  14408. //this.index = o.index;
  14409. //this.hasUpLoadImg = o.hasUpLoadImg || false;
  14410. if(o.imgSrc){this.img = new Image; this.img.src = o.imgSrc; /* this.oldImgsrc = o.imgSrc; */}
  14411. //if(o.posGets) this.setPosGets(o.posGets);
  14412. //this.scale1 = dom.ifVoid(o.scale1, 1);
  14413. //this.scale2 = dom.ifVoid(o.scale2, 1);
  14414. }
  14415. Hotspot.prototype.becomeReal = function(){//变成非markspos 具有real的效果
  14416. this.player.allHotspots = [];
  14417. this.elem.parentElement.removeChild(this.elem);
  14418. this.player.model.spotCreatedNum++;
  14419. var tag = new Tag(this.player.model, this.player.model.spotCreatedNum,{
  14420. label : this.title,
  14421. description : this.content,
  14422. //media :
  14423. posGets:this.player.posGets,
  14424. position: this.pos3d,
  14425. type: this.type
  14426. })
  14427. tag.build();
  14428. tag.bindEvents();
  14429. this.player.model.tags[this.player.model.spotCreatedNum] = tag;
  14430. this.player.tagManager.getTag(tag);
  14431. //this.player.editor.exchangeTagForSave(tag); //反正一定要加标题的就加标题时保存
  14432. return tag;
  14433. }
  14434. Hotspot.prototype.enlarge = function(){
  14435. var img = new Image;
  14436. img.src = this.img ? this.img.src : "images/default.jpg";
  14437. var outLayer = dom.id("spotLarge");
  14438. var imgBox = dom.cla("inner",outLayer)[0];
  14439. imgBox.appendChild(img);
  14440. var oldImg = dom.cla("replaceImg",this.elem)[0];
  14441. var rect = this.player.imgRect = oldImg.getBoundingClientRect();
  14442. dom.removeClass(outLayer,"hide")
  14443. imgBox.style.left = rect.left + "px";
  14444. imgBox.style.top = rect.top - (window.innerHeight - this.player.domElement.clientHeight) + "px";
  14445. imgBox.style.width = rect.width + "px";
  14446. imgBox.style.height = rect.height + "px";
  14447. setTimeout(function(){
  14448. var r1 = imgBox.clientWidth / imgBox.clientHeight;
  14449. var r2 = this.player.domElement.clientWidth/ this.player.domElement.clientHeight;
  14450. var percent = 0.95;
  14451. var naturalScale = 1.5;//不得大于natural的倍数
  14452. if( r1 >= r2 ){
  14453. var w = Math.min( this.player.domElement.clientWidth * percent, img.naturalWidth * naturalScale);
  14454. imgBox.style.width = w + "px";
  14455. imgBox.style.height = w / r1 + "px";
  14456. }else{
  14457. var h = Math.min( this.player.domElement.clientHeight * percent, img.naturalHeight * naturalScale);
  14458. imgBox.style.height = h + "px";
  14459. imgBox.style.width = h * r1 + "px";
  14460. }
  14461. imgBox.style.left = "50%";
  14462. imgBox.style.top = "50%";
  14463. dom.addClass(outLayer,"center");
  14464. }.bind(this),50)
  14465. }
  14466. Hotspot.prototype.setPosGets = function(posGets){
  14467. this.posGets = {list:[],length:2};
  14468. for(var i in posGets){
  14469. this.posGets[i] = new THREE.Vector3().fromArray(posGets[i]);
  14470. this.posGets.list.push(i);
  14471. }
  14472. }
  14473. /* Hotspot.prototype.computeHotPos = function(){//计算真实位置。采集和最终呈现的符合度和 采集的2点的符合度成正比。 原始版本 易于理解
  14474. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14475. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14476. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14477. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14478. var Fraction = algebra.Fraction;
  14479. var Expression = algebra.Expression;
  14480. var Equation = algebra.Equation;
  14481. var Num = function(num){if(num>0) return "+"+num; else return num;}
  14482. var a11 = algebra.parse("x" + Num(-A.x) +"=" +(p1.x-A.x)+"a");
  14483. var answer11 = a11.solveFor("x");//得到x的函数1,变量为a
  14484. var a12 = algebra.parse("x" + Num(-B.x) +"=" +(p2.x-B.x)+"b");
  14485. var answer12 = a12.solveFor("x");//得到x的函数2,变量为b
  14486. var eq = new Equation(answer11, answer12); //得到表达式,变量为a和b
  14487. var aOfb1 = eq.solveFor("a");//得到a的函数1,变量为b
  14488. var a21 = algebra.parse("z" + Num(-A.z) +"=" +(p1.z-A.z)+"a");
  14489. var answer21 = a21.solveFor("z");//得到z的函数1,变量为a
  14490. var a22 = algebra.parse("z" + Num(-B.z) +"=" +(p2.z-B.z)+"b");
  14491. var answer22 = a22.solveFor("z");//得到z的函数2,变量为a
  14492. var eq = new Equation(answer21, answer22);//得到表达式,变量为a和b
  14493. var aOfb2 = eq.solveFor("a");//得到a的函数2,变量为b
  14494. var eq2 = new Equation(aOfb1, aOfb2);//得到表达式,变量为b
  14495. var b = eq2.solveFor("b");//得到b
  14496. eq = eq.eval({//b代入表达式
  14497. b: b
  14498. });
  14499. var a = eq.solveFor("a");//得到a
  14500. eq = a11.eval({
  14501. a:a
  14502. });
  14503. var x = eq.solveFor("x").valueOf();
  14504. eq = a21.eval({
  14505. a:a
  14506. });
  14507. var z = eq.solveFor("z").valueOf();
  14508. var y = a * (p1.y-A.y) + A.y;
  14509. this.pos3d = new THREE.Vector3(x, y, z);
  14510. } */
  14511. //二维向量夹角
  14512. /* function angleTo(a,b){ var c = a.dot(b)/(a.length()*b.length()); return Math.acos(THREE.Math.clamp(c,-1,1))}
  14513. Hotspot.prototype.computeHotPos1 = function(){//取最大角度版本 并不是最正确的
  14514. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14515. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14516. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14517. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14518. var Fraction = algebra.Fraction;
  14519. var Expression = algebra.Expression;
  14520. var Equation = algebra.Equation;
  14521. var axis = ["x", "y", "z"];
  14522. var angles = [];
  14523. var minAngle;
  14524. for(var i=0;i<3;i++){
  14525. var AxisChosen = [];
  14526. for(var j=0;j<3;j++){
  14527. if(i!=j)AxisChosen.push(axis[j])
  14528. }
  14529. AxisChosen.push(axis[i]);
  14530. var v1 = new THREE.Vector2( p1[AxisChosen[0]] - A[AxisChosen[0]], p1[AxisChosen[1]] - A[AxisChosen[1]]);
  14531. var v2 = new THREE.Vector2( p2[AxisChosen[0]] - B[AxisChosen[0]], p2[AxisChosen[1]] - B[AxisChosen[1]]);
  14532. var angle = angleTo(v1, v2);
  14533. angles.push(angle);
  14534. console.log("角度"+AxisChosen[0] + AxisChosen[1] +": "+ angles[i]/Math.PI*180)
  14535. }
  14536. var mA = 0, index;
  14537. for(var i=0;i<3;i++){
  14538. if(angles[i]>mA) mA = angles[i], index = i;
  14539. }
  14540. if(mA<minAngle) console.log("最大角度为: "+mA/Math.PI*180+ ", 过小")
  14541. var AxisChosen = [];
  14542. for(var j=0;j<3;j++){
  14543. if(index!=j)AxisChosen.push(axis[j]);
  14544. }
  14545. AxisChosen.push(axis[index]);
  14546. console.log('选择面:'+ AxisChosen[0] + AxisChosen[1] +", 最大角度为: "+mA/Math.PI*180)
  14547. var results = [0,0,0];
  14548. var Num = function(num){if(num>0) return "+"+num; else return num;}
  14549. var a11 = algebra.parse("x" + Num(-A[AxisChosen[0]]) +"=" +(p1[AxisChosen[0]]-A[AxisChosen[0]])+"a");
  14550. var answer11 = a11.solveFor("x");//得到x的函数1,变量为a
  14551. var a12 = algebra.parse("x" + Num(-B[AxisChosen[0]]) +"=" +(p2[AxisChosen[0]]-B[AxisChosen[0]])+"b");
  14552. var answer12 = a12.solveFor("x");//得到x的函数2,变量为b
  14553. var eq = new Equation(answer11, answer12); //得到表达式,变量为a和b
  14554. var aOfb1 = eq.solveFor("a");//得到a的函数1,变量为b
  14555. var a21 = algebra.parse("z" + Num(-A[AxisChosen[1]]) +"=" +(p1[AxisChosen[1]]-A[AxisChosen[1]])+"a");
  14556. var answer21 = a21.solveFor("z");//得到z的函数1,变量为a
  14557. var a22 = algebra.parse("z" + Num(-B[AxisChosen[1]]) +"=" +(p2[AxisChosen[1]]-B[AxisChosen[1]])+"b");
  14558. var answer22 = a22.solveFor("z");//得到z的函数2,变量为a
  14559. var eq = new Equation(answer21, answer22);//得到表达式,变量为a和b
  14560. var aOfb2 = eq.solveFor("a");//得到a的函数2,变量为b
  14561. var eq2 = new Equation(aOfb1, aOfb2);//得到表达式,变量为b
  14562. var b = eq2.solveFor("b");//得到b
  14563. eq = eq.eval({//b代入表达式
  14564. b: b
  14565. });
  14566. var a = eq.solveFor("a");//得到a
  14567. eq = a11.eval({
  14568. a:a
  14569. });
  14570. results[0] = eq.solveFor("x").valueOf();
  14571. eq = a21.eval({
  14572. a:a
  14573. });
  14574. results[1] = eq.solveFor("z").valueOf();
  14575. var rest1 = a * (p1[AxisChosen[2]]-A[AxisChosen[2]]) + A[AxisChosen[2]];
  14576. var rest2 = b * (p2[AxisChosen[2]]-B[AxisChosen[2]]) + B[AxisChosen[2]];
  14577. results[2] = (rest1 + rest2) / 2;
  14578. this.pos3d = new THREE.Vector3;
  14579. for(var i=0;i<3;i++){
  14580. this.pos3d[AxisChosen[i]] = results[i];
  14581. }
  14582. console.log(this.pos3d);
  14583. } */
  14584. /* Hotspot.prototype.computeHotPos = function(){//取两线最短线段中心点 有问题
  14585. //this.computeHotPos1();
  14586. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14587. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14588. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14589. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14590. var line1 = p1.clone().sub(A);
  14591. var line2 = p2.clone().sub(B);
  14592. var verti = line1.clone().cross(line2);
  14593. var t1 = B.clone().sub(A).cross(line1).dot( verti ) / Math.pow(verti.length(),2);
  14594. var t2 = B.clone().sub(A).cross(line2).dot( verti ) / Math.pow(verti.length(),2);
  14595. var mid1 = line1.clone().multiplyScalar(t1).add(A);
  14596. var mid2 = line2.clone().multiplyScalar(t2).add(B);
  14597. this.pos3d = mid1.clone().add(mid2).multiplyScalar(0.5);
  14598. //此方法借用网上的
  14599. //source:https://blog.csdn.net/zyf_2014/article/details/52863677 }
  14600. //console.log(this.pos3d);
  14601. } */
  14602. var IsEqual = function(d1, d2) {
  14603. return (Math.abs(d1 - d2) < 1e-7)
  14604. }
  14605. var getAngle = function(cos){
  14606. return Math.acos(cos) * 180 / Math.PI
  14607. }
  14608. Hotspot.prototype.computeHotPos = function(){//取两线最短线段中心点 并且不能超出起点
  14609. var p1 = this.player.posGets[this.player.posGets.list[0]]; //得到的热点位置可能在mesh外而且很远,因为可视范围是比盒子要大的。
  14610. var p2 = this.player.posGets[this.player.posGets.list[1]];
  14611. var A = this.player.model.panos.index[this.player.posGets.list[0]].origin;
  14612. var B = this.player.model.panos.index[this.player.posGets.list[1]].origin;
  14613. //调试热点夹角
  14614. /* var line1 = p1.clone().sub(A).normalize();
  14615. var line2 = p2.clone().sub(B).normalize();
  14616. var cos1 = Math.abs( line1.dot(line2) );
  14617. var pano = this.player.model.panos.index[this.player.posGets.list[1]]
  14618. console.log("真实两线夹角: "+getAngle(cos1) +"("+ cos1+")"+""+"旧夹角min: "+getAngle(pano.recentAngleScore)+"("+pano.recentAngleScore+")");
  14619. *///----------
  14620. var ux = p1.x - A.x;
  14621. var uy = p1.y - A.y;
  14622. var uz = p1.z - A.z;
  14623. var vx = p2.x - B.x;
  14624. var vy = p2.y - B.y;
  14625. var vz = p2.z - B.z;
  14626. var wx = A.x - B.x;
  14627. var wy = A.y - B.y;
  14628. var wz = A.z - B.z;
  14629. var a = (ux * ux + uy * uy + uz * uz); //u*u
  14630. var b = (ux * vx + uy * vy + uz * vz); //u*v
  14631. var c = (vx * vx + vy * vy + vz * vz); //v*v
  14632. var d = (ux * wx + uy * wy + uz * wz); //u*w
  14633. var e = (vx * wx + vy * wy + vz * wz); //v*w
  14634. var dt = a * c - b * b;
  14635. var sd = dt;
  14636. var td = dt;
  14637. var sn = 0.0;//sn = be-cd
  14638. var tn = 0.0;//tn = ae-bd
  14639. var behind = function(index){ //在后方交点的话,直接其中一个点 不用两posget点中心点是因为可能从不同方位 距离很大
  14640. this.pos3d = (index==1 ? p1 : p2).clone();
  14641. console.log(this.pos3d+" 在后方交点,使用点"+index);
  14642. }
  14643. if(IsEqual(dt, 0.0))
  14644. {
  14645. //两直线平行
  14646. sn = 0.0; //在s上指定取s0
  14647. sd = 1.00; //防止计算时除0错误
  14648. tn = e; //按(公式3)求tc
  14649. td = c;
  14650. }else{
  14651. sn = (b * e - c * d);
  14652. tn = (a * e - b * d);
  14653. if (sn < 0.0) {
  14654. //最近点在s起点以外,同平行条件
  14655. behind(1); return;
  14656. sn = 0.0;
  14657. tn = e;
  14658. td = c;
  14659. }else if (sn > sd){ //超出终点不限制
  14660. /* //最近点在s终点以外(即sc>1,则取sc=1)
  14661. sn = sd;
  14662. tn = e + b; //按(公式3)计算
  14663. td = c; */
  14664. }
  14665. }
  14666. if (tn < 0.0 ){
  14667. //最近点在t起点以外
  14668. behind(2); return;
  14669. tn = 0.0;
  14670. if (-d < 0.0) sn = 0.0; //按(公式2)计算,如果等号右边小于0,则sc也小于零,取sc=0
  14671. else if (-d > a) sn = sd;//按(公式2)计算,如果sc大于1,取sc=1
  14672. else{
  14673. sn = -d;
  14674. sd = a;
  14675. }
  14676. }
  14677. /* else if (tn > td){ //超出终点不限制
  14678. tn = td;
  14679. if ((-d + b) < 0.0)
  14680. sn = 0.0;
  14681. else if ((-d + b) > a)
  14682. sn = sd;
  14683. else
  14684. {
  14685. sn = (-d + b);
  14686. sd = a;
  14687. }
  14688. } */
  14689. sc = 0.0;
  14690. tc = 0.0;
  14691. if (IsEqual(sn, 0.0)) sc = 0.0;
  14692. else sc = sn / sd;
  14693. if (IsEqual(tn, 0.0)) tc = 0.0;
  14694. else tc = tn / td;
  14695. var mid1 = new THREE.Vector3(A.x + sc * ux, A.y + sc * uy, A.z + sc * uz )
  14696. var mid2 = new THREE.Vector3(B.x + tc * vx, B.y + tc * vy, B.z + tc * vz )
  14697. this.pos3d = mid1.clone().add(mid2).multiplyScalar(0.5);
  14698. //console.log(this.pos3d)
  14699. //https://blog.csdn.net/u011511587/article/details/52063663 三维空间两直线/线段最短距离、线段计算算法
  14700. }
  14701. Hotspot.prototype.updateHotspot2dPos = function(){
  14702. if(!this.pos3d) return;
  14703. if(this.state == "drag") return;
  14704. if(this.elem.style.display == "none") return;
  14705. if(this.elem.parentElement.style.opacity == "0") return;
  14706. var pos3d = this.pos3d.clone().applyMatrix4(this.player.model.matrixWorld);
  14707. var camera = this.player.camera;
  14708. var modelViewMatrix = camera.matrixWorldInverse.clone();
  14709. var distance = this.player.position.distanceTo(pos3d);
  14710. var near = -camera.projectionMatrix.elements[14];//最开始飞入的时候是transitioning 也显示热点 所以还是不访问camera.near了
  14711. var matrix = new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix,modelViewMatrix);
  14712. var pos3d2 = pos3d.applyMatrix4( matrix );
  14713. if(pos3d2.z<-near){//? 有<0但是应该显示的情况,遂改成更小的
  14714. dom.addClass(this.elem, "hide");
  14715. return;//不可被渲染,否则会出现另一个点
  14716. }
  14717. dom.removeClass(this.elem, "hide");
  14718. //floorplan(+2*near)的near:2.008/2 doll的 2.008 pano:0.20004
  14719. if(this.player.mode == "floorplan" || (this.player.mode =="transitioning" &&
  14720. (this.player.modeTran == "floorplan-dollhouse" || this.player.modeTran == "dollhouse-floorplan"))){
  14721. var x = pos3d2.x / (pos3d2.z+2.008);
  14722. var y = pos3d2.y / (pos3d2.z+2.008);
  14723. }else{
  14724. var x = pos3d2.x / (pos3d2.z+near );
  14725. var y = pos3d2.y / (pos3d2.z+near );
  14726. }
  14727. this.transformX = (x + 1)/2 * this.player.domElement.clientWidth;
  14728. //this.transformY = (1-(y + 1)/2) * this.player.domElement.clientHeight + (window.innerHeight - this.player.domElement.clientHeight);
  14729. this.transformY = (1-(y + 1)/2) * this.player.domElement.clientHeight;
  14730. var s;
  14731. /* if(this.state==="real" || this.state==="hover" )
  14732. if(pos3d2.z<=this.player.bound){
  14733. var s = this.player.k * pos3d2.z + this.player.max;
  14734. }else{
  14735. var s = 0.1/(pos3d2.z-this.player.bound+1) + this.player.min;
  14736. } */
  14737. /* if(this.state==="real" || this.state==="hover" ){
  14738. if(distance<=this.player.minD)
  14739. var s = this.player.max;
  14740. else var s = this.player.min + this.player.k * Math.pow(this.player.step, distance);
  14741. } */
  14742. if(this.state === "real"){
  14743. var s = this.scale1 * this.player.k / distance;
  14744. }else if( this.state === "hover" || this.state === "pin"){
  14745. var s = this.scale1 * this.scale2 * this.player.k / distance;
  14746. }
  14747. this.elem.style.transform = "translateX("+this.transformX + "px) translateY("+ this.transformY + "px) translateZ(0px)"
  14748. +((this.state==="real" || ((this.state==="hover"||this.state==="pin")&& s>this.scale1) ) ? (" scale("+s+","+s+")") : "");//如果hover/pin时是放大的继续放大,缩小的不缩小。因为由放大变成不放大会跳跃
  14749. }
  14750. var dom = t("dom");
  14751. var Tag = t('Tag');
  14752. var THREE = t('THREE');
  14753. e.exports = Hotspot;
  14754. },{
  14755. "dom" : "dom",
  14756. "Tag" : "123",
  14757. THREE: 217
  14758. }
  14759. ],
  14760. "Editor":[ //xzw
  14761. function(t, e){
  14762. var dom = t("dom");
  14763. var Hotspot = t("Hotspot");
  14764. var Toolbox = t('toolbox');
  14765. var ScrollBar = t('ScrollBar');
  14766. var List = t('List');
  14767. var editor = {
  14768. elem : dom.id('hotPointBox'),
  14769. //tipElem: dom.id('prompt_box'),
  14770. metaElem : dom.id("hotPoint_input"),
  14771. list: dom.id("list"),
  14772. modes:{},
  14773. scroller:{},
  14774. global:{}, //存储全局使用且名字单一的函数或变量,
  14775. selectList:{},
  14776. inputAreas:{}
  14777. }
  14778. editor.show = function(){
  14779. editor.elem.style.opacity = 1;
  14780. }
  14781. editor.hide = function(){
  14782. editor.elem.style.opacity = 0;
  14783. }
  14784. editor.tipWrite = function(t,type){
  14785. if(type === "warn"){
  14786. var old = this.tipElem.children[0].innerHTML;
  14787. editor.tipElem.children[0].innerHTML = t;
  14788. setTimeout(function(){
  14789. if(editor.tipElem.children[0].innerHTML == t){//如果还是未变
  14790. editor.tipElem.children[0].innerHTML = old;
  14791. }
  14792. },1500);
  14793. }else
  14794. this.tipElem.children[0].innerHTML = t;
  14795. }
  14796. //mode\edit面板按钮
  14797. editor.openPanel = function(index){//改
  14798. for(var i=0; i<4;i++){
  14799. if(i==index)$(".editor").children().eq(i+1).css("display", "block");
  14800. else $(".editor").children().eq(i+1).css("display", "none");
  14801. }
  14802. for(var i=0; i<4;i++){
  14803. if(i==index){
  14804. $(".toolBox_nav input").eq(i).addClass("toolBox-Top-input");
  14805. $(".toolBox_nav").addClass("toolBox_nav-left"+index+"");
  14806. }else{
  14807. $(".toolBox_nav input").eq(i).removeClass("toolBox-Top-input");
  14808. $(".toolBox_nav").removeClass("toolBox_nav-left"+i+"");
  14809. }
  14810. }
  14811. for(var i in editor.scroller){
  14812. editor.scroller[i].getOffset();
  14813. editor.scroller[i].moveKnot();
  14814. }
  14815. }
  14816. editor.cancelToDelSpot = function(e){
  14817. if(!this.player.sureToDel) return;
  14818. //if()
  14819. e && e.stopPropagation();
  14820. var sure = dom.cla("DelConfirm", this.player.sureToDel)[0];
  14821. dom.removeClass(sure,"open");
  14822. this.player.sureToDel = null;
  14823. }.bind(editor)
  14824. editor.msgBoxCount = 0;//用于判断当前是否有信息展示
  14825. editor.msgInfoCount = 0;
  14826. editor.showMsgBox = function(title,msg,o){//目前最多支持两个btn,且一般左边是确定,右边取消
  14827. var overlay = dom.cla("Zprompt-popupBox")[0];
  14828. var box = dom.id("msg",overlay);
  14829. var inner = dom.cla("Zprompt-main-false",overlay)[0];
  14830. var head = dom.cla("Ztitle",overlay)[0];
  14831. var footer = dom.cla("Zprompt-footer",overlay)[0];
  14832. var close = dom.cla("Zclose",overlay)[0];
  14833. var btns = [];
  14834. var funcs = [];
  14835. footer.innerHTML = "";
  14836. //btns[0] = dom.cla("confirm",overlay)[0];
  14837. //btns[1] = dom.cla("cancel",overlay)[0];
  14838. inner.innerHTML = msg;
  14839. head.innerHTML = title;
  14840. dom.removeClass(overlay,"hide");
  14841. dom.removeClass(box,"hide");
  14842. editor.msgBoxCount ++;
  14843. var over = false;
  14844. var hideFun;
  14845. var checkClick = function(e){
  14846. if(e.target == overlay){
  14847. hideFun();//或者cancel函数?
  14848. }
  14849. }
  14850. if(o && o.clickBlankToHide)dom.bind(document,"click",checkClick);
  14851. if(o == void 0 || o.btns == void 0){//如果没有btns,即使有funcs,也默认作什么都没有
  14852. o = {btns:["确定"]}
  14853. }
  14854. for(var i=0; i<o.btns.length; i++){
  14855. var a = document.createElement("a");
  14856. a.innerHTML = "<span>"+ o.btns[i] +"</span>"
  14857. footer.appendChild(a);
  14858. dom.addClass(a,"btn"+i);
  14859. btns[i] = a;
  14860. dom.removeClass(a,"hide");
  14861. funcs[i] = function(i){
  14862. return function(){
  14863. if(o.funcs&&o.funcs[i]) o.funcs[i]();
  14864. hideFun();
  14865. }
  14866. }(i)
  14867. dom.bind(btns[i],"click",funcs[i]);
  14868. }
  14869. hideFun = function(){//就是要放最后赋值
  14870. for(var j=0; j<2; j++){
  14871. if(funcs[j]) dom.unbind(btns[j],"click",funcs[j]);
  14872. }
  14873. dom.unbind(close,"click",hideFun);
  14874. dom.unbind(document,"click",checkClick);
  14875. editor.msgBoxCount --;
  14876. if(editor.msgBoxCount==0)dom.addClass(box,"hide");
  14877. if(editor.msgBoxCount + editor.msgInfoCount == 0)dom.addClass(overlay,"hide");
  14878. }
  14879. dom.bind(close,"click",hideFun);
  14880. }
  14881. editor.showInfo = function(o){ // ({result:true, title:"发布成功"});
  14882. var overlay = dom.cla("Zprompt-popupBox")[0];
  14883. var box = dom.id("Zinfo",overlay);
  14884. var title = dom.cla("Ztitle",overlay)[0];
  14885. title.innerText = o.title;
  14886. dom.removeClass(overlay,"hide");
  14887. dom.removeClass(box,"hide");
  14888. editor.msgInfoCount ++;
  14889. dom.addClass(box,"animate");
  14890. setTimeout(function(){
  14891. dom.removeClass(box,"animate");
  14892. dom.addClass(box,"hide");
  14893. editor.msgInfoCount --;
  14894. if(editor.msgBoxCount + editor.msgInfoCount == 0)dom.addClass(overlay,"hide");
  14895. },1020)
  14896. }
  14897. var checkLen = {
  14898. project_name1:function(val){
  14899. var project_name1 = $("#project-name1");
  14900. var len = $(".project-name input").val().length;
  14901. project_name1.attr("data-size",15 - len);
  14902. return len;
  14903. },
  14904. editor1:function(html){
  14905. var all = 200;
  14906. var len = 0;
  14907. var pFlag = false;
  14908. html.replace(/<p>/ig,function(){
  14909. if(!pFlag){ pFlag = true; }
  14910. else{ len += 8; }
  14911. })
  14912. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  14913. c = c.substring(1,c.length-1);
  14914. len +=c.length;
  14915. if(c != ""){
  14916. c.replace(/&nbsp;/ig,function(){
  14917. len -= 5;
  14918. });
  14919. }
  14920. })
  14921. var span = document.getElementById("project-intro1");
  14922. if(html == ''){all = 200};
  14923. span.setAttribute("data-size",all - len);
  14924. return all - len;
  14925. }
  14926. }//检测内容长度
  14927. //----热点描述-----
  14928. var editor1Enter = true;
  14929. var editor1 = new window.wangEditor('#forEdit1','#edit1');
  14930. editor1.customConfig.menus = ['link'];
  14931. editor1.customConfig.pasteFilterStyle = true;
  14932. editor1.customConfig.pasteIgnoreImg = true;
  14933. editor1.customConfig.pasteTextHandle = function (content) {
  14934. var move = '',bodyFlag = false,timeFlag = true;
  14935. content.replace(/<body([\s\S\r\n\.]*?)<\/body>/ig,function(d){
  14936. bodyFlag = true;
  14937. d = d.replace(/<[^>]+>/gi,function(c){
  14938. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  14939. if( aF || c == '</a>'){ c = c }
  14940. else{ c = ''; }
  14941. return c;
  14942. })
  14943. move += d;
  14944. })
  14945. if(!bodyFlag){
  14946. content = content.replace(/<[^>]+>/gi,function(c){
  14947. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  14948. if( aF || c == '</a>'){ c = c }
  14949. else{ c = ''; }
  14950. return c;
  14951. })
  14952. move += content;
  14953. }
  14954. move = move.replace(/\s+/g,'');
  14955. return move
  14956. } //修改复制内容
  14957. editor1.customConfig.onchange = function (htmlZ) {
  14958. var html = "";
  14959. var pNum = 0;
  14960. var pFlag = false;
  14961. htmlZ.replace(/<p>([\s\S\r\n\.]*?)<\/p>/gi,function(c){
  14962. if(pNum < 1){
  14963. html += c;
  14964. } else{
  14965. /* html = html.substring(0,html.length-4);
  14966. c = c.substring(3,c.length-4); */
  14967. html += c // + "</p>";
  14968. }
  14969. pNum ++;
  14970. pFlag =true;
  14971. });
  14972. if(!pFlag){
  14973. html = '<p>' + htmlZ + '</p>';
  14974. editor1.txt.html(html);
  14975. }
  14976. /* if(pNum > 1){
  14977. editor1.txt.html(html);
  14978. }
  14979. html = html.replace(/<p><br><\/p>|<br>/ig,'');*/
  14980. html = html.replace(/style="([\s\S\r\n\.]*?)"/ig,'');
  14981. var len = checkLen.editor1(html);
  14982. if(len < 0){
  14983. editor1Enter = false;
  14984. var span = document.getElementById("project-intro1");
  14985. span.setAttribute("data-size","超出字数限制");
  14986. span.classList.add("sizeWaring");
  14987. var now = 0;
  14988. var clear = false;
  14989. var nowHtml = "";
  14990. var pFlag = true;
  14991. html.replace(/<p>/gi,function(){
  14992. if(pFlag){ pFlag =false; }
  14993. else{
  14994. now += 8;
  14995. }
  14996. })
  14997. html = html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  14998. c = c.substring(1,c.length-1);
  14999. if(!clear){
  15000. var cLen = c.length;
  15001. now += cLen;
  15002. if(now < 201){
  15003. c.replace(/&nbsp;/ig,function(){
  15004. now -= 5;
  15005. });
  15006. }
  15007. //判断这一节点是否超过一百
  15008. if(now > 200){
  15009. var spilth = now - 200;
  15010. c = c.substring(0,c.length - spilth);
  15011. }//拼凑的内容大于100时取里面
  15012. }else{
  15013. c = "";
  15014. }
  15015. return '>'+c+'<';
  15016. })
  15017. } else{
  15018. editor1Enter = true;
  15019. var span = document.getElementById("project-intro1");
  15020. span.classList.remove("sizeWaring");
  15021. }
  15022. //document.getElementsByClassName("dsc")[0].innerHTML = html;
  15023. if(html == '<p><br></p>'){
  15024. editor.player.chosenSpot.billboard.changeDesc('');
  15025. }else{
  15026. editor.player.chosenSpot.billboard.changeDesc(html);
  15027. }
  15028. editor.exchangeTagForSave(editor.player.chosenSpot);
  15029. };
  15030. editor1.create();
  15031. $("#edit1").on("keydown",">div",function(ev){
  15032. if(ev.keyCode == 13 && !editor1Enter){
  15033. $(this).blur();
  15034. }
  15035. })
  15036. editor.addList = function(tag){
  15037. var li = document.createElement('li');
  15038. li.innerHTML = '<div class="left"><img class="typeHead" src="images/spots/'+ tag.type +'_small.png" alt="png"><span>' +tag.billboard.label+ '</span></div><div class="delete"></div>';
  15039. this.list.insertBefore(li, this.list.firstChild);
  15040. tag.listElem = li;
  15041. li.tag = tag;
  15042. li.player = this.player;
  15043. dom.bind(dom.cla("delete", li)[0], "click", function(e){//删除li 整个spot
  15044. e.stopPropagation();
  15045. if(this.player.sureToDel) editor.cancelToDelSpot();
  15046. //if(dom.hasClass(e.target, ))
  15047. var sure = dom.cla("DelConfirm",this);//确定删除按钮
  15048. if(!sure.length){
  15049. sure = document.createElement('div');
  15050. sure.innerHTML = '<div class="DelNo">取消</div> <div class="DelYes">删除</div>';
  15051. sure.className = "DelConfirm open";
  15052. this.insertBefore(sure, e.target);
  15053. dom.bind(sure.children[1], "click", function(e){//确定
  15054. e.stopPropagation();
  15055. editor.changePosCancel();
  15056. editor.deleteSpot(li.tag);
  15057. if(li.tag == li.player.needSaveTag) li.player.needSaveTag = null;
  15058. //li.player.spotImgsDelete.push(li.tag.sid);
  15059. li.tag.remove();
  15060. if(li.tag === li.player.chosenSpot){
  15061. li.player.chosenSpot = null;
  15062. }
  15063. $("#hotPoint_input").css({
  15064. "display": "none"
  15065. })
  15066. li.parentElement.removeChild(li); //删除元素前需要把这上面所有事件解除吗???
  15067. li.player.sureToDel = null;
  15068. editor.changeSnapState();
  15069. },true);
  15070. //取消部分见 cancelToDelSpot
  15071. /* var cancelFun = function(e){
  15072. }
  15073. dom.bind(sure.children[0],"click", cancelFun);
  15074. dom.bind(document, "click", function(e){
  15075. cancelFun(e);
  15076. dom.unbind(document, cancelFun);
  15077. }) */
  15078. }else{
  15079. dom.addClass(sure[0], "open");
  15080. }
  15081. this.player.sureToDel = li;
  15082. }.bind(li))
  15083. dom.bind(li,"click",function(e){
  15084. var player = this.player;
  15085. if(player.mode == "transitioning") return;//还未到inside模式 热点不能飞入
  15086. if(dom.hasClass(e.target,"DelNo")) return; //因为取消删除直接在cancelToDelSpot里绑定在更大范围的document了..
  15087. if(player.chosenSpot === this.tag) player.editor.closeList();
  15088. else{
  15089. var canOpen = player.editor.openList(this);
  15090. if(!canOpen) return;
  15091. player.flytoTag(tag,"force");
  15092. }
  15093. }.bind(li));
  15094. }
  15095. editor.closeList = function(){
  15096. var player = editor.player;
  15097. if(player.chosenSpot && player.chosenSpot.billboard.label==''){
  15098. //强调未命名
  15099. dom.addClass(editor.metaTitle.parentElement, "warn");
  15100. this.openPanel(0)
  15101. //console.log('未命名')
  15102. return false;//如果未命名 就无法关上
  15103. }
  15104. this.changePosCancel();
  15105. player.chosenSpot && dom.removeClass(player.chosenSpot.listElem, "open");
  15106. player.chosenSpot = null;
  15107. player.nokeyForSpotMeta = false;
  15108. $("#hotPoint_input").css({
  15109. "overflow":"hidden",
  15110. "max-height": "0",
  15111. "border":"none"
  15112. })
  15113. return true;
  15114. }.bind(editor);
  15115. editor.metaDisplayChange = function(tag){
  15116. dom.Tag("span",this.player.chosenSpot.listElem)[0].innerHTML = this.metaTitle.value || ("未命名");
  15117. editor.changeImgPreview(this.player.chosenSpot);
  15118. }
  15119. editor.changeImgPreview = function(spot){
  15120. var ImgPreview = dom.cla('ImgPreview',editor.metaImgInput.parentElement)[0];
  15121. var media = spot.billboard.media;
  15122. if(media.type == "photo"){
  15123. if(media.src)ImgPreview.style['background-image'] = 'url("'+ media.src +'")';
  15124. else ImgPreview.style['background-image'] = 'url("'+ media.img.src +'")';
  15125. ImgPreview.style.display = "block";
  15126. }else{
  15127. ImgPreview.style.display = "none";
  15128. }
  15129. }
  15130. editor.openList = function(li){
  15131. var player = li.player;
  15132. if(player.markspot || player.startGetPos) return false;
  15133. if(player.flying || player.flyingToTag) return false;
  15134. if(player.chosenSpot && li == player.chosenSpot.listElem){//已经打开
  15135. if(player.chosenSpot.billboard.label==''){
  15136. dom.addClass(editor.metaTitle.parentElement, "warn");
  15137. player.editor.openPanel(0);
  15138. }
  15139. return false;
  15140. }
  15141. var canClose = this.closeList();//如果原本有打开的先关上
  15142. if(!canClose) return false;
  15143. if(player.chosenSpot === li.tag) return;
  15144. player.chosenSpot = li.tag;
  15145. player.nokeyForSpotMeta = true;
  15146. player.editor.metaTitle.value = li.tag.billboard.label;
  15147. if(li.tag.billboard.description != ''){
  15148. editor1.txt.html(li.tag.billboard.description);
  15149. checkLen.editor1(li.tag.billboard.description);
  15150. }
  15151. else{
  15152. if (navigator.userAgent.indexOf('Firefox') >= 0) {
  15153. $('#edit1>div')[0].innerHTML = '';
  15154. }else{
  15155. $('#edit1>div')[0].innerHTML = '<p><br></p>';
  15156. }
  15157. checkLen.editor1('');
  15158. }
  15159. player.editor.metaSelect.find('p').text(li.tag.TypeToChinese());
  15160. dom.setIndex(player.editor.metaSelect.find('p')[0],li.tag.type);
  15161. player.editor.metaSelect.find('img')[0].src = "images/spots/"+li.tag.type + ".png";
  15162. player.editor.metaDisplayChange(li.tag);
  15163. player.editor.metaElem.parentElement.removeChild(player.editor.metaElem);
  15164. $(li).after(player.editor.metaElem);
  15165. dom.addClass(li,"open");
  15166. checkLen.project_name1();
  15167. //476
  15168. /* var maxScrollTop = 48 * $(li).index() + 88;
  15169. var minScrollTop = maxScrollTop + 354 + 48 - $(".editor .scrollBox .hotPointBox").height()
  15170. var scrollTop = dom.clamp($(".editor .scrollBox .hotPointBox")[0].scrollTop, minScrollTop, maxScrollTop)
  15171. */ var maxScrollTop = 48 * $(li).index();
  15172. var minScrollTop = maxScrollTop + 510 - $(".editor .scrollBox .hotPoint_list").height()
  15173. var scrollTop = dom.clamp($(".editor .scrollBox .hotPointBox")[0].scrollTop, minScrollTop, maxScrollTop)
  15174. setTimeout(function(){//延后
  15175. $("#hotPoint_input").css({
  15176. "display": "block",
  15177. "max-height": "800px",
  15178. "overflow":"unset",
  15179. "overflow":"visible",
  15180. //"overflow" : "visible",
  15181. "border":""
  15182. });
  15183. $(".editor .scrollBox .hotPoint_list")[0].scrollTop = scrollTop;
  15184. /* editor.scroller["hotSize1"].getOffset();
  15185. editor.scroller["hotSize1"].moveKnot();
  15186. editor.scroller["hotSize1"].setValueFromOutside(li.tag.scale1 * 100);
  15187. editor.scroller["hotSize2"].getOffset();
  15188. editor.scroller["hotSize2"].moveKnot();
  15189. editor.scroller["hotSize2"].setValueFromOutside(li.tag.scale2 * 100);
  15190. */ },10)
  15191. return true;
  15192. }.bind(editor);
  15193. editor.bind = function(player){
  15194. editor.player = player;
  15195. player.editor = editor;
  15196. this.snap = dom.id("hotPoint_button",editor.elem);
  15197. this.ok = dom.id("ok",editor.elem);
  15198. //this.select = dom.Tag("select",editor.elem)[0];
  15199. this.pointsElem = dom.id('snapPoint',editor.elem).children;
  15200. this.pointsElem2 = dom.id('listPoint',editor.elem).children;
  15201. this.changeBtn = dom.id('change',editor.elem);
  15202. player.k = 3;// 函数y=常数/x 这是最接近普通视觉大小和距离关系的函数了吧
  15203. this.player.hotspotDragBegin = function(e){//当还是markspot时
  15204. if(this.flying) return;
  15205. this.hotspotDrag.mouseinitX = e.clientX;
  15206. this.hotspotDrag.mouseinitY = e.clientY;
  15207. this.hotspotDrag.transformX = this.markspot.transformX;
  15208. this.hotspotDrag.transformY = this.markspot.transformY;
  15209. this.markspot.state = "drag";
  15210. dom.addClass(this.markspot.elem,"drag");
  15211. }.bind(this.player);
  15212. dom.bind(document, "click", this.cancelToDelSpot);
  15213. Data.sceneIndex = Data.sceneIndex || 0;//贴图风格
  15214. dom.addClass($(".styleZBox .styleZ_content ul").children()[Data.sceneIndex],"active");
  15215. this.snap.addEventListener( "click",function(){
  15216. if(player.mode!="panorama")return;
  15217. if(player.posGets.length>0){
  15218. //editor.tipWrite("当前正在定位热点,请先完成此热点的定位采集。","warn");
  15219. return;
  15220. }
  15221. var canClose = editor.closeList(); //热点未命名 无法关闭
  15222. if(!canClose)return;
  15223. //editor.tipWrite("热点位置计算需要得到两个位置中的定位点,现在请点击以进行第一次热点定位。");
  15224. editor.pointsElem[0].parentElement.style.display = "";
  15225. player.startGetPos = true;
  15226. //player.domElement.style.cursor = "crosshair";
  15227. player.domElement.style.cursor = 'url("images/crosshair.cur"), crosshair';
  15228. //this.style.color = "red";
  15229. dom.addClass(this,"unable");
  15230. player.reticule.visible = false;
  15231. })
  15232. this.ok.addEventListener("click",function(){
  15233. if(player.posGets.length == 2 && !player.flying){
  15234. this.style.display = "";
  15235. dom.unbind(player.markspot.elem, "mousedown",player.hotspotDragBegin); //这个热点无法再被拖拽
  15236. player.markspot.computeHotPos();
  15237. var tag = player.markspot.becomeReal();
  15238. //player.markspot.posGets = player.posGets;
  15239. editor.addList(tag);
  15240. editor.finish();
  15241. editor.openList(tag.listElem);
  15242. tag.obj3d.updateMatrixWorld();
  15243. player.flytoTag(tag,"force"); //如果一定fly到最近点 有可能最近点和两个标点不相邻 于是展开了却看不到热点。。。
  15244. }
  15245. })
  15246. var flyToThis2Pano = function(index){
  15247. if(player.posGets.length>index){
  15248. var to = player.model.panos.index[player.posGets.list[index]];
  15249. player.flyToPano({pano:to});
  15250. player.lookAtPos(player.markspot.pos3d, to.position);
  15251. //player.markspot.pos3d = player.posGets[player.posGets.list[index]];
  15252. }
  15253. }
  15254. this.setMarkspotDisplayNum = function(num){//初始为1,因为点击第一下后就是1
  15255. var elem = this.player.markspot.elem;
  15256. dom.removeClass(elem,"zero");
  15257. dom.removeClass(elem,"two");
  15258. if(num==0)dom.addClass(elem,"zero");
  15259. else if(num==2)dom.addClass(elem,"two");
  15260. }.bind(this);
  15261. var posElemClick = function(index, type){
  15262. var snap;
  15263. if(type == "snapPos"){
  15264. var pointsElem = this.pointsElem;
  15265. snap = true;
  15266. }else{
  15267. var pointsElem = this.pointsElem2;
  15268. }
  15269. return function(e){
  15270. if(this.player.mode!=="panorama" || this.player.flying)return;
  15271. if(!snap){//修改位置
  15272. if(this.player.markspot && !this.player.markspot.changePos ) return; //正在采集期间不可修改这个
  15273. if(!this.player.markspot){
  15274. if(this.player.tagManager.activeTag) this.player.tagManager.dismissActiveTag();
  15275. this.player.chosenSpot.disc.visible = false;
  15276. this.player.chosenSpot.state = "rebuildHide";
  15277. this.player.markspot = new Hotspot({pos3d : this.player.chosenSpot.position, player:this.player, type: this.player.chosenSpot.type })
  15278. var markspot = this.player.markspot;
  15279. markspot.changePos = true; //标记这个markspot是由于改位置临时产生的
  15280. for(var m in this.player.chosenSpot.posGets){
  15281. if(m == "list") this.player.posGets.list = this.player.chosenSpot.posGets.list.slice(0);
  15282. else this.player.posGets[m] = this.player.chosenSpot.posGets[m];
  15283. }
  15284. dom.bind(markspot.elem, "mousedown",this.player.hotspotDragBegin);
  15285. this.changeSnapState(false);//dom.addClass(this.snap,"unable");
  15286. this.player.reticule.visible = false;
  15287. this.changeBtn.style.display = "";//flex
  15288. //this.player.updateMarkerDisplay();
  15289. this.player.model.fadeMarkerOpacity(null,null,{player:this});
  15290. }
  15291. }
  15292. if(dom.hasClass(e.target,"delete")){//删除坐标点
  15293. if(this.player.posGets.length == 2){
  15294. pointsElem[1].style.display = "none";
  15295. this.setMarkspotDisplayNum(1);
  15296. snap && (this.ok.style.display = "none");
  15297. }else{
  15298. //this.pointsElem[0].style.display = "none";
  15299. //this.setMarkspotDisplayNum(0);
  15300. if(snap){
  15301. this.clearCollect(); return;//如果删除了仅剩下的一个坐标,就直接取消这轮采集
  15302. }else{
  15303. this.pointsElem[0].style.display = "none";
  15304. this.setMarkspotDisplayNum(0);
  15305. }
  15306. }
  15307. delete this.player.posGets[this.player.posGets.list[index]];
  15308. this.player.posGets.list.splice(index,1);
  15309. this.player.posGets.length -- ;
  15310. if(this.player.posGets.length){ //如果还剩下一个点 那么 pos3d要变成这个点的,否则还是原来真实位置。
  15311. if( this.player.currentPano.id == this.player.posGets.list[0]){
  15312. dom.addClass(pointsElem[0],"chosen");
  15313. }
  15314. else dom.removeClass(pointsElem[0],"chosen");
  15315. this.player.markspot.pos3d = this.player.posGets[ this.player.posGets.list[0] ].clone();
  15316. flyToThis2Pano(0);//飞向剩下的这点
  15317. var origin = this.player.model.panos.index[this.player.posGets.list[0]].position;
  15318. var end = this.player.posGets[ this.player.posGets.list[0] ];
  15319. this.player.disablePanoAtLine(origin,end)
  15320. }
  15321. return;
  15322. }
  15323. flyToThis2Pano(index);
  15324. }.bind(editor)
  15325. }.bind(editor)
  15326. for(var i=0; i<2; i++){//采集时点击坐标
  15327. dom.bind(this.pointsElem[i],"click",posElemClick(i,"snapPos"));
  15328. }
  15329. //============更改坐标操作==========
  15330. for(var i=0; i<2; i++){//点击坐标修改位置
  15331. dom.bind(this.pointsElem2[i],"click", posElemClick(i,"changePos"));
  15332. }
  15333. editor.changePosCancel = function(){
  15334. if(!this.player.markspot || !this.player.markspot.changePos ) return;
  15335. this.clearCollect();
  15336. for(var i=0; i<2; i++){
  15337. dom.removeClass(this.pointsElem2[i], "chosen");
  15338. }
  15339. this.changeBtn.style.display = "none";
  15340. this.pointsElem2[0].style.display = "";
  15341. this.pointsElem2[1].style.display = "";
  15342. this.changeSnapState(true);//dom.removeClass(this.snap,"unable");
  15343. //this.player.chosenSpot && (this.player.chosenSpot.elem.style.display = "");
  15344. this.player.chosenSpot && (this.player.chosenSpot.disc.visible = true, this.player.chosenSpot.state = "");//this.player.chosenSpot.show();
  15345. }
  15346. editor.changePosConfirm = function(){
  15347. if(this.player.posGets.length == 2 && !this.player.flying && !this.player.flyingToTag){
  15348. /* if(window.use1) this.player.markspot.computeHotPos1();
  15349. else */this.player.markspot.computeHotPos();
  15350. this.player.chosenSpot.rePos(this.player.markspot.pos3d);
  15351. this.player.chosenSpot.posGets = this.player.posGets;
  15352. editor.changePosCancel();//复制好坐标后,就和取消一样了
  15353. this.player.chosenSpot.obj3d.updateMatrixWorld();
  15354. this.player.flytoTag(this.player.chosenSpot,"force");
  15355. this.exchangeTagForSave(this.player.chosenSpot);
  15356. //this.changeBtn.style.display = "none";
  15357. //dom.addClass(this.snap,"unable");
  15358. }
  15359. }
  15360. dom.bind(this.changeBtn.children[0],'click', function(){//change pos
  15361. this.changePosConfirm();
  15362. }.bind(editor))
  15363. dom.bind(this.changeBtn.children[1],'click', function(){//cancel
  15364. this.changePosCancel();
  15365. }.bind(editor))
  15366. this.metaSelect = $("#select");
  15367. this.metaTitle = dom.Tag("input",this.metaElem)[0];
  15368. this.metaContain = dom.id("discrib",this.metaElem);
  15369. this.metaImgInput = dom.id("hotPoint_file",this.metaElem);
  15370. this.player.chosenSpot = null;
  15371. //============更改信息==========
  15372. var titleInput = function(e){
  15373. this.chosenSpot.billboard.changeLabel(e.target.value);
  15374. if(this.editor.metaTitle.clientHeight){//改标题
  15375. dom.Tag("span",this.chosenSpot.listElem)[0].innerHTML = e.target.value;
  15376. }
  15377. if(e.target.value != "") this.editor.exchangeTagForSave(this.chosenSpot);
  15378. }.bind(player);
  15379. dom.bind(this.metaTitle,"input",titleInput)
  15380. dom.bind(this.metaTitle,"change",function(e){
  15381. e.target.value = e.target.value.trim();
  15382. titleInput(e);
  15383. })
  15384. $(".hotPoint-titleInput").on("focus",function(){
  15385. $(".project-name").removeClass("warn");
  15386. })
  15387. $("#pjtName").on("focus",function(){
  15388. $(this).removeClass("empty_warn");
  15389. })
  15390. $(".selection").on("click",function(){
  15391. $(this).removeClass("empty_warn");
  15392. })
  15393. //----------信息面板的信息----------
  15394. dom.bind(dom.id("pjtName"),"input",function(e){
  15395. $(".model-title2").text(e.target.value || '四维看看');
  15396. })
  15397. dom.bind(dom.id("pjtName"),"change",function(e){
  15398. e.target.value = e.target.value.trim();//名称不允许前后有空格,但简介应该可以开头有空格?
  15399. $(".model-title2").text(e.target.value || '四维看看');
  15400. })
  15401. //---------地面标志大小======
  15402. this.scroller.floorLogoSize = new ScrollBar(dom.id('floorLogoSize'), dom.ifVoid(Data.floorLogoSize, 100),40,160,"floorLogoSize","%",function(s){
  15403. var s = s / 100;
  15404. editor.player.model.floorLogos[0].scale.set(s,s,s);
  15405. editor.player.model.floorLogos[1].scale.set(s,s,s);
  15406. })
  15407. //---------热点未展开大小======
  15408. /* this.scroller.hotSize1 = new ScrollBar(dom.id('hotSize1'), dom.ifVoid(Data.hotSize1, 100),50,150,"hotSize1","%",function(s){
  15409. var s = s / 100;
  15410. editor.player.chosenSpot.scale1 = s;
  15411. })
  15412. this.scroller.hotSize2 = new ScrollBar(dom.id('hotSize2'), dom.ifVoid(Data.hotSize2, 100),100,150,"hotSize2","%",function(s){
  15413. var s = s / 100;
  15414. editor.player.chosenSpot.scale2 = s;
  15415. })
  15416. */
  15417. var setLenthCheck = function(textArea,small){
  15418. this.textArea = textArea;
  15419. this.small = small;
  15420. this.max = parseInt(small.innerText);
  15421. if(textArea.nodeName.toUpperCase == "INPUT"){
  15422. dom.bind(textArea,"focus",function(){
  15423. dom.removeClass(this.small,"hide");
  15424. });
  15425. dom.bind(textArea,"blur",function(){
  15426. dom.addClass(this.small,"hide");
  15427. });
  15428. }else if(textArea.nodeName.toUpperCase == "DIV"){
  15429. dom.bind(textArea,"click",function(e){//focus
  15430. dom.removeClass(this.small,"hide");
  15431. }.bind(this))
  15432. dom.bind(document,"click",function(e){//blur
  15433. if(e.target == this.textArea) return;
  15434. dom.addClass(this.small,"hide");
  15435. }.bind(this));
  15436. }else console.log('错误的textArea类型');
  15437. dom.bind(textArea,"input",this.check);//Safari5.0以下版本,oninput 不支持 textarea 元素。
  15438. dom.bind(textArea,"propertychange",this.check);// IE9.0以下
  15439. /* dom.bind(textArea,"change",function(){ //结束输入时才将多出的字符删去
  15440. var count = max - textArea.value.length;
  15441. if(count<0){
  15442. textArea.value = textArea.value.slice(0,max);
  15443. count = 0;
  15444. }
  15445. dom.removeClass(small,"red");
  15446. small.innerText = count + "";
  15447. }) */
  15448. }
  15449. setLenthCheck.prototype.check = function(){
  15450. if(textArea.nodeName.toUpperCase == "INPUT"){
  15451. var count = this.max - this.textArea.value.length();
  15452. this.textArea.value = this.textArea.value.slice(0,this.max);
  15453. }else{
  15454. var count = this.max - this.textArea.innerHTML.length;
  15455. this.textArea.innerHTML = this.textArea.innerHTML.slice(0,this.max);
  15456. }
  15457. count = dom.clamp(count,0,this.max);
  15458. /* if(count<0){
  15459. dom.addClass(this.small,"red");
  15460. }else{
  15461. dom.removeClass(this.small,"red");
  15462. } */
  15463. this.small.innerText = count + "";
  15464. }
  15465. var checkLen = {
  15466. project_name1:function(val){
  15467. var project_name1 = $("#project-name1");
  15468. var len = $(".project-name input").val().length;
  15469. project_name1.attr("data-size",15 - len);
  15470. return len;
  15471. },
  15472. project_name2:function(val){
  15473. var project_name2 = $("#project-name2");
  15474. var len = $("#pjtName").val().length;
  15475. project_name2.attr("data-size",15 - len);
  15476. return len;
  15477. },
  15478. editor2:function(html){
  15479. var all = 200;
  15480. var len = 0;
  15481. var pFlag = false;
  15482. html.replace(/<p>/ig,function(){
  15483. if(!pFlag){ pFlag = true; }
  15484. else{ len += 8; }
  15485. })
  15486. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  15487. c = c.substring(1,c.length-1);
  15488. len +=c.length;
  15489. if(c != ""){
  15490. c.replace(/&nbsp;/ig,function(){
  15491. len -= 5;
  15492. });
  15493. }
  15494. })
  15495. var span = document.getElementById("project-intro2");
  15496. if(html == ''){all = 200};
  15497. span.setAttribute("data-size",all - len);
  15498. return all - len;
  15499. },
  15500. editor1:function(html){
  15501. var all = 200;
  15502. var len = 0;
  15503. var pFlag = false;
  15504. html.replace(/<p>/ig,function(){
  15505. if(!pFlag){ pFlag = true; }
  15506. else{ len += 8; }
  15507. })
  15508. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  15509. c = c.substring(1,c.length-1);
  15510. len +=c.length;
  15511. if(c != ""){
  15512. c.replace(/&nbsp;/ig,function(){
  15513. len -= 5;
  15514. });
  15515. }
  15516. })
  15517. var span = document.getElementById("project-intro1");
  15518. if(html == ''){all = 200};
  15519. span.setAttribute("data-size",all - len);
  15520. return all - len;
  15521. }
  15522. }//检测内容长度
  15523. /* $("#edit1").on("keydown",">div",function(ev){
  15524. if(ev.keyCode == 13){
  15525. $(this).blur();
  15526. }
  15527. })
  15528. */
  15529. var editor2Enter = true;
  15530. var editor2 = new window.wangEditor('#forEdit2','#edit2');
  15531. editor2.customConfig.menus = ['link'];
  15532. var editor2_dsc = document.getElementById("edit2").getAttribute("data-more") || "";
  15533. editor2.customConfig.pasteIgnoreImg = true;
  15534. editor2.customConfig.pasteTextHandle = function (content) {
  15535. var move = '',bodyFlag = false,timeFlag = true;
  15536. content.replace(/<body([\s\S\r\n\.]*?)<\/body>/ig,function(d){
  15537. bodyFlag = true;
  15538. d = d.replace(/<[^>]+>/gi,function(c){
  15539. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  15540. if( aF || c == '</a>'){ c = c }
  15541. else{ c = ''; }
  15542. return c;
  15543. })
  15544. move += d;
  15545. })
  15546. if(!bodyFlag){
  15547. content = content.replace(/<[^>]+>/gi,function(c){
  15548. var aF = /<a([\s\S\r\n\.]*?)>/.test(c);
  15549. if( aF || c == '</a>'){ c = c }
  15550. else{ c = ''; }
  15551. return c;
  15552. })
  15553. move += content;
  15554. }
  15555. move = move.replace(/\s+/g,'');
  15556. return move
  15557. } //修改复制内容
  15558. editor2.customConfig.onchange = function (html) {
  15559. var pNum = 0;
  15560. var pFlag = false;
  15561. html.replace(/<p>([\s\S\r\n\.]*?)<\/p>/gi,function(c){
  15562. /* var html = ""; if(pNum < 1){
  15563. html += c;
  15564. } else{
  15565. html = html.substring(0,html.length-4);
  15566. c = '<br>' + c.substring(3,c.length-4);
  15567. html += c + "</p>";
  15568. }
  15569. pNum ++;
  15570. if(pNum > 1){
  15571. editor2.txt.html(html);
  15572. } */
  15573. pFlag =true;
  15574. });
  15575. if(!pFlag){
  15576. html = '<p>' + htmlZ + '</p>';
  15577. editor2.txt.html(html);
  15578. }
  15579. html = html.replace(/style="([\s\S\r\n\.]*?)"/ig,'');
  15580. var len = checkLen.editor2(html);
  15581. if(len < 0){
  15582. editor2Enter = false;
  15583. var span = document.getElementById("project-intro2");
  15584. span.setAttribute("data-size","超出字数限制");
  15585. span.classList.add("sizeWaring");
  15586. var now = 0;
  15587. var clear = false;
  15588. var nowHtml = "";
  15589. var pFlag = true;
  15590. html.replace(/<p>/gi,function(){
  15591. if(pFlag){ pFlag =false; }
  15592. else{
  15593. now += 8;
  15594. }
  15595. })
  15596. html = html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  15597. c = c.substring(1,c.length-1);
  15598. if(!clear){
  15599. var cLen = c.length;
  15600. now += cLen;
  15601. if(now < 201){
  15602. c.replace(/&nbsp;/ig,function(){
  15603. now -= 5;
  15604. });
  15605. }
  15606. //判断这一节点是否超过一百
  15607. if(now > 200){
  15608. var spilth = now - 200;
  15609. c = c.substring(0,c.length - spilth);
  15610. }//拼凑的内容大于100时取里面
  15611. }else{
  15612. c = "";
  15613. }
  15614. return '>'+c+'<';
  15615. })
  15616. }else{
  15617. editor2Enter = true;
  15618. var span = document.getElementById("project-intro2");
  15619. span.classList.remove("sizeWaring");
  15620. }
  15621. document.getElementsByClassName("introduce-detail")[0].getElementsByTagName("span")[0].innerHTML = html;
  15622. }; //实时监听
  15623. editor2.create();
  15624. editor2.txt.html(editor2_dsc);
  15625. $("#edit2").on("keydown",">div",function(ev){
  15626. if(ev.keyCode == 13 && !editor2Enter){
  15627. $(this).blur();
  15628. }
  15629. })
  15630. $("#edit1>div").on("focus",function(){
  15631. $("#edit1").css("border","1px solid #09e1c0");
  15632. })
  15633. $("#edit1>div").on("blur",function(){
  15634. $("#edit1").css("border","1px solid white");
  15635. })
  15636. $("#edit2>div").on("focus",function(){
  15637. $("#edit2").css("border","1px solid #09e1c0");
  15638. })
  15639. $("#edit2>div").on("blur",function(){
  15640. $("#edit2").css("border","1px solid white");
  15641. })
  15642. $(".project-name input").on("input",function(){
  15643. checkLen.project_name1();
  15644. });
  15645. $("#pjtName").on("input",function(){
  15646. checkLen.project_name2();
  15647. });
  15648. $("#edit2Box,#edit1Box").on("input",".addLink_input",function(){
  15649. var len = $(this).val().length;
  15650. $("#addLink-maxSize").text( 40 - len);
  15651. })
  15652. //----------输入框的输入时keydown不会触发player移动控制----
  15653. var allInputs = [];
  15654. allInputs.push($('.editor #pjtName')) //项目标题
  15655. allInputs.push($("#edit2>div")) //项目描述
  15656. allInputs.push($(".editor .hotPoint-titleInput")) //热点标题
  15657. allInputs.push($("#edit1>div")) //热点描述
  15658. allInputs.push($("#scenePSD input")) //密钥
  15659. //allInputs.push($('#edit2Box .w-e-panel-container input')) //链接输入写在控件js里
  15660. allInputs.push($(".slider input")) //滑动条输入
  15661. for(var i=0; i<allInputs.length;i++){
  15662. allInputs[i].on("focus", function(){window.keyCon = false;} )
  15663. allInputs[i].on("blur", function(){window.keyCon = true;} )
  15664. allInputs[i].on("keydown", function(e){
  15665. if(e.which == 33||e.which == 34){e.preventDefault();} //pageup pagedown 会页面抬升错乱
  15666. e.stopPropagation();
  15667. })
  15668. }
  15669. //============选择样式==========
  15670. var listBind = function(select ){
  15671. select.find("#styleBtn").click(function (ev) {
  15672. ev.stopPropagation();
  15673. if(select.hasClass("open") ){
  15674. select.removeClass('open');
  15675. }else {
  15676. select.addClass('open');
  15677. }
  15678. });
  15679. $(document).click(function (event) {
  15680. select.removeClass('open');
  15681. });
  15682. var index;
  15683. for (var i = 0; i < $("#select ul li").length; i++) {
  15684. (function (i) {
  15685. select.find("ul li")[i].onclick = function () {
  15686. index = i;
  15687. var text = select.find("ul li").eq(index).text();
  15688. var type = dom.getIndex(select.find("ul li").eq(index)[0]);
  15689. dom.setIndex(select.find("p")[0], type);
  15690. select.find("p").text(text);
  15691. select.find('img')[0].src = "images/spots/"+ type + "_small.png";
  15692. this.chosenSpot.setElemType(type);
  15693. this.editor.exchangeTagForSave(this.chosenSpot);
  15694. dom.cla("typeHead",this.chosenSpot.listElem)[0].src = "images/spots/"+type+"_small.png";
  15695. }.bind(player)
  15696. })(i);
  15697. }
  15698. }
  15699. listBind( this.metaSelect ); //换超链接类型
  15700. //============上传图==========
  15701. function dataURLtoBlob(dataurl) {
  15702. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  15703. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  15704. while(n--){
  15705. u8arr[n] = bstr.charCodeAt(n);
  15706. }
  15707. return new Blob([u8arr], {type:mime});
  15708. }
  15709. dom.bind(this.metaImgInput,"change",function(ev){
  15710. if (!window.FileReader) {
  15711. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>您的浏览器不支持上传图片</span>'); return;
  15712. error_dialog("提示","您的浏览器不支持上传图片");
  15713. return;
  15714. }
  15715. else if (ev.target.files.length===0)return;
  15716. if(ev.target.files[0].size/1024/1024 > 3){ //图片越大,要×的1.024这个值会越偏大一些些,即无法准确得到图是几M的
  15717. //editor.showMsgBox("提示",'图片不得大于3M');
  15718. error_dialog("提示","图片不得大于3M");
  15719. return;
  15720. }
  15721. var reader = new FileReader();
  15722. //reader.name = ev.target.files[0].name;
  15723. var spot = this.chosenSpot.elem;
  15724. reader.onload = function(evt){
  15725. var img = new Image();
  15726. var imgType = evt.target.result.slice(0,17).indexOf("png") ? "png" : "jpeg";
  15727. var blob = dataURLtoBlob(evt.target.result)
  15728. img.src = window.URL.createObjectURL(blob);
  15729. img.base64Src = evt.target.result;
  15730. img.onload = function(e){//这时img才有宽高,才能赋予texture宽高
  15731. if(spot != this.chosenSpot.elem) return; //万一加载太久转到别的spot就不好啦
  15732. var elem = this.chosenSpot.elem;
  15733. this.chosenSpot.imgNeedSave = true;
  15734. //var imgs = dom.cla("replaceImg",elem);
  15735. var png = ResizeImg(e.target, {weight:blob.size, maxWeight: 0.5*1024*1024, oldType:imgType, maxSize:1480});//最大500k
  15736. //this.chosenSpot.img = png;
  15737. //imgs[0].src = png.src;
  15738. //imgs[0].base64Src = png.base64Src;
  15739. this.chosenSpot.billboard.changeImg(png);
  15740. this.chosenSpot.base64Src = png.base64Src;
  15741. this.editor.changeImgPreview( this.chosenSpot );
  15742. this.editor.exchangeTagForSave(this.chosenSpot);
  15743. }.bind(this)
  15744. }.bind(this)
  15745. reader.readAsDataURL(ev.target.files[0]);
  15746. this.editor.metaImgInput.value = "";
  15747. }.bind(player))
  15748. var scaleImg = t("scaleImg");
  15749. var ResizeImg = function(img, option){
  15750. var img2; //不能直接改img 否则可能触发第二次img.onload
  15751. var compress = function(ratio,type){
  15752. var image = img2 || img;
  15753. var c = document.createElement('canvas');
  15754. c.width = image.width; c.height = image.height;
  15755. var ctx = c.getContext('2d');
  15756. ctx.drawImage(image,0,0,image.width,image.height);
  15757. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  15758. }
  15759. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  15760. var image = img2 || img;
  15761. var blob = dataURLtoBlob(image.src);
  15762. if(option.maxWeight && blob.size > option.maxWeight){
  15763. compress(option.maxWeight/blob.size, "jpeg")
  15764. blob = dataURLtoBlob(image.src);
  15765. }
  15766. if(!img2){
  15767. img2 = new Image();
  15768. }
  15769. img2.base64Src = image.src;
  15770. img2.src = window.URL.createObjectURL(blob);
  15771. }
  15772. var oldSize = Math.max(img.width, img.height);
  15773. if(option.toType != "png"){//不是非要png的话
  15774. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  15775. if(oldSize > option.maxSize){
  15776. compress(option.maxSize/oldSize, "jpeg");
  15777. }
  15778. reCom();
  15779. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  15780. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  15781. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  15782. reCom();
  15783. }
  15784. }
  15785. }else{
  15786. //?貌似png会越压缩越大?
  15787. }
  15788. return img2 || img;
  15789. }
  15790. if(Data.thumbImg){//初始化thumbImgPreview
  15791. var preview = $("#setEntry .ImgPreview")[0];
  15792. preview.style.display = "block";
  15793. var src = Data.imgRoot + CONSTANT.THUMBPIC+"?m=" + Data.version;
  15794. preview.style["background-image"] = 'url("'+ src +'")';
  15795. }
  15796. //---------保存初始视角并且截图------------
  15797. if(Data.thumbImg==1&&Data.entry && Data.entry.panoId){//初始化EntryPreview
  15798. var preview = dom.cla("ImgPreview",dom.id("setEntry"))[0];
  15799. preview.style.display = "block";
  15800. var src = Data.imgRoot + CONSTANT.THUMBPIC+"?m=" + Data.version //var src = Data.imgRoot + "entry.jpg?" +"" + Data.version
  15801. preview.style["background-image"] = 'url("'+ src +'")';
  15802. //dom.removeClass(dom.id('useEntry'),"hide");
  15803. }
  15804. player.thumbImg = Data.thumbImg;
  15805. var screenShot = function(o){
  15806. if(player.flying || player.flyingToTag || player.mode != "panorama") return;
  15807. var R = player.sceneRenderer;
  15808. var flash = dom.cla("snapshotFlash",dom.id("player"))[0];
  15809. // dom.addClass(dom.cla("snapshot",fdageUI)[0],"unable");
  15810. dom.addClass(flash,"active");
  15811. R.updateScreenSize(o);
  15812. for(var i in player.model.panos.index){
  15813. player.model.panos.index[i].marker.forceHide = player.model.panos.index[i].marker.visible;
  15814. player.model.panos.index[i].marker.visible = false;
  15815. }
  15816. player.tagManager.hideAlltags();
  15817. player.reticule.visible = false;
  15818. player.reticule.forceUnvisible = true;
  15819. player.model.floorLogos[0].visible = false;
  15820. player.model.floorLogos[1].visible = false;
  15821. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  15822. R.renderer.clear(true,true,true);
  15823. R.renderer.render(R.scene, R.camera);
  15824. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  15825. o.f && o.f(imgData)
  15826. //player.resize();
  15827. R.updateScreenSize({resize:true});
  15828. //player.markerHide = false;
  15829. player.reticule.visible = true;
  15830. player.tagManager.showAlltags();
  15831. player.model.floorLogos[0].visible = true;
  15832. player.model.floorLogos[1].visible = true;
  15833. for(var i in player.model.panos.index){
  15834. player.model.panos.index[i].marker.visible = player.model.panos.index[i].marker.forceHide;
  15835. }
  15836. R.renderer.render(R.scene, R.camera);
  15837. },30) //这个数字不能太小
  15838. setTimeout( function(){
  15839. dom.removeClass(flash,"active");
  15840. },1050)
  15841. }
  15842. var _fixType=function(type) {
  15843. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  15844. var r = type.match(/png|jpeg|bmp|gif/)[0];
  15845. return 'image/' + r;
  15846. };
  15847. var setEntryPreview = function(){
  15848. player.setEntry();
  15849. screenShot({/* width:160*9, height:114*9, */ width:256*10, height:128*10, type:"image/jpeg", f:function(imgData){
  15850. imgData.replace(_fixType("image/jpeg"),'image/octet-stream');
  15851. player.thumbBigImg = imgData;
  15852. var img = new Image();
  15853. img.src = imgData;
  15854. img.onload = function(){
  15855. var png = ResizeImg(this,{maxSize: 256*4, oldType:"jpeg"}); //暂定缩略图大小
  15856. var preview = dom.cla("ImgPreview",dom.id("setEntry"))[0];
  15857. player.thumbSmallImg = png.base64Src;
  15858. preview.style.display = "block";
  15859. preview.style["background-image"] = 'url("'+ png.src +'")';
  15860. player.thumbImg = true;
  15861. }
  15862. }});
  15863. editor.finishSetEntry();
  15864. }
  15865. var setSnapElemDisplay = function(open){
  15866. var snapElem = dom.cla("snapshotGui",dom.id('webgl'))[0];
  15867. if( open != false){
  15868. dom.removeClass(snapElem,"hide");
  15869. setTimeout(function(){snapElem.style.opacity = "1"; },10)
  15870. }else{
  15871. snapElem.style.opacity = "0";
  15872. setTimeout(function(){dom.addClass(snapElem,"hide"); },200)
  15873. }
  15874. }
  15875. var toSetEntry = function(){
  15876. var done;
  15877. if(player.mode != "panorama"){
  15878. var panoramaBtn = dom.id('hotPoint');
  15879. done = editor.global.inside(null,{fuc:setSnapElemDisplay, dontTurnToHot:true})
  15880. }else{
  15881. setSnapElemDisplay(); done = true;
  15882. }
  15883. if(done){
  15884. setEntryBtn.innerHTML = "取消";
  15885. player.thumbNeedSave = true;//player.entryImgNeedSave = true;
  15886. dom.unbind(setEntryBtn,"click",toSetEntry);
  15887. dom.bind(setEntryBtn,"click",editor.finishSetEntry);
  15888. }
  15889. }
  15890. var setEntryBtn = dom.Tag("label",dom.id("setEntry"))[0] ;
  15891. dom.bind(setEntryBtn,"click",toSetEntry)
  15892. var confirmSnap = dom.cla("confirmSnap",dom.id('webgl'))[0];
  15893. dom.bind(confirmSnap,"click",setEntryPreview)
  15894. dom.bind(confirmSnap,"mouseover", function(){
  15895. var snapElem = dom.cla("snapshotGui",dom.id('webgl'))[0];
  15896. dom.addClass(snapElem,"highLight");
  15897. })
  15898. dom.bind(confirmSnap,"mouseout", function(){
  15899. var snapElem = dom.cla("snapshotGui",dom.id('webgl'))[0];
  15900. dom.removeClass(snapElem,"highLight");
  15901. })
  15902. editor.finishSetEntry = function(){
  15903. setSnapElemDisplay(false);
  15904. setEntryBtn.innerHTML = "点击设置";
  15905. dom.unbind(setEntryBtn,"click",editor.finishSetEntry);
  15906. dom.bind(setEntryBtn,"click",toSetEntry);
  15907. //dom.removeClass(dom.id('useEntry'),"hide");
  15908. }
  15909. /* dom.bind(dom.id('useEntry'),"click", function(){
  15910. editor.finishSetEntry();
  15911. player.thumbImg = player.entryImg.slice(0);
  15912. player.thumbUseEntry = true; //就会用它的url entryImg.jpg...
  15913. player.thumbNeedSave = true;
  15914. }) */
  15915. //---------类别======
  15916. var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
  15917. //var typeName = ["文博","地产","电商","餐饮","家居","其他"];
  15918. var setMetaType = function(){//初始化作品信息的类别
  15919. var select = dom.cla("selection", dom.id("type"))[0];
  15920. var o = {initOption:"请点击选择", option: CONSTANT.SCENETYPE[ typeIndex.indexOf(Data.sceneType) ], noCallback:true};
  15921. //mulChosedlistBind(list,hasOnArray, select,3)//list,onArray, select, max,fuc
  15922. var fuc = function(type){
  15923. $(".introduce-button img")[0].src = "images/type/"+ typeIndex[CONSTANT.SCENETYPE.indexOf(type)] +".svg";
  15924. }
  15925. $(".introduce-button img")[0].src = "images/type/"+ (Data.sceneType || 0) +".svg";
  15926. editor.selectList.type = new List(CONSTANT.SCENETYPE,select,fuc,o);
  15927. }
  15928. setMetaType();
  15929. //---------私密设置======
  15930. //初始化:
  15931. function Mode(ul,funcs,index){ //多选模式按钮的设置 这里主要用于密钥设置
  15932. this.ul = ul;
  15933. this.funcs = funcs;
  15934. if(index!=void 0) this.setMode(index);
  15935. for(var i=0;i<this.ul.children.length;i++){
  15936. dom.bind(this.ul.children[i], "click", (function(i){
  15937. return function(e){
  15938. if(dom.hasClass(e.target,'chosen')) return;
  15939. this.setMode(i);
  15940. this.funcs[i] && this.funcs[i]();
  15941. }.bind(this)
  15942. }.bind(this)(i)))
  15943. }
  15944. }
  15945. Mode.prototype.setMode = function(index){
  15946. for(var i=0;i<this.ul.children.length;i++){
  15947. dom.removeClass(this.ul.children[i],"chosen")
  15948. }
  15949. dom.addClass(this.ul.children[index],"chosen")
  15950. }
  15951. Mode.prototype.getMode = function(){
  15952. for(var i=0;i<this.ul.children.length;i++){
  15953. if(dom.hasClass(this.ul.children[i],"chosen")) return i;
  15954. }
  15955. }
  15956. //var btn = dom.cla("button",dom.id('scenePSD'))[0];
  15957. var initPsd = function(psd){ //密钥初始化
  15958. var ul = dom.cla("MenuOptions",dom.id('scenePSD'))[0];
  15959. var funcs = [function(){
  15960. var word = dom.cla("word",dom.id('scenePSD'))[0];
  15961. dom.addClass(word,"hide");
  15962. //dom.removeClass(btn,"hide");
  15963. },function(){
  15964. var word = dom.cla("word",dom.id('scenePSD'))[0];
  15965. dom.removeClass(word,"hide");
  15966. //checkInput();
  15967. }]
  15968. var mode = new Mode(ul,funcs)
  15969. if(psd && psd!=''){
  15970. dom.Tag("input",dom.id('scenePSD'))[0].value = psd;
  15971. mode.ul.children[1].click();
  15972. }else{//公开
  15973. mode.setMode(0);
  15974. }
  15975. editor.modes.psd = mode;
  15976. }
  15977. /* var getPsd = $.ajax({
  15978. url: "scene/setkey",//??????
  15979. type: 'POST',
  15980. dataType: "json",
  15981. data:{num: window.number},
  15982. success: function(data) {
  15983. initPsd(data)
  15984. },
  15985. error: function(msg) {
  15986. initPsd();
  15987. console.log(msg)
  15988. }
  15989. }); */
  15990. var psdInput = dom.Tag("input",dom.id('scenePSD'))[0]
  15991. var checkInput = function(){
  15992. var reg = /[a-zA-Z0-9]*/g; //抽取字母和数字
  15993. var a = psdInput.value.match(reg);
  15994. psdInput.value = a.join('').slice(0,4);
  15995. /* if(psdInput.value.length == 4){//显示确定按钮
  15996. dom.removeClass(btn,"hide");
  15997. } */
  15998. }
  15999. dom.bind(psdInput, "input", checkInput);
  16000. dom.bind(psdInput, "propertychange", checkInput)// IE9.0以下
  16001. initPsd(Data.scenePsd);
  16002. //---------热点图放大的关闭按钮======
  16003. /* var outLayer = dom.id("spotLarge");
  16004. var imgBox = dom.cla("inner",outLayer)[0];
  16005. //var close = dom.cla("close",outLayer)[0];
  16006. dom.bind(outLayer,"click",rebackSize.bind(this));
  16007. function rebackSize(e){
  16008. //if(e.target == imgBox)return;
  16009. imgBox.style.left = this.player.imgRect.left + this.player.imgRect.width/2 + "px";
  16010. imgBox.style.top = this.player.imgRect.top - (window.innerHeight - this.player.domElement.clientHeight) + "px";
  16011. imgBox.style.width = 1 + "px";
  16012. imgBox.style.height = 1 + "px";
  16013. setTimeout(function(){
  16014. dom.addClass(outLayer,"hide");
  16015. imgBox.innerHTML = "";
  16016. dom.removeClass(outLayer,"center");
  16017. },520)
  16018. }
  16019. */
  16020. //---------还有些别的事件写在toolbox里======
  16021. Toolbox(editor, player);
  16022. //=========保存==========
  16023. //changeDesc的保存不一定对
  16024. editor.exchangeTagForSave = function(needSaveTag){ //在更改热点信息、点保存按钮时会触发
  16025. var t = $.Deferred();
  16026. if(this.player.needSaveTag && this.player.needSaveTag != needSaveTag){
  16027. editor.saveSingleSpot(this.player.needSaveTag,t);
  16028. }else t.resolve();
  16029. this.player.needSaveTag = needSaveTag;
  16030. return t.promise();
  16031. }
  16032. var saveDone = function(tag, t){ //保存完单个热点
  16033. tag.imgNeedSave = false;
  16034. t.resolve();
  16035. }
  16036. editor.saveSingleSpot = function(tag, t){ //保存单个热点
  16037. var spot = {
  16038. "label" : tag.billboard.label,
  16039. "description" : tag.billboard.description,
  16040. "position" : tag.position,
  16041. "type" : tag.type,
  16042. "posGets" : {},
  16043. "sid" : tag.sid
  16044. }
  16045. for(var p in tag.posGets){
  16046. if(p == "length" || p == "list")continue;
  16047. spot.posGets[p] = tag.posGets[p].toArray();
  16048. }
  16049. if(tag.billboard.media.type == "photo"){
  16050. if(tag.imgNeedSave) spot.media = {"base64": tag.billboard.media.img.base64Src, type:"photo"};
  16051. else spot.media = {type:"photo"};
  16052. }
  16053. var form_data = new FormData();
  16054. form_data.append("sceneNum", number);//场景序号
  16055. form_data.append("hotData", JSON.stringify(spot));
  16056. form_data.append("childName", Data.CAMERA_ID);//相机名称
  16057. //console.log(spot);
  16058. $.ajax({
  16059. type: "POST",
  16060. url: "edit/saveHot",
  16061. data: form_data,
  16062. cache: false,
  16063. processData: false,
  16064. contentType: false,
  16065. success: function(data){
  16066. saveDone(tag, t);
  16067. },
  16068. error: function(data){
  16069. t.reject();
  16070. }
  16071. });
  16072. }
  16073. editor.deleteSpot = function(tag){ //删除热点
  16074. var form_data = new FormData();
  16075. form_data.append("sceneNum", number);//场景序号
  16076. form_data.append("index", tag.sid);
  16077. form_data.append("childName", Data.CAMERA_ID);//相机名称
  16078. $.ajax({
  16079. type: "POST",
  16080. url: "edit/deleteHot",
  16081. data: form_data,
  16082. cache: false,
  16083. processData: false,
  16084. contentType: false,
  16085. success: function(data){
  16086. },
  16087. error: function(data){
  16088. }
  16089. });
  16090. }
  16091. //this.save = dom.id("toolTop_save");
  16092. editor.save = function(publishFuc){//保存
  16093. //保存进度条出现 画面变暗禁止操作
  16094. $('.waiting').addClass('showloading');
  16095. var data = {};//没用了
  16096. var data1 = {};
  16097. var sceneDec = document.getElementsByClassName("introduce-detail")[0].getElementsByTagName("span")[0].innerHTML;
  16098. var psd = editor.modes['psd'].getMode() && psdInput.value;
  16099. data1.sceneName = dom.id("pjtName").value;
  16100. data1.sceneDec = sceneDec;
  16101. data1.scenePsd = psd ? psd : "";
  16102. data1.sceneType = typeIndex[ CONSTANT.SCENETYPE.indexOf(dom.cla("selection", dom.id("type"))[0].innerText) ] || 0;
  16103. data1.sceneIndex = $(".styleZBox .styleZ_content ul").find(".active").index();
  16104. if(player.thumbNeedSave){
  16105. data1.thumbBigImg = player.thumbBigImg;
  16106. data1.thumbSmallImg = player.thumbSmallImg;
  16107. }
  16108. if(player.fLogoNeedSave){
  16109. data1.floorLogoImg = player.floorLogoImg;
  16110. }
  16111. data1.designImg = editor.getDesignImg();//wallImg
  16112. data1.floorLogo = (player.floorLogoImg || Data.floorLogo =="1" || Data.floorLogo == 1) ? 1 : 0;
  16113. data1.thumbImg = (player.thumbImg==true ||player.thumbImg =="1" || player.thumbImg == 1) ? 1 : 0;
  16114. data1.floorLogoSize = this.player.model.floorLogos[0].scale.x * 100;
  16115. if(!Data.version)Data.version = 0;
  16116. ++Data.version;
  16117. data1.version = Data.version;
  16118. //data1.version = (new Date()).getTime()+"";//Data.version;
  16119. data1.currentPanoId = player.currentPano.id;
  16120. if(player.EntryInfo){
  16121. data1.entry = { panoId: player.EntryInfo[0],
  16122. quaternion: player.EntryInfo[1].toArray(),
  16123. lon:player.EntryInfo[2],
  16124. lat:player.EntryInfo[3]}
  16125. }else if(Data.entry){
  16126. data1.entry = Data.entry;
  16127. }
  16128. var Done = function(){ //保存成功以后
  16129. //画面恢复
  16130. //记录图片等数据修改的变量归0
  16131. //editor.showMsgBox("保存成功","您的场景保存成功。</span>",{btns:["确定"],funcs:[]});
  16132. $('.waiting').removeClass('showloading');
  16133. for(var i=0; i<player.hotspots.length; i++){
  16134. player.hotspots[i].imgNeedSave = false;
  16135. }
  16136. //player.spotImgsDelete = [];
  16137. player.thumbNeedSave = false;
  16138. player.fLogoNeedSave = false;
  16139. if(publishFuc && (publishFuc instanceof Function)){
  16140. //editor.showMsgBox("确定发布","<span style='text-align:center'>是否确定发布?</span>",{btns:["确定","取消"],funcs:[publishFuc]});
  16141. //success_dialog_double('确定发布','是否确定发布?',publishFuc);
  16142. publishFuc();
  16143. }else{
  16144. editor.showInfo({result:true, title:"保存成功"});
  16145. }
  16146. }
  16147. editor.exchangeTagForSave().then(function(){
  16148. var t = $.Deferred();
  16149. layer.dataUtil.saveEditInfo(data,data1,t);
  16150. return t.promise();
  16151. }).done(Done).fail(
  16152. //function(o){if(o instanceof Function)o(); else editor.showMsgBox("确定发布","<img src='images/prompt-false.png' alt='png'><span>"+o+ "</span>",{btns:["确定"]});}
  16153. function(o){
  16154. if(o instanceof Function)
  16155. o();
  16156. else
  16157. error_dialog("提示",o);
  16158. $('.waiting').removeClass('showloading');
  16159. }
  16160. );
  16161. }
  16162. editor.getDesignImg = function() {//获取保存墙面图
  16163. //this.fullScreen();
  16164. var canvas = document.getElementById('dynamiccanvas2d');
  16165. if(!autodraw)
  16166. {
  16167. return null;
  16168. }
  16169. // 图片导出为 png 格式
  16170. var type = 'png';
  16171. var imgData = canvas.toDataURL(type);
  16172. //上传到服务器
  16173. return imgData;
  16174. };
  16175. //window.location.href = 'show.html?m='+number;
  16176. //不知道提前写会不会防止markspot加载背景图延迟
  16177. var markspotImg = new Image;
  16178. markspotImg.src = "images/markspotAll.png";
  16179. }
  16180. editor.changeSnapState = function(state){//热点采集数量显示变化
  16181. //CONSTANT.MAX_SPOT_COUNT = 2;
  16182. var count = function(){
  16183. if(editor.player.tagManager.tagDiscs.length>=CONSTANT.MAX_SPOT_COUNT){
  16184. editor.snap
  16185. dom.addClass(editor.snap,"unable");
  16186. $(editor.snap).find("span").text("已满"+ CONSTANT.MAX_SPOT_COUNT +"个")
  16187. }else{
  16188. $(editor.snap).find("span").text("新增热点")
  16189. if(state!=false)dom.removeClass(editor.snap,"unable");
  16190. }
  16191. }
  16192. if(state){
  16193. dom.removeClass(editor.snap,"unable");
  16194. count();
  16195. }else if(state == false){
  16196. dom.addClass(editor.snap,"unable");
  16197. //count();
  16198. }else if(state == void 0){
  16199. count();
  16200. }
  16201. }
  16202. editor.finish = function(){//热点采集结束 收尾 归位
  16203. this.setMarkspotDisplayNum(1);
  16204. this.pointsElem[0].style.display = "none";
  16205. this.pointsElem[1].style.display = "none";
  16206. this.player.markspot = null;
  16207. this.player.posGets = {};
  16208. //this.select.style.display = "none";
  16209. //this.snap.style.color = "";
  16210. this.changeSnapState(true);//dom.removeClass(this.snap,"unable");
  16211. this.player.reticule.visible = true;
  16212. //dom.removeClass(this.player.domElement,"grab");
  16213. this.ok.style.display = "";
  16214. this.player.cancelPanoDisable();
  16215. }
  16216. editor.clearCollect = function(){//放弃选点 清除
  16217. if(this.player.startGetPos){
  16218. this.player.startGetPos = false; this.player.domElement.style.cursor = ""; dom.addClass(this.pointsElem[0],'chosen');
  16219. }
  16220. if(!this.player.markspot) return;
  16221. this.player.markspot.elem.parentNode.removeChild(this.player.markspot.elem);
  16222. this.player.allHotspots.pop();
  16223. this.finish();
  16224. }
  16225. editor.global.enablePanel = function(){// 初始飞入后解禁
  16226. dom.removeClass($(".pinBottom.left")[0],"unable");
  16227. /* dom.removeClass($(".hotPointBox")[0],"unable");
  16228. dom.removeClass($(".informationBox")[0],"unable");
  16229. dom.removeClass($(".toolBox")[0],"unable"); */
  16230. dom.removeClass($(".editor")[0],"unable");
  16231. dom.removeClass($(".toolTop")[0],"unable");
  16232. }
  16233. var a = document.getElementsByTagName('input');
  16234. for(var i=0; i<a.length;i++){a.draggable = false;}
  16235. e.exports = editor;
  16236. },{
  16237. "dom": "dom",
  16238. "Hotspot":"Hotspot",
  16239. "toolbox":"toolbox",
  16240. "ScrollBar":"ScrollBar",
  16241. "List":"List"
  16242. }
  16243. ],
  16244. "toolbox":[function(t, e){//改 加 内有保存发布、 图片上传裁剪功能
  16245. e.exports = function(editor, player){
  16246. var dom = t("dom");
  16247. function controlBox() {
  16248. $(".controlBox").css("display", "block");
  16249. setTimeout(function () {
  16250. $(".controlBox").css("opacity", "1");
  16251. }, 0);
  16252. $(".controlBox a").click(function () {
  16253. $(".controlBox").css("opacity", "0");
  16254. setTimeout(function () {
  16255. $(".controlBox").css("display", "none");
  16256. }, 1000);
  16257. })
  16258. } //控件窗口
  16259. var saveFuc = function(publishFuc){
  16260. //要一次性展示
  16261. if($("#pjtName").val() == ""){
  16262. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请填写 信息 —— 项目名称!</span>',{btns:["返回填写"]})
  16263. error_dialog("提示","请完善项目信息!");
  16264. $("#information").click();
  16265. $("#pjtName").addClass("empty_warn");
  16266. }else if(editor.selectList.type.getValue()=="请点击选择"){
  16267. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请选择 信息 —— 类别!</span>',{btns:["返回选择"]})
  16268. error_dialog("提示","请完善项目信息!");
  16269. $("#information").click();
  16270. $(".selection").addClass("empty_warn");
  16271. }else if(player.chosenSpot && player.chosenSpot.billboard.label == ""){
  16272. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请填写 热点 —— 标题!</span>',{btns:["返回填写"],funcs:[]})
  16273. error_dialog("提示","请填写热点标题!");
  16274. $("#hotPoint").click();
  16275. dom.addClass(editor.metaTitle.parentElement, "warn");
  16276. }else if(editor.modes.psd.getMode() == 1 && $("#scenePSD .word input")[0].value.length!=4){
  16277. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>信息 —— 密码要4位字符!</span>',{btns:["设为公开,并保存","返回设置"]
  16278. // ,funcs:[function(){$("#scenePSD .MenuOptions>*")[0].click(); saveFuc(publishFuc); }]})
  16279. error_dialog("提示","场景密码必须4位!");
  16280. $("#information").click();
  16281. }
  16282. //else if(!editor.player.thumbImg && Data.thumbImg){
  16283. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>初始画面未设置。</span>',{btns:["确定"]});
  16284. //}
  16285. else{
  16286. if(publishFuc instanceof Function) window.newOpen_link = window.open('loading.html');
  16287. editor.save(publishFuc);
  16288. }
  16289. }
  16290. var publishFuc = function(){
  16291. $('.waiting').addClass('showloading');
  16292. $.ajax({
  16293. url:"edit/publishScene",
  16294. type: 'POST',
  16295. dataType: "json",
  16296. data : {sceneNum: window.number,childName: Data.CAMERA_ID},
  16297. success: function (data) {
  16298. if(data && (data==1 || data=="1")){
  16299. error_dialog("提示",'发布成功!');
  16300. if(newOpen_link)newOpen_link.location.href = 'show.html?m='+number;
  16301. else console.log('窗口为空,被拦截?')
  16302. }else{
  16303. error_dialog("提示",'发布失败!');
  16304. setTimeout(function(){
  16305. if(newOpen_link)newOpen_link.close();
  16306. },500)
  16307. }
  16308. $('.waiting').removeClass('showloading');
  16309. },
  16310. error: function (msg) {
  16311. console.log('发布失败');
  16312. if(newOpen_link)newOpen_link.close();
  16313. $('.waiting').removeClass('showloading');
  16314. }
  16315. });
  16316. }
  16317. $("#toolTop_save").click(saveFuc);
  16318. $("#toolTop_publish").click(function(){
  16319. //saveFuc(publishFuc);
  16320. success_dialog_double('确定发布','是否确定发布?',function(){saveFuc(publishFuc)});
  16321. });
  16322. $("#toolTop_exit").click(function(){
  16323. //editor.showMsgBox("退出提示","是否保存场景?",{btns:["确定"],funcs:
  16324. success_dialog_double('退出','是否确定退出?',function(){window.location.href = 'index.html'; });
  16325. })
  16326. $(function () {
  16327. $(".function li").click(function(){
  16328. $("#draw_Tools li").find("a").removeClass("draw_Tools-a");
  16329. });
  16330. $("#draw_Tools li").click(function(){
  16331. $("#draw_Tools li").find("a").removeClass("draw_Tools-a");
  16332. $(this).find("a").addClass("draw_Tools-a");//画墙一栏选中状态
  16333. })
  16334. /* $(".function li:eq(0) img,.function li:eq(0) span").click(function () {
  16335. $(".noteBox").css("display", "block");
  16336. setTimeout(function () {
  16337. $(".noteBox").css("opacity", "1");
  16338. }, 0);
  16339. });
  16340. $(".noteBox a").click(function () {
  16341. $(".noteBox").css("opacity", "0");
  16342. setTimeout(function () {
  16343. //$(".noteBox").css("display", "none");
  16344. var textid = $("#noteInput_text")[0].dirName;
  16345. if(textid!=null)
  16346. {
  16347. layer.deleteVector(textid);
  16348. layer.control.refreshCanvas = true;
  16349. }
  16350. }, 1000);
  16351. }) //标签属性框 */
  16352. })
  16353. $(function(){
  16354. /* $(".prompt-popup a").click(function(){
  16355. $(".prompt-popupBox").css("display","none");
  16356. }) */
  16357. var order;
  16358. $('#information_file').click(function(){
  16359. $(".myAccount-cutAvatar-main>div:last").css("display","none");
  16360. $(".myAccount-cutAvatar-main>div:first").removeClass("logo-cutAvatar");
  16361. $(".myAccount-cutAvatar-top>span").text("裁剪缩略图");
  16362. initCropper($('#myAccount-cutAvatar-img'),$('#information_file'),16/8);
  16363. order = 1;
  16364. })
  16365. $('#information_logo_file').click(function(){
  16366. $(".myAccount-cutAvatar-main>div:last").css("display","block");
  16367. $(".myAccount-cutAvatar-main>div:first").addClass("logo-cutAvatar");
  16368. $(".myAccount-cutAvatar-top>span").text("裁剪地面标志");
  16369. initCropper($('#myAccount-cutAvatar-img'),$('#information_logo_file'),1);
  16370. order = 2;
  16371. })
  16372. $('#myAccount-cutAvatar-submit').click(function(){
  16373. if(order == 1){order =1}else if(order == 2){order = 2};
  16374. $('.myAccount-cutAvatar').css("display","none");crop(order);
  16375. })
  16376. //裁剪框
  16377. $(".myAccount-cutAvatar-top a").click(function(){
  16378. $('.myAccount-cutAvatar').css("display","none");
  16379. })
  16380. })
  16381. var initCropper = function (img, input,Ratio){
  16382. var radius;if(Ratio == 1){radius = '50%'} else {radius = '0px'};
  16383. var $image = img;
  16384. var options = {
  16385. aspectRatio: Ratio, // 纵横比
  16386. viewMode: 0,
  16387. preview: '.myAccount-cutAvatar-img-preview' // 预览图的class名
  16388. };
  16389. $image.cropper(options);
  16390. var $inputImage = input;
  16391. var uploadedImageURL;
  16392. if (URL) {
  16393. // 给input添加监听
  16394. $inputImage.change(function () {
  16395. editor.finishSetEntry();
  16396. var files = this.files;
  16397. var file;
  16398. if (!$image.data('cropper')) {
  16399. return;
  16400. }
  16401. if (files && files.length) {
  16402. file = files[0];
  16403. // 判断是否是图像文件
  16404. if (/^image\/\w+$/.test(file.type)) {
  16405. // 如果URL已存在就先释放
  16406. if (uploadedImageURL) {
  16407. URL.revokeObjectURL(uploadedImageURL);
  16408. }
  16409. uploadedImageURL = URL.createObjectURL(file);
  16410. // 销毁cropper后更改src属性再重新创建cropper
  16411. $image.cropper('destroy').attr('src', uploadedImageURL).cropper(options);
  16412. $inputImage.val('');
  16413. $(".myAccount-cutAvatar").css("display","block");
  16414. } else {
  16415. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>请选择一个图像文件!</span>');
  16416. error_dialog("提示","请选择一个图像文件!");
  16417. }
  16418. var T = setInterval(function(){
  16419. var flag = $(".myAccount-cutAvatar-main span:first").hasClass("cropper-view-box");
  16420. if(flag){
  16421. $(".cropper-view-box").css("borderRadius",radius);clearInterval(T);
  16422. }
  16423. },5)
  16424. }
  16425. });
  16426. } else {
  16427. $inputImage.prop('disabled', true).addClass('disabled');
  16428. }
  16429. }
  16430. function dataURLtoBlob(dataurl) {
  16431. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  16432. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  16433. while(n--){
  16434. u8arr[n] = bstr.charCodeAt(n);
  16435. }
  16436. return new Blob([u8arr], {type:mime});
  16437. }
  16438. var scaleImg = t("scaleImg");
  16439. var crop = function(order){
  16440. if(order == 1){id = $('#showInformation')}
  16441. else {id = $('#showInformationLogo')};
  16442. var $image = $('#myAccount-cutAvatar-img');
  16443. var $target = id;
  16444. var canvas = $image.cropper('getCroppedCanvas');
  16445. var size = order==1 ? 160 : 512;
  16446. var png = scaleImg(size/canvas.width, canvas,'jpeg');
  16447. png.base64Src = png.src;
  16448. var blob = dataURLtoBlob(png.src);
  16449. png.src = window.URL.createObjectURL(blob);
  16450. $target.css('background-image', "url('"+png.src+"')");
  16451. $target.css("display","block");
  16452. if(order == 1){
  16453. player.thumbImg = png.base64Src;
  16454. player.thumbNeedSave = true;
  16455. }else{
  16456. player.floorLogoImg = png.base64Src;
  16457. player.fLogoNeedSave = true;
  16458. png.onload = function(){
  16459. player.model.changeFloorLogo({"image":this});
  16460. /* var t = new THREE.Texture(png);
  16461. t.needsUpdate=!0;
  16462. player.model.floorLogo.material.uniforms.map.value = t;
  16463. player.model.floorLogo.material.needsUpdate=!0;
  16464. */
  16465. }
  16466. }
  16467. return png;
  16468. };
  16469. }
  16470. }, {
  16471. "dom": "dom",
  16472. "scaleImg":"scaleImg"
  16473. }
  16474. ],
  16475. 116: [function(e, t, i) {///js/main.js
  16476. (function(t) {
  16477. "use strict";
  16478. var editor = e("Editor");
  16479. var dom = e("dom");
  16480. //layer && (layer.editor = editor);
  16481. window.Data || (window.Data = {})
  16482. Data.imgRoot = "images/images" + number + "/"; //+'/hot/';
  16483. //Data.imgRoot2 = "http://4dkk.4dage.com/FDKKIMG/";
  16484. Data.imgRoot2 = "images/"; //+'/hot/';
  16485. window.ifTest = window.location.href.substring(window.location.href.indexOf("?")+1).indexOf('test')>-1;
  16486. window.keyCon = true;//当编辑输入框被focus时不能keydown控制相机
  16487. //Data.spotImgRoot = prefix + "images/images" + number + "/"; //+'/hot/'; //到底是要读7牛的还是本地的呢 伤脑筋哦
  16488. Data.spotImgRoot = "images/images" + number + "/"; //+'/hot/';
  16489. var checkLen = { //HB
  16490. project_name1:function(val){
  16491. var project_name1 = $("#project-name1");
  16492. var len = $(".project-name input").val().length;
  16493. project_name1.attr("data-size",15 - len);
  16494. return len;
  16495. },
  16496. project_name2:function(val){
  16497. var project_name2 = $("#project-name2");
  16498. var len = $("#pjtName").val().length;
  16499. project_name2.attr("data-size",15 - len);
  16500. return len;
  16501. },
  16502. editor2:function(html){
  16503. var all = 200;
  16504. var len = 0;
  16505. var pFlag = false;
  16506. html.replace(/<p>/ig,function(){
  16507. if(!pFlag){ pFlag = true; }
  16508. else{ len += 8; }
  16509. })
  16510. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  16511. c = c.substring(1,c.length-1);
  16512. len +=c.length;
  16513. if(c != ""){
  16514. c.replace(/&nbsp;/ig,function(){
  16515. len -= 5;
  16516. });
  16517. }
  16518. })
  16519. var span = document.getElementById("project-intro2");
  16520. if(html == ''){all = 200};
  16521. span.setAttribute("data-size",all - len);
  16522. return all - len;
  16523. },
  16524. editor1:function(html){
  16525. var all = 200;
  16526. var len = 0;
  16527. var pFlag = false;
  16528. html.replace(/<p>/ig,function(){
  16529. if(!pFlag){ pFlag = true; }
  16530. else{ len += 8; }
  16531. })
  16532. html.replace(/>([\s\S\r\n\.]*?)</ig,function(c){
  16533. c = c.substring(1,c.length-1);
  16534. len +=c.length;
  16535. if(c != ""){
  16536. c.replace(/&nbsp;/ig,function(){
  16537. len -= 5;
  16538. });
  16539. }
  16540. })
  16541. var span = document.getElementById("project-intro1");
  16542. if(html == ''){all = 200};
  16543. span.setAttribute("data-size",all - len);
  16544. return all - len;
  16545. }
  16546. }//检测内容长度
  16547. function i() {
  16548. var e = Y.getModelIDFromQueryString(); //读取后缀
  16549. if (!e)
  16550. return b(null, "loading-failed");
  16551. var t = Y.parseSidUrl(e)
  16552. , i = l()
  16553. , a = c()
  16554. , s = o()
  16555. , u = V.quickstart.enabled
  16556. , g = null
  16557. , m = null
  16558. , v = null
  16559. , w = null
  16560. , T = null
  16561. , x = null
  16562. , S = null
  16563. , M = null
  16564. , R = null
  16565. , P = null
  16566. , O = null
  16567. , L = null
  16568. , N = new ue;
  16569. r(s);
  16570. /* h({ //MP开头写法
  16571. urlBase: t.urlBase
  16572. }).then...... */
  16573. $.ajax("data/"+window.number+"/someData.json",{dataType: "json"}).done( function(e){ //改
  16574. e.files.templates[0] = e.files.templates[0].replace("{{number}}",window.number);
  16575. window.MP_PREFETCHED_MODELDATA = e;
  16576. h({
  16577. urlBase: t.urlBase
  16578. }) //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  16579. }).then(function(i) {
  16580. return re.init(),
  16581. d(t, e) //getModel and load
  16582. }).then(function(e) {
  16583. return P = e,
  16584. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  16585. startSource: i,
  16586. autoplay: V.autoplay,
  16587. quickstart: u
  16588. }),
  16589. P.urls.init() //加载file,但是不需要了
  16590. }).then(function() {
  16591. return P.loadPanos()
  16592. }).then(function() {
  16593. m = X.getStartCameraOptions(P, P.panos), //设置初始视角
  16594. S = A(P),
  16595. O = y(u, m.mode),
  16596. v = O.controls,
  16597. w = O.player,
  16598. T = O.director,
  16599. x = O.tagManager,
  16600. M = O.tileDownloader,
  16601. R = O.qualityManager,
  16602. L = O.panoRenderer,
  16603. C(P, S, O, s),
  16604. P.supportsTiles && M.start(),
  16605. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  16606. u = !1);
  16607. var e = null;
  16608. if (u) {//qust = 1
  16609. de.warn("Quickstart engaged. Hold on to your knickers.");
  16610. var t = v.controls[D.PANORAMA];
  16611. g = new ie(R,S.scene,S.camera,t,s),
  16612. _(S, s, P),
  16613. e = g.load(m).then(function() {
  16614. S.addComponent(g),
  16615. S.once(le.AfterRender, function() {
  16616. de.warn("First render after quickstart load finished.")
  16617. })
  16618. })
  16619. }
  16620. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  16621. }).then(function() {
  16622. return f(P, U.onProgress, i, !u, a)
  16623. }).then(function() {
  16624. if (m.quickstart = u,
  16625. I(P, S, O, s),
  16626. S.started || _(S, s, P),
  16627. H.modelLoaded(P, w, v, V.autoplay),
  16628. E(w, P, m, V.autoplay).done(function() {
  16629. T.autoTour()
  16630. }),
  16631. !P.supportsTiles) {
  16632. var e = new Z(P,w);
  16633. e.start()
  16634. }
  16635. u && (S.removeComponent(g),
  16636. g.destroy(),
  16637. m.pano.enter()),
  16638. U.init(P, T, w, v, S, m, H.getSessionId()),
  16639. U.endLoading(P, T, x),
  16640. S.once(le.AfterRender, function() {
  16641. N.setAppReadyTime();
  16642. var e = N.calcFullLoadingTime();
  16643. de.warn("Total load time: " + e / 1e3),
  16644. H.loadComplete(e),
  16645. de.warn("First render after model load finished.")
  16646. console.log(O)
  16647. editor.bind(w);
  16648. }),
  16649. S.on(le.MemoryUsageUpdated, n)
  16650. }).fail(b.bind(this, e))
  16651. }
  16652. function loadAllInfo(fuc){ //加 xzw 所有请求按顺序加载
  16653. window.loadInfoTime = window.loadInfoTime ? window.loadInfoTime+1 : 1;
  16654. console.log("第"+window.loadInfoTime+"次加载信息");
  16655. getFirstData().then(checkLogin).then(getData).then( GetThumbImg ).then(fuc).fail(function(){
  16656. if(window.loadInfoTime < 3) loadAllInfo(fuc);
  16657. else {
  16658. y.error("getInfo-failed");
  16659. setTimeout(function(){
  16660. window.location.href = "404.html";
  16661. },8000)
  16662. }
  16663. });
  16664. }
  16665. function checkLogin(){ //加 xzw 是否登陆
  16666. var t = $.Deferred();
  16667. $.ajax({
  16668. url:"camera/isLogin",
  16669. type: 'POST',
  16670. data : {num: window.number},
  16671. success: function (data) {
  16672. if(data && data!="0"){
  16673. Data.CAMERA_ID = data;
  16674. //startLoad();
  16675. t.resolve();
  16676. }else{
  16677. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>您没有登录,请登录后再编辑</span>');
  16678. error_dialog_double('提示','您没有登录,请登录后再编辑',function(){
  16679. window.open(CONSTANT.MAINURL,"blank")
  16680. });
  16681. y.endLoading("forceQuit");//进度条等消失
  16682. //t.reject();
  16683. }
  16684. },
  16685. error: function (msg) {
  16686. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>您没有登录,请登录后再编辑</span>');
  16687. error_dialog_double('提示','您没有登录,请登录后再编辑',function(){
  16688. window.open(CONSTANT.MAINURL,"blank")
  16689. });
  16690. y.endLoading("forceQuit");
  16691. //t.reject();
  16692. }
  16693. });
  16694. return t.promise();
  16695. }
  16696. function getFirstData(){//首次编辑的数据是拍摄时的数据 要比getData前加载 //加 xzw
  16697. var t = $.Deferred();
  16698. $.ajax({
  16699. url:"scene/getInfo",
  16700. type: 'POST',
  16701. dataType: "json",
  16702. data : {num: window.number},
  16703. success: function (data) {
  16704. if(data && data!="0"){
  16705. window.Data = $.extend(Data,data);
  16706. if(parseInt(Data.status) == 0){
  16707. window.location.href = "404.html?m=wait"+"&m="+window.number;//模型正在计算
  16708. return;
  16709. }else if(parseInt(Data.status) == -1) {
  16710. window.location.href = "404.html?m=404";//无
  16711. return;
  16712. }//1 or undefine都继续执行
  16713. Data.version = parseInt(data.version || 0);
  16714. var createTime = Data.createTime;
  16715. $(".model-title").text(Data.sceneName || '四维看看');
  16716. $(".model-title2").text(Data.sceneName || '四维看看');
  16717. $("#pjtName")[0].value = Data.sceneName || '';
  16718. $('.introduce-detail span')[0].innerHTML = Data.sceneDec;//直接text()会得不到<a>这类HTML文字
  16719. $(".show_count").text(Data.shootCount);
  16720. $(".show_data").text(createTime);
  16721. $("#edit2").attr('data-more',Data.sceneDec || '');
  16722. Data.sceneType = parseInt(Data.sceneType);
  16723. if(layer.editor.selectList["type"]){//有的话说明selectList["type"]先于Data.SCENETYPE
  16724. var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
  16725. //var typeName = ["文博","地产","电商","餐饮","家居","其他"];
  16726. var type = CONSTANT.SCENETYPE[typeIndex.indexOf(Data.sceneType)];
  16727. if(type) layer.editor.selectList["type"].selectFromOutSide(type);
  16728. }
  16729. t.resolve();
  16730. }else{
  16731. //editor.showMsgBox("提示",'<img src="images/prompt-false.png" alt="png"><span>数据加载失败 错误代码firstData</span>');
  16732. console.log("数据1加载失败");
  16733. t.reject();
  16734. }
  16735. },
  16736. error: function (msg) {
  16737. console.log("数据1加载失败");
  16738. t.reject();
  16739. }
  16740. });
  16741. return t.promise();
  16742. }
  16743. function getData(){//加 xzw 场景名称等数据加载
  16744. var t = $.Deferred();
  16745. $.ajax(ifTest?"data/scene.json?m="+(new Date()).getTime() : "data/data"+number+"/scene.json?m="+(new Date()).getTime(), {
  16746. //return $.ajax(prefix+"data/data"+number+"/floor.json?m="+(new Date()).getTime(), {
  16747. crossDomain: !0,
  16748. dataType: "json",
  16749. beforeSend: function(t) {
  16750. v.token && t.setRequestHeader("Authorization", "Token " + v.token)
  16751. }
  16752. }).done(function(e) {
  16753. this.baseUrl = "images/images"+number+"/{{filename}}";
  16754. window.Data = $.extend(Data,e);
  16755. Data.sceneName = e.sceneName; //覆盖firstData
  16756. Data.sceneDec = e.sceneDec; //覆盖firstData
  16757. Data.sceneType = e.sceneType;
  16758. Data.floorLogo = (e.floorLogo=="1" || e.floorLogo == 1) ? 1 : 0;
  16759. Data.thumbImg = (e.thumbImg=="1" || e.thumbImg == 1) ? 1 : 0;
  16760. Data.entry = e.entry;
  16761. Data.version = parseInt(e.version || 0);
  16762. Data.floorLogoSize = parseInt(Data.floorLogoSize || 100);
  16763. if(Data.sceneName != undefined){
  16764. $(".model-title").text(Data.sceneName || '四维看看');
  16765. $(".model-title2").text(Data.sceneName || '四维看看');
  16766. $("#pjtName")[0].value = Data.sceneName || '';
  16767. }
  16768. $('.introduce-detail span')[0].innerHTML = Data.sceneDec;//直接text()会得不到<a>这类HTML文字
  16769. $("#edit2").attr('data-more',Data.sceneDec || '');
  16770. Data.sceneType = parseInt(Data.sceneType);
  16771. if(layer.editor.selectList["type"]){//有的话说明selectList["type"]先于Data.SCENETYPE
  16772. var typeIndex = [1,2,3,4,5,0];//0标定为其他 以后若有增加就从6开始,删除的类型继续保留数字
  16773. //var typeName = ["文博","地产","电商","餐饮","家居","其他"];
  16774. var type = CONSTANT.SCENETYPE[typeIndex.indexOf(Data.sceneType)];
  16775. if(type) layer.editor.selectList["type"].selectFromOutSide(type);
  16776. }
  16777. if(Data.sceneDec!=null&&typeof(Data.sceneDec)!='undefined')
  16778. {
  16779. checkLen.editor2(Data.sceneDec);
  16780. //checkLen.project_name2();
  16781. if(layer.editor.inputAreas.sceneDec) layer.editor.inputAreas.sceneDec.check();
  16782. }
  16783. t.resolve();
  16784. }.bind(this)).fail(function() {
  16785. (parseInt(Data.version) > 1) && console.log("数据2加载失败");
  16786. t.resolve();
  16787. //getData();
  16788. });
  16789. return t.promise();
  16790. }
  16791. function GetThumbImg(){//加 xzw 缩略图
  16792. var t = $.Deferred();
  16793. var img = new Image;
  16794. checkLen.project_name2();
  16795. $("#gui-loading .bg").css({"display": "none"});
  16796. img.src = Data.thumbImg ? Data.imgRoot +CONSTANT.LOADPIC +"?"+"m="+Data.version : "http://scene3d.4dage.com/loading/pc.jpg";
  16797. img.onload = function(){
  16798. $("#gui-loading .bg").css({"background-image": "url("+img.src+")"});
  16799. $("#gui-loading .bg").fadeIn(120);
  16800. //t.resolve();
  16801. }
  16802. return t.resolve().promise();
  16803. }
  16804. function infoGuiBind(){
  16805. $(".introduce-button").click(function(e){
  16806. if( $(".introduce-detailBox").hasClass("hide")){
  16807. $(".introduce-detailBox").removeClass("hide");
  16808. setTimeout(function(){
  16809. $(".introduce-top").addClass("open");
  16810. },50)
  16811. }else{
  16812. close();
  16813. }
  16814. })
  16815. var close = function(e){
  16816. if(e && ( dom.findParent(e.target,$(".introduce-button")[0]) || dom.findParent(e.target, $(".introduce-detailBox")[0] ))) return;
  16817. if( !$(".introduce-detailBox").hasClass("hide")){
  16818. $(".introduce-top").removeClass("open");
  16819. setTimeout(function(){
  16820. $(".introduce-detailBox").addClass("hide");
  16821. },350)
  16822. }
  16823. }
  16824. $("#player").on("touchstart",close);
  16825. $("#player").on("mousedown",close);
  16826. }
  16827. function n(e) {
  16828. ce.update(e)
  16829. }
  16830. function r(e) {
  16831. de.info("Version", "2.25.6-0-gd87e5b1"),
  16832. q.defaultMaxListeners = 1e3,
  16833. a(e),
  16834. s()
  16835. }
  16836. function o() {
  16837. return document.getElementById("player")
  16838. }
  16839. function a(e) {
  16840. e.addEventListener("dragenter", T, !1),
  16841. e.addEventListener("dragover", T, !1)
  16842. }
  16843. function s() {
  16844. F.valueFromHash("title", !0) || $(document).ready(function() {
  16845. var e = $(".model-title");
  16846. e.hide()
  16847. })
  16848. }
  16849. function l() {
  16850. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  16851. }
  16852. function c() {
  16853. return {
  16854. panoElementsToLoad: 6,
  16855. modelElementsToLoad: 0,
  16856. totalElementsLoaded: 0,
  16857. totalElementsToLoad: 0,
  16858. totalPercentageLoaded: 0,
  16859. progressCallback: null
  16860. }
  16861. }
  16862. function h(e) {
  16863. return K.loadFeatureFlags(e).done(function(e) {
  16864. K.updateDependentSettings(e, V)
  16865. })
  16866. }
  16867. function u(e) {
  16868. return Q.get(e.urlBase + "/api/v1/config/showcase", {
  16869. responseType: "json",
  16870. prefetchFrom: "config"
  16871. }).then(function(e) {
  16872. return e ? void j.extendObject(V.appConfig, e) : {}
  16873. }, function(e) {
  16874. return de.warn("Failed loading runtime config, using defaults."),
  16875. $.when({})
  16876. })
  16877. }
  16878. function d(e, t) {
  16879. var i = B.getModel({
  16880. url: t,
  16881. floors: F.valueFromHash("f", !0),
  16882. autoload: !1
  16883. })
  16884. , n = u({
  16885. urlBase: e.urlBase
  16886. });
  16887. return $.when(i, n).then(null, function(e) {
  16888. return this
  16889. })
  16890. }
  16891. function p(e, t, i, n, r) {
  16892. de.info("Model data loaded"),
  16893. de.debug("UUID: " + e.data.job.uuid),
  16894. J.init(K.getFlags()),
  16895. i && H.initKeen({
  16896. token: i,
  16897. appId: n
  16898. }),
  16899. H.initSegment({
  16900. model: e.sid,
  16901. version: "2.25.6-0-gd87e5b1",
  16902. startSource: r.startSource,
  16903. token: t,
  16904. autoplay: r.autoplay,
  16905. quickstart: r.quickstart
  16906. })
  16907. }
  16908. function f(e, t, i, n, r) {
  16909. return r.progressCallback = t,
  16910. H.sessionStart(),
  16911. e.load(n).progress(g.bind(this, r))
  16912. }
  16913. function g(e, t) {
  16914. e.modelElementsToLoad = t[1],
  16915. v(e),
  16916. m(e)
  16917. }
  16918. function m(e) {
  16919. e.totalElementsLoaded++,
  16920. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  16921. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  16922. }
  16923. function v(e) {
  16924. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  16925. }
  16926. function A(e) {
  16927. var t = new x.PerspectiveCamera;
  16928. t.layers.enable(he.PANOMARKERS),
  16929. t.layers.enable(he.RETICULE),
  16930. t.layers.enable(he.TAG);
  16931. var i = new x.Scene
  16932. , n = new x.AmbientLight(16777215);
  16933. i.add(n),
  16934. i.skybox = new W,
  16935. i.add(i.skybox),
  16936. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  16937. side: x.DoubleSide
  16938. })),
  16939. i.plane.position.y = 0,
  16940. i.plane.rotateX(-Math.PI / 2),
  16941. i.plane.material.visible = !1,
  16942. i.add(i.plane),
  16943. i.updateMatrixWorld(),
  16944. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  16945. if (e.metadata && e.metadata.camera_position) {
  16946. var t = e.metadata.camera_position
  16947. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  16948. n.position = t.clone(),
  16949. i.add(n);
  16950. var r = e.metadata.camera_quaternion
  16951. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  16952. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  16953. }
  16954. }),
  16955. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  16956. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  16957. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  16958. var r = new te(i,t,z);
  16959. return r
  16960. }
  16961. function y(e, t) {
  16962. var i = e ? 1 : 1e3
  16963. , n = J.tilegen || J.imgopt ? 6 : 2;
  16964. n = F.valueFromHash("tileconc", n);
  16965. var r = new ne
  16966. , o = new ae({
  16967. concurrentDownloads: n
  16968. })
  16969. , a = new se
  16970. , s = new P
  16971. , l = new M
  16972. , c = new S(t)
  16973. , h = new R
  16974. , u = new O(i)
  16975. , d = new L
  16976. , p = new oe;
  16977. return {
  16978. qualityManager: r,
  16979. panoRenderer: a,
  16980. tileDownloader: o,
  16981. player: c,
  16982. director: l,
  16983. modelManager: s,
  16984. tagManager: p,
  16985. displayController: u,
  16986. labelDisplayController: d,
  16987. controls: h
  16988. }
  16989. }
  16990. function C(e, t, i, n) {
  16991. var r = i.controls
  16992. , o = i.qualityManager
  16993. , a = i.panoRenderer
  16994. , s = i.tileDownloader
  16995. , l = i.modelManager;
  16996. r.init(n, l),
  16997. ee.init(i.director, r, i.player, l, t),
  16998. o.init(l),
  16999. s.init(o),
  17000. a.init(t, s, o),
  17001. l.init(s, a, o),
  17002. l.addModel(e),
  17003. t.addComponent(G)
  17004. }
  17005. function I(e, t, i, n) {
  17006. var r = i.qualityManager
  17007. , o = i.panoRenderer
  17008. , a = i.tileDownloader
  17009. , s = i.modelManager
  17010. , l = i.player
  17011. , c = i.director
  17012. , h = i.tagManager
  17013. , u = i.displayController
  17014. , d = i.labelDisplayController
  17015. , p = i.controls;
  17016. t.scene.add(e),
  17017. t.qualityManager = r;
  17018. var f = {
  17019. camera: t.camera,
  17020. director: c,
  17021. modelManager: s,
  17022. tileDownloader: a,
  17023. panoRenderer: o,
  17024. qualityManager: r,
  17025. tagManager: h,
  17026. container: n,
  17027. controls: p
  17028. };
  17029. l.init(f),
  17030. l.setScene(t.scene),
  17031. h.init(s, l),
  17032. c.init(l, s),
  17033. u.init(c, l, s, h, n),
  17034. d.init(l, s, n),
  17035. z.bindEvents(l);
  17036. t.addComponent(h);
  17037. t.addComponent(l);
  17038. t.addComponent(o)
  17039. l.sceneRenderer = t; //xzw add 方便resize
  17040. }
  17041. function E(e, t, i, n) {
  17042. return de.info("Starting player in " + i.mode),
  17043. H.report(t.sid, "started-playing", n, i.quickstart),
  17044. e.start(i)
  17045. }
  17046. function b(e, t) {
  17047. de.error(t),
  17048. k.error(t),
  17049. H.report(e, "error-" + t)
  17050. }
  17051. function w(e) {
  17052. var t = F.details();
  17053. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  17054. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  17055. H.report(e, "error-webgl-generic"))
  17056. }
  17057. function _(e, t, i) {
  17058. try {
  17059. e.start(t)
  17060. } catch (e) {
  17061. throw de.warn(e.message),
  17062. w(i.sid),
  17063. e
  17064. }
  17065. }
  17066. function T(e) {
  17067. e.stopPropagation(),
  17068. e.preventDefault()
  17069. }
  17070. e("./lib/three75-shim"),
  17071. e("./lib/array-polyfill"),
  17072. e("./lib/performance-polyfill"),
  17073. e("./lib/shaders/CopyShader.js"),
  17074. e("./lib/shaders/HorizontalBlurShader.js"),
  17075. e("./lib/shaders/VerticalBlurShader.js"),
  17076. e("./lib/postprocessing/EffectComposer.js"),
  17077. e("./lib/postprocessing/RenderPass.js"),
  17078. e("./lib/postprocessing/MaskPass.js"),
  17079. e("./lib/postprocessing/ShaderPass.js"),
  17080. window.Promise || (window.Promise = e("promise-polyfill"));
  17081. var x = e("three")
  17082. , S = (e("./util/sentry"),
  17083. e("./player"))
  17084. , M = e("./director")
  17085. , R = e("./controls/CameraControls")
  17086. , P = e("./model/ModelManager")
  17087. , O = e("./DisplayController")
  17088. , L = e("./label/LabelDisplayController")
  17089. , D = e("./enum/Viewmode")
  17090. , N = e("./util/logger")
  17091. , B = e("./showcase")
  17092. , F = e("./util/browser")
  17093. , V = e("./settings")
  17094. , U = e("./gui/gui")
  17095. , k = e("./gui/error")
  17096. , H = e("./analytics")
  17097. , G = e("./util/transitions")
  17098. , z = e("./effects")
  17099. , W = e("./objects/Skybox")
  17100. , j = e("./util/common")
  17101. , Y = (e("./util/PanoramaCollection"),
  17102. e("./util/math"),
  17103. e("./util/showcase"))
  17104. , X = e("./util/camera")
  17105. , Z = (e("./objects/Panorama"),
  17106. e("./cameras/PanoramaCamera"),
  17107. e("./preloaders"))
  17108. , q = e("events").EventEmitter
  17109. , K = e("./featureflags")
  17110. , Q = (e("./util/lerp"),
  17111. e("./util/ajax"))
  17112. , J = e("./ab")
  17113. , ee = e("./sdk/automation.js")
  17114. , te = e("./scene/SceneRenderer")
  17115. , ie = e("./scene/QuickstartManager")
  17116. , ne = e("./tile/QualityManager.js")
  17117. , re = e("./localization/localize")
  17118. , oe = e("./tag/tagManager")
  17119. , ae = e("./tile/TileDownloader")
  17120. , se = e("./tile/PanoRenderer")
  17121. , le = (e("./enum/PanoSizeClass"),
  17122. e("./enum/PanoramaEvents"),
  17123. e("./enum/SceneRendererEvents"))
  17124. , ce = e("./gui/memoryUsage")
  17125. , he = e("./enum/RenderLayers")
  17126. , ue = e("./TimingData")
  17127. , de = new N(t);
  17128. N.level = V.logLevel,
  17129. N.consoleEnabled = V.console,
  17130. i()
  17131. }
  17132. ).call(this, "/js/main.js")
  17133. }
  17134. , {
  17135. "./DisplayController": 1,
  17136. "./TimingData": 2,
  17137. "./ab": 3,
  17138. "./analytics": 4,
  17139. "./cameras/PanoramaCamera": 7,
  17140. "./controls/CameraControls": 9,
  17141. "./director": 15,
  17142. "./effects": 16,
  17143. "./enum/PanoSizeClass": 36,
  17144. "./enum/PanoramaEvents": 37,
  17145. "./enum/RenderLayers": 41,
  17146. "./enum/SceneRendererEvents": 43,
  17147. "./enum/Viewmode": 51,
  17148. "./featureflags": 59,
  17149. "./gui/error": 64,
  17150. "./gui/gui": 65,
  17151. "./gui/memoryUsage": 73,
  17152. "./label/LabelDisplayController": 91,
  17153. "./lib/array-polyfill": 92,
  17154. "./lib/performance-polyfill": 95,
  17155. "./lib/postprocessing/EffectComposer.js": 96,
  17156. "./lib/postprocessing/MaskPass.js": 97,
  17157. "./lib/postprocessing/RenderPass.js": 98,
  17158. "./lib/postprocessing/ShaderPass.js": 99,
  17159. "./lib/shaders/CopyShader.js": 100,
  17160. "./lib/shaders/HorizontalBlurShader.js": 101,
  17161. "./lib/shaders/VerticalBlurShader.js": 102,
  17162. "./lib/three75-shim": 103,
  17163. "./localization/localize": 108,
  17164. "./tag/tagManager": 124,
  17165. "./model/ModelManager": 140,
  17166. "./objects/Panorama": 148,
  17167. "./objects/Skybox": 152,
  17168. "./player": 155,
  17169. "./preloaders": 156,
  17170. "./scene/QuickstartManager": 157,
  17171. "./scene/SceneRenderer": 158,
  17172. "./sdk/automation.js": 164,
  17173. "./settings": 166,
  17174. "./showcase": 168,
  17175. "./tile/PanoRenderer": 169,
  17176. "./tile/QualityManager.js": 170,
  17177. "./tile/TileDownloader": 171,
  17178. "./util/PanoramaCollection": 178,
  17179. "./util/ajax": 181,
  17180. "./util/browser": 182,
  17181. "./util/camera": 183,
  17182. "./util/common": 185,
  17183. "./util/lerp": 188,
  17184. "./util/logger": 189,
  17185. "./util/math": 190,
  17186. "./util/sentry": 192,
  17187. "./util/showcase": 193,
  17188. "./util/transitions": 195,
  17189. events: 202,
  17190. "promise-polyfill": 213,
  17191. three: 217,
  17192. "Editor" : "Editor",
  17193. "dom" : "dom"
  17194. }],
  17195. 117: [function(e, t, i) {//"../materials/CubemapMaterial"
  17196. "use strict";
  17197. function n(e) {
  17198. e = e || {},
  17199. r.RawShaderMaterial.call(this, a.extendObject({
  17200. fragmentShader: o.cube.fragmentShader,
  17201. vertexShader: o.cube.vertexShader,
  17202. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  17203. name: "CubemapMaterial"
  17204. }, e))
  17205. }
  17206. var r = e("three")
  17207. , o = e("../shaders")
  17208. , a = e("../util/common");
  17209. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  17210. n.prototype.constructor = n,
  17211. t.exports = n
  17212. }
  17213. , {
  17214. "../shaders": 167,
  17215. "../util/common": 185,
  17216. three: 217
  17217. }],
  17218. 118: [function(e, t, i) {//"../materials/ModelTextureMaterial"
  17219. "use strict";
  17220. function n(e) {
  17221. e = e || {},
  17222. r.RawShaderMaterial.call(this, a.extendObject({
  17223. fragmentShader: o.model.fragmentShader,
  17224. vertexShader: o.model.vertexShader,
  17225. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  17226. name: "ModelTextureMaterial"
  17227. }, e))
  17228. }
  17229. var r = e("three")
  17230. , o = e("../shaders")
  17231. , a = e("../util/common");
  17232. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  17233. n.prototype.constructor = n,
  17234. n.prototype.setProjectedPanos = function(e, t, i) {
  17235. i && (this.uniforms.progress.value = 0),
  17236. e.ensureSkyboxReadyForRender(),
  17237. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  17238. this.uniforms.pano0Position.value.copy(e.position),
  17239. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  17240. t.ensureSkyboxReadyForRender(),
  17241. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  17242. this.uniforms.pano1Position.value.copy(t.position),
  17243. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  17244. }
  17245. ,
  17246. t.exports = n
  17247. }
  17248. , {
  17249. "../shaders": 167,
  17250. "../util/common": 185,
  17251. three: 217
  17252. }],
  17253. 119: [function(e, t, i) {///js/tag/Billboard/Billboard.js
  17254. (function(i) {
  17255. "use strict";
  17256. function n(e, t, i, n) {
  17257. this.div = null,
  17258. this.body = null,
  17259. this.label = e,
  17260. this.description = t,
  17261. this.parsedDescription = [],
  17262. this.media = i || {
  17263. type: null
  17264. },
  17265. this.loadingSpinner = null,
  17266. this.parser = new r({
  17267. supportLinks: !u.valueFromHash("mls"),
  17268. keepLinkLabels: !0
  17269. }),
  17270. this.state = I.CLOSED,
  17271. this.orientation = "",
  17272. this.initialTransform = "",
  17273. this.hovering = !1,
  17274. this.openTransition = null,
  17275. this.closeTransition = null,
  17276. this.openPromise = null,
  17277. this.closePromise = null,
  17278. this.animationTransition = null,
  17279. this.animationScale = 0
  17280. }
  17281. var r = e("../Parser/DescriptionParser")
  17282. , o = e("../Media/Link")
  17283. , a = e("../Media/Image")
  17284. , s = e("../Media/EmbedlyPlayer")
  17285. , l = e("../Media/EmbedlyEmbed")
  17286. , c = e("../../util/transitions")
  17287. , h = e("../../util/lerp")
  17288. , u = e("../../util/browser")
  17289. , d = e("./BillboardEvent")
  17290. , p = e("../Media/MediaEvent")
  17291. , f = e("../Parser/DescriptionChunkType")
  17292. , g = e("events").EventEmitter
  17293. , m = e("./billboardSettings")
  17294. , v = e("./overlaySettings")
  17295. , A = e("../../util/logger")
  17296. , y = new A(i)
  17297. , C = document.getElementById("tag-billboards");
  17298. C.addEventListener("touchend", function(e) {
  17299. C.style.pointerEvents = "none"
  17300. }),
  17301. C.addEventListener("touchcancel", function(e) {
  17302. C.style.pointerEvents = "none"
  17303. });
  17304. var I = {
  17305. CLOSED: "closed",
  17306. OPENING: "opening",
  17307. OPEN: "open",
  17308. CLOSING: "closing",
  17309. ACTIVE: "active"
  17310. };
  17311. n.prototype = Object.create(g.prototype),
  17312. n.prototype.build = function(e) {//xzw
  17313. //this.parsedDescription = this.parser.parse(this.description);
  17314. var t = document.createElement("div");
  17315. t.className = "tag-container has-hotzone",
  17316. this.div = t,
  17317. this.body = document.createElement("div"),
  17318. this.body.className = "tag-body";
  17319. var i = document.createElement("div");
  17320. i.classList.add("tag-content");
  17321. var n = document.createElement("div");
  17322. n.classList.add("tag-text-content");
  17323. var r = document.createElement("div");
  17324. r.className = "tag-label",//label
  17325. r.textContent = this.label || "请于右侧编辑您新的热点",//改
  17326. n.appendChild(r);
  17327. var o = document.createElement("div");
  17328. o.className = "tag-desc",//description
  17329. n.appendChild(o),
  17330. i.appendChild(n),
  17331. this.body.appendChild(i),
  17332. //this.appendDescriptionElements(this.parsedDescription, o),
  17333. this.appendMedia(),
  17334. t.appendChild(this.body),
  17335. C.appendChild(t),
  17336. this.changeDesc(this.description);//add
  17337. this.bindEvents(t, this.body)
  17338. }
  17339. ,
  17340. //xzw: add
  17341. n.prototype.changeLabel = function(title){//换标题
  17342. var container = $(this.div).find('.tag-label')[0];
  17343. container.innerHTML = "";
  17344. this.label = title;
  17345. container.textContent = this.label;
  17346. this.applyOrientation(this.orientation)//更新面板位置
  17347. }
  17348. ,
  17349. n.prototype.changeDesc = function(desc){//换摘要
  17350. var container = $(this.div).find('.tag-desc')[0];
  17351. container.innerHTML = "";
  17352. this.description = desc;
  17353. if(desc != "") $(container).addClass("hasText")
  17354. else $(container).removeClass("hasText")
  17355. this.parsedDescription = this.parser.parse(this.description);
  17356. this.appendDescriptionElements(this.parsedDescription, container);
  17357. this.applyOrientation(this.orientation)
  17358. }
  17359. ,
  17360. n.prototype.changeImg = function(img){//暂时只支持换image
  17361. var has;
  17362. if(this.media.type == "photo") has = true;
  17363. this.media = {"img":img,"type":"photo"};
  17364. has ? this.changeMedia() : this.appendMedia()
  17365. this.applyOrientation(this.orientation)
  17366. },
  17367. n.prototype.changeMedia = function() {//暂时只支持image
  17368. if (this.media && this.media.type && "error" !== this.media.type && (/* !u.valueFromHash("mls", 0) || */this.media.type === f.IMAGE)) {
  17369. this.appendLoadingSpinner();
  17370. var e = $(this.body).find(".tag-media-content")[0];
  17371. e.innerHTML = "";
  17372. e.appendChild(this.createImageElement(this.media, this.body));
  17373. }
  17374. }
  17375. //xzw-------end
  17376. n.prototype.bindEvents = function(e, t) {
  17377. var i = function(e) {
  17378. return function(t) {
  17379. if (!this.div.classList.contains("overlay")) {
  17380. var i, n = document.getElementById("player");
  17381. try {
  17382. i = new MouseEvent(e,t)
  17383. } catch (n) {
  17384. i = document.createEvent("MouseEvents"),
  17385. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  17386. }
  17387. n.dispatchEvent(i)
  17388. }
  17389. }
  17390. };
  17391. t.addEventListener("mousedown", function(e) {
  17392. e.stopPropagation()
  17393. }),
  17394. t.addEventListener("mouseup", function(e) {
  17395. e.stopPropagation()
  17396. }),
  17397. e.addEventListener("touchstart", function(e) {
  17398. C.style.pointerEvents = "auto"
  17399. }),
  17400. e.addEventListener("mousedown", i("mousedown").bind(this)),
  17401. e.addEventListener("mouseup", i("mouseup").bind(this)),
  17402. t.addEventListener("mouseover", function(t) {
  17403. this.state === I.OPEN && e.classList.remove("has-hotzone")
  17404. }
  17405. .bind(this)),
  17406. e.addEventListener("mouseenter", function(e) {
  17407. this.state !== I.CLOSING && (this.hovering = !0,
  17408. this.emit(d.ENTER))
  17409. }
  17410. .bind(this)),
  17411. e.addEventListener("mouseleave", function(e) {
  17412. this.hovering = !1,
  17413. this.emit(d.LEAVE)
  17414. }
  17415. .bind(this)),
  17416. e.addEventListener("gesturestart", function(e) {
  17417. e.preventDefault()
  17418. });
  17419. var n = e.querySelector(".tag-text-content")
  17420. , r = 0;
  17421. n.addEventListener("touchstart", function(e) {
  17422. r = e.changedTouches[0].clientY
  17423. }),
  17424. n.addEventListener("touchmove", function(t) {
  17425. function i(e) {
  17426. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  17427. }
  17428. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  17429. }),
  17430. e.addEventListener("touchmove", function(e) {
  17431. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  17432. })
  17433. }
  17434. ,
  17435. n.prototype.appendDescriptionElements = function(e, t) {
  17436. e.length > 0 && this.div.classList.add("has-text"),
  17437. e.forEach(function(e, i) {
  17438. switch (e.type) {
  17439. case f.TEXT:
  17440. //t.appendChild(this.createTextElement(e.text)); //---MP
  17441. t.innerHTML = e.text; //xzw 这样<a>等标签不会变成文字显示
  17442. break;
  17443. case f.LINK:
  17444. t.appendChild(this.createLinkElement(e.link))
  17445. }
  17446. }
  17447. .bind(this))
  17448. }
  17449. ,
  17450. /* n.prototype.appendLoadingSpinner = function() {----MP
  17451. this.loadingSpinner = document.createElement("div"),
  17452. this.loadingSpinner.classList.add("loading-spinner");
  17453. var e = document.createElement("div");
  17454. e.classList.add("gui-spinner-icon"),
  17455. this.loadingSpinner.appendChild(e),
  17456. this.body.appendChild(this.loadingSpinner)
  17457. } */
  17458. n.prototype.appendLoadingSpinner = function() {//---not by xzw
  17459. this.loadingSpinner = document.createElement("div"),
  17460. this.loadingSpinner.classList.add("loading-spinner");
  17461. var e = document.createElement("div");
  17462. e.classList.add("gui-spinner-icon");
  17463. var d = document.createElement("div");
  17464. d.classList.add("loadingPic");
  17465. var z = document.createElement("div");
  17466. z.classList.add("loadingPic-inner");
  17467. d.appendChild(z);
  17468. this.loadingSpinner.appendChild(e),
  17469. this.loadingSpinner.appendChild(d),
  17470. this.body.appendChild(this.loadingSpinner)
  17471. }
  17472. ,
  17473. n.prototype.onMediaLoadFinished = function() {
  17474. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  17475. this.applyOrientation(this.orientation),
  17476. this.loadingSpinner = null)
  17477. }
  17478. ,
  17479. n.prototype.appendMedia = function() {
  17480. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  17481. this.appendLoadingSpinner();
  17482. var e = document.createElement("div");
  17483. e.classList.add("tag-media-content");
  17484. var t = document.createElement("i");
  17485. ["icon", "icon-close-thin", "close"].forEach(function(e) {
  17486. t.classList.add(e)
  17487. }),
  17488. this.body.appendChild(t),
  17489. this.body.appendChild(e);
  17490. switch (this.media.type) {
  17491. case f.IMAGE:
  17492. e.appendChild(this.createImageElement(this.media, this.body));
  17493. break;
  17494. case f.VIDEO:
  17495. e.appendChild(this.createVideoElement(this.media, this.body));
  17496. break;
  17497. case f.RICH:
  17498. e.appendChild(this.createEmbedElement(this.media, this.body))
  17499. }
  17500. }
  17501. }
  17502. ,
  17503. n.prototype.createTextElement = function(e) {
  17504. var t = document.createElement("span");
  17505. return t.textContent = e,
  17506. t
  17507. }
  17508. ;
  17509. n.prototype.createLinkElement = function(e) {
  17510. var t = new o(e);
  17511. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  17512. t.createDomElement()
  17513. }
  17514. ,
  17515. n.prototype.createImageElement = function(e, t) {
  17516. function i() {
  17517. function e() {
  17518. m || (r.classList.remove("view-image"),
  17519. c.classList.add("overlay"),
  17520. i(),
  17521. window.addEventListener("resize", b),
  17522. c.addEventListener("click", a),
  17523. g.addEventListener("click", l),
  17524. f.addEventListener("click", s),
  17525. m = !0,
  17526. o.emit(p.IMAGE_OPENED))
  17527. }
  17528. function i() {
  17529. t.classList.add("show-info"),
  17530. h.classList.remove("collapsible"),
  17531. h.style.height = "";
  17532. /* var e = parseFloat(getComputedStyle(I).lineHeight) -----MP
  17533. , i = y + e
  17534. , r = c.clientWidth - 2 * v.boundaryWidth - C
  17535. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  17536. , s = a
  17537. , l = s * n.aspect;
  17538. l > r && (l = r,
  17539. s = l / n.aspect),
  17540. s > a && (s = a,
  17541. l = s * n.aspect),
  17542. l += C,
  17543. s += C + i,
  17544. t.style.width = l + "px",
  17545. t.style.height = s + "px",
  17546. u.style.paddingTop = e + C + "px",
  17547. o.description.length > 0 && (h.classList.add("collapsible"),
  17548. h.style.height = h.clientHeight + 12 + "px",
  17549. E.style.height = "calc(100% - " + I.clientHeight + "px)") */
  17550. //by ?:
  17551. o.description.length > 0 && (h.classList.add("collapsible"));
  17552. return $.when(this);
  17553. }
  17554. function a(e) {
  17555. e.target === c && s()
  17556. }
  17557. function s() {
  17558. m && (m = !1,
  17559. r.classList.add("view-image"),
  17560. c.classList.remove("overlay"),
  17561. h.style.height = "",
  17562. u.style.paddingTop = "",
  17563. t.style.width = "",
  17564. t.style.height = "",
  17565. window.removeEventListener("resize", b),
  17566. c.removeEventListener("click", a),
  17567. g.removeEventListener("click", l),
  17568. f.removeEventListener("click", s),
  17569. o.emit(p.IMAGE_CLOSED),
  17570. o.close(!0))
  17571. }
  17572. function l(e) {
  17573. t.classList.toggle("show-info")
  17574. }
  17575. var c = o.div
  17576. , h = c.getElementsByClassName("tag-content")[0]
  17577. , u = c.getElementsByClassName("tag-media-content")[0]
  17578. , f = t.getElementsByClassName("close")[0]
  17579. , g = h.getElementsByClassName("tag-label")[0];
  17580. c.classList.add("has-image"),
  17581. r.classList.add("view-image"),
  17582. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  17583. o.applyOrientation(o.orientation);
  17584. var m = !1
  17585. , A = getComputedStyle(h)
  17586. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  17587. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  17588. , I = h.querySelector(".tag-label")
  17589. , E = h.querySelector(".tag-desc")
  17590. , b = function() {
  17591. var e, t, n = 0;
  17592. return function() {
  17593. clearInterval(e),
  17594. clearTimeout(t),
  17595. e = setInterval(function() {
  17596. var e = c.clientHeight;
  17597. n !== e && (i(),
  17598. n = e)
  17599. }, 100),
  17600. t = setTimeout(clearInterval.bind(this, e), 1e3)
  17601. }
  17602. }();
  17603. n.on(p.IMAGE_OPENING, e);
  17604. // o.on(d.ACTIVATE, e),//加了这个再点击热点时就会变大图
  17605. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n));
  17606. // o.on(d.CLOSING, s)
  17607. }
  17608. /* var n = new a -----MP
  17609. , r = n.createDomElement();
  17610. this.once(d.OPENED, function() {
  17611. n.load(e.src).then(i).catch(function(t) {
  17612. y.warn("Failed to load image:", e.src),
  17613. y.warn("with error:", t)
  17614. }).then(this.onMediaLoadFinished.bind(this))
  17615. });
  17616. var o = this; */
  17617. //xzw:
  17618. var n = new a
  17619. ,r = n.createDomElement()
  17620. ,o = this;
  17621. if(e.img){ //如果是编辑页面添加的将是个img
  17622. n.load(e.img, this.div).then(i).fail(function(t) {
  17623. y.warn("Failed to load image:", e.src),
  17624. y.warn("with error:", t)
  17625. }).then(this.onMediaLoadFinished.bind(this))
  17626. }else{
  17627. if(!e.src) e.src = Data.spotImgRoot + "hot" +this.tag.sid + '.jpg?m=' + Data.version;
  17628. this.once(d.OPENED, function() {
  17629. n.load(e.src, this.div).then(i).fail(function(t) {
  17630. y.warn("Failed to load image:", e.src),
  17631. y.warn("with error:", t)
  17632. }).then(this.onMediaLoadFinished.bind(this))
  17633. });
  17634. }
  17635. return r
  17636. }
  17637. ,
  17638. n.prototype.createVideoElement = function(e, t) {
  17639. var i = new s({
  17640. autoPlay: !0,
  17641. autoResume: !0,
  17642. startMuted: !1,
  17643. loop: !1
  17644. })
  17645. , n = i.createDomElement();
  17646. return this.once(d.OPENED, function() {
  17647. i.load(e.src).then(function() {
  17648. this.div.classList.add("has-video"),
  17649. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  17650. i.play()),
  17651. this.on(d.OPENING, i.show.bind(i)),
  17652. this.on(d.OPENED, i.play.bind(i)),
  17653. this.on(d.CLOSING, i.pause.bind(i)),
  17654. this.on(d.CLOSED, i.hide.bind(i))
  17655. }
  17656. .bind(this)).catch(function(t) {
  17657. y.warn("Failed to embed video:", e.src),
  17658. y.warn("with error:", t)
  17659. }).then(this.onMediaLoadFinished.bind(this))
  17660. }
  17661. .bind(this)),
  17662. n
  17663. }
  17664. ,
  17665. n.prototype.createEmbedElement = function(e, t) {
  17666. var i = new l
  17667. , n = i.createDomElement();
  17668. return this.once(d.OPENED, function() {
  17669. i.load(e.src).then(function() {
  17670. this.div.classList.add("has-embed"),
  17671. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  17672. this.applyOrientation(this.orientation),
  17673. this.on(d.OPENING, i.show.bind(i)),
  17674. this.on(d.CLOSED, i.hide.bind(i))
  17675. }
  17676. .bind(this)).catch(function(t) {
  17677. y.warn("Failed to embed:", e.src),
  17678. y.warn("with error:", t)
  17679. }).then(this.onMediaLoadFinished.bind(this))
  17680. }
  17681. .bind(this)),
  17682. n
  17683. }
  17684. ,
  17685. n.prototype.open = function(e) {
  17686. return this.openPromise = $.Deferred(),
  17687. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  17688. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  17689. this.state !== I.OPEN && (this.emit(d.OPENING),
  17690. e && this.emit(d.ACTIVATING),
  17691. this.state = I.OPENING,
  17692. this.animateOpen(function() {
  17693. e && this.setActiveState(),
  17694. this.openPromise.resolve()
  17695. }
  17696. .bind(this)))
  17697. }
  17698. .bind(this), m.animation.openDelay),
  17699. c.cancel(this.closeTransition),
  17700. this.closePromise && this.closePromise.reject(),
  17701. this.closeTransition = void 0,
  17702. this.openPromise.promise())
  17703. }
  17704. ,
  17705. n.prototype.close = function(e) {
  17706. console.log('close')
  17707. return this.closePromise = $.Deferred(),
  17708. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  17709. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  17710. this.state = I.CLOSING,
  17711. this.animateClose())
  17712. }
  17713. .bind(this), m.animation.closeDelay)),
  17714. c.cancel(this.openTransition),
  17715. this.openPromise && this.openPromise.reject(),
  17716. this.openTransition = void 0,
  17717. this.closePromise.resolve(),
  17718. this.closePromise.promise())
  17719. }
  17720. ,
  17721. n.prototype.setActiveState = function() {
  17722. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  17723. this.emit(d.ACTIVATE),
  17724. this.div.classList.remove("has-hotzone"))
  17725. }
  17726. ,
  17727. n.prototype.animateOpen = function(e) {
  17728. if (this.state === I.OPENING) {
  17729. if (c.cancel(this.animationTransition),
  17730. u.detectSamsungNative())
  17731. return this.boardOrientation = null,
  17732. this.div.style.visibility = "visible",
  17733. this.emit(d.OPENED),
  17734. this.state = I.OPEN,
  17735. void (e && e());
  17736. this.div.style.webkitTransform = "scale(0)",
  17737. this.div.style.transform = "scale(0)",
  17738. this.div.style.visibility = "visible",
  17739. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  17740. this.emit(d.OPENED),
  17741. this.state = I.OPEN,
  17742. e && e()
  17743. }
  17744. .bind(this))
  17745. }
  17746. }
  17747. ,
  17748. n.prototype.animateClose = function(e) {
  17749. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  17750. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  17751. this.emit(d.CLOSED),
  17752. this.state = I.CLOSED,
  17753. this.div.style.visibility = "hidden",
  17754. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  17755. e && e()
  17756. }
  17757. .bind(this)))
  17758. }
  17759. ,
  17760. n.prototype.needsUpdate = function() {
  17761. return this.state !== I.CLOSED
  17762. }
  17763. ,
  17764. n.prototype.update = function(e, t) {
  17765. if (this.needsUpdate()) {
  17766. var i = (this.updateOrientation(e),
  17767. this.calcScale(t))
  17768. , n = {
  17769. x: (e.x + 1) * $('#player').width() / 2,
  17770. y: (e.y + 1) * $('#player').height() / 2
  17771. };
  17772. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  17773. this.div.style.webkitTransform = this.div.screenTransform,
  17774. this.div.style.transform = this.div.screenTransform
  17775. }
  17776. }
  17777. ,
  17778. n.prototype.getDimensions = function() {
  17779. return this.div.getBoundingClientRect()
  17780. }
  17781. ,
  17782. n.prototype.ifOutOfScreen = function() {//xzw add
  17783. var t = this.getDimensions();
  17784. var pad = 8;
  17785. return t.left<0-pad || t.right> $("#player").width()+pad || t.top<0-pad || t.bottom>$("#player").height()+pad;
  17786. }
  17787. ,
  17788. n.prototype.calcScale = function(e) {
  17789. return Math.sqrt(e / 40) * m.boardToDiscRatio
  17790. }
  17791. ,
  17792. n.prototype.updateOrientation = function(e) {
  17793. if (this.state !== I.ACTIVE) {
  17794. var t = 1 / 3
  17795. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  17796. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  17797. , r = "";
  17798. r += 0 === n ? "right" : 2 === n ? "left" : "",
  17799. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  17800. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  17801. 1 === i && (r = $('#player').width()>$('#player').height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  17802. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  17803. }
  17804. }
  17805. ,
  17806. n.prototype.applyOrientation = function(e) {
  17807. this.div.style.transform = this.div.style.webkitTransform = "",
  17808. this.div.classList.remove("tag-container-" + this.orientation),
  17809. this.div.classList.add("tag-container-" + e);
  17810. var t = window.getComputedStyle(this.div);
  17811. this.initialTransform = t.transform || t.webkitTransform,
  17812. "none" === this.initialTransform && (this.initialTransform = "");
  17813. var i = t.transform.slice(7, -1).split(",")
  17814. , n = -i[4]
  17815. , r = -i[5];
  17816. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  17817. this.div.style.transformOrigin = n + "px " + r + "px",
  17818. this.orientation = e
  17819. }
  17820. ,
  17821. t.exports = n
  17822. }
  17823. ).call(this, "/js/tag/Billboard/Billboard.js")
  17824. }
  17825. , {
  17826. "../../util/browser": 182,
  17827. "../../util/lerp": 188,
  17828. "../../util/logger": 189,
  17829. "../../util/transitions": 195,
  17830. "../Media/EmbedlyEmbed": 125,
  17831. "../Media/EmbedlyPlayer": 126,
  17832. "../Media/Image": 128,
  17833. "../Media/Link": 129,
  17834. "../Media/MediaEvent": 131,
  17835. "../Parser/DescriptionChunkType": 133,
  17836. "../Parser/DescriptionParser": 134,
  17837. "./BillboardEvent": 120,
  17838. "./billboardSettings": 121,
  17839. "./overlaySettings": 122,
  17840. events: 202
  17841. }],
  17842. 120: [function(e, t, i) {//"./tag/Billboard/BillboardEvent"
  17843. "use strict";
  17844. t.exports = Object.freeze({
  17845. ENTER: "billboard.enter",
  17846. LEAVE: "billboard.leave",
  17847. OPENING: "billboard.opening",
  17848. OPENED: "billboard.open",
  17849. CLOSING: "billboard.closing",
  17850. CLOSED: "billboard.closed",
  17851. ACTIVATING: "billboard.activating",
  17852. ACTIVATE: "billboard.activate"
  17853. })
  17854. }
  17855. , {}],
  17856. 121: [function(e, t, i) {//"./billboardSettings"
  17857. "use strict";
  17858. t.exports = Object.freeze({
  17859. animation: Object.freeze({
  17860. hoverOnClosing: !1,
  17861. openDelay: 100,
  17862. closeDelay: 50,
  17863. openDuration: 200,
  17864. closeDuration: 100
  17865. }),
  17866. boardToDiscRatio: 1.2
  17867. })
  17868. }
  17869. , {}],
  17870. 122: [function(e, t, i) {//"./overlaySettings
  17871. "use strict";
  17872. t.exports = Object.freeze({
  17873. boundaryWidth: 30,
  17874. boundaryHeight: 0
  17875. })
  17876. }
  17877. , {}],
  17878. 123: [function(e, t, i) {//js/tag/tag.js
  17879. (function(i) {
  17880. "use strict";
  17881. function n(e, t, i) {
  17882. var n = i.version || "0";
  17883. "0" !== n && I.info("tag defined using version " + n),
  17884. this.model = e,
  17885. this.sid = t,
  17886. this.color = (new r.Color).set(i.color || l.tagDefault),
  17887. this.hoverColor = l._darken(this.color, .2),
  17888. this.floor = null,
  17889. this.floorIndex = i.floor,
  17890. this.mode = s.PANORAMA,
  17891. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  17892. this.obj3d = null,
  17893. this.disc = null,
  17894. this.materials = {
  17895. disc: null,
  17896. pole: null
  17897. },
  17898. this.position = (new r.Vector3).copy(i.position),
  17899. //this.discPosition = (new r.Vector3).copy(i.stem.direction), //--MP xzw不要需要了
  17900. this.discWorldPosition = null,
  17901. this.discScale = .05,
  17902. //this.poleEnabled = i.stem.enabled,
  17903. this.billboard = new o(i.label,i.description,i.media,this),
  17904. this.visibleTransition = null,
  17905. this.hoveringDisc = !1;
  17906. //xzw:
  17907. if(i.posGets)this.setPosGets(i.posGets);
  17908. this.type = i.type || "note";
  17909. }
  17910. var r = e("three")
  17911. , o = e("./Billboard/Billboard")
  17912. , a = e("../settings")
  17913. , s = e("../enum/Viewmode")
  17914. , l = e("../enum/Colors")
  17915. , c = e("../enum/RenderLayers")
  17916. , h = e("../enum/RenderOrder")
  17917. , u = (e("../util/common"),
  17918. e("../util/math"))
  17919. , d = e("../util/texture")
  17920. , p = e("../objects/Panorama")
  17921. , f = e("../shaders")
  17922. , g = e("../util/transitions")
  17923. , m = e("../util/lerp")
  17924. , v = e("../util/easing")
  17925. , A = e("./Billboard/BillboardEvent")
  17926. , y = e("events").EventEmitter
  17927. , C = e("../util/logger")
  17928. , uu = e('../util/texture')//xzw add
  17929. , I = new C(i)
  17930. , E = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg==")
  17931. , b = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC")
  17932. , w = new r.PlaneBufferGeometry(1,1);
  17933. n.prototype = Object.create(y.prototype),
  17934. n.raycaster = new r.Raycaster,
  17935. n.prototype.bindEvents = function() {
  17936. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  17937. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  17938. }
  17939. ,
  17940. n.prototype.unbindEvent = function(){ //add by xzw
  17941. this.billboard.removeListener(A.ENTER, this.setHoverState.bind(this)),
  17942. this.billboard.removeListener(A.LEAVE, this.setFreeState.bind(this))
  17943. }
  17944. ,
  17945. n.prototype.remove = function(){ //add by xzw
  17946. this.unbindEvent();
  17947. this.obj3d.remove(this.disc);
  17948. this.floor.remove(this.obj3d);
  17949. this.billboard.div.parentElement.removeChild(this.billboard.div);
  17950. delete this.model.tags[this.sid];
  17951. this.tagManager.removeTag(this);
  17952. }
  17953. ,
  17954. n.prototype.rePos = function(pos){ //add by xzw 重新定位置
  17955. this.position.copy(pos);
  17956. this.obj3d.position.copy(pos);
  17957. }
  17958. ,
  17959. n.prototype.setPosGets = function(posGets){ //add by xzw 热点采集的两个点
  17960. if(posGets.list){
  17961. this.posGets = posGets;
  17962. return;
  17963. }
  17964. this.posGets = {list:[],length:2};
  17965. for(var i in posGets){
  17966. this.posGets[i] = new THREE.Vector3().fromArray(posGets[i]);
  17967. this.posGets.list.push(i);
  17968. }
  17969. }
  17970. n.prototype.TypeToChinese = function(){ //add by xzw
  17971. switch(this.type){
  17972. case "hotpoint": return "热点"; break;
  17973. case "photo": return "快照"; break;
  17974. case "note": return "注释"; break;
  17975. case "loading": return "加载"; break;
  17976. }
  17977. },
  17978. n.prototype.setElemType = function(type){ //add by xzw
  17979. this.type = type;
  17980. this.disc.material.uniforms.mask.value = uu.load("images/spots/tagFG-"+this.type+".png")
  17981. }
  17982. ,
  17983. n.prototype.build = function() {
  17984. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  17985. this.floor && (this.billboard.build(this.model.sid),
  17986. this.obj3d = this.buildObject3D(),
  17987. this.floor.add(this.obj3d)),
  17988. this
  17989. }
  17990. ,
  17991. n.prototype.buildObject3D = function() {//xzw
  17992. var e = new r.Object3D;
  17993. e.position.copy(this.position);
  17994. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  17995. t.bg.value = b,
  17996. t.mask.value = E,
  17997. t.color.value.copy(this.color),
  17998. this.materials.disc = new r.RawShaderMaterial({
  17999. transparent: !0,
  18000. vertexShader: f.tagDisc.vertexShader,
  18001. fragmentShader: f.tagDisc.fragmentShader,
  18002. uniforms: t
  18003. }),
  18004. this.disc = new r.Mesh(w,this.materials.disc),
  18005. this.disc.layers.set(c.TAG),
  18006. //this.disc.position.copy(this.discPosition),
  18007. this.disc.renderOrder = h.tagDisc,
  18008. this.disc.tag = this;
  18009. /* var i = this.buildPole(); //--MP
  18010. return i.layers.set(c.TAG),
  18011. i.renderOrder = h.tagStem,
  18012. e.add(i),
  18013. e.layers.set(c.TAG),
  18014. e.add(this.disc) */
  18015. e.add(this.disc) //去掉pole
  18016. e.name = "tagGroup";
  18017. return e
  18018. }
  18019. ,
  18020. n.prototype.buildPole = function() {//没用了
  18021. var e = new r.BufferGeometry
  18022. , t = new Float32Array(6);
  18023. return t[0] = t[1] = t[2] = 0,
  18024. t[3] = this.discPosition.x,
  18025. t[4] = this.discPosition.y,
  18026. t[5] = this.discPosition.z,
  18027. e.addAttribute("position", new r.BufferAttribute(t,3)),
  18028. this.materials.pole = new r.LineBasicMaterial({
  18029. linewidth: a.tags.pole.width,
  18030. color: a.tags.pole.color,
  18031. opacity: 0,
  18032. visible: this.poleEnabled,
  18033. transparent: !0,
  18034. depthWrite: !1
  18035. }),
  18036. new r.Line(e,this.materials.pole)
  18037. }
  18038. ,
  18039. n.prototype.setFreeState = function(e) {
  18040. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  18041. this.materials.disc.uniforms.color.value = this.color
  18042. }
  18043. .bind(this))
  18044. }
  18045. ,
  18046. n.prototype.setHoverState = function(e) {
  18047. this.billboard.open(e),
  18048. this.materials.disc.uniforms.color.value = this.hoverColor
  18049. }
  18050. ,
  18051. n.prototype.hide = function(e, t) {//xzw 热点的线pole不需要
  18052. var i = $.Deferred();
  18053. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  18054. return i.resolve().promise();
  18055. e = e || 0,
  18056. t = t || 0,
  18057. g.cancel(this.visibleTransition);
  18058. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  18059. , r = t + e
  18060. , o = t / r;
  18061. return this.visibleTransition = g.start(function(e) {
  18062. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  18063. // , i = m.property(e.materials.pole, "opacity", 0);
  18064. return function(n) {
  18065. t(n)
  18066. // e.materials.pole && i(n)
  18067. }
  18068. }(this), r * n, function() {
  18069. i.resolve()
  18070. }, o, v[a.warp.blendEasing]),
  18071. i.promise()
  18072. }
  18073. ,
  18074. n.prototype.show = function(e, t) {
  18075. var i = $.Deferred();
  18076. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  18077. return i.resolve().promise();
  18078. e = e || 0,
  18079. t = t || 0,
  18080. g.cancel(this.visibleTransition);
  18081. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  18082. , r = t + e
  18083. , o = t / r;
  18084. return this.visibleTransition = g.start(function(e) {
  18085. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  18086. // , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  18087. return function(n) {
  18088. t(n)
  18089. // e.materials.pole && i(n)
  18090. }
  18091. }(this), r * n, function() {
  18092. i.resolve()
  18093. }, o, v[a.warp.blendEasing]),
  18094. i.promise()
  18095. }
  18096. ,
  18097. /* n.prototype.closestPanoTowardTag = function(e, t) {// ---MP
  18098. var i = []
  18099. , o = []
  18100. , l = this.disc.getWorldPosition();
  18101. if (e === s.PANORAMA) {
  18102. var c = .5
  18103. , h = t.position.clone().sub(l).normalize();
  18104. i.push(p.filters.isPanoAligned()),
  18105. i.push(p.filters.inPanoDirection(l, h, c)),
  18106. i.push(p.filters.isNeighbourPanoTo(t)),
  18107. o.push(p.scoreFunctions.direction(l, h))
  18108. }
  18109. var u = new r.Vector3
  18110. , d = function(e) {
  18111. u.copy(l).sub(e.position);
  18112. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  18113. , i = a.tags.navigate.tiltTolerance;
  18114. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  18115. }
  18116. , f = function(e) {
  18117. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  18118. };
  18119. i.push(f, d),
  18120. o.push(p.scoreFunctions.distanceSquared(this, -2));
  18121. var g = this.model.panos.sortByScore(i, o);
  18122. if (a.tags.navigate.lineOfSight) {
  18123. for (var m = 0; m < g.length; m++) {
  18124. var v = g[m].pano
  18125. , A = v.position.distanceTo(l);
  18126. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  18127. return null;
  18128. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  18129. var y = n.raycaster.intersectObjects(this.model.colliders);
  18130. if (0 === y.length || y[0].distance > A)
  18131. return v
  18132. }
  18133. return null
  18134. }
  18135. return g.length > 0 && g[0].pano
  18136. } */
  18137. n.prototype.closestPanoTowardTag = function(e, t, type) {//寻找最接近热点的pano
  18138. var i = []
  18139. , o = []
  18140. , l = this.disc.getWorldPosition();
  18141. if (e === s.PANORAMA) {
  18142. var c = .5
  18143. , h = t.position.clone().sub(l).normalize();
  18144. if(type!="force") i.push(p.filters.inPanoDirection(l, h, c)); // i.push(p.filters.isPanoAligned()),
  18145. var tag = this;
  18146. i.push(function(t){ //是否可见
  18147. return t.neighbourPanos[tag.posGets.list[0]] || t.neighbourPanos[tag.posGets.list[1]];
  18148. }) //}else i.push(p.filters.isNeighbourPanoTo(t))//!force2
  18149. o.push(p.scoreFunctions.direction(l, h))
  18150. }
  18151. var u = new r.Vector3, d = function(e){
  18152. u.copy(l).sub(e.position);
  18153. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  18154. , i = a.tags.navigate.tiltTolerance;
  18155. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  18156. }
  18157. , f = function(e) {
  18158. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  18159. };
  18160. i.push(f, d),//如果force要不要不push??否则会有得到null的风险,于是就在currentPano处展开,而curentPAno处可能disc不可见。
  18161. o.push(p.scoreFunctions.distanceSquared(this, -2));
  18162. var g = this.model.panos.sortByScore(i, o);//var g = this.model.panos.sortByScore(i, o);
  18163. /* if (type!= "force" && g && a.tags.navigate.lineOfSight) {
  18164. for (var m = 0; m < g.length; m++) {
  18165. var v = g[m].pano
  18166. , A = v.position.distanceTo(l);
  18167. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  18168. return null;
  18169. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  18170. var ee = this.model.floorList.reduce(function(t, e) {
  18171. return e.hidden ? t : t.concat(e.collider.children)
  18172. }, []);
  18173. var y = n.raycaster.intersectObjects(ee);
  18174. if (0 === y.length || y[0].distance > A - this.discScale*SIZE/2)//discScale
  18175. return v
  18176. }
  18177. //if(type == "force") return this.closestPanoTowardTag(e, t, "force2");
  18178. return null;
  18179. } */
  18180. return g && g.length > 0 && g[0].pano
  18181. }
  18182. ,
  18183. n.prototype.getAngle = function(player, lookAt){//xzw 加 算视线方向与对准方向的夹角
  18184. var b = player.camera.quaternion.clone()
  18185. , _ = (new r.Matrix4).lookAt(player.currentPano.position, lookAt, new r.Vector3(0,1,0))
  18186. , T = (new r.Quaternion).setFromRotationMatrix(_)
  18187. ,R = new r.Vector3(0,0,-1).clone().applyQuaternion(b)
  18188. , P = new r.Vector3(0,0,-1).clone().applyQuaternion(T)
  18189. , O = R.angleTo(P);
  18190. return O / Math.PI * 180;
  18191. }
  18192. n.prototype.examine = function(e,type) { //校准tag xzw
  18193. var t = e.mode
  18194. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  18195. , n = this.disc.getWorldPosition();
  18196. this.billboard.setActiveState();
  18197. //xzw
  18198. e.flyingToTag = true;
  18199. var done = function(t){ t.billboard.examTimes=0; e.flyingToTag = false; }
  18200. //----end
  18201. var o = function() {
  18202. if(e.mode != "panorama"){//xzw 加
  18203. e.flyingToTag = false;
  18204. return;
  18205. }
  18206. var t = this.billboard.getDimensions()
  18207. , n = new r.Vector3;
  18208. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  18209. n.unproject(e.camera);
  18210. e.flyToPano({
  18211. pano: i,
  18212. lookAtPoint: n,
  18213. constantMoveSpeed: v=="constant" //匀速 xzw
  18214. },function(){ //函数xzw加的 因为有可能校准结束要再校准一次
  18215. if(this.billboard.ifOutOfScreen()){
  18216. this.billboard.state = "open";//为了防止有的billboard在飞过去后靠边被遮住
  18217. setTimeout(function(){
  18218. if(this.billboard.ifOutOfScreen()){
  18219. if(this.billboard.examTimes > 2){
  18220. console.log("exam>2次仍未校准,已放弃"); done(this); return;
  18221. }
  18222. o("constant");
  18223. this.billboard.examTimes++;
  18224. }else done(this);
  18225. }.bind(this),60)
  18226. }else done(this)
  18227. }.bind(this))
  18228. }.bind(this);
  18229. if (t === s.PANORAMA)
  18230. if (i !== e.currentPano || (type === "force"&& this.getAngle(e, n)>60) ) {//在click List时 转动较大的话 会不准确 可能因计算billboard位置不准确
  18231. var l = {
  18232. pano: i,
  18233. lookAtPoint: n,
  18234. duration: null,
  18235. maxDistanceOverride: null,
  18236. skipWarpingCheck: !1,
  18237. force : type == "force"//xzw
  18238. };
  18239. e.flyToPano(l, o)
  18240. } else
  18241. setTimeout(function() {
  18242. //this.billboard.open().then(function() { // ----MP 其实可以去掉 有了反而不准
  18243. o()
  18244. //})
  18245. }
  18246. .bind(this), 300);//原先是0
  18247. else {
  18248. var c = {
  18249. pano: i
  18250. };
  18251. if (n) {
  18252. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  18253. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  18254. }
  18255. c.callback = o,
  18256. c.duration = 1500,
  18257. c.mode = s.PANORAMA,
  18258. e.flyToNewMode(c)//xzw
  18259. }
  18260. }
  18261. ,
  18262. n.prototype.update = function(e, t) {
  18263. var i = new r.Vector3;
  18264. return function(e, t) {
  18265. this.discWorldPosition = this.disc.getWorldPosition(),
  18266. this.updateDisc(e, t);
  18267. /* this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t), ------MP
  18268. i.z < 1 && (i.y *= -1,
  18269. this.billboard.update(i, this.getDiscRadius(i, t)))) */
  18270. if(this.billboard.needsUpdate()){//xzw
  18271. i.copy(this.discWorldPosition).project(t);
  18272. if(i.z < 1 || this.updateBoardOrient){
  18273. i.y *= -1;
  18274. this.updateBoardOrient = false; //由点击列表而exam,更新orientation
  18275. this.billboard.div.style.opacity = "1";//由点击列表而exam, 未达到可见位置不出现 通常在左上方?
  18276. this.billboard.update(i, this.getDiscRadius(i, t))
  18277. }else{
  18278. this.billboard.div.style.opacity = "0";
  18279. }
  18280. }
  18281. }
  18282. }(),
  18283. n.prototype.updateDisc = function(e, t) {
  18284. var i = new r.Vector3
  18285. , o = new r.Vector3
  18286. , l = new r.Vector3
  18287. , c = new r.Vector3
  18288. , h = new r.Vector3;
  18289. return function(e, t) {
  18290. var u = a.tags.visibility
  18291. , d = a.tags.disc.scale
  18292. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  18293. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  18294. this.obj3d.visible) {
  18295. this.disc.quaternion.copy(t.quaternion);
  18296. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  18297. i.copy(this.discWorldPosition).project(t),
  18298. o.set($('#player').width()/2 , $('#player').height()/2, 1).multiply(i),
  18299. l.set(f / 2, 0, 0).add(o),
  18300. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  18301. h.copy(c).unproject(t);
  18302. var g = h.distanceTo(this.discWorldPosition)
  18303. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  18304. this.discScale = g * m,
  18305. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  18306. }
  18307. }
  18308. }(),
  18309. n.prototype.getDiscRadius = function(e, t) {
  18310. var i = new r.Vector3;
  18311. return function(e, t) {
  18312. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  18313. Math.abs(e.x - i.x) * $('#player').width()
  18314. }
  18315. }(),
  18316. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  18317. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  18318. }
  18319. ,
  18320. n.prototype.offScreen = function(e, t) {
  18321. var i = e.getWorldPosition().project(t);
  18322. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  18323. }
  18324. ,
  18325. n.viewportScale = function() {
  18326. return n.viewportWidth === $('#player').width() && n.viewportHeight === $('#player').height() || (n.viewportWidth = $('#player').width(),
  18327. n.viewportHeight = $('#player').height(),
  18328. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  18329. n.currentViewportScale
  18330. }
  18331. ,
  18332. t.exports = n
  18333. }
  18334. ).call(this, "/js/tag/tag.js")
  18335. }
  18336. , {
  18337. "../enum/Colors": 19,
  18338. "../enum/RenderLayers": 41,
  18339. "../enum/RenderOrder": 42,
  18340. "../enum/Viewmode": 51,
  18341. "../objects/Panorama": 148,
  18342. "../settings": 166,
  18343. "../shaders": 167,
  18344. "../util/common": 185,
  18345. "../util/easing": 186,
  18346. "../util/lerp": 188,
  18347. "../util/logger": 189,
  18348. "../util/math": 190,
  18349. "../util/texture": 194,
  18350. "../util/transitions": 195,
  18351. "./Billboard/Billboard": 119,
  18352. "./Billboard/BillboardEvent": 120,
  18353. "../util/texture" :194,
  18354. events: 202,
  18355. three: 217
  18356. }],
  18357. 124: [function(e, t, i) {///js/tag/tagManager.js
  18358. (function(i) {
  18359. "use strict";
  18360. function n() {
  18361. this.tagState = y.IDLE,
  18362. this.intersectTag = null,
  18363. this.hoveredTag = null,
  18364. this.activeTag = null,
  18365. this.tagDiscs = [],
  18366. this.raycaster = new r.Raycaster,
  18367. this.modelManager = null,
  18368. this.player = null,
  18369. this.totaltags = 0,
  18370. this.navigatingViaTag = !1
  18371. // this.enabled = !1
  18372. }
  18373. var r = e("three")
  18374. , o = e("../util/logger")
  18375. , a = e("../util/common")
  18376. , s = e("../controls/serializer")
  18377. , l = e("../objects/Snapshot")
  18378. , c = e("../settings")
  18379. , h = e("./Billboard/BillboardEvent")
  18380. , u = e("./Media/MediaEvent")
  18381. , d = e("./Media/LinkType")
  18382. , p = e("../enum/Viewmode")
  18383. , f = e("../enum/WarpStyle")
  18384. , g = e("../enum/BlackoutStyle")
  18385. , m = e("../enum/ModelManagerEvents")
  18386. , v = e("../enum/tagEvents")
  18387. , A = e("../enum/PlayerEvents")
  18388. , y = (e("../util/lerp"),
  18389. e("../enum/TagStates"))
  18390. , C = e("events").EventEmitter
  18391. , I = new o(i);
  18392. a.extend(n, C),
  18393. n.prototype.init = function(e, t) {
  18394. this.modelManager = e,
  18395. this.player = t,
  18396. this.updateModel(),
  18397. this.bindEvents()
  18398. }
  18399. ,
  18400. n.prototype.update = function(e) {
  18401. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  18402. }
  18403. ,
  18404. n.prototype.updateTags = function(e, t, i, n) {
  18405. for (var r in this.model.tags)
  18406. this.model.tags[r].update(e, t, i, n)
  18407. }
  18408. ,
  18409. n.prototype.updateVisible = function(mode, pano){ //xzw加 根据visibles数据更新热点显示
  18410. if(!(this.player || this.player.model)) return;
  18411. var tags = this.player.model.tags;
  18412. pano = pano || this.player.currentPano;
  18413. for (var r in tags){
  18414. var visible;
  18415. if(mode!="panorama"){
  18416. visible = true;
  18417. tags[r].disc.material.depthTest = true; //要被遮挡?
  18418. }else{
  18419. tags[r].disc.material.depthTest = false;
  18420. visible = tags[r].state != "rebuildHide" && (pano.neighbourPanos[tags[r].posGets.list[0]] || pano.neighbourPanos[tags[r].posGets.list[1]])
  18421. }
  18422. tags[r].disc.visible = visible;
  18423. }
  18424. }
  18425. ,
  18426. /* n.prototype.updateModel = function() {//---MP
  18427. this.model = this.modelManager.getActiveModel(),
  18428. this.gettagsFromModel(),
  18429. this.totaltags = Object.keys(this.model.tags).length
  18430. }
  18431. ,
  18432. n.prototype.gettagsFromModel = function() {
  18433. this.tagDiscs = [];
  18434. for (var e in this.model.tags) {
  18435. var t = this.model.tags[e].disc;
  18436. t && this.tagDiscs.push(t)
  18437. }
  18438. }
  18439. , */
  18440. //xzw: 获取tag的disc 因为编辑页面要一个个添加、一个个删除 所以改
  18441. n.prototype.updateModel = function() {
  18442. this.model = this.modelManager.getActiveModel(),
  18443. this.tagDiscs = [];
  18444. this.totaltags = 0;
  18445. for (var e in this.model.tags) {
  18446. this.getTag(this.model.tags[e])
  18447. }
  18448. }
  18449. ,
  18450. n.prototype.getTag = function(tag) {
  18451. this.tagDiscs.push(tag.disc);
  18452. this.totaltags ++;
  18453. tag.tagManager = this;
  18454. }
  18455. ,
  18456. n.prototype.removeTag = function(tag) {
  18457. var i = this.tagDiscs.indexOf(tag.disc);
  18458. if(i>-1){
  18459. this.tagDiscs.splice(i,1);
  18460. this.totaltags --;
  18461. }
  18462. }
  18463. ////xzw----end
  18464. n.prototype.bindEvents = function() {
  18465. function e() {
  18466. Object.keys(this.model.tags).forEach(function(e) {
  18467. var t = this.model.tags[e];
  18468. t.bindEvents(),
  18469. t.billboard.on(u.LINK_CLICK, function(e) {
  18470. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  18471. }
  18472. .bind(this)),
  18473. t.billboard.on(u.IMAGE_OPENED, function() {
  18474. this.tagState = y.EXAMINE,
  18475. this.emit(u.IMAGE_OPENED)
  18476. }
  18477. .bind(this)),
  18478. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  18479. }
  18480. .bind(this))
  18481. }
  18482. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  18483. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  18484. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  18485. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  18486. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  18487. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  18488. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  18489. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  18490. e.call(this)
  18491. }
  18492. ,
  18493. n.prototype.navigateViaLink = function(e) {
  18494. var t = s.deserialize(e);
  18495. if (t)
  18496. if (t.mode === p.PANORAMA) {
  18497. try {
  18498. this.player.model.panos.get(t.panoId)
  18499. } catch (e) {
  18500. return void I.warn("Unable to find panorama location", t.panoId)
  18501. }
  18502. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  18503. } else {
  18504. var i = {
  18505. cameraMode: t.mode,
  18506. position: t.position,
  18507. quaternion: t.quaternion,
  18508. scanId: t.panoId,
  18509. orthoZoom: t.zoom,
  18510. floorVisibility: t.floorVisibility,
  18511. thumbUrl: null,
  18512. name: null
  18513. };
  18514. this.player.flyToNewMode({
  18515. mode: t.mode,
  18516. duration: c.warp.outsideTime,
  18517. warpDest: new l(i),
  18518. force: !0
  18519. })
  18520. }
  18521. }
  18522. ,
  18523. n.prototype.handleWarpStart = function(e, t, i, n) {
  18524. this.dismissExaminedTag(),
  18525. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  18526. e && (i = g.END),
  18527. this.hideShowTagsForBlackoutStyle(i, n))
  18528. }
  18529. ,
  18530. n.prototype.handleWarpInterruption = function(e, t, i) {
  18531. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  18532. this.hideShowTagsForBlackoutStyle(t, i)
  18533. }
  18534. ,
  18535. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  18536. var i = 0
  18537. , n = 0
  18538. , r = t / 2;
  18539. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  18540. e) {
  18541. case g.END:
  18542. this.hideAlltags(r);
  18543. break;
  18544. case g.BEGINNING:
  18545. this.hideAlltags().done(this.showAlltags.bind(this, r));
  18546. break;
  18547. case g.NONE:
  18548. break;
  18549. case g.MIDDLE:
  18550. i = r,
  18551. n = r,
  18552. this.hideAlltags(n),
  18553. setTimeout(function() {
  18554. this.showAlltags(i)
  18555. }
  18556. .bind(this), n);
  18557. break;
  18558. case g.FADEIN:
  18559. setTimeout(function() {
  18560. this.showAlltags(r)
  18561. }
  18562. .bind(this), r)
  18563. }
  18564. }
  18565. ,
  18566. n.prototype.onPlayerModeChanging = function(e, t) {
  18567. t !== p.PANORAMA && this.dismissExaminedTag(),
  18568. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  18569. var i = t !== p.OUTDOOR;
  18570. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  18571. }
  18572. ,
  18573. n.prototype.onPanoChange = function(e, t) {
  18574. var i = this.navigatingViaTag;
  18575. if (this.navigatingViaTag = !1,
  18576. !i) {
  18577. //this.dismissExaminedTag(); //xzw删 否则会导致热点加上打开又被关闭
  18578. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  18579. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  18580. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  18581. }
  18582. }
  18583. ,
  18584. n.prototype.onPlayerReady = function(e, t, i) {
  18585. this.startAlltags(e, t ? i : null)
  18586. }
  18587. ,
  18588. n.prototype.onPlayerFlyingEnded = function(e, t) {
  18589. this.updateClosestTags(e)
  18590. }
  18591. ,
  18592. n.prototype.dismissExaminedTag = function() {
  18593. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  18594. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  18595. this.hoveredTag = null)
  18596. }
  18597. ,
  18598. n.prototype.startAlltags = function(e, t) {
  18599. this.model.shouldShowtags = c.tags.enabled,
  18600. this.enabled = !0,
  18601. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  18602. t && setTimeout(function() {
  18603. this.activateTag(this.model.getTagBySid(t))
  18604. }
  18605. .bind(this), c.tags.startup.fadeInDuration / 2))
  18606. }
  18607. ,
  18608. n.prototype.showAlltags = function(e, t, i) {
  18609. function n() {
  18610. o++,
  18611. o === this.totaltags && (this.model.tagsShown = !0,
  18612. r.resolve())
  18613. }
  18614. var r = $.Deferred();
  18615. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  18616. return r.resolve().promise();
  18617. var o = 0;
  18618. for (var a in this.model.tags) {
  18619. var s = this.model.tags[a];
  18620. s.show(e, t).done(n.bind(this))
  18621. }
  18622. return r.promise()
  18623. }
  18624. ,
  18625. n.prototype.hideAlltags = function(e, t) {
  18626. function i() {
  18627. r++,
  18628. r === this.totaltags && (this.model.tagsShown = !1,
  18629. n.resolve())
  18630. }
  18631. var n = $.Deferred()
  18632. , r = 0;
  18633. for (var o in this.model.tags) {
  18634. var a = this.model.tags[o];
  18635. a.hide(e, t).done(i.bind(this)),
  18636. a === this.activeTag && this.dismissActiveTag()
  18637. }
  18638. return n.promise()
  18639. }
  18640. ,
  18641. n.prototype.enableHovering = function() {
  18642. this.enabled = !0
  18643. }
  18644. ,
  18645. n.prototype.disableHovering = function() {
  18646. this.enabled = !1
  18647. }
  18648. ,
  18649. n.prototype.activateTag = function(e, t) {
  18650. t = t || y.EXAMINE,
  18651. this.activeTag = e,
  18652. this.activeTag.hoveringDisc = !0,
  18653. this.activeTag.setHoverState(t === y.EXAMINE),
  18654. this.tagState = t,
  18655. this.emit(v.TagActivated, e)
  18656. }
  18657. ,
  18658. n.prototype.dismissActiveTag = function() {
  18659. this.activeTag.hoveringDisc = !1,
  18660. this.activeTag.setFreeState(!0);
  18661. var e = this.activeTag;
  18662. this.activeTag = null,
  18663. this.tagState = y.IDLE,
  18664. this.emit(v.TagDismissed, e)
  18665. }
  18666. ,
  18667. n.prototype.clickedOnTag = function(e) {
  18668. //xzw 打开热点列表
  18669. if(this.player.markspot || this.player.startGetPos) return;
  18670. var canOpen = this.player.editor.openList(this.intersectTag.listElem)
  18671. if(!canOpen && (this.intersectTag!=this.player.chosenSpot || this.intersectTag.billboard.label == "")){ //在无法关闭当前列表时点击其他热点
  18672. return;
  18673. }
  18674. this.player.editor.openPanel(0);
  18675. //end
  18676. var t = function() {
  18677. this.navigatingViaTag = !0,
  18678. this.activeTag.examine(this.player),
  18679. this.emit(v.TagNavigation, this.activeTag)
  18680. }
  18681. .bind(this);
  18682. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  18683. this.activeTag = this.intersectTag,
  18684. t(),
  18685. !0) : (this.dismissActiveTag(),
  18686. !1)
  18687. }
  18688. ,
  18689. n.prototype.intersecttag = function() {//对应旧的findIntersectTag
  18690. var e = new r.Vector3
  18691. , t = new r.Vector3
  18692. , i = new r.Vector3;
  18693. return function(n, r, o) {
  18694. /* if (!this.enabled) //xzw 没必要
  18695. return null; */
  18696. var a = null
  18697. , s = this.tagDiscs.filter(function(e) {
  18698. return e.parent.visible
  18699. });
  18700. if (s.length > 0) {
  18701. /* var l = this.model.floors.reduce(function(e, t) {
  18702. return t.hidden ? e : e.concat(t.collider.children)
  18703. }, s); */
  18704. //xzw: 热点即使被墙挡住,只要显示就要能被hover
  18705. var l;
  18706. if(this.player.mode != "panorama") l = this.model.floors.reduce(function(e, t) {
  18707. return t.hidden ? e : e.concat(t.collider.children)
  18708. }, s);
  18709. else l = s;
  18710. e.set(n.x, n.y, -1).unproject(o),
  18711. t.set(n.x, n.y, 1).unproject(o),
  18712. i.copy(t).sub(e).normalize(),
  18713. this.raycaster.set(e, i);
  18714. var c = this.raycaster.intersectObjects(l);
  18715. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  18716. }
  18717. return this.intersectTag = a,
  18718. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  18719. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  18720. this.hoveredTag = a
  18721. }
  18722. .bind(this)),
  18723. a.billboard.on(h.LEAVE, function() {
  18724. this.hoveredTag = null
  18725. }
  18726. .bind(this))),
  18727. this.activateTag(a, y.BROWSE))),
  18728. a
  18729. }
  18730. }(),
  18731. n.prototype.rankedtagInDirection = function() {
  18732. var e = []
  18733. , t = []
  18734. , i = new r.Vector3
  18735. , n = new r.Vector3
  18736. , o = new r.Vector3;
  18737. return function(r, a, s, l) {
  18738. var c = 0;
  18739. t.length = 0;
  18740. for (var h = 0; h < this.closesttags.length; h++) {
  18741. var u = this.closesttags[h];
  18742. n.copy(u.position),
  18743. n.add(u.discPosition),
  18744. i.copy(a),
  18745. i.sub(n).negate(),
  18746. i.normalize();
  18747. var d = i.dot(l);
  18748. if (d >= 0) {
  18749. o.copy(n),
  18750. o.project(s);
  18751. var p = this.intersecttag(o, !1, s);
  18752. if (p) {
  18753. if (c >= e.length)
  18754. for (var f = 0; f < 64; f++)
  18755. e.push({
  18756. tag: u,
  18757. dot: d
  18758. });
  18759. var g = e[c];
  18760. g.tag = u,
  18761. g.dot = d,
  18762. g.position = math.projectPositionToCanvas(n, s),
  18763. t.push(g),
  18764. c++
  18765. }
  18766. }
  18767. }
  18768. return t.sort(function(e, t) {
  18769. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  18770. }),
  18771. r < t.length ? t[r].tag : null
  18772. }
  18773. }(),
  18774. n.prototype.updateClosestTags = function() {
  18775. var e = new r.Vector3
  18776. , t = 30;
  18777. return function(i) {
  18778. this.closesttags || (this.closesttags = []),
  18779. this.closesttags.length = 0;
  18780. var n = this.model.tags;
  18781. if (n)
  18782. for (var r in n)
  18783. if (n.hasOwnProperty(r)) {
  18784. var o = n[r]
  18785. , a = o.position;
  18786. e.copy(i),
  18787. e.sub(a).negate();
  18788. var s = e.lengthSq();
  18789. s < t && this.closesttags.push(o)
  18790. }
  18791. }
  18792. }(),
  18793. t.exports = n
  18794. }
  18795. ).call(this, "/js/tag/tagManager.js")
  18796. }
  18797. , {
  18798. "../controls/serializer": 14,
  18799. "../enum/BlackoutStyle": 18,
  18800. "../enum/tagEvents": 32,
  18801. "../enum/ModelManagerEvents": 33,
  18802. "../enum/PlayerEvents": 40,
  18803. "../enum/TagStates": 44,
  18804. "../enum/Viewmode": 51,
  18805. "../enum/WarpStyle": 52,
  18806. "../objects/Snapshot": 153,
  18807. "../settings": 166,
  18808. "../util/common": 185,
  18809. "../util/lerp": 188,
  18810. "../util/logger": 189,
  18811. "./Billboard/BillboardEvent": 120,
  18812. "./Media/LinkType": 130,
  18813. "./Media/MediaEvent": 131,
  18814. events: 202,
  18815. three: 217
  18816. }],
  18817. 125: [function(e, t, i) {///js/tag/Media/EmbedlyEmbed.js
  18818. (function(i) {
  18819. "use strict";
  18820. function n() {
  18821. this.embedWrapper = null,
  18822. this.embedElement = null
  18823. }
  18824. var r = e("../../util/ajax")
  18825. , o = e("./mediaSettings")
  18826. , a = e("../../settings")
  18827. , s = e("../../util/logger")
  18828. , l = new s(i);
  18829. n.prototype.createDomElement = function() {
  18830. return this.embedWrapper = document.createElement("div"),
  18831. this.embedWrapper.classList.add("tag-embed"),
  18832. this.embedWrapper.classList.add("hidden"),
  18833. this.embedWrapper
  18834. }
  18835. ,
  18836. n.prototype.load = function(e) {
  18837. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  18838. return new Promise(function(e, i) {
  18839. r.get(t).then(function(t) {
  18840. if (t = JSON.parse(t),
  18841. t.html && t.html.indexOf("<script") === -1) {
  18842. this.embedWrapper.innerHTML = t.html;
  18843. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  18844. if (this.embedWrapper.style.width = n + "px",
  18845. t.height) {
  18846. var r = t.height / t.width;
  18847. this.embedWrapper.style.height = n * r + "px"
  18848. }
  18849. this.embedElement = this.embedWrapper.firstChild;
  18850. var a = [];
  18851. try {
  18852. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  18853. } catch (e) {
  18854. l.debug("Error getting `a` elements for embed; was it an iframe?")
  18855. }
  18856. a.forEach(function(e) {
  18857. e.setAttribute("target", "_blank")
  18858. }),
  18859. this.embedElement.classList.add("hidden"),
  18860. this.embedWrapper.classList.remove("hidden"),
  18861. e()
  18862. } else
  18863. i("Not a valid embed")
  18864. }
  18865. .bind(this), function(e) {
  18866. i(e.response)
  18867. })
  18868. }
  18869. .bind(this))
  18870. }
  18871. ,
  18872. n.prototype.show = function() {
  18873. this.embedElement && this.embedElement.classList.remove("hidden")
  18874. }
  18875. ,
  18876. n.prototype.hide = function() {
  18877. this.embedElement && this.embedElement.classList.add("hidden")
  18878. }
  18879. ,
  18880. t.exports = n
  18881. }
  18882. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  18883. }
  18884. , {
  18885. "../../settings": 166,
  18886. "../../util/ajax": 181,
  18887. "../../util/logger": 189,
  18888. "./mediaSettings": 132
  18889. }],
  18890. 126: [function(e, t, i) {///js/tag/Media/EmbedlyPlayer.js
  18891. (function(i) {
  18892. "use strict";
  18893. function n(e) {
  18894. o.call(this),
  18895. this.options = e,
  18896. this.playerControls = null,
  18897. this.state = s.NOT_READY
  18898. }
  18899. var r = e("../../util/browser")
  18900. , o = e("./EmbedlyEmbed")
  18901. , a = e("../../util/logger")
  18902. , s = (new a(i),
  18903. Object.freeze({
  18904. NOT_READY: "player.not.ready",
  18905. CUED: "player.cued",
  18906. PLAYING: "player.playing",
  18907. PAUSED: "player.paused"
  18908. }));
  18909. n.prototype = Object.create(o.prototype),
  18910. n.prototype.createDomElement = function() {
  18911. return this.embedWrapper = document.createElement("div"),
  18912. this.embedWrapper.classList.add("tag-video"),
  18913. this.embedWrapper.classList.add("hidden"),
  18914. this.embedWrapper
  18915. }
  18916. ,
  18917. n.prototype.load = function(e) {
  18918. var t = function() {
  18919. function e(e) {
  18920. this.playerState = s.CUED,
  18921. this.options.startMuted && this.playerControls.mute()
  18922. }
  18923. function t(e) {
  18924. this.playerState = e
  18925. }
  18926. function i(e) {
  18927. this.playerControls.setCurrentTime(0),
  18928. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  18929. }
  18930. this.playerControls = new playerjs.Player(this.embedElement),
  18931. this.playerControls.on("ready", e.bind(this)),
  18932. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  18933. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  18934. this.playerControls.on("ended", i.bind(this))
  18935. }
  18936. .bind(this);
  18937. return o.prototype.load.call(this, e).then(t.bind(this))
  18938. }
  18939. ,
  18940. n.prototype.play = function() {
  18941. var e = r.isMobile();
  18942. return function() {
  18943. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  18944. }
  18945. }(),
  18946. n.prototype.pause = function() {
  18947. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  18948. }
  18949. ,
  18950. t.exports = n
  18951. }
  18952. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  18953. }
  18954. , {
  18955. "../../util/browser": 182,
  18956. "../../util/logger": 189,
  18957. "./EmbedlyEmbed": 125
  18958. }],
  18959. 127: [function(e, t, i) {///js/tag/Media/EmbedlyQueue.js
  18960. (function(i) {
  18961. "use strict";
  18962. function n(e) {
  18963. function t() {
  18964. return a.debug("requesting file from embedly:", e.href),
  18965. r.get(e.href, {
  18966. responseType: e.responseType
  18967. }).then(function(t) {
  18968. return a.debug("requesting file finished:", e.href),
  18969. t
  18970. })
  18971. }
  18972. function i() {}
  18973. return s = new Promise(function(e, n) {
  18974. s.catch(i).then(function() {
  18975. t().then(e, n)
  18976. })
  18977. }
  18978. )
  18979. }
  18980. var r = e("../../util/ajax")
  18981. , o = (e("./mediaSettings"),
  18982. e("../../util/logger"))
  18983. , a = new o(i)
  18984. , s = Promise.resolve();
  18985. t.exports.enqueue = n
  18986. }
  18987. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  18988. }
  18989. , {
  18990. "../../util/ajax": 181,
  18991. "../../util/logger": 189,
  18992. "./mediaSettings": 132
  18993. }],
  18994. 128: [function(e, t, i) {///js/tag/Media/Image.js
  18995. (function(i) {
  18996. "use strict";
  18997. function n() {
  18998. this.imageWrapper = null,
  18999. this.width = 0,
  19000. this.height = 0,
  19001. this.aspect = 1
  19002. }
  19003. var r = e("./MediaEvent")
  19004. , o = e("./EmbedlyQueue")
  19005. , a = e("events").EventEmitter
  19006. , s = e("../../util/logger")
  19007. , l = e("../../settings");
  19008. new s(i);
  19009. n.prototype = Object.create(a.prototype),
  19010. n.prototype.createDomElement = function() {
  19011. return this.imageWrapper = new Image,//document.createElement("div"), xzw
  19012. this.imageWrapper.classList.add("tag-image"),
  19013. this.imageWrapper.classList.add("hidden"),
  19014. this.imageWrapper.addEventListener("click", function(e) {
  19015. e.stopPropagation(),
  19016. this.emit(r.IMAGE_OPENING),
  19017. this.imageWrapper.style.pointerEvents = "none"
  19018. }
  19019. .bind(this)),
  19020. this.imageWrapper
  19021. }
  19022. ,
  19023. n.prototype.onClosed = function() {
  19024. this.imageWrapper.style.pointerEvents = "auto"
  19025. }
  19026. ,
  19027. /* n.prototype.load = function(e) {
  19028. var t = Math.max(window.screen.height, window.screen.width)
  19029. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  19030. return new Promise(function(e, t) {
  19031. function n(t) {
  19032. var i = t.target;
  19033. this.width = i.naturalWidth,
  19034. this.height = i.naturalHeight,
  19035. this.aspect = this.width / this.height;
  19036. var n = t.target.src;
  19037. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  19038. this.imageWrapper.style.width = this.width + "px",
  19039. this.imageWrapper.style.height = this.height + "px",
  19040. this.imageWrapper.classList.remove("hidden"),
  19041. e()
  19042. }
  19043. o.enqueue({
  19044. href: i,
  19045. responseType: "arraybuffer"
  19046. }).then(function(e) {
  19047. var t = new Uint8Array(e)
  19048. , i = new Blob([t])
  19049. , r = new window.Image;
  19050. r.addEventListener("load", n.bind(this));
  19051. var o = URL.createObjectURL(i);
  19052. r.src = o
  19053. }
  19054. .bind(this), t)
  19055. }
  19056. .bind(this))
  19057. } */ //--------MP_AB_TESTS
  19058. n.prototype.load = function(e, billboard) {//loadImg xzw
  19059. // var t = Math.max(window.screen.height, window.screen.width)
  19060. // , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  19061. var done = function(img,billboard){
  19062. var s = 1,scaleImg,activeClass;
  19063. _this.aspect = img.width / img.height;//naturalWidth可能为0
  19064. var r = Math.max(img.width / maxWidth, img.height / maxHeight);
  19065. if(r > 1) s = r;
  19066. _this.width = img.width / s;
  19067. _this.height = img.height / s;
  19068. if(r > 1) s = r;
  19069. _this.width = img.width / s;
  19070. _this.height = img.height / s;
  19071. //billboard.childNodes[0].style.maxWidth = (_this.width + 20) + "px";
  19072. /* scaleImg = (_this.height *100) / (_this.width*100) * 100 / 2;
  19073. scaleImg = Math.round(scaleImg);
  19074. if(scaleImg%2 != 0){
  19075. scaleImg += 1;
  19076. }
  19077. activeClass = 'per'+scaleImg;
  19078. _this.imageWrapper.classList.add(activeClass);
  19079. _this.imageWrapper.style.backgroundImage = 'url("' + img.src + '")', */
  19080. _this.imageWrapper.src = img.src;
  19081. _this.imageWrapper.style.width = _this.width + "px",
  19082. _this.imageWrapper.style.height = _this.height + "px",
  19083. _this.imageWrapper.classList.remove("hidden"),
  19084. //e()
  19085. //billboard
  19086. u.resolve();
  19087. }
  19088. var maxWidth = 256;
  19089. var maxHeight = 256;
  19090. var u = new $.Deferred();
  19091. var _this = this;
  19092. if(e instanceof Image){
  19093. done(e,billboard)
  19094. }
  19095. else {
  19096. var a = new Image;
  19097. a.src = e;
  19098. a.onload = function(event){
  19099. done(event.target,billboard)
  19100. }
  19101. }
  19102. return u.promise();
  19103. }
  19104. ,
  19105. t.exports = n
  19106. }
  19107. ).call(this, "/js/tag/Media/Image.js")
  19108. }
  19109. , {
  19110. "../../settings": 166,
  19111. "../../util/logger": 189,
  19112. "./EmbedlyQueue": 127,
  19113. "./MediaEvent": 131,
  19114. events: 202
  19115. }],
  19116. 129: [function(e, t, i) {//"../Media/Link"
  19117. "use strict";
  19118. function n(e) {
  19119. this.label = e.label,
  19120. this.href = e.url,
  19121. this.type = this.updateLinkForType(),
  19122. this.domElement = null,
  19123. this.id = c++
  19124. }
  19125. var r = e("./LinkType")
  19126. , o = e("./MediaEvent")
  19127. , a = e("../../util/browser")
  19128. , s = e("../../analytics")
  19129. , l = e("events").EventEmitter
  19130. , c = 0;
  19131. n.prototype = Object.create(l.prototype),
  19132. n.prototype.updateLinkForType = function() {
  19133. function e(e) {
  19134. var t = new RegExp("[#&?]start=([^#&?]*)")
  19135. , i = t.exec(e);
  19136. return i[1]
  19137. }
  19138. function t(e) {
  19139. return e + "&play=1"
  19140. }
  19141. var i = a.valueFromHash("m") || a.valueFromHash("model");
  19142. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  19143. r.NAVIGATION) : (this.href = t(this.href),
  19144. r.MODEL) : r.EXT_LINK
  19145. }
  19146. ;
  19147. var h = {};
  19148. n.prototype.createDomElement = function() {
  19149. function e(e) {
  19150. switch (e.stopPropagation(),
  19151. h[this.id] = !0,
  19152. s.trackAlways("click_tag_link", {
  19153. link_type: this.type,
  19154. link_count: c,
  19155. links_clicked: Object.keys(h).length
  19156. }),
  19157. this.type) {
  19158. case r.MODEL:
  19159. window.location.replace(this.href);
  19160. break;
  19161. case r.EXT_LINK:
  19162. window.open(this.href, "_blank")
  19163. }
  19164. this.emit(o.LINK_CLICK, {
  19165. type: this.type,
  19166. url: this.href
  19167. })
  19168. }
  19169. if (this.domElement = document.createElement("a"),
  19170. this.domElement.classList.add("tag-link"),
  19171. this.domElement.textContent = this.label,
  19172. this.type === r.EXT_LINK) {
  19173. this.domElement.textContent += " ";
  19174. var t = document.createElement("i");
  19175. t.classList.add("icon-ext-link"),
  19176. t.title = "Link to external web site",
  19177. this.domElement.appendChild(t)
  19178. }
  19179. return this.domElement.addEventListener("click", e.bind(this)),
  19180. this.domElement
  19181. }
  19182. ,
  19183. t.exports = n
  19184. }
  19185. , {
  19186. "../../analytics": 4,
  19187. "../../util/browser": 182,
  19188. "./LinkType": 130,
  19189. "./MediaEvent": 131,
  19190. events: 202
  19191. }],
  19192. 130: [function(e, t, i) {//"./Media/LinkType"
  19193. "use strict";
  19194. t.exports = {
  19195. NAVIGATION: "navigation",
  19196. MODEL: "model",
  19197. EXT_LINK: "ext-link"
  19198. }
  19199. }
  19200. , {}],
  19201. 131: [function(e, t, i) {//"./MediaEvent"
  19202. "use strict";
  19203. t.exports = Object.freeze({
  19204. LINK_CLICK: "mtmedia.link",
  19205. IMAGE_LOADED: "mtmedia.image.loaded",
  19206. IMAGE_OPENING: "mtmedia.image.opening",
  19207. IMAGE_OPENED: "mtmedia.image.opened",
  19208. IMAGE_CLOSING: "mtmedia.image.closing",
  19209. IMAGE_CLOSED: "mtmedia.image.closed",
  19210. VIDEO_START: "mtmedia.video.start",
  19211. VIDEO_PAUSE: "mtmedia.video.pause",
  19212. VIDEO_ENDED: "mtmedia.video.end"
  19213. })
  19214. }
  19215. , {}],
  19216. 132: [function(e, t, i) {//"./mediaSettings"
  19217. "use strict";
  19218. t.exports = Object.freeze({
  19219. maxEmbedWidth: 350,
  19220. defaultAspectRatio: .75
  19221. })
  19222. }
  19223. , {}],
  19224. 133: [function(e, t, i) {//"./DescriptionChunkType" or "../Parser/DescriptionChunkType"
  19225. "use strict";
  19226. t.exports = Object.freeze({
  19227. TEXT: "text",
  19228. LINK: "link",
  19229. IMAGE: "photo",
  19230. VIDEO: "video",
  19231. RICH: "rich"
  19232. })
  19233. }
  19234. , {}],
  19235. 134: [function(e, t, i) {//"../Parser/DescriptionParser"
  19236. "use strict";
  19237. function n(e) {
  19238. this.capabilities = {
  19239. links: {
  19240. enable: e.supportLinks,
  19241. keepLabels: e.keepLinkLabels
  19242. }
  19243. }
  19244. }
  19245. var r = e("./DescriptionChunkType");
  19246. n.prototype.parse = function(e, t) {
  19247. var i = []
  19248. , n = e.split("[").map(function(e, t) {
  19249. return 0 === t ? e : "[" + e
  19250. });
  19251. return n.forEach(function(e) {
  19252. var n = this.findMarkdown(e);
  19253. if (n) {
  19254. if (n.url.indexOf("javascript:") !== -1)
  19255. return;
  19256. this.addLinkChunk(i, n, t),
  19257. this.addTextChunk(i, e.slice(n.markdown.length))
  19258. } else
  19259. this.addTextChunk(i, e)
  19260. }
  19261. .bind(this)),
  19262. i
  19263. }
  19264. ,
  19265. n.prototype.findMarkdown = function(e) {
  19266. var t = /\[([^\]]*)\]\((.*)\)/
  19267. , i = e.match(t);
  19268. if (i) {
  19269. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  19270. 0 !== r); )
  19271. o++;
  19272. var a = n.length - o;
  19273. return {
  19274. markdown: i[0].substring(0, i[0].length - a),
  19275. label: i[1],
  19276. url: i[2].substring(0, o)
  19277. }
  19278. }
  19279. }
  19280. ,
  19281. n.prototype.addTextChunk = function(e, t) {
  19282. 0 !== t.length && e.push({
  19283. type: r.TEXT,
  19284. text: t
  19285. })
  19286. }
  19287. ,
  19288. n.prototype.addLinkChunk = function(e, t) {
  19289. if (!this.capabilities.links.enable)
  19290. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  19291. var i = {
  19292. label: t.label,
  19293. url: t.url
  19294. };
  19295. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  19296. e.push({
  19297. type: r.LINK,
  19298. link: i
  19299. })
  19300. }
  19301. ,
  19302. t.exports = n
  19303. }
  19304. , {
  19305. "./DescriptionChunkType": 133
  19306. }],
  19307. 135: [function(e, t, i) {//js/model/Chunks.js
  19308. (function(i) {
  19309. "use strict";
  19310. var n = e("../util/logger")
  19311. , r = new n(i)
  19312. , o = {
  19313. parseIdsFromChunkName: function(e, t) {
  19314. t.floorId = o.parseFloor(e),
  19315. t.roomId = o.parseRoom(e)
  19316. },
  19317. parseFloor: function(e) {
  19318. var t = e.match(/_group([0-9]+)/);
  19319. if (!t)
  19320. return 0;
  19321. try {
  19322. return parseInt(t[1], 10)
  19323. } catch (e) {
  19324. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  19325. 0
  19326. }
  19327. },
  19328. parseRoom: function(e) {
  19329. var t = e.match(/_sub([0-9]+)/);
  19330. if (!t)
  19331. return -1;
  19332. try {
  19333. return parseInt(t[1], 10)
  19334. } catch (e) {
  19335. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  19336. 0
  19337. }
  19338. }
  19339. };
  19340. t.exports = o
  19341. }
  19342. ).call(this, "/js/model/Chunks.js")
  19343. }
  19344. , {
  19345. "../util/logger": 189
  19346. }],
  19347. 136: [function(e, t, i) {///js/model/FloorCollection.js
  19348. (function(i) {
  19349. "use strict";
  19350. function n(e) {
  19351. s.call(this),
  19352. this.model = e,
  19353. this.exploded = !1
  19354. }
  19355. var r = e("../objects/Floor")
  19356. , o = (e("../settings"),
  19357. e("../util/logger"))
  19358. , a = e("../util/transitions")
  19359. , s = e("../util/IndexedCollection")
  19360. , l = e("../util/common")
  19361. , c = e("../util/easing");
  19362. new o(i);
  19363. l.inherit(n, s),
  19364. n.prototype.add = function(e) {
  19365. s.prototype.add.call(this, e),
  19366. this.model.add(e)
  19367. }
  19368. ,
  19369. n.prototype.getIndex = function(e) {
  19370. return e.floorIndex
  19371. }
  19372. ,
  19373. n.prototype.build = function() {
  19374. this.list.forEach(function(e) {
  19375. e.build()
  19376. })
  19377. }
  19378. ,
  19379. n.prototype.size = function() {
  19380. return this.length
  19381. }
  19382. ,
  19383. n.prototype.sort = function() {
  19384. s.prototype.sort.call(this, function(e, t) {
  19385. return e.floorIndex - t.floorIndex
  19386. })
  19387. }
  19388. ,
  19389. n.prototype.nextFloor = function(e, t) {
  19390. return this.index[e.floorIndex + t] || null
  19391. }
  19392. ,
  19393. n.prototype.getFloorAtPoint = function(e) {
  19394. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  19395. var r = this.list[n]
  19396. , o = r.distanceToPoint(e);
  19397. (!t || i > o) && (i = o,
  19398. t = r)
  19399. }
  19400. return t
  19401. }
  19402. ,
  19403. n.prototype.getOrMakeFloor = function(e) {
  19404. var t = this.index[e];
  19405. return t || (t = new r(this.model,e),
  19406. this.add(t)),
  19407. t
  19408. }
  19409. ,
  19410. n.prototype.hide = function() {
  19411. this.list.forEach(function(e) {
  19412. e.hide()
  19413. })
  19414. }
  19415. ,
  19416. n.prototype.show = function() {
  19417. this.list.forEach(function(e) {
  19418. e.show()
  19419. })
  19420. }
  19421. ,
  19422. n.prototype.names = function() {
  19423. return this.list.reduce(function(e, t) {
  19424. return e.concat(t.name)
  19425. }, [])
  19426. }
  19427. ,
  19428. n.prototype.toggleExplodeHorizontal = function() {
  19429. function e(e, t) {
  19430. r.copy(e.position),
  19431. e.position.x = i[e.floorIndex] * t,
  19432. e.position.y = 1 * e.floorIndex * t,
  19433. r.sub(e.position).multiplyScalar(-1),
  19434. e.panos.forEach(function(e) {
  19435. e.translate(r)
  19436. })
  19437. }
  19438. var t, i = [], n = 0;
  19439. this.list.forEach(function(e, r, o) {
  19440. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  19441. n += t,
  19442. i[r] = n
  19443. }),
  19444. i = i.map(function(e) {
  19445. return e - n / 2
  19446. });
  19447. var r = this.list[0].position.clone();
  19448. this.exploded ? this.list.forEach(function(t) {
  19449. a.start(function(i) {
  19450. e(t, 1 - i)
  19451. }, 1500, null, 0, c.easeOutExpo)
  19452. }) : this.list.forEach(function(t) {
  19453. a.start(function(i) {
  19454. e(t, i)
  19455. }, 1500, null, 0, c.easeOutExpo)
  19456. }),
  19457. this.exploded = !this.exploded
  19458. }
  19459. ,
  19460. n.prototype.toggleExplodeVertical = function() {
  19461. function e(e, i) {
  19462. //var n = n.copy(e.position); //有bug
  19463. var n = e.position.clone();
  19464. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  19465. n.sub(e.position).multiplyScalar(-1),
  19466. e.panos.forEach(function(e) {
  19467. e.translate(n)
  19468. })
  19469. }
  19470. var t = this.model.size;
  19471. this.list[0].position.clone();
  19472. this.exploded ? this.list.forEach(function(t) {
  19473. a.start(function(i) {
  19474. e(t, 1 - i)
  19475. }, 1500, null, 0, c.easeOutExpo)
  19476. }) : this.list.forEach(function(t) {
  19477. a.start(function(i) {
  19478. e(t, i)
  19479. }, 1500, null, 0, c.easeOutExpo)
  19480. }),
  19481. this.exploded = !this.exploded
  19482. }
  19483. ,
  19484. t.exports = n
  19485. }
  19486. ).call(this, "/js/model/FloorCollection.js")
  19487. }
  19488. , {
  19489. "../objects/Floor": 146,
  19490. "../settings": 166,
  19491. "../util/IndexedCollection": 175,
  19492. "../util/common": 185,
  19493. "../util/easing": 186,
  19494. "../util/logger": 189,
  19495. "../util/transitions": 195
  19496. }],
  19497. 137: [function(e, t, i) {///js/model/ImageCollection.js
  19498. (function(i) {
  19499. "use strict";
  19500. function n() {
  19501. c.call(this)
  19502. }
  19503. var r = e("../settings")
  19504. , o = e("../util/logger")
  19505. , a = e("../enum/Viewmode")
  19506. , s = e("../objects/Snapshot")
  19507. , l = (e("../util/math"),
  19508. e("../util/common"))
  19509. , c = e("../util/IndexedCollection")
  19510. , h = new o(i);
  19511. l.inherit(n, c),
  19512. n.prototype.getImage = function(e) {
  19513. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  19514. }
  19515. ,
  19516. n.prototype.filterByModesAndReel = function(e, t) {
  19517. for (var i = [], n = 0; n < t.length; n += 1) {
  19518. var r = t[n]
  19519. , o = this.index[r.sid];
  19520. o && i.push(o)
  19521. }
  19522. var s = e[a.DOLLHOUSE]
  19523. , l = e[a.FLOORPLAN];
  19524. i = i.filter(function(e) {
  19525. if (!e.metadata || void 0 === e.metadata.camera_mode)
  19526. return !0;
  19527. var t;
  19528. try {
  19529. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  19530. } catch (e) {
  19531. return h.debug(e.message),
  19532. !1
  19533. }
  19534. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  19535. }),
  19536. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  19537. this.list = i,
  19538. this.reIndex()
  19539. }
  19540. ,
  19541. n.prototype.getHeroLocations = function(e) {
  19542. if (0 === this.list.length)
  19543. return [];
  19544. for (var t = [], i = 0; i < this.list.length; ++i) {
  19545. var o = this.list[i]
  19546. , l = o.thumbnail_signed_src
  19547. , c = o.name;
  19548. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  19549. if (!r.show360Views.enabled && o.metadata.scan_id) {
  19550. var h = e.get(o.metadata.scan_id);
  19551. if (h && !h.isAligned())
  19552. continue
  19553. }
  19554. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  19555. if (u === a.MESH)
  19556. continue;
  19557. var d = {
  19558. cameraMode: u,
  19559. position: o.metadata.camera_position,
  19560. quaternion: o.metadata.camera_quaternion,
  19561. panoId: o.metadata.scan_id,
  19562. orthoZoom: o.metadata.ortho_zoom,
  19563. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  19564. thumbUrl: l,
  19565. name: n.filterImageName(c)
  19566. }
  19567. , p = new s(d);
  19568. t.push(p)
  19569. }
  19570. }
  19571. return t
  19572. }
  19573. ,
  19574. n.prototype.getIndex = function(e) {
  19575. return e.sid
  19576. }
  19577. ,
  19578. n.filterImageName = function(e) {
  19579. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  19580. }
  19581. ,
  19582. t.exports = n
  19583. }
  19584. ).call(this, "/js/model/ImageCollection.js")
  19585. }
  19586. , {
  19587. "../enum/Viewmode": 51,
  19588. "../objects/Snapshot": 153,
  19589. "../settings": 166,
  19590. "../util/IndexedCollection": 175,
  19591. "../util/common": 185,
  19592. "../util/logger": 189,
  19593. "../util/math": 190
  19594. }],
  19595. 138: [function(e, t, i) {///js/model/LabelCollection.js
  19596. (function(i) {
  19597. "use strict";
  19598. function n() {
  19599. u.call(this)
  19600. }
  19601. var r = e("../label/Label")
  19602. , o = e("../settings")
  19603. , a = e("../util/logger")
  19604. , s = e("../util/math")
  19605. , l = e("../util/ajax")
  19606. , c = e("./RoomCollection")
  19607. , h = e("../util/common")
  19608. , u = e("../util/IndexedCollection");
  19609. new a(i);
  19610. h.inherit(n, u),
  19611. n.prototype.getIndex = function(e) {
  19612. return e.labelId
  19613. }
  19614. ,
  19615. n.prototype.associateWithRooms = function(e) {
  19616. this.forEach(function(t) {
  19617. e.forEach(function(e) {
  19618. e.roomId === t.roomId && (t.room = e)
  19619. })
  19620. })
  19621. }
  19622. ,
  19623. n.prototype.createFromLabelData = function(e) {
  19624. e.forEach(function(e) {
  19625. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  19626. t = c.generateRoomId(e.floorId, t);
  19627. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  19628. i.position = s.convertWorkshopVector(i.position),
  19629. this.add(i),
  19630. i.build()
  19631. }
  19632. .bind(this))
  19633. }
  19634. ,
  19635. n.prototype.load = function(e, t) {
  19636. return l.get(e, {
  19637. responseType: "json",
  19638. auth: t ? o.authorizationHeader : null
  19639. }).done(function(e) {
  19640. var t = [];
  19641. for (var i in e) {
  19642. var n = e[i];
  19643. t.push(n)
  19644. }
  19645. this.createFromLabelData(t)
  19646. }
  19647. .bind(this))
  19648. }
  19649. ,
  19650. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  19651. var t = -1;
  19652. if (e) {
  19653. var i = e.split("_");
  19654. t = parseInt(i[0])
  19655. }
  19656. return t
  19657. }
  19658. ,
  19659. t.exports = n
  19660. }
  19661. ).call(this, "/js/model/LabelCollection.js")
  19662. }
  19663. , {
  19664. "../label/Label": 90,
  19665. "../settings": 166,
  19666. "../util/IndexedCollection": 175,
  19667. "../util/ajax": 181,
  19668. "../util/common": 185,
  19669. "../util/logger": 189,
  19670. "../util/math": 190,
  19671. "./RoomCollection": 141
  19672. }],
  19673. 139: [function(e, t, i) {///js/model/Model.js
  19674. (function(i) {
  19675. "use strict";
  19676. function n(e, t) {
  19677. o.Object3D.call(this),
  19678. this.sid = t.sid,
  19679. this.data = t,
  19680. this.options = e,
  19681. this.urls = new s(e.urlFiles),
  19682. this.isPublic = void 0 !== t.is_public && t.is_public,
  19683. this.images = new _(this),
  19684. this.images.extend(t.images),
  19685. this.heroImage = this.images.getImage(t.icon), //封面图和初始视角
  19686. this.heroLocations = [],
  19687. this.outdoorPanoLocations = [],
  19688. this.floors = new d(this),
  19689. this.floorsEnabled = void 0 === e.floors || e.floors,
  19690. this.changingFloor = !1,
  19691. this.chunks = [],
  19692. this.panos = new A,
  19693. this.colliders = [],
  19694. this.loadPanosPromise = null,
  19695. this.loadMeshTexturesPromise = null,
  19696. this.auxDataPromise = null,
  19697. this.meshTexturesLoaded = !1,
  19698. this.meshTextures = [],
  19699. this.tags = {},
  19700. this.tagsShown = !1,
  19701. this.shouldShowtags = !1,
  19702. this.has360Views = !1,
  19703. this.showingLabels = f.labels.enabled && t.player_options.labels,
  19704. this.supportedModes = {},
  19705. this.supportedModes[c.PANORAMA] = !0,
  19706. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  19707. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  19708. this.supportedModes[c.TRANSITIONING] = !0,
  19709. this.supportsTiles = this.configureTiling(),
  19710. this.supportsVR = t.is_vr,
  19711. this.mode = c.DOLLHOUSE,
  19712. this.size = null,
  19713. this.center = null,
  19714. this.boundingBox = new o.Box3,
  19715. this.currentFloor = null,
  19716. this.allFloorsVisible = !0,
  19717. this.projectedPano0 = null,
  19718. this.projectedPano1 = null,
  19719. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  19720. this.addFloor(new u(this,t,e.trim()))
  19721. }
  19722. .bind(this)),
  19723. this.waitQueue = [],
  19724. this.on("load", function(e) {
  19725. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  19726. return !e.isLoadedCallback()
  19727. }),
  19728. 0 === this.waitQueue.length && this.emit("waiting-done"))
  19729. }
  19730. .bind(this)),
  19731. this.setupCustomProperties()
  19732. //xzw:
  19733. this.spotCreatedNum = -1;//记录当前所有的热点sid最大值
  19734. }
  19735. function r() {
  19736. try {
  19737. var e = document.createElement("canvas")
  19738. , t = e.getContext("webgl");
  19739. t || (t = e.getContext("experimental-webgl"));
  19740. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  19741. return i
  19742. } catch (e) {
  19743. return 0
  19744. }
  19745. }
  19746. var o = e("three")
  19747. , a = e("../util/ajax")
  19748. , s = e("../util/ModelUrls")
  19749. , l = e("../objects/BoundingTextureSkybox")
  19750. , c = e("../enum/Viewmode")
  19751. , h = e("../enum/RenderOrder")
  19752. , u = (e("../enum/AlignmentType"),
  19753. e("../objects/Floor"))
  19754. , d = e("./FloorCollection")
  19755. , p = e("../objects/Chunk")
  19756. , f = (e("../objects/Room"),
  19757. e("../objects/Snapshot"),
  19758. e("../label/Label"),
  19759. e("../util/math"),
  19760. e("../settings")),
  19761. ss = e("../shaders") //xzw
  19762. , g = e("../util/logger")
  19763. , m = e("../tag/tag")
  19764. , v = (e("../tag/tagManager"),
  19765. e("../objects/Panorama"))
  19766. , A = e("../util/PanoramaCollection")
  19767. , y = e("../loaders/ModelLoader")
  19768. , C = e("../loaders/ModelTextureLoader")
  19769. , I = e("../loaders/SweepDataLoader")
  19770. , E = e("../util/transitions")
  19771. , b = e("../util/common")
  19772. , le = e("../util/lerp") //xzw
  19773. , es = e("../util/easing") //xzw
  19774. , te = e("../util/texture") //xzw
  19775. , w = e("./../util/browser")
  19776. , _ = e("./ImageCollection")
  19777. , T = e("./RoomCollection")
  19778. , x = e("./LabelCollection")
  19779. , S = e("./Chunks")
  19780. , M = e("./../util/showcase")
  19781. , R = e("../exception/BasicException")
  19782. , P = (e("../constants"),
  19783. e("events").EventEmitter)
  19784. , O = new g(i);
  19785. var editor = e('editor');
  19786. n.prototype = Object.create(o.Object3D.prototype),
  19787. b.extend(n, P),
  19788. n.prototype.setupCustomProperties = function() {
  19789. var e = f.modelAlpha;
  19790. Object.defineProperty(this, "alpha", {
  19791. get: function() {
  19792. return e
  19793. },
  19794. set: function(t) {
  19795. e = t,
  19796. this.chunks.forEach(function(t) {
  19797. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  19798. })
  19799. }
  19800. })
  19801. }
  19802. ,
  19803. n.prototype.configureTiling = function() {
  19804. var e = r();
  19805. if (e < 2048)
  19806. return !1;
  19807. O.warn("Max cube texture size: " + e);
  19808. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  19809. var i = f.tiling.tilingFlagNames[t];
  19810. if ("1" === w.valueFromHash(i, null))
  19811. return !0;
  19812. if ("0" === w.valueFromHash(i, null))
  19813. return !1
  19814. }
  19815. return !!M.modelDataPromisesTiles(this.data)
  19816. }
  19817. ,
  19818. n.prototype.toggleAlpha = function() {
  19819. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  19820. }
  19821. ,
  19822. n.prototype.load = function(e) {
  19823. var t = function() {
  19824. return $.when(this.loadPanos(), this.loadMesh())
  19825. },
  19826. i = this.urls.init().then(t.bind(this));
  19827. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  19828. this.auxDataPromise = $.when(this.loadHighlightReel(), this.loadtags(), this.loadLabels()),
  19829. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  19830. }
  19831. ,
  19832. n.prototype.loadMesh = function() {
  19833. function e(e) {
  19834. O.error(e),
  19835. n.reject("loading-failed")
  19836. }
  19837. function t(e, t) {
  19838. n.notify(e, t)
  19839. }
  19840. function i(e, t) {
  19841. if (0 === e.length) {
  19842. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  19843. r.supportedModes[c.DOLLHOUSE] = !1,
  19844. r.supportedModes[c.FLOORPLAN] = !1;
  19845. var i = new p({
  19846. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  19847. });
  19848. i.material.visible = !1,
  19849. i.rotateX(-Math.PI / 2),
  19850. i.geometry.computeBoundingBox(),
  19851. e = [i]
  19852. }
  19853. e.forEach(function(e) {
  19854. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  19855. r.addChunk(t, e)
  19856. }),
  19857. r.floors.sort(),
  19858. n.resolve(r)
  19859. }
  19860. var n = $.Deferred()
  19861. , r = this;
  19862. return y.load(r.data.job.uuid, r.urls, i, t, e),
  19863. n.promise()
  19864. }
  19865. ,
  19866. n.prototype.loadMeshTextures = function() {
  19867. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  19868. this.meshTexturesLoaded = !0
  19869. }
  19870. .bind(this)),
  19871. this.loadTexturesPromise)
  19872. }
  19873. ,
  19874. n.prototype.loadtags = function() {// ------MP
  19875. var e = $.Deferred();
  19876. if (!f.tags.enabled)
  19877. return e.resolve();
  19878. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  19879. t = "data/" + this.sid + "/tags.json"
  19880. return a.get(t, {
  19881. responseType: "json",
  19882. auth: this.isPublic ? null : f.authorizationHeader
  19883. }).done(function(t) {
  19884. /* var i = 0
  19885. , n = 0;
  19886. for (var r in t) {
  19887. var o = t[r];
  19888. o.enabled && (n++,
  19889. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  19890. i++))
  19891. }
  19892. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  19893. */e.resolve()
  19894. }
  19895. .bind(this)).fail(function() {
  19896. O.warn("Getting tags failed, not displaying tags."),
  19897. e.resolve()
  19898. }),
  19899. e
  19900. }
  19901. /* n.prototype.loadTags = function(){//xzw 加载热点
  19902. this.tags = {};
  19903. var e = $.Deferred();
  19904. //var t = ifTest?"data/tags.json?m="+(new Date()).getTime() : "data/data"+number+"/hot.json?m="+(new Date()).getTime();
  19905. t = "data/" + this.sid + "/tags.json"
  19906. var time = 0;
  19907. var Tag = m;
  19908. var load = function(){
  19909. time ++;
  19910. console.log("第"+time+"次加载tags");
  19911. $.ajax(t).done(function(t) {
  19912. if(t.length) t.sort(function(a,b){return parseInt(a.sid) - parseInt(b.sid)})//升序
  19913. for (var r=0; r<t.length; r++) {
  19914. var o = t[r];
  19915. this.tags[r] = new Tag(this,t[r].sid,o);
  19916. editor.addList(this.tags[r]);
  19917. if(parseInt(t[r].sid) > this.spotCreatedNum) this.spotCreatedNum = parseInt(t[r].sid);
  19918. }
  19919. e.resolve(this)
  19920. }.bind(this)).fail(function() {
  19921. if(time < 3) load();
  19922. else{
  19923. //error_dialog("提示","热点数据加载失败"); //第一次编辑可能就是没热点
  19924. console.log("Getting tags failed, not displaying tags.");//O.warn("Getting tags failed, not displaying tags."),
  19925. e.resolve(this)
  19926. }
  19927. }.bind(this))
  19928. }.bind(this)
  19929. load();
  19930. return e.promise();
  19931. } */
  19932. ,
  19933. n.prototype.loadPanos = function() {
  19934. if (this.loadPanosPromise)
  19935. return this.loadPanosPromise;
  19936. var e = new I(this);
  19937. return this.loadPanosPromise = e.load().then(function(e) {
  19938. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  19939. return this.data.sweeps[e.uuid].enabled
  19940. }
  19941. .bind(this))),
  19942. this.panos.extend(e.map(function(e) {
  19943. return new v(this,e.uuid,e,this.supportsTiles)
  19944. }
  19945. .bind(this))),
  19946. this.panos.forEach(function(e) {
  19947. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  19948. var i = this.panos.get(t);
  19949. i && this.panos.setNeighbour(e, i, !0)
  19950. }
  19951. .bind(this)),
  19952. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  19953. }
  19954. .bind(this)),
  19955. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  19956. this.supportedModes[c.PANORAMA] = !1),
  19957. $.when(this)
  19958. }
  19959. .bind(this)),
  19960. this.loadPanosPromise
  19961. }
  19962. ,
  19963. n.prototype.loadHighlightReel = function() {//加载导览位置
  19964. var e = $.Deferred()
  19965. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  19966. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  19967. return a.get(t, {
  19968. responseType: "json",
  19969. auth: this.isPublic ? null : f.authorizationHeader
  19970. }).done(function(t) {
  19971. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  19972. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  19973. e.resolve()
  19974. }
  19975. .bind(this)).fail(function() {
  19976. O.warn("Getting highlight reel failed, no highlights available"),
  19977. e.resolve()
  19978. }),
  19979. e
  19980. }
  19981. ,
  19982. n.prototype.waitForLoad = function(e, t) {
  19983. t() || (this.waitQueue.push({
  19984. object: e,
  19985. isLoadedCallback: t
  19986. }),
  19987. 1 === this.waitQueue.length && this.emit("waiting"))
  19988. }
  19989. ,
  19990. n.prototype.hide = function() {
  19991. this.floors.hide()
  19992. }
  19993. ,
  19994. n.prototype.show = function() {
  19995. this.floors.show()
  19996. }
  19997. ,
  19998. n.prototype.floorNames = function() {
  19999. return this.floors.names()
  20000. }
  20001. ,
  20002. n.prototype.warpDestFloors = function(e, t) {
  20003. if (!e || this.floors.length !== e.length)
  20004. return void this.toggleAllFloors(!0);
  20005. var i = e.findIndex(function(e) {
  20006. return e
  20007. }
  20008. .bind(this));
  20009. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  20010. }
  20011. ,
  20012. n.prototype.setFloor = function(e, t, i) {
  20013. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  20014. this.allFloorsVisible = !1,
  20015. this._setFloor(e, t, i)
  20016. }
  20017. ,
  20018. n.prototype.toggleAllFloors = function(e) {
  20019. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  20020. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  20021. this._setFloor(this.currentFloor)
  20022. }
  20023. ,
  20024. n.prototype._setFloor = function(e, t, i) {
  20025. t = t || this.mode,
  20026. this.emit("floor.changed", e, t, this.currentFloor),
  20027. this.currentFloor = e;
  20028. var n;
  20029. if (t === c.PANORAMA) {
  20030. if (this.show(),
  20031. this.shouldShowtags && this.tagsShown)
  20032. for (n in this.tags)
  20033. this.tags[n].show(f.showFloorDuration)
  20034. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  20035. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  20036. }
  20037. .bind(this)),
  20038. this.shouldShowtags && this.tagsShown))
  20039. for (n in this.tags) {
  20040. var r = this.tags[n];
  20041. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  20042. }
  20043. var o = this
  20044. , a = e;
  20045. E.start(function() {}, f.showFloorDelay, function() {
  20046. o.floors.forEach(function(e) {
  20047. e.chunks.forEach(function(t) {
  20048. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  20049. })
  20050. })
  20051. }
  20052. .bind(this))
  20053. }
  20054. ,
  20055. n.prototype.toggleExplode = function() {
  20056. this.floors.toggleExplodeHorizontal()
  20057. }
  20058. ,
  20059. n.prototype.toggleExplodeUp = function() {
  20060. this.floors.toggleExplodeVertical()
  20061. }
  20062. ,
  20063. n.prototype.nextFloor = function(e) {
  20064. return this.floors.nextFloor(this.currentFloor, e)
  20065. }
  20066. ,
  20067. n.prototype.addFloor = function(e) {
  20068. this.floors.add(e)
  20069. }
  20070. ,
  20071. n.prototype.getFloorAtPoint = function(e) {
  20072. return this.floors.getFloorAtPoint(e)
  20073. }
  20074. ,
  20075. n.prototype.getTagBySid = function(e) {
  20076. return this.tags[e]
  20077. }
  20078. ,
  20079. n.prototype.addChunk = function(e, t) {
  20080. this.floors.getOrMakeFloor(e).addChunk(t),
  20081. this.chunks.push(t)
  20082. }
  20083. ,
  20084. n.prototype.setMode = function(e) {
  20085. if (!this.supportedModes[e])
  20086. throw new R("Mode not supported for this model: " + e);
  20087. this.mode = e,
  20088. this.chunks.forEach(function(t) {
  20089. t.setMode(e)
  20090. })
  20091. }
  20092. ,
  20093. n.prototype.build = function() {
  20094. this.heroLocations = this.images.getHeroLocations(this.panos);
  20095. var e = function() {
  20096. return !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  20097. }
  20098. .bind(this)();
  20099. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  20100. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  20101. }
  20102. .bind(this)) || e,
  20103. null === this.heroImage && O.warn("No hero image defined."),
  20104. this.currentFloor = this.floors.last(),
  20105. this.floors.build(),
  20106. this.colliders = this.floors.reduce(function(e, t) {
  20107. return e.concat(t.collider.children)
  20108. }, []),
  20109. this.panos.forEach(function(e) {
  20110. e.build1(),
  20111. e.on("enter", function() {
  20112. e.floor !== this.currentFloor && this.setFloor(e.floor)
  20113. }
  20114. .bind(this))
  20115. }
  20116. .bind(this)),
  20117. this.panos.forEach(function(e) {
  20118. e.build2()
  20119. }),
  20120. this.floors.forEach(function(e) {
  20121. this.boundingBox.union(e.boundingBox)
  20122. }
  20123. .bind(this)),
  20124. this.size = this.boundingBox.size(),
  20125. this.center = this.boundingBox.center(),
  20126. this.floors.forEach(function(e) {
  20127. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  20128. }
  20129. .bind(this)),
  20130. this.panos.populate_path_graph(),
  20131. this.skybox = new l(this.boundingBox),
  20132. this.skybox.matrixWorldNeedsUpdate = !0,
  20133. this.add(this.skybox);
  20134. for (var t in this.tags)
  20135. this.tags[t].build();
  20136. O.debug("Done building model"),
  20137. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  20138. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  20139. this.buildRooms(),
  20140. this.labels.associateWithRooms(this.rooms)
  20141. this.createFloorLogo(); //xzw
  20142. return $.when(this); //it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. 必须有参数,没有的话无法触发done()
  20143. }
  20144. ,
  20145. n.prototype.createFloorLogo = function(){//xzw 创建地标
  20146. var url = Data.floorLogo ? Data.imgRoot+"floorLogoImg.png"+"?m="+Data.version : Data.imgRoot2 +"floorLogo.png"; //暂定
  20147. var map = te.load(url);//可以追加done
  20148. $("#showInformationLogo").css('background-image', "url('"+url+"')");
  20149. this.floorLogos = [];
  20150. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  20151. var e = o.UniformsUtils.clone(ss.floorLogo.uniforms);
  20152. e.map.value = map;
  20153. var material = new o.ShaderMaterial({
  20154. fragmentShader: ss.floorLogo.fragmentShader,
  20155. vertexShader: ss.floorLogo.vertexShader,
  20156. uniforms: e,
  20157. side: o.DoubleSide,
  20158. transparent: !0,
  20159. depthWrite: !1,
  20160. depthTest:false//改 在chunk\skybox外也可看到
  20161. });
  20162. var logo = new o.Mesh(new o.PlaneGeometry(2.5,2.5,1,1),material);
  20163. var s = (Data.floorLogoSize || 100)/100;
  20164. logo.scale.set(s,s,s);
  20165. logo.position.set(0,-1.49,0);
  20166. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  20167. this.add(logo);
  20168. this.floorLogos.push(logo);
  20169. }
  20170. this.floorLogos[1].visible = false;
  20171. },
  20172. n.prototype.changeFloorLogo = function(n){
  20173. if(!this.floorLogos) return;
  20174. for(var i=0; i<2; i++){
  20175. if(n.url){
  20176. this.floorLogos[i].material.uniforms.map.value = te.load(n.url+"?m="+Data.version);
  20177. }else if(n.image){
  20178. var t = new o.Texture(n.image);
  20179. t.needsUpdate = !0;
  20180. this.floorLogos[i].material.uniforms.map.value = t;
  20181. this.floorLogos[i].material.needsUpdate=!0;
  20182. }
  20183. }
  20184. if(n.initPreview){
  20185. $("#showInformationLogo").css('background-image', "url('"+n.url+"')");
  20186. }
  20187. },
  20188. n.prototype.floorLogoFade = function(i, time, delay){//改
  20189. if(!this.floorLogos) return;
  20190. E.start(le.uniform(this.floorLogos[i], "opacity", 0), time || 250, null,delay,es["easeInQuad"])
  20191. },
  20192. n.prototype.floorLogoShow = function(i, time, delay){//改
  20193. if(!this.floorLogos) return;
  20194. E.start(le.uniform(this.floorLogos[i], "opacity", 1), time || 250, null,delay,es["easeInQuad"])
  20195. },
  20196. n.prototype.updateFloorlogo = function(Q) { //xzw add 更新地标的旋转
  20197. var quaternion;
  20198. for(var i=0;i<2;i++){
  20199. if(!quaternion){
  20200. var a = new o.Vector3(0,0,-1);
  20201. a.applyQuaternion(Q);
  20202. a.setY(0);
  20203. var _ = (new o.Matrix4).lookAt(a,new o.Vector3, new o.Vector3(0,1,0));
  20204. quaternion = (new o.Quaternion).setFromRotationMatrix(_)
  20205. }
  20206. if(this.floorLogos[i].visible){
  20207. this.floorLogos[i].quaternion.copy(quaternion);
  20208. /* k.model.floorLogos[i].rotateOnAxis(new o.Vector3(1,0,0),Math.PI/2) //origin
  20209. k.model.floorLogos[i].rotateOnAxis(new o.Vector3(0,1,0),Math.PI) */
  20210. /*var a = new o.Quaternion;
  20211. a.setFromAxisAngle(new o.Vector3(1,0,0), Math.PI/2);
  20212. var b = new o.Quaternion;
  20213. b.setFromAxisAngle(new o.Vector3(0,1,0), Math.PI);
  20214. a.multiply(b); */
  20215. //var a = new o.Quaternion( 4.329780281177466e-17 , 0.7071067811865476, 0.7071067811865476 , 4.329780281177467e-17)
  20216. var a = new o.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  20217. this.floorLogos[i].quaternion.multiply(a);
  20218. }
  20219. }
  20220. }
  20221. ,
  20222. n.prototype.loadLabels = function() {
  20223. this.labels = new x(this);
  20224. var e = $.Deferred();
  20225. if (!this.showingLabels)
  20226. return e.resolve();
  20227. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  20228. var t = "data/" + this.sid + "/labels.json";
  20229. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  20230. O.warn("Getting labels failed, not displaying labels."),
  20231. e.resolve()
  20232. }),
  20233. e
  20234. }
  20235. ,
  20236. n.prototype.buildRooms = function() {
  20237. this.rooms = new T(this),
  20238. this.rooms.createFromChunks(this.chunks),
  20239. this.rooms.calcRoomBoundaries()
  20240. }
  20241. ,
  20242. n.prototype.updateProjectedPanos = function() {
  20243. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  20244. }
  20245. ,
  20246. n.prototype.setProjectedPanos = function(e, t, i) {
  20247. void 0 !== i && null !== i || (i = !0),
  20248. i = !!i,
  20249. this.projectedPano0 = e,
  20250. this.projectedPano1 = t,
  20251. this.skybox.material.setProjectedPanos(e, t, i),
  20252. this.chunks.forEach(function(n) {
  20253. n.materialInside.setProjectedPanos(e, t, i)
  20254. })
  20255. }
  20256. ,
  20257. n.prototype.setSide = function(e) {
  20258. this.floors.forEach(function(t) {
  20259. t.collider.material.side = e
  20260. })
  20261. }
  20262. ,
  20263. n.prototype.heroCount = function() {
  20264. return this.heroLocations ? this.heroLocations.length : 0
  20265. }
  20266. ,
  20267. n.prototype.getHeroDescriptorByIndex = function(e) {
  20268. if (e < 0)
  20269. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  20270. null;
  20271. var t = this.heroCount();
  20272. if (t < 1)
  20273. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  20274. null;
  20275. var i = this.heroLocations[e];
  20276. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  20277. null) : i
  20278. }
  20279. ,
  20280. n.prototype.findPanoramicHero = function() {
  20281. for (var e in this.heroLocations)
  20282. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  20283. return this.heroLocations[e];
  20284. return null
  20285. }
  20286. ,
  20287. n.prototype.listImagePanos = function() {
  20288. var e = []
  20289. , t = this;
  20290. return this.images.forEach(function(i) {
  20291. if (i.metadata && i.metadata.scan_id) {
  20292. var n = t.panos.get(i.metadata.scan_id);
  20293. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  20294. }
  20295. }),
  20296. e
  20297. }
  20298. ,
  20299. n.prototype.fadePanoMarkers = function(e, t, o) {//xzw
  20300. if(e!=0 && o && o.player.mode == "panorama" && o.player.currentPano){
  20301. var shows = [], hides = [];
  20302. for(var i in o.player.model.panos.index){//是邻近点就显示否则隐藏
  20303. var pano = o.player.model.panos.index[i];
  20304. var ma = pano.marker;
  20305. if(o.player.markspot && o.player.posGets.length == 1){ //正在采集热点 且只有一个位置 只能显示可以走的点
  20306. if(o.player.disablePanos.indexOf(pano)>-1){
  20307. ma.material.depthTest = true;
  20308. hides.push(pano);
  20309. }else{
  20310. ma.material.depthTest = false
  20311. shows.push(pano);
  20312. }
  20313. }else if(o.player.markspot && o.player.posGets.length == 2){ //正在采集热点 且有两个位置 只能显示两个位置
  20314. if(o.player.posGets.list.indexOf(i)>-1){
  20315. ma.material.depthTest = false;
  20316. shows.push(pano);
  20317. }else{
  20318. ma.material.depthTest = true;
  20319. hides.push(pano);
  20320. }
  20321. }else{
  20322. if(o.player.currentPano.seeMarkers.indexOf(i)>-1){
  20323. ma.material.depthTest = false;
  20324. shows.push(pano);
  20325. }else{
  20326. ma.material.depthTest = true;
  20327. hides.push(pano);
  20328. }
  20329. }
  20330. }
  20331. this.panos.fadeMarkerOpacity(e, t, [
  20332. {toOp: f.panorama.markerOpacity, member: shows},
  20333. {toOp: 0, member: hides}
  20334. ])
  20335. }else this.panos.fadeMarkerOpacity(e, t)
  20336. }
  20337. ,
  20338. n.prototype.setSweepVisibility = function(e) {
  20339. this.panos.forEach(function(t) {
  20340. t.marker && (t.marker.visible = e)
  20341. })
  20342. }
  20343. ,
  20344. n.prototype.outsideAllowed = function() {
  20345. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  20346. }
  20347. ,
  20348. t.exports = n
  20349. }
  20350. ).call(this, "/js/model/Model.js")
  20351. }
  20352. , {
  20353. "../constants": 8,
  20354. "../enum/AlignmentType": 17,
  20355. "../enum/RenderOrder": 42,
  20356. "../enum/Viewmode": 51,
  20357. "../exception/BasicException": 55,
  20358. "../label/Label": 90,
  20359. "../loaders/ModelLoader": 105,
  20360. "../loaders/ModelTextureLoader": 106,
  20361. "../loaders/SweepDataLoader": 107,
  20362. "../tag/tag": 123,
  20363. "../tag/tagManager": 124,
  20364. "../objects/BoundingTextureSkybox": 143,
  20365. "../objects/Chunk": 144,
  20366. "../objects/Floor": 146,
  20367. "../objects/Panorama": 148,
  20368. "../objects/Room": 150,
  20369. "../objects/Snapshot": 153,
  20370. "../settings": 166,
  20371. "../shaders": 167,
  20372. "../util/ModelUrls": 177,
  20373. "../util/PanoramaCollection": 178,
  20374. "../util/ajax": 181,
  20375. "../util/common": 185,
  20376. "../util/easing": 186,
  20377. "../util/lerp": 188,
  20378. "../util/logger": 189,
  20379. "../util/math": 190,
  20380. "../util/texture": 194,
  20381. "../util/transitions": 195,
  20382. "./../util/browser": 182,
  20383. "./../util/showcase": 193,
  20384. "./Chunks": 135,
  20385. "./FloorCollection": 136,
  20386. "./ImageCollection": 137,
  20387. "./LabelCollection": 138,
  20388. "./RoomCollection": 141,
  20389. events: 202,
  20390. three: 217,
  20391. editor: "Editor"
  20392. }],
  20393. 140: [function(e, t, i) {//"../model/ModelManager"
  20394. "use strict";
  20395. function n() {
  20396. this.modelMap = {},
  20397. this.activeModel = null,
  20398. this.modelCount = 0,
  20399. this.tileDownloader = null,
  20400. this.panoRenderer = null
  20401. }
  20402. var r = (e("three"),
  20403. e("../util/common"))
  20404. , o = e("../exception/BasicException")
  20405. , a = e("../enum/ModelManagerEvents")
  20406. , s = e("../enum/PanoRendererEvents")
  20407. , l = e("events").EventEmitter;
  20408. n.prototype.init = function(e, t, i) {
  20409. this.tileDownloader = e,
  20410. this.panoRenderer = t,
  20411. this.qualityManager = i,
  20412. this.bindEvents()
  20413. }
  20414. ,
  20415. n.prototype.bindEvents = function() {
  20416. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  20417. }
  20418. ,
  20419. n.prototype.onTileRendered = function(e, t, i, n) {}
  20420. ,
  20421. n.prototype.addModel = function(e) {
  20422. this.modelMap[e.sid] = e,
  20423. 0 === this.modelCount && this.activateModel(e.sid),
  20424. this.modelCount++,
  20425. this.emit(a.ModelAdded)
  20426. }
  20427. ,
  20428. n.prototype.getModel = function(e) {
  20429. return this.modelMap[e]
  20430. }
  20431. ,
  20432. n.prototype.activateModel = function(e) {
  20433. var t = this.modelMap[e];
  20434. if (!t)
  20435. throw new o("Tried to activate invalid model!");
  20436. var i = this.activeModel;
  20437. this.activeModel = t,
  20438. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  20439. this.tileDownloader.setUrls(t.urls),
  20440. t.panos.forEach(function(e) {
  20441. e.attachToPanoRenderer(this.panoRenderer),
  20442. e.tileDownloader = this.tileDownloader,
  20443. e.qualityManager = this.qualityManager
  20444. }
  20445. .bind(this)),
  20446. this.emit(a.ActiveModelChanged, {
  20447. oldModel: i,
  20448. model: t
  20449. })
  20450. }
  20451. ,
  20452. n.prototype.getActiveModel = function() {
  20453. return this.activeModel
  20454. }
  20455. ,
  20456. r.extend(n, l),
  20457. t.exports = n
  20458. }
  20459. , {
  20460. "../enum/ModelManagerEvents": 33,
  20461. "../enum/PanoRendererEvents": 35,
  20462. "../exception/BasicException": 55,
  20463. "../util/common": 185,
  20464. events: 202,
  20465. three: 217
  20466. }],
  20467. 141: [function(e, t, i) {///js/model/RoomCollection.js
  20468. (function(i) {
  20469. "use strict";
  20470. function n() {
  20471. s.call(this)
  20472. }
  20473. var r = e("../objects/Room")
  20474. , o = (e("../settings"),
  20475. e("../util/logger"))
  20476. , a = (e("../util/transitions"),
  20477. e("../util/easing"),
  20478. e("../util/common"))
  20479. , s = e("../util/IndexedCollection")
  20480. , l = e("./Chunks");
  20481. new o(i);
  20482. a.inherit(n, s),
  20483. n.prototype.getIndex = function(e) {
  20484. return e.roomId
  20485. }
  20486. ,
  20487. n.prototype.calcRoomBoundaries = function() {
  20488. this.forEach(function(e) {
  20489. e.calcBoundaries()
  20490. })
  20491. }
  20492. ,
  20493. n.prototype.createFromChunks = function(e) {
  20494. var t = {
  20495. floorId: -1,
  20496. roomId: -1
  20497. }
  20498. , i = {};
  20499. e.forEach(function(e) {
  20500. l.parseIdsFromChunkName(e.name, t);
  20501. var o = i[t.roomId];
  20502. if (!o) {
  20503. var a = n.generateRoomId(t.floorId, t.roomId);
  20504. o = new r(t.floorId,a),
  20505. this.add(o),
  20506. i[t.roomId] = o
  20507. }
  20508. o.addChunk(e)
  20509. }
  20510. .bind(this)),
  20511. this.calcRoomBoundaries()
  20512. }
  20513. ,
  20514. n.generateRoomId = function(e, t) {
  20515. return e + "_" + t
  20516. }
  20517. ,
  20518. t.exports = n
  20519. }
  20520. ).call(this, "/js/model/RoomCollection.js")
  20521. }
  20522. , {
  20523. "../objects/Room": 150,
  20524. "../settings": 166,
  20525. "../util/IndexedCollection": 175,
  20526. "../util/common": 185,
  20527. "../util/easing": 186,
  20528. "../util/logger": 189,
  20529. "../util/transitions": 195,
  20530. "./Chunks": 135
  20531. }],
  20532. 142: [function(e, t, i) {//"./BoundingMesh"
  20533. "use strict";
  20534. function n(e, t, i) {
  20535. e = e.clone();
  20536. var n = e.size()
  20537. , o = new r.BoxGeometry(n.x,n.y,n.z);
  20538. //o.boundingBox = e, //xzw delete 这句加上不对。因为后面算鼠标与skybox交点时 要用到的是boundingbox加上position才是真实skybox真实位置,所以boundingbox要居中的,而不应该是整体模型所在的位置。
  20539. r.Mesh.call(this, o, t),
  20540. this.position.copy(e.center()),
  20541. this.frustumCulled = !1,
  20542. i && this.add(new r.WireframeHelper(this))
  20543. }
  20544. var r = e("three");
  20545. n.prototype = Object.create(r.Mesh.prototype),
  20546. n.prototype.constructor = n,
  20547. t.exports = n
  20548. }
  20549. , {
  20550. three: 217
  20551. }],
  20552. 143: [function(e, t, i) {///js/objects/BoundingTextureSkybox.js
  20553. (function(i) {
  20554. "use strict";
  20555. function n(e) {
  20556. h.time("Computing a nice bounding cubemap");
  20557. var t = new a({
  20558. side: r.BackSide,
  20559. transparent: !0
  20560. });
  20561. t.uniforms.modelAlpha.value = 0,
  20562. t.uniforms.opacity.value = 1 - s.modelAlpha,
  20563. this.renderOrder = l.boundingSkybox,
  20564. o.call(this, e, t),
  20565. h.timeEnd("Computing a nice bounding cubemap")
  20566. }
  20567. var r = e("three")
  20568. , o = (e("../enum/Viewmode"),
  20569. e("../shaders"),
  20570. e("./BoundingMesh"))
  20571. , a = e("../materials/ModelTextureMaterial")
  20572. , s = e("../settings")
  20573. , l = e("../enum/RenderOrder")
  20574. , c = e("../util/logger")
  20575. , h = new c(i);
  20576. n.prototype = Object.create(o.prototype),
  20577. n.prototype.constructor = n,
  20578. t.exports = n
  20579. }
  20580. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  20581. }
  20582. , {
  20583. "../enum/RenderOrder": 42,
  20584. "../enum/Viewmode": 51,
  20585. "../materials/ModelTextureMaterial": 118,
  20586. "../settings": 166,
  20587. "../shaders": 167,
  20588. "../util/logger": 189,
  20589. "./BoundingMesh": 142,
  20590. three: 217
  20591. }],
  20592. 144: [function(e, t, i) {//"./objects/Chunk"
  20593. "use strict";
  20594. function n(e) {
  20595. this.materialInside = new s({
  20596. side: r.DoubleSide
  20597. });
  20598. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  20599. this.materialOutside = new r.RawShaderMaterial({
  20600. fragmentShader: o.modelOutside.fragmentShader,
  20601. vertexShader: o.modelOutside.vertexShader,
  20602. uniforms: t,
  20603. side: r.FrontSide,
  20604. name: "chunkOut"
  20605. }),
  20606. r.Mesh.call(this, e.geometry, this.materialInside),
  20607. this.name = e.name || "",
  20608. this.textureName = e.textureName,
  20609. this.meshUrl = e.meshUrl
  20610. }
  20611. var r = e("three")
  20612. , o = e("../shaders")
  20613. , a = e("../enum/Viewmode")
  20614. , s = e("../materials/ModelTextureMaterial");
  20615. n.prototype = Object.create(r.Mesh.prototype),
  20616. n.prototype.setTextureMap = function(e) {
  20617. this.materialInside.uniforms.map.value = e,
  20618. this.materialOutside.uniforms.map.value = e
  20619. }
  20620. ,
  20621. n.prototype.setMode = function(e) {
  20622. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  20623. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  20624. t.transparent = this.material.transparent,
  20625. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  20626. this.material = t
  20627. }
  20628. ,
  20629. t.exports = n
  20630. }
  20631. , {
  20632. "../enum/Viewmode": 51,
  20633. "../materials/ModelTextureMaterial": 118,
  20634. "../shaders": 167,
  20635. three: 217
  20636. }],
  20637. 145: [function(e, t, i) {//"./ChunkedCollider"
  20638. "use strict";
  20639. function n(e) {
  20640. this.chunksize = e || 10,
  20641. this.chunks = {},
  20642. this.boundingBoxes = {},
  20643. this.children = [],
  20644. this.offset = new r.Vector3(0,.5,0),
  20645. this.material = new r.MeshBasicMaterial({
  20646. color: 16777215 * Math.random(),
  20647. side: r.DoubleSide
  20648. })
  20649. }
  20650. var r = e("three");
  20651. e("../enum/Viewmode");
  20652. n.prototype.add = function(e) {
  20653. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  20654. m ? (t = m.position.array,
  20655. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  20656. n = e.faces);
  20657. var v = new r.Vector3;
  20658. if (i)
  20659. for (o = 0,
  20660. a = i.length; o < a; o += 3) {
  20661. var A = 3 * i[o]
  20662. , y = 3 * i[o + 1]
  20663. , C = 3 * i[o + 2];
  20664. s = (t[A] + t[y] + t[C]) / 3,
  20665. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  20666. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  20667. h = Math.floor(s / this.chunksize),
  20668. u = Math.floor(l / this.chunksize),
  20669. d = Math.floor(c / this.chunksize),
  20670. p = h + "." + u + "." + d,
  20671. p in this.chunks ? (g = this.chunks[p],
  20672. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  20673. f = this.boundingBoxes[p] = new r.Box3),
  20674. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  20675. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  20676. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  20677. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  20678. }
  20679. else
  20680. for (o = 0,
  20681. a = t.length; o < a; o += 9)
  20682. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  20683. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  20684. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  20685. h = Math.floor(s / this.chunksize),
  20686. u = Math.floor(l / this.chunksize),
  20687. d = Math.floor(c / this.chunksize),
  20688. p = h + "." + u + "." + d,
  20689. p in this.chunks ? (g = this.chunks[p],
  20690. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  20691. f = this.boundingBoxes[p] = new r.Box3),
  20692. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  20693. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  20694. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  20695. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  20696. }
  20697. ,
  20698. n.prototype.build = function() {
  20699. var e = new r.Object3D;
  20700. e.material = this.material;
  20701. for (var t in this.chunks) {
  20702. var i = this.chunks[t]
  20703. , n = new r.BufferGeometry;
  20704. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  20705. n.boundingBox = this.boundingBoxes[t];
  20706. var o = new r.Mesh(n,this.material);
  20707. o.material.visible = !1,
  20708. e.add(o),
  20709. this.chunks[t] = []
  20710. }
  20711. return e
  20712. }
  20713. ,
  20714. t.exports = n
  20715. }
  20716. , {
  20717. "../enum/Viewmode": 51,
  20718. three: 217
  20719. }],
  20720. 146: [function(e, t, i) {//"./objects/Floor"
  20721. "use strict";
  20722. function n(e, t, i) {
  20723. r.Object3D.call(this),
  20724. this.model = e,
  20725. this.floorIndex = t,
  20726. this.name = i || d.FLOOR_NAME + (t + 1),
  20727. this.panos = [],
  20728. this.chunks = [],
  20729. this.colliderBuilder = new l(3),
  20730. this.collider = null,
  20731. this.center = null,
  20732. this.boundingBox = new r.Box3,
  20733. this.size = null,
  20734. this.hidden = !1,
  20735. this.conservativeBoundingBox = new r.Box3,
  20736. this.debugColor = 16777215 * Math.random(),
  20737. this.transition = null
  20738. }
  20739. var r = e("three")
  20740. , o = e("../settings")
  20741. , a = e("../util/common")
  20742. , s = e("../util/lerp")
  20743. , l = e("./ChunkedCollider")
  20744. , c = e("../util/transitions")
  20745. , h = e("../util/easing")
  20746. , u = (e("../objects/Panorama"),
  20747. e("../enum/RenderOrder"))
  20748. , d = e("../localization/localize");
  20749. n.prototype = Object.create(r.Object3D.prototype),
  20750. n.prototype.enter = function(e) {
  20751. this.model.setFloor(this, e)
  20752. }
  20753. ,
  20754. n.prototype.hide = function(e) {
  20755. if (!this.hidden || this.transition) {
  20756. this.chunks.forEach(function(e) {
  20757. e.material.transparent = !0
  20758. }),
  20759. c.cancel(this.transition);
  20760. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  20761. , i = e ? 0 : o.hideFloorDelay / t;
  20762. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  20763. this.hidden = !0
  20764. }
  20765. .bind(this), i, h.easeInOutQuad)
  20766. }
  20767. }
  20768. ,
  20769. n.prototype.show = function(e) {
  20770. if (this.hidden || this.transition) {
  20771. this.hidden = !1,
  20772. c.cancel(this.transition);
  20773. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  20774. , i = e ? 0 : o.showFloorDelay / t;
  20775. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  20776. this.hidden || this.chunks.forEach(function(e) {
  20777. e.material.transparent = !1
  20778. })
  20779. }
  20780. .bind(this), i, h.easeInOutQuad)
  20781. }
  20782. }
  20783. ,
  20784. n.prototype.toggle = function(e, t) {
  20785. e = void 0 === e ? this.hidden : e,
  20786. e ? this.show(t) : this.hide(t)
  20787. }
  20788. ,
  20789. n.prototype.containsPoint = function(e) {
  20790. return this.collider.children.some(function(t) {
  20791. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  20792. t.geometry.boundingBox.containsPoint(e)
  20793. })
  20794. }
  20795. ,
  20796. n.prototype.distanceToPoint = function(e) {
  20797. var t = null
  20798. , i = 1 / 0;
  20799. return this.collider.children.forEach(function(n) {
  20800. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  20801. var r = n.geometry.boundingBox.distanceToPoint(e);
  20802. (!t || i > r) && (i = r,
  20803. t = n)
  20804. }),
  20805. i
  20806. }
  20807. ,
  20808. n.prototype.addChunk = function(e) {
  20809. e.renderOrder = u.ghostFloor,
  20810. this.add(e),
  20811. this.chunks.push(e),
  20812. this.boundingBox.union(e.geometry.boundingBox),
  20813. this.size = this.boundingBox.size(),
  20814. this.colliderBuilder.add(e.geometry)
  20815. }
  20816. ,
  20817. n.prototype.addPano = function(e) {
  20818. this.panos.push(e),
  20819. this.add(e.skyboxMesh),
  20820. e.marker && this.add(e.marker);
  20821. var t = new r.Vector3(1,1,1)
  20822. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  20823. this.boundingBox.union(i)
  20824. }
  20825. ,
  20826. n.prototype.build = function() {
  20827. this.collider = this.colliderBuilder.build(!0),
  20828. this.add(this.collider),
  20829. this.center = this.boundingBox.center(),
  20830. this.conservativeBoundingBox.copy(this.boundingBox),
  20831. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  20832. return e.geometry.boundingBox.min.y
  20833. }), 5),
  20834. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  20835. return e.geometry.boundingBox.max.y
  20836. }), 5),
  20837. this.colliderBuilder = null
  20838. }
  20839. ,
  20840. n.prototype.toShortString = function() {
  20841. return a.nth(this.floorIndex + 1)
  20842. }
  20843. ,
  20844. n.prototype.toString = function() {
  20845. return this.name
  20846. }
  20847. ,
  20848. t.exports = n
  20849. }
  20850. , {
  20851. "../enum/RenderOrder": 42,
  20852. "../localization/localize": 108,
  20853. "../objects/Panorama": 148,
  20854. "../settings": 166,
  20855. "../util/common": 185,
  20856. "../util/easing": 186,
  20857. "../util/lerp": 188,
  20858. "../util/transitions": 195,
  20859. "./ChunkedCollider": 145,
  20860. three: 217
  20861. }],
  20862. 147: [function(e, t, i) {//"./objects/NSpider"
  20863. "use strict";
  20864. function n(e) {
  20865. this.player = e,
  20866. this.obj3d = null,
  20867. this.UP = new r.Vector3(0,1,0)
  20868. }
  20869. var r = e("three")
  20870. , o = e("../settings");
  20871. n.prototype.prefs = {
  20872. linewidth: 3,
  20873. height: .07,
  20874. opacity: .45,
  20875. endScale: .05
  20876. },
  20877. n.prototype.discard = function() {
  20878. if (this.obj3d) {
  20879. var e = this.obj3d.parent;
  20880. e && e.remove(this.obj3d)
  20881. }
  20882. this.obj3d = null
  20883. }
  20884. ,
  20885. n.prototype.draw = function() {
  20886. if (this.discard(),
  20887. o.showNeighbors) {
  20888. var e = this.player.currentPano.floor;
  20889. this.obj3d = new r.Object3D;
  20890. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  20891. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  20892. i.y += this.prefs.height;
  20893. var n = .1525
  20894. , a = .127
  20895. , s = .0127
  20896. , l = .1
  20897. , c = .19
  20898. , h = .2032
  20899. , u = .2286
  20900. , d = .255
  20901. , p = new r.Matrix4;
  20902. for (var f in t)
  20903. if (t[f]) {
  20904. var g = this.player.model.panos.get(f)
  20905. , m = (g.position.clone().sub(this.player.model.position),
  20906. g.position.clone().sub(g.floorPosition))
  20907. , v = g.floorPosition.clone().sub(this.player.model.position);
  20908. v.y += this.prefs.height;
  20909. var A = new r.Geometry;
  20910. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  20911. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  20912. p.identity().setPosition(m),
  20913. A.applyMatrix(p),
  20914. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  20915. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  20916. p.lookAt(v, i, this.UP).setPosition(v),
  20917. A.applyMatrix(p),
  20918. A.vertices.push(v, i);
  20919. var y = new r.Line(A,new r.LineBasicMaterial({
  20920. color: g.debugColor.getHex(),
  20921. transparent: !0,
  20922. opacity: this.prefs.opacity,
  20923. depthWrite: !1,
  20924. name: "sLine" + f,
  20925. linewidth: this.prefs.linewidth
  20926. }));
  20927. this.obj3d.add(y)
  20928. }
  20929. e.add(this.obj3d)
  20930. }
  20931. }
  20932. ,
  20933. n.prototype.update = function() {
  20934. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  20935. }
  20936. ,
  20937. t.exports = n
  20938. }
  20939. , {
  20940. "../settings": 166,
  20941. three: 217
  20942. }],
  20943. 148: [function(e, t, i) {///js/objects/Panorama.js
  20944. (function(i) {
  20945. "use strict";
  20946. function n(e, t, i, n) {
  20947. this.model = e,
  20948. this.id = t,
  20949. this.alignmentType = i.alignmentType || l.ALIGNED,
  20950. this.neighbourUUIDs = i.neighbours || null,
  20951. this.neighbourPanos = null,
  20952. this.floor = null,
  20953. this.floorIndex = i.floor,
  20954. this.failedLoadingAt = 0,
  20955. this.maxLoadRetries = 4,
  20956. this.origin = i.position.clone(),
  20957. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  20958. this.quaternion = i.quaternion.clone(),
  20959. this.skyboxMesh = new r.Mesh(E),
  20960. this.skyboxMesh.position.copy(this.position),
  20961. this.skyboxMesh.quaternion.copy(this.quaternion),
  20962. this.skyboxMesh.name = "skybox",
  20963. this.skyboxMesh.visible = !1,
  20964. this.skyboxMesh.updateMatrix(),
  20965. this.skyboxMesh.updateMatrixWorld(),
  20966. this.marker = null,
  20967. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  20968. map: w,
  20969. side: r.DoubleSide,
  20970. opacity: 0,
  20971. transparent: !0,
  20972. depthWrite: !1
  20973. })),
  20974. this.marker.renderOrder = s.panoMarker,
  20975. this.marker.name = "marker",
  20976. this.marker.pano = this,
  20977. this.marker.layers.set(v.PANOMARKERS),
  20978. this.marker.updateMatrixWorld(),
  20979. a.colorMarkerOnLoad && this.on("load", function() {
  20980. this.marker.material.color.set(65280)
  20981. })),
  20982. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  20983. this.floorPosition = i.puck ? i.puck.clone() : null,
  20984. this.tiled = n,
  20985. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  20986. this.solidSkybox.flipY = !1,
  20987. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  20988. this.solidSkybox.magFilter = r.LinearFilter,
  20989. this.solidSkybox.generateMipmaps = !1)),
  20990. this.zoomed = !1,
  20991. this.panoRenderer = null,
  20992. this.qualityManager = null,
  20993. this.tileDownloader = null,
  20994. this.tiledPanoRenderTarget = null,
  20995. this.minimumTiledPanoLoaded = !1,
  20996. this.highestPartialTileRenderOpCompleted = 0,
  20997. this.highestFullTileRenderOpCompleted = 0,
  20998. this.shouldRedrawOnBaseLoaded = !1,
  20999. this.lockUntilRenderingComplete = !1,
  21000. a.colorMarkerOnLoad && this.on("load", function() {
  21001. this.marker.material.color.set(65280)
  21002. })
  21003. //xzw
  21004. this.noBlocks = i.noBlocks,
  21005. this.seeMarkers = i.seeMarkers;
  21006. }
  21007. var r = e("three")
  21008. , o = e("../util/logger")
  21009. , a = e("../settings")
  21010. , s = (e("../enum/Viewmode"),
  21011. e("../enum/RenderOrder"))
  21012. , l = e("../enum/AlignmentType")
  21013. , c = (e("../util/common"),
  21014. e("../util/transitions"))
  21015. , h = e("../util/lerp")
  21016. , u = e("../util/ajax")
  21017. , d = e("../util/texture")
  21018. , p = e("../util/panorama")
  21019. , f = (e("../enum/TileDownloaderEvents"),
  21020. e("../enum/PanoramaEvents"))
  21021. , g = e("../enum/PanoRendererEvents")
  21022. , m = e("../enum/PanoSizeClass")
  21023. , v = e("../enum/RenderLayers")
  21024. , A = (e("../scene/SceneRenderer"),
  21025. e("../enum/GLCubeFaces"),
  21026. e("../exception/BasicException"))
  21027. , y = e("../tile/TileUtils")
  21028. , C = e("events").EventEmitter
  21029. , I = new o(i)
  21030. , E = new r.SphereBufferGeometry(.1)
  21031. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  21032. , w = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAIIRJREFUeAHtnQvsXVWVxnnKG8qjFCiPtjA8Qh3COyTgpIOgECQDwmAI+ByMCiNqJDpRY4ya0cGoICiB+MQhIA8JElAeaRxISAuFMJRAkUIpFCjlUYZnodD5fWXfet/3nHvPY6991krW/9z/uefss/a31vruPnvvs89667k4Ao6AI+AIOAKOgCPgCDgCjkCDEFi/QXVNsqpr1qzZkIpti+4QtluylW4RtPX5ffyvYzfqUv5db3WXvsP/b6Gvoa+Gbeuz/n8JfV7b9ddfX8e6GEXACcCI40j07TB1OrorOg3dHlXST0E3QOuQd7noSlRk8AK6HH0KXQYxvMjWJXIEnAAidBDJvhNm7YnujirhlfiboZbkDYxdhooQlqKLIYVn2bpEhIATQM3OINnVJJ+BKuFbqmZ7iqLbh8VtugRS0O2HS00IOAHUADxJP5XL7o/ORvdBdX/eRFE/wyJ0IfogZLCiiSDUWWcngArQJ+GFsxL9AFSJr3t4l14E1IfwIHo/ughCWNN7iO8pEgEngCLRbCsrJP0/sOsQ9CB0q7av/eNoBF7hkHvRe9C/ORmMBmycI5wAxkFtyDkk/h58fQSqpN9myKH+VXYEXuZQkcFdEMET2U/zI0ch4AQwCqEM35P06qE/HD0S3S3DKX7I+Ag8yal3ovMgA400uEyAgBPABOCR+HtxupL+YLSpHXkTIDjRqepAXIDeCRE8OlFJDT7ZCSCn88O9vRL+GHRGztP98HIQWEKxt6ILvK8gH8BOABnxIvE34VD92h+NahaeS3wIaDbi7ahaBaviMy8+i5wARvgk3N/r134OuvmIw/3rOBB4HTPmord6P8FwhzgBDMAn/OJ/kK+V/Nam4Q6oVeN2q5NQtwa3eYugv++dALpwIfHVmadf+2PRVKfkdtU6+X81BfkWdC5EoM5Dl4CAE0AAgsQXFhq/PwndOuz2TVoIaD7B9ajmE/gsQ4BwAgAEkl/DeaehevrOJX0E9HTiVZBA44cPG00AJL6esf8oqum6Ls1DQNOMr4UIGrt2QSMJgMTXAhrq3DsB9Qk8gNBgUZ/AjahGDLTASaOkcQRA8quZfybqzf1GhfrIyuq24HJIQNvGSGMIgMTfGK9+BNUvv1oALo5ANwJqAWjY8E8QwdvdX6b4fyMIgOSfifM+g2ohDhdHYBQCWpjkl5DA46MOtP598gRA8mvqrjr6NrTuLLe/UgTe4WrqINTU4mQlWQIg8TVt95OoVuFxcQTGRUCrE/0GItD04uQkSQIg+WfhqbNQDfO5OAKTIqBhwktTvCVIjgBIfnXyaTafN/knDXs/vx0B3RL8ERJQJ2EykgwBkPhb4JVPoe9PxjtekRgReACjfg0R6E1J5iUJAvAmv/k4tFYB3RJcBgk8Zs3wbnvNEwDJr0d2T0a9yd/tXf+/TAR0S3AdJHBbmRcpu2zTBEDynwpAIgAXR6AuBLTWwNV1XXzS65okABJfv/afQLUSr4sjUDcC8zDgtxCBWgWmxBwBkPx6eOdzqN6w4+IIxIKA3mh0CSRgasERUwRA8qun/9/RmbF43e1wBNoQ0NThn0ECZkYIzBAAya9JPeeienW2iyMQKwJ6BfoFkICJNQZMEADJvwugfhHdNlavu12OQBsCL/H5Qkjg6bZ9UX6MngBI/j1B7mxUzX8XR8AKAroNuBgSWByzwVETAMmvjj51+PmqPTFHkds2CAF1CKpjUB2EUUq0C2OEX35P/ijDxo3KiMDaEasQyxlPqfawKAkAwHTPr2a///JXGw9+teIRUAyfTUzvXHzRk5cYHQEAlHr71eHn9/yT+9dLiAMBxfK5IbbjsChYERUBANBaoLDNe/ujChM3pgAEFNMigah+2KLpBAQYNZW+gs4sAGwvohcBLXL5Zpvq7bn6X7Ipqrcfa9tSLaLqUjwCmiz0YzoGo5gxGAUBkPya2382un/xeDeixDXUUhNPlqPPtm1X8FlLWa0i4LTibWbBJ2odihS0tNpUVBOwprVtdasWRfxghzXRqICGCGt/diAKBxJsnwYQf7AnWxgr2Zehi1CNMSvhnyOYKl3GGp+phbAjKmLQXI190OloFDGFHbHLPHz2q7qNrN1ZBNKpgOCP9A6PBP2yP4wq6RcROHrbbXSCL/U2ZRGBdF9ULQaXwQjU/ihxrQRAwCjxRQAunQioabgQXYAq4Vd2fm3jP/w7BUtFBgejs1Hd6rl0InA1/q1tUZHaCIDgmAUOX0U9KP4eEEv4qGfL58f6K/93U/N9Cq2DwzhLt3oz8p2d9NEi+x/h71qWF6uFAAgGDYV8E1VHUtNFnXfzUb2zXvfzyQv+V7/BEagIwWPgvQ7c7+H/16p2fl0EcA4VbfrqvY+Awc3oQzheHXuNE4hA8bcfehy6d+MA6KzwA8TBRZ27yv+vcgLA6cdSLb2qq6mie/ubcLZ68F0CAsSFRhKOR9VX0FTRq8huqbLylRIATm7qfb9+4e9Db8bBS6t0sLVrESO7Y7NaBAeilcZnBFhV3h9QGcA4VhNKvoU26Z5PiX83ql/8Z9i6ZESAeNmZQ9UiOBStLE4zmlfmYeoT+i7xoglcpUtlwOLQL1CbJr2o80nqewWOrKV3t/TIqegCxI1ajaeju1V0yRgucz9x8/MqDKmEAHBik8b738BxN6BzcWIjO/eKDlziR3E6Bz0R3azo8iMtr5L5AaUTAM6bCcDnoU0Y759PPa8h8V+ONKhMm0UsbUMFTkE1fJi6qD/gfGLp8TIrWioB4DDNF/82OrXMSkRQtsbv1dzXVF2XkhEgrjS7ULcFmk+Qsuhhru8QV6U951E2AZxMBT6Usoeo2x3olThpdeL1jKp64cflNIw6KirDijfmL8TWdcUX+16JpREADtJwzn+gG5RlfM3lvsn1f49z1MvvUhMCxJlGCc5AN63JhLIv+y4X+E/irJTh41KSE6eo3DPRUsovG/EM5auH//ue/BmQKvmQ4IPvcxn5JEVZm0shpwqvX1kJegyWqgWQovwPlfoBgfdcipWzWKfgix9gu3yToiiXlFOFS+EEAFNpos8JhVtaf4GrMOEygu2/Ub/fr98fHRbIJ/KNfITKV6nJCSG3Cq1X4QSAdZrnr/X9UpJXqcxPCLB7UqpUinUJPvoJdZPPUhLlVOHP0BRKADDUXhh5SEqoUxdNzSx9PDYxzGqtDiSgsfPzUfkuJTkk5FhhdSqMADBMIwoalklJnqYyPySgGvGcfkqOCz77IXWSD1OS00KuFVKnwggAa45AU+r4e5T66Jff5HJchUSH8UKC79QSkC9TEeWYcq0QKYQAYCTdn5xUiEVxFPK/mPFTAqiSJ7LiqHKaVgQf/pTayaepyEkh5yauTyEEgBX/jG49sTVxFKBA+QWBU9r0yziq2Rwrgi9/QY1TIQHl2pwiPDgxAcBEm2BIKWOURVQwZxlqKl5KwLyb8zw/PHIEgk8vxcxUbgeODbk3EfITEwBX16O+W05kRRwnq7NIb2vxX/44/FG4FcG3F1NwCh2Dyjnl3kQyEQHAQHo2O4Vffw0XXUCA+D3/ROEU/8nBxxdgaQpDhMeEHBwb+IkIgKsq+a0v0KAJI0p+7+0fO4xsnRh8LRKwPllo4h/gsQkg3H8U0hFRY/hoyuhFBISP89fohDouHXx+Ede2Pm14ziR9AWMTAMAdiW5eh/MKvObvCIRSV1wp0FYvqmAEgu9/V3CxVRenHFQujiVjEQCMo1l/R491xXhO+isB4HP74/FHLZaEGPhrLRcv7qJHh5zMXeJYBMBV9LLH7XNfLZ4T9Oz4H+Ixxy2pGQHFguX1BJSLysncMi4BWO7510o+GutfnRstPyFJBEIsaI6AYsOqjJWTuQmApoae+JthFSXs1jJezxm2300vAYEQE78voeiqipwRcjPX9XITAKVbXoTxDhzta/jlCpHmHBxi4w7DNc6dm7kIAIbRuONBRgHSUN+VRm13s6tDQDFidVj4oJCjmdHKRQCUejiqJ/8sitbt9/t+i56r0OYQI1dUeMkiL6XcVI5mlrwEMPZ4Y2aLyjlwPo5dVE7RXmpqCIRYmW+0XrlyNDMB0LTYA0B2MwjKG9h8jUG73eR6EVDMKHasyW4hVzPZnZkAKK2wVUgyWVbcQTfA6P6uvuLwbERJIWZuMFrZzLmaiQBgFM38s9j5p8kdc4060c2uHwHFjsUJQuoMVM6OlEwEQCl7o3ozqyVZg7Hq+NPWxRHIjUCIHXUIWosh5apydqRkJYCxphmOvHq5B9yNAx8r9xJeeuoIhBiyOHckU86OJACjzX8x9k2pB6fXrzIEFEvWWgGZbgNGEgAV17vYt6oM6mIudB/M/UwxRXkpTUcgxNJ9xnBQzip3h0oWAjhgaAlxfnlznGa5VYYRsBhTI3M3CwHsb8xpC2HspcZsdnMjRyDE1MLIzew2b2TuDiUA7v+nUuK07lIj/9/v/SN3kGHzrMXWtJDDAyEfSgCcNZJBBpZczxeLYOrF9Vzar5o6AiG2HjFWz6E5PIoAZhur7J+N2evm2kPAWl/A0BweSAA0HTbCNyN7ESPyn9Z5fygie9yUNBFQjFl6p8A+IZf7emMgAXD0DFSPF1oRPfFnbazWCrZuZ0AgxJilJwWVwzMGOXAYAew56KRI998VqV1uVnoIWIu1gbmcCgEsgZmtruKSXnokXqMQa0sMVTN5AphnyBluahoIWIq5fARAp8FO+GhLI356Bzst3ZMZgdXNHIGAYk6xZ0G2DDndY+ugW4CBjNFTQv07NPPP+kse60fRLciFQIg5SzMD++b0IALYPRca9R68oN7L+9UbjICl2Oub04MIYFdDTvXFPg05KzFTLcVe35weRADTjTjqWZpiK43Y6mYmhkCIPSujT31zuocA6CzYDj/pBSAWxBIDW8DTbcyPgJUY3CzkdkcNewiAb/syRcdZ8fxjBfx4EHNLikbAUgz25HY/Auh7r1A0agWUp2m/lsAvoMpeRIQIKAatTEHvye1+BGDl+f9lPvwXYTo0zKQQg8uMVLsnt/sRwPZGKvOwETvdzPQRsBKLPbndjwB2MOIvX/LbiKMaYKaVWOzJ7Q4CoJdwQ5w1xYjDrAy/GIHTzZwAASuxOCXk+LqqdhAAe7dFu/etOziiD+p0eS4ie9yUZiOgWLTQEajcVo6vk+5k72kirDsyrg8v0vnydlwmuTVNRSDEopVVgjpyvJsAOtghYocuj9g2N62ZCFiJyY4c7yYAK48AW7nnamYqNLPWVmKyI8etEoAVtm1mKjSz1lZicigBbGHEd1bY1gicbmYBCFiJyY4ct9oCWFGAw7wIR6BIBKzEZBItgNeL9JyX5QgUgICVmEyiBfBmAQ7zIhyBIhFYVWRhJZY1lAA2LvHCRRX9FuOuFiZdFFVfL8cAAsTku5j5lgFTO172090HoNeBxS7+6x+7h5prn4XY7MjxbgLQswCxi5WmVuw4un3FI2AhNjtyvJsAOtiheHwKKdECyxZSUS/EHAIWYrMjxy0SgAWWNRe5bnAhCFiITfMEYIFlC4kmL8QcAhZicygBmEPcDXYEHIHxEei+BVg9flGVnblpZVfyCzkC+RCwEJsdOW6RADbJ5xM/2hGoDAELsWmeACywbGUR5xeKCgELsekEEFXIuDEpIWCeACy879wCyCkFtdclOwIWYrMjx7v7ACzMZd6YlU277c7uIj/SESgBgRCTJp6laa9+dyK91v5lxJ8tdLZEDJ+bVgICVmKyI8etEsDmJTjQi3QEJkHASky+2l7JbgLo+LL9wMg+T43MHjfHEbASk0m0AHbyeHMEIkPASkwOJQArLYCet5xGFgxuTvMQsBKTHTlu9RbACts2Lw2aW2MrMTmUAF4y4j8rbGsETjezAASsxGRHjne3AJ4vAIgqitiOcVcLY65VYOHXqBmBEIvb1WxG1st35Hg3AYgdtLhh7LI+Bu4Yu5FuX2MQUCwqJmMX5fbgFgArm2qa4MrYaxHss3LPZQRON3MCBKzE4sqQ4+uq2t0C0BcdTYR1R8b3YVZ8JrlFDUVgTyP17sntfgTwgpHK7GvETjczfQT2MVLFntzuRwBW3nI6nc6XLY0A72YmikCIwelGqvdst539COCp7oMi/V+dLlaYN1II3awCEFAMWugAVFWXdde3HwH0HNR9UkT/OwFE5IyGmmIpBntyu4cA6CV8EUe+YcSZ3g9gxFEJm2klBt8Iud3hih4CCN/2MEXHWfH8M417sCnxmOOWNAmBEHtWZgD2zelBBGClH0DxZqkJ1qT8aEJdLcVe35weRABLDXnvYEO2uqlpIWAp9vrm9CACWGzIT7N9ONCQtxIxNcTcbEPV6ZvTfQmAzgKNF3Y8NhhxRfW648Mits9NSxMBxVzHq7YjruarIad7TOxLAOGovozRU0IcOw6Pwwy3okEIWIq5gbmcCgHMoElm5YGMBuVImlUNsTbDUO2SJwD54ghDDnFTbSNgLdbGIoAl+MjCi0JaoXQYzGxlSmbLZt8aQyDEmKU+J+XwkkEwD7wFoNNALxFcNOjECPdrRZb9IrTLTUoLAcWYldV/hPyikMt9vTCQAMLRC/ueFe/O4+I1zS1LBAFrMTY0h0cRwIPGnLY3TTQrizMYg9bNDbG1tzEkhubwUAKg6bCCyi43VuHjjdnr5tpBwFpsLQ85PBDhoQQQzhrKIANLru8LzQzcvb7L+5VTRCDElKWZf3LDyNzNQgD3G3Sotfs0gxA3zmSLMTUyd7MQgEYCXjHm7gNh7J2N2ezmRopAiKUDIzVvkFnK2ZGjeCMJgHuINRR076CrRLpf8wGs3a9FCqWbFWLJ2hyTe0PuDnXgSAIIZ98ztJQ4vzwU5p4Vp2lulRUEQgwdasXeNjsz5WxWAvgbBb/cVriFj2Ls03GgNea2gG0jbAyxczqVtRZDylXl7EjJRABGbwNU+d3QOSNR8AMcgf4IKHYUQ9YkU/NflcpEAKH2d1lDIdh7Iky+jVHb3eyaEAgxc2JNl5/0splzNTMB0Ap4AquenNSyGs7fjGueUsN1/ZK2EVDMKHasyZMhVzPZnZkAQml3Zio1voP0pKClBRzjQ7BBFoVYsfTEX7t3cuVoXgKYx5UsPSLcDow6BDdq3+GfHYFuBEKMqOPPoig3laOZJRcB0LTQC0MWZC49rgO1YtDH4jLJrYkQAcWI1dWlFoQczQxrLgIIpeZqYmS2pJoDj4LhLY7pVoNOw68SYuMowzDkzs3cBADDPApASwyDdAaO3tGw/W56CQiEmDijhKKrKnJJyM1c18tNAKH0W3NdJa6DN8Wcz+Jw7w+Iyy+1WRNi4bMYoNiwKmPl5LgEoH6AF6wihd2a3HGaYfvd9GIRUCxYnPDTQkG5OFbf3FgEQFNDDwjd3rq60e0HYP5DjNruZheEQIiBDxRUXF3F3B5yMvf1xyKAcBV1OLye+4pxnfBxAmBmXCa5NVUhEHz/8aquV9J1lIO5O/9atoxNADDOKgqZ2yrI6HYT7D6HQLA67GMU9vrNDj4/B0sUA5ZlbsjFseowNgGEq6njQXMDLMuWGH8uATHFciXc9uwIBF+fyxnyvWVR7o3V+deq9EQEAPNMbEDLkJq3WuddJLB5zXb45UtGIPhYyW9pbf9BqNwacnDQ9yP3T0QAofTb2L468krxH7ALJp5NgGwcv6lu4TgIBN+ezbnytXVRzin3JpKJCSDcf9wykRXxnLwXpmiOwMS4xFMlt0QIBJ9qrF8+TkFumeTevwVAUYGuzsD/axVqfPuP2P95bwkY92Kb+cGXn2eXfJuCaMWfQjrgCyEAmEhPIf0xBWRDHRQoXyJwvE/AuFODD79ENVJJfnnk+pBzE3unEAIIVtzFdunEFsVTgJqK5xFAPjoQj09yWRJ8dx4npdLsV/2VY8q1QqQwAoCRNDvwqkKsiqcQdRZ9jUDyeQLx+CSTJcFnX+PgFDr82ut8Vci19n1jfy6MAGQBhulJwUzLEY9tcfUnarhILQGfMVg99mNdMfhKv/wpDPW1Y3BPyLH2fRN9LpQAgiXXslWfQEqiCSNfJrD82YHIvRp89GXMtD7Jpxtp5ZRyq1ApnABgqBex8MZCrYyjME0ZPYsA86XF4vBHhxX4ZSP5Rj5CrU/v7ahb+OfGkFv9vht7X+EEECzR9MSlY1sV94n/hHlfJ9h8UZFI/BR88XXMkW9SFOXSRFN+B4FSCgHAVO9ywctRbVMUPTv+DQLPlxer2bvBB9/ADMvP8w9DcW0uhZwadtxY360/1lkZT8I5J3PohzIebvWwOzD8Shy02moFLNpNbG2E3R9Dj7Jofw6b/0JsXZfj+FyHlk0Amlf/bXRqLqvsHfwsJl+Bo0a+jtle1eKzmOTfB6t0v5/68OwK6vgd4urtsrxQKgHIaJyl4TMNyWyo/xOX+dTvGhxm7UWqJtxCLOkVb6egh5kweDIj3+H084mlxycrZvjZpROALo/jPsjm1OGmJPOtHpG+AdVCDWuSqVWNFSF+FKdz0BPRzWo0pcpL/4H4ub3sC1ZCAKoETvwCmwPKrlBE5es9iroteCwim8yZQtzMwmg191Pt5Ovnk/uJm5/3+6LofVUSgB6s+Raa2uysYT5RC+Bu9CYc+sywA/27TgRI/J3ZczyqkZbK4rTTilr+0zya7xIvWuuvdKkU2MDmX6VWTegPaHeeiOA+9GYcm+r8iPb6jv2ZGNmdk49DD0Qrjc+xjS7uRN33/4gYqazVWDnAOPgYKqmOnKbKQiquFsHipgLQr97ExZ7s1y/+7H7fN2SfOpBLmfAzCL/KCUCG4Oxz2Lx/kFEN2a8hwz+jD+H0RnYWEgeKv/3QD6Ma2muyPEAcXFQ1AHURwBZU9Jtok/oDBvlW93zz0bsIAM0nSF5IfI3fH4FqOM9jYL31FAPfw/+vsa1UaiEA1ZAgUO9uE/sDhjl4CV/OQ+cTDK8OO9Dad/hbT+cp4Q9HZ6Au7yFQ+X1/O/C1EYCMICiOZvOv7Qb557UIKCjUV6D3vS2CDFau3WvsD/7Vakpq2h+M6t6+aZ2/VHmkVDLeP8iKWglARhEkmiCkiUIugxHQrYH6DNZqrK2D8CuvhG9p6lN1B3ss2ze34cursx1azlG1E4CqReB8mo2ahi6jEVCH4TL0YVTDRSKH5wik0uaLU36P4DM957EjqiTX7dy+6HQ0ipjCjthlHj77Vd1GRuEsgklNw7PR/esGxOj1RQrqSFqOihBa2xV8fh1dRbC9yzaz4JMNOHgTVBO4pqJK9GltW3XeRRE/2GFNHsTgi/GJbvVqlWgcSMC9DyS+gs6sFZF0L64lpd5EV3VtVeNNUSV7+1b+cCkegccp8sckv/xRu0RDAEICElBP8Xmofm1cHIHUEFDr7L9I/tdiqZiaedEIwGjo6wL0pWiMckMcgWIQUExfEFPyq1pREYAMAiDdy16IRsOSssvFEZgAAcXyhSG2Jyim+FOjIwBVEaCeZnMxGsV9kmxycQTGREAxrA4/xXR0EiUBCCUA08Myl6BOAgLExSICit1LQixHaX9UnYD9EKJjUE+JaYhwi37f+z5HIFIE1OzXL79+yKKV6AlAyEECu7D5Irqt/ndxBCJHQB1+uuePstnfjp0JApDBkIAmnpyL+hChAHGJFQEN9am3X53Z0YsZAhCSYZ6A1hKYGT2ybmATEdAkn5+R/GZGsEwRgCIKEtAMtc+hPm1YgLjEgsCDGKIOP1Od1uYIQN6GBPTswCdQf4BIgLjUjYDWcPgtyV/73P68QJgkgFYlIYJT+eyPErcA8W0dCNT+SO8klTZNAKo4JCACOBn1xSYEiEtVCOjX/jp+9W+r6oJlXMc8AQgUSEBzBf4N1UiBiyNQNgLq4b+M5K9s+e6yKpQEAQgcSEAThT6FNn21YcHhUh4CD1D0r0l+Mz39w6BIhgBalYQIjuXzv6B+S9ACxbdFIKAm//Uk/i1FFBZLGckRgICFBGaxOQv1WwIB4jIpAsk0+buBSJIAVElIQEtZfRI9AHVxBMZF4H5O/A2//FpaLTlJlgBanoIIfJSgBYZv8yCQRC//qAonTwACABKYyeYz6FT97+IIjEBgBd//kl99Te1NWhpBAPIgJKBlrD+CHoNGuw4CtrnUh4BWTtbLOf9E8le6zHpdVW4MAbQAhgh25/OZqLYujkALgaV8uJzE17Yx0jgCkGchAbUA1BI4AdXDRS7NRUAP79yI3kryqwXQKGkkAbQ8DBFomPCj6CGtfb5tFAL3UNtrSXwTz+6X4ZlGE0ALUIhgLz6fhvptQQuUtLdq5l9F4j+adjVH184JIGAECQgLvbP+JHTrsNs3aSHwMtW5Hr2L5F+TVtXGq40TQBduEIH6BOagmlKsNxW52EdAL5zRFN65JL6pBTvKht4JYADCEIHeladJROos3GzAYb47bgTewDwN6+mZfb0T0aULASeALkC6/4UIlPwiAbUKNL3YJX4ENG13LqqefZGAywAEnAAGANO9O7QIjmT/0ej23d/7/1Eg8AJW3I7e6b/42fzhBJANp3VHQQTC7GBUrYIZqEv9CCzBBDX1F5D43rmXwx9OADnA6j4UMtDw4VHoQahPKOoGqNz/1Zl3L3oHSd/44bxxoXYCGBe5tvNCP4FWKNYtwm5tX/nH4hF4kiLvROf5/f3k4DoBTI5hRwmQwR7s0HwCtQq26fjS/xkXAY3f69de4/dPjFuIn9eLgBNALyaF7Al9BXtTmPoLRAZbFVJwcwp5haoq6Regj/i9fTmOdwIoB9eOUgMZ7MNOrU6kNxpN6zjA/2khsJwPesOOVuFZ5EnfgqW8rRNAedgOLBlC0MIkIoLZqIihqR2I6shbhC5EHyThtRCHS4UIOAFUCHa/S0EGG7F/Brpnm6Y6BVlTche36RKSfjX/u9SEgBNATcAPuyykoFegixD0dOKu6HTU2nRkzcBbhj6F6um7xSS7Xp3tEhECTgAROWOYKZCC1i4QEYgQ1Ieg2Yg7oFNQLXBSh2gBjZXo86hm4ekeXgm/jGR/ka1L5Ag4AUTuoFHmQQwbcsy2qMhAW90+SLdo2+qz+hl0u6HjtW0pH9dTM7yl74TPuj/X22+karq3tvr8Eqqkf4lE1/EujoAj4Ag4Ao6AI+AIOAKOgCPgCDgC8SPw/zAG7eO6u+9JAAAAAElFTkSuQmCC");
  21033. n.prototype = Object.create(C.prototype),
  21034. n.prototype.enter = function() {
  21035. var e = null;
  21036. return function() {
  21037. this.setZoomed(!1),
  21038. this.emit("enter", {
  21039. oldPano: e,
  21040. newPano: this
  21041. }),
  21042. e = this
  21043. }
  21044. }(),
  21045. n.prototype.exit = function() {
  21046. this.tiled ? (this.clearWaitDeferreds(),
  21047. this.minimumTiledPanoLoaded = !1,
  21048. this.tiledPanoRenderTarget = null,
  21049. this.setZoomed(!1),
  21050. this.panoRenderer.deactivateTiledPano(this),
  21051. this.highestPartialTileRenderOpCompleted = 0,
  21052. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  21053. this.solidSkybox.loaded = !1,
  21054. this.solidSkybox.version = 0),
  21055. this.emit("exit")
  21056. }
  21057. ,
  21058. n.prototype.hoverOn = function(e) {
  21059. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  21060. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  21061. }
  21062. ,
  21063. n.prototype.hoverOff = function(e) {
  21064. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  21065. }
  21066. ,
  21067. n.prototype.build1 = function() {
  21068. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  21069. this.floor.addPano(this),
  21070. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  21071. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  21072. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  21073. }
  21074. ,
  21075. n.prototype.build2 = function() {
  21076. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  21077. this.height = this.position.distanceTo(this.floorPosition),
  21078. this.placeMarker()
  21079. }
  21080. ,
  21081. n.prototype.interpolateFloorPosition = function() {
  21082. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  21083. return !!e.floorPosition
  21084. }).sort(function(e, t) {
  21085. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  21086. }
  21087. .bind(this))
  21088. , t = this.position.clone();
  21089. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  21090. t
  21091. }
  21092. ,
  21093. n.prototype.raycastFloorPosition = function() {
  21094. I.warn("Performance warning: Raycasting to find floor position");
  21095. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  21096. , t = e.intersectObjects(this.model.colliders);
  21097. return t.length ? t[0].point : null
  21098. }
  21099. ,
  21100. n.prototype.raycastToFindFloor = function() {
  21101. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  21102. return function() {
  21103. I.warn("Performance warning: Raycasting to find floor index");
  21104. for (var t = 0; t < e.length; t++) {
  21105. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  21106. , n = i.intersectObjects(this.model.colliders);
  21107. if (n.length)
  21108. return n[0].object.parent.parent
  21109. }
  21110. return null
  21111. }
  21112. }(),
  21113. n.prototype.placeMarker = function() {
  21114. this.marker && (this.marker.position.copy(this.floorPosition),
  21115. this.marker.position.y += .05,
  21116. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  21117. }
  21118. ,
  21119. n.prototype.translate = function(e) {
  21120. this.position.add(e),
  21121. this.floorPosition.add(e)
  21122. }
  21123. ,
  21124. n.prototype.findClosestMidtpointPanoTo = function(e) {
  21125. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  21126. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  21127. }
  21128. ,
  21129. n.prototype.attachToPanoRenderer = function(e) {
  21130. this.panoRenderer = e,
  21131. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  21132. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  21133. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  21134. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  21135. }
  21136. ;
  21137. var _ = {};
  21138. n.prototype.getWaitDeferred = function(e) {
  21139. var t = _[this.id];
  21140. t || (t = {},
  21141. _[this.id] = t);
  21142. var i = t[e];
  21143. return i || (i = {
  21144. deferred: $.Deferred(),
  21145. active: !1
  21146. },
  21147. t[e] = i),
  21148. i
  21149. }
  21150. ,
  21151. n.prototype.resetWaitDeferred = function(e) {
  21152. var t = this.getWaitDeferred(e);
  21153. t.active = !1,
  21154. t.deferred = $.Deferred()
  21155. }
  21156. ,
  21157. n.prototype.clearWaitDeferreds = function() {
  21158. var e = _[this.id];
  21159. e || (e = {},
  21160. _[this.id] = e);
  21161. for (var t in e)
  21162. if (e.hasOwnProperty(t)) {
  21163. var i = e[t];
  21164. i.active = !1,
  21165. i.deferred = $.Deferred()
  21166. }
  21167. }
  21168. ,
  21169. n.prototype.loadTiledPano = function() {
  21170. var e = (new r.Vector3,
  21171. [])
  21172. , t = [];
  21173. return function(i, n, r, o, a, s) {
  21174. null !== o && void 0 !== o || (o = !0),
  21175. null !== a && void 0 !== a || (a = !0);
  21176. var l = this.getWaitDeferred(i)
  21177. , c = l.deferred
  21178. , h = null
  21179. , u = null;
  21180. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  21181. u = r.vFov)),
  21182. !this.isLoaded(i)) {
  21183. if (!l.active) {
  21184. if (l.active = !0,
  21185. r) {
  21186. var d = y.matchingTilesInDirection(this, i, n, h, u);
  21187. e[this.id + ":" + i] = {
  21188. tileCount: 0,
  21189. targetTileCount: d
  21190. },
  21191. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  21192. }
  21193. t[this.id] || (t[this.id] = !0,
  21194. this.on(f.LoadComplete, function(e, t) {
  21195. var i = this.getWaitDeferred(e).deferred;
  21196. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  21197. this.resetWaitDeferred(e))
  21198. }
  21199. .bind(this)),
  21200. this.on(f.LoadFailed, function(e) {
  21201. var t = this.getWaitDeferred(e).deferred;
  21202. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  21203. this.resetWaitDeferred(e))
  21204. }
  21205. .bind(this)),
  21206. this.on(f.TileLoaded, function(t, i, n) {
  21207. var r = this.getWaitDeferred(t).deferred;
  21208. if (r && "pending" === r.state()) {
  21209. r.notify(t, i, n);
  21210. var o = e[this.id + ":" + t];
  21211. o && (o.tileCount++,
  21212. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  21213. r.resolve(t, n),
  21214. this.resetWaitDeferred(t)))
  21215. }
  21216. }
  21217. .bind(this)))
  21218. }
  21219. this.tileDownloader.clearForceQueue(),
  21220. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  21221. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  21222. this.panoRenderer.renderPanoTiles(this.id, n, a)
  21223. }
  21224. return c.promise()
  21225. }
  21226. }(),
  21227. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  21228. if (e === this.id) {
  21229. var n = this.qualityManager.getPanoSize(m.BASE);
  21230. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  21231. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  21232. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  21233. }
  21234. }
  21235. ,
  21236. n.prototype.onTileRendered = function(e, t, i, n) {
  21237. e === this.id && this.emit(f.TileLoaded, t, i, n)
  21238. }
  21239. ,
  21240. n.prototype.onPanoRendered = function(e, t, i, n) {
  21241. e === this.id && (this.minimumTiledPanoLoaded = !0,
  21242. this.updateSkyboxForZoomLevel(),
  21243. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  21244. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  21245. this.emit("load", t),
  21246. this.model.emit("load", this),
  21247. this.emit(f.LoadComplete, t, i))
  21248. }
  21249. ,
  21250. n.prototype.setZoomed = function(e) {
  21251. this.zoomed = e,
  21252. this.updateSkyboxForZoomLevel()
  21253. }
  21254. ,
  21255. n.prototype.ensureSkyboxReadyForRender = function() {
  21256. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  21257. this.solidSkybox.loaded = !0)
  21258. }
  21259. ,
  21260. n.prototype.updateSkyboxForZoomLevel = function() {
  21261. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  21262. }
  21263. ,
  21264. n.prototype.getSkyboxTexture = function() {
  21265. // return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  21266. if(this.tiled){
  21267. if(this.minimumTiledPanoLoaded){
  21268. if(this.zoomed) return this.panoRenderer.zoomRenderTarget.texture;
  21269. else return this.tiledPanoRenderTarget.texture;
  21270. }else{
  21271. return null;
  21272. }
  21273. }else return this.solidSkybox;
  21274. }
  21275. ,
  21276. n.prototype.onTileRenderFail = function(e, t, i) {
  21277. e === this.id && this.emit(f.LoadFailed, t)
  21278. }
  21279. ,
  21280. n.prototype.isLoaded = function(e) {
  21281. if (this.tiled) {
  21282. if (e && "string" == typeof e)
  21283. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  21284. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  21285. }
  21286. if (e && "number" == typeof e)
  21287. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  21288. return !!this.solidSkybox.high || e in this.solidSkybox
  21289. }
  21290. ,
  21291. n.prototype.loadCube = function(e) {
  21292. if (this.isLoaded(e))
  21293. return I.info("Skipping load of pano, already loaded"),
  21294. $.when();
  21295. this.emit("loading", e),
  21296. this.model.emit("loading", this);
  21297. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  21298. , i = t.filter(function(e) {
  21299. return !e
  21300. });
  21301. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  21302. e = "high",
  21303. t = p.getCubemapUrls(this.model.urls, this.id, e));
  21304. var n = 0
  21305. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  21306. return u.getImage(t[i])
  21307. }
  21308. .bind(this));
  21309. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  21310. return this.solidSkybox[e] = [t, i, n, r, o, a],
  21311. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  21312. this.solidSkybox.low = null),
  21313. this.solidSkybox.needsUpdate = !0,
  21314. this.emit("load", e),
  21315. this.model.emit("load", this),
  21316. this
  21317. }
  21318. .bind(this), function() {
  21319. I.error("Downloading cubemap for pano", this.id, "failed"),
  21320. this.failedLoadingAt = Date.now()
  21321. }
  21322. .bind(this), function() {
  21323. return $.when(++n, 6)
  21324. })
  21325. }
  21326. ,
  21327. n.raycastsSkipped = 0,
  21328. n.raycastsDone = 0,
  21329. n.prototype.findNeighourPanos = function() {
  21330. return this.model.panos.setNeighbour(this.id, this.id, !1),
  21331. this.model.panos.forEach(function(e) {
  21332. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  21333. var t = this.position.distanceTo(e.position);
  21334. if (t > a.panoramaNeighbourMaxDistance)
  21335. return this.model.panos.setNeighbour(this, e, !1),
  21336. void n.raycastsSkipped++;
  21337. var i = e.position.clone().sub(this.position).normalize()
  21338. , o = new r.Raycaster(this.position,i.clone(),0,t)
  21339. , s = o.intersectObjects(this.model.colliders);
  21340. n.raycastsDone++,
  21341. this.model.panos.setNeighbour(this, e, 0 === s.length),
  21342. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  21343. }
  21344. }
  21345. .bind(this)),
  21346. this.model.panos.neighbourMap[this.id]
  21347. }
  21348. ,
  21349. n.prototype.worldPosition = function() {
  21350. return this.position
  21351. }
  21352. ,
  21353. n.prototype.addTextSprite = function(e, t) {
  21354. this.removeTextSprite();
  21355. var i = document.createElement("canvas")
  21356. , n = i.getContext("2d");
  21357. i.width = 256,
  21358. i.height = 256;
  21359. var o = "Arial"
  21360. , a = 60;
  21361. n.font = "bold " + a + "px " + o,
  21362. n.fillStyle = "white";
  21363. var s = n.measureText(e).width;
  21364. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  21365. var l = new r.Texture(i);
  21366. l.needsUpdate = !0;
  21367. var c = new r.SpriteMaterial({
  21368. map: l,
  21369. color: t || 16428055
  21370. });
  21371. this.text3d = new r.Sprite(c),
  21372. this.text3d.position.copy(this.skyboxMesh.position),
  21373. this.floor.add(this.text3d)
  21374. }
  21375. ,
  21376. n.prototype.removeTextSprite = function() {
  21377. this.text3d && (this.floor.remove(this.text3d),
  21378. this.text3d = null)
  21379. }
  21380. ,
  21381. n.prototype.isAligned = function() {
  21382. return this.alignmentType === l.ALIGNED
  21383. }
  21384. ,
  21385. n.filters = {
  21386. inDirection: function(e, t, i) {
  21387. return function(n) {
  21388. var r = n.position.clone().sub(e).normalize();
  21389. return r.dot(t) > i
  21390. }
  21391. },
  21392. inFloorDirection: function(e, t, i) {
  21393. return function(n) {
  21394. var r = n.floorPosition.clone().sub(e).normalize();
  21395. return r.dot(t) > i
  21396. }
  21397. },
  21398. inPanoDirection: function(e, t, i) {
  21399. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  21400. function(n) {
  21401. var r = n.floorPosition.clone().sub(e).normalize()
  21402. , o = n.position.clone().sub(e).normalize();
  21403. return r.dot(t) > i || o.dot(t) > i
  21404. }
  21405. },
  21406. atFloor: function(e) {
  21407. return function(t) {
  21408. return !e || t.floor === e
  21409. }
  21410. },
  21411. not: function(e) {
  21412. return function(t) {
  21413. return t !== e
  21414. }
  21415. },
  21416. notIn: function(e) {
  21417. return function(t) {
  21418. return e.indexOf(t) === -1
  21419. }
  21420. },
  21421. isLoaded: function() {
  21422. return function(e) {
  21423. return e.isLoaded()
  21424. }
  21425. },
  21426. isNotLoaded: function() {
  21427. return function(e) {
  21428. return !e.isLoaded()
  21429. }
  21430. },
  21431. isCloseEnoughTo: function(e, t) {
  21432. return function(i) {
  21433. return e.distanceTo(i.floorPosition) < t
  21434. }
  21435. },
  21436. hasMinimumHeightDifferenceTo: function(e, t) {
  21437. return function(i) {
  21438. return Math.abs(i.position.y - e.y) > t
  21439. }
  21440. },
  21441. isNotBehindNormal: function(e, t) {
  21442. var i = new r.Vector3;
  21443. return t = t.clone(),
  21444. function(n) {
  21445. var r = i.copy(n.position).sub(e).normalize();
  21446. return r.dot(t) > 0
  21447. }
  21448. },
  21449. isNeighbourPanoTo: function(e) {
  21450. return function(t) {
  21451. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  21452. }
  21453. },
  21454. isNeighbourOfNeighbourTo: function(e) {
  21455. return function(t) {
  21456. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  21457. var n = e.model.panos.get(i);
  21458. return !!n && n.neighbourPanos[t.id]
  21459. })
  21460. }
  21461. },
  21462. isNotRecentlyFailed: function(e) {
  21463. return function(t) {
  21464. return Date.now() - t.failedLoadingAt > e
  21465. }
  21466. },
  21467. isOnVisibleFloor: function() {
  21468. return function(e) {
  21469. return !e.floor.hidden
  21470. }
  21471. },
  21472. isPanoAligned: function() {
  21473. return function(e) {
  21474. return e.isAligned()
  21475. }
  21476. }
  21477. },
  21478. n.sortFunctions = {
  21479. distanceToPoint: function(e) {
  21480. return function(t, i) {
  21481. return t.position.distanceTo(e) - i.position.distanceTo(e)
  21482. }
  21483. },
  21484. floorDistanceToPoint: function(e) {
  21485. return function(t, i) {
  21486. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  21487. }
  21488. },
  21489. choose: function(e) {
  21490. return function(t, i) {
  21491. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  21492. }
  21493. }
  21494. },
  21495. n.scoreFunctions = {
  21496. distance: function(e, t) {
  21497. return t = t || a.navigation.distanceFactor,
  21498. function(i) {
  21499. return e ? e.position.distanceTo(i.position) * t : 0
  21500. }
  21501. },
  21502. distanceSquared: function(e, t) {
  21503. return t = t || a.navigation.distanceFactor,
  21504. function(i) {
  21505. return e ? e.position.distanceToSquared(i.position) * t : 0
  21506. }
  21507. },
  21508. direction: function(e, t) {
  21509. return function(i) {
  21510. var n = i.position.clone().sub(e).normalize();
  21511. return n.dot(t) * a.navigation.directionFactor
  21512. }
  21513. },
  21514. angle: function(e, t) {
  21515. return function(i) {
  21516. var n = i.position.clone().sub(e).normalize();
  21517. return n.angleTo(t) * a.navigation.angleFactor
  21518. }
  21519. },
  21520. inFieldOfView: function(e, t) {
  21521. return function(i) {
  21522. var n = i.position.clone().sub(e).normalize();
  21523. return n.dot(t) > .75 ? 10 : -1
  21524. }
  21525. },
  21526. optionality: function(e) {
  21527. return function(t) {
  21528. var i = t.neighbourUUIDs.filter(function(t) {
  21529. return !(t in e.neighbourUUIDs) && t !== e.id
  21530. });
  21531. return i.length * a.navigation.optionalityFactor
  21532. }
  21533. },
  21534. penalizeHeightDifferenceUnder: function(e, t) {
  21535. return function(i) {
  21536. return e.y - i.position.y < t ? -20 : 0
  21537. }
  21538. }
  21539. },
  21540. t.exports = n
  21541. }
  21542. ).call(this, "/js/objects/Panorama.js")
  21543. }
  21544. , {
  21545. "../enum/AlignmentType": 17,
  21546. "../enum/GLCubeFaces": 25,
  21547. "../enum/PanoRendererEvents": 35,
  21548. "../enum/PanoSizeClass": 36,
  21549. "../enum/PanoramaEvents": 37,
  21550. "../enum/RenderLayers": 41,
  21551. "../enum/RenderOrder": 42,
  21552. "../enum/TileDownloaderEvents": 45,
  21553. "../enum/Viewmode": 51,
  21554. "../exception/BasicException": 55,
  21555. "../scene/SceneRenderer": 158,
  21556. "../settings": 166,
  21557. "../tile/TileUtils": 174,
  21558. "../util/ajax": 181,
  21559. "../util/common": 185,
  21560. "../util/lerp": 188,
  21561. "../util/logger": 189,
  21562. "../util/panorama": 191,
  21563. "../util/texture": 194,
  21564. "../util/transitions": 195,
  21565. events: 202,
  21566. three: 217
  21567. }],
  21568. 149: [function(e, t, i) {//"./objects/Reticule"
  21569. "use strict";
  21570. function n(e) {
  21571. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  21572. t.map.value = d,
  21573. t.opacity.value = 0,
  21574. t.color.value.set(o.reticuleColor),
  21575. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  21576. side: r.DoubleSide,
  21577. depthWrite: !1,
  21578. depthTest: !1,
  21579. transparent: !0,
  21580. vertexShader: c.waypoint.vertexShader,
  21581. fragmentShader: c.waypoint.fragmentShader,
  21582. uniforms: t,
  21583. name: "waypoint",
  21584. opacity: 0
  21585. })),
  21586. this.layers.set(h.RETICULE),
  21587. this.renderOrder = u.reticule,
  21588. this.player = e,
  21589. this.direction = new r.Vector3,
  21590. this.hidden = !0,
  21591. this.mouseLastMoveTime = Date.now()
  21592. }
  21593. var r = e("three")
  21594. , o = e("../settings")
  21595. , a = e("../util/transitions")
  21596. , s = e("../util/texture")
  21597. , l = e("../util/lerp")
  21598. , c = e("../shaders")
  21599. , h = e("../enum/RenderLayers")
  21600. , u = e("../enum/RenderOrder")
  21601. , d = s.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAQABJREFUeAHtfQl8HMWVd1V3z4wky7KNjDFgwI4xR7htGccHhwMxkswRQmKSkCWBhGw2ybebQE6yuzj7fSEkBMLuJtlkIUDIQhYnhGDQYQdiDttgPDZgIBzGsQwGbGNZsmxZmumjvv9rSUYzmuo5NNPdI1X/MJqu89Wr939d9epVFWPqURxQHFAcUBxQHFAcUBxQHFAcUBwYRRzgo6itI7Kps+LxyGRx8lG20KcxTUzhjE9Ep+IfrxVc1KLRE7lghwjGK/E7yjiLIT7KBIu5731cSSI8IRhLIjyBoCRnokdwtge/d3PB2wUT+Md24+9u5vDtOre37uAvvbWhrs7sK0L9vxw5oBRAmfTa+fGeo6M8cioAeKom+HEA9zQAcyqAOwVN0AJphmA26n0btLSBlq0OF69D8WxKCnPTo3WVbwZCk6o0Lw4oBZAXu3xJzBfFE8dHBJ8vuDYTX2KAnp/CORvnS+1FqkQIthe0vwjaN3HhbDS5WLOyLvYaisdAQj1h4YBSAAH3REPz5piYNHW2zhgAz+bjSzoPX3Uauo+8R7B2jBbWYkqyBkOHNXxX2/qWxhk05VBPQBxQCiAAxjfEe6czoTVwzusxZF4IwFcFQEbwVQp2AFOaVUKIVsadlpa6ii3BEzW6KFAKwI/+XrZMXzzt0oUO5xdrXNQzxmf4UW351SE2O4K3akIsb9r64Cq2ZAnZGNRTQg4oBVAq5i5dqtUv/t7ZGueX4wt/GRh9aKmqGonlwlDwHqwFDzhC3N/a9IMn2dKlzkhsZ9BtUgqgyD1Q/2xytq5rV8II9nEY7iYXufjMxQksz3GxFfaDNgyp3wF42jVatuNit2Nr7Rhi79Z0Z7/tOElm2olk0komYvsTT29/OkkFzp0yNxpLVMeiUSPKInpM17Qo8lVjijIR+WpR7kQHy4oQFvzjR6DcqQibBsU2MTNBxQ0FL3eAl3+wbeee1jOj64tb+uguTSmAIvT/uas6xlfVjLkC4LgGw/vTilDkkCIA6gQT4hXG+YtciE2C81ctx25L7t/bNnbsofR1nGgZMB7a1gTQMIY7rJoZDH95tRBONQyMFQCRDgOcgbT4xw0Ai36jSGbBOI9/zEI6C+E20vVyru0XmtiP2G6hsf1I0810o8OwWDvS7t637z0tWj1uqqHpUAjiBNB0Kmg8BQWeCMEiP4MSPOIFKLnbD3R13/v4wgmdJahgVBWpFMAwurs+bi7QAHow8RP4GpKjTVEeANBiXDyPIfAaJpx1tmCbdmvR1w/R2KG6ZR7JdDFFF/zw/q/yRHypK4pScZ6FYGTRC8W0W2PabptbO6A2tttG5O09DntvopM8TufsVMa1OeDNfCb46VA0rsLJs5rMyQXrQd2/d6AMWusiqzMnUqHZOKAUQDYOpcfDoNcw9ZKPc137Br74denRhbwD8L34uj6JvE+hQ9bsYMa6ccmeCTEjcizXaajNp+DLejjiigegQgjNMQ+ACQXG3wXN24UttiYs84290cqOycyag7j5KOYsjDvOhkIoiuLCiCAubOcnLW0P/UEZDnPspP5kSgHkyK9zV+2qrqwZ/wXOtK+BacfkmM0jmdgM4LcIWL13cf0J+O4ewR37OF3n04XjTMdXvWgjCg8ifIvCaKGHa9oW2xZbhKa/Dp/idyYJ+xyOVREoggYohGGvjEC5bBPMua2nq/OOxxdOwpRFPdk4oBRAFg658/ux1dcBkF9F0vFZkntGAwTr8FW8X3BneY/e015hV5+MJa+T3DnzCAO8JyMQSQoB/3sFS6Mv9+r7X6q0K2Fs1C4GLy4Hr+dky58lvhPl/+zAvv23KDuBN6eUApDwZ/7q98bWVIzH154D/MNxwxUb8GW6n/Vay1ikIsF0uw4Gs5kQ9CMlVY/OYCGwp4BvZLYeZ2ZvjFUYSyCcl2NkMKtQhmCEtRfTg1u6ejtvW7Pg0H2FljOS8ykFkNa7i1bsGBOprcXXnn8TxquCXHIheDvwjbvLTtp3CmF2adHKOpjf6xTo05gte4UysAWPO8meOOeRGj2qX43+uAqKuLBlVbggoz9uNtvbf7bygsndsmpHY7hSAAO9DsedhsXXf07j2o0A/mEDwXn8hUFatMIyf7txhL7SfMeaiS16Z2E4OzWPMlTSNA5gKN+GNc6nIkcYG6137EXwb7gGihTelAXsgBRspyOc61uabrxbORb1MVopAPCBlvOwGeffIVgz0+Qvl1eab/7ScsxfYKnLMCKRBfjaYJgfzNJcLgSXYxo4H2GlhMct01yNJVLL0CJfhnL9EtqSv11GiI3wMf4ntXwIjpajMBSLZnePPYvcjKHlknzLxLy+DWv0twkrcpfg1klaRDsPc/uj8i1Hpc+fA7AVvOWYzmNcGC9zw7wKvga0MjM135IwVVsG18hvjuazC0alAjh31SpjzNgF10H/3QAVmNdyG772z2Hn2k3bjWjTUZa1AIrgwzAU5v8VyldaVfohHICBrxMC/Je3DGP1FCu5GDssv4NRwRlDEnoFwKEII7bvd+9bjRWDheQNOaqeUacALognZ+qM35G/oIiXsGa/NMm7Ho2xmkVwkV2ghvnhwApND+DyvDrBulZGRc358C1YiuncyflQR4rdZuILK+qiG/PJV+5pR40CmLv2rcoJkcnfB/CvxVcfU/7cHgjGaxjqf7/djjYdEoURSrBzkDOaW26VymcOJB3OntiT1FfW6hgRcO0G9PfxOdOAPRDo71s7zB03PD3vKIwMRv4zKhRAYzw5B0bjezHXn55rl2J+uIdz57vdFZH7KnqTH9GFvhCKo0QbXHKlSqXLiQM42NTm9qreiuifx/SanxZC+yH6/pCc8iIR+n4LY84VzXXRdbnmKdd0I14BNMbNazHXvwkCEMmlkzCnx9SS3ZkYo387esA6DQy6GHP8vOwEudSj0pSeA/ia08nGy3uqjU1V++yboMCvRn/mJPNQAjjtWHynuS5ya+kpDa6GnJgRHHmF13zB2r2HGLGqu9DfF+deinjBttg/6Jq9U+iRTyurfu6cC3NKWjXgtnmf7eiH6Qb7L8hEHlu2xXIrceCqFfPG0RHpI+4ZkQqgfp05F5tq/he6/uhcegzavgtDvn9tt/bdVRsddwlGAPNz/VLkUr5KEzwH3JEdZ2vak3sfqjXGXoUp4b9hVFiTE2WCvelw5/KWWdFnckpfRolGmgLgi+PmdTiKmuZ8OW2dBfh/Z7PEdZxFp2ucfQzD/TFl1H+K1Dw5gPldtyPYHwVLbtFZ7BbIyadyKQJyYuGY8+821UVuQXrok5HxjBgFcN66rtqYXvkbWH0X59Q1QrwKi/FXbNvYbGjWFcg3Lad8KtGI4ADsA1stx7hX160ZWNn5OZYNT8ilYcjXlLB7PvvYnBo6FansH7irl/+z+FlzXkyvei4X8PcZ+cQtnb2dZwqHTzI0+3oF/vKXgXxbQH1OfU8yQLIA0/8trmxkKYhkjGSNZC5L0rKILvsRQL+V/0e5DPkxjNsDu8BnuWP9VXD9GnRmzktDZdGbisiCOICv+h4u7NuFZnwQg/vfQJayygVNCTAT+Ha5rxKU8wiAN24wbwWIaR6Xdb6Pud9ay0mejs5O4mDLbyjwF4SVEZnJlQXIBMmGKyOQlWwNJZkj2SMZRNqy/ZCWJeHujbjs9LvA9iuydVTfsE7cLGqMH7BO80pN007JlkfFj14OOI7zIhsfuYd3Wd8Drr8JgGTHiGD37mDPX1WONyVnb1zIZKH/wI4HYLS5ICtpOAgCJ+peybn1msZ02keOI7PVoziQhQNCdDgMUwJhHI+Tje+BCsh+MIwQK3DgyGXlduBIWSmAc+NdE8ewyiYA+cwsXYjpmVjtWOantEiEztyjtf2c/f+zlq0SjHwOcFx9LsRDjmm+rBmR30GGcM5DlkeIZ3vtnsZyWiEoGxsA7d2vYpU4DMIb/DTkx3NTgu27UDOMSzGC+5gCfxbBVdFDOeB+MPjHSIZIlkimsq4SQDaxFL2GZHVogeEMKYsRwKL1iZMjmt4KFh7pxUZYZuG/bX8OBr91GotgyC/UkN+LYSouNw4IjimBeTucxLCpTL8bBsBs+0reNh27fuXs2Eu5VRBcqtArgIb15nxN4w+DRZ5ghnbuhpb+GHfELqZrOL8/aycFx3VVc9lxAPJlMtu5Q2h8Eqz/f4R8ZfMY7XAccVHL7MiaMDc21AqgYb3VAPdcGPyynNqDyzFx8WUj03gMV3XBq6+AAyPD3EuKtlBwACNMBye/3ssckcAFqs2Qy4mehOG0IbgdX9Yy22jxTBdgZGgVgPvl5/zP2cAPzbzNcSysCBjTdY1dEiAvVdWjhAO2wx7C7WdbNM1YAQAd49lsVwmIj4R1JBBKIyDN+d1hf9Yvv3jJ7NHhkmmcocDvKYYqsogc6JM14wxX9oTwnudDhkmWL3g2cVIRSShaUaFTAGRB7Tf4ec75aZnPShrnRMbYjeiQhUXjiCpIcSAHDpDMkeyRDJIsZskywdD1FWFcHQiVAqAdfVFmrAQzPa39WOlbnphgXGjEzCu5w2ZnYb6KVhwoCQdI9kgGSRZJJrNUciTJNsl4lnS+RodGAZCHX4Ve2QwLq+chjjDE3LNDGFfGOq2v4FCHE33l1gioDDYT8pPoxVJpJ5ZJd9A/+t0XBo8J9eTJAe1EkkWSSZJNr8wk2yTjJOte6fyMC4URsM+3/7SH4eSTxb1XLCdG457565D2MD8ZFfa6yEKN47GxR11zQY1bh3eawnkvxqIHEhHW65gdiciuCb0tjTzh1ZaGZhEzJ3VUaJEJsZjJcJtpsirCtUNxi+9huPkId/M5k3Eceq1aaUnjIvi9gxm3TOYWlECWY+jgNryDvXBRGPYOhEEB4BQf67ew9l+RxtLUV8yzaKjV9+Xn3pbX1Jwj7g1f7B4AfTPAuIVpYodtmztr/la16/dLOG68Kv3ziWVC7/rAgUm6HjmMOaQUNJy27MyAo8woPzxVbEuMN34e67AewQfK23UYG4ia6oy/Q28FOuoKXAG4W3oZ/7qn2MLSSsYWI+ZcCX6NxmF/EpeSvIFV6NeciPVq6+kV2yBggQrOkP4CgfXP9x6jmcYJTNOOB3nHIs0ovD+Bv2IltHuMqPUE+sjzchIo8p82z4pcO4SXPgYEqgDoMA/aU+3VXkj5NlpuMSrtxTBY1HmlHUlxEI53MZSMm6b12vg3Y3/z6+teLB7SKKHz6MQHIhEDNh1clsr44cUqO+zl4DbjuNWjN0Uq7bUAmOdoFbaX64I8VCQwBUCOPgD/43SwgrRDycNPWBhKuev8C6XpRkqEEPsw117PuflM88zKbSOlWdSOxo09xwgR+RCOWj8T/V49ktqWqS1wFloFZ6HndG5gA5vcYxC2GwtK4NygHIUCUQB9B3jSGX5Mepsuvvzdju0sxPVOh45kJx+008TXcZPNrGdatzz0MluyxJd5fCah9SVs2TK9fvolJ+nM+BBGOadCALNtrPGFrFJU4noMwhCr6doqtFNq+YcSeCthHzgjiG3EQSgAjqH/w/gKLJYxHQwxIRwXAhwHdM7JUDLiHrLYY5/DyvYeY93T8ziMeqPvmbtWVNZWWnPgL7+IVhZGIgdw2eBvAbIqKPlH8MGTKjuMApowFbgIPIDY+/f4rgBg9MMxS/zHsiai9cC+/RlYl/8KY9Lfj7jlJiwXMYe1NrU9uG7Ef+1lnZwejlHB4qmXzsEWrnoYzkbU8i4tz8J4+yus1nyQcf1/ADgp5iD434JR8OZ09pTyXUpMKSqlG3s0nT/pNe+HJvwhLmn9NefG10GcVGOWgr5SlukIsZ3boqV5TmQDZMBXLV/KdhW3bMEb15mzhM6xC5RPKW7ZwZWGzjaFsH6KS6k/j5Hvd2WUkD3AscXZrXMiT8vSFDvcNwXg3tUXHfMc9J/8tBRa68fpKzE27rsj5TAPKLQ2hxtNrbP4pmJ33kgur36DOFUT1mIAZuqIaCcOFUmwvT+MsbHePgK4hsxKdp/h112EvikADP2XY+hPc5zMDyz+jpU8Q4vGLoWzquf6aeYCQhYKi76tsQdaZ/qnzUPGgaKQU78R9zw67DJMDcYWpcAgC+H8JSeZeFAzovQhlJ4lgKnAw5gK5HGpbeGN8kUBZFvvp3m/cNhiLBHhvg5+aeHNCT4nrqPGnI89pTP9Tw/X8QPBU1T+FFwUF1U2sz8KG8FZmDyFZv9KIZwVtngQS704nZ49AvBJ8Qco+OIfICWgkMZlytMYT86Bq+hTnhZQJn4shP3fOGDhOpgAy/j0XrFNcOPe5pl8WyZeqLDhcaBxoziGCwsu42XsCo7ThnGADS6z0b+IEfG3ZByhlTC4V5/VXBddJ0tTjPCSKoC5a9+qnBA9/EWAH77imR8Md9bi0o4Gba91PYZ53mcAZC4iBKHiAC4a/VPLTONJZeArdXcI3rDROhsXen4UvK4qdW0lKZ/uHRhn3IjLR1qgBKR3DEIJbOlIvnvK0/OOKtkycUmHUxMik7/vBX587dst2/wk64KPf7mCn/PXE8JY2jIz8oQCf0ngklYoF8Rr4jlk5vW0yPJ4JVmHzJPsA+R7ZEQTdghDsvhihJdsBHBBPDnTYNqzmOVkHNLTvB8NuBhznSSWfC4rRmP8LMOd69ustblOXw5BpLaox28OwGTUGLcvhoTVl6NtAEvDD2CVgzZMwUAusQdgTdxizpkr6qIbS8HekowAzl21ytAZv0MGfmoIgH8L3dKL89IwlCu3R3ThNtn/aJ5tPKTAH2DfQfFSH1BfQKK6AqSkoKpJ9t2bqoEFaQH4gBKWCFPSNMOIKIkCGDN2wXXQbGdI6RLi1a7ezn8Tun5NuRn9BOevJcS+/9c0K/aKtH0qwlcOUF9Qn1Df+FrxcCuDwZswQFjAF/FVWXGEJcKULH444UWfAtDBhzEWeRVff+nhEDhb/Tzh8EnldJgnTVlgvW1urYvRyUVqyD8cqStVXjqTIJ64CKtJjdIhdanqHka5tHOQa2IX7rR4TFoMjhdPMPOER+sq35SmKSCi6COAKIMvswf4YfS4z7aNzdgIc04B9AaTBfMwzXHubJ1doeb7wfRAbrVCMVMfUV9hZFk2uyoJC4QJYON30oYCUy62pAkKiyjqCKA+bi7A7r2nZKSggV02S5ygs+hnMayZJksXqnDBEo6m/7JlJjYnqadsONCwUXxQc+wv4WMUKweiYRPbarPkb3QWexXW/xoZzdhdeFZrXSTbMeSy7EPCizcCWLpUg7n/34fUkBLg/Atn0enlAn50yn5bN29V4E/pxLJ4oT6jvqM+LAeCCROEDTj//KsXvS7GgDWvNPnEFW0E0LA+eTX8G38tqxwd8Xy71XVObaRmKZwfpIcjyPL7HQ569yQs47bHPsR3+l23qq94HDjvGXFYzLC+BoAdUrxSS1MSnOK6282upbVGzROg93RZLY7jfL5ldvROWXw+4UVRAHTOeaR24hYMtzLu5XYNaJaYr0X4sTCfeZ+Wmg/1pUorxNvd+v7/ePyMCZ2lqkKV6x8Hzn2uY/wYu/ofYbw90r9aC6sJ/iWrHVO8oRl8DcCZGZ+C7TTbd09fecHk7sJqeT9XUYYSkdrar8rA71Yl2J26Zu+EYWb++1WH9BfArzHjJwr8Ie2fAsiivqQ+xVLb2wVk9zcLMNKPFfkXHh9aF3NFoCyzhsmj4Pmr3xs7vmLCViiAjEc6katjYox+XKzH+Qfs9jsqj6J9T0rD/gP6/h8p8PvOel8qpJFAlV397bBPB+DP8FaiUvuvWLf9OgyCmacucKPv7O2YtmbBofuGw7xhjwDGV4z/ugz8RBjnznejB6zTygD8+2nOr8A/HHEKd17qW+rjsBsGCSsuZoAdKUfxwa2pGP81aXyOEcNSAOeu6hgvGL9WVhcY/Vp3ReQ+DDN8OdxARkfWcFrq063/VAa/rJwq+wTUx9TXmI4mwtwY2MouJuwQhmR0wph+HWFQFp9L+LAUQNXYarj8snGyihzhLK3oTX4EhEq9AmV5fQuHwwit87eeUdnmW52qokA5QH1NfR5mZyFMUyoJO4QhGbMIe4RBWXwu4QUrgHNX7aoGkV+VVoLrvDrsaDOcnRdK0wQcQasTXDh3q3X+gDsigOqpz6nvSQYCqD6nKgk7hCEYL1+SZSAMEhZl8dnCC1YAlTXjv4DC5cMPh99wSNReBPtAaD2x0PNNj8yOPpuNSSp+ZHKA+p5kILStA3ZcDAFLHjSO78eiRxJ5VGEKAOe4c6ZJDRCYtzyX0Loew6kt58irDjYGltbXWmbqjwRLhao9aA6QDJAsBE2HrH7CEGGJMCVL42IRmJTFe4UXpAAapl7ycRj2jpEWzJ2borzmAsSH9HZY0ZV09v5a7eqT9uDoicAGIlcWwnueQDTGajCSdm6SdQphkTApi/cKL0gBcF37hqxQDKnathvRJpzrH0qnH/ckH+bc+WjdIXtlbVDho4sDfbLg3NknG+Fru9DEAsIUYUtGnRcmZXkoPG8FQDv+YNWvkxYqnNumJCwc38wrpGmCjMAxXuowjyA7IJx1uzIB2QgjdYSloyzckg1syegjTBI2ZfGy8LwVAM7v+6KsMIR3CityF85oC6flH4dIumf4eTRARY1eDvSf7xjKg0bx9f+wiy1gTNZDWbCZMVteCoCcDuCgIJ1rwFDxS8Gtk6CN5KsDGcnwI1AcwMZ+nFOoTvPxg9tlWQdkw5URJkJ3oQthirBFGJPxlrCZr2NQXgqgsnrMZ7CsJ3PqcSzH/IUW0c6TERhkuGOzPz1ax9W8P8hOKIO6SUbojocwkkrYIoyBNicjfcBmVc2YKzLGSQLzUgA4xZTW/jM/QrTCrcYIo88/joprazmTLu1Qj+JAdg7QBS8kM9lT+pvCxRYwBscgqa0CI4Vr8qEqZwVQ/2xyNrb2nCYr3GH8diMSydsIISuvWOGuZVfT7gPtmEapR3EgFw5AViAzYVwVIIwR1uSt4Kf1YVWeYnBMzgpA49pnB2cc/BtbfncYR+grucOgJEL24KJOdVdfyPqkDMhxZQayEzZSCWOENcKcjDZd166UxaWH56YA6AwyjiuapY+4y3nXmhU6t19c0U239ErJVhGKAx4ccGUHMuSRxP8ouAe7WGPiLlnlUA4fZzmeGwgnouzP4ri5ENbzv8hSWglrhh7VP4GNCVNlaYIIt7m4u3Vm5Okg6lZ1jgwO1G805+qCfy5MrcFKQJudtH9vxIzNUrqE+HBTXWSVNL4/IqcRAPb8L5EXJDYIYXaFDfzEJAV+ea+pmNw4QDJEspRban9SEdYIc9jIuEFWozdm38+VXQHQJgOP4T8sa/dr0Uq5Z+D7dfn6y+FGeHd5+coJVdlwORBGWSLMEfakbSPM5rBBKKsCWDzt0oWYJxwqrajXwtZAESoFgFtXt7fO4pukNKsIxYE8OODKUsgOFHUxB+zJmkGYJezK4gfCsyoAh3PpcV4YGq1jkYoE7ANHDhQYhr/cFi1hoEPRMHI4IGzRHKrWEOaAPReDEsK8sDuQJasC0LioH0g85K8Q9zPdDtXXH04SO5vnRKRzoyFtUAGKAzlwwJUpyFYOSf1LQtgjDEoeT+z25/FUAA3x3ulwoJkhKR+Of85yeCfNlMUHEu7Qji7l9BMI70d0pZApV7bC00jCHmFQThGf0YdheQpPBcCE1iDPKjb36D3tYRr+44C/9qa2B9fJaVYxigOFc4Bki2Ss8BKKnBPTABeDTHgsB3phOMt5AFhukA7/4WzQUmFXn1zkJg2rOFyzvJItWVI210IPq7Eqs/8cgGy5MuZ/zdIaCYOERVkCLwxTHukIoKF5cwwbC6RWRGyWaNWEOElWsd/hWBIx23sM9fX3m/GjrD6SMZK1sDSbMEhYlNFDGCYsy+KlCkBMmjob6/9VmTJC4/Tu4voTGP6fmCk+iDA0dNPT83hPEHWrOkcPB0jGSNZC02JgkLBImMxIEzDsYjljpMcIAEeMzpfkQbB4ciJnR2B4USlP42+Mzaxn/K1R1TZaORAmWSMMEhYJk7L+8MKyfATAvRQAe4o79nGyCn0Px4aN1i0Pvex7varCUckBV9ZCtEmoH4vSnYvY1iz9mMsUAA5H4vNkvQsvozW6zrFEGI4HDg/rlfEvHH0xKqiAMdCVuZA0lrBImJSR049lJBn6ZFQAi+KJ4zH/rx2aHAMNwawdDIYQxwmNAuDcVMP/TJ2lwkrGgTDJHGHRxSSwmbHBwLKL6QyRGRVARHDpkAE+Ns8fbrAJYZn/CybebZ5ZuS1D21SQ4kDJOEAyR7JXsgryKJiwSJgkbMqyyTCdUQEIrsm9+wRbYyetY2UV+R/O4/7XqWpUHCAOhEf2XEwCm7J+kWE6owLgTJwqKwiXE6zjuviANN7nCJvpr/pcpapOccDlgGlaoblT0MUksCnrGhmmMyoAHCZwiqwgYbMXGNePlMX7HJ6s2cK2+lynqk5xwOXA+Ddjf8OPZCjYAUzagkn9E2SYHqIAzo/3HM05G5epUfCASrw59o03YAk8PFO832HwgHrj90u4cv31m/GqPpcDJHskg6FgBzC5fcwbmwmjmeghTBO20+OGKIAoj3gM/8UrRyQ+CL8DZqQXFMi744RmCBZI+1WlwXMgJDJImCRs4uP8iowpmbA9RAHAsilXAHCB1GxziqwCv8OdiKXm/34zXdWXwoEwyaBumZiay92UM2F7iALQBJd6+MGQ8CLXRCjm/2hMT+vpFWr5L0Uc1YvfHCAZJFn0u96M9eliCmE0YxwCM2F7iALAfudpsgIE56/iiORQzP/RnM3YjIQpj3oUBwLkgCuDkMUQPIRNwqiMlEzYHqIAcMyPVAFYjt2GIcZEWQW+htvOFl/rU5UpDkg5EA5ZxJVhtX0YzUwoXIKnpsekKIBZ8XgE1kL5EH9Px1Z8cjO6CKcXXPL3iNhR8jpUBYoDuXBAC4cswhA4kQGjUpI5m0IYHxyfogAmi5OPQmRK2MHEgu2O1R6GEQavOBgW4A/bNncGWL2qWnHgIAfCIouETcIoA1YPEpf6Q+vH+MHQFLDbQpcO/zF/IM0SiuE/NiQ5NX+r2nWwFeqH4kCAHCBZJJkMkITBVU/sx+rgsIO/0zGeogA0XdAIIOOD+UObZYRk+M/EbuUAlLGbVGAAHHAdgkJyWChhlLAqY0M6xlMUALyapPN7jCveYbY1QVawn+G4DEEN//1kuKorBw5o4bBJAaMuViUUp2M8RQG4RgRZRsZwHDIfI4n2N1gPCbP9bbWqLcwc4OEwBBJGYaiXHl2ejvE0BSAfAeAokN3cYdVh6AOchKpGAGHoCEXDQQ6ERSb7MCpkRkCc85OK8RQFAJBLjXzwd2jHDoBQjABsx1AGwIOip36EgQOhkUlg1MWqlCmpGE9RADg8UGoDcGytnTs8FCMAi/eGw/VSymQVMdo4EBaZJIwSVmX8T8d4igKAY61UAcDwtlsIJxQKQEtYmc9Al7VahSsOlJgDYZFJwihhVdZcYPyQwXEpCgCHBkidfDTd2Q/tIY0fXGipf+t6tVIApWayKj8vDoRFJgmjhFUZ8cB45eC4FAWACOkVQsxyEpoIxzkAb46V3IIyuGXqt+KAjxwIi0y6GAVWPZqegvFUBcBZVJbRtu0kTIi4ZCTYBxrOefkkHo5jmIJlhao9RBwgmSTZDJwkYNTFqoyQNIynKACsEUoVQDJpEeiCPwnIEQr8ss5V4cFyIByyafRjNSMv0jGeogCwiSBleDC4hERsP4YVPHgFwNXwf3C/qN8h4kAoZJMbfViV8CUN46kKwGME8PT2p5PY8BC4AsB2ZWUAlPStCg6WA2GQTcIoYdWDEymj/HQF4JFPRSkOKA6MNA6kKwCp5pg7ZW4UGi7z3WM+cgUaLhRLkT42WVVVJhwIg2wSRgmrHixLwXiqAuCZzxSnwmKJatgHROAKAHYKpQA8eldFBciBUMimsPqwKuFDGsZTFAB2EaVoh8FFRKMGaZXgFQDnUkPlYHrVb8UB3zkQDtm0+rGasfnpGE9RAPi6yh0IInoM65yBKwAsY/CGZqGUQMbuVYFBcYBkkmQzqPoH6nUxCqwOvA/5m4bxVAXgMQLQNS2KOU4oruEyJ3WoacCQnlUBQXIgLDJJGCWsevAiZZSfogBwqYB0lx12GFVjI0EoluC0yAS5hvNouYpSHCgVB8Iik4RRwqqsnekYT1EAGD7skWbkfCLnmnSTgSxfKcJjpjIEloKvqszCORAWmSSM4nRg6bke6RhPUQDQHtJ9xNhhVCs0EQoFkGDJqsK7SuVUHCg+B8Iik4RRwqpHC1O2CqcoANgwUiIHF4KTRifCBNg9OCyo3xGuHRpU3apexYFMHAiNTAKjLlYzEYkwxKV85FMUAE4TTYkcXAZdOyQ0FooRgMP5YYNpU78VB4LmQFhkkjBKWJXxIx3jaQpAeqMIrW+gUBGKEQCzncmyBqpwxYFAOCB4SGRSdPdhNTMX4AeQMspPUwAeRwkxfgTTjY7MxfocqoWF2T63W1UXYg6E5KMEjOLk3yNkjMIIQK4AmMO3SzNyMdWw5EZCWb5ShGMeU/uJZSLww0lK0TZVZvlxgGSRZDIMlBNGcTXYVCktaRhPGQHo3N4qy4gGTkNcivaQpS11ODY8aF0fODCp1PWo8hUHcuEAySLJZC5pfUizux+rGatKx3gK0Tv4S28hV+ZjjTibuG/fe7j/QITCGUjXI8oQmLGLVaDfHAiLLBI2CaMw2GX2A4CXYD/GD7IoRQFsqKszsR9AOg2IVo+bmm5EOFiS3z8cZQfwm+WqPgkHQiKLhE3CqIRKCn7bxfigBCkKgMIxf2gbFJ/y09D0qZrHUmFK4pK/aNNLXoWqQHEgJw6EQxY1pu0mjMpIzoTtIQoA8wcPO4A4webiXVkF/oY7MxiuOvW3TlWb4kAaB1wZhCyG4LG5tYMLcYKMlEzYHqIAHC5elxUgOD+V2fKVAlm+UoRjqaOy/vneY0pRtipTcSBXDpAMkizmmr6k6YBNF6OSSrAE+Fp61BAFgMZsSk908F2IU2wj8vbB94B/aKYh1XYBk6aqHyUcCJMMutgERqWs5/zF9LghCiApTLkC4PzEd2J/3Q1jQ+AHg7gN0bTj0xuk3hUHfOVASGSQMLnHYe8xYFTW/kzYHqIAHq2rfBOHCuzNVAgm3LEp3cfOQCWhsAPgGuRjlUNQpp5SYX5wwHUAggz6UVfWOoDJiU7yOMJoprSEacJ2etwQBUAJcGjAkKHCQEads1NhfJMuFQ6k8+lvtGs6Iwcl9SgO+M6BzqMTH0ClXqfv+EcTMOliU1KjDNMZFQBuEPWYBmhzhC2kKwWS+ksWrDNb2QFKxl1VsBcHIhEjNFNQF5NcmyOjV4bpjAqAC2ejrCAMD+brUeMNabzvEaLO9ypVhYoDLgfCI3sJy3yDsCnrGBmmMyoAk4s1soLgKXT6uxbrgNuh9PxAad4SRGDV4vDGjT1qObAEvFVFyjlAMkeyJ0/hXwxhcW+0soOwKatVhumMCmBlXew1uARnPBwEmx6MycyawzVti6wyv8OFiHzI7zpVfaObA2GSOcKii0lgM2OvAMsupjNEZlQASAf/JrE2Q3o3CEsO821bhEYBYIfSbLZsmdoeLOswFV5cDkDWXJkrbqkFl0ZYJEzKCujHMpIMfWQKAGeHMfk0gLGzhKZLPQaHVlPiEM7H1k+/5KQS16KKVxxwOeDKGmQuLOzox+JZMnq8sCxVALgBxEMB8LPhDfROWOwA1HCdGWoaIJMAFV5UDoRJ1giDhEUs3p8ta6QXlqUKgO9qWw87wIFMhcIOUDFJ2OdgovBKpvggwuDnfOrctSIcPtlBMEDV6QsHSMZI1nypLJdKgEHCImEyY3Jg2MVyxkgmP8WkpXFGAg1dJckHZ0BRj5NQX5bF+x0OD6hIbaUlXQf1mx5V38jkAMkYyVpYWkcYJCzK6CEME5Zl8dIRAGXA8KJVlhEap6FX3/+SLD6IcEewRcoYGATnR0mdMP65Mhai5hIGCYsykrwwTHk8FQDjTousYMw5ZlTalbXQEm/L0/gbg/3OtYunXqpGAf6yfdTURrJFMhaaBgN7LgaBRSlNnhjOogBa6iqw1Cc2ywrnQrsY+4/lXoOyjKUM1xiGQ+qgkFKyeHSWDZlyZSs8rSfsEQblFInNfRiWp/AeASCfI7h0GgBDwOW4jDguLz6AGNwa1LjOnBVAzarKEcwBV6bCdiMVYY8wKHk8sdufJ6sCgMPDckn5qJvPYWZvLEzTAKIVp7RL50SytqhwxQEvDoROpmjqDey5GJQQ7oXdgSxZFUDT1gdXwYXovYEMQ/5WGEtswUM1CtA4n1K/IURLNUOYpgLKiQMkSyRTYaLZxRywJ6OJMEvYlcUPhGdVAGzJEhv+AA8MZEj/iyWRy51kT6gUANGoCWtxOq3qXXGgEA6EUZYIc4Q9aXsIs4TdLE92BYACHCHul5fDZ3EeqcFyQ5s8jf8xGBpNrd9ozvW/ZlXjSOIAyRDJUpjaRFgjzGElTmrr8sbs+63JSQG0Nv3gSRwptOP9bKm/9Kh+NdYiV6eGBv+mO+yyi+KiKnhKFAXlyAGSHZKhsNGOq7ueIszJ6CKsEmZl8YPDc1IAbOlSOByxPwzOmPqbX6UdbmzArqPe1PCA37Bhw2b2RwOmQlVfphxwZSdEm36IjYSxyBEGlt75VTK2ulgFZmXxg8NzUwDIYdvOPYMzDv6NCidb79iLQFTobAFYuz2rcaM4ZjC96rfiQDYOuDID2cmWzv94HiesEeZkdXthNT1Pzgqg9czoeuifF9ILGHjHlWHXWKYZumkAtkJqXFhXKOeggZ5Sf7NzAC42kBmSnexp/U1BGCOsyWsVL/RhVZ5icExeDcTGgtsHZ075zXk9DhGwwDq6YThkDz+mYaMl3S4ZMmIVOQFzoE9WeOhGjS62gDE44Hht/pFjNANf81IAB7q678WSYE+GcihIM7TIlx3TeUwSH2iwJthHz4+LcYESoSoPPQdIRkhWwkgoYYswBtoy4xbYdDGaB/GZC5IU8PjCCZ1wMPi9JJo8A7/EhfEyRgqdsjTBhfOqmOZ8AV6LWD5Vj+JABg5ANlwZYTx0K0eEKcIWYSwD5W4QYZMwKovPFJ6XAqACHK9pAGPjuWFeBYT9JVNlgYcJcVxj3PbYPBE4hYqAADngygZkJEASpFUTpghbSDBeligLNjNmy1sBtNZFVkMbya39XPvaW4axOnRLggPN11n94g2JEwde1V/FAeKAKxOQjTByg7BEmGLAlow+wiRhUxYvC89bAVBBwnZ+IisQmmrqFCu5mDs8b2JkZRYzvM+yq119fnyPsgcUk7FlXFafLGhXh9HqT2wlLLmYArZkbPbCpCwPhRekAFraHvoD5hvbpAUL7TsJ1rUS8UlpmkAjeE1UG/d5ZQ8ItBPCUTnm/a4sMA7X2lA+SRdLwJSMOsIiYVIW7xVekAKgTQaCObfJCoah4oyYU3Oew9kTsjRBh3Mhjq+PJy4Kmg5Vf7AcIBkgWQiWCnnthKGoqDmfMCVL5WIxh40/mfIXpgBQUk9X5x34I7c4auL7e5L6SiwbSg8kzESQn2GaZjReuD55pp91qrrCwwHqe5KB8FCURgmwQxiCV9LStJjBr539WBwclvPvghXA4wsn7ceupJ9Ja+L85Fo9udjm9ippmoAjYK/AEW/a5xo2ig8GTIqq3mcOUJ9T35MM+Fx1ztURdghDWF8/WZaJMEhYlMVnCy9YAVDBB/btvwU7j/ZKK+HaDb0V0T+DSJnzkDSrbxGc6Zpjf6n+uZ6pvtWpKgqUA9TX1OeAfmivkyPMEHZg+b9BxizCHmFQFp9L+LAUQJ9jkJASgHnL8WN6zU/D9UZ6rFguRJY8DWcxzTb+z3nPiMNKXpeqIFAOUB9TXwP8sUAJyVI5YYawQxiSJcXS3y35Ov6klzUsBUCFdfV23oZ5fnt6wQPvQmg/TFYZL4Rzj8AAlRgHcl4dM6yvnftch9TR4v3U6lc5coD6lvqY+jrM9BNWXMwAO1I6gTkXe9IEuUUMWwGsWXDoPngG3CyrDtsWD4l12z/itnkflivwX3gfCMYhY+zqf1SHiIS3jwqljPqU+pb6uNAy/MhHGCGsuJgBduR1ipv7sCdPkUvMsBUAVWK2t/8M0N4prZCzq21HPwzDrjXSNGGJ4PxIh1nfUCOBsHTI8OmgvqQ+xTDvyOGXVuISgJF+rFwtq4lO/HExJ0uQR3hRFMDKCyZ3O8K5XlYvWVp1g/1Xe3LvQ5i3dMvShSYcglJlV39b2QRC0yMFE0J9SH1ZDuAnbBBGCCteqxNCON8jzBXMlEEZi6IAqLyWphvvhmcdjiqSPfy0WmPsVbhb7Y+yFGEKp6Ei5ovfUqsDYeqV/GihvqM+DPuwf6BVhA3CCL6Xpw2EDfkLjLlYGxJRWEBR10Dr4+YCnfOnZKRg6NJls8QJOot+Fp0yTZYuVOFwxnA0/ZctM/lfQ0WXIsaTA7TO37/UF2pr/0AjsOy31WbJ3+gs9irsZlK3ZFuIswrZ9DNQT/rfoo0AqGB3p6Bgy9IrGXinhqGBt1iOcS+UQU6HFg7kDewvLRE69leVx2BgPZB3xa6HH/os7Et9Aw0jLBAmCBte4Ee6ZcUEP9VfVAXgNihhfgsGQanjDxr4KV23ZmC488QAA0L/Fw4jjqZdXb++92K1gSjEvYWNPdRH1FcAf2idfNI5SFggTBA20uMOvgNTSWZ+8+B7kX4UdQowQNPiuElGl5sG3of8FeLVzt7OM8dVjL++XOZnA23AGu1rSWfvrx+tO0TuATmQWP31jQO0pZd29YV5Y08mZmDov2dvb+eN4yvGPwvMnJApjRsmxHea6iI/ksYXGFH8EQAI6d63Gi7C4jkpTWgoGnwDF/bt0NRZry+SlhNABAlYjI/9Z3WoSADMl1RJfUF9Um7gJ9knDBAWvMBPWCJMSZo/rOCSjACIogviyZkG06DVMg/F+p2CLkbjkrh4MXS3r2TjKlw1Haiu1uY6fTk6L9QOTtnaUrbxGPK7x3jhJJ+wHubhxVtc3/UARsBRpFkOIGbGomC2xZwzV9RFPVbYvGrxjstcqXeenGMb15s/5hqXzltg1NhjOcnTdW5comnaKTkXHKaEnL+OZYI7Hq3jakrgY7/Q6b39h7yG8gy/bKxwHOdFW1gPGVr0ecz9pR5/whE3N8+OfCtbeYXGl2QKMEBMh7njBoB8y8B7+l9quKFH/peNj9wD41pHenxZvOMQyRi3ljY8a55DXpxlQXNZEyk48Zp4DpkpS/C7sg6ZJ9n3BD+wQxgqZXeVXGAb48k5WGx4Cg2NyBoCD6gfC2H/Nw5nuA4rCGVjvU1vD0akbUzT7mueybelx6n34XPAva7LcbBDTkwdfmkBlYB5v+NYWO7Tv8gZl37Z8eE0beEsWDE7+mwpKS25AiDiG+PmtZjrSI0YZA9wHHahrgkYBPnHStngUpft2gYc3N7K9D89XMcPlLq+0VA+beRxL+rEXX3lONdP7SPxR9vhuqaxRwA+Kf4AiGubZ0d/mpq3+G9SAopdVeMGE4YOfpG0XGxvdKzk6ZphXIpDEKQnoEjzhy1CiH22xh5onRl5OmyklRM99RvNue4V3SG7pbcgHgrnJceyHtSM6POAfq28DLG8aVbkEnl88WJ8UwAXrN17iBEd8xwafrSUfCFWJ9i+C2Ns3HdxWNcEaboyisAqR5vDjabWWXxTGZEdOKn1G8SpmrAWY+Q4NXBiikGA4B0JtveHMTb2EawaLZAWKdibVrL7jBXzxu2RpilihG8KgGiuX2fO1XT+JOwBhqwNAMxNWPm4g3Pj6yBOajeQ5Q9rOJZ8tnNbtDTPiWzAyE8tG2bsKCzrrTNnCZ03YGl4SsYkZRiIzja5o98quHUNFJr8eG/BLMcWZ7fO8W/U6KsCoL6DlyDty5YeIEL2ANw88hnmYPONpv09lEVJVyp8lychdsKDoLWp7cF1dLy67/WHscJly/TFUy+dg57GDdN8RB3LBmOewxznV0zDwbNc/x8ATo45Ib4Jb7+f+NlFcmJKRwWcN8yHoQkXy6ogCyi0wIVQBgewu/DvZOnKORzXPbVrnK1s7zHWPT2PS/dOlHMbs9E+d62orK205sAXfhGOZ/aYE2crKbzx2L33W4CsCvavRzxXwoRoaq6LkI3M19FhEAqAnbeuqzamVz0Hhhwl6zpwoduxnYUwCB6qa8wXg4iMllKGo50mhGOTzaxnWrc89PKIHxXga18//ZKTdGZ8CEr+VAjgiJnmpcuJ7bCHsL71nqZrq9DOMenxA+/44L2VsA+c8dicmvaBML/+BqIAqHGLnzXnCY0/4WUPgC7cDW8pGEyMM6AEFvrFlMDqwcqBw/l6zs1nmmdWbguMjhJU3Lix5xghIh/ShJiNYf7YElQRqiIB/lWMWc/ByxWXerKJMuIAfos74pymMyNrZWlKGR6YAqBGNa5Pfp1r2q1eDcQXcpvZo8+LjLEbucNme6UdSXH4Or6L6WLcZvqrNVvY1t8v4WVlL/jEMqF3TWfTdGZjh5uowyjn8JHUP15tERpbb3brzZFKey0AdoxnWp/W+2U0BKoAiCj4B9wK4fi6jEA3XIiXrKRxjhFzroQwjcarvZPwMnwDxqTXnIj1auvpFdvwFYVuDNFDe/Gf7z1GM40TYLw9HuQdC+qiIaLQJ1KcV6wE3Hyj1hPoI09/Fij5nzbPilzrE2EZqwlcAYAqvjhu/RbDpCsyUjgQSD4CE4wLY53WV5DFU6sOZBmpfyE4MBpqmxlztsC6vMO2zZ01f6va5dcowf26f+DAJF2PHIbVmsmgZTpomQFFXjlSeZ5bu8S2xHjj57EOy3utnwoT7N6mOoMM3IEq8jAoADYrHo9MZqc9DI15gTejxfIdwrhyMrOuQ9oRtVzk3e7sse5yExO74UexE5ed7cBce6ftGLss3tujJaxeXa/ufXMs6335JO55ZftJL4vo0ftYhW3vr3BiRoXGtKoIDLGwTRwGL/bJWL0B3/nEEbc8m53F3inA7x3MuGUyt+4Bfy72TCzEih3shYs21NWZnul8iAyFAqB2LlqxY0yktvYvAPaZXu2GoN8DCf9HMHrUjwS8+CSL69urIJIYcfUCxL2UDjytwHeoAryPQSBCIxOyNoQvXGzDh+nnh3H7P8E872VrIZ7Fmf4fLtax3sPlRag6+9x418QqVrkaX5njvRsmlmOodWWs07lqlNoEvNmjYn3kAH8lMV67C1PTrF9+jM5eS9g984NY7pMxJFQKgIg8P95zdIy7SyLet7jAJgDD4CVazL4MroJ1sgaqcMWBUnEAx1rHnYT+AAx+D2H0JPfv7yPg7YQw5z1aV/lmqegppNzQKQBqxKL1iZMjmv4kfnpvCMLqQLLXuECP2WePCj+BQnpY5SkJB2id307oT0YrrBUAv6e1HwR0mI599srZsZdKQswwCg2lAqD2NKw352NDCO5HZ56WZZhQt+GABRgPjekj2WNwGH2sshaZA66HH7O24ACbFQCQ94oUjvPGRrCPtMyOhPJezNAqAOqzhvUWdoWxB7IpAddj0HEamcZjGuNXKAt1kSVeFedygFZaHCbuZY5I4ESPZsil1MOvLwOBn13WMttoCSsLMX0O70OMI+0JCr3PC0RH9PtbV+EKj19hVBD48kp4uaooK4QDrkxhVx++mFUka1nBD5nt+/KHF/zEh1ArACKQhk40f8LPt+ld9qBjxsAR5RFmiw8KYf0U53N6Kw1ZQSpccSCdA5AlV6awpZdkjGQtPUna+9sks2Ed9g+mNfQKgIgl4wlZUGkZZTDx6b8x9I/07bnWP7/b6rwRxpnQGV3SaVbvIecAZIhO8sH1Fp93ZcvjcFtqibvUB1kNo8EvE6dDbQNIJ5j8BMawyiYA29NZyM2HZULHMj/FtcjJ3IBnVhmfNpzOB/XuAwdweq+wxHLhmC9pRuR3OSzzEfqf7bV7GsO0zp+NU2UxAhhoxON1NbvJiwqMXjEQJv2LdVkcvvgc7vLjdAwz8qgpgZRZKiKFA5AVkhmSHZKhHMG/gmSznMBPbS4rBUAEkwsl+VHji34vvXs+MA5yjTXRGezOOONGh/EXPdOryFHPAZIRkhX33H7ITg7GPnz52b0kk2Fx782nE8tqCpDWMI6txLfAKOO9lbg/E3bQrbVs85O6FjlR0/hH1ZQgjZuj/dW9sEP8yXbMV9wbexiflwtL+rf0Xoe0WCgov6fsRgCDWCxoLzWMLtdhfdYaFJ7xJxTFvIgWxTFkuIzRtn6CM/l8OXY5IzEqMFQccGUBMkGy4cpIDuAnmSPZ69/PX5bgp04o5xHAQSEir0F03u+wCiA9Y3AgMXoK/SZu6ert/LexsQmL4Wh0jnIcGuDO6PrrOvYI9sS+REdTTcX4f4UMXQdAZMUE8r2FY7w+GdQxXsXspayNLWZlpSyr76DRyt+gExfnVI8QrzqcfcW2jc2GZsF7kE/LKZ9KNCI4gI/AVssx7tV1a4Ym2M9h6MPRZdkf5GvCjr7PlpuxT9ayEaMA+htIdoFvwAkIRhz55SODmQFtfp/NEt/gLDodo4GPYaqQzcljcHb1u8w4gDl7N9xz/yhYcovOYhj2s0/n0gQa8uM+l+sx5Kdz+8t2yJ/e1pGmANz20Q1Eus7/F4M5+TVkgziBzu3CkVb/0m7tu7s2Ou4SdO98MGZE8mZQs0fVT5r6oUfXtCf3PlRrjP0cFsD+L8BfkxMTcF2XbYtP+nljT050FSHRiBVyuotQj1XdjS86XbaQ04Ph3fOOzb6sa/ZOoUc+zYXIalPIqWCVKFAOYD3/LW6b99mOfpims19gund6rgRhxPCwnTjwOb/u6suVrmKlG7EKYIBBdDU5PuY3QdtHBsK8/rpfCsHuTIzRvx09YJ0GBl0MJeK5JdmrPBUXHAeg0HtwBNryZJXxQqzb/hFGAFejP3OSeYwKsaFMfAe39dwaXAtKX3NOzCg9GaWtoTGenIMh371QAji9NrcHArAHPoTf7a6I3FfRm/yILvSFEJ1YbrlVqkA5IFjC5vaq3oron8f0mp8WQvsh+v6QXGlC32/BlPCK5rroulzzlGu6cvYDyJnn1JEdyXdPEY64GTNBO5eMfQKj/aqqx4rjesfYbkv/Z6wa/Bl5PU/VzaVslaZkHEhSH1FfUZ+5fce0X+UMfsgGyQjJymgAP/XCqBgBDBa3C+LJmTrjuH6cnzE4POtvHD+GM/BvSGhdj8VYzSKhiQW40LIiaz6VoOQcgCNPL3f46gTrWhlzas7DXQnfx7JetmO6UujCdOE5m4kvrKiLbkyJGOEvo2IEMLgPqYMP7Ft9JtyBvoPRQM/gOM/fJFA6eyDKxq4S3ObbdeN6YYsHYSTq9MynIkvGAeI99YHbF+gT6hvqo7zATzIAWSCZGG3gp44ZdSOAwdLYuKbnGBaL/BhDxCWDw3P5DWNhG25+vU1YkbsEt07SItp5atUgF84NPw1Z9R3TeYwL42VumFfhBumvQZCn5lsy5vrLksz8ZthO6s23HcNJP6oVwADj6uPmAp2xf8eXY+ZAWB5/OzF8/KXlmL+AA5JhRCIL3EtMlcEwDxbmkBSGPbp00zJN3LYrLEOLfBnTuC8h5/gccqcmEWIjDEH/1FoXWZ0aMfrelAIY6POlS7WGxdd/TuMaThJiuP4q7wfnRYpWbCe93ThCX+m8a83CF2YBhHRq3iWpDAc5AOXahhHaau1wY4P1jr1IY+IaKOp6JMh7+or+2CGE872WphvvZkuX4lh/9SgFkCYD/VeUfRWzo29CEdSmRef0SoKGNeS77KR9pxBmlxatrNO5qIPgel92klPpoyCREG/bgsedZE+c80iNHtWvRn9cBUWAi0gLeARrR3/cjAM7flaOe2QjXhcAAAVhSURBVPYLaHHOWZQCkLBq/ur3xo6vGP91+I9eC8EbJ0mWQ7DYAHvB/azXWsYiFQmm23WwFcxUyiCNdQA95vYbma3HmdkbYxXGEgjn5QD+rLSUOb9CEe/lTNza2dv50zULDt2Xc8ZRlFApgCydfe6qjvFVY6uvw1Aeo4IC5puDysdwdh2mCfcL7izv0XvaK+zqk3GL70lQBiei/FHlbQhekPX9Fdw6/HKvvv+lSruylgvtYvDicvACjlvDesgu87MD+/bf8vjCCWqVxoOVSgF4MGdw1LmrdlVX1oz/AmeuxfmYwXGF/Rab8YVqEYK37uL6ExM5O4I79nHYxDRdOM70kaYQCPBc07ZgU80Woemv7xbsnUnCPodzUY8RVgO+9DMK4+P7uTDS2oa7O27r6eq84/GFk/a/H6N+yTigFICMM7LwZcv0hqmXfJzrGrYQ8zpZsnzCoQhwTbd4EnmeQoeswT3z6w432AQ7aR3LdfEBHEd9JL6WhyPOyKfcoNICiNg6y98FzduxTr9VjxpvvGuxjsnMmoO4+aDrLAD+bAC/KI5U8AeIC9v5SUvbQ39gS5bk5OkZFG/CVq9SAMPoEVo+xP2FX+SCfRwGw6IN4aEQaO/583BUWgNfg3XCZi+8OfaNN45IfHCiZptTuCaO1AU/HCsOtejAiRgtFAVI+bICX/VeAHo3LPPtNhfvCoe/7eiR7e/E/rr76H3HQnmx07BGPwe8mY8l0tMB+OIpMDjwYKPPH3D7zn+r5bx8e+799EoBvM+Lgn+RnaCyesxncNjoF/BlO63ggjwyAmgJmjOj/E0wbL0Ig9mrlmO3sT0dW2O1hyGaTbQMrFrYFm5U5mPgi1ANuOEvr8bSVzXAUoGTbwyAES4PBERuQNG4gAQwcaaioHMVLdorAX96C0qtF4di74fL836EdmMNHkNq0c10o8OwyKrOdifad2KLzYRphqZPhWHzBBhMT0GaU12bBivVxinxguOIO3r2d/+Pmt+jF4b5KAUwTAamZ69/Njlb17UrAa6PA1iFLVulF5rtXbDd8Iffir0JbRgOvwNtQMteuzG/bndsrR1f6t2a7gDITsK27WQyaSUTsf2Jp7c/7W5smjtlbjSWqI5Fo0ZU1/UoM7QY8lVjZIE7F51a2CmwHMphpmAYcfAjUBcAz6dBmUzMRlox4sHLHeDlH2zbuaf1zOj6YpSpyujjgFIApZIEOBYtvvB75+CruARAuQyMPrRUVY3EcqHE3sNo5AGMdpY1PfKDJ5TjTml6WSmA0vA1tVQYDhdPu3Qhlrwu1mD1xtd02Bbv1ApGypvY7GBVBEujy5u2PrhKGfRK369KAZSex0NqaIj3TmdCa8AQux5D6oUYIVQNSTQaAgQ7gCnLKkxRWhl3WlrqKraMhmaHqY1KAQTcGw3Nm2Ni0tTZsMzNh6FuPubW86AQCnJBDrgp2auHSy7sB2thYFyDtbo1fFfb+pbGGYnsGVWKUnFAKYBScbbwcvmieOL4iOBQCNpMzIFPJes6jGDDcEcunJhCc8JwR264L4L2TVw4G00u1qysi9H17rRioZ6QcEApgJB0RDYyzo/3HB3lESgDcaom+HH4kk7DaGEqRgtTkDfvnXHZ6ssxHjsg2XbQ0gZatjpcvI4pzaakMDeN5j32OfIuFMmUAghFNxROxKx4PDJZnHyULfRpmi6OoiU7dCqW7GjpTkzEtAI+9uwQfInJUSkGhRFFfBTApQNOo/01JxGewKc5iXBaGkzg602ONnuQF0uKHJ67oh3x/UuL/C2d21t38Jfe2lBXh9Nz1aM4oDigOKA4oDigOKA4oDigOKA4oDigOFAGHPj/BmkrpMF8AC4AAAAASUVORK5CYII=");
  21602. n.prototype = Object.create(r.Mesh.prototype),
  21603. n.prototype.move = function(e, t, i) {
  21604. this.hidden = i,
  21605. this.mouseLastMoveTime = Date.now()
  21606. }
  21607. ,
  21608. n.prototype.hide = function() {
  21609. this.hidden || (this.hidden = !0,
  21610. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  21611. }
  21612. ,
  21613. n.prototype.show = function() {
  21614. this.hidden = !1,
  21615. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  21616. }
  21617. ,
  21618. n.prototype.update = function() {
  21619. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  21620. }
  21621. ,
  21622. n.prototype.updatePosition = function(e, t) {
  21623. if (!this.hidden) {
  21624. if (!t)
  21625. return this.hide();
  21626. var i = t.point
  21627. , n = e.distanceTo(i)
  21628. , r = 1 + .01 * n;
  21629. n < 1 && (r -= 1 - n),
  21630. this.show(),
  21631. this.scale.set(r, r, r),
  21632. this.direction = this.direction.multiplyScalar(.8),
  21633. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  21634. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  21635. this.lookAt(this.position.clone().add(this.direction))
  21636. }
  21637. }
  21638. ,
  21639. n.prototype.writeAstag = function() {
  21640. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  21641. , t = new Date;
  21642. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  21643. var i = {
  21644. enabled: !0,
  21645. version: "0",
  21646. created: t.toISOString(),
  21647. created_by: "APITest",
  21648. position: this.position.clone(),
  21649. stem: {
  21650. enabled: o.tags.pole.enabled,
  21651. direction: this.direction.multiplyScalar(o.tags.pole.height)
  21652. },
  21653. label: "tag " + this.tagCount,
  21654. description: "Description " + e,
  21655. floor: function(e) {
  21656. if (e.currentFloor) {
  21657. var t = e.floors.indexOf(e.currentFloor);
  21658. return t > -1 ? t : void 0
  21659. }
  21660. }(this.player.model),
  21661. type: "info",
  21662. metadata: {
  21663. preferred_camera: {
  21664. mode: this.player.mode
  21665. }
  21666. }
  21667. };
  21668. console.log("--------------------------"),
  21669. console.log(JSON.stringify(i));
  21670. var n = this.player.model.addtag(e, i).build();
  21671. n && (n.disc && this.player.tagDiscs.push(n.disc),
  21672. n.visible || n.show(o.tags.startup.fadeInDuration))
  21673. }
  21674. ,
  21675. t.exports = n
  21676. }
  21677. , {
  21678. "../enum/RenderLayers": 41,
  21679. "../enum/RenderOrder": 42,
  21680. "../settings": 166,
  21681. "../shaders": 167,
  21682. "../util/lerp": 188,
  21683. "../util/texture": 194,
  21684. "../util/transitions": 195,
  21685. three: 217
  21686. }],
  21687. 150: [function(e, t, i) {//"../objects/Room"
  21688. "use strict";
  21689. function n(e, t) {
  21690. this.chunks = [],
  21691. this.floorId = e,
  21692. this.roomId = t,
  21693. this.position = new r.Vector3
  21694. }
  21695. var r = e("three");
  21696. n.prototype.addChunk = function(e) {
  21697. this.chunks.push(e)
  21698. }
  21699. ,
  21700. n.prototype.calcBoundaries = function() {
  21701. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  21702. var s = this.chunks[a]
  21703. , l = s.geometry.attributes.position;
  21704. if (l)
  21705. for (var c = 0; c < l.array.length; c += 3)
  21706. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  21707. t.add(e),
  21708. 0 === c ? (i.copy(e),
  21709. n.copy(e)) : (i.max(e),
  21710. n.min(e)),
  21711. o++
  21712. }
  21713. o > 0 ? (t.multiplyScalar(1 / o),
  21714. this.average = t) : this.average = null,
  21715. this.boundsMax = i,
  21716. this.boundsMin = n,
  21717. this.center = new r.Vector3,
  21718. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  21719. }
  21720. ,
  21721. t.exports = n
  21722. }
  21723. , {
  21724. three: 217
  21725. }],
  21726. 151: [function(e, t, i) {///js/objects/ShowPath.js
  21727. (function(i) {
  21728. "use strict";
  21729. function n(e, t, i) {
  21730. this.obj3d = null,
  21731. this.nodes = [],
  21732. this.colorHull = [],
  21733. this.shortPaths = {},
  21734. this.floorHull = null,
  21735. this.cameraHull = null,
  21736. this.floorPathDistance = 0,
  21737. this.floorCurvePoints = null,
  21738. this.floorCurveColors = null,
  21739. this.camCurvePoints = null,
  21740. this.warpDestHeroLoc = null,
  21741. this.warpDestPano = null,
  21742. this.warpPathPoints = null,
  21743. this.warpPathLengths = [0],
  21744. this.warpLength = 0,
  21745. this.closeWarpDistance = 4,
  21746. this.UP = A.UP.clone(),
  21747. this.longestStep = 0,
  21748. this.upcomingTransType = null,
  21749. this.burnsDir = 1,
  21750. this.prevNextDist = 0,
  21751. this.nextI = 0,
  21752. this.activeTransType = null,
  21753. this.lastTransType = null,
  21754. this.bunnyObj = null,
  21755. this.director = e,
  21756. this.player = t,
  21757. this.playerControls = i,
  21758. this.modelManager = t.modelManager,
  21759. this.updateModel(),
  21760. this.updateDefaultsFromModelData(),
  21761. this.bindEvents(),
  21762. this.warping = !1,
  21763. this.waitingToWarp = !1,
  21764. this.warpInterrupted = !1,
  21765. this.warpInterruptionBlackoutStyle = null,
  21766. this.warpInterruptionTravelTime = null
  21767. }
  21768. var r = e("three")
  21769. , o = e("../util/logger")
  21770. , a = e("../enum/Viewmode")
  21771. , s = e("../enum/RenderOrder")
  21772. , l = e("../enum/WarpStyle")
  21773. , c = e("../settings")
  21774. , h = e("../util/math")
  21775. , u = e("../util/lerp")
  21776. , d = e("../util/easing")
  21777. , p = e("../util/transitions")
  21778. , f = e("../objects/Snapshot")
  21779. , g = e("../effects")
  21780. , m = e("../shaders")
  21781. , v = (e("../gui/gui"),
  21782. e("../util/texture"))
  21783. , A = e("../enum/Vectors")
  21784. , y = (e("../model/ModelManager"),
  21785. new o(i))
  21786. , C = e("../enum/PlayerEvents")
  21787. , I = e("../enum/BlackoutStyle")
  21788. , E = e("../enum/ModelManagerEvents")
  21789. , b = e("../constants")
  21790. , w = {
  21791. path: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  21792. pathEnd: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM3pJREFUeAHtfQmUHMWZZkTW0Ye6uRECg5FYCz3WHGK6G0kNFmqBpD4WG3Mb3sh4bOPd98aewWAMyxsj7NGADdhee97bHWwPtvy4ZJDxQF8IqYUspBbdPSCOZSX5WcJgEBIgoFt9VFZl7PdnVbWqW1XdWVfmn1WRT62sjIyM+OL7j4yIjEMKffiagUVb36qqDc88PaACc4SwTpaGPB4FOkEoOqvjJf0W4lglZCXOYSFFBcLCQokK+xr/4YggfEzRWYkxupZCjeJ8EGHvCyE/EFJ9gOv3lUVn492YjO0ZjOx/c1vjaSMI14dPGYAu6IM7A0t6eoJVVY1nqoA4VxrG2VLJM2DcMHg5W0oxy0v8Sol9wLIXWPYoqf6sLOs1GROvjIxs3bWpqSnqJTad9/QMaAcwPUeuxljSs6eysvbUeghmgRTyXBjXuULKs3BNb2zfHKg5jAml3oBjeEUJhT+xfXTw7f5NTXOoZqEPJgxoB+CxIFo2D54oqqsuhKFfaEiBs6wDpLDHsIqVfQTlHLCUeAHlfEEMj7zQubj2QLEy0+lOz4B2ANNzVNAYdf39oVnivItQdW5B9b0Fb/ezC5qB3xJT6jVw0QkuOveJHVsG6utNvxXBz3i1A3BBesu2HDolVBG6DMYOo5eXIMsaF7L1YxZDSqkNaDp0mmPm0+svmvGOHwvhJ8zaARRJWpf0Dp1UEQpfhQ67a5WUF4FozXUWXKPPAH2Kagv+e3zMjDyxYWHNe1k8rqM6ZEArpUOinERbsfXj4wKhqqvxpr8Wb/qL8Yzh5DkdZ1oGLNQMnkfN4PGYOfK77sajP5z2CR3BEQPaATiiaepIzX3mEkPKryPWFWjL0vd2fRSJAfQX0FeEdfAIv+hqCG0qUjZlk6x2ADmKevkLgzMD4cobDUN8DbX7uTkmox/LiwG127LEL2OR0V8/e2Ht/rySKtOHtQPIUvArtkfOCwSNWzBi7jq87UNZPq6jF4EB1ApM9LA8FotaD3QvCO8oQhYlm6R2AA5F2zxgrggIcSve9pc6fERH84QB9VxMiPu76kLdnmTvs0y1A5hKYGvXBlrmXH4DOvRuxd85U0XV93gxgE7DV/F3f+eepx4W11wDn6CPdAxoB5COlVWrjNa2O64V0lgFwz8zXRQd5g8G4AR2CWWt6mi/53GxapXlD9TuodQOYCLXsrUvip58dTc+5X124i195WsGlHpdKXlXR0NwHcqBYQb6IAa0A0joQWufuQxs/Ahv/PlaNUqXAdQIXob539bREFpfuqV0XrKydwDLekfnhkKBBzDz7jLntOmYfmcAMxSfNs3YLesXVu72e1nywV+2DqCl94OjRPCof8IAnm+BwFKdfZePbpTDsxEMKPqZiH7yg86Fx39SDgWeXMaydACtL0a+IgLGvSj8zMmE6OvyYwAdAvtFzLq944LwQ+VW+rJyACu2jn4mEA48iHZ+U7kJWpd3egbQP9ATi8Ru6m6s/NP0sUsjRlk4AHtJrZqLvo3q/ip09FWVhuh0KYrCgBIjaBasGhna8uNyWNKs5B1AS1/kfLzxf4W/84uiMDrRkmQAtYGX8PfVzobwSyVZwEShSnq6astA5B+lNLZr4y9lFS5O2UhnSHdIh4qTA49US7IG0PbHj45VVTMeghC/wINmjcLPDKAm8Ac5cugr7Z875qCfy5EOe8k5gNb+yAIM4X0cBTs9XYF1mGYgFwbwpeBNDCm+tqM+vD2X57k+U1JNgNZ+89tYhOeP2vi5qpt/ccV1yvhjXMf8W47JyEuiBmAvxVVR/Ws9mm+yePV1MRigUYSxseEbS2FpMt87gObt5qJAQD6Gz3ufLoawdZqagbQMKPGXWExd17UgtC3tfZ8E+rkJIFsHzO8YAblZG79PtK2UYOKFQ7pHOohi+fZF6kvgtH1W9VGnPowq/xWlpFO6LP5kAE2CdcOfvH2DH7c9850DuLT/w6PDsvY/YPyL/akuGnUpMgAnsDmiBj//XP1xH/upfL5yACv6D50ckOEuGD82zdSHZoAXA3ACr8RUpLm7fsa7vJBlRuMbBxCftx98FoBnZy6OvqMZ8JYBjBfYa5rR5X5ZZ8AXDqB1e6ReBI0OgD3RW/Hq3DUD0zMAJ3BARK3WjgXh/uljexuD/VeAtj7zUhk0erTxe6soOnfnDJCuks6S7jp/ypuYrB1Ac9/YdcKQ7aBG76brjX7oXHNnoIZ019bh3NMo+pNsHUBbf+SbhhF4BAzo5bqKrgY6gyIxECYdJl0uUvp5J8uyDwCDK+5CT/+qvEtXZgmg7XkIO+juwizInVjUYpch1PvKEkNKGoPKUIOBmMDZGrRMa9A0zMF9b741SBTNOv202pAVqjVCRq20jNpYQOAsa6WyaqUhaiwhT8BiKmdiVtw8LJd+JpRmRplRm3dx8YVgVUdd6O68EypwAuwcgO0tpfGzApez1JJ7B4b+Kgx+pxRqZ8ySO6Vl7uxcWP22GwVt6R0+VRmheQFDzVNCzoMSkWOgnZNOcSN/3+ahrG+114d/zgk/KwdA7SWqMgEUK1xeC8zuVVaiB9NRN5oxayPXT0z2p9qAsRTTsfEnmiBE/dUmRXkgR2VZseu7GioeSwn29CcbQ7N7TOMdfrrNL8RHqG4/D33ZiL+ejvqK16Al0B9fHbK1f+xs+PIm/C1Fs+RioD/GVyUoDtiIsFRbe0PoueIkn12qLBwAfeenzyaAXr69/QrtcymesCy1pqt99eaS28cO+y02t9252DDkSqnEVagh1GanqiUVe0hFrSYO4wQ8dwCJEX4vAEj5VReViCmp1gvLWnPQ3P/UtsbTRkpKzTMUZtHWt6qODc28XBgGnIGkLdmw83p5HajOHcCIwQu9bs556gDiY/srtgLE7DIT/w6lxBphjT3ScUHNvvIq+8TStr44NEsYFddLKVaiqXDexLulfQUnsDemxhq9nDvgmQNIzOrbXEYTeyz03K8TUt3bXhceKG3Vzq10bQOROqHk7fiiQNO82Y5Rya106Z+iCUSYRbjYq1mEnjiAxHz+7nKY0os3fRRV3EdlJHZP+6KKN9KrgQ5NZaBt29hZKhy4A92eX0LNIJh6rxR/wwlsxnoCK7xYT8ALByDb+s0n4eW/WIrCTClTBL9/bUbNe59dULUnJVz/dMjA8u0jc0LB0O2IfiP+SvrrEJzAOgwUugrlRMvAvcN1B9DSZ96GnuAfuldEl3NSYhhV/QdHTPP+jY3Vf3U595LMbunW4U9VhUK34qVxE2pT1SVZSBQKTuA2OIH73Cyfqw6AFvCkddRKtlqnxO9GIpGbteEXR4VtRxAO/wRO4Ori5OBtqtRctGJqsZsLjbrmAGjp7mB4xksQXgmu3qt2W0r8fWd96FlvVag8cm/pN5cbUvwrvhrMLbkSY7XhaOTQ+W4tOe5WT6sMYN3+kjP++E6y37Pe23uONn73TJG4Js4x4el7qDeX1tgJvCBtW3GJTldqAPDYt2A22f0ulcmVbDBUtz0ai35Td/C5QnfGTKijMBgI/hxDjdsyRvLhDTi3W+HoHig29KI7AOyuulAqg9r9oWIXxpX0lXgPbbVvdDQE/+BKfjoTRwy09kW/AB37N9QyT3L0APNI0DFTSWtxZ124t5hQi+oA7F16q2teQianF7MQbqWNt34PRu9dX+6j99ziO9t8EqMKH0FtoCnbZznGx/fAN+Xw0PnF3JW4qH0A9hbdpWH8lrLU3R3PrL5UGz9HU4ljItmQjEhWCLH4InWGjF6cZEPOYucWC3kU52jti9wsDePHxUndvVRRFduHCTs3dNaFMDVXH35hoGXAXIqJRg+jWTDLL5gz4bSEdTOaAj/NdD+f8KI4gBX9kb8JCKPX/+1+tWHUHLthw8Ka9/IhWT/rDQOX9A6dVBmqeBifCy/xBkFhcrX7A5S1oLMh/FJhUjycSsGbAEt6eoIBIX/pZ+NH2wuDstRd7U+vXq6N/7Cy+O0XyY5kSLK0Zeq3AiTwki2hX+NXZFuFLkLBawB+H+pL3tZSsZWclm0qtNDLMT17uTkZWOPnFxMWi/luZ0PoR4WUX0EdwIqto58JhoOv4FNMVSFBupjWEDqQruhoCK13MU+dlUsMtPaZy6Qh1yE7f648hUFP0Uj03O7Gyj8VirKCNgEC4cCDfjV+VBEP2Ms0aeMvlG6xS4ccO8mYZM0OnBNAeLHaNuYkrsM4BXMALX2Rv/Pr91coxF4RjV7EYY02h3LT0XJkwJYxZG3LPMc0vHyMbKz1xchXCoWhIE2Alt4PjpKho3cjsZmFAuZWOhjc82pMRFZ4uSyTW2XV+RxmwF6OToS7YVC0n4GvDjiv/cr8eG7nwuM/yRd4YWoAwaP+yZfGL9TW4cGhxdr481Uj/z1PMifZ43PPVr+ht20NNlcI3HnXAGhV33AoSOvW+2rFFnrzkwJsajr2o0IQqdPwJwNLeg4eU11bg7kqvqsJRCJm9Ox8VxXOuwYQCgVoxpK/jJ9WY0W1Xxu/P422kKhJB0gXfNgnEE7YXl505FUDSHxW8dUiGBD0gXiHX+WuvJjTD5cUA63bR88UweAWGISv9qfAZ+vl+Xy2zqcGgEV9RUEHJbigUUNYdKm1Y4E2fhe49lUWtk5ANwB6yFfA4zaY84s8ZweA+ddXoN003y9k2eOpaZDPgnC/XzBrnO4yQLpBA8FIV9zNOffcyAbJFnNNITcHgH3epLSnXOaar6vPodoPucZW5lNVchWwzswzBkhHSFdIZzwDkWXGti3CJrN8zI6eU9WhtW/sSxLbeOeSoRfP0NpxWF7pB17krfP0JwPYu+J7WIb8br+gV9h2vKOh4tFs8WbvNdauxWQ/Y1W2GXkXX23ofGb1au/y1zn7kYH2Z1b/MyoBG3yDnWySbDPLI+saAIb8rjQM4zdZ5uNJdLTl9o1FR+eX45Te+PftGfPAwTxDyHnosD0TQjgB51qE1aLtWINKbi3CaKONYYQPYmzEEGbLDSJ8EGHv47wLGxruRNjO4cFDO8vtsymtJ1ARrHwZ5ffFoiKWZX0ZawasgewcH1k7AFSNXkXV6GzHOXgX0YLyLiuTlXxkc+/YOUZQNsGwlyohF0KwBR+WjUbxfilULxzFRiuqeroWVrwK8fqmrZyLKtLKQnCgNDs0+9pyLhnm8QwNbuuoD52bTRJZOYDmAXMF6v9d2WTgVVz0+t2NDp1VXuVf7Hzt+RdG7ZVYdq0FeTXhDX5CsfOcnD4s/4BUYpOyrE5lDT5ZiLHpk/PgcI3xLqswjfguDlimwxATqrmrLtQ9Xbzk/ay8GhoYtyYf5HyGJ+zpaF/9fc4Yc8KGNl5zX7S1bSD6qBE8ep8MGP8Ow7/aC+Mn/Hh7nEj5Ew7CQ7gIXy5t0Zz4cOkh0iXSKZeyyyubbG3UcQ1gxfbIecGg8XJe6Nx4mNbtt0bnl9Lqvcu2HDolVBH+R1TvV8Lg+K97b++doNaYY5Gfrr9oxjtuiL3YedCS49KofNkP/Eej1vzuBeEdTjhxXAMIBI1bnCTodRx0cH2jVIy/edvI7Nb+6P8OVVX8GVXQ7/hB+Wz5w0kRXsJN+KkcXutFvvmTTpFu5ZuOG89nY6uOagCJ3tC3uK+nhmraM+gEucwNkouZhz0uPRC8E3lcD84LvhBkMbGnSxuGE0X4IyIWXe33Ydit/eYzqImx3oYMfJv4+nWak69fjmoA4UDFl7kbP/qiR7BX37fSKaBfwur636mGgt0jAsHXwPfKUjB+4p7KQeWhclH5qJx+kclknLQfJOna5HBO1+A6RDbrBJMjB2AY4mtOEvMyDhZ2+Bc/b9TZ0h+9fJaY+QbeLreTAL3kslh5U7mofFROKm+x8ilmuqRj+Lx8TzHzKETaTm12WgfQ3GcugQ+fWwhQxUtD7Vb7995XvPSLl/LyF4dPw9iKdux3/3u08T9dvJwYpYxyUnmp3FR+RsicQdm/F7Ng1W5nkb2KJefGbXfq/Kd1AJj18/Wpk/D+rqXE33e2zh3zHkl2CFoHov8taITRsyxpGmr5HSg3lZ948FPhSddI57hjdmK7U3YCrtj68XGBihnvIFIF28Iq8bv2+uA1bPGlAVbX3x+aJc67R0n5bXA7pQzSPF5yQRhQhO0X1Y/3iR13DNTX+2Yqblt/dC2kdzVXgaAzcDQWOfSp7sajP8yEccoaQCBcdQ1z4x8eiURuzlQ4juGX9o98+iRx3ma89W/Rxh+XkM0D+CBeiB+OckuHydY9hXkUTA/0uVSSDU8Fb0oHgJfTlA9PlbAr95R6cGNj9V9dyasAmWA99/kVIvQiOsIWFiC5kkuCeCF+iCc/FM7WPeggb6xT23BGB2CPfJLyYsaFi4yY5v2M8U2Ahg6vJmEYz/tmMM8E9C5e0EhH8OSkA8tFVBmzSuhgJGMEj2/AqV5MtpwJRkYHIALhK/FQ5vuZUnQpHO3Gh/zy9seSTVeivd+JKtlRLtHj62yIJ8OQXcQb94KQDpIuMsZpJGw5LcSMBi6VvDbtEwwCaWRZNGr+kAGUaSG09UW+Kg2xlnVfyrSlcD8C8UW8EX/u555djqSLidGO2T3oUuypbDmtA6DJJ3hjXeQSvuyzkeJRPwz6sd9ghkFtxLQ8Z1/wsnvCQHPgQe41AVsXoZNcpUO2TDadDl9axQxVhC5j3ENtyUiM/UiseJtfPAzS03KcThg6LC0DcALiYZvPtLd5BCZ00uKBZiIKsmWy6Ymh8av0yiklLTLB81BqXfuiijd4goujol5srMrzlK72F0ZKxCPxyfnrgK2T0M3ClLgIqWSw6SMcAA1SQc/hJUWAUJAko8zHYbe+MHI6Vunp0h1+BRH3eCLEJ/HKepyAVPeOA2b2g2yabHsyrCMcAEaoUdu/ZnJEHtdqR3d9+D95YDkShU1wRfAx/anvSG4KEoJPhGERfDydIhck/TwTaa8LD2BQo6OFOPLMKpfHaxK2PeHZIxwAejPZVv+Bbc0E9MwuaHgvDWZhBquk4BC/xDPXQnHW0XS2fYQDQFWLpwNQIiassUe4Cp4mtNDYfq74SgkX8cx2AhHpKOkqwyOdbU9wAC2bB7HII88lvzFbZD3Xpb7sKa1K/IbxlxOG6pg7JJtn8M1xKrG9dBh0NffSFfFJ2LZt4ylZTHAAorrqwpR7vH5aFtvqf8gI/R941+N4EVbaaIhv4p1lKRnr6mQbn+gAhOLpALBTzUFz/1Mchd08EP1i2c7n91ogWE/A5t9rHJPyt3U1vrvSpDscLifa+AQHgFVaWDoAJcUT2xpPY7cOG61tF1DipxzEWq4YiH9uawySrpLOcpTJZBsfdwBLevZUYsBQHUfQlqVYVv9niROxg2yZLOPFUTEIE/i35cAMH1edJRuP23qcsHEHUFl7aj2Cwsx4JDgfdbWv3swNFy3djdFputefgWBIDvZS6gywJCEkdPaj5DWjczhh6zakcQeAntUFjECOQ8Fa/8+LVav4jbHGuv3oiDpiZNU4cP3DNQZsOcT3UXAtz2kzgs7aujttRPcjpNp6igOQ57oPxUmOaqOTWG7GSex0c72beeq8pmXgen47EPHTXWJRisO2Pu4AMISRpQOIYivqaUXvcgQjFPou3jq+37HHZdqKmh3Jg+RS1EyyTJyj7saLcNjWbQewpKcniE9ZZ2VZvqJHx0orB55tqHi96BllkYE9r1qKr2TxiI7qFgOQS6Z5725BSM2HdJd0ODWMxW/Yum3zAGM7gKqqxjPRLuC39LcSPcAIDvkc9i69HLniQ5FnSEiHST6eATgyY2xYZevwkXc8DCGeyOYJgu0AVECwrP4LZfGq/q9dG8BklJUeyk5nPQ0Dtnwgp2miuXebmw4nSp60edsBYJ712e4x4jwnM8bLATTPuWKFnurrXH6exMSUYVtOnmR+ZKbcdDiJMGnztgMwhPwvyRuMzu+sX1i5mxEeETDE33LCo7GkZ4CTnBI6/E56pN6FYqHQMyj3eBNAqdneQcmQs1KvZrjjSXBL7wdHoT33BU8y15lmxwDkZMsru6eKF5uZLscLqubQ2XYA+DI4G79ZHej528kJkDRqr0T1v4oTJo0lAwOQky2vDLfdDuamy/Hyy9l0NhZtfasK31Az7hxCkbw4pFDMHIDBc6EUL4TjgzzRxmUjL266TOIjmyfbN2rDM0/nKM+YJTk5ADSZxBKOPGlM6RlIyAtfvLw/mOnyOCFk+0ZABey2wHgokx/SMtk4gObesXOgSScyoUbDcMAAyYvk5iBq0aNw0uXUwpLtow/AOjk1kMNvtJkOdS6sfpsDFsJgBGUTFywah3MGuMiNdJl02jlyt2JaJxvSkMe7lZ3TfKRi1v6XcqlT7DoeHwYwKIiP3JTaxYeZOBKyfdQAxAncgGF+N5vqP3EDPHqpb25K4gAPL7nJ/+cAsttRTjCE4lcDEIy85ZKeg8egPTnTbcno/PJngORG8ss/pfxTwKQAVoPa7BLB9lEDUOxqAFKqD/KnvDApVNfOmFeYlHQqXjDARX54077vRfmnzlOdgDUCBbs+AHzCGZwauHt3sZuKdgDu0V3wnLjIj5NOJ0km2zcAjN969pbBxgFgnoR2AEmN8eGZjfwY6XSKGI+lPgB26wBgFyA2DgDDf+150ymk6Z9+YoCJ/FjpdEJ+6CStpK8A/BxAjE8TAPyw6yPxk/0xwMpCfoqXTifFUoEaEr+lwI2ANZRE6PlZilrPMWgAuTPARH6sdDrJJmyfOgHZ7QVgmRabJgA6kbQDSCqMD89c5MdJp5NiJNtHHwC/JoBpmGwcAOZNaQeQ1BhfnnnIj5dOJwQJ26c+AHY1gH1vvsXGAWDapHYAvjT8OGgu8uOk0yniRA1AH1MzoPQiIFMTxPyult+UAiIHEJkyhgc3Z51+Gqe37rAHFOgsC8cAC/kx0+kkuxH6CjCWvOJyDlkhNg4A0zj5fJHgIiA/4WAyqpSTTo+LD7ZvQMHZ1QCMkMHGAWCuBJv+iHHB6R+OGcAGnSwcOC+djtNHtk9fAdjVAKTFxwGgE0k7AMfmxi8iF/lx0ulxKcH2WfYBxAKMet6VdgDjCuPHH0zkx0qnD8sxgoFAavTwNY9f0uLx7TbBBsNpnDzk5BMULOTHTKdt0ZHtUw3gIDdBSmXx6QNQgt1STtzkxRoPE/mx0unDAjtInYAfHL7m8UsaooYHEiyZymx/Ai68+AUHF/lx0umk7GD776MGIFlUkZKg6GwJyWIGF2FBJxKr9QkJkz6cM8BFfpx0+jB78gOMA+Cz/FYSmCElmzn4w4OHtANICsaHZy7y46TT42KE7VMfALsaAL7dslmFZ1PTsR+hqrR/nDT9wzcMkNxIfhwAc9LpFD7eN5TFrwaAejebGgCRhd7S3hTS9E+fMMBKbsx0mkRIto8agPEuN3linvKMlt7hU7nggvfeyAWLxuGcAS5yI10mnXaO3K2YxrtGTMb2uJVdNvkoI8SmGWBFVU822HVcHgxwkRsnXU6VDNm+MRjZ/2ZqIJffAYNPP0DXwopX0Z48wIUbjWN6BkheJLfpYxY/BiddTi0t2b6xrfG0ESybtC/1BoffWLGUTQ0AfGBRV7GJAy8agzMGEvKCH/D+YKbLNiFk82T79BUAh9prnxj9hzYTJweADhOrkxE9Gso0DHCSFzddjlMXt/mEA5B7puHT/dtSnuN+pplzVNbgk5g5OZI5hr7DhgHIyZYXF0DMdDlOS9zmbQeA+u2fuXCVguOUZb2jc1OuPf3ZufD4T/A98A+egtCZO2MAcrLl5Sx2UWMldPiUomaSQ+JJm487AMt6LYc0iv5IKGAsLXomWWQQs8Rvs4iuo3rEACc5cdPhpEjQRLJt3nYAMiZeSd5gdZa8HEDXnnXdaAa8x4ojDWYiA5CPLaeJod5dMdPhJBFJm7cdwMjI1l3oLmW3MhCq3E0AjD4UJsc118QwuGQNEzQaRhoGbPlATmlueREkEzrsRd4Z8yRbJ5unCLYD2NTUFBVKvZHxCY9uwPJPXN439lmPsk+brTkW+SlLZ5kWbXkFklxIPlxK3do/djbpMBc84zhg67bNI8B2APEbkmUzICjl0nHgDH6sv2jGO2gGPMQAioYwmQHIxZbP5HDPriXVYBkeh2193AEooVg6ALQAWDkAkqZlmj/EQIooQ8mWLSSSB8mFFwH8dJf4SbX1FAcgtvMiL45GSnmxWLVqHCcHjF2LqvYCxyMcsGgM4ww8kpDLeICnP6Cztu56CiJ95mgqjdv6uGGNDr7dj+js9ggApmOa2+5cnL4oHobGoqvx1jE9RKCzTjBgywHy4ERIQmeP4YQpgSWSsHX7ctwBbGqag9WB1QBDwMIw5EpuuDoWVKIXVT3ADVd54lEPxOXBp/QcdTbOjhqI23r8atwB0KWlxAvxYF7/Y2LHVYu2vlXFC5XAgIADP0CD6i/ccJUVHvBvy4FRoUlXSWcZQRqHMtnGJzgAdLixdAD4llp7bGjm5eOlYPJjoP6UYUuIf2ACpyxhEP8kB06Ft3WV7bbyE218ogMYHuHpAEi6hsGuGUCwOuuDT2EMRQf91ofLDIB3m3+Xs502O6a6auOeZOMTHEDn4toDUGaW8wKkkstaXxyaNS35HkQwLfO/oyPqQw+yLtssiW/inRsBpKOkq9xw2Xhg27aNp4Cb4AAoHMTynPcuRUAYFdenYGfz89kLqt9CM+XL+LyCf/ooNgM2z+Db5r3YmWWbPuko6SrDI51tH+EAsJECTwcAQoGNZTOAZN1RF3xGKvVjhnIvOUjEM/HNsWCcdTSdbR/hAPaJHVtA7BBHcuECzmsbiNTxxCawrtqOOzAZRS8hXkQBEb/EcxGzyDnpuG7K83JOoLgPDiVse0IuRziAgfp6EyRvmBCL04WSt3OCk4qFuIuI6LVoCLyXGq5/F4gB8Er8Es8FSrGwyTDWTbLpdLwd4QBsRpRi2wxAO+CKtm1jZxVWcoVL7bn6qr9gsYVmtLc+KVyqOiXik3glfjmyYeskdJMjNhtTBptO6wDMMfNpxh1ahgoHWFYBk8LvuCD8MnaluRwc8ltjIQnSR2fikfgkXrnCTuhkWnvyGjPZMtl0OhxpAdOUSnS0UF8Az0OJLy3fPjKHJ7g4qvb6UA+2Ob4BVxiroo88GLCIR5vPPBIp5qO2LkIni5lHPmmTLWeaJp3WAVBmWDTw8XwyLeaz6M0MhoIhtn0BybJ3NASfFJZ1E661E0iSkt0Zxm/dZPOY3XOuxiZdJJ10NdMsMpvKljM6gDEz8gTy4Ky4Ny7dOvypLHjwJGp7Q/hXyhLX6OZAdvQTX8Qb8Zfdk+7GTujgje7mmlVuVsKW0z6U0QFsWFjzHnoOn0/7FI/AcFUodCsPKFOjoDcYqmEtumNwap6Sd4kn4ov7m5/wJnQwnMTO7Uw2TLacCVdGB2A/oPg2A2x8Ut7kh1oAYY33CVgX60+EtuQy/0efUC3rYs5t/iR4W/egg8lrludpbHhKBxAzR34Hb4x1ApgeUlRXhcM/YYruCFjUiz0mzAvglfVgoSPYoWHoqpf44dzbnwrb1j3oYGoYp99ku2TDU2Ga0gF0Nx5NE1zWTZWA5/ekuLql31zuOQ6HAOg79ntix2Jo+wP0ecbhYyUdzeYBfBAvXL/zTxaArXPQvcnhzK7XJWw4I6wpHQA9ZSn1i4xPM7lhSPGvLR27K5jAmRYGjchCFZf6Lz4PL13WswgT5f888ZFupNq0ZHoQgXSNdM6DrLPK0ontTusAuhpCm/Ci2p1Vzq5HlnPFzNm3uZ5tnhnShJaoFZmP2kB5rieAclP5uU7sySheW9egc6wPtTtuu1ODnNYB0OOWJX45dTLe3zWEvIP74KB0LNGUVrz92rCVzRVoEPwlXZySC0M5qbxUbpZTeqcgnHSMdG2KKCxuObVZRw4gFhn9NapqJouSZQIhRVUwEPx5ptvcw7vqgr/fJ/afhdoA7TnAm+scybTLhfJROam8OSbj6WO2jkHXPAUxTebEM9nsNNHs29i5yNnROhBdg8h/6yy2d7EweORyfD/29TberdtHzxSB4J1g8XrOI8ycShkKSZuoPCKwdDe31XudloHitfRHL0fbn73jQqfqb9GscrR2hmMHsGJ75Lxg0GA7GWNckPiOrKzR+R0X1OwbD/Ppj+ZtI7ONUOi7WGHmKxCUbzo5k3RDEcfQrHmIduxhtWlHEmAWZ3upL6PyZcjipCwe8yRqNGrN714Q3uEkc0dNAEoonqB6zkminsYhARkVj3DbTSgXTshoOuqD/8McGTtDWeo+3wwisp2wuo9wE36/G7+tS6RTPjB+dNg/59T4SScd1wAocvOAuSIgZBf95n7AYO7uaAit4o4zK3xr1waa51yxImCgKabEFyA9Pm1RJUaA5w8xS/y2a8+6bsFni+6sKE4XubXPXCUNeVe6e9zCYkI1d9WFup3iysoBUKKt/eYr2PPsHKcZeBgPHaFqWWddaKOHGIqWdUvvB0dJo/ZKaRgtSoolEKTr21Cjin8AG2BswkIdncoafLJz4fEltwhKy4C5FL3+6yFIx7Xlogl9moQxkvLVjvrQudNEm3A7awfQ0hdZaRjGbyakwvQCnU/7xqKj86eaDMEUerawZHPv2DlGUDbBOS9VQi6EYGdmm8h08WHw+7EwRy8UbaMVVT1dCytexTMILs3jkt6hkyqClS+jI3aWH0oIR7yyoyH822ywZu0ABKqhrWd88f9C0c7MJiPv4qoN7U+vXo52HOepzQWnZ0nPwWOqa2fMgxOchzfYPFTPSV4n4FyLsFq0/mqh2LUw3yqEjSBsELY8iLBBhOG3eB/nXahF7UTYzuHBQzs3NR37UcGBck0Qu/u2XXbns+DpEq4QU3HBKe/q+PPv/2u2Ta/sHQBybe0b+5I0Ao+kAmD9W6m7MOjk+6wxanCsGGjrN7+H9SfvZgVqCjDKil3f0VDx6BRR0t7KqV3T0X7P4xiw8nraFBkGKilXNfeNXccQmobEkAHSFdIZhtDSQ4It2jaZ/u6UoTnVACjF1r4oOqAErRrkiwNVXBNOqw1fBqhDRx+agbQMoMd/Gd787Wj2hNJGYBiIwW9X5bp4Ss4OADxIfBH4T/QFzGfISSZIQypqNXUsCPdniqDDy5eB1u2Rehk0esBAjV9YQNv/ZfT8/w3w5tQZm1MTIEGOQpZ+m4FXI4JGhz3U1i8S1jhdYcDWCegGMvON8dvExG0wJ+On5/NxAIKq0/ACT9tAfPIfqjwnimCwe0X/oZN9AlnDLDIDti5AJ2zdKHJehUyebC/fJm1eDoAKY5qxW3CKFLJgxU4Lgp4dEOFu+lRW7Lx0+rwZIB0gXSCd4I30CHSRhO0dcSObgLwdwPqFlbux8sjPssmUQ1z0XZxTfVRNu3YCHKThDQZ7rAR0gHTBGwS550o2R7aXewrxJ/N2AHYy0U9+gEbI/nzBuP28FLKxurZms24OuM289/mRzEn2pAPeo8kOgW1rsLnsnkofuyAOwB4DHrNuT58F71Dy/gFZsVV3DPKWUyHRkaxJ5n5889s8wNYKNe8CTZ/CHfgsuBGkNhUuRfdSglc9IKJWq/5E6B7nXuREn/roSxAU3/XJU4UoLz779eCz39JCpEVpFKQGkAQTi8RuwqfBkeS1n86kEPQN2B4I4ifgGqtjBki2JGO/Gj/Zlm1jjks8fcSCOoDuxso/oXNi1fTZso1RQ6PA9LBhtvLJGZgtU8gWCfjrO39Kicm2yMZSgvL+WVAHQGhGhrb8GNWUl/JG5lECNATUwEQnezIIZoR5BENnWygGaFYfJvaQTP00vHdy8cmmyLYmh+d7jdpQ4Q+sGXC+lMZ2PxMeZ0VtGDXHbiiD9QQKrwQMUqT5/JWhiof9MqU3E2U0j0Upa0FnQ7jgL9aivOEIqJKW34YJp+FfXkILQtCqMGlu6iDGDJDMSHZ+N36imGypGMZPaRfFAVDCnXXhn6La4uvluakcqMXMoiWhaF24UlholMpU0geq/CQrkhnJzu9lJRsiWypWOYrSBEiCbfvjR8eq6pqXkMnpyTA/nyGMHmGNXV8KS477WQ6ZsNPS3bQitF8/RU8uFz5NvymHh85v/9wxByffK9R1UR0AgWztjyxAReOP/u8PSFBOS14r8Q2/bz5SKAXikg7Wp/gCdOzfsLwZ+3X7nXBmr18hrM911Ie3O4mfa5yiOwAChgFC34ZXfiBXkByfQ22gPRqLfvPZBVV7OOIrF0y0Vx9t1wX9aiulMkO/bsGAn4L3+k/myBUHQJm2Dpj/gXHXl00G4OtrDMzAlMx/Ufv33tfZOnfM12XxGXjaolvOnP0d6NT/xFufz/4IBeDRnuZbF/p8AZKaNomidQJOzjk2NnwjRjL9ZXK4r6+heHjz/MA4afarLf3mcl+XxUfgiWvinLgvNeMnG7FtxSV5uFYDoPI0bzcXGQG5GW21oEvlczcbJX43EoncvLGx+q/uZlweuS3dOvypqnD4JzD6q0uxxGj3R62YWty1ILTNrfK56gCoUGgKULXtR24V0PV8lBjG4qMPjpjm/doRFIZ92/BDoVvxTfYmGH91YVLllwqq/rd11IXucxOZ6w4AhZNwAk/ACVzhZkE9yCuCzzgPRaPmD3VHYW7sUwdfKBiiaeY34i+cWyr+eArGvw7GfxXQQm3cO7xwAGJJz57K6qNOxTJMcrF7RfUmJ6rW4a31qIzE7mlfVPGGNyj8lWvbtrGzVDhwB0zhSyXbXEwRCYx/8/Anb6/Y1DRnNCXYlZ+eOAAq2aX9Hx4dlrW0IktWmxm6wkpxMsEuW2qdkOre9rrwQHGy8HeqbQOROox7vR1VfaodutZB7SVrMP5XImpw8XP1x33sBQ7PHAAVlpZlsldmEWK2F4X3Lk+1AzWDNRhV+Ei5jypMjN67Hm/6lWgdnuedTNzPGXX9vTE11thdP+Nd93OP5+ipAyAIy3pH54ZCwRcAxJcrtOQlOCViSqr1wrLWHDT3P7Wt8TRfLqaSLQeLtr5VdWxo5uXCMFZKJbETjwhkm4bf48P4D5hm9MJCLOyZDxeeOwAC78cdWfIhPe2z2JFXSfGEZak1Xe2rN5fcbsaYpNPcdudiw5AwenEVjL42LQ/lEchmhyoWDoBk3tZnXioMe8WWku7tdajfH2Eo6PPoEN4YVWrjsw0Vr+M5V3uHHeKcKppc3jf22aCUS1G1X4pBOxcjst6HgfbQsFRbe0PouanIc+seGwdABaZlm+yVW6AxbhHgh3yougjz7xHK2mjGrI1eVxszcWY35wLGUiHpTzRBiOXXrMtEDsIhR2VhG++uhorHpojm6i12htbWH/kmFMh3G424KjUh3sEXhVehUDulUDtjltwpLXNn58Lqt93A0dI7fKoyQvMChpqnhJwHJZqHnvtzkPcpbuTv2zyU9a32+vDPOeFn5wCIHAwUugufB1dxIsoPWOAQDkmldsIo8ad2G0K9j36FQWEZ6F9QgyomBo2ANWSZ1qBpmIP73nxrkMo16/TTakNWqNYIGbVWzKiRAVGLzrlaYVg4i1pLyBMgj7lwNvOUtA1+hh/4YIVRqbva60PfZ4UJYFg6ACKJagJKGv8LANli5CZMjYcfA1Ttl8r6B25v/iRTrI2L+gQCRuA3AKs7BpMS02c/MRCJWbEvc2rzTyaPtQMgsImvA7/HT9+u5z6ZdH1dFgwMobf/i1x6+zMxzt4BEHC/b+eUiXwdXpoMoNrvm23mfOEASE0SIwafBeDZpak2ulSlwACMfy9G+C3n+ql2Mse+mXBBhNK4aZo8MbkQ+lozwIEB0k3SUb8YP3HmGwdAYGnSBM2cAtGb6VofmgEuDJBOkm56ObEnFy585QCogDRtkuZOg/B1uRRYP6MZKDQDpIukk15N6c2nPL7pA0hTSNnSh+XFpFxdDotGpCm/DvKYAVrsBXM27uxssJfxQvPff4efHYDNNi00GgjIxzBc6NP+o18j9i0DtHpvTF3n5gKexeDKd02AySSQAKKRQ+ejGvb05Hv6WjNQDAZI10jn/G78xI3vawApApZYL/7bGLN+D5oEoZRw/VMzUBAGUOU3Yfx3dMZ37PFllX8yEaXkAOyy2XsRSuNxFOz0yYXV15qBXBmAtb+JybzXFnuvvlzx5fqc75sAkwtOAqIdVdE54/utySeXTV97wwDpEulUqRk/sVlyNYBUFWnti9yMtQV+qJsEqazo304ZoCo/3vrf7WjAbkQlepS0AyCZtfRFzsenwl/h7/wSlaEuVhEYwFv/Jfx9tbMh/FIRkmeTZMk1ASYzSwIcHtxyARbb/C7WZCqLVXcnc6Cvs2AAOkK6QjpT6sZPrJR8DSBV9Cu2jn4mEA48iNpAU2q4/q0ZIAbwxu+JRWI3dTdW/qlcGCkrB5AUKpoFfycN4x4UfmYyTJ/LlwH08O8XMev2jgvCD5UbCyXfBEgnUFTt/l2ZH8+1lLof9yPp4uiwsmAgQjpAulCOxk8SLssaQKpqx9cZCDyAAUSXpYbr36XNAI3mM83YLX6aulsMiZS9A0iS2tpn0hZVP0L/wPxkmD6XHgNo57+MzuDbOhpC60uvdNmXSDuAiZzJ1r7oFVKqu7HO/Wcn3tJXvmZAqdeVknd1NARpGjma/fogBsqyD2AK0SsoyJPtz6w+V2EHF7wtdk0RV9/yAQMkQ5IlyZRkC8ja+FPkpmsAKWQc8XPt2kDLnMtvMKT8DmoEZx9xXwfwZUCp19DBd1/nnqceFtdcE+ML1Ftk2gE45L95wFyBPaxvRb/ppQ4f0dE8YUA9B2u/v6su1O1J9j7LVDuALAW2YnvkvEDQuAUVyev0HIMsyStSdHvMvhSPxaLWA90LwjuKlE1JJqsdQI5ivaR36KRwoOLLhiG+hlrB3ByT0Y/lxYDabVnil5HY2G82LKx5L6+kyvRh7QAKIPjmPnMJ+gm+js+IV4LQigIkqZPIwAB68MZQ+3oS7ftfdDWENmWIpoMdMqAdgEOinERbsfXj4wLhqmtQI7gG4wkuxjP6K4sT4qaPA3tXz6MDf20sMrK2u/HoD6d/RMdwwoB2AE5YyiFO64tDs0QgfCW22b4WW2pfBKI111nwiDc9dtVVW/Df4yIWebLjgpp9WTyuozpkQCulQ6LyibZsy6FTQhWhy/ApsQU1g0uQlt7oND2hQ3jTb8C0vE5zzHx6/UUz3kkfTYcWigHtAArFpMN0Prv29fDsM868ED3XcAaipezHF+B7PbjoBBed+8SOLQP19aZDKnW0AjCgHUABSMwniZbNgyeK6qoLUeO90JACZ1mH9ML5pMn4Wcy8VAOWEi+gnC+I4ZEXOhfXHmCMt+ShaQfATMRLevZUVtaeWg/BLMAMxXNhMOeilnAWrn31dSHeW6/egKG/gpl3+BPbRwff7t/UNGeUGeVlDUc7AB+If0lPT7CqqvFMFRDnYiGTs9GxeAYcwxwY12xUnWd5WQRU39E5p/YCyx502P1ZWdZrMiZeGRnZumtTU1PUS2w67+kZ0A5geo5Yx1i09a2q2vDM0wMqAIdgnSwNeTwAn4A+dJzVCRAwXR+rhKzEuQLfIsIIC+NbOtUokk2NCMLH8JaOIJwWSBmTQtGb+iDCPoBxvy+kwlm8ryw6G+/GZGzPYGT/m9saT9PrLIIYvx7/H1IyCcsl4M1WAAAAAElFTkSuQmCC"),
  21793. pathStart: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  21794. };
  21795. n.prototype.setScene = function(e) {
  21796. this.createCpm(e),
  21797. this.createBunnyObj(e)
  21798. }
  21799. ,
  21800. n.prototype.updateModel = function() {
  21801. this.model = this.modelManager.getActiveModel()
  21802. }
  21803. ,
  21804. n.prototype.bindEvents = function() {
  21805. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  21806. }
  21807. ,
  21808. n.prototype.updateDefaultsFromModelData = function() {
  21809. this.model.data
  21810. }
  21811. ,
  21812. n.prototype.pointPathDistance = function(e) {
  21813. for (var t = 0, i = 1; i < e.length; i += 1)
  21814. t += e[i - 1].distanceTo(e[i]);
  21815. return t
  21816. }
  21817. ,
  21818. n.prototype.pointPathLengths = function(e) {
  21819. for (var t = [0], i = 1; i < e.length; i += 1)
  21820. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  21821. return t
  21822. }
  21823. ,
  21824. n.prototype.interpAlongPath = function(e, t, i) {
  21825. var n, o = new r.Vector3, a = t[t.length - 1];
  21826. if (i < 1) {
  21827. n = i * a;
  21828. for (var s = 1; s < t.length; s += 1)
  21829. if (t[s] > n) {
  21830. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  21831. return o.copy(e[s]),
  21832. o.sub(e[s - 1]),
  21833. o.multiplyScalar(l),
  21834. o.add(e[s - 1]),
  21835. o
  21836. }
  21837. } else
  21838. o.copy(e[e.length - 1]);
  21839. return o
  21840. }
  21841. ,
  21842. n.prototype.pathHeight = function() {
  21843. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  21844. }
  21845. ,
  21846. n.prototype.createBunnyObj = function(e) {
  21847. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  21848. this.bunnyObj.visible = c.warp.showBunny),
  21849. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  21850. e.add(this.bunnyObj)
  21851. }
  21852. ,
  21853. n.prototype.createCpm = function(e) {
  21854. if (!this.currentPanoMarker) {
  21855. var t = this.makeWaypointObj(w.pathEnd, "Current");
  21856. t.material.uniforms.opacity.value = 0,
  21857. this.currentPanoMarker = {
  21858. mesh: t,
  21859. placed: !1
  21860. }
  21861. }
  21862. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  21863. this.placeCpm(),
  21864. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  21865. }
  21866. ,
  21867. n.prototype.placeCpm = function() {
  21868. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  21869. var e = this.player.currentPano.floor;
  21870. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  21871. e.add(this.currentPanoMarker.mesh)),
  21872. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  21873. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  21874. this.currentPanoMarker.placed = !0
  21875. } else
  21876. this.popOutCpm()
  21877. }
  21878. ,
  21879. n.prototype.fadeInCpm = function(e) {
  21880. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  21881. }
  21882. ,
  21883. n.prototype.fadeOutCpm = function(e) {
  21884. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  21885. }
  21886. ,
  21887. n.prototype.popInCpm = function() {
  21888. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  21889. }
  21890. ,
  21891. n.prototype.popOutCpm = function() {
  21892. this.fadeOutCpm(2)
  21893. }
  21894. ,
  21895. n.prototype.brushPrefs = {
  21896. linewidth: 7,
  21897. strokeWidth: 15,
  21898. cvSegments: 48,
  21899. paveStep: .1,
  21900. paveWidth: .2,
  21901. lookBlendDist: 3,
  21902. maxTurn: r.Math.degToRad(2)
  21903. },
  21904. n.prototype.panoPathDistance = function(e) {
  21905. var t = this.model.panos;
  21906. if (!e || e.length < 2)
  21907. return 0;
  21908. for (var i = [], n = 0; n < e.length; n += 1)
  21909. i.push(t.get(e[n]).floorPosition);
  21910. return this.pointPathDistance(i)
  21911. }
  21912. ,
  21913. n.prototype.loadTileTexture = function(e) {
  21914. var t = v.load(e, function(t) {
  21915. t.wrapS = r.RepeatWrapping,
  21916. t.wrapT = r.RepeatWrapping,
  21917. t.needsUpdate = !0,
  21918. y.debug('path texture "' + e + '" is ready')
  21919. }, function() {
  21920. y.error('path texture "' + e + '" failed')
  21921. });
  21922. return t.mapping = r.UVMapping,
  21923. t
  21924. }
  21925. ,
  21926. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  21927. var a = {
  21928. cameraMode: n,
  21929. position: e,
  21930. quaternion: t,
  21931. panoId: i,
  21932. orthoZoom: o,
  21933. floorVisibility: r,
  21934. thumbUrl: null,
  21935. name: null
  21936. };
  21937. return new f(a)
  21938. }
  21939. ,
  21940. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  21941. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  21942. }
  21943. ,
  21944. n.prototype.setWarpDestination = function(e) {
  21945. this.warpDestHeroLoc = e
  21946. }
  21947. ,
  21948. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  21949. var t = this.getHeroDescriptorByHeroIndex(e);
  21950. return null !== t && (this.setWarpDestination(t),
  21951. !0)
  21952. }
  21953. ,
  21954. n.prototype.setWarpDestinationByPano = function(e, t) {
  21955. var i = this.model.panos.get(e.id);
  21956. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  21957. }
  21958. ,
  21959. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  21960. var i = this.model.panos.get(e);
  21961. if (i) {
  21962. t = t || new r.Quaternion;
  21963. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  21964. return this.setWarpDestination(n),
  21965. !0
  21966. }
  21967. return !1
  21968. }
  21969. ,
  21970. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  21971. var t = this.model.heroCount();
  21972. if (null !== this.warpDestHeroLoc && t < 2)
  21973. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  21974. this.model.getHeroDescriptorByIndex(0);
  21975. var i = this.model.getHeroDescriptorByIndex(e);
  21976. if (i) {
  21977. var n = i.isPano() ? i.panoId : i.cameraMode;
  21978. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  21979. }
  21980. return i
  21981. }
  21982. ,
  21983. n.prototype.getHeroDescriptorByPano = function(e) {
  21984. var t = this.model.panos.get(e.id);
  21985. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  21986. }
  21987. ,
  21988. n.prototype.getHeroDescriptorByPanoId = function(e) {
  21989. var t = this.getHeroIndexFromPanoId(e);
  21990. return this.getHeroDescriptorByHeroIndex(t)
  21991. }
  21992. ,
  21993. n.prototype.getHeroIndexFromPanoId = function(e) {
  21994. for (var t = 0; t < this.model.heroLocations.length; t++) {
  21995. var i = this.model.heroLocations[t]
  21996. , n = this.getHeroId(i);
  21997. if (n && n === e)
  21998. return t
  21999. }
  22000. return -1
  22001. }
  22002. ,
  22003. n.prototype.getHeroPano = function(e) {
  22004. if (null === e)
  22005. return y.warn("getHeroPano(): no destination"),
  22006. null;
  22007. var t = this.getHeroId(e)
  22008. , i = this.model.panos.get(t);
  22009. return void 0 === i && (i = null,
  22010. "" !== t && y.debug('unable to find pano "' + t + '"')),
  22011. i
  22012. }
  22013. ,
  22014. n.prototype.getHeroId = function(e) {
  22015. return e.panoId
  22016. }
  22017. ,
  22018. n.prototype.setWarpDestPano = function() {
  22019. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  22020. this.warpDestPano
  22021. }
  22022. ,
  22023. n.prototype.brushToWarpPano = function(e, t) {
  22024. if (this.discardPathObject(),
  22025. !this.setWarpDestPano())
  22026. return !1;
  22027. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  22028. !this.warpDestPano)
  22029. return y.info("No brush"),
  22030. !1;
  22031. if (!this.player.currentPano)
  22032. return y.debug("No current pano, visibility undefined"),
  22033. !1;
  22034. if (!this.warpDestPano)
  22035. return y.info("No wPano, visibility undefined"),
  22036. !1;
  22037. if (!this.warpDestPano.isAligned())
  22038. return y.debug("Cannot brush to unaligned pano"),
  22039. !1;
  22040. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  22041. , n = !0;
  22042. if (this.player.currentPano.id === this.warpDestPano.id)
  22043. y.debug("Already at destination pano");
  22044. else {
  22045. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  22046. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  22047. this.obj3d = new r.Object3D,
  22048. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  22049. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  22050. e = t) : (this.setPathHulls(this.nodes),
  22051. this.setFloorCurves(),
  22052. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  22053. this.player.currentPano.floor.add(this.obj3d);
  22054. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  22055. , s = e === l.STD;
  22056. if (!n && (i || s)) {
  22057. if (o) {
  22058. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  22059. this.obj3d.add(h)
  22060. }
  22061. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  22062. this.obj3d.add(u)
  22063. }
  22064. this.appearSlow()
  22065. }
  22066. return this.upcomingTransType = e,
  22067. !n
  22068. }
  22069. ,
  22070. n.prototype.findShortestPath = function(e, t) {
  22071. if (!e || !t)
  22072. return null;
  22073. var i = c.warp.walkExtraPanosDistance
  22074. , n = e.id + ":" + t.id + ":" + i;
  22075. if (this.shortPaths.hasOwnProperty(n))
  22076. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  22077. var r = t.id + ":" + e.id + ":" + i;
  22078. if (this.shortPaths.hasOwnProperty(r))
  22079. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  22080. var o = this.model.panos.aStarSearch(e, t);
  22081. return this.model.panos.includeNodesNearPath(o, i),
  22082. this.shortPaths[n] = o ? o.slice() : null,
  22083. o
  22084. }
  22085. ,
  22086. n.prototype.makePathHulls = function(e) {
  22087. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  22088. t = u.get(e[0]),
  22089. r = t.floor.floorIndex;
  22090. for (var d = 0; d < e.length; d += 1)
  22091. t = u.get(e[d]),
  22092. i = t.floorPosition.clone().sub(this.model.position),
  22093. i.y += this.pathHeight(),
  22094. s.push(i),
  22095. l.push(t.position.clone()),
  22096. n = t.floor.floorIndex,
  22097. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  22098. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  22099. o > a && (a = o));
  22100. return a > this.longestStep && (this.longestStep = a,
  22101. y.debug("path contains " + a + " meter segment")),
  22102. {
  22103. floor: s,
  22104. camera: l,
  22105. color: h
  22106. }
  22107. }
  22108. ,
  22109. n.prototype.makeFloorCurves = function(e, t, i) {
  22110. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  22111. , o = this.pointPathDistance(e) - 2 * n
  22112. , s = e.slice(0)
  22113. , l = s[1].clone().sub(s[0]);
  22114. l.y = 0,
  22115. l.normalize().multiplyScalar(n),
  22116. s[0] = (new r.Vector3).copy(s[0]).add(l),
  22117. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  22118. l.y = 0,
  22119. l.normalize().multiplyScalar(n),
  22120. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  22121. var h = new r.CatmullRomCurve3(s)
  22122. , u = Math.floor(o / i);
  22123. u = 4 * Math.floor(u / 4),
  22124. u = Math.max(4, u);
  22125. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  22126. f = 0,
  22127. d = g[A].distanceTo(e[0]);
  22128. for (var y = 1; y < e.length; y += 1)
  22129. v.copy(g[A]).sub(e[y]),
  22130. v.y *= 4,
  22131. p = v.length(),
  22132. p < d && (f = y);
  22133. m.push(t[f])
  22134. }
  22135. return {
  22136. distance: o,
  22137. points: g,
  22138. colors: m
  22139. }
  22140. }
  22141. ,
  22142. n.prototype.makeCameraCurvePoints = function(e, t) {
  22143. var i = this.pointPathDistance(e)
  22144. , n = new r.CatmullRomCurve3(e);
  22145. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  22146. }
  22147. ,
  22148. n.prototype.makeCameraCurveTangents = function(e, t) {
  22149. var i = this.pointPathDistance(e)
  22150. , n = new r.CatmullRomCurve3(e)
  22151. , o = Math.max(2, Math.floor(i / t));
  22152. o || (o = 5);
  22153. for (var a = [], s = 0; s <= o; s++)
  22154. a.push(n.getTangentAt(s / o));
  22155. return a
  22156. }
  22157. ,
  22158. n.prototype.setPathHulls = function(e) {
  22159. var t = this.makePathHulls(e);
  22160. this.floorHull = t.floor,
  22161. this.cameraHull = t.camera,
  22162. this.colorHull = t.color
  22163. }
  22164. ,
  22165. n.prototype.setFloorCurves = function() {
  22166. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  22167. this.floorPathDistance = e.distance,
  22168. this.floorCurvePoints = e.points,
  22169. this.floorCurveColors = e.colors
  22170. }
  22171. ,
  22172. n.prototype.setCameraCurvePoints = function() {
  22173. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  22174. }
  22175. ,
  22176. n.prototype.chooseWarpPath = function(e) { //选择导览路径
  22177. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  22178. if (this.player.currentPano === this.warpDestPano || !e)
  22179. return this.warpPathPoints = null,
  22180. this.warpLength = 0,
  22181. !1;
  22182. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano);
  22183. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (
  22184. y.debug("warp path to unreachable node"),
  22185. t = this.warpDestPano.position.clone().sub(o.position),
  22186. i = t.clone().negate(),
  22187. t.multiplyScalar(.15).add(o.position),
  22188. i.multiplyScalar(.15).add(this.warpDestPano.position),
  22189. t.y = o.position.y,
  22190. i.y = this.warpDestPano.position.y,
  22191. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  22192. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)
  22193. )
  22194. : ( y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  22195. this.setCameraCurvePoints(),
  22196. this.warpPathPoints = this.camCurvePoints.slice(0)
  22197. );
  22198. this.warpLength = 0,
  22199. this.warpPathLengths = [0];
  22200. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  22201. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  22202. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  22203. var p = s.length();
  22204. s.y *= c.warp.climbEffort;
  22205. var f = s.length() / p;
  22206. if (d > 1) {
  22207. s.setY(0).normalize(),
  22208. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  22209. var g = Math.min(1, s.dot(l))
  22210. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  22211. f = Math.max(m, f)
  22212. }
  22213. this.warpLength += p * f,
  22214. this.warpPathLengths[d] = this.warpLength
  22215. }
  22216. return !0
  22217. }
  22218. ,
  22219. n.prototype.drawPathRibbon = function(e, t) {//画路径
  22220. this.bunnyObj.visible = c.warp.showBunny;
  22221. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  22222. h.copy(e[u]),
  22223. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  22224. h.normalize(),
  22225. n.crossVectors(h, A.UP),
  22226. n.multiplyScalar(i);
  22227. var d = (new r.Vector3).copy(e[u]).add(o);
  22228. d.sub(n),
  22229. l.vertices.push(d),
  22230. d = (new r.Vector3).copy(e[u]).add(o),
  22231. d.add(n),
  22232. l.vertices.push(d)
  22233. }
  22234. var p, f = 0;
  22235. for (u = 0; u < e.length - 1; u += 1) {
  22236. var g = 2 * u
  22237. , v = f;
  22238. f += e[u + 1].distanceTo(e[u]);
  22239. var y = f
  22240. , C = t[u]
  22241. , I = t[u + 1];
  22242. p = new r.Face3(g,g + 1,g + 2),
  22243. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  22244. l.faces.push(p),
  22245. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  22246. p = new r.Face3(g + 2,g + 1,g + 3),
  22247. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  22248. l.faces.push(p),
  22249. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  22250. }
  22251. l.computeFaceNormals(),
  22252. l.computeVertexNormals();
  22253. var E, b;
  22254. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  22255. b.map.value = w.path,
  22256. b.opacity.value = 0,
  22257. b.color.value.set(c.path.color),
  22258. E = new r.RawShaderMaterial({
  22259. side: r.DoubleSide,
  22260. depthWrite: !1,
  22261. transparent: !0,
  22262. vertexShader: m.ribbon.vertexShader,
  22263. fragmentShader: m.ribbon.fragmentShader,
  22264. uniforms: b,
  22265. name: "ribbonT",
  22266. opacity: 0
  22267. })) : E = new r.MeshBasicMaterial({
  22268. color: 16777215,
  22269. side: r.DoubleSide,
  22270. name: "ribbonOut",
  22271. vertexColors: r.VertexColors
  22272. });
  22273. var _ = new r.Mesh(l,E);
  22274. return _.name = "ribbon",
  22275. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  22276. _
  22277. }
  22278. ,
  22279. n.prototype.drawPathPavement = function(e) {//画路径大道
  22280. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  22281. s.copy(e[l]),
  22282. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  22283. s.normalize(),
  22284. n.crossVectors(s, A.UP),
  22285. n.multiplyScalar(this.brushPrefs.paveWidth),
  22286. t = (new r.Vector3).copy(e[l]),
  22287. t.sub(n),
  22288. o.vertices.push(t),
  22289. o.vertices.push((new r.Vector3).copy(e[l])),
  22290. t = (new r.Vector3).copy(e[l]),
  22291. t.add(n),
  22292. o.vertices.push(t);
  22293. var h, u, d;
  22294. for (l = 0; l < e.length - 1; l += 1)
  22295. h = 3 * l + 1,
  22296. u = l * i,
  22297. d = u + i,
  22298. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  22299. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  22300. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  22301. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  22302. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  22303. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  22304. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  22305. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  22306. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  22307. color: c.path.color,
  22308. side: r.DoubleSide,
  22309. transparent: !0,
  22310. depthWrite: !1,
  22311. opacity: 0,
  22312. name: "paveT",
  22313. map: w.path
  22314. }) : new r.MeshBasicMaterial({
  22315. color: c.path.color,
  22316. side: r.DoubleSide,
  22317. transparent: !0,
  22318. depthWrite: !1,
  22319. opacity: 1,
  22320. name: "paveO",
  22321. map: w.path
  22322. });
  22323. return new r.Mesh(o,p)
  22324. }
  22325. ,
  22326. n.prototype.hintPrefs = {
  22327. rad: .18,
  22328. width: .0125,
  22329. depth: .0625,
  22330. setBack: -.04,
  22331. markRad: .25,
  22332. markInnerRad: .16
  22333. },
  22334. n.prototype.makeWaypointObj = function(e, t) {//画路径圈圈
  22335. var i = new r.Geometry
  22336. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  22337. , o = this.pathHeight();
  22338. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  22339. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  22340. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  22341. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  22342. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  22343. s.map.value = e,
  22344. s.opacity.value = 0,
  22345. s.color.value.set(c.path.color);
  22346. var l = {
  22347. side: r.DoubleSide,
  22348. depthWrite: !1,
  22349. transparent: !0,
  22350. vertexShader: m.waypoint.vertexShader,
  22351. fragmentShader: m.waypoint.fragmentShader,
  22352. uniforms: s,
  22353. name: "waypoint",
  22354. opacity: 0
  22355. };
  22356. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  22357. l.name = "wayPtOut");
  22358. var h = new r.RawShaderMaterial(l)
  22359. , u = new r.Mesh(i,h);
  22360. return u.name = t,
  22361. u
  22362. }
  22363. ,
  22364. n.prototype.makeStartMarker = function(e, t) {
  22365. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  22366. i.y = 0,
  22367. i.normalize();
  22368. var n = Math.acos(i.x)
  22369. , o = this.makeWaypointObj(w.pathStart, "Start");
  22370. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  22371. o.position.copy(e),
  22372. o
  22373. }
  22374. ,
  22375. n.prototype.makeEndMarker = function(e) {
  22376. var t = this.makeWaypointObj(w.pathEnd, "End")
  22377. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  22378. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  22379. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  22380. t.position.copy(e),
  22381. t
  22382. }
  22383. ,
  22384. n.prototype.pathClean = function(e) {
  22385. if (e) {
  22386. for (var t in e.children)
  22387. this.pathClean(e.children[t]);
  22388. e.geometry && e.geometry.dispose(),
  22389. e.material && e.material.dispose()
  22390. }
  22391. }
  22392. ,
  22393. n.prototype.discardPathObject = function() {
  22394. if (this.obj3d) {
  22395. var e = this.obj3d.parent;
  22396. e && e.remove(this.obj3d),
  22397. this.pathClean(this.obj3d)
  22398. }
  22399. this.obj3d = null,
  22400. this.popInCpm()
  22401. }
  22402. ,
  22403. n.prototype.discardSlow = function() {
  22404. if (this.obj3d) {
  22405. if (this.player.mode !== a.PANORAMA)
  22406. return void this.discardPathObject();
  22407. for (var e, t = this, i = 0, n = function() {
  22408. this.discardPathObject()
  22409. }
  22410. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  22411. e = t.obj3d.children[r],
  22412. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  22413. i += 1,
  22414. n = null);
  22415. 0 === i && this.discardPathObject(),
  22416. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  22417. }
  22418. }
  22419. ,
  22420. n.prototype.appearSlow = function() {
  22421. var e, t = this;
  22422. this.fadeOutCpm(c.path.fadeInTime);
  22423. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  22424. e = t.obj3d.children[n],
  22425. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  22426. }
  22427. ,
  22428. n.prototype.update = function() {
  22429. this.obj3d && this.obj3d.updateMatrixWorld()
  22430. }
  22431. ,
  22432. n.prototype.calcBurnsAmount = function(e) {
  22433. var t = r.Math.degToRad(c.warp.burnsAngle);
  22434. if (this.player.mode === a.PANORAMA) {
  22435. var i = this.burnsDir * t;
  22436. if (this.upcomingTransType === l.BLACK)
  22437. return i;
  22438. var n = e;
  22439. if (null === n)
  22440. return y.warn("Transition request for non-highlight"),
  22441. i;
  22442. var o = this.getHeroDescriptorByHeroIndex(n);
  22443. if (null === o)
  22444. return i;
  22445. if (!o.isPano())
  22446. return i;
  22447. var s = this.getHeroPano(o)
  22448. , h = this.playerControls.cameras[a.PANORAMA]
  22449. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  22450. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  22451. , p = function(e) {
  22452. var i = Math.acos(Math.min(1, e.dot(u)))
  22453. , n = (new r.Vector3).crossVectors(u, e);
  22454. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  22455. };
  22456. if (s === this.player.currentPano)
  22457. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  22458. var f = this.findShortestPath(this.player.currentPano, s);
  22459. if (void 0 === f || null === f || f.length < 1)
  22460. return y.debug("Empty path ahead..."),
  22461. i;
  22462. var g = this.makePathHulls(f)
  22463. , m = new r.CatmullRomCurve3(g.camera)
  22464. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  22465. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  22466. }
  22467. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  22468. }
  22469. ,
  22470. n.prototype.waitNextStep = function(e, t) {
  22471. var i = c.warp.tourStepDelay;
  22472. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  22473. var n = new r.Euler
  22474. , o = new r.Vector3;
  22475. y.debug("Starting wait: " + (void 0 !== t));
  22476. var s = this.calcBurnsAmount(e)
  22477. , h = function() {
  22478. this.endWarpState(),
  22479. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  22480. t && t()
  22481. }
  22482. .bind(this)
  22483. , u = function(e, t) {
  22484. if (this.warpInterrupted)
  22485. return h(),
  22486. !0;
  22487. var r = t || 1e3 / 60;
  22488. if (c.warp.doBurns)
  22489. if (this.player.mode === a.PANORAMA) {
  22490. var l = this.playerControls.cameras[a.PANORAMA];
  22491. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  22492. var u = r * s / i;
  22493. n.y += u,
  22494. o.set(0, 0, -1),
  22495. o.applyEuler(n),
  22496. o.add(l.position),
  22497. l.controls.lookAt(o),
  22498. l.controls.lookVector.copy(o),
  22499. l.lookAt(o)
  22500. } else
  22501. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  22502. }
  22503. .bind(this);
  22504. this.startWarpState(),
  22505. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  22506. }
  22507. ,
  22508. n.prototype.warpToNonPano = function(e) {
  22509. if (this.discardPathObject(),
  22510. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  22511. var t = function() {
  22512. e && e()
  22513. }
  22514. .bind(this);
  22515. this.player.flyToNewMode({
  22516. mode: this.warpDestHeroLoc.cameraMode,
  22517. duration: c.warp.outsideTime,
  22518. warpDest: this.warpDestHeroLoc,
  22519. callback: t,
  22520. force: !0
  22521. })
  22522. } else
  22523. y.warn("no warp destination!!!"),
  22524. e && e()
  22525. }
  22526. ,
  22527. n.prototype._resetWarpShaderParams = function(e) {
  22528. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  22529. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  22530. }
  22531. ,
  22532. n.prototype._clearWarpShading = function() {
  22533. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  22534. this._resetWarpShaderParams(e[t]),
  22535. e[t].visible = !0;
  22536. this._resetWarpShaderParams(this.model.skybox)
  22537. }
  22538. ,
  22539. n.prototype._warpStopFlying = function() {
  22540. this.activeTransType = null,
  22541. this.placeCpm()
  22542. }
  22543. ,
  22544. n.prototype._wrapupTravelOnlyBits = function() {
  22545. this._warpStopFlying(),
  22546. this.warpPathPoints && (this.player.currentPano.exit(),
  22547. this.warpDestPano.enter(),
  22548. this.player.currentPano = this.warpDestPano),
  22549. this.player.spider.draw(),
  22550. this.placeCpm()
  22551. }
  22552. ,
  22553. n.prototype._wrapupTravel = function(e) {
  22554. this._wrapupTravelOnlyBits(),
  22555. this.warpCameraAim(e)
  22556. }
  22557. ,
  22558. n.prototype._wrapupWarpShading = function(e) {
  22559. this._clearWarpShading(),
  22560. this._wrapupTravel(e)
  22561. }
  22562. ,
  22563. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  22564. t !== I.END && this._clearWarpShading(),
  22565. this._wrapupTravelOnlyBits(),
  22566. this.upcomingTransType = null,
  22567. e && e()
  22568. }
  22569. ,
  22570. n.prototype._warpCameraAim = function(e, t) {
  22571. var i = this.warpDestHeroLoc.quaternion
  22572. , n = this.playerControls.cameras[a.PANORAMA]
  22573. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  22574. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  22575. , l = s.dot(o)
  22576. , u = r.Math.radToDeg(Math.acos(l))
  22577. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  22578. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  22579. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  22580. m.y = h.constrainedTurn(m.y),
  22581. this.burnsDir = Math.sign(m.y);
  22582. var v = new r.Euler(0,0,0,c.warp.eOrder)
  22583. , A = new r.Vector3
  22584. , C = function(e, t) {
  22585. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  22586. v.y = g.y + e * m.y,
  22587. v.z = g.z + e * m.z,
  22588. A.set(0, 0, -1),
  22589. A.applyEuler(v),
  22590. A.add(n.position),
  22591. n.controls.lookAt(A),
  22592. n.controls.lookVector.copy(A),
  22593. void n.lookAt(A))
  22594. }
  22595. .bind(this);
  22596. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.debug("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim"),
  22597. void (t && t()))
  22598. }
  22599. ,
  22600. n.prototype._warpBendAim = function(e, t, i, n) {
  22601. var o = n || 0
  22602. , s = this.playerControls.cameras[a.PANORAMA]
  22603. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22604. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  22605. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  22606. f.y = h.constrainedTurn(f.y);
  22607. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  22608. f.x = g * Math.sign(f.x),
  22609. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  22610. this.burnsDir = Math.sign(f.y),
  22611. g *= Math.sign(f.y),
  22612. f.y = g;
  22613. var m = new r.Euler(0,0,0,c.warp.eOrder)
  22614. , v = new r.Vector3
  22615. , A = function(e, t) {
  22616. if (e < .5)
  22617. m.x = u.x + e * f.x,
  22618. m.y = u.y + e * f.y,
  22619. m.z = u.z + e * f.z;
  22620. else {
  22621. var i = (1 - e) * c.warp.softBendEnd;
  22622. m.x = l.x - i * f.x,
  22623. m.y = l.y - i * f.y,
  22624. m.z = l.z - i * f.z
  22625. }
  22626. v.set(0, 0, -1),
  22627. v.applyEuler(m),
  22628. v.add(s.position),
  22629. s.controls.lookAt(v),
  22630. s.controls.lookVector.copy(v),
  22631. s.lookAt(v)
  22632. }
  22633. .bind(this);
  22634. return p.start(A, t, i, o, d[c.warp.movementEasing])
  22635. }
  22636. ,
  22637. n.prototype._warpStepCameraAim = function(e, t, i) {
  22638. var n = this.playerControls.cameras[a.PANORAMA]
  22639. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22640. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  22641. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  22642. l.y = h.constrainedTurn(l.y),
  22643. this.burnsDir = Math.sign(l.y);
  22644. var u = new r.Euler(0,0,0,c.warp.eOrder)
  22645. , f = new r.Vector3
  22646. , g = function(e, t) {
  22647. e < .5 ? u.copy(s) : u.copy(o),
  22648. f.set(0, 0, -1),
  22649. f.applyEuler(u),
  22650. f.add(n.position),
  22651. n.controls.lookAt(f),
  22652. n.controls.lookVector.copy(f),
  22653. n.lookAt(f)
  22654. }
  22655. .bind(this);
  22656. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  22657. }
  22658. ,
  22659. n.prototype.setBurnsDir = function() {
  22660. var e = this.playerControls.cameras[a.PANORAMA]
  22661. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22662. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  22663. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  22664. n.y = h.constrainedTurn(n.y),
  22665. this.burnsDir = Math.sign(n.y)
  22666. }
  22667. ,
  22668. n.prototype.stepWarpPath = function(e, t) {
  22669. var i = this.playerControls.cameras[a.PANORAMA];
  22670. if (!this.warpPathPoints)
  22671. return i.position.copy(this.warpDestPano.position),
  22672. !0;
  22673. var n = this.warpPathPoints[0]
  22674. , o = this.warpDestPano.position;
  22675. if (null !== this.nodes && this.cameraHull.length > 1) {
  22676. var s = new r.Vector3;
  22677. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  22678. i.position.copy(s)
  22679. } else
  22680. e < .5 ? i.position.copy(n) : i.position.copy(o)
  22681. }
  22682. ,
  22683. n.prototype.interruptAndFastForward = function(e, t) {
  22684. this.warping && (this.warpInterrupted = !0,
  22685. this.warpInterruptionBlackoutStyle = e,
  22686. this.warpInterruptionTravelTime = t,
  22687. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  22688. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  22689. }
  22690. ,
  22691. n.prototype.warpCameraAim = function(e) {//导览到达下一个pano时可能要重新矫正转向
  22692. var t = c.warp.minWarpTime;
  22693. if (this.upcomingTransType === l.BLACK)
  22694. t = c.warp.teleportTime;
  22695. else {
  22696. var i = this.playerControls.cameras[a.PANORAMA]
  22697. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  22698. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  22699. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  22700. s.y = h.constrainedTurn(s.y);
  22701. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  22702. t = Math.max(t, u)
  22703. }
  22704. var d = function() {
  22705. this._warpStopFlying(),
  22706. this.discardSlow();
  22707. e && e()
  22708. }.bind(this);
  22709. this._warpCameraAim(t, d)
  22710. }
  22711. ,
  22712. n.prototype.warpCommonParameters = function(e, t, i, n) {
  22713. this.model.skybox.material.uniforms.blackout.value = n;
  22714. var r = u.uniform(this.model.skybox, "progress", 1)
  22715. , o = u.allUniforms(this.model.chunks, "progress", 1)
  22716. , a = !1
  22717. , s = function() {
  22718. if (this.warpInterrupted)
  22719. return a = !0,
  22720. !0
  22721. }
  22722. .bind(this)
  22723. , l = function(e, t) {
  22724. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  22725. !0) : void r(e, t)
  22726. }
  22727. .bind(this)
  22728. , h = function(e, t) {
  22729. return i && a ? (o(0),
  22730. !0) : void o(e, t)
  22731. }
  22732. .bind(this);
  22733. p.start(s, e, null, t, null, "safeHaltWatch"),
  22734. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  22735. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  22736. }
  22737. ,
  22738. n.prototype.warpTravel_STD = function(e) {
  22739. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  22740. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  22741. w += this.warpLength * c.warp.timePerMeter,
  22742. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  22743. var _ = !1
  22744. , T = this.warpDestHeroLoc.quaternion
  22745. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  22746. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  22747. , M = S.dot(x)
  22748. , R = r.Math.radToDeg(Math.acos(M))
  22749. , P = function(e) {
  22750. var t = o
  22751. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  22752. return i
  22753. }
  22754. , O = function() {
  22755. return E.lookAt(C, t, A.UP),
  22756. s.setFromRotationMatrix(E, c.warp.eOrder),
  22757. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  22758. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  22759. h.constrainedTurn(b.y)
  22760. }
  22761. .bind(this)
  22762. , L = function(e, t) {
  22763. if (this.warpInterrupted)
  22764. return _ = !0,
  22765. !0
  22766. }
  22767. .bind(this)
  22768. , D = function(e, t) {
  22769. return _ || !this.warpPathPoints ? (g.blur(0),
  22770. !0) : void g.blur(e)
  22771. }
  22772. .bind(this)
  22773. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  22774. , B = function(e, t) {
  22775. return _ || !this.warpPathPoints ? (N(0),
  22776. !0) : void N(e, t)
  22777. }
  22778. .bind(this)
  22779. , F = function(e, t) {
  22780. if (!this.warpPathPoints)
  22781. return n.position.copy(this.warpDestPano.position),
  22782. !0;
  22783. if (_)
  22784. return !0;
  22785. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  22786. n.position.copy(i),
  22787. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  22788. }
  22789. .bind(this)
  22790. , V = function(e, n) {
  22791. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  22792. !0)
  22793. }
  22794. .bind(this)
  22795. , U = function(e, o) {
  22796. if (_)
  22797. return y.debug(">>>> Walkthrough interupted at t=" + e),
  22798. !0;
  22799. if (!this.warpPathPoints)
  22800. return !0;
  22801. var a = this.warpLength * e
  22802. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  22803. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  22804. c.warp.matchCam && (l *= 1 - u),
  22805. E.lookAt(C, t, A.UP),
  22806. s.setFromRotationMatrix(E, c.warp.eOrder),
  22807. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  22808. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  22809. b.y = h.constrainedTurn(b.y),
  22810. s.x = m.x + l * b.x,
  22811. s.y = m.y + l * b.y,
  22812. s.z = m.z + l * b.z,
  22813. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  22814. b.y = h.constrainedTurn(b.y);
  22815. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  22816. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  22817. v.x = v.x + b.x * c.warp.turnFriction,
  22818. v.y = v.y + b.y * c.warp.turnFriction,
  22819. v.z = v.z + b.z * c.warp.turnFriction,
  22820. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  22821. var p = t.clone().sub(C).normalize();
  22822. if (R < c.warp.maxAimRotation && u > 0) {
  22823. var g = 1 - u;
  22824. p.x = p.x * g + u * S.x,
  22825. p.y = p.y * g + u * S.y,
  22826. p.z = p.z * g + u * S.z,
  22827. p.normalize()
  22828. }
  22829. this.bunnyObj.position.copy(n.position).add(p),
  22830. f.set(0, 0, -1).applyEuler(v).normalize(),
  22831. f.multiplyScalar(8),
  22832. f.add(n.position),
  22833. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  22834. n.controls.lookVector.copy(f),
  22835. n.lookAt(f))
  22836. }
  22837. .bind(this)
  22838. , k = function() {
  22839. _ ? (this.discardSlow(),
  22840. this.upcomingTransType = l.BLACK,
  22841. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  22842. }
  22843. .bind(this);
  22844. V(0);
  22845. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  22846. w += H;
  22847. var G = H / w;
  22848. this.warpCommonParameters(w, G, !0, I.NONE),
  22849. p.start(L, w, null, 0, null, "_haltWatcher"),
  22850. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  22851. p.start(D, w, null, G, P, "blurring")),
  22852. p.start(B, w, null, G, P, "modelAlpha"),
  22853. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  22854. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  22855. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  22856. }
  22857. ,
  22858. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  22859. var r = e || 0;
  22860. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  22861. this.warpCommonParameters(t, r, !1, i),
  22862. this.model.chunks.forEach(function(e) {
  22863. e.material.uniforms.blackout.value = i
  22864. }),
  22865. this._warpBendAim(null, t, null, r);
  22866. var o = function() {
  22867. this.wrapupWarpShadingOnly(n, i)
  22868. //xzw 结束时地标变化
  22869. this.player.model.floorLogos[0].position.copy(this.player.model.floorLogos[1].position)
  22870. if(this.player.mode === a.PANORAMA){
  22871. this.player.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22872. this.player.model.floorLogos[1].visible = false;
  22873. }else{
  22874. this.player.model.floorLogos[0].visible = false;
  22875. }
  22876. //-----end
  22877. }
  22878. .bind(this);
  22879. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  22880. }
  22881. ,
  22882. n.prototype.flightStepWalk = function(e, t, i) {
  22883. var n = .001
  22884. , o = 1
  22885. , a = 1.2
  22886. , s = new r.Vector3
  22887. , h = new r.Vector3
  22888. , u = function(e, t) {
  22889. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  22890. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  22891. h.copy(A.FORWARD),
  22892. this.player.getDirection(h),
  22893. s.copy(t).sub(e.position).normalize();
  22894. var l = s.dot(h)
  22895. , u = Math.acos(l)
  22896. , d = u / r;
  22897. return d > n && (r *= d / n,
  22898. u < o && (r *= a)),
  22899. r
  22900. };
  22901. return function(e, t, i) {
  22902. if (this.warpInterrupted)
  22903. i && i();
  22904. else if (this.activeTransType !== l.WALK)
  22905. this._clearWarpShading(),
  22906. this._warpStopFlying(),
  22907. this.player.spider.draw(),
  22908. this.placeCpm(),
  22909. i && i();
  22910. else if (this.player.currentPano !== e) {
  22911. var n = {
  22912. pano: e,
  22913. lookAtPoint: t,
  22914. duration: null,
  22915. maxDistanceOverride: c.warp.walkMaxDist,
  22916. skipWarpingCheck: !1,
  22917. constantMoveSpeed: !0
  22918. };
  22919. n.duration = u.call(this, e, t),
  22920. this.player.nonInterruptingFlyToPano(n, i)
  22921. } else
  22922. i && i()
  22923. }
  22924. }(),
  22925. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  22926. return this.flightStepWalk.bind(this, e, t, i)
  22927. }
  22928. ,
  22929. n.prototype.warpTravel_WALK = function() {
  22930. var e = [];
  22931. return function(t) {
  22932. var i = this.player.model.panos;
  22933. e.length = 0;
  22934. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  22935. var s = this.nodes[a]
  22936. , l = i.get(s);
  22937. a === this.nodes.length - 1;
  22938. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  22939. n && o || (e.push(s),
  22940. n = l)
  22941. }
  22942. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  22943. var h = e.length
  22944. , u = i.get(e[h - 1])
  22945. , d = new Array(h + 1);
  22946. d[d.length - 1] = function() {
  22947. t && t()
  22948. }
  22949. .bind(this);
  22950. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  22951. var g = e[p];
  22952. u = i.get(g);
  22953. var m = new r.Vector3;
  22954. this.getLookAtForWalkingTourNode(e, p, m),
  22955. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  22956. p--
  22957. }
  22958. d[0]()
  22959. }
  22960. }(),
  22961. n.prototype.getLookAtForWalkingTourNode = function() {
  22962. var e = new r.Vector3
  22963. , t = new r.Vector3
  22964. , i = new r.Vector3
  22965. , n = new r.Vector3
  22966. , o = new r.Vector3
  22967. , a = .65
  22968. , s = .75
  22969. , l = .2
  22970. , c = .4
  22971. , h = .2
  22972. , u = 3;
  22973. return function(r, d, p) {
  22974. var f = r.length;
  22975. if (d >= f)
  22976. return !1;
  22977. var g = 1
  22978. , m = 1;
  22979. t.set(0, 0, 0),
  22980. o.set(0, 0, 0);
  22981. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  22982. if (v = this.player.model.panos.get(r[A]),
  22983. this.getOrientationForWalkingTourNode(r, A, i),
  22984. A === d && e.copy(i),
  22985. n.copy(i),
  22986. A > d) {
  22987. var y = n.dot(e) < a;
  22988. g *= y ? l : s,
  22989. m *= y ? h : c
  22990. }
  22991. i.multiplyScalar(g),
  22992. t.add(i),
  22993. o.lerp(v.position, m)
  22994. }
  22995. return t.normalize(),
  22996. p.copy(o),
  22997. p.add(t),
  22998. !0
  22999. }
  23000. }(),
  23001. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  23002. var n = e.length;
  23003. if (t >= n)
  23004. return !1;
  23005. if (t === n - 1)
  23006. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  23007. else {
  23008. var r = this.player.model.panos.get(e[t])
  23009. , o = this.player.model.panos.get(e[t + 1]);
  23010. i.copy(o.position).sub(r.position)
  23011. }
  23012. return i.normalize(),
  23013. !0
  23014. }
  23015. ,
  23016. n.prototype.warpCameraTravel = function(e, t, i, n) {
  23017. if (this.activeTransType = this.upcomingTransType,
  23018. this.lastTransType = this.activeTransType,
  23019. this.upcomingTransType = null,
  23020. !e) {
  23021. var r = function() {
  23022. this._wrapupTravel(n)
  23023. }
  23024. .bind(this)
  23025. , o = {
  23026. pano: this.warpDestPano,
  23027. lookAtPoint: null,
  23028. duration: null,
  23029. maxDistanceOverride: null,
  23030. skipWarpingCheck: !1
  23031. };
  23032. return void this.player.flyToPano(o, r)
  23033. }
  23034. var floorlogoChange = function(){ //xzw add 地标开始变化 因为warpTravel_BLACK将不会是flytopano
  23035. this.player.model.floorLogoFade(0, 450, 0.7);
  23036. this.player.model.floorLogos[1].position.copy(this.warpDestPano.floorPosition.clone().sub(this.player.model.position));
  23037. }.bind(this);
  23038. this.activeTransType === l.BLACK ?( floorlogoChange(), this.warpTravel_BLACK(null, i, t, n) ): this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  23039. this._clearWarpShading(),
  23040. this._warpStopFlying(),
  23041. this.player.spider.draw(),
  23042. this.placeCpm(),
  23043. n && n()
  23044. }
  23045. .bind(this)) : this.warpTravel_STD(n)//warpTravel_STD??
  23046. }
  23047. ,
  23048. n.prototype.startWarpState = function() {
  23049. this.warping = !0,
  23050. this.warpInterrupted = !1,
  23051. this.warpInterruptionBlackoutStyle = null,
  23052. this.warpInterruptionTravelTime = null
  23053. }
  23054. ,
  23055. n.prototype.endWarpState = function() {
  23056. this.warping = !1
  23057. }
  23058. ,
  23059. n.prototype.warpToPano = function(e, t, i, n) {//导览漫游 走到下一个点结束时还会执行一次
  23060. if (this.warping)
  23061. return void y.warn("Cannot warp when already warping");
  23062. if (this.upcomingTransType = e,
  23063. this.activeTransType = null,
  23064. !this.setWarpDestPano())
  23065. return this.upcomingTransType = null,
  23066. void this.warpToNonPano(n);
  23067. if (this.player.mode !== a.PANORAMA)
  23068. return this.upcomingTransType = null,
  23069. this.discardSlow(),
  23070. void this.player.flyToNewMode({
  23071. mode: a.PANORAMA,
  23072. pano: this.warpDestPano,
  23073. duration: c.warp.outsideTime,
  23074. warpDest: this.warpDestHeroLoc,
  23075. callback: n,
  23076. force: !0
  23077. });
  23078. if (!this.warpDestPano)
  23079. return y.warn("no warp destination, callback dropped"),
  23080. void (this.upcomingTransType = null);
  23081. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano)
  23082. && this.warpDestPano !== this.player.currentPano
  23083. && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  23084. , o = this.chooseWarpPath(r);
  23085. if (o && this.upcomingTransType !== l.WALK) {//o为false则可能已经到下一个点
  23086. var s = function() {
  23087. this.waitingToWarp = !1,
  23088. this.warpToPano(e, t, i, n)
  23089. }
  23090. .bind(this);
  23091. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  23092. return void (this.waitingToWarp = !0)
  23093. }
  23094. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  23095. this.player.currentPano = this.warpDestPano,
  23096. this.placeCpm(),
  23097. this.fadeOutCpm(c.path.fadeOutTime),
  23098. this.player.spider.draw()
  23099. );
  23100. y.debug("Warping to pano ", this.warpDestPano.position);
  23101. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano);
  23102. this.startWarpState();
  23103. var h = function() {
  23104. this.endWarpState(),
  23105. n && n()
  23106. }
  23107. .bind(this);
  23108. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h), //this.warpCameraAim(h)是到达后触发
  23109. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  23110. }
  23111. ,
  23112. t.exports = n
  23113. }
  23114. ).call(this, "/js/objects/ShowPath.js")
  23115. }
  23116. , {
  23117. "../constants": 8,
  23118. "../effects": 16,
  23119. "../enum/BlackoutStyle": 18,
  23120. "../enum/ModelManagerEvents": 33,
  23121. "../enum/PlayerEvents": 40,
  23122. "../enum/RenderOrder": 42,
  23123. "../enum/Vectors": 50,
  23124. "../enum/Viewmode": 51,
  23125. "../enum/WarpStyle": 52,
  23126. "../gui/gui": 65,
  23127. "../model/ModelManager": 140,
  23128. "../objects/Snapshot": 153,
  23129. "../settings": 166,
  23130. "../shaders": 167,
  23131. "../util/easing": 186,
  23132. "../util/lerp": 188,
  23133. "../util/logger": 189,
  23134. "../util/math": 190,
  23135. "../util/texture": 194,
  23136. "../util/transitions": 195,
  23137. three: 217
  23138. }],
  23139. 152: [function(e, t, i) {//"./objects/Skybox"
  23140. "use strict";
  23141. function n() {
  23142. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  23143. , t = new r.RawShaderMaterial({
  23144. fragmentShader: o.skysphere.fragmentShader,
  23145. vertexShader: o.skysphere.vertexShader,
  23146. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  23147. side: r.BackSide,
  23148. name: "skysphere"
  23149. });
  23150. t.uniforms.radius.value = e.parameters.radius,
  23151. r.Mesh.call(this, e, t)
  23152. }
  23153. var r = e("three")
  23154. , o = e("../shaders")
  23155. , a = e("../settings");
  23156. n.prototype = Object.create(r.Mesh.prototype),
  23157. n.prototype.constructor = n,
  23158. t.exports = n
  23159. }
  23160. , {
  23161. "../settings": 166,
  23162. "../shaders": 167,
  23163. three: 217
  23164. }],
  23165. 153: [function(e, t, i) {///js/objects/Snapshot.js
  23166. (function(i) {
  23167. "use strict";
  23168. function n(e) {
  23169. o.call(this, e),
  23170. this.panoId = e.panoId,
  23171. this.orthoZoom = e.orthoZoom,
  23172. this.floorVisibility = e.floorVisibility,
  23173. this.thumbUrl = e.thumbUrl,
  23174. this.name = e.name
  23175. }
  23176. var r = (e("three"),
  23177. e("../util/logger"))
  23178. , o = (e("../settings"),
  23179. e("../enum/Viewmode"),
  23180. e("../util/common"),
  23181. e("../util/transitions"),
  23182. e("../util/lerp"),
  23183. e("../util/ajax"),
  23184. e("../util/texture"),
  23185. e("./View"));
  23186. e("events").EventEmitter,
  23187. new r(i);
  23188. n.prototype = Object.create(o.prototype),
  23189. n.prototype.isPano = function() {
  23190. return this.panoId && "" !== this.panoId
  23191. }
  23192. ,
  23193. t.exports = n
  23194. }
  23195. ).call(this, "/js/objects/Snapshot.js")
  23196. }
  23197. , {
  23198. "../enum/Viewmode": 51,
  23199. "../settings": 166,
  23200. "../util/ajax": 181,
  23201. "../util/common": 185,
  23202. "../util/lerp": 188,
  23203. "../util/logger": 189,
  23204. "../util/texture": 194,
  23205. "../util/transitions": 195,
  23206. "./View": 154,
  23207. events: 202,
  23208. three: 217
  23209. }],
  23210. 154: [function(e, t, i) {///js/objects/View.js
  23211. (function(i) {
  23212. "use strict";
  23213. function n(e) {
  23214. e = e || {},
  23215. this.position = new r.Vector3,
  23216. this.quaternion = new r.Quaternion,
  23217. this.update(e)
  23218. }
  23219. var r = e("three")
  23220. , o = e("../util/logger")
  23221. , a = (e("../settings"),
  23222. e("../enum/Viewmode"),
  23223. e("../util/common"),
  23224. e("../util/transitions"),
  23225. e("../util/lerp"),
  23226. e("../util/ajax"),
  23227. e("../util/texture"),
  23228. e("events").EventEmitter);
  23229. new o(i);
  23230. n.prototype = Object.create(a.prototype),
  23231. n.prototype.isValid = function() {
  23232. return !!this.cameraMode
  23233. }
  23234. ,
  23235. n.prototype.update = function(e) {
  23236. return this.cameraMode = e.cameraMode || this.cameraMode,
  23237. this.pano = e.pano || this.pano,
  23238. e.position && this.position.copy(e.position),
  23239. e.quaternion && this.quaternion.copy(e.quaternion),
  23240. this
  23241. }
  23242. ,
  23243. t.exports = n
  23244. }
  23245. ).call(this, "/js/objects/View.js")
  23246. }
  23247. , {
  23248. "../enum/Viewmode": 51,
  23249. "../settings": 166,
  23250. "../util/ajax": 181,
  23251. "../util/common": 185,
  23252. "../util/lerp": 188,
  23253. "../util/logger": 189,
  23254. "../util/texture": 194,
  23255. "../util/transitions": 195,
  23256. events: 202,
  23257. three: 217
  23258. }],
  23259. 155: [function(e, t, i) {///js/player.js
  23260. (function(i) {
  23261. "use strict";
  23262. function n(e) {
  23263. this.currentPano = null,
  23264. this.nextPano = null,
  23265. this.camera = null,
  23266. this.paused = !1,
  23267. this.flying = !1,
  23268. this.sceneIntersectionPlane = null,
  23269. this.target = new r.Vector3,
  23270. this.mouse = new r.Vector3(1.1,1.1,.5),
  23271. this.mouseAtMouseDown = new r.Vector2,
  23272. this.mouseCouldBeClickToMove = !1,
  23273. this.mouseLastMoveTime = Date.now(),
  23274. this.mouseDown = !1,
  23275. this.mouseDownTimer = null,
  23276. this.couldBeLongTap = !1,
  23277. this.containsMouse = !0,
  23278. this.isTouchEvent = !1,
  23279. this.isPanoHover = !1,
  23280. this.reticule = new a(this),
  23281. this.panoMarkers = [],
  23282. this.spider = new h(this),
  23283. this.quaternion = new r.Quaternion,
  23284. this.position = new r.Vector3(15,10,15),
  23285. this.previousState = null,
  23286. this.lastInsideView = new c,
  23287. this.last360View = new c,
  23288. this.raycaster = new r.Raycaster,
  23289. this.intersect = null,
  23290. this.lastChangeTime = Date.now(),
  23291. this.history = new I,
  23292. this.cameraControls = null,
  23293. this.path = null,
  23294. this.model = null,
  23295. this.domElement = null,
  23296. this.cachedPanoCandidates = null,
  23297. this.basePanoSize = 0,
  23298. this.standardPanoSize = 0,
  23299. this.highPanoSize = 0,
  23300. this.ultraHighPanoSize = 0,
  23301. this.zoomLevel = 1,
  23302. this.zooming = 0,
  23303. this.zoomSpeed = .5,
  23304. this.scrollZoomSpeed = .06,
  23305. this.zoomSpeedAdjust = .05,
  23306. this.defaultZoomIncrement = .2,
  23307. this.baseFov = f.insideFOV,
  23308. this.zoomFov = this.baseFov,
  23309. this.zoomEnabled = !0,
  23310. this.preRenderingEnabled = !1,
  23311. this.setupCustomProperties(e),
  23312. this.zoomStats = new L
  23313. //xzw:
  23314. this.hotspotDrag = {};//热点拖拽的信息
  23315. this.allHotspots = [];//包括 正在采集的热点 和 已经生成的热点
  23316. this.posGets = {};//采集的点 需要2处
  23317. this.startGetPos = !1; //是否开始采集
  23318. this.markspot = null; //当前正在采集的热点
  23319. this.disablePanos = []; //收集采集时被禁止走到的第二个位置
  23320. if(window.ifTest) window.player = this;
  23321. }
  23322. var r = e("three")
  23323. , o = e("./util/logger")
  23324. , a = e("./objects/Reticule")
  23325. , s = e("./objects/Panorama")
  23326. , l = e("./objects/ShowPath")
  23327. , c = e("./objects/View")
  23328. , h = (e("./objects/Snapshot"),
  23329. e("./objects/NSpider"))
  23330. , u = e("./enum/Viewmode")
  23331. , d = (e("./enum/TagStates"),
  23332. e("./enum/Vectors"))
  23333. , p = e("./enum/Keys")
  23334. , f = (e("./enum/AlignmentType"),
  23335. e("./settings"))
  23336. , g = e("./util/common")
  23337. , m = (e("./util/browser"),
  23338. e("./util/math"))
  23339. , v = e("./util/lerp")
  23340. , A = e("./util/easing")
  23341. , y = e("./util/transitions")
  23342. , C = e("events").EventEmitter
  23343. , I = (e("./shaders"),
  23344. e("./util/history"))
  23345. , E = (e("./util/camera"),
  23346. e("./model/ModelManager"),
  23347. e("./enum/PathDiscardMode"))
  23348. , b = e("./enum/PathDisplayMode")
  23349. , w = e("./enum/PlayerEvents")
  23350. , _ = e("./enum/ControlEvents")
  23351. , T = e("./enum/ModelManagerEvents")
  23352. , x = e("./enum/WarpStyle")
  23353. , S = e("./enum/BlackoutStyle")
  23354. , M = e("./exception/BasicException")
  23355. , R = e("./enum/PanoSizeClass")
  23356. , P = (e("./tile/TileDownloader"),
  23357. e("./tile/TilePrioritizer"))
  23358. , O = (e("./enum/PanoramaEvents"),
  23359. e("./enum/ZoomEvents"))
  23360. , L = e("./util/ZoomStats")
  23361. , D = e("./constants")
  23362. , N = e("./util/common")
  23363. , B = e("./util/cameraLight")
  23364. , F = new o(i)
  23365. , editor = e("Editor") //改
  23366. , Hotspot = e("Hotspot")
  23367. , dom = e("dom")
  23368. , V = Object.freeze({
  23369. FlyToPano: y.getUniqueId(),
  23370. FlyToNewMode: y.getUniqueId(),
  23371. FlyToSameMode: y.getUniqueId(),
  23372. FlyToViewFloor: y.getUniqueId(),
  23373. LookTransition: y.getUniqueId(),
  23374. ZoomTransition: y.getUniqueId()
  23375. });
  23376. n.prototype = Object.create(C.prototype),
  23377. n.prototype.init = function(e) {
  23378. this.modelManager = e.modelManager,
  23379. this.tileDownloader = e.tileDownloader,
  23380. this.panoRenderer = e.panoRenderer,
  23381. this.qualityManager = e.qualityManager,
  23382. this.domElement = e.container,
  23383. this.camera = e.camera,
  23384. this.tagManager = e.tagManager,
  23385. this.cameraControls = e.controls,
  23386. this.path = new l(e.director,this,e.controls),
  23387. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  23388. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  23389. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  23390. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  23391. this.tileDownloader.processPriorityQueue = !1,
  23392. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  23393. this.bindEvents(e.container),
  23394. this.updateModel()
  23395. }
  23396. ,
  23397. //xzw: 主要是采集热点的函数----------------
  23398. n.prototype.disablePanoAtLine = function(origin, end){//角度过小的位置禁止行走 //问题:在修改位置后有可能变成角度很小
  23399. this.disablePanos = [];
  23400. var atline = function(origin,end){
  23401. var b = origin.clone().sub(end).setY(0).normalize();
  23402. return function(pano){
  23403. var a1 = pano.position.clone().sub(end).normalize(); //真实情况有可能焦点在线段终点之外,角度会更小,现在忽略
  23404. var a2 = pano.position.clone().sub(origin).normalize();
  23405. var cos1 = Math.abs( a1.dot(b) );
  23406. var cos2 = Math.abs( a2.dot(b) );
  23407. var a = Math.max(cos1, cos2);
  23408. //console.log(Math.acos(a) * 180 / Math.PI)
  23409. pano.recentAngleScore = a;//注意 currentPano的recentAngleScore没被刷新
  23410. return a > 0.996;//5° 0.9848 10°
  23411. }
  23412. }
  23413. var sortByAngle = function(origin,end){
  23414. return function(pano){
  23415. return pano.recentAngleScore;
  23416. }
  23417. }
  23418. var o = this.model.panos.sortByScore(
  23419. [s.filters.not(this.currentPano), atline(origin,end) ],
  23420. [sortByAngle(origin,end)]
  23421. );
  23422. if(o){
  23423. if(o.length==this.model.panos.list.length-1) o.pop(); //如果全部pano都被纳入,那么剔除角度最大的
  23424. for(var i=0;i<o.length;i++){
  23425. this.disablePanos.push(o[i].pano)
  23426. }
  23427. }
  23428. //console.log(o)
  23429. //this.updateMarkerDisplay();
  23430. this.model.fadePanoMarkers(null,null,{player:this});
  23431. }
  23432. n.prototype.cancelPanoDisable = function(){
  23433. this.disablePanos = [];
  23434. //this.updateMarkerDisplay();
  23435. this.model.fadePanoMarkers(null,null,{player:this});
  23436. }
  23437. n.prototype.lookAtPos = function(pos,cameraPos){//点击修改热点位置时 看向markspot
  23438. var realPos = pos.clone().applyMatrix4(this.model.matrixWorld);
  23439. this.cameraControls.activeControl.startLookAt(realPos,y,v,f, cameraPos);
  23440. }
  23441. //end-------
  23442. n.prototype.setupCustomProperties = function(e) {
  23443. var t = e || u.PANORAMA;
  23444. Object.defineProperty(this, "mode", {
  23445. get: function() {
  23446. return t
  23447. },
  23448. set: function(e) {
  23449. var i = t;
  23450. t = e,
  23451. this.onModeUpdated(i, t)
  23452. }
  23453. })
  23454. }
  23455. ,
  23456. n.prototype.isInMode = function() {
  23457. for (var e = 0; e < arguments.length; e++)
  23458. if (this.mode === arguments[e])
  23459. return !0;
  23460. return !1
  23461. }
  23462. ,
  23463. n.prototype.isOutsideMode = function(e) {
  23464. return e = e || this.mode,
  23465. e === u.DOLLHOUSE || e === u.FLOORPLAN
  23466. }
  23467. ,
  23468. n.prototype.is360View = function(e, t) {
  23469. return e === u.PANORAMA && t && !t.isAligned()
  23470. }
  23471. ,
  23472. n.prototype.setScene = function(e) {
  23473. this.sceneIntersectionPlane = e.plane,
  23474. this.path.setScene(e),
  23475. this.moveReticuleToScene(e)
  23476. }
  23477. ,
  23478. n.prototype.moveReticuleToScene = function(e) {
  23479. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  23480. e.add(this.reticule)
  23481. }
  23482. ,
  23483. n.prototype.updateModel = function() {
  23484. function e(e, t, n) {
  23485. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  23486. }
  23487. function t(e, t) {
  23488. if (this.mode === u.DOLLHOUSE) {
  23489. var n = e ? this.model.center.y : n = t.center.y;
  23490. i.call(this, n)
  23491. }
  23492. }
  23493. function i(e) {
  23494. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  23495. , i = this.cameraControls.controls[u.DOLLHOUSE]
  23496. , n = t.position.y + (e - i.target.y)
  23497. , r = f.showFloorDuration + f.showFloorDelay;
  23498. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  23499. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  23500. }
  23501. this.model = this.modelManager.getActiveModel(),
  23502. this.model.player = this, //xzw加 方便调用
  23503. this.model.on("floor.changed", e.bind(this)),
  23504. this.model.on("allfloors.toggled", t.bind(this)),
  23505. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  23506. }
  23507. ,
  23508. n.prototype.updateModelDependentData = function() {
  23509. this.cameraControls.setModelForControls(this.model),
  23510. this.getPanoMarkersFromModel(this.model)
  23511. }
  23512. ,
  23513. n.prototype.onModelChanged = function() {
  23514. this.updateModel(),
  23515. this.updateModelDependentData()
  23516. }
  23517. ,
  23518. n.prototype.getPanoMarkersFromModel = function(e) {
  23519. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  23520. return t.marker ? e.concat(t.marker) : e
  23521. }, [])
  23522. }
  23523. ,
  23524. n.prototype.handleControlMove = function(e) {
  23525. this.emit(w.Move, e)
  23526. }
  23527. ,
  23528. n.prototype.handleControlInputStart = function(e) {
  23529. this.emit(w.InputStart, e)
  23530. }
  23531. ,
  23532. n.prototype.onModeUpdated = function(e, t) {
  23533. this.cameraControls.activateControls(t),
  23534. this.emit(w.ModeChanged, e, t)
  23535. }
  23536. ,
  23537. n.prototype.isWarping = function() {
  23538. return this.path.warping
  23539. }
  23540. ,
  23541. n.prototype.isWaitingToWarp = function() {
  23542. return this.path.waitingToWarp
  23543. }
  23544. ,
  23545. n.prototype.getLabelScaleFactor = function() {
  23546. if (this.isOutsideMode()) {
  23547. var e = 10
  23548. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  23549. return t
  23550. }
  23551. return .5
  23552. }
  23553. ,
  23554. n.prototype.bindEvents = function(e) {
  23555. e !== document && e.setAttribute("tabindex", -1),
  23556. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  23557. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  23558. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  23559. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  23560. // e.addEventListener("mouseup", this.onMouseUp.bind(this)), //xzw pointerup也会触发,而有时随后又触发mouseup,造成handleInputend执行两次,热点click执行两次展不开。如果删除有问题以后再改。
  23561. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  23562. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  23563. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  23564. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  23565. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  23566. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  23567. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  23568. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  23569. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  23570. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  23571. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  23572. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  23573. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  23574. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this))
  23575. //热点相关 xzw
  23576. window.addEventListener("mousemove", this.dragSpotMove.bind(this) )
  23577. window.addEventListener("touchmove", this.dragSpotMove.bind(this) )
  23578. window.addEventListener("mouseup", this.dragSpotDone.bind(this) )
  23579. window.addEventListener("touchend", this.dragSpotDone.bind(this) )
  23580. }
  23581. ,
  23582. n.prototype.onMouseDown = function(e) {
  23583. e.currentTarget !== document && e.currentTarget.focus(),
  23584. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  23585. this.updateIntersect())
  23586. //xzw加:
  23587. this.chosenSpot && (this.chosenSpot.billboard.div.style['pointer-events'] = "none",
  23588. $(this.chosenSpot.billboard.div).find("img").css({'pointer-events':"none"})
  23589. );//防止拖动到热点
  23590. }
  23591. ,
  23592. n.prototype.onMouseMove = function(e) {
  23593. this.isTouchEvent = !1,
  23594. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  23595. }
  23596. ,
  23597. n.prototype.onMouseOver = function(e) {
  23598. this.containsMouse = !0,
  23599. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  23600. }
  23601. ,
  23602. n.prototype.onMouseOut = function(e) {
  23603. this.containsMouse = !1
  23604. }
  23605. ,
  23606. n.prototype.onMouseUp = function(e) {
  23607. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  23608. }
  23609. ,
  23610. n.prototype.onTouchStart = function(e) {
  23611. if (e.currentTarget !== document && e.currentTarget.focus(),
  23612. !this.mouseDown) {
  23613. this.couldBeLongTap = !0;
  23614. var t = g.average(e.changedTouches, "clientX")
  23615. , i = g.average(e.changedTouches, "clientY");
  23616. this.handleInputStart.call(this, t, i, !0),
  23617. this.mouseDownTimer = setTimeout(function() {
  23618. this.updateIntersect(),
  23619. this.handleInputEnd.call(this, t, i, !0)
  23620. }
  23621. .bind(this), f.input.longTapThreshold)
  23622. }
  23623. }
  23624. ,
  23625. n.prototype.onTouchMove = function(e) {
  23626. var t = g.average(e.changedTouches, "clientX")
  23627. , i = g.average(e.changedTouches, "clientY");
  23628. this.handleInputMove.call(this, t, i, !0)
  23629. }
  23630. ,
  23631. n.prototype.onTouchEnd = function(e) {
  23632. if (clearTimeout(this.mouseDownTimer),
  23633. this.mouseDown) {
  23634. this.couldBeLongTap = !1,
  23635. this.updateIntersect();
  23636. var t = g.average(e.changedTouches, "clientX")
  23637. , i = g.average(e.changedTouches, "clientY");
  23638. this.handleInputEnd.call(this, t, i, !0)
  23639. }
  23640. }
  23641. ,
  23642. n.prototype.onPointerDown = function(e) {
  23643. return e.currentTarget !== document && e.currentTarget.focus(),
  23644. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  23645. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  23646. void (this.mouseDownTimer = setTimeout(function() {
  23647. this.updateIntersect(),
  23648. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  23649. }
  23650. .bind(this), f.input.longTapThreshold)))
  23651. }
  23652. ,
  23653. n.prototype.onPointerMove = function(e) {
  23654. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  23655. }
  23656. ,
  23657. n.prototype.onPointerUp = function(e) {
  23658. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  23659. this.couldBeLongTap = !1,
  23660. this.updateIntersect(),
  23661. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  23662. }
  23663. ,
  23664. n.prototype.onPointerOut = function(e) {
  23665. this.mouseDown = !1
  23666. }
  23667. ,
  23668. n.prototype.onPointerCancel = function(e) {
  23669. this.mouseDown = !1
  23670. }
  23671. ,
  23672. n.prototype.onKeyDown = function(e) {
  23673. if(!window.keyCon) return; //xzw add
  23674. var t = function() {
  23675. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  23676. }
  23677. .bind(this)
  23678. , i = e.which;
  23679. switch (i) {
  23680. case p.F:
  23681. t(),
  23682. this.changeFloor(-1);
  23683. break;
  23684. case p.R:
  23685. t(),
  23686. this.changeFloor(1)
  23687. }
  23688. if (this.mode === u.PANORAMA)
  23689. switch (i) {
  23690. case p.UPARROW:
  23691. case p.W:
  23692. this.flyLocalDirection(d.FORWARD.clone());
  23693. break;
  23694. case p.DOWNARROW:
  23695. case p.S:
  23696. this.flyLocalDirection(d.BACK.clone());
  23697. break;
  23698. case p.A:
  23699. this.flyLocalDirection(d.LEFT.clone());
  23700. break;
  23701. case p.D:
  23702. this.flyLocalDirection(d.RIGHT.clone())
  23703. }
  23704. }
  23705. ,
  23706. n.prototype.handleScrollPinchZoom = function() {
  23707. return function(e) {
  23708. var t = e
  23709. , i = this.zoomLevel;
  23710. this.zoomBy(t),
  23711. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  23712. }
  23713. }(),
  23714. n.prototype.handleControlPinch = function(e) {
  23715. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  23716. }
  23717. ,
  23718. n.prototype.handleControlScroll = function(e) {
  23719. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  23720. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  23721. }
  23722. ,
  23723. n.prototype.handleInputStart = function(e, t, i) {
  23724. this.isTouchEvent = i,
  23725. m.convertScreenPositionToNDC(e, t, this.mouse),
  23726. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  23727. this.mouseCouldBeClickToMove = !0,
  23728. this.mouseDown = !0
  23729. }
  23730. ,
  23731. n.prototype.handleInputMove = function(e, t, i) {
  23732. if(this.markspot && this.markspot.state == "drag") return;//xzw
  23733. this.isTouchEvent = i,
  23734. m.convertScreenPositionToNDC(e, t, this.mouse),
  23735. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  23736. this.couldBeLongTap = !1,
  23737. clearTimeout(this.mouseDownTimer)),
  23738. this.mouseLastMoveTime = Date.now(),
  23739. this.reticule.move(e, t, i)
  23740. }
  23741. ,
  23742. /* n.prototype.handleInputEnd = function(e, t, i) {// mouseup touchend ----MP
  23743. if (this.isTouchEvent = i,
  23744. this.mouseDown = !1,
  23745. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  23746. !i && this.couldBeLongTap)
  23747. return !0;
  23748. if (this.handleLongTap())
  23749. return !0;
  23750. if (this.mouseCouldBeClickToMove) {
  23751. if (this.flying)
  23752. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  23753. !0;
  23754. if (this.checktagClick())
  23755. return !0;
  23756. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  23757. this.history.invalidate(),
  23758. this.intersect)
  23759. return this.flyToPanoClosestToMouse();
  23760. if (this.mode === u.PANORAMA) {
  23761. var n = this.closestPanoInDirection(this.getMouseDirection());
  23762. return n ? this.flyToPano({
  23763. pano: n
  23764. }) : this.bump(this.getMouseDirection())
  23765. }
  23766. }
  23767. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  23768. }*/
  23769. //xzw: 加点和采集热点相关的东西:
  23770. n.prototype.handleInputEnd = function(e, t, i) {// mouseup touchend
  23771. console.log('handleInputEnd '+i);
  23772. this.isTouchEvent = i,
  23773. this.mouseDown = !1,
  23774. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct");
  23775. this.chosenSpot && (this.chosenSpot.billboard.div.style['pointer-events'] = "",
  23776. $(this.chosenSpot.billboard.div).find("img").css({'pointer-events':""}));
  23777. if (!i && this.couldBeLongTap)
  23778. return !0;
  23779. if (this.handleLongTap())
  23780. return !0;
  23781. if (this.mouseCouldBeClickToMove) {
  23782. if (this.flying)
  23783. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  23784. !0;
  23785. if(this.startGetPos){// 改 开始采集第一个点
  23786. this.updateIntersect({notTag:true});
  23787. if(!this.intersect) return;
  23788. var modelViewMatrix = new r.Matrix4().getInverse(this.model.matrixWorld.clone());//×模型矩阵的逆矩阵,是因为当飞出屋子再飞进去时模型位移了,现在要保证采集的点是模型没有任何变换下的点。在计算2d坐标时会乘以模型矩阵。
  23789. var point = this.intersect.point.clone().applyMatrix4(modelViewMatrix);
  23790. this.markspot = new Hotspot({pos3d : point, player:this, type: dom.getIndex(editor.metaSelect.find('p')[0])});
  23791. this.posGets[this.currentPano.id] = point;
  23792. this.posGets.list = [this.currentPano.id];
  23793. this.posGets.length = 1;
  23794. this.disablePanoAtLine(this.currentPano.position, point);
  23795. dom.bind(this.markspot.elem, "mousedown",this.hotspotDragBegin); //热点拖拽开启
  23796. this.domElement.style.cursor = "";
  23797. editor.pointsElem[0].style.display = "flex";
  23798. dom.addClass(editor.pointsElem[0],'chosen');
  23799. this.startGetPos = false;//第一个点标记结束
  23800. return;
  23801. }
  23802. if (this.checktagClick())
  23803. return !0;
  23804. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  23805. this.history.invalidate(),
  23806. this.intersect)
  23807. return this.flyToPanoClosestToMouse();
  23808. if (this.mode === u.PANORAMA) {
  23809. var n = this.closestPanoInDirection(this.getMouseDirection());
  23810. return n ? this.flyToPano({
  23811. pano: n
  23812. }) : this.bump(this.getMouseDirection())
  23813. }
  23814. }
  23815. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  23816. }
  23817. ,
  23818. n.prototype.dragSpotMove = function(t){//新添加 为了热点拖动
  23819. if(this.markspot && this.markspot.state == "drag"){
  23820. var deltaX = t.clientX - this.hotspotDrag.mouseinitX;
  23821. var deltaY = t.clientY - this.hotspotDrag.mouseinitY;
  23822. this.markspot.transformX = this.hotspotDrag.transformX + deltaX;
  23823. this.markspot.transformY = this.hotspotDrag.transformY + deltaY;
  23824. this.markspot.elem.style.transform = "translateX("+this.markspot.transformX + "px) translateY("+ this.markspot.transformY + "px) translateZ(0px)";
  23825. }
  23826. }
  23827. n.prototype.dragSpotDone = function(t) {//新添加 热点拖动结束
  23828. if(this.markspot && this.markspot.state == "drag"){
  23829. this.markspot.state = "static";
  23830. dom.removeClass(this.markspot.elem,"drag");
  23831. //var offsetTop = window.innerHeight - this.domElement.clientHeight;
  23832. this.mouse.x = ( this.markspot.transformX / this.domElement.clientWidth ) * 2 - 1;
  23833. //this.mouse.y = - ( (this.markspot.transformY-offsetTop) / this.domElement.clientHeight ) * 2 + 1;
  23834. this.mouse.y = - ( this.markspot.transformY/ this.domElement.clientHeight ) * 2 + 1;
  23835. this.updateIntersect({notTag:true});
  23836. if(!this.intersect) return;
  23837. var modelViewMatrix = new r.Matrix4().getInverse(this.model.matrixWorld.clone());
  23838. var point = this.intersect.point.clone().applyMatrix4(modelViewMatrix);
  23839. this.markspot.pos3d = point.clone();
  23840. if(this.posGets.length<2 && this.posGets.list[0]!=this.currentPano.id){
  23841. //editor.pointsElem[1].children[0].innerHTML = this.currentPano.id;
  23842. var index = this.posGets.length; //0是把点删完了重新拖动的结果
  23843. if(!this.markspot.changePos)editor.pointsElem[index].style.display = "flex";
  23844. else editor.pointsElem2[index].style.display = "flex";
  23845. this.posGets.list.push(this.currentPano.id);
  23846. this.posGets.length ++;
  23847. if(!this.markspot.changePos)dom.addClass(editor.pointsElem[index],'chosen');
  23848. else dom.addClass(editor.pointsElem2[index],'chosen');
  23849. //editor.tipWrite("您可以点击“位置1”和“位置2”来在两个位置间切换,并确保热点在这两个位置中的定位相同,然后点击“完成”即可生成最终的热点。");
  23850. //由1变2:
  23851. index && (!this.markspot.changePos) && (editor.ok.style.display = "block") && this.model.fadePanoMarkers(null,null,{player:this});//xzw改 fadePanoMarkers加了参数
  23852. this.editor.setMarkspotDisplayNum(index+1);
  23853. }else if(this.posGets.length==1 && this.posGets.list[0]==this.currentPano.id){
  23854. this.disablePanoAtLine(this.currentPano.position, point);
  23855. }
  23856. this.posGets[this.currentPano.id] = point.clone();
  23857. }
  23858. }
  23859. n.prototype.handleLongTap = function() {
  23860. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  23861. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  23862. !0
  23863. }
  23864. ,
  23865. n.prototype.checktagClick = function() {
  23866. if (this.tagManager.intersectTag) {
  23867. var e = this.isTouchEvent
  23868. , t = this.tagManager.clickedOnTag(e, this);
  23869. return e || t || y.cancelById(V.LookTransition),
  23870. !0
  23871. }
  23872. if (this.tagManager.activeTag)
  23873. return this.tagManager.dismissActiveTag(),
  23874. !1
  23875. }
  23876. ,
  23877. n.prototype.rankedtagInDirection = function(e, t) {
  23878. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  23879. }
  23880. ,
  23881. n.prototype.start = function(e) {
  23882. var t = e.mode
  23883. , i = e.pano
  23884. , n = e.position
  23885. , r = e.quaternion
  23886. , o = e.tag
  23887. , a = e.quickstart
  23888. , s = $.Deferred();
  23889. this.updateModelDependentData(),
  23890. this.updateFromControls(),
  23891. this.findDefaultViews();
  23892. var l = this.is360View(t, i);
  23893. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  23894. s.done(function(e) {
  23895. this.emit(w.Ready, l, e, o)
  23896. }
  23897. .bind(this)),
  23898. s.promise()
  23899. }
  23900. ,
  23901. n.prototype.startOutside = function(e, t) {
  23902. var i = e.mode
  23903. , n = e.pano
  23904. , r = e.position
  23905. , o = e.quaternion
  23906. , a = e.zoom
  23907. , s = e.floorVisibility
  23908. , l = e.tag;
  23909. this.emit(w.StartOutside, f[i].transitionTime),
  23910. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  23911. y.cancelById(V.FlyToViewFloor),
  23912. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  23913. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  23914. }
  23915. ,
  23916. n.prototype.startInside = function(e, t, i, n, r) {
  23917. r = r || $.Deferred(),
  23918. this.currentPano = e;
  23919. var o = e && !e.isAligned();
  23920. if (t = o ? e.position : t || e.position,
  23921. i = i || e.quaternion,
  23922. e) {
  23923. var a = this.startInside.bind(this, e, t, i, n, r);
  23924. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  23925. return
  23926. }
  23927. return this.mode = u.PANORAMA,
  23928. e.floor.enter(this.mode),
  23929. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  23930. this.switchCameraMode(this.mode, i),
  23931. this.emit(w.StartInside, o),
  23932. r.resolve(!0),
  23933. r
  23934. }
  23935. ,
  23936. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  23937. if (r = r || $.Deferred(),
  23938. this.dollhouseMode(),
  23939. !e)
  23940. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  23941. r.resolve(!1),
  23942. r;
  23943. t = t || e.position;
  23944. var o = i || this.cameraControls.activeControl.camera.quaternion
  23945. , a = e.position;
  23946. return this.fitDollhouse(a, t, o),
  23947. setTimeout(function(t) {
  23948. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  23949. var n = {
  23950. mode: u.PANORAMA,
  23951. pano: e,
  23952. quaternion: i,
  23953. callback: function() {
  23954. this.emit(w.FlyinFinished),
  23955. r.resolve(!0)
  23956. }
  23957. .bind(this)
  23958. };
  23959. this.flyToNewMode(n),
  23960. editor.global.enablePanel(); //改 xzw
  23961. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  23962. r
  23963. }
  23964. ,
  23965. n.prototype.checkAndWaitForPanoLoad = function() {
  23966. var e = {}
  23967. , t = {}
  23968. , i = 5e3
  23969. , n = function() {
  23970. for (var n in e)
  23971. if (e.hasOwnProperty(n) && e[n]) {
  23972. var r = performance.now() - t[n];
  23973. if (r < i)
  23974. return !0
  23975. }
  23976. return !1
  23977. };
  23978. return function(r, o, a, s, l, c, h, u, d, p) {
  23979. if (n())
  23980. return !0;
  23981. var f = function(t, i, n) {
  23982. N.delayOneFrame(function() {
  23983. e[t] = !1,
  23984. l && l(i, n)
  23985. }
  23986. .bind(this))
  23987. }
  23988. .bind(this, r.id)
  23989. , g = function(t, i) {
  23990. N.delayOneFrame(function() {
  23991. e[t] = !1,
  23992. c && c(i)
  23993. }
  23994. .bind(this))
  23995. }
  23996. .bind(this, r.id);
  23997. try {
  23998. return null !== u && void 0 !== u || (u = !0),
  23999. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  24000. e[r.id] && (t[r.id] = performance.now()),
  24001. e[r.id]
  24002. } catch (n) {
  24003. throw e[r.id] = !1,
  24004. t[r.id] = performance.now() - i,
  24005. n
  24006. }
  24007. }
  24008. }(),
  24009. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  24010. if (!e)
  24011. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  24012. return r && this.model.waitForLoad(e, function() {
  24013. return e.isLoaded(i)
  24014. }),
  24015. !e.isLoaded(t) && (e.loadCube(t).done(n),
  24016. !0)
  24017. }
  24018. ,
  24019. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  24020. var e = new r.Vector3;
  24021. return function(t, i, n, r, o, a, s, l) {
  24022. if (!t)
  24023. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  24024. return e.copy(d.FORWARD),
  24025. this.getDirection(e),
  24026. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  24027. return t.isLoaded(i)
  24028. }),
  24029. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  24030. n && n(e, t)
  24031. }
  24032. .bind(this)).fail(function(e) {
  24033. r && r(e)
  24034. }
  24035. .bind(this)).progress(function(e, t, i) {
  24036. o && o(e, t, i)
  24037. }
  24038. .bind(this)),
  24039. !0)
  24040. }
  24041. }(),
  24042. n.prototype.switchCameraMode = function(e, t) {
  24043. var i = this.cameraControls.controls[e]
  24044. , n = i.camera;
  24045. switch (e) {
  24046. case u.PANORAMA:
  24047. n.position.copy(this.currentPano.position);
  24048. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  24049. i.lookAt(o.add(n.position));
  24050. break;
  24051. case u.DOLLHOUSE:
  24052. var a = this.position.clone();
  24053. 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),
  24054. n.position.copy(a),
  24055. i.target.copy(this.target.clone().setY(this.model.center.y));
  24056. break;
  24057. case u.FLOORPLAN:
  24058. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  24059. i.target.copy(this.model.center).setY(0),
  24060. i.zoomToContain(this.model.size),
  24061. i.rotateToView(this.model.size, this.getDirection())
  24062. }
  24063. i.update(0)
  24064. }
  24065. ,
  24066. n.prototype.update = function() {//在animat里一直刷新
  24067. var e = (new r.Vector3,
  24068. {})
  24069. , t = [];
  24070. return function(i) {
  24071. this.markspot && this.markspot.updateHotspot2dPos(), //xzw
  24072. this.updatePersistentZooming(i),
  24073. this.updateFromControls(i),
  24074. this.getCurrentNodePanos(t),
  24075. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  24076. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  24077. this.emit(w.ViewChanged)),
  24078. this.model.supportsTiles && (this.updateTileDownloader(t),
  24079. this.updatePanoRenderer(t)),
  24080. this.updatePreRendering(t),
  24081. this.reticule.update(),
  24082. this.path.update(),
  24083. this.spider.update(),
  24084. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  24085. this.updateControlLocks(),
  24086. this.model.supportsTiles && this.updateZoomPano()
  24087. this.model.updateFloorlogo(this.camera && this.camera.quaternion); // xzw add
  24088. }
  24089. }(),
  24090. n.prototype.updatePersistentZooming = function(e) {
  24091. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  24092. }
  24093. ,
  24094. n.prototype.updateControlLocks = function() {
  24095. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  24096. }
  24097. ,
  24098. n.prototype.updatePanoRenderer = function() {
  24099. var e = new r.Vector3;
  24100. return function(t) {
  24101. var i = this.nextPano || this.currentPano;
  24102. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  24103. this.getDirection(e),
  24104. this.panoRenderer.updateDirection(e))
  24105. }
  24106. }(),
  24107. n.prototype.cleanupInactivePanos = function() {
  24108. var e = []
  24109. , t = [];
  24110. return function() {
  24111. e.length = 0,
  24112. e.push(this.currentPano),
  24113. this.nextPano && e.push(this.nextPano),
  24114. t.length = 0;
  24115. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  24116. t.push(this.panoRenderer.activePanos[i]);
  24117. for (var n = 0; n < t.length; n++) {
  24118. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  24119. r.id === e[a].id && (o = !1);
  24120. o && r.exit()
  24121. }
  24122. }
  24123. }(),
  24124. n.prototype.updatePreRendering = function() {
  24125. var e = {};
  24126. return function(t) {
  24127. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  24128. var i = this.nextPano || this.currentPano;
  24129. if (i && t && t.length > 1) {
  24130. var n = t.findIndex(function(e) {
  24131. if (e.id === i.id)
  24132. return !0
  24133. });
  24134. if (n >= 0 && n + 1 < t.length) {
  24135. var r = t[n + 1];
  24136. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  24137. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  24138. window.setTimeout(function(t) {
  24139. e[t.id] = !1
  24140. }
  24141. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  24142. }
  24143. .bind(this, r), f.tiling.panoPreRenderDelay),
  24144. e[r.id] = !0)
  24145. }
  24146. }
  24147. }
  24148. }
  24149. }(),
  24150. n.prototype.enablePreRendering = function() {
  24151. this.preRenderingEnabled = !0
  24152. }
  24153. ,
  24154. n.prototype.disablePreRendering = function() {
  24155. this.preRenderingEnabled = !1,
  24156. this.cleanupInactivePanos()
  24157. }
  24158. ,
  24159. n.prototype.updateTileDownloader = function() {
  24160. var e = new r.Vector3;
  24161. return function(t) {
  24162. var i = this.nextPano || this.currentPano;
  24163. i && (e.copy(d.FORWARD),
  24164. this.getDirection(e),
  24165. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  24166. this.tileDownloader.processPriorityQueue = !0)
  24167. }
  24168. }(),
  24169. n.prototype.updateFromControls = function(e) {
  24170. null !== e && void 0 !== e || (e = 0),
  24171. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  24172. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  24173. this.position.copy(this.cameraControls.activeControl.camera.position),
  24174. this.target.copy(this.cameraControls.activeControl.target),
  24175. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  24176. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  24177. this.camera.position.copy(this.position),
  24178. this.camera.quaternion.copy(this.quaternion),
  24179. this.camera.updateMatrix(),
  24180. this.camera.updateMatrixWorld()
  24181. }
  24182. ,
  24183. n.prototype.hasChanged = function(e) {
  24184. if (!this.previousState)
  24185. return this.previousState = {
  24186. allFloorsVisible: this.model.allFloorsVisible,
  24187. position: this.position.clone(),
  24188. quaternion: this.quaternion.clone(),
  24189. mouse: this.mouse.clone(),
  24190. labelScaleFactor: this.getLabelScaleFactor(),
  24191. currentFloor: this.model.currentFloor,
  24192. projectionMatrix: this.camera.projectionMatrix.clone(),
  24193. worldMatrix: this.camera.matrixWorld.clone(),
  24194. mode: this.mode,
  24195. modelPosition: this.model.position.clone(),
  24196. modelCenter: this.model.center.clone(),
  24197. zoomLevel: this.zoomLevel
  24198. },
  24199. !0;
  24200. var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  24201. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  24202. e.moved = !this.position.equals(this.previousState.position),
  24203. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  24204. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  24205. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  24206. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  24207. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  24208. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  24209. e.modeChanged = this.mode !== this.previousState.mode,
  24210. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  24211. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  24212. e.nextPanoActive = null !== this.nextPano,
  24213. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  24214. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  24215. this.previousState.position.copy(this.position),
  24216. this.previousState.quaternion.copy(this.quaternion),
  24217. this.previousState.mouse.copy(this.mouse),
  24218. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  24219. this.previousState.currentFloor = this.model.currentFloor,
  24220. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  24221. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  24222. this.previousState.mode = this.mode,
  24223. this.previousState.modelPosition.copy(this.model.position),
  24224. this.previousState.modelCenter.copy(this.model.center),
  24225. this.previousState.zoomLevel = this.zoomLevel,
  24226. !t
  24227. }
  24228. ,
  24229. n.prototype.updateIntersect = function(o) {//xzw
  24230. /* if(!o || !o.notTag){ //稍后再改
  24231. var n = !this.flying && this.started && !this.flyingToTag;
  24232. var m = this.tagManager.findIntersectTag(this.mouse, n, this.camera);
  24233. if(m){ this.reticule.visible = false; return;}
  24234. }
  24235. */
  24236. var e = this.flying || this.isWarping()
  24237. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  24238. , i = y.getById(V.LookTransition)
  24239. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  24240. this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),
  24241. this.intersect && this.updateClosestPano(this.intersect),
  24242. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  24243. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide())
  24244. }
  24245. ,
  24246. n.prototype.getMouseDirection = function(e) {
  24247. e = e || this.mouse;
  24248. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  24249. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  24250. return i.sub(t).normalize()
  24251. }
  24252. ,
  24253. n.prototype.getMouseIntersect = function(e, t) {
  24254. e = e || this.mouse.clone(),
  24255. t = t || this.model.floors.reduce(function(e, t) {
  24256. return t.hidden ? e : e.concat(t.collider.children)
  24257. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  24258. if(this.mode === u.PANORAMA)t = t.concat([this.model.skybox]);//xzw add 为了加热点时 没有模型的地方都能加 以及任何地方点击都能走动
  24259. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  24260. this.raycaster.set(i, this.getMouseDirection(e));
  24261. var n = this.raycaster.intersectObjects(t);
  24262. if (0 === n.length){
  24263. return null;
  24264. }
  24265. var o = n[0];
  24266. if (o.face) {
  24267. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  24268. var a = this.position.clone().sub(o.point);
  24269. a.dot(o.normal) < 0 && o.normal.negate(),
  24270. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  24271. o.horizontal = o.normal.y > .8
  24272. }
  24273. return o
  24274. }
  24275. ,
  24276. /* n.prototype.updateClosestPano = function(e) { //--MP
  24277. var t = [s.filters.isPanoAligned()];
  24278. if (this.mode === u.PANORAMA) {
  24279. if (!this.currentPano)
  24280. return;
  24281. t.push(s.filters.not(this.currentPano)),
  24282. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  24283. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  24284. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  24285. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  24286. } else
  24287. t.push(s.filters.isOnVisibleFloor()),
  24288. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  24289. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  24290. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  24291. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  24292. this.closestPano = i) : this.isPanoHover = !1
  24293. } */
  24294. n.prototype.updateClosestPano = function(e) {//xzw 改
  24295. if(!e.normal)return;//有时候天花板没有normal
  24296. var t = [s.filters.isPanoAligned()],fu, posget1, posget2;
  24297. if(this.markspot && this.posGets.length == 1 ){//如果在snap热点的话
  24298. posget1 = true;
  24299. fu = function(o){
  24300. return this.disablePanos.indexOf(o)==-1;
  24301. }.bind(this)
  24302. }else if(this.markspot && this.posGets.length == 2 ){
  24303. posget2 = true;
  24304. fu = function(o){
  24305. return this.posGets.list.indexOf(o.id)>-1;
  24306. }.bind(this)
  24307. }
  24308. else{
  24309. fu = s.filters.isNeighbourPanoTo(this.currentPano)
  24310. }
  24311. if (this.mode === u.PANORAMA) {
  24312. if (!this.currentPano) return;
  24313. t.push(s.filters.not(this.currentPano)),
  24314. t.push(fu),//add
  24315. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  24316. //t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  24317. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  24318. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  24319. } else
  24320. t.push(s.filters.isOnVisibleFloor()),
  24321. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  24322. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  24323. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  24324. this.emit(w.ClosestPanoChanging, this.closestPano, i, this, posget1,posget2),
  24325. this.closestPano = i) : this.isPanoHover = !1
  24326. },
  24327. n.prototype.dollhouseMode = function(e, t) {
  24328. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  24329. this.mode = u.DOLLHOUSE,
  24330. this.cameraControls.controls[u.DOLLHOUSE].reset();
  24331. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  24332. , n = new r.Vector3(15,10,15);
  24333. if (e && t) {
  24334. var o = d.FORWARD.clone().applyQuaternion(t)
  24335. , a = this.model.center.clone().sub(e)
  24336. , s = a.dot(o);
  24337. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  24338. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  24339. }
  24340. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  24341. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  24342. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  24343. this.updateFromControls(),
  24344. this.model.alpha = 1,
  24345. this.model.skybox.material.uniforms.opacity.value = 0
  24346. }
  24347. ,
  24348. n.prototype.insideMode = function(e, t) {
  24349. var i = $.Deferred()
  24350. , n = t || null;
  24351. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  24352. var r = [s.filters.isPanoAligned()];
  24353. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  24354. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  24355. this.flyToNewMode({
  24356. mode: u.PANORAMA,
  24357. pano: e,
  24358. callback: n
  24359. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  24360. } else {
  24361. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  24362. i.reject(o)
  24363. }
  24364. return i.promise()
  24365. }
  24366. ,
  24367. n.prototype.fitDollhouse = function(e, t, i) {
  24368. var n = d.FORWARD.clone().applyQuaternion(i);
  24369. this.cameraControls.activeControl.target.copy(n).add(e);
  24370. var o = d.RIGHT.clone().applyQuaternion(i)
  24371. , a = d.UP.clone()
  24372. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  24373. , l = this.model.boundingBox.max.clone()
  24374. , c = this.model.boundingBox.min.clone()
  24375. , 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)]
  24376. , u = 0
  24377. , p = 0
  24378. , g = 0;
  24379. h.forEach(function(e, t, i) {
  24380. var n = Math.abs(e.dot(o))
  24381. , r = e.dot(s);
  24382. n > u && (u = n,
  24383. p = r),
  24384. r > g && (g = r)
  24385. });
  24386. 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)))
  24387. , v = s.clone().multiplyScalar(p).add(t)
  24388. , A = s.clone().multiplyScalar(g).add(t);
  24389. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180)),
  24390. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180)),
  24391. p = Math.max(p, 10),
  24392. g = Math.max(g, 10);
  24393. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  24394. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  24395. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1,
  24396. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p)) : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  24397. }
  24398. ,
  24399. n.prototype.floorplanMode = function(e, t, i) {
  24400. this.mode = u.FLOORPLAN;
  24401. var n = this.cameraControls.controls[u.FLOORPLAN];
  24402. n.reset();
  24403. var r = e ? e : this.model.center;
  24404. if (n.target.copy(r).setY(0),
  24405. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  24406. i ? (n.currentScale = i / ($('#player').width()/$('#player').height()),
  24407. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  24408. t) {
  24409. var o = d.LEFT.clone().applyQuaternion(t);
  24410. n.rotateLeft(-Math.atan2(o.x, o.z))
  24411. } else
  24412. n.rotateToView(this.model.size, this.getDirection());
  24413. n.update(0)
  24414. }
  24415. ,
  24416. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  24417. return e.skipWarpingCheck = !0,
  24418. this.flyToPano(e, t)
  24419. }
  24420. ,
  24421. n.prototype.flyToPano = function(e, t) {//xzw大改
  24422. var i = e.pano
  24423. , n = e.lookAtPoint
  24424. , o = e.duration
  24425. , a = e.aimDuration
  24426. , s = e.maxDistanceOverride
  24427. , l = e.skipWarpingCheck
  24428. , c = e.constantMoveSpeed
  24429. , h = null
  24430. , p = null
  24431. , force = e.force; //xzw
  24432. if(this.markspot){ //xzw 加热点中
  24433. if( this.posGets.length==2 && !this.posGets[i.id] ){
  24434. //editor.tipWrite("定位热点期间,只能在已选的两个位置间移动,请直接点击“位置1”和“位置2”来切换位置。","warn");
  24435. return;
  24436. }else{
  24437. for(var j=0; j<this.posGets.length;j++){
  24438. if(this.posGets.list[j] == i.id){
  24439. if(editor.pointsElem[j].clientHeight)dom.addClass(editor.pointsElem[j],"chosen");
  24440. else dom.addClass(editor.pointsElem2[j],"chosen");
  24441. this.markspot.pos3d = this.posGets[i.id];
  24442. }
  24443. else{
  24444. if(editor.pointsElem[j].clientHeight)dom.removeClass(editor.pointsElem[j],"chosen");
  24445. else dom.removeClass(editor.pointsElem2[j],"chosen");
  24446. }
  24447. }
  24448. }
  24449. }
  24450. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  24451. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  24452. t && t(),
  24453. !1;
  24454. if (this.updateLastView(),
  24455. this.mode !== u.PANORAMA) {
  24456. var m;
  24457. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  24458. void this.flyToNewMode({
  24459. mode: u.PANORAMA,
  24460. pano: i,
  24461. duration: o,
  24462. quaternion: m,
  24463. callback: t
  24464. }), editor.openPanel(3);//xzw add
  24465. }
  24466. if (!i || (h = g.deepExtend(e),
  24467. p = function() {
  24468. N.delayOneFrame(function() {
  24469. this.flyToPano(h, t)
  24470. }
  24471. .bind(this))
  24472. }
  24473. .bind(this),
  24474. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  24475. var C = function(e) {
  24476. t && t(e)
  24477. }
  24478. .bind(this);
  24479. this.currentPano || (this.currentPano = i,
  24480. this.path.placeCpm(),
  24481. this.path.fadeOutCpm(f.path.fadeOutTime),
  24482. this.spider.draw());
  24483. var I = o;
  24484. if ("number" != typeof o) {
  24485. var E = s || f.transition.flytimeMaxDistanceThreshold;
  24486. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  24487. }
  24488. if(force)I *= 0.75;//xzw
  24489. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  24490. 1 !== this.zoomLevel)
  24491. switch (f.zoom.transitionStyle) {
  24492. case 1:
  24493. this.smoothZoomToDefault(I / 2);
  24494. break;
  24495. case 2:
  24496. return h = g.deepExtend(e),
  24497. p = this.flyToPano.bind(this, h, t),
  24498. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  24499. }
  24500. if (n) {
  24501. y.cancelById(V.LookTransition);
  24502. I *= f.transition.aimSlowFactor;
  24503. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  24504. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  24505. , T = (new r.Quaternion).setFromRotationMatrix(_)
  24506. , S = b.clone()
  24507. , M = new r.Vector3;
  24508. if (i === this.currentPano) {
  24509. var R = d.FORWARD.clone().applyQuaternion(b)
  24510. , P = d.FORWARD.clone().applyQuaternion(T)
  24511. , O = R.angleTo(P);
  24512. //return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3), //--MP
  24513. var speed = force ? f.tags.navigate.rotateSpeedFactor * 1.5 : f.tags.navigate.rotateSpeedFactor;
  24514. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / speed * 1e3),
  24515. void y.start(function(ee) {//旋转镜头对准billboard
  24516. if(this.mode != u.PANORAMA){//提早结束 xzw
  24517. y.cancelById(V.LookTransition);
  24518. C(e);
  24519. return;
  24520. }
  24521. S.copy(b),
  24522. v.quaternion(S, T)(ee),
  24523. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  24524. this.cameraControls.activeControl.lookAt(M)
  24525. }
  24526. .bind(this), c?a*0.9:a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  24527. }
  24528. }
  24529. if (i === this.currentPano || this.flying)
  24530. return void C();
  24531. this.flying = !0;
  24532. var L = this.position.clone()
  24533. , D = this.currentPano;
  24534. F.debug("Flying to pano ", i.position),
  24535. this.emit(w.PanoChosen, this.currentPano, i),//触发 setProjectedPanos
  24536. this.emit(w.FlyingStarted, i.position, L, i, D);
  24537. n && y.start(function(ee) {//过渡的同时旋转镜头
  24538. if( this.mode != u.PANORAMA){//提早结束 xzw
  24539. y.cancelById(V.LookTransition);
  24540. C(e);
  24541. return;
  24542. }
  24543. S.copy(b),
  24544. v.quaternion(S, T)(ee),
  24545. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  24546. this.cameraControls.activeControl.lookAt(M)
  24547. }.bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  24548. //xzw:
  24549. for(var j in this.model.panos.dict){// 过渡时为false的会滑动
  24550. this.model.panos.dict[j].marker.material.depthTest = true
  24551. }
  24552. //地标变化
  24553. this.model.floorLogoFade(0, I, 0.7);
  24554. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(i.model.position));
  24555. this.model.floorLogos[1].material.uniforms.opacity.value = 0;
  24556. this.model.floorLogos[1].visible = true;
  24557. /* this.modeTran.split("-")[1] == h.PANORAMA && */(this.model.floorLogoShow(1,250));
  24558. //如果有墙 就不显示模型
  24559. if(this.currentPano.noBlocks==void 0 || this.currentPano.noBlocks.indexOf(i.id)>-1|| isSpecialScene){
  24560. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano)
  24561. }else{
  24562. for(var j=0; j<this.model.chunks.length; j++){
  24563. this.model.chunks[j].visible = false; //这个会使floorlogo出现延迟
  24564. }
  24565. }
  24566. this.tagManager.updateVisible("panorama",i); //更新热点显示
  24567. //--end
  24568. var B = c ? null : A[f.transition.movementEasing];
  24569. this.nextPano = i,
  24570. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  24571. //y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  24572. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  24573. //xzw:
  24574. if(this.mode == u.PANORAMA){
  24575. //this.model.floorLogo.visible = true;
  24576. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  24577. this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  24578. this.model.floorLogos[1].visible = false;
  24579. }
  24580. for(var j=0; j<this.model.chunks.length; j++){
  24581. this.model.chunks[j].visible = true;
  24582. this.model.chunks[j].material.uniforms.progress && (this.model.chunks[j].material.uniforms.progress.value = 1);
  24583. }
  24584. //xzw----end
  24585. this.flying = !1,
  24586. this.currentPano !== i && this.currentPano.exit(),
  24587. i.enter(),
  24588. this.currentPano = i,
  24589. this.nextPano = null,
  24590. this.path.placeCpm(),
  24591. this.path.fadeOutCpm(f.path.fadeOutTime),
  24592. this.spider.draw(),
  24593. this.emit(w.FlyingEnded, i.position, L, i, D),
  24594. this.model.fadePanoMarkers(null,null,{player:this});//xzw 改了参数
  24595. C(e)
  24596. }
  24597. .bind(this), 0, B, "camFly", V.FlyToPano)
  24598. }
  24599. }
  24600. ,
  24601. n.prototype.flytoTag = function(tag, force) {//xzw 飞向热点 一般由列表点击触发
  24602. if(this.tagManager.activeTag && this.tagManager.activeTag != tag) {
  24603. this.tagManager.dismissActiveTag();
  24604. }
  24605. /* if(this.tagManager.activeTag && this.tagManager.activeTag != tag && this.tagManager.tagState == "examine"){
  24606. this.tagManager.dismissActiveTag(); console.log("dismissActiveTag")
  24607. } */
  24608. //setTimeout(function(){
  24609. this.tagManager.activateTag(tag, "examine");//"browse"
  24610. tag.updateBoardOrient = true;
  24611. tag.examine(this, force );
  24612. //}.bind(this),200)
  24613. }
  24614. n.prototype.updateMarkerDisplay = function(){ //xzw 更新marker显示
  24615. return;
  24616. for(var i in this.model.panos.index){//是邻近点就显示否则隐藏
  24617. var pano = this.model.panos.index[i];
  24618. var ma = pano.marker;
  24619. var op = f['panorama'].markerOpacity;
  24620. if(this.mode != u.PANORAMA){
  24621. y.start(v.property(ma.material, "opacity", 0), f.markerOpacityTransitionTime);
  24622. continue;
  24623. }
  24624. if(this.markspot && this.posGets.length == 1){ //正在采集热点 且只有一个位置 只能显示可以走的点
  24625. if(this.disablePanos.indexOf(pano)>-1){
  24626. ma.material.depthTest = true
  24627. if(ma.material.opacity>0)m.start(p.property(ma.material, "opacity", 0), 250)
  24628. }else{
  24629. ma.material.depthTest = false
  24630. if(ma.material.opacity<v)m.start(p.property(ma.material, "opacity", v), 250)
  24631. }
  24632. }else if(this.markspot && this.posGets.length == 2){ //正在采集热点 且有两个位置 只能显示两个位置
  24633. if(this.posGets.list.indexOf(i)>-1){
  24634. ma.material.depthTest = false
  24635. if(ma.material.opacity<v)m.start(p.property(ma.material, "opacity", v), 250)
  24636. }else{
  24637. ma.material.depthTest = true
  24638. if(ma.material.opacity>0)m.start(p.property(ma.material, "opacity", 0), 250)
  24639. }
  24640. }else{
  24641. if(this.currentPano.seeMarkers.indexOf(i)>-1){
  24642. ma.material.depthTest = false
  24643. if(ma.material.opacity<v)m.start(p.property(ma.material, "opacity", v), 250)
  24644. }else{
  24645. ma.material.depthTest = true
  24646. if(ma.material.opacity>0)m.start(p.property(ma.material, "opacity", 0), 250)
  24647. }
  24648. }
  24649. }
  24650. },
  24651. n.prototype.fastForwardActivePanoFlight = function(e) {
  24652. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  24653. y.adjustSpeed(V.FlyToPano, e),
  24654. y.adjustSpeed(V.LookTransition, e)
  24655. }
  24656. ,
  24657. n.prototype.flyToPanoClosestToMouse = function() {
  24658. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  24659. this.intersect && this.updateClosestPano(this.intersect)),
  24660. this.closestPano)
  24661. return this.flyToPano({
  24662. pano: this.closestPano
  24663. });
  24664. var e = this.getMouseDirection();
  24665. this.flyDirection(e) || this.flyToPano({
  24666. pano: this.currentPano
  24667. })
  24668. }
  24669. ,
  24670. n.prototype.flyLocalDirection = function(e) {
  24671. var t = this.getDirection(e)
  24672. , i = 1 === e.z ? .4 : .75
  24673. , n = 1 === Math.abs(e.x);
  24674. return this.flyDirection(t, i, n)
  24675. }
  24676. ,
  24677. n.prototype.flyDirection = function(e, t, i) {
  24678. if(this.tagManager.activeTag) this.tagManager.dismissActiveTag(); //xzw add 因为panochange处的被我去掉了
  24679. var n = $.Deferred();
  24680. this.history.invalidate();
  24681. var r = this.closestPanoInDirection(e, t, i);
  24682. return r ? this.flyToPano({
  24683. pano: r
  24684. }, n.resolve.bind(n, !0)) : (this.bump(e),
  24685. n.resolve(!1)),
  24686. n.promise()
  24687. }
  24688. ,
  24689. n.prototype.closestPanoInDirection = function(e, t, i) {
  24690. return this.rankedPanoInDirection(0, e, t, i)
  24691. }
  24692. ,
  24693. /* n.prototype.rankedPanoInDirection = function() {//MP
  24694. var e = {
  24695. pano: null,
  24696. candidates: []
  24697. };
  24698. return function(t, i, n, r) {
  24699. t || (t = 0),
  24700. n = void 0 !== n ? n : .75;
  24701. var o = r ? "angle" : "direction";
  24702. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  24703. this.cachedPanoCandidates = e.candidates,
  24704. e.pano
  24705. }
  24706. }(), */
  24707. n.prototype.rankedPanoInDirection = function() {//xzw改
  24708. var e = {
  24709. pano: null,
  24710. candidates: []
  24711. };
  24712. return function(t, i, n, r) {
  24713. var o = r ? "angle" : "direction";
  24714. var list1 = [
  24715. s.filters.isPanoAligned(),
  24716. s.filters.inPanoDirection(this.position, i, n),
  24717. s.filters.not(this.currentPano)
  24718. ]
  24719. var list2 = [
  24720. s.scoreFunctions.distanceSquared(this.currentPano),
  24721. s.scoreFunctions[o](this.position, i)
  24722. ]
  24723. if(this.markspot && this.posGets.length == 1 ){//如果在snap热点的话
  24724. var f = function(disablePanos){
  24725. return function(o){
  24726. return disablePanos.indexOf(o)==-1;
  24727. }
  24728. }
  24729. list1.push( f(this.disablePanos) )
  24730. }else if(this.markspot && this.posGets.length == 2 ){
  24731. var f = function(panolist){
  24732. return function(o){
  24733. return panolist.indexOf(o.id)>-1;
  24734. }
  24735. }
  24736. list1.push( f(this.posGets.list) )
  24737. }else{
  24738. list1.push( s.filters.isNeighbourPanoTo(this.currentPano) );
  24739. }
  24740. t || (t = 0),
  24741. n = void 0 !== n ? n : .75;
  24742. return this.model.panos.findRankedByScore(t, list1, list2, e),
  24743. this.cachedPanoCandidates = e.candidates,
  24744. e.pano
  24745. }
  24746. }()
  24747. ,
  24748. n.prototype.bump = function(e) {
  24749. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  24750. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  24751. if (s)
  24752. t = function() {
  24753. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  24754. }
  24755. .bind(this),
  24756. i = function() {
  24757. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  24758. }
  24759. .bind(this);
  24760. else {
  24761. var l = this.camera.position.clone()
  24762. , c = e.clone();
  24763. this.raycaster.set(l, c);
  24764. var h = this.model.floors.reduce(function(e, t) {
  24765. return e.concat(t.collider.children)
  24766. }, [])
  24767. , d = this.raycaster.intersectObjects(h)
  24768. , p = d.length > 0 ? d[0].distance / 25 : .04
  24769. , g = l.clone().add(c.multiplyScalar(p));
  24770. t = function() {
  24771. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  24772. }
  24773. .bind(this),
  24774. i = function() {
  24775. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  24776. }
  24777. .bind(this)
  24778. }
  24779. n = function() {
  24780. this.flying = !1
  24781. }
  24782. .bind(this),
  24783. this.flying = !0,
  24784. t()
  24785. }
  24786. }
  24787. ,
  24788. n.prototype.changeFloor = function(e) {
  24789. if (!this.is360View(this.mode, this.currentPano))
  24790. if (this.mode === u.PANORAMA) {
  24791. var t = this.history.reversePano(e);
  24792. t && t.isAligned() ? this.flyToPano({
  24793. pano: t
  24794. }) : this.changeFloorByScore(e)
  24795. } else
  24796. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  24797. }
  24798. ,
  24799. n.prototype.changeFloorByScore = function() {
  24800. var e = {
  24801. pano: null,
  24802. candidates: []
  24803. };
  24804. return function(t) {
  24805. var i = this.model.nextFloor(t);
  24806. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  24807. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  24808. this.history.push(t, this.currentPano),
  24809. this.flyToPano({
  24810. pano: e.pano
  24811. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  24812. }
  24813. }(),
  24814. n.prototype.gotoFloor = function(e) {
  24815. var t = e - this.model.currentFloor.floorIndex;
  24816. this.changeFloor(t)
  24817. }
  24818. ,
  24819. n.prototype.getDirection = function(e) {
  24820. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  24821. e.applyQuaternion(this.camera.quaternion)
  24822. }
  24823. ,
  24824. n.prototype.setEntry = function(){//xzw 设置初始视角
  24825. if(this.mode != u.PANORAMA) return;
  24826. this.EntryInfo = [this.currentPano.id, this.quaternion.clone(), this.cameraControls.activeControl.lon, this.cameraControls.activeControl.lat];
  24827. }
  24828. ,
  24829. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  24830. if (o = o || $.Deferred(),
  24831. this.mode === u.TRANSITIONING)
  24832. return F.warn("should not be transitioning here"),
  24833. n && n(!1),
  24834. o.reject().promise();
  24835. var a = i || !1
  24836. , s = i ? i.position : this.position
  24837. , l = this.position.clone()
  24838. , c = this.currentPano;
  24839. if (F.debug("New pose in mode " + this.mode),
  24840. !e || (retryCallback = function() {
  24841. N.delayOneFrame(function() {
  24842. this.flyToSameMode(e, t, i, n, o)
  24843. }
  24844. .bind(this))
  24845. }
  24846. .bind(this),
  24847. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  24848. var h = function() {
  24849. this.emit(w.FlyingEnded, s, l, e, c),
  24850. n && n(!0)
  24851. }
  24852. .bind(this)
  24853. , d = f[this.mode]
  24854. , p = void 0 !== t ? t : d.transitionTime
  24855. , g = new r.Vector3
  24856. , C = new r.Vector3;
  24857. if (this.emit(w.FlyingStarted, s, l, e, c),
  24858. this.mode === u.PANORAMA)
  24859. F.warn("we should not be here for panorama views");
  24860. else if (this.mode === u.DOLLHOUSE)
  24861. if (a) {
  24862. var I = new r.Vector3(0,1,0);
  24863. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  24864. this.model.warpDestFloors(i.floorVisibility),
  24865. C.copy(i.position);
  24866. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  24867. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  24868. , _ = b.intersectObjects(this.model.colliders)
  24869. , T = 3;
  24870. _.length ? (g.copy(_[0].point),
  24871. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  24872. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  24873. var x = (new r.Matrix4).lookAt(C, g, I)
  24874. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  24875. , M = g.distanceTo(C)
  24876. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  24877. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  24878. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  24879. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  24880. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  24881. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  24882. this.path.burnsDir = Math.sign(L.y);
  24883. var D = new r.Euler(0,0,0,f.warp.eOrder)
  24884. , B = new r.Vector3;
  24885. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  24886. y.start(function(e, t) {
  24887. D.x = P.x + e * L.x,
  24888. D.y = P.y + e * L.y,
  24889. D.z = P.z + e * L.z;
  24890. var i = O + e * (M - O);
  24891. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  24892. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  24893. }
  24894. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  24895. y.start(function(e, t) {
  24896. this.cameraControls.controls[u.DOLLHOUSE].update(),
  24897. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  24898. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  24899. }
  24900. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  24901. } else
  24902. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  24903. else if (this.path.placeCpm(),
  24904. this.path.fadeInCpm(f.path.fadeInTime),
  24905. i) {
  24906. this.model.warpDestFloors(i.floorVisibility);
  24907. var U = this.cameraControls.cameras[u.FLOORPLAN]
  24908. , k = this.cameraControls.controls[u.FLOORPLAN]
  24909. , H = k.target.clone()
  24910. , G = i.position.clone().sub(H)
  24911. , z = U.position.clone().sub(k.target)
  24912. , W = z.length()
  24913. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  24914. , Y = Math.atan2(k.offset.x, k.offset.z)
  24915. , X = Math.atan2(j.x, j.z)
  24916. , Z = k.absoluteScale
  24917. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  24918. y.start(function(e, t) {
  24919. k.target.copy(G).multiplyScalar(e).add(H);
  24920. var i = Y + (X - Y) * e;
  24921. k.offset.x = W * Math.sin(i),
  24922. k.offset.z = W * Math.cos(i),
  24923. U.position.copy(k.target).add(k.offset),
  24924. k.absoluteScale = Z + e * (q - Z),
  24925. k.update(),
  24926. this.quaternion.copy(U.quaternion),
  24927. this.position.copy(U.position),
  24928. this.target.copy(k.target),
  24929. this.camera.projectionMatrix.copy(U.projectionMatrix)
  24930. }
  24931. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  24932. } else
  24933. F.info("flyToSameMode() funny floorplan view? skipping");
  24934. return y.setTimeout(function(e) {
  24935. this.mode = e,
  24936. h(),
  24937. o.resolve(!0)
  24938. }
  24939. .bind(this, this.mode), p, V.FlyToSameMode),
  24940. this.mode = u.TRANSITIONING,
  24941. o.promise()
  24942. }
  24943. }
  24944. ,
  24945. n.prototype.beforeChangeMode = function(from, to, toPano){ //xzw加 当模式转换前要执行的
  24946. if(from == u.PANORAMA){
  24947. editor.changeSnapState(false);
  24948. editor.changePosCancel();//这个是清除位置修改的操作,一定要在下面那个前执行
  24949. editor.clearCollect();
  24950. this.tagManager.updateVisible();//更新热点显示
  24951. this.model.floorLogos[0].visible = false;
  24952. this.model.floorLogos[1].visible = false;
  24953. }else if(from == u.FLOORPLAN){
  24954. //layer.menu.removeNotebox(false) //标签编辑框消失
  24955. }
  24956. if(to == u.PANORAMA){
  24957. this.model.floorLogos[0].position.copy(toPano.floorPosition.clone().sub(this.model.position));//改
  24958. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  24959. }
  24960. }
  24961. ,
  24962. n.prototype.afterChangeMode = function(from, to){//xzw加 当模式转换后要执行的
  24963. if(to == u.PANORAMA){
  24964. editor.changeSnapState(true);
  24965. this.model.floorLogos[0].visible = true;
  24966. this.model.floorLogos[0].material.uniforms.opacity.value = 0;
  24967. this.model.floorLogoShow(0,150);
  24968. this.model.fadePanoMarkers(null,null,{player:this})
  24969. //this.model.skybox.material.transparent = !1;//如果skybox透明,会让其中其他mesh的透明出问题
  24970. }else{
  24971. //this.model.skybox.material.transparent = !0;
  24972. }
  24973. }
  24974. ,
  24975. n.prototype.flyToNewMode = function(e, t) {
  24976. e = e || {};
  24977. var i = e.mode
  24978. , n = e.pano
  24979. , o = e.duration
  24980. , a = e.warpDest
  24981. , s = e.callback
  24982. , l = e.force
  24983. , c = e.quaternion;
  24984. if (t = t || $.Deferred(),
  24985. this.isWarping())
  24986. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  24987. s && s(!1),
  24988. t.reject("Cannot change mode during tour transition").promise();
  24989. if (this.mode === u.TRANSITIONING)
  24990. return s && s(!1),
  24991. t.reject("Cannot change mode during mode transition").promise();
  24992. if (i === this.mode)
  24993. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  24994. t.promise()) : (s && s(!1),
  24995. t.reject("Already in " + i + " mode").promise());
  24996. var h = a || !1;
  24997. F.debug("Switching mode to " + i);
  24998. var d = function() {
  24999. N.delayOneFrame(function() {
  25000. this.flyToNewMode(e, t)
  25001. }
  25002. .bind(this))
  25003. }
  25004. .bind(this);
  25005. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  25006. return t.promise();
  25007. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  25008. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  25009. this.model.waitForLoad(this.model, function() {
  25010. return this.model.meshTexturesLoaded;
  25011. }
  25012. .bind(this)),
  25013. this.model.loadMeshTextures().done(d),
  25014. t.promise();
  25015. this.history.invalidate(),
  25016. this.updateLastView();
  25017. var p = this.mode
  25018. , C = this.cameraControls.cameras[i];
  25019. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  25020. //xzw
  25021. this.modeTran = p + "-" + i;
  25022. this.beforeChangeMode(p, i, n);
  25023. //end
  25024. var I = void 0 !== o ? o : e.transitionTime;
  25025. this.emit(w.ModeChanging, p, i, n);
  25026. n && (this.currentPano = n);
  25027. this.switchCameraMode(i, c);
  25028. y.cancelById(V.LookTransition);
  25029. var _ = (new r.Vector3).copy(this.position);
  25030. if (i === u.PANORAMA)
  25031. this.emit(w.PanoChosen, n, n),
  25032. setTimeout(function() {
  25033. n.floor.enter(i)
  25034. }
  25035. .bind(this), I / 2),
  25036. this.path.fadeOutCpm(f.path.fadeOutTime);
  25037. else if (i === u.DOLLHOUSE) {
  25038. if (h && (this.model.stayPut = !0),
  25039. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  25040. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  25041. this.path.placeCpm(),
  25042. this.path.fadeInCpm(f.path.fadeInTime),
  25043. h) {
  25044. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  25045. _.set(15, 10, 15);
  25046. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  25047. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  25048. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  25049. P.length ? (T.copy(P[0].point),
  25050. _.copy(a.position),
  25051. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  25052. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  25053. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  25054. _.add(this.model.position),
  25055. C.position.copy(_),
  25056. this.cameraControls.controls[u.DOLLHOUSE].update()
  25057. }
  25058. } else if (this.path.placeCpm(),
  25059. this.path.fadeInCpm(f.path.fadeInTime),
  25060. a) {
  25061. this.model.warpDestFloors(a.floorVisibility);
  25062. var O = this.cameraControls.cameras[u.FLOORPLAN]
  25063. , L = this.cameraControls.controls[u.FLOORPLAN]
  25064. , D = O.position.clone().sub(L.target)
  25065. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  25066. , U = Math.atan2(B.x, B.z);
  25067. L.target.copy(a.position);
  25068. var k = D.length();
  25069. L.offset.x = k * Math.sin(U),
  25070. L.offset.y = 0,
  25071. L.offset.z = k * Math.cos(U),
  25072. O.position.copy(L.target).add(L.offset);
  25073. L.target.clone().sub(C.position);
  25074. C.quaternion.copy(a.quaternion),
  25075. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  25076. L.absoluteScale = L.currentScale,
  25077. L.update()
  25078. } else
  25079. this.model.currentFloor.enter(i);
  25080. var H = this.currentPano
  25081. , G = this.position.clone();
  25082. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  25083. this.flying = !0,
  25084. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  25085. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  25086. C.controls.update()),
  25087. e.blackoutStyle = S.FADEIN,
  25088. I = f.show360Views.transitionTime,
  25089. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  25090. this.mode = i,
  25091. this.path && this.path.popOutCpm(),
  25092. e.blackoutStyle = S.END,
  25093. I = f.show360Views.transitionTime,
  25094. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  25095. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  25096. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  25097. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  25098. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  25099. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  25100. y.setTimeout(function() {
  25101. this.flying = !1,
  25102. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  25103. this.currentPano.enter(),
  25104. this.path.placeCpm(),
  25105. this.path.fadeOutCpm(f.path.fadeOutTime),
  25106. this.spider.draw()),
  25107. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  25108. this.mode = i,
  25109. this.afterChangeMode(p,i)//xzw
  25110. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  25111. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  25112. t.resolve())
  25113. }
  25114. .bind(this), I, V.FlyToNewMode),
  25115. this.mode = u.TRANSITIONING,
  25116. t.promise()
  25117. }
  25118. ,
  25119. n.prototype.fade360View = function(e, t, i) {
  25120. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  25121. $(this.domElement).fadeOut(.5 * e, function() {
  25122. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  25123. this.model.alpha = i.modelAlpha,
  25124. this.position.copy(t.position),
  25125. this.quaternion.copy(t.quaternion),
  25126. this.camera.projectionMatrix.copy(t.projectionMatrix),
  25127. $(this.domElement).fadeIn(.5 * e)
  25128. }
  25129. .bind(this))
  25130. }
  25131. ,
  25132. n.prototype.findDefaultViews = function() {
  25133. this.findDefaultView(this.lastInsideView, !0),
  25134. this.findDefaultView(this.last360View, !1)
  25135. }
  25136. ,
  25137. n.prototype.findDefaultView = function(e, t) {
  25138. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  25139. if (e.cameraMode !== u.PANORAMA)
  25140. return !1;
  25141. var i = r.get(e.panoId);
  25142. return i && i.isAligned() === t
  25143. });
  25144. o >= 0 ? (i = r.get(n[o].panoId),
  25145. e.update({
  25146. cameraMode: u.PANORAMA,
  25147. pano: i,
  25148. position: n[o].position,
  25149. quaternion: n[o].quaternion
  25150. })) : (o = r.list.findIndex(function(e) {
  25151. return e.isAligned() === t
  25152. }),
  25153. o >= 0 ? (i = r.list[o],
  25154. e.update({
  25155. cameraMode: u.PANORAMA,
  25156. pano: i,
  25157. position: i.position
  25158. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  25159. }
  25160. ,
  25161. n.prototype.updateLastView = function() {
  25162. if (this.mode === u.PANORAMA) {
  25163. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  25164. e.update({
  25165. pano: this.currentPano,
  25166. position: this.position,
  25167. quaternion: this.quaternion
  25168. })
  25169. }
  25170. }
  25171. ,
  25172. n.prototype.goToLastView = function(e, t) {
  25173. var i = $.Deferred()
  25174. , n = i.resolve.bind(i)
  25175. , r = i.reject.bind(i)
  25176. , o = e ? this.lastInsideView : this.last360View;
  25177. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  25178. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  25179. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  25180. mode: o.cameraMode,
  25181. pano: o.pano,
  25182. quaternion: o.quaternion,
  25183. callback: t
  25184. }).done(n).fail(r),
  25185. i.promise()
  25186. }
  25187. ,
  25188. n.prototype.fadeToView = function(e, t, i, n) {
  25189. var r = $.Deferred()
  25190. , o = r.resolve.bind(r)
  25191. , a = r.reject.bind(r);
  25192. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  25193. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  25194. a("Cannot go to illegal view"),
  25195. r.promise();
  25196. var s = (f[t.cameraMode],
  25197. function() {
  25198. $(this.domElement).fadeIn(.5 * i),
  25199. n && n(),
  25200. o()
  25201. }
  25202. .bind(this))
  25203. , l = e ? S.FADEIN : S.END;
  25204. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  25205. $(this.domElement).fadeOut(.5 * i, function() {
  25206. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0,{player:this}),//xzw改 加了后两个参数
  25207. t.cameraMode === u.PANORAMA ? this.flyToPano({
  25208. pano: t.pano,
  25209. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  25210. duration: 0
  25211. }, s) : this.flyToNewMode({
  25212. mode: t.cameraMode,
  25213. quaternion: t.quaternion,
  25214. duration: 0,
  25215. callback: s
  25216. })
  25217. }
  25218. .bind(this)),
  25219. r.promise()
  25220. }
  25221. ,
  25222. n.prototype.startWarp = function(e, t, i, n, r, o) {//开始蛇行 向导览点
  25223. //e:v.Show , t: m.Slow, i:black or walk, n,r,? o:fuc
  25224. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  25225. this.flying)
  25226. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  25227. o && o(),
  25228. !1;
  25229. null !== e && void 0 !== e || (e = b.Show),
  25230. this.history.invalidate(),
  25231. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType; //brushToWarpPano ???
  25232. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  25233. this.emit(w.WarpStarted, a, i, n, r);
  25234. n = n || S.MIDDLE;
  25235. this.path.warpToPano(i, n, r, function() {
  25236. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  25237. this.emit(w.WarpEnded, i),
  25238. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  25239. o && o()
  25240. }.bind(this));
  25241. e === b.Hide && this.path.discardPathObject();
  25242. return !0
  25243. }
  25244. ,
  25245. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  25246. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  25247. s && s(),
  25248. !1)
  25249. }
  25250. ,
  25251. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  25252. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  25253. a && a(),
  25254. !1)
  25255. }
  25256. ,
  25257. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  25258. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  25259. }
  25260. ,
  25261. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  25262. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  25263. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  25264. t && t(),
  25265. !1)
  25266. }
  25267. ,
  25268. n.prototype.aimTourCamera = function(e, t, i, n) {
  25269. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  25270. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  25271. }
  25272. ,
  25273. n.prototype.showPathToHeroLocation = function(e) {
  25274. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  25275. }
  25276. ,
  25277. n.prototype.tourInterlude = function(e, t) {
  25278. this.history.invalidate(),
  25279. this.path.discardSlow(),
  25280. this.path.waitNextStep(e, function() {
  25281. t && t()
  25282. }
  25283. .bind(this))
  25284. }
  25285. ,
  25286. n.prototype.stopInterlude = function() {
  25287. this.interruptAndFastForward(null, 0)
  25288. }
  25289. ,
  25290. n.prototype.interruptAndFastForward = function(e, t) {
  25291. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  25292. this.flying && this.emit(w.FlyingInterrupted),
  25293. this.path.interruptAndFastForward(e, t)
  25294. }
  25295. ,
  25296. n.prototype.setSize = function(e, t) {
  25297. var i = e / t;
  25298. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  25299. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  25300. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  25301. for (var r in this.cameraControls.cameras) {
  25302. var o = this.cameraControls.cameras[r];
  25303. o.fov = this.baseFov * (1 / this.zoomLevel),
  25304. o.updateAspect(i)
  25305. }
  25306. if(this.editor && this.editor.scroller){
  25307. for(var i in this.editor.scroller) //xzw add 滑动条更新offset
  25308. this.editor.scroller[i].getOffset(),
  25309. this.editor.scroller[i].moveKnot();
  25310. }
  25311. }
  25312. ,
  25313. n.prototype.toJSON = function() {
  25314. var e = {};
  25315. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  25316. e.camera_mode = u.toInt(this.mode),
  25317. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  25318. return e.hidden ? 0 : 1
  25319. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  25320. e) : e
  25321. }
  25322. ,
  25323. n.prototype.getCurrentNodePanos = function(e) {
  25324. this.model.panos.map;
  25325. if (e.length = 0,
  25326. this.path.nodes)
  25327. for (var t = 0; t < this.path.nodes.length; t++) {
  25328. var i = this.path.nodes[t];
  25329. e.push(this.model.panos.get(i))
  25330. }
  25331. }
  25332. ,
  25333. n.prototype.zoomIncrementally = function(e) {
  25334. var t = this.zoomLevel;
  25335. this.zoomTo(this.zoomLevel + e),
  25336. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  25337. }
  25338. ,
  25339. n.prototype.zoomInIncrementally = function(e) {
  25340. e = e || this.defaultZoomIncrement,
  25341. this.zoomIncrementally(e)
  25342. }
  25343. ,
  25344. n.prototype.zoomOutIncrementally = function(e) {
  25345. e = e || -this.defaultZoomIncrement,
  25346. this.zoomIncrementally(e)
  25347. }
  25348. ,
  25349. n.prototype.zoomBy = function(e) {
  25350. this.zoomTo(this.zoomLevel * e)
  25351. }
  25352. ,
  25353. n.prototype.zoomIn = function() {
  25354. this.zoomBy(1 + this.zoomSpeed)
  25355. }
  25356. ,
  25357. n.prototype.zoomOut = function() {
  25358. this.zoomBy(1 - this.zoomSpeed)
  25359. }
  25360. ,
  25361. n.prototype.zoomTo = function(e, t) {
  25362. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  25363. if (e < f.zoom.min && (e = f.zoom.min),
  25364. e > f.zoom.max && (e = f.zoom.max),
  25365. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  25366. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  25367. e === f.zoom.min && this.emit(O.ZoomMin)),
  25368. this.cameraControls.activeControl) {
  25369. var i = this.cameraControls.activeControl.camera;
  25370. this.zoomLevel = e,
  25371. i.fov = this.baseFov * (1 / this.zoomLevel),
  25372. i.updateProjectionMatrix(),
  25373. this.zoomFov = i.fov
  25374. }
  25375. }
  25376. }
  25377. ,
  25378. n.prototype.increaseZoomSpeed = function() {
  25379. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  25380. }
  25381. ,
  25382. n.prototype.decreaseZoomSpeed = function() {
  25383. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  25384. }
  25385. ,
  25386. n.prototype.clampZoomSpeed = function(e) {
  25387. return e < 0 ? 0 : e
  25388. }
  25389. ,
  25390. n.prototype.activatePersistentZooming = function(e) {
  25391. this.zooming = e ? 1 : -1
  25392. }
  25393. ,
  25394. n.prototype.deactivatePersistentZooming = function() {
  25395. this.zooming = 0
  25396. }
  25397. ,
  25398. n.prototype.zoomDefault = function() {
  25399. this.zoomTo(1, !0)
  25400. }
  25401. ,
  25402. n.prototype.smoothZoomToDefault = function(e, t) {
  25403. var i, n = this.zoomLevel, r = function(e) {
  25404. e > 1 && (e = 1),
  25405. i = n * (1 - e) + e,
  25406. this.zoomTo(i, !0)
  25407. }
  25408. .bind(this), o = function() {
  25409. this.zoomDefault(),
  25410. t && window.setTimeout(t, 50)
  25411. }
  25412. .bind(this);
  25413. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  25414. }
  25415. ,
  25416. n.prototype.updateZoomPano = function() {
  25417. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  25418. var e = this.currentPano;
  25419. if (e) {
  25420. var t = this.zoomLevel > f.zoom.activationThreshold
  25421. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  25422. , n = !i && !this.isWarping()
  25423. , r = t && n;
  25424. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  25425. this.panoRenderer.setZoomingActive(r, e, !0);
  25426. var o = function(e, t) {
  25427. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  25428. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  25429. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  25430. e.setZoomed(t)
  25431. }
  25432. .bind(this);
  25433. r && !e.zoomed ? (o(e, !0),
  25434. this.panoRenderer.enableUltraHighQualityMode(function() {
  25435. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  25436. r && o(e, !0)
  25437. }
  25438. .bind(this))) : !t && e.zoomed && o(e, !1)
  25439. }
  25440. }
  25441. }
  25442. ,
  25443. t.exports = n
  25444. }
  25445. ).call(this, "/js/player.js")
  25446. }
  25447. , {
  25448. "./constants": 8,
  25449. "./enum/AlignmentType": 17,
  25450. "./enum/BlackoutStyle": 18,
  25451. "./enum/ControlEvents": 21,
  25452. "./enum/Keys": 30,
  25453. "./enum/ModelManagerEvents": 33,
  25454. "./enum/PanoSizeClass": 36,
  25455. "./enum/PanoramaEvents": 37,
  25456. "./enum/PathDiscardMode": 38,
  25457. "./enum/PathDisplayMode": 39,
  25458. "./enum/PlayerEvents": 40,
  25459. "./enum/TagStates": 44,
  25460. "./enum/Vectors": 50,
  25461. "./enum/Viewmode": 51,
  25462. "./enum/WarpStyle": 52,
  25463. "./enum/ZoomEvents": 53,
  25464. "./exception/BasicException": 55,
  25465. "./model/ModelManager": 140,
  25466. "./objects/NSpider": 147,
  25467. "./objects/Panorama": 148,
  25468. "./objects/Reticule": 149,
  25469. "./objects/ShowPath": 151,
  25470. "./objects/Snapshot": 153,
  25471. "./objects/View": 154,
  25472. "./settings": 166,
  25473. "./shaders": 167,
  25474. "./tile/TileDownloader": 171,
  25475. "./tile/TilePrioritizer": 172,
  25476. "./util/ZoomStats": 179,
  25477. "./util/browser": 182,
  25478. "./util/camera": 183,
  25479. "./util/cameraLight": 184,
  25480. "./util/common": 185,
  25481. "./util/easing": 186,
  25482. "./util/history": 187,
  25483. "./util/lerp": 188,
  25484. "./util/logger": 189,
  25485. "./util/math": 190,
  25486. "./util/transitions": 195,
  25487. events: 202,
  25488. three: 217,
  25489. "Editor":"Editor",
  25490. "Hotspot":"Hotspot",
  25491. "dom":"dom"
  25492. }],
  25493. 156: [function(e, t, i) {//js/preloaders.js
  25494. (function(i) {
  25495. "use strict";
  25496. function n(e, t) {
  25497. this.model = e,
  25498. this.panos = e.panos,
  25499. this.player = t,
  25500. this.imagePanos = this.listImagePanos(),
  25501. this.retryMinimumTime = 1e4
  25502. }
  25503. var r = (e("three"),
  25504. e("./enum/Viewmode"))
  25505. , o = (e("./settings"),
  25506. e("./objects/Panorama"))
  25507. , a = e("./util/logger")
  25508. , s = new a(i);
  25509. n.prototype.start = function() {
  25510. this.loadNextPano(function(e) {
  25511. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  25512. setTimeout(function() {
  25513. this.start()
  25514. }
  25515. .bind(this), 1e3))
  25516. }
  25517. .bind(this))
  25518. }
  25519. ,
  25520. n.prototype.validLoadTarget = function(e) {
  25521. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  25522. }
  25523. ,
  25524. n.prototype.listImagePanos = function() {
  25525. var e = []
  25526. , t = this;
  25527. return this.model.images.forEach(function(i) {
  25528. if (i.metadata && i.metadata.scan_id) {
  25529. var n = t.model.panos.get(i.metadata.scan_id);
  25530. n && !n.isLoaded("high") && e.push(n)
  25531. }
  25532. }),
  25533. e
  25534. }
  25535. ,
  25536. n.prototype.nextNotLoadedImage = function() {
  25537. for (; this.imagePanos.length > 0; ) {
  25538. var e = this.imagePanos[0];
  25539. if (!e.isLoaded("high"))
  25540. return e;
  25541. this.imagePanos.shift()
  25542. }
  25543. return null
  25544. }
  25545. ,
  25546. n.prototype.loadNextPano = function(e) {
  25547. var t, i, n = this.model.waitQueue.filter(function(e) {
  25548. return e.object instanceof o
  25549. });
  25550. n.length > 0 ? (t = n[0].object,
  25551. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  25552. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  25553. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  25554. t = this.imagePanos[0],
  25555. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  25556. t && s.debug("Normal pano selection: neighbor " + t.id)),
  25557. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  25558. s.debug("Preloading " + i + "-res pano " + t.id),
  25559. t.loadCube(i).done(e).fail(function() {
  25560. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  25561. e()
  25562. })) : e && e(null)
  25563. }
  25564. ,
  25565. t.exports = n
  25566. }
  25567. ).call(this, "/js/preloaders.js")
  25568. }
  25569. , {
  25570. "./enum/Viewmode": 51,
  25571. "./objects/Panorama": 148,
  25572. "./settings": 166,
  25573. "./util/logger": 189,
  25574. three: 217
  25575. }],
  25576. 157: [function(e, t, i) {//js/scene/QuickstartManager.js
  25577. (function(i) {
  25578. "use strict";
  25579. function n(e, t, i, n, r) {
  25580. this.qualityManager = e,
  25581. this.scene = t,
  25582. this.camera = i,
  25583. this.container = r,
  25584. this.controls = n,
  25585. this.controls.enabled = !0,
  25586. this.controls.locked = !0,
  25587. this.quickstartCamera = n.camera,
  25588. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $('#player').width() , $('#player').height()),
  25589. this.skybox = null
  25590. }
  25591. var r = e("three")
  25592. , o = e("../util/logger")
  25593. , a = e("../constants")
  25594. , s = (e("../util/transitions"),
  25595. e("../util/lerp"),
  25596. e("../util/easing"),
  25597. e("../enum/Vectors"))
  25598. , l = e("../enum/PanoSizeClass")
  25599. , c = (e("../materials/ModelTextureMaterial"),
  25600. e("../materials/CubemapMaterial"))
  25601. , h = (e("../cameras/PanoramaCamera"),
  25602. e("../controls/PanoramaControls"),
  25603. e("../tile/TileUtils"),
  25604. e("../util/camera"),
  25605. e("../util/cameraLight"))
  25606. , u = (e("../util/browser"),
  25607. e("../settings"),
  25608. e("../gui/helpManager"),
  25609. new o(i));
  25610. n.prototype.load = function(e) {
  25611. e.pano.shouldRedrawOnBaseLoaded = !0;
  25612. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  25613. this.controls.lookAt(r.add(this.quickstartCamera.position));
  25614. var a = this.qualityManager.getPanoSize(l.BASE)
  25615. , c = this.qualityManager.getPanoSize(l.STANDARD);
  25616. if (e.pano.tiled) {
  25617. u.warn("Loading startPano, TILED", e.pano.id);
  25618. var d = h.getHFOVForCamera(this.quickstartCamera, $('#player').width() , $('#player').height())
  25619. , p = this.quickstartCamera.fov;
  25620. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  25621. t = e.pano.loadTiledPano(c, r, {
  25622. hFov: d,
  25623. vFov: p
  25624. }, !1, !1, !0),
  25625. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  25626. } else
  25627. u.warn("Loading startPano", e.pano.id),
  25628. t = e.pano.loadCube("high");
  25629. return $.when(t).then(function() {
  25630. n.init(e.pano, e.quaternion),
  25631. e.pano.tiled ? i.done(function() {
  25632. e.pano.lockUntilRenderingComplete = !1,
  25633. this.controls.locked = !1
  25634. }
  25635. .bind(this)) : this.controls.locked = !1
  25636. }
  25637. .bind(this))
  25638. }
  25639. ,
  25640. n.prototype.init = function(e, t) {
  25641. u.info("Quickstart done loading, adding scene objects"),
  25642. e.lockUntilRenderingComplete = !0,
  25643. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  25644. side: r.BackSide
  25645. })),
  25646. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  25647. this.skybox.quaternion.copy(e.quaternion),
  25648. this.scene.add(this.skybox),
  25649. $(this.container).show()
  25650. }
  25651. ,
  25652. n.prototype.update = function(e) {
  25653. this.controls.update(e),
  25654. this.camera.copy(this.quickstartCamera)
  25655. }
  25656. ,
  25657. n.prototype.setSize = function(e, t) {
  25658. this.quickstartCamera.updateAspect(e / t)
  25659. }
  25660. ,
  25661. n.prototype.destroy = function() {
  25662. this.scene.remove(this.skybox)
  25663. }
  25664. ,
  25665. t.exports = n
  25666. }
  25667. ).call(this, "/js/scene/QuickstartManager.js")
  25668. }
  25669. , {
  25670. "../cameras/PanoramaCamera": 7,
  25671. "../constants": 8,
  25672. "../controls/PanoramaControls": 13,
  25673. "../enum/PanoSizeClass": 36,
  25674. "../enum/Vectors": 50,
  25675. "../gui/helpManager": 68,
  25676. "../materials/CubemapMaterial": 117,
  25677. "../materials/ModelTextureMaterial": 118,
  25678. "../settings": 166,
  25679. "../tile/TileUtils": 174,
  25680. "../util/browser": 182,
  25681. "../util/camera": 183,
  25682. "../util/cameraLight": 184,
  25683. "../util/easing": 186,
  25684. "../util/lerp": 188,
  25685. "../util/logger": 189,
  25686. "../util/transitions": 195,
  25687. three: 217
  25688. }],
  25689. 158: [function(e, t, i) {//"./scene/SceneRenderer"
  25690. "use strict";
  25691. function n(e, t, i) {
  25692. this.scene = e,
  25693. this.camera = t,
  25694. this.renderer = null,
  25695. this.effects = i,
  25696. this.animateCallback = null,
  25697. this.composer = null,
  25698. this.qualityManager = null,
  25699. e.renderWidth = 0,
  25700. e.renderHeight = 0,
  25701. this.updateClock = new r.Clock,
  25702. this.components = [],
  25703. this.updateListeners = [],
  25704. this.resizeListeners = [],
  25705. this.forceUpdateSize = !1,
  25706. this.started = !1,
  25707. this.textures = {},
  25708. this.suspendedObjects = []
  25709. }
  25710. var r = e("three")
  25711. , o = e("../shaders")
  25712. , a = e("../enum/SceneRendererEvents")
  25713. , s = e("../enum/GLTextureType")
  25714. , l = e("../enum/GLCubeFaces")
  25715. , c = e("../exception/BasicException")
  25716. , h = e("../exception/RendererCreationException")
  25717. , u = e("../settings")
  25718. , d = e("events").EventEmitter;
  25719. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  25720. n.prototype = Object.create(d.prototype),
  25721. n.prototype.addComponent = function(e) { //增加渲染成员
  25722. this.components.push(e),
  25723. e.update && this.updateListeners.push(e),
  25724. e.setSize && (this.resizeListeners.push(e),
  25725. this.forceUpdateSize = !0)
  25726. }
  25727. ,
  25728. n.prototype.removeComponent = function(e) {
  25729. var t = function(t) {
  25730. return t !== e
  25731. };
  25732. this.components = this.components.filter(t),
  25733. this.updateListeners = this.updateListeners.filter(t),
  25734. this.resizeListeners = this.resizeListeners.filter(t)
  25735. }
  25736. ,
  25737. n.prototype.start = function(e) {
  25738. if (this.started)
  25739. throw new c("Can't start SceneRenderer, already started");
  25740. this.createContext(e),
  25741. this.initComposer(),
  25742. this.started = !0,
  25743. (p = p.bind(this))()
  25744. }
  25745. ,
  25746. n.prototype.createContext = function(e) {
  25747. try {
  25748. this.renderer = new r.WebGLRenderer,
  25749. this.renderer.autoClear = !0,
  25750. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  25751. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  25752. this.emit(a.ContextCreated)
  25753. } catch (e) {
  25754. throw new h("Unable to create a WebGL rendering context")
  25755. }
  25756. u.profiling.enabled && this.overrideTextures(),
  25757. e.appendChild(this.renderer.domElement)
  25758. }
  25759. ,
  25760. n.prototype.overrideTextures = function() {
  25761. var e = this.renderer.context
  25762. , t = 0
  25763. , i = e.createTexture;
  25764. e.createTexture = function() {
  25765. var n = i.call(e);
  25766. return n.id = t++,
  25767. this.textures[n.id] = n,
  25768. n
  25769. }
  25770. .bind(this);
  25771. var n = e.texImage2D;
  25772. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  25773. var d, p = this.getTextureTypeFromTarget(e, t);
  25774. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  25775. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  25776. h = a,
  25777. u = l,
  25778. o = u.naturalWidth,
  25779. a = u.naturalHeight,
  25780. n.call(e, t, i, r, c, h, u));
  25781. var f = this.textures[d.id];
  25782. f.width = p === s.TextureCube ? 6 * o : o,
  25783. f.height = a
  25784. }
  25785. .bind(this);
  25786. var r = e.deleteTexture;
  25787. e.deleteTexture = function(t) {
  25788. delete this.textures[t.id],
  25789. r.call(e, t)
  25790. }
  25791. .bind(this)
  25792. }
  25793. ,
  25794. n.prototype.updateTextureMemory = function() {
  25795. var e = null;
  25796. return function() {
  25797. var t = 0;
  25798. for (var i in this.textures) {
  25799. var n = this.textures[i];
  25800. n.width && n.height && (t += n.width * n.height * 4)
  25801. }
  25802. t !== e && this.emit(a.MemoryUsageUpdated, t),
  25803. e = t
  25804. }
  25805. }(),
  25806. n.prototype.getTextureTypeFromTarget = function(e, t) {
  25807. switch (t) {
  25808. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  25809. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  25810. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  25811. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25812. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  25813. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25814. return s.TextureCube;
  25815. case e.TEXTURE_2D:
  25816. return s.Texture2D;
  25817. default:
  25818. return null
  25819. }
  25820. }
  25821. ,
  25822. n.prototype.initComposer = function() {
  25823. this.composer = new r.EffectComposer(this.renderer),
  25824. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  25825. this.composer.addPass(this.effects.hblurPass),
  25826. this.composer.addPass(this.effects.vblurPass)
  25827. }
  25828. ,
  25829. n.prototype.setSize = function(e, t, devicePixelRatio) {
  25830. this.renderWidth = e,
  25831. this.renderHeight = t,
  25832. this.effects.aspect = e / t,
  25833. /* this.renderer.setSize(e, t), -----MP */
  25834. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  25835. this.composer.setSize(e, t);
  25836. for (var i = 0; i < this.resizeListeners.length; i++)
  25837. this.resizeListeners[i].setSize(e, t)
  25838. }
  25839. ,
  25840. n.prototype.render = function() {
  25841. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  25842. }
  25843. ,
  25844. /* n.prototype.updateScreenSize = function() { //MP
  25845. (window.innerWidth !== this.renderWidth || window.innerHeight !== this.renderHeight || this.forceUpdateSize) && (this.setSize(window.innerWidth, window.innerHeight),
  25846. this.forceUpdateSize = !1)
  25847. } */
  25848. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25849. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25850. return function(o){
  25851. var render = false;
  25852. var ratio;
  25853. var w, h; //记录应当render的大小
  25854. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25855. w = o.width, h = o.height, render = true, ratio=1;
  25856. }else{
  25857. w = $('#player').width();
  25858. h = $('#player').height();
  25859. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25860. (w !== W || h !== H || this.forceUpdateSize) &&
  25861. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25862. }
  25863. if(render){
  25864. this.setSize(w, h, ratio);
  25865. this.forceUpdateSize = !1
  25866. }
  25867. }
  25868. }()
  25869. ,
  25870. n.prototype.updateComponents = function() {
  25871. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25872. this.updateListeners[t].update(e)
  25873. }
  25874. ,
  25875. n.prototype.suspend = function() {
  25876. this.started = !1,
  25877. this.suspendedObjects = this.scene.children.map(function(e) {
  25878. return this.scene.remove(e),
  25879. e
  25880. }
  25881. .bind(this)),
  25882. this.render()
  25883. }
  25884. ,
  25885. n.prototype.resume = function() {
  25886. this.suspendedObjects.forEach(function(e) {
  25887. this.scene.add(e)
  25888. }
  25889. .bind(this)),
  25890. this.suspendedObjects = [],
  25891. this.started = !0,
  25892. p()
  25893. }
  25894. ;
  25895. var p = function(player) {
  25896. this.started && (window.requestAnimationFrame(p),
  25897. this.updateScreenSize(),
  25898. this.updateComponents(),
  25899. this.updateTextureMemory(),
  25900. this.render(),
  25901. // markspot && markspot.updateHotspot2dPos(),
  25902. this.emit(a.AfterRender)
  25903. )
  25904. };
  25905. n.prototype.getImageData = function() {
  25906. var e = document.createElement("canvas")
  25907. , t = e.getContext("2d");
  25908. return function(i, n, r) {
  25909. return e.width === n && e.height === r || (e.width = n,
  25910. e.height = r),
  25911. t.drawImage(i, 0, 0, n, r),
  25912. t.getImageData(0, 0, n, r)
  25913. }
  25914. }(),
  25915. n.prototype.initSizedTexture2D = function(e, t, i) {
  25916. var n = this.renderer
  25917. , o = n.context
  25918. , a = n.state
  25919. , s = new r.Texture(null);
  25920. s.flipY = !1,
  25921. i !== !0 && (i = !1),
  25922. s.generateMipmaps = i;
  25923. var l = n.paramThreeToGL(s.format)
  25924. , c = n.paramThreeToGL(s.type)
  25925. , h = n.properties.get(s)
  25926. , u = o.createTexture();
  25927. a.bindTexture(o.TEXTURE_2D, u),
  25928. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25929. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25930. s.wrapS = t,
  25931. s.wrapT = t;
  25932. var d = n.paramThreeToGL(t);
  25933. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25934. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25935. i ? (s.magFilter = r.LinearFilter,
  25936. s.minFilter = r.LinearMipMapLinearFilter,
  25937. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25938. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25939. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25940. s.minFilter = r.LinearFilter,
  25941. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25942. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25943. a.bindTexture(o.TEXTURE_2D, null),
  25944. h.__webglTexture = u,
  25945. s
  25946. }
  25947. ,
  25948. n.prototype.initSizedCubeMap = function(e, t) {
  25949. var i = this.renderer
  25950. , n = i.context
  25951. , o = i.state
  25952. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25953. a.flipY = !1,
  25954. a.generateMipmaps = t;
  25955. var s = i.paramThreeToGL(a.format)
  25956. , l = i.paramThreeToGL(a.type)
  25957. , c = i.properties.get(a)
  25958. , h = n.createTexture();
  25959. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25960. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25961. for (var u = 0; u < 6; u++)
  25962. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25963. return t ? (a.magFilter = r.LinearFilter,
  25964. a.minFilter = r.LinearMipMapLinearFilter,
  25965. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25966. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25967. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25968. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25969. a.minFilter = r.LinearFilter,
  25970. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25971. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25972. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25973. c.__image__webglTextureCube = h,
  25974. a
  25975. }
  25976. ,
  25977. n.prototype.deallocateCubeTexture = function(e) {
  25978. var t = this.renderer
  25979. , i = t.context
  25980. , n = t.properties.get(e);
  25981. i.deleteTexture(n.__image__webglTextureCube)
  25982. }
  25983. ,
  25984. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25985. var a = this.renderer
  25986. , s = a.context
  25987. , l = a.state
  25988. , c = a.properties.get(t);
  25989. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25990. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25991. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25992. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25993. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25994. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25995. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25996. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25997. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25998. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25999. l.bindTexture(s.TEXTURE_2D, null)
  26000. }
  26001. ,
  26002. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  26003. var s = this.renderer
  26004. , l = s.context
  26005. , c = s.state
  26006. , h = s.properties.get(t);
  26007. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  26008. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  26009. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  26010. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  26011. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  26012. }
  26013. ,
  26014. n.prototype.rebuildMipMaps2D = function(e) {
  26015. var t = this.renderer
  26016. , i = t.context
  26017. , n = t.state;
  26018. t.properties.get(e);
  26019. i.generateMipmap(i.TEXTURE_2D),
  26020. n.bindTexture(i.TEXTURE_2D, null)
  26021. }
  26022. ,
  26023. n.prototype.rebuildMipMaps3D = function(e) {
  26024. var t = this.renderer
  26025. , i = t.context
  26026. , n = t.state
  26027. , r = t.properties.get(e);
  26028. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  26029. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  26030. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  26031. }
  26032. ,
  26033. n.prototype.renderToCubeMap = function() {
  26034. var e = !1
  26035. , t = null
  26036. , i = null
  26037. , n = null
  26038. , a = null
  26039. , s = null
  26040. , l = 1;
  26041. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  26042. var _ = this.renderer;
  26043. _.context;
  26044. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  26045. i.position.z = 150,
  26046. t = new r.Scene,
  26047. t.add(i),
  26048. n = new r.ShaderMaterial({
  26049. uniforms: {
  26050. tDiffuse: {
  26051. type: "t",
  26052. value: null
  26053. },
  26054. alpha: {
  26055. type: "f",
  26056. value: 1
  26057. }
  26058. },
  26059. vertexShader: o.basicTextured.vertexShader,
  26060. fragmentShader: o.basicTextured.fragmentShader,
  26061. depthWrite: !1,
  26062. depthTest: !1,
  26063. side: r.DoubleSide
  26064. }),
  26065. a = new r.PlaneBufferGeometry(l,l),
  26066. s = new r.Mesh(a,n),
  26067. s.position.z = 0,
  26068. t.add(s),
  26069. e = !0);
  26070. var T = a.getAttribute("uv");
  26071. T.setDynamic(!0),
  26072. T.needsUpdate = !0;
  26073. var x = T.array
  26074. , S = p / u
  26075. , M = f / d
  26076. , R = g / u
  26077. , P = m / d;
  26078. x[0] = S,
  26079. x[1] = M + P,
  26080. x[2] = S + R,
  26081. x[3] = M + P,
  26082. x[4] = S,
  26083. x[5] = M,
  26084. x[6] = S + R,
  26085. x[7] = M;
  26086. var O = a.getAttribute("position");
  26087. O.setDynamic(!0),
  26088. O.needsUpdate = !0;
  26089. var L = O.array
  26090. , D = v / h.width - l / 2
  26091. , N = A / h.height - l / 2
  26092. , B = y / h.width
  26093. , F = C / h.height;
  26094. L[0] = D,
  26095. L[1] = N + F,
  26096. L[3] = D + B,
  26097. L[4] = N + F,
  26098. L[6] = D,
  26099. L[7] = N,
  26100. L[9] = D + B,
  26101. L[10] = N;
  26102. this.renderer.properties.get(c);
  26103. n.uniforms.tDiffuse.value = c,
  26104. n.blending = E || r.NoBlending,
  26105. n.transparent = !!b,
  26106. void 0 !== w && null !== w || (w = 1),
  26107. n.uniforms.alpha.value = w,
  26108. n.needUpdate = !0,
  26109. h.activeCubeFace = I,
  26110. h.viewport.set(0, 0, h.width, h.height);
  26111. var V = this.renderer.autoClear;
  26112. this.renderer.autoClear = !1,
  26113. this.renderer.render(t, i, h, !1),
  26114. this.renderer.autoClear = V
  26115. }
  26116. }(),
  26117. n.prototype.copyCubeMap = function() {
  26118. var e = !1
  26119. , t = null
  26120. , i = null
  26121. , a = null
  26122. , s = null
  26123. , l = null
  26124. , c = new r.Euler;
  26125. new r.Vector3;
  26126. return function(h, u, d, p, f, g, m, v, A) {
  26127. this.renderer;
  26128. if (!e) {
  26129. var y = 2;
  26130. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  26131. i.position.set(0, 0, 0),
  26132. t = new r.Scene,
  26133. t.add(i),
  26134. a = new r.ShaderMaterial({
  26135. uniforms: {
  26136. tDiffuse: {
  26137. type: "t",
  26138. value: null
  26139. },
  26140. alpha: {
  26141. type: "f",
  26142. value: 1
  26143. }
  26144. },
  26145. vertexShader: o.copyCubeMap.vertexShader,
  26146. fragmentShader: o.copyCubeMap.fragmentShader,
  26147. depthWrite: !1,
  26148. depthTest: !1,
  26149. side: r.DoubleSide
  26150. }),
  26151. s = new r.BoxGeometry(y,y,y),
  26152. l = new r.Mesh(s,a),
  26153. t.add(l),
  26154. e = !0
  26155. }
  26156. for (var C = 0; C < 6; C++)
  26157. n.getCubeOrientationForCubeFace(C, c),
  26158. l.rotation.copy(c),
  26159. l.matrixWorldNeedsUpdate = !0,
  26160. l.updateMatrixWorld(),
  26161. a.uniforms.tDiffuse.value = h,
  26162. a.blending = m || r.NoBlending,
  26163. a.transparent = !!v,
  26164. void 0 !== A && null !== A || (A = 1),
  26165. a.uniforms.alpha.value = A,
  26166. a.needUpdate = !0,
  26167. u.activeCubeFace = C,
  26168. u.viewport.set(0, 0, f, g),
  26169. this.renderer.render(t, i, u, !1)
  26170. }
  26171. }(),
  26172. n.getLookAtForCubeFace = function(e, t) {
  26173. switch (e) {
  26174. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26175. t.set(1, 0, 0);
  26176. break;
  26177. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26178. t.set(-1, 0, 0);
  26179. break;
  26180. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26181. t.set(0, 1, 0);
  26182. break;
  26183. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26184. t.set(0, -1, 0);
  26185. break;
  26186. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26187. t.set(0, 0, 1);
  26188. break;
  26189. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26190. t.set(0, 0, -1)
  26191. }
  26192. }
  26193. ,
  26194. n.getCubeOrientationForCubeFace = function(e, t) {
  26195. switch (e) {
  26196. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26197. t.set(0, -Math.PI / 2, 0);
  26198. break;
  26199. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26200. t.set(0, Math.PI / 2, 0);
  26201. break;
  26202. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26203. t.set(Math.PI / 2, Math.PI, 0);
  26204. break;
  26205. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26206. t.set(-Math.PI / 2, Math.PI, 0);
  26207. break;
  26208. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26209. t.set(0, -Math.PI, 0);
  26210. break;
  26211. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26212. t.set(0, 0, 0)
  26213. }
  26214. }
  26215. ,
  26216. t.exports = n
  26217. }
  26218. , {
  26219. "../enum/GLCubeFaces": 25,
  26220. "../enum/GLTextureType": 26,
  26221. "../enum/SceneRendererEvents": 43,
  26222. "../exception/BasicException": 55,
  26223. "../exception/RendererCreationException": 57,
  26224. "../settings": 166,
  26225. "../shaders": 167,
  26226. events: 202,
  26227. three: 217
  26228. }],
  26229. 159: [function(e, t, i) {//"./ApiHost"
  26230. "use strict";
  26231. function n(e) {
  26232. this.messenger = new a(e),
  26233. this.clientKey = null
  26234. }
  26235. var r = e("../util/ajax")
  26236. , o = e("./PostMessageType")
  26237. , a = e("./postmessage")
  26238. , s = e("./VersionInfo")
  26239. , l = e("events").EventEmitter
  26240. , c = window.location.origin + "/api/v1/user/";
  26241. n.prototype = Object.create(l.prototype),
  26242. n.prototype.bindEvents = function() {
  26243. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  26244. }
  26245. ,
  26246. n.prototype.waitForConnection = function() {
  26247. var e = new Promise(function(e, t) {
  26248. this.messenger.on(o.CONNECT, function(i) {
  26249. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  26250. }
  26251. .bind(this))
  26252. }
  26253. .bind(this));
  26254. return e
  26255. }
  26256. ,
  26257. n.prototype.onConnectionReceived = function(e) {
  26258. return this.messenger.setTarget(e.source, e.origin),
  26259. this.verifyConnection(e).then(function(t, i) {
  26260. this.messenger.send({
  26261. type: o.ACCEPT,
  26262. toId: e.fromId,
  26263. warning: i
  26264. }),
  26265. this.clientKey = t,
  26266. this.messenger.removeAllListeners(o.CONNECT),
  26267. this.bindEvents()
  26268. }
  26269. .bind(this), function(t) {
  26270. this.messenger.send({
  26271. type: o.REJECT,
  26272. toId: e.fromId,
  26273. reason: t
  26274. }),
  26275. this.messenger.setTarget()
  26276. }
  26277. .bind(this))
  26278. }
  26279. ,
  26280. n.prototype.verifyConnection = function(e) {
  26281. return new Promise(function(t, i) {
  26282. var n;
  26283. if (s.isDeprecated(e.sdkVersion))
  26284. n = "This version of the SDK is being deprecated. Please see http://www.port.com for more info";
  26285. else if (!s.isSupported(e.sdkVersion))
  26286. return i("This version of the SDK isn't supported. Get the latest version here: http://www.port.com");
  26287. var o = {
  26288. cache: !1,
  26289. headers: {
  26290. "X-port-Application-Key": e.applicationKey,
  26291. "X-port-Referrer": e.origin
  26292. }
  26293. };
  26294. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  26295. }
  26296. )
  26297. }
  26298. ,
  26299. n.prototype.onMessageReceived = function(e) {
  26300. if (this.validateClientApplicationKey(e.applicationKey)) {
  26301. var t = this;
  26302. e.onDone = function(i) {
  26303. i.toId = e.fromId,
  26304. i.uid = e.uid,
  26305. i.type = o.RESPONSE,
  26306. t.messenger.send(i)
  26307. }
  26308. ,
  26309. this.emit(o.ACTION, e)
  26310. }
  26311. }
  26312. ,
  26313. n.prototype.validateClientApplicationKey = function(e) {
  26314. return this.clientKey === e
  26315. }
  26316. ,
  26317. n.prototype.sendEvent = function(e, t) {
  26318. this.messenger.send({
  26319. type: o.EVENT,
  26320. eventType: e,
  26321. eventData: t
  26322. })
  26323. }
  26324. ,
  26325. t.exports = n
  26326. }
  26327. , {
  26328. "../util/ajax": 181,
  26329. "./PostMessageType": 160,
  26330. "./VersionInfo": 163,
  26331. "./postmessage": 165,
  26332. events: 202
  26333. }],
  26334. 160: [function(e, t, i) {//"./PostMessageType"
  26335. "use strict";
  26336. t.exports = Object.freeze({
  26337. CONNECT: "postmessage.connect",
  26338. ACCEPT: "postmessage.accept",
  26339. REJECT: "postmessage.reject",
  26340. ACTION: "postmessage.action",
  26341. RESPONSE: "postmessage.response",
  26342. EVENT: "postmessage.event"
  26343. })
  26344. }
  26345. , {}],
  26346. 161: [function(e, t, i) {//"../sdk/SdkEvents"
  26347. "use strict";
  26348. t.exports = Object.freeze({
  26349. MOVE: "sdk.move",
  26350. ENTER_PANO: "sdk.enterpano",
  26351. MODEL_LOADED: "sdk.modelloaded"
  26352. })
  26353. }
  26354. , {}],
  26355. 162: [function(e, t, i) {//"./TransitionStyles"
  26356. "use strict";
  26357. t.exports = Object.freeze({
  26358. FLY: "transition.fly",
  26359. FADEOUT: "transition.fade",
  26360. INSTANT: "transition.instant"
  26361. })
  26362. }
  26363. , {}],
  26364. 163: [function(e, t, i) {//"./VersionInfo"
  26365. "use strict";
  26366. t.exports = {
  26367. current: "1.0",
  26368. supported: ["1.0"],
  26369. deprecated: [],
  26370. isSupported: function(e) {
  26371. return this.supported.indexOf(e) !== -1
  26372. },
  26373. isDeprecated: function(e) {
  26374. return this.deprecated.indexOf(e) !== -1
  26375. },
  26376. isValid: function(e) {
  26377. return this.isSupported(e) || this.isDeprecated(e)
  26378. }
  26379. }
  26380. }
  26381. , {}],
  26382. 164: [function(e, t, i) {///js/sdk/automation.js
  26383. (function(i) {
  26384. "use strict";
  26385. function n(e, t, i) {
  26386. e && (e = e.toLowerCase().trim());
  26387. var n = new I.UP.clone
  26388. , r = Math.PI / 3
  26389. , o = Math.PI / 2;
  26390. switch (e) {
  26391. case "left":
  26392. i.copy(t),
  26393. i.applyAxisAngle(n, o);
  26394. break;
  26395. case "right":
  26396. i.copy(t),
  26397. i.applyAxisAngle(n, -o);
  26398. break;
  26399. case "forwardleft":
  26400. i.copy(t),
  26401. i.applyAxisAngle(n, r);
  26402. break;
  26403. case "forwardright":
  26404. i.copy(t),
  26405. i.applyAxisAngle(n, -r);
  26406. break;
  26407. case "forward":
  26408. default:
  26409. i.copy(t)
  26410. }
  26411. return i
  26412. }
  26413. function r(e, t) {
  26414. if (e) {
  26415. var i = {
  26416. pano: e,
  26417. lookAtPoint: null,
  26418. duration: null,
  26419. maxDistanceOverride: null,
  26420. skipWarpingCheck: !1
  26421. };
  26422. this.player.flyToPano(i, function() {
  26423. t && t({
  26424. success: !0,
  26425. message: "Transition complete."
  26426. })
  26427. })
  26428. } else
  26429. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  26430. t && t({
  26431. success: !1,
  26432. error: "Unable to find pano."
  26433. })
  26434. }
  26435. function o(e, t) {
  26436. var i = this.findRankedPano(e, t);
  26437. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  26438. null)
  26439. }
  26440. function a(e, t) {
  26441. var i = this.findRankedtag(e, t);
  26442. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  26443. null)
  26444. }
  26445. function s(e, t) {
  26446. t.copy(I.FORWARD),
  26447. e.getDirection(t)
  26448. }
  26449. function l(e) {
  26450. function t(e) {
  26451. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  26452. return {
  26453. x: c.Math.radToDeg(t._x),
  26454. y: c.Math.radToDeg(t._y),
  26455. z: c.Math.radToDeg(t._z)
  26456. }
  26457. }
  26458. var i = function(e) {
  26459. return e.alignmentType !== m.ALIGNED ? null : {
  26460. x: e.position.x,
  26461. y: e.position.y,
  26462. z: e.position.z
  26463. }
  26464. };
  26465. return {
  26466. panos: e.panos.list.map(function(n) {
  26467. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  26468. return {
  26469. uuid: n.id,
  26470. aligned: n.alignmentType === m.ALIGNED,
  26471. neighbourUUIDs: n.neighbourUUIDs.slice(),
  26472. position: i(n),
  26473. rotation: t(n),
  26474. thumbnail: r
  26475. }
  26476. })
  26477. }
  26478. }
  26479. var c = e("three")
  26480. , h = e("./ApiHost")
  26481. , u = e("../util/logger")
  26482. , d = e("../util/common")
  26483. , p = e("../util/math")
  26484. , f = e("../enum/ModelManagerEvents")
  26485. , g = e("./PostMessageType")
  26486. , m = e("../enum/AlignmentType")
  26487. , v = e("../enum/Direction")
  26488. , A = e("./TransitionStyles")
  26489. , y = e("../util/panorama")
  26490. , C = e("../enum/GLCubeFaces")
  26491. , I = e("../enum/Vectors")
  26492. , E = e("../enum/Viewmode")
  26493. , b = e("../enum/WarpStyle")
  26494. , w = (e("../enum/Keys"),
  26495. e("../enum/PlayerEvents"))
  26496. , _ = e("../sdk/SdkEvents")
  26497. , I = e("../enum/Vectors")
  26498. , T = e("../enum/ControlEvents")
  26499. , x = e("../enum/RenderLayers")
  26500. , S = (e("../constants"),
  26501. e("../settings"))
  26502. , M = e("../lib/jpeg_encoder")
  26503. , R = new u(i)
  26504. , P = function() {
  26505. var e = function e() {
  26506. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26507. e.player.getDirection(e.playerDirection),
  26508. e.projectVectors();
  26509. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  26510. if (e.angleTravelled += Math.abs(t),
  26511. e.angleTravelled >= Math.abs(e.angle)) {
  26512. if (e.active = !1,
  26513. e.onDone) {
  26514. var i = e.onDone;
  26515. i()
  26516. }
  26517. } else
  26518. e.lastFacingDirection.copy(e.playerDirection),
  26519. window.setTimeout(e, 4)
  26520. };
  26521. return e.active = !1,
  26522. e.angle = 0,
  26523. e.angleTravelled = 0,
  26524. e.playerDirection = new c.Vector3,
  26525. e.lastFacingDirection = new c.Vector3,
  26526. e.onDone = null,
  26527. e.player = null,
  26528. e.start = function(t, i, n, r) {
  26529. e.active = !0,
  26530. t && i && (i = 0),
  26531. e.angle = t || i,
  26532. e.xAngle = t,
  26533. e.yAngle = i,
  26534. e.angleTravelled = 0,
  26535. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26536. n.getDirection(e.playerDirection),
  26537. e.lastFacingDirection.copy(e.playerDirection),
  26538. e.projectVectors(),
  26539. e.onDone = r,
  26540. e.player = n,
  26541. e()
  26542. }
  26543. ,
  26544. e.projectVectors = function() {
  26545. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  26546. e.lastFacingDirection.projectOnPlane(I.UP))
  26547. }
  26548. ,
  26549. e
  26550. }()
  26551. , O = function() {
  26552. var e = new c.Vector3;
  26553. return function(t) {
  26554. t ? (e.copy(t.position),
  26555. e.add(t.discPosition),
  26556. p.projectPositionToCanvas(e, this.player.camera, e),
  26557. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  26558. }
  26559. }()
  26560. , L = function() {
  26561. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  26562. }
  26563. , D = function() {
  26564. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  26565. }
  26566. , N = function(e) {
  26567. var t = new c.Vector3;
  26568. return function(e) {
  26569. var i = this.player.getDirection();
  26570. t.copy(i);
  26571. var n = t.y;
  26572. t.y = 0,
  26573. t.normalize();
  26574. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  26575. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  26576. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  26577. 0;
  26578. this.player.mode === E.DOLLHOUSE && (r = -r);
  26579. var o = L.call(this) - .1
  26580. , a = D.call(this) + .1
  26581. , s = r + e;
  26582. s > o ? s = o : s < a && (s = a);
  26583. var l = s - r;
  26584. return e > 0 && l < .01 && (l = 0),
  26585. e < 0 && l > -.01 && (l = 0),
  26586. l
  26587. }
  26588. }()
  26589. , B = function() {
  26590. var e = new c.Euler;
  26591. return function(t) {
  26592. return e.setFromQuaternion(t.quaternion, "YXZ"),
  26593. {
  26594. position: {
  26595. x: t.position.x,
  26596. y: t.position.y,
  26597. z: t.position.z
  26598. },
  26599. rotation: {
  26600. x: c.Math.radToDeg(e.x),
  26601. y: c.Math.radToDeg(e.y),
  26602. z: 0
  26603. },
  26604. pano: t.currentPano ? t.currentPano.id : null,
  26605. mode: t.mode
  26606. }
  26607. }
  26608. }()
  26609. , F = null;
  26610. t.exports = {
  26611. init: function(e, t, i, n, r) {
  26612. V.init(e, t, i, r),
  26613. F = new Promise(function(e, t) {
  26614. i.on(w.Ready, function() {
  26615. e()
  26616. })
  26617. }
  26618. .bind(this));
  26619. var o = new h(window)
  26620. , a = o.waitForConnection();
  26621. a.then(function(e) {
  26622. o.on(g.ACTION, V.onMessageReceive.bind(V))
  26623. });
  26624. var s = function() {
  26625. var e = Date.now();
  26626. return function() {
  26627. if (!(Date.now() - e < 100)) {
  26628. var t = B(i);
  26629. o.sendEvent(_.MOVE, {
  26630. state: t
  26631. }),
  26632. e = Date.now()
  26633. }
  26634. }
  26635. }();
  26636. i.on(w.Move, s),
  26637. i.on(w.ViewChanged, s),
  26638. n.on(f.ActiveModelChanged, function(e) {
  26639. function t(e) {
  26640. var t, i = e.newPano.id;
  26641. e.oldPano && (t = e.oldPano.id),
  26642. i !== t && o.sendEvent(_.ENTER_PANO, {
  26643. oldPano: t,
  26644. newPano: i
  26645. })
  26646. }
  26647. var i = e.model
  26648. , n = e.oldModel;
  26649. V.model = i,
  26650. a.then(function() {
  26651. o.sendEvent(_.MODEL_LOADED, {
  26652. metadata: l(i)
  26653. })
  26654. }),
  26655. n && n.panos.forEach(function(e) {
  26656. e.removeEventListener("enter", t)
  26657. }),
  26658. i.panos.forEach(function(e) {
  26659. e.on("enter", t)
  26660. })
  26661. })
  26662. }
  26663. };
  26664. var V = {
  26665. director: null,
  26666. player: null,
  26667. controls: null,
  26668. sceneRenderer: null,
  26669. model: null,
  26670. init: function(e, t, i, n) {
  26671. this.director = e,
  26672. this.player = i,
  26673. this.controls = t,
  26674. this.sceneRenderer = n
  26675. },
  26676. handleToObject: {},
  26677. objectToHandle: {},
  26678. handleCount: 0,
  26679. onMessageReceive: function(e) {
  26680. if (e) {
  26681. var t = e.targetFunction
  26682. , i = e.params
  26683. , n = e.onDone;
  26684. t && this[t] && this[t](i, n)
  26685. }
  26686. },
  26687. waitForInit: function(e, t) {
  26688. F.then(t.bind({
  26689. success: !0,
  26690. message: "Init complete."
  26691. }))
  26692. },
  26693. moveToPano: function(e, t) {
  26694. var i = new c.Euler(0,0,0,"YXZ")
  26695. , n = new c.Quaternion;
  26696. return function(e, t) {
  26697. var r = e.pano
  26698. , o = e.rotation
  26699. , a = e.transition;
  26700. if (!this.model)
  26701. return t({
  26702. success: !1,
  26703. error: "The model has not been loaded yet"
  26704. });
  26705. var s = this.model.panos.get(r);
  26706. if (!s)
  26707. return t({
  26708. success: !1,
  26709. error: r + " does not exist in this model"
  26710. });
  26711. if (!o)
  26712. return t({
  26713. sucess: !1,
  26714. erorr: o + " is not a valid rotation"
  26715. });
  26716. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  26717. console.log(o.z);
  26718. var l = {
  26719. success: !0,
  26720. message: r
  26721. };
  26722. if (a === A.FADEOUT)
  26723. n.setFromEuler(i),
  26724. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  26725. else {
  26726. var h, u;
  26727. a === A.INSTANT && (h = 0,
  26728. u = 0);
  26729. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  26730. this.player.flyToPano({
  26731. pano: s,
  26732. lookAtPoint: d,
  26733. duration: h,
  26734. aimDuration: u
  26735. }, t.bind(this, l))
  26736. }
  26737. }
  26738. }(),
  26739. moveInDirection: function(e, t) {
  26740. var i = e.direction;
  26741. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  26742. void (t && t({
  26743. success: !1,
  26744. error: "Invalid direction."
  26745. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  26746. t(e ? {
  26747. success: !0,
  26748. message: "moved " + i
  26749. } : {
  26750. success: !1,
  26751. error: "Cannot move in direction: " + i
  26752. })
  26753. })
  26754. },
  26755. getPose: function(e, t) {
  26756. this.player.camera.position,
  26757. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  26758. return t({
  26759. success: !0,
  26760. message: B(this.player)
  26761. })
  26762. },
  26763. takeScreenShot: function() {
  26764. var e = new c.PerspectiveCamera
  26765. , t = new c.WebGLRenderTarget;
  26766. return function(i, n) {
  26767. if (!i.resolution)
  26768. return n({
  26769. success: !1,
  26770. error: "An invalid resolution was specified"
  26771. });
  26772. if (i.resolution.width === -1 || i.resolution.height === -1) {
  26773. var r = this.sceneRenderer.renderer.getSize();
  26774. i.resolution.width = r.width,
  26775. i.resolution.height = r.height
  26776. }
  26777. e.layers.set(x.DEFAULT),
  26778. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  26779. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  26780. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  26781. var o = i.resolution.width
  26782. , a = i.resolution.height
  26783. , s = o / a;
  26784. e.position.copy(this.sceneRenderer.camera.position),
  26785. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  26786. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  26787. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  26788. t.setSize(o, a),
  26789. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  26790. var l = new Uint8Array(o * a * 4);
  26791. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  26792. var c = M.encode({
  26793. data: l,
  26794. width: o,
  26795. height: a,
  26796. heading: 180,
  26797. pitch: 0
  26798. }, {
  26799. quality: 75,
  26800. flipY: !0
  26801. })
  26802. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  26803. n({
  26804. success: !0,
  26805. message: h
  26806. })
  26807. }
  26808. }(),
  26809. findRankedPano: function(e, t) {
  26810. var i = new c.Vector3
  26811. , r = new c.Vector3;
  26812. return function(e, t) {
  26813. s(this.player, r),
  26814. n(t, r, i);
  26815. var o = this.player.rankedPanoInDirection(e, i);
  26816. if (o) {
  26817. var a = this.objectToHandle[o.id];
  26818. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  26819. this.handleToObject[a] = o),
  26820. a
  26821. }
  26822. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  26823. -1
  26824. }
  26825. }(),
  26826. findRankedtag: function(e, t) {
  26827. var i = new c.Vector3
  26828. , r = new c.Vector3;
  26829. return function(e, t) {
  26830. s(this.player, r),
  26831. n(t, r, i);
  26832. var o = this.player.rankedtagInDirection(e, i);
  26833. if (o) {
  26834. var a = this.objectToHandle[o.sid];
  26835. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  26836. this.handleToObject[a] = o),
  26837. a
  26838. }
  26839. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26840. -1
  26841. }
  26842. }(),
  26843. clickNearesttag: function(e) {
  26844. this.clickRankedtag(0, e)
  26845. },
  26846. clickRankedtag: function(e, t) {
  26847. var i = a.call(this, e, t);
  26848. i && O.call(this, i)
  26849. },
  26850. clickNearestPano: function(e, t) {
  26851. this.clickRankedPano(0, e, t)
  26852. },
  26853. clickRankedPano: function(e, t, i) {
  26854. var n = o.call(this, e, t);
  26855. n ? r.call(this, n, i) : i(null)
  26856. },
  26857. clickPano: function(e, t) {
  26858. var i = this.handleTable[e];
  26859. i ? r.call(this, i, t) : t(null)
  26860. },
  26861. rotateDirection: function() {
  26862. return function(e, t) {
  26863. var i = e.direction
  26864. , n = e.angle;
  26865. if (!P.active) {
  26866. var r = 0
  26867. , o = 0
  26868. , a = 0
  26869. , s = 0;
  26870. if (!n || isNaN(n))
  26871. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26872. void (t && t({
  26873. success: !1,
  26874. error: "Invalid rotation angle."
  26875. }));
  26876. if (this.player.mode === E.TRANSITIONING)
  26877. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26878. void (t && t({
  26879. success: !1,
  26880. error: "Cannot rotate while transitioning"
  26881. }));
  26882. if (i === v.RIGHT || i === v.LEFT)
  26883. i === v.RIGHT && (n = -n),
  26884. r = n > 0 ? -1 : 1,
  26885. a = n;
  26886. else {
  26887. if (i !== v.UP && i !== v.DOWN)
  26888. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26889. void (t && t({
  26890. success: !1,
  26891. error: "Invalid direction for rotation."
  26892. }));
  26893. if (this.player.mode === E.FLOORPLAN)
  26894. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26895. void (t && t({
  26896. success: !1,
  26897. error: "Cannot rotate " + i + " in floorplan mode"
  26898. }));
  26899. if (i === v.DOWN && (n = -n),
  26900. n = N.call(this, n),
  26901. 0 === n)
  26902. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26903. void (t && t({
  26904. success: !1,
  26905. error: "Already at maximum rotation in direction: " + i
  26906. }));
  26907. o = n > 0 ? 1 : -1,
  26908. s = n
  26909. }
  26910. var l = n;
  26911. n = c.Math.degToRad(n),
  26912. a = c.Math.degToRad(a),
  26913. s = c.Math.degToRad(s);
  26914. var h = this.controls.activeControl
  26915. , u = function() {
  26916. h.stopRotating(!0),
  26917. t && t({
  26918. success: !0,
  26919. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26920. })
  26921. };
  26922. h.startRotating(r, o),
  26923. P.start(a, s, this.player, u)
  26924. }
  26925. }
  26926. }(),
  26927. rotate: function() {
  26928. var e = new c.Vector3
  26929. , t = new c.Vector3;
  26930. return function(i, n) {
  26931. var r = i.xAngle
  26932. , o = i.yAngle;
  26933. if (!P.active) {
  26934. if (r = r || 0,
  26935. o = o || 0,
  26936. isNaN(r) || isNaN(o))
  26937. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26938. void (n && n({
  26939. success: !1,
  26940. error: "Invalid rotation angle."
  26941. }));
  26942. if (this.player.mode === E.TRANSITIONING)
  26943. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26944. void (n && n({
  26945. success: !1,
  26946. error: "Cannot rotate while transitioning"
  26947. }));
  26948. Math.abs(r) < .01 && (r = 0),
  26949. Math.abs(o) < .01 && (o = 0);
  26950. var a = o;
  26951. o = N.call(this, o),
  26952. r = -r;
  26953. var s = a > 0 ? "UP" : "DOWN";
  26954. if (!r && a && !o)
  26955. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26956. void (n && n({
  26957. success: !1,
  26958. error: "Already at maximum rotation in direction: " + s
  26959. }));
  26960. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26961. var l = o;
  26962. o = c.Math.degToRad(o),
  26963. r = c.Math.degToRad(r),
  26964. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26965. this.player.getDirection(e),
  26966. t.copy(e).applyAxisAngle(I.UP, r),
  26967. t.applyAxisAngle(I.RIGHT, o);
  26968. var h = (e.angleTo(t),
  26969. r > 0 ? -1 : r < 0 ? 1 : 0)
  26970. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26971. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26972. var d = this.controls.activeControl
  26973. , p = function() {
  26974. d.stopRotating(!0),
  26975. n && n({
  26976. success: !0,
  26977. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26978. })
  26979. };
  26980. d.startRotating(h, u),
  26981. P.start(r, o, this.player, p)
  26982. }
  26983. }
  26984. }(),
  26985. panCamera: function(e, t) {
  26986. function i(e) {
  26987. switch (r.removeAllListeners(T.AutoPanComplete),
  26988. r.removeAllListeners(T.AutoPanInterrupt),
  26989. r.removeAllListeners(T.AutoPanClamped),
  26990. e) {
  26991. case T.AutoPanInterrupt:
  26992. t({
  26993. success: !0,
  26994. message: "Camera panning interrupted."
  26995. });
  26996. break;
  26997. case T.AutoPanClamped:
  26998. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26999. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  27000. return void t({
  27001. success: !1,
  27002. error: "Already at edge of current model bounds."
  27003. });
  27004. var i = "The view point is outside the bounds for the current model. ";
  27005. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  27006. console.warn(i)
  27007. }
  27008. case T.AutoPanComplete:
  27009. t({
  27010. success: !0,
  27011. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  27012. })
  27013. }
  27014. }
  27015. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  27016. return t({
  27017. success: !1,
  27018. error: "Camera panning is not available in the current mode: " + this.player.mode
  27019. });
  27020. var n = e.position
  27021. , r = this.player.control;
  27022. r.setAutoPanPosition(n.x, n.z),
  27023. r.autoPan = !0;
  27024. var o = function(e, t) {
  27025. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  27026. };
  27027. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  27028. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  27029. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  27030. },
  27031. click: function(e, t) {
  27032. var i = e.x
  27033. , n = e.y
  27034. , r = e.percentage;
  27035. r === !0 && (i = i / 100 * $('#player').width(),
  27036. n = n / 100 * $('#player').height()),
  27037. this.player.handleInputStart(i, n),
  27038. this.player.updateIntersect(),
  27039. this.player.handleInputEnd(i, n)
  27040. },
  27041. mouseOver: function(e, t) {
  27042. var i = e.x
  27043. , n = e.y
  27044. , r = e.percentage;
  27045. r === !0 && (i = i / 100 * $('#player').width(),
  27046. n = n / 100 * $('#player').height()),
  27047. this.player.handleInputMove(i, n),
  27048. this.player.updateIntersect()
  27049. },
  27050. moveToMode: function(e, t) {
  27051. function i(e) {
  27052. t(e ? {
  27053. success: !1,
  27054. error: "Failed to load new mode: " + e
  27055. } : {
  27056. success: !0,
  27057. message: "Moved to new mode: " + n
  27058. })
  27059. }
  27060. var n = e.mode;
  27061. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  27062. i()
  27063. }, function(e) {
  27064. i(e)
  27065. }) : t({
  27066. success: !1,
  27067. error: "Invalid mode selection"
  27068. })
  27069. }
  27070. }
  27071. }
  27072. ).call(this, "/js/sdk/automation.js")
  27073. }
  27074. , {
  27075. "../constants": 8,
  27076. "../enum/AlignmentType": 17,
  27077. "../enum/ControlEvents": 21,
  27078. "../enum/Direction": 22,
  27079. "../enum/GLCubeFaces": 25,
  27080. "../enum/Keys": 30,
  27081. "../enum/ModelManagerEvents": 33,
  27082. "../enum/PlayerEvents": 40,
  27083. "../enum/RenderLayers": 41,
  27084. "../enum/Vectors": 50,
  27085. "../enum/Viewmode": 51,
  27086. "../enum/WarpStyle": 52,
  27087. "../lib/jpeg_encoder": 94,
  27088. "../sdk/SdkEvents": 161,
  27089. "../settings": 166,
  27090. "../util/common": 185,
  27091. "../util/logger": 189,
  27092. "../util/math": 190,
  27093. "../util/panorama": 191,
  27094. "./ApiHost": 159,
  27095. "./PostMessageType": 160,
  27096. "./TransitionStyles": 162,
  27097. three: 217
  27098. }],
  27099. 165: [function(e, t, i) {//"./postmessage"
  27100. "use strict";
  27101. function n(e) {
  27102. this.sourceWindow = e,
  27103. this.targetWindow = null,
  27104. this.targetOrigin = null,
  27105. this.id = Math.floor(1e5 * Math.random()),
  27106. this.bindEvents()
  27107. }
  27108. var r = e("./PostMessageType")
  27109. , o = e("events").EventEmitter;
  27110. n.prototype = Object.create(o.prototype),
  27111. n.prototype.bindEvents = function() {
  27112. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  27113. }
  27114. ,
  27115. n.prototype.setTarget = function(e, t) {
  27116. this.targetWindow = e,
  27117. this.targetOrigin = t
  27118. }
  27119. ,
  27120. n.prototype.onPostmessageReceived = function(e) {
  27121. var t = e.origin || e.originalEvent.origin
  27122. , i = e.source;
  27123. switch (e.data.type) {
  27124. case r.CONNECT:
  27125. break;
  27126. case r.RESPONSE:
  27127. if (this.id !== e.data.toId)
  27128. return;
  27129. default:
  27130. if (!this.validateMessageOrigin(t))
  27131. return
  27132. }
  27133. var n = e.data;
  27134. n.source = i,
  27135. n.origin = t,
  27136. n.timestamp = Date.now(),
  27137. this.emit(e.data.type, n)
  27138. }
  27139. ,
  27140. n.prototype.validateMessageOrigin = function(e) {
  27141. return "*" === this.targetOrigin || e === this.targetOrigin
  27142. }
  27143. ,
  27144. n.prototype.send = function(e) {
  27145. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  27146. this.targetWindow.postMessage(e, this.targetOrigin))
  27147. }
  27148. ,
  27149. t.exports = n
  27150. }
  27151. , {
  27152. "./PostMessageType": 160,
  27153. events: 202
  27154. }],
  27155. 166: [function(e, t, i) {//"./settings"
  27156. "use strict";
  27157. var n = e("three")
  27158. , r = e("./util/browser")
  27159. , o = e("./enum/Viewmode")
  27160. , a = e("./enum/VROption")
  27161. , s = e("./enum/Colors")
  27162. , l = e("./enum/WarpStyle")
  27163. , c = e("./util/easing")
  27164. , h = e("./util/common")
  27165. , u = e("./util/showcase")
  27166. , d = e("./constants")
  27167. , p = {
  27168. debug: window.location.href.substring(window.location.href.indexOf("?")+1).indexOf('debug')>-1, //xzw
  27169. version: "2.25.6-0-gd87e5b1",
  27170. languageTag: r.valueFromHash("lang", null),
  27171. pageTitle: "port 3D Showcase",
  27172. authorizationHeader: u.getAuthorizationHeader(),
  27173. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  27174. logLevel: r.valueFromHash("log", 2),
  27175. skyboxRadius: 2500,
  27176. modelBoundsPadding: 5,
  27177. showNeighbors: !1,
  27178. brand: r.valueFromHash("brand", !0),
  27179. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  27180. startHighlights: r.valueFromHash("hl", -1),
  27181. specialEdition: r.valueFromHash("bn", 0),
  27182. useWheel: r.valueFromHash("wh", !0),
  27183. crossOrigin: "anonymous",
  27184. fancierTransition: !1,
  27185. wireframe: !1,
  27186. skyboxWireframe: !1,
  27187. modelAlpha: 1,
  27188. highlightPanoSelection: !1,
  27189. showSweeps: !0,
  27190. showSkyboxes: !1,
  27191. showMesh: !0,
  27192. showFloors: !1,
  27193. showFloorDuration: 300,
  27194. showFloorDelay: 300,
  27195. hideFloorDuration: 300,
  27196. hideFloorDelay: 0,
  27197. reticuleOpacityTransitionTime: 250,
  27198. reticuleColor: s.newBlue,
  27199. markerOpacityTransitionTime: 500,
  27200. guiAnimationSpeed: 250,
  27201. highlightAnimationDuration: 500,
  27202. modelComponentLoadSpinnerDelay: 150,
  27203. captureErrors: !1,
  27204. maxMobileTextures: 6,
  27205. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  27206. startupFlyinDelay: 3e3,
  27207. dollhouseDefault: {
  27208. minDistance: 15,
  27209. maxDistance: 50,
  27210. minPolarAngle: n.Math.degToRad(10),
  27211. maxPolarAngle: n.Math.degToRad(90)
  27212. },
  27213. hideReticuleTimeout: 1e3,
  27214. analytics: {
  27215. inactivityThreshold: 30,
  27216. sessionTrackingRate: .15,
  27217. maxTrackedErrors: 20,
  27218. sessionDurationPingFrequency: 10,
  27219. sessionDurationTimeout: 15
  27220. },
  27221. flydown: {
  27222. movementEasing: "easeInOutQuad",
  27223. movementDelay: .001,
  27224. rotationEasing: "easeInOutQuad",
  27225. rotationDelay: .5,
  27226. modelTextureDelay: .75,
  27227. skyboxDelay: .75
  27228. },
  27229. transition: {
  27230. flySpeed: .01,
  27231. flyTime: 750,
  27232. flytimeMaxDistanceThreshold: 5,
  27233. flytimeDistanceMultiplier: 150,
  27234. aimTime: 1500,
  27235. aimSlowFactor: 1.5,
  27236. blur: .8,
  27237. movementEasing: "easeInOutQuad",
  27238. blendEasing: "easeInOutQuad",
  27239. fastForwardFactor: r.valueFromHash("mfis", 3)
  27240. },
  27241. show360Views: {
  27242. enabled: !0,
  27243. transitionTime: 1e3
  27244. },
  27245. quickstart: {
  27246. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  27247. animation: 1400,
  27248. showTextDelay: 500,
  27249. fadeOutDelay: 3e3,
  27250. fovChange: 10
  27251. },
  27252. appConfig: {
  27253. webvr_version: null,
  27254. segment_key: null,
  27255. embedly_key: null,
  27256. branch_key: null,
  27257. keen_write_key: null,
  27258. keen_project_id: null
  27259. },
  27260. vr: {
  27261. enabled: !0,
  27262. allowWebVR: !1,
  27263. option: r.valueFromHash("vr", a.CONTEXTUAL)
  27264. },
  27265. share: {
  27266. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  27267. },
  27268. input: {
  27269. longTapThreshold: 200,
  27270. moveToleranceNDC: .08,
  27271. touchMoveThreshold: 25
  27272. },
  27273. help: {
  27274. modalStayDuration: 600
  27275. },
  27276. immersive: {
  27277. timeToShowAgain: 1250,
  27278. uiStayDuration: 600
  27279. },
  27280. tourInteraction: {
  27281. disabled: "0" === r.valueFromHash("tourcta", null),
  27282. showPauseButton: 1e3,
  27283. showModal: 1500,
  27284. allowNextClick: 200,
  27285. largeModal: "1" === r.valueFromHash("tourcta", null),
  27286. smallModal: "2" === r.valueFromHash("tourcta", null)
  27287. },
  27288. labels: {
  27289. enabled: !1,
  27290. hideUntilStart: !0,
  27291. fadeInDuration: 250,
  27292. fadeInDelay: 250,
  27293. fadeOutDuration: 250,
  27294. fadeOutDelay: 0,
  27295. zoomHideThreshhold: {
  27296. mobile: r.isSmallScreen() ? .45 : .6,
  27297. desktop: 2
  27298. },
  27299. zoomTruncateThreshhold: {
  27300. mobile: r.isSmallScreen() ? .35 : .45,
  27301. desktop: .85
  27302. },
  27303. minLengthForTruncate: 16,
  27304. truncateLength: 12,
  27305. truncateSuffix: "..."
  27306. },
  27307. tags: {
  27308. enabled: r.valueFromHash("mt", 1),
  27309. startup: {
  27310. hideUntilStart: !0,
  27311. fadeInDuration: 500,
  27312. fadeInDelay: 100
  27313. },
  27314. visibility: {
  27315. anyDistance: !0,
  27316. visibleDistance: 8,
  27317. cameraClearance: .1,
  27318. alphaTestLevel: .05,
  27319. hideViaFloor: !0,
  27320. hideOffScreenDisc: !1,
  27321. hideOffScreenObject: !1
  27322. },
  27323. disc: {
  27324. opacity: 1,
  27325. disabledOpacity: .5,
  27326. scale: {
  27327. nearBound: 1.5,
  27328. farBound: 4.8,
  27329. linkFarBound: !1,
  27330. linkPercent: 40,
  27331. maxSize: 80,
  27332. minSize: 40,
  27333. baseViewportSize: 800,
  27334. responsiveness: 100
  27335. }
  27336. },
  27337. pole: {
  27338. enabled: !0,
  27339. height: .5,
  27340. width: 2,
  27341. opacity: .5,
  27342. color: "white"
  27343. },
  27344. navigate: {
  27345. nearestPano: !0,
  27346. lineOfSight: !0,
  27347. reactivate: !0,
  27348. aimAt: "disc",
  27349. tiltTolerance: 15, //xzw 改小点热点不容易超出屏幕
  27350. rotateSpeedFactor: .6
  27351. }
  27352. },
  27353. path: {
  27354. color: s.newBlue,
  27355. colorUp: s._desat(s.newBlue, .5),
  27356. colorDown: s._darken(s.newBlue, .35),
  27357. opacity: .5,
  27358. style: "ribbon",
  27359. height: .025,
  27360. ribbonWidth: .24,
  27361. outsideHeight: .5,
  27362. waypointRadius: .5,
  27363. waypointIndoorRadius: .24,
  27364. waypointPulse: 1e3,
  27365. typ: l.BLACK,
  27366. meshFree: r.valueFromHash("mf", 1),
  27367. mapGuides: r.valueFromHash("guides", !0),
  27368. fadeInTime: 400,
  27369. fadeOutTime: 300
  27370. },
  27371. warp: {
  27372. nearPanoDist: .1,
  27373. matchCam: !1,
  27374. blur: .33,
  27375. fastTime: 1500,
  27376. teleportTime: 1500,
  27377. outsideTime: 2e3,
  27378. lookAheadMax: .3,
  27379. lookAheadDist: 2.5,
  27380. softPushDist: .37,
  27381. softPushEnd: .3,
  27382. softBendAngle: 8,
  27383. softBendTilt: 4,
  27384. softBendEnd: .3,
  27385. doBurns: r.valueFromHash("kb", !0),
  27386. burnsAngle: 35,
  27387. minBurnsAngle: 35,
  27388. minDownAngle: -35,
  27389. maxTurnPerSec: 280,
  27390. maxAimPerSec: 35,
  27391. minRotation: 12,
  27392. maxAimRotation: 33.2,
  27393. turnFriction: .2,
  27394. flySpeed: .01,
  27395. minWarpTime: 1200,
  27396. warpInterruptionRedirectTime: 500,
  27397. tourStepDelay: r.valueFromHash("st", 0),
  27398. walkDelay: 0,
  27399. walkMaxDist: 50,
  27400. walkMinDist: .8,
  27401. walkSlideShowThreshhold: 3e3,
  27402. walkExtraPanosDistance: .4,
  27403. timePerMeter: 800,
  27404. motionLeadTime: 500,
  27405. movementEasing: "easeInOutQuad",
  27406. blendEasing: "easeInOutQuad",
  27407. showBunny: !1,
  27408. loop: r.valueFromHash("lp", !1),
  27409. auto: r.valueFromHash("ts", -1),
  27410. eOrder: "YXZ",
  27411. stepFactor: .25,
  27412. brakeStrength: 2,
  27413. minBrakeAngle: .1,
  27414. maxBrakeAngle: 1.8,
  27415. climbEffort: 4
  27416. },
  27417. rotationFriction: .05,
  27418. rotationAccelerationInside: 4.5,
  27419. rotationAccelerationOutside: .15,
  27420. rotationAfterMoveMultiplier: 40,
  27421. rotationAfterMoveHistoryCount: 5,
  27422. panFriction: .09,
  27423. panAccelerationOutside: 60,
  27424. onload: r.valueFromHash("onload", o.PANORAMA),
  27425. zoomNearLimit: .1,
  27426. zoomFarLimit: 10,
  27427. navigation: {
  27428. panoScores: !1,
  27429. mouseDirection: !0,
  27430. filterStrictness: .75,
  27431. angleFactor: -30,
  27432. directionFactor: 10,
  27433. distanceFactor: -1,
  27434. optionalityFactor: 3
  27435. },
  27436. sdkInit: !1,
  27437. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  27438. console: r.valueFromHash("console", !1),
  27439. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  27440. panoramaNeighbourMaxDistance: 5,
  27441. panoFloorClickRadius: .35,
  27442. showScreenshotLocations: !1,
  27443. showAxis: !1,
  27444. showNeighbourRaycasts: !1,
  27445. colorMarkerOnLoad: !1,
  27446. colorMarkerByFloor: !1,
  27447. tiling: {
  27448. panoPreRenderRepeatDelay: 2500,
  27449. panoPreRenderDelay: 500,
  27450. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  27451. tilingFlagNames: ["usetiles", "tiles"],
  27452. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  27453. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  27454. overlayStyle: r.valueFromHash("tileoverlay", 0),
  27455. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  27456. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  27457. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  27458. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  27459. customCompression: r.valueFromHash("tilecustcomp", 0),
  27460. mobileHighQualityOverride: !1,
  27461. allowUltraHighResolution: !1
  27462. },
  27463. zoom: {
  27464. enabled: !1,
  27465. forceOff: r.valueFromHash("nozoom", 0),
  27466. overridemax: r.valueFromHash("maxzoom", null),
  27467. overridemin: r.valueFromHash("minzoom", null),
  27468. max: d.highQualityMaxZoom,
  27469. min: 1,
  27470. transitionStyle: r.valueFromHash("zoomtrans", 1),
  27471. activationThreshold: 1.1,
  27472. restoreTime: 500
  27473. },
  27474. profiling: {
  27475. enabled: r.valueFromHash("mem", !1)
  27476. }
  27477. };
  27478. p = h.deepExtend(p, d, {
  27479. insideFOV: r.valueFromHash("fov", d.insideFOV),
  27480. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  27481. panorama: {
  27482. transitionTime: 1e3,
  27483. modelAlpha: 0,
  27484. modelAlphaDelay: p.flydown.modelTextureDelay,
  27485. modelAlphaLength: 1,
  27486. skyboxOpacity: 1,
  27487. skyboxOpacityDelay: p.flydown.skyboxDelay,
  27488. skyboxOpacityLength: .9,
  27489. fovLength: 1,
  27490. fovDelay: 0,
  27491. cameraMatrixDuration: .8,
  27492. cameraMatrixDelay: 0,
  27493. cameraMatrixEase: c.easeInCubic,
  27494. reticuleOpacity: 1,
  27495. markerOpacity: .3,
  27496. markerOpacityOnHover: 1
  27497. },
  27498. dollhouse: {
  27499. transitionTime: 1e3,
  27500. modelAlpha: 1,
  27501. modelAlphaDelay: 0,
  27502. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  27503. skyboxOpacity: 0,
  27504. skyboxOpacityDelay: 0,
  27505. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  27506. fovLength: 1,
  27507. fovDelay: 0,
  27508. cameraMatrixDuration: .8,
  27509. cameraMatrixDelay: .3,
  27510. cameraMatrixEase: c.easeInCubic,
  27511. reticuleOpacity: 1,
  27512. markerOpacity: 0,
  27513. markerOpacityOnHover: 0
  27514. },
  27515. floorplan: {
  27516. transitionTime: 1e3,
  27517. modelAlpha: 1,
  27518. modelAlphaDelay: 0,
  27519. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  27520. skyboxOpacity: 0,
  27521. skyboxOpacityDelay: 0,
  27522. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  27523. fovLength: 1,
  27524. fovDelay: 0,
  27525. cameraMatrixDuration: .5,
  27526. cameraMatrixDelay: 0,
  27527. cameraMatrixEase: c.easeOutCubic,
  27528. reticuleOpacity: 1,
  27529. markerOpacity: 0,
  27530. markerOpacityOnHover: 0,
  27531. cameraHeight: 50
  27532. },
  27533. transitioning: {
  27534. reticuleOpacity: 0,
  27535. markerOpacity: .3,
  27536. markerOpacityOnHover: 1
  27537. },
  27538. "floorplan-dollhouse": {
  27539. rotationDelay: 0,
  27540. rotationDuration: 1
  27541. },
  27542. "floorplan-panorama": {
  27543. rotationDelay: .5,
  27544. rotationDuration: 1
  27545. },
  27546. "dollhouse-panorama": {
  27547. rotationDelay: .5,
  27548. rotationDuration: 1
  27549. },
  27550. "dollhouse-floorplan": {
  27551. rotationDelay: 0,
  27552. rotationDuration: 1,
  27553. cameraMatrixDuration: 1.05,
  27554. cameraMatrixDelay: .5
  27555. },
  27556. "panorama-dollhouse": {
  27557. rotationDelay: 0,
  27558. rotationDuration: .5
  27559. },
  27560. "panorama-floorplan": {
  27561. transitionTime: 1500,
  27562. rotationDelay: 0,
  27563. rotationDuration: .5
  27564. }
  27565. }),
  27566. p.path.meshFree && (p.path.typ = l.WALK),
  27567. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  27568. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  27569. t.exports = p
  27570. }
  27571. , {
  27572. "./constants": 8,
  27573. "./enum/Colors": 19,
  27574. "./enum/VROption": 47,
  27575. "./enum/Viewmode": 51,
  27576. "./enum/WarpStyle": 52,
  27577. "./util/browser": 182,
  27578. "./util/common": 185,
  27579. "./util/easing": 186,
  27580. "./util/showcase": 193,
  27581. three: 217
  27582. }],
  27583. 167: [function(e, t, i) {//"../shaders"
  27584. "use strict";
  27585. var n = e("three")
  27586. , r = e("./settings")
  27587. , o = "precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n"
  27588. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  27589. t.exports = {
  27590. basicTextured: {
  27591. uniforms: {
  27592. tDiffuse: {
  27593. type: "t",
  27594. value: null
  27595. },
  27596. alpha: {
  27597. type: "f",
  27598. value: 1
  27599. }
  27600. },
  27601. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27602. fragmentShader: "varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  27603. },
  27604. copyCubeMap: {
  27605. uniforms: {
  27606. tDiffuse: {
  27607. type: "t",
  27608. value: null
  27609. },
  27610. alpha: {
  27611. type: "f",
  27612. value: 1
  27613. }
  27614. },
  27615. vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27616. fragmentShader: "varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  27617. },
  27618. cube: {
  27619. uniforms: {
  27620. map: {
  27621. type: "t",
  27622. value: null
  27623. },
  27624. opacity: {
  27625. type: "f",
  27626. value: 1
  27627. }
  27628. },
  27629. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  27630. fragmentShader: a + "uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n"
  27631. },
  27632. model: {
  27633. uniforms: {
  27634. map: {
  27635. type: "t",
  27636. value: null
  27637. },
  27638. modelAlpha: {
  27639. type: "f",
  27640. value: r.modelAlpha
  27641. },
  27642. opacity: {
  27643. type: "f",
  27644. value: 1
  27645. },
  27646. progress: {
  27647. type: "f",
  27648. value: 0
  27649. },
  27650. blackout: {
  27651. type: "i",
  27652. value: 0
  27653. },
  27654. pano0Map: {
  27655. type: "t",
  27656. value: null
  27657. },
  27658. pano0Position: {
  27659. type: "v3",
  27660. value: new n.Vector3
  27661. },
  27662. pano0Matrix: {
  27663. type: "m4",
  27664. value: new n.Matrix4
  27665. },
  27666. pano1Map: {
  27667. type: "t",
  27668. value: null
  27669. },
  27670. pano1Position: {
  27671. type: "v3",
  27672. value: new n.Vector3
  27673. },
  27674. pano1Matrix: {
  27675. type: "m4",
  27676. value: new n.Matrix4
  27677. }
  27678. },
  27679. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27680. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  27681. },
  27682. floorLogo: {//改
  27683. uniforms: {
  27684. map: {
  27685. type: "t",
  27686. value: null
  27687. },
  27688. opacity:{
  27689. type:"f",
  27690. value: 0
  27691. },
  27692. opaRadius:{//百分比
  27693. type:"f",
  27694. value: 0.2
  27695. }
  27696. },
  27697. vertexShader: "varying vec2 vUv;void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );}",
  27698. fragmentShader: "uniform sampler2D map; uniform float opacity;uniform float opaRadius;varying vec2 vUv; void main() { vec2 vUv2 = vec2(vUv.x*2.0 - 1.0, vUv.y*2.0 - 1.0); vec4 colorFromTexture = texture2D( map, vUv ); float opa = 1.0; float r = vUv2.x*vUv2.x + vUv2.y*vUv2.y; if(r > 1.0) opa = 0.0; else if(r < opaRadius)opa = 1.0; else{ float a = -1.0 / ((opaRadius - 1.0)*(opaRadius - 1.0)); float b = -2.0 * a * opaRadius; float c = 1.0 + a * opaRadius * opaRadius; opa = a * r*r + b * r + c; } gl_FragColor = vec4(colorFromTexture.rgb, opacity * min(colorFromTexture.a, opa) );}"
  27699. },
  27700. modelOutside: {
  27701. uniforms: {
  27702. map: {
  27703. type: "t",
  27704. value: null
  27705. },
  27706. opacity: {
  27707. type: "f",
  27708. value: 1
  27709. }
  27710. },
  27711. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27712. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n"
  27713. },
  27714. ribbon: {
  27715. uniforms: {
  27716. map: {
  27717. type: "t",
  27718. value: null
  27719. },
  27720. opacity: {
  27721. type: "f",
  27722. value: 1
  27723. },
  27724. color: {
  27725. type: "c",
  27726. value: new n.Color(r.path.color)
  27727. }
  27728. },
  27729. vertexShader: o + "varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n",
  27730. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n"
  27731. },
  27732. waypoint: {
  27733. uniforms: {
  27734. map: {
  27735. type: "t",
  27736. value: null
  27737. },
  27738. opacity: {
  27739. type: "f",
  27740. value: 1
  27741. },
  27742. pulse: {
  27743. type: "f",
  27744. value: 1
  27745. },
  27746. nearFade: {
  27747. type: "v2",
  27748. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  27749. },
  27750. color: {
  27751. type: "c",
  27752. value: new n.Color(r.reticuleColor)
  27753. }
  27754. },
  27755. vertexShader: o + "varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n",
  27756. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n"
  27757. },
  27758. modelDebug: {
  27759. uniforms: {
  27760. map: {
  27761. type: "t",
  27762. value: null
  27763. },
  27764. modelAlpha: {
  27765. type: "f",
  27766. value: r.modelAlpha
  27767. },
  27768. depthmapRatio: {
  27769. type: "f",
  27770. value: 0
  27771. },
  27772. opacity: {
  27773. type: "f",
  27774. value: 1
  27775. },
  27776. progress: {
  27777. type: "f",
  27778. value: 0
  27779. },
  27780. considerOcclusion: {
  27781. type: "i",
  27782. value: r.fancierTransition
  27783. },
  27784. highlightPanoSelection: {
  27785. type: "i",
  27786. value: 0
  27787. },
  27788. useThirdPano: {
  27789. type: "i",
  27790. value: r.useThirdPano
  27791. },
  27792. pano0Map: {
  27793. type: "t",
  27794. value: null
  27795. },
  27796. pano0Depth: {
  27797. type: "t",
  27798. value: null
  27799. },
  27800. pano0Position: {
  27801. type: "v3",
  27802. value: new n.Vector3
  27803. },
  27804. pano0Matrix: {
  27805. type: "m4",
  27806. value: new n.Matrix4
  27807. },
  27808. pano0Weight: {
  27809. type: "f",
  27810. value: r.transition.pano0Weight
  27811. },
  27812. pano1Map: {
  27813. type: "t",
  27814. value: null
  27815. },
  27816. pano1Depth: {
  27817. type: "t",
  27818. value: null
  27819. },
  27820. pano1Position: {
  27821. type: "v3",
  27822. value: new n.Vector3
  27823. },
  27824. pano1Matrix: {
  27825. type: "m4",
  27826. value: new n.Matrix4
  27827. },
  27828. pano1Weight: {
  27829. type: "f",
  27830. value: r.transition.pano1Weight
  27831. },
  27832. pano2Map: {
  27833. type: "t",
  27834. value: null
  27835. },
  27836. pano2Depth: {
  27837. type: "t",
  27838. value: null
  27839. },
  27840. pano2Position: {
  27841. type: "v3",
  27842. value: new n.Vector3
  27843. },
  27844. pano2Matrix: {
  27845. type: "m4",
  27846. value: new n.Matrix4
  27847. },
  27848. pano2Weight: {
  27849. type: "f",
  27850. value: r.transition.pano2Weight
  27851. }
  27852. },
  27853. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27854. fragmentShader: a + "uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n"
  27855. },
  27856. customDepth: {
  27857. uniforms: {
  27858. panoPosition: {
  27859. type: "v3",
  27860. value: new n.Vector3
  27861. }
  27862. },
  27863. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27864. fragmentShader: a + "uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n"
  27865. },
  27866. skysphere: {
  27867. uniforms: {
  27868. radius: {
  27869. type: "f",
  27870. value: 0
  27871. }
  27872. },
  27873. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27874. fragmentShader: a + "varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n"
  27875. },
  27876. tagDisc: {
  27877. uniforms: {
  27878. opacity: {
  27879. type: "f",
  27880. value: 1
  27881. },
  27882. color: {
  27883. type: "c",
  27884. value: new n.Color
  27885. },
  27886. bg: {
  27887. type: "t",
  27888. value: null
  27889. },
  27890. mask: {
  27891. type: "t",
  27892. value: null
  27893. }
  27894. },
  27895. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27896. fragmentShader: a + "uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n"
  27897. }
  27898. }
  27899. }
  27900. , {
  27901. "./settings": 166,
  27902. three: 217
  27903. }],
  27904. 168: [function(e, t, i) {///js/showcase.js
  27905. (function(i) {
  27906. "use strict";
  27907. var n = e("three")
  27908. , r = (e("url"),
  27909. e("./util/ajax"))
  27910. , o = e("./settings")
  27911. , a = e("./util/logger")
  27912. , s = e("./util/math")
  27913. , l = e("./util/showcase")
  27914. , c = e("./objects/Panorama")
  27915. , h = new a(i)
  27916. , u = e("./model/Model")
  27917. , d = e("./shaders")
  27918. , p = e("./util/transitions")
  27919. , f = e("./objects/Chunk")
  27920. , g = e("./objects/Reticule")
  27921. , m = e("./objects/Skybox")
  27922. , v = e("./objects/Floor")
  27923. , A = e("./cameras/DollhouseCamera")
  27924. , y = e("./cameras/FloorplanCamera")
  27925. , C = e("./cameras/PanoramaCamera")
  27926. , I = e("./controls/DollhouseControls")
  27927. , E = e("./controls/FloorplanControls")
  27928. , b = e("./controls/PanoramaControls");
  27929. n.ImageUtils.crossOrigin = o.crossOrigin,
  27930. t.exports = {
  27931. shaders: d,
  27932. transitions: p,
  27933. Model: u,
  27934. Chunk: f,
  27935. Floor: v,
  27936. Skybox: m,
  27937. Reticule: g,
  27938. Panorama: c,
  27939. DollhouseCamera: A,
  27940. FloorplanCamera: y,
  27941. PanoramaCamera: C,
  27942. DollhouseControls: I,
  27943. FloorplanControls: E,
  27944. PanoramaControls: b,
  27945. getModel: function(e) {
  27946. if (!e.url)
  27947. throw 'getModel(): missing parameter "url"';
  27948. e.autoload = void 0 === e.autoload || e.autoload;
  27949. var t = l.parseSidUrl(e.url);
  27950. e.urlBase = t.urlBase,
  27951. e.urlModel = t.urlModel,
  27952. e.urlFiles = t.urlFiles;
  27953. var i = this._getPlatformError();
  27954. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27955. this._loadModel().then(this._buildModel.bind(this)))
  27956. },
  27957. _getPlatformError: function() {
  27958. return "IE" === $.ua.browser.name && parseInt($.ua.browser.major) < 11 ? "webgl-unsupported" : "iOS" === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version) ? "webgl-ios" : Modernizr.webgl ? null : "webgl-unsupported"
  27959. },
  27960. _loadModel: function() {
  27961. return r.get(this.options.urlModel, {
  27962. responseType: "json",
  27963. prefetchFrom: "model",
  27964. auth: l.getAuthorizationHeader()
  27965. }).then(null, function() {
  27966. return h.warn("Model loading failed at initial metadata load"),
  27967. "loading-failed"
  27968. })
  27969. },
  27970. _buildModel: function(e) {
  27971. e = l.normalizeModeldata(e, s);
  27972. var t = new u(this.options,e);
  27973. return this.options.autoload ? t.load(!0) : $.when(t)
  27974. }
  27975. }
  27976. }
  27977. ).call(this, "/js/showcase.js")
  27978. }
  27979. , {
  27980. "./cameras/DollhouseCamera": 5,
  27981. "./cameras/FloorplanCamera": 6,
  27982. "./cameras/PanoramaCamera": 7,
  27983. "./controls/DollhouseControls": 10,
  27984. "./controls/FloorplanControls": 11,
  27985. "./controls/PanoramaControls": 13,
  27986. "./model/Model": 139,
  27987. "./objects/Chunk": 144,
  27988. "./objects/Floor": 146,
  27989. "./objects/Panorama": 148,
  27990. "./objects/Reticule": 149,
  27991. "./objects/Skybox": 152,
  27992. "./settings": 166,
  27993. "./shaders": 167,
  27994. "./util/ajax": 181,
  27995. "./util/logger": 189,
  27996. "./util/math": 190,
  27997. "./util/showcase": 193,
  27998. "./util/transitions": 195,
  27999. three: 217,
  28000. url: 208
  28001. }],
  28002. 169: [function(e, t, i) {//./tile/PanoRenderer
  28003. "use strict";
  28004. function n() {
  28005. var e = {
  28006. renderTarget: null,
  28007. inUse: !1,
  28008. size: -1,
  28009. pano: null
  28010. };
  28011. return e
  28012. }
  28013. function r(e) {
  28014. M.push(e)
  28015. }
  28016. function o(e) {
  28017. var t = n();
  28018. return t.inUse = !0,
  28019. t.size = e,
  28020. r(t),
  28021. t
  28022. }
  28023. function a(e) {
  28024. for (var t = 0; t < M.length; t++) {
  28025. var i = M[t];
  28026. if (!i.inUse && i.size === e)
  28027. return i.inUse = !0,
  28028. i
  28029. }
  28030. return null
  28031. }
  28032. function s(e) {
  28033. for (var t = 0; t < M.length; t++) {
  28034. var i = M[t];
  28035. if (i.renderTarget === e)
  28036. return i.inUse = !1,
  28037. !0
  28038. }
  28039. return !1
  28040. }
  28041. function l() {
  28042. this.tileDirectory = {},
  28043. this.activeRenderTargetDescriptors = {},
  28044. this.activePanos = [],
  28045. this.panoLODDescriptors = {},
  28046. this.panoDescriptors = {},
  28047. this.tileTrees = {},
  28048. this.sceneRenderer = null,
  28049. this.tileDownloader = null,
  28050. this.forceQueue = [],
  28051. this.uploadQueues = {},
  28052. this.uploadInterval = null,
  28053. this.uploadIntervalCancelled = !1,
  28054. this.usingTileOverlay = !1,
  28055. this.overlayTilesLoaded = !1,
  28056. this.overlayTileBase = null,
  28057. this.overlayTilesBasic = {},
  28058. this.overlayTilesEnhanced = {},
  28059. this.zoomRenderTarget = null,
  28060. this.zoomPano = null,
  28061. this.zoomingActive = !1,
  28062. this.zoomPanoId = null,
  28063. this.zoomPanoRenderingDisabled = !1,
  28064. this.direction = new h.Vector3,
  28065. this.initTime = -1,
  28066. this.maxBaseUploadsPerFrame = x,
  28067. this.maxNonBaseUploadsPerFrame = T
  28068. }
  28069. function c() {
  28070. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  28071. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  28072. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  28073. }
  28074. var h = e("three")
  28075. , u = e("../exception/BasicException")
  28076. , d = e("../settings")
  28077. , p = e("../enum/PanoSizeClass")
  28078. , f = (e("../objects/Panorama"),
  28079. e("../enum/PanoRendererEvents"))
  28080. , g = e("../enum/SceneRendererEvents")
  28081. , m = e("../enum/TileDownloaderEvents")
  28082. , v = e("../enum/Vectors")
  28083. , A = (e("../enum/GLCubeFaces"),
  28084. e("../objects/Panorama"),
  28085. e("./TileTree"))
  28086. , y = (e("./TileDownloader"),
  28087. e("./TilePrioritizer"))
  28088. , C = e("./TileUtils")
  28089. , p = e("../enum/PanoSizeClass")
  28090. , I = (e("../util/browser"),
  28091. e("../util/panorama"))
  28092. , E = e("events").EventEmitter
  28093. , b = !1
  28094. , w = d.tiling.uploadIntervalDelay
  28095. , _ = d.tiling.initialIntervalDelay
  28096. , T = d.tiling.maxNonBaseUploadsPerFrame
  28097. , x = d.tiling.maxBaseUploadsPerFrame
  28098. , S = {
  28099. Base: 0,
  28100. Remaining: 1
  28101. }
  28102. , M = [];
  28103. l.prototype = Object.create(E.prototype),
  28104. l.prototype.init = function(e, t, i) {
  28105. this.sceneRenderer = e,
  28106. this.tileDownloader = t,
  28107. this.qualityManager = i,
  28108. this.bindEvents(),
  28109. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  28110. this.initTime = performance.now()
  28111. }
  28112. ,
  28113. l.prototype.getActivePanoTextures = function(e) {
  28114. e = e || [];
  28115. for (var t = 0; t < M.length; t++) {
  28116. var i = M[t];
  28117. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  28118. }
  28119. }
  28120. ,
  28121. l.prototype.hasQueuedTiles = function() {
  28122. var e = this.peekNextFromUploadQueue();
  28123. return null !== e && void 0 !== e
  28124. }
  28125. ,
  28126. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  28127. return this.activeRenderTargetDescriptors[e]
  28128. }
  28129. ,
  28130. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  28131. this.activeRenderTargetDescriptors[e] = t
  28132. }
  28133. ,
  28134. l.prototype.loadOverlayTiles = function() {
  28135. if (0 !== d.tiling.overlayStyle) {
  28136. var e = 0
  28137. , t = function(t, n, r) {
  28138. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  28139. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  28140. e++,
  28141. e === i.length && (this.overlayTilesLoaded = !0)
  28142. }
  28143. .bind(this)
  28144. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  28145. i.forEach(function(e) {
  28146. this.tileDownloader.loadImage(e[0], 0, e[1])
  28147. }
  28148. .bind(this)),
  28149. this.usingTileOverlay = !0
  28150. } else
  28151. this.usingTileOverlay = !1
  28152. }
  28153. ,
  28154. l.prototype.bindEvents = function() {
  28155. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  28156. }
  28157. ,
  28158. l.prototype.setupZoomRenderTarget = function() {
  28159. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  28160. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  28161. return;
  28162. var e = this.zoomRenderTarget;
  28163. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  28164. e) {
  28165. var t = e.width
  28166. , i = this.zoomRenderTarget.width;
  28167. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  28168. e.texture.dispose(),
  28169. e.texture.loaded = !1,
  28170. e.texture.version = 0,
  28171. this.sceneRenderer.deallocateCubeTexture(e.texture),
  28172. e.texture = null
  28173. }
  28174. this.zoomPanoRenderingDisabled = !1
  28175. } else
  28176. this.zoomPanoRenderingDisabled = !0
  28177. }
  28178. ,
  28179. l.prototype.enableUltraHighQualityMode = function(e) {
  28180. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  28181. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  28182. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  28183. t && (this.qualityManager.enableUltraHighQualityMode(),
  28184. this.setupZoomRenderTarget(),
  28185. e())
  28186. }
  28187. .bind(this))
  28188. }
  28189. }
  28190. ,
  28191. l.prototype.activateTiledPano = function(e, t, i) {
  28192. i && this.clearAllQueuedUploads();
  28193. for (var n = 0; n < C.FACES_PER_PANO; n++)
  28194. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  28195. this.linkAllTilesAndNodes(e);
  28196. var r = this.getActiveRenderTargetDescriptor(e.id)
  28197. , l = t;
  28198. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  28199. !r || l !== r.size) {
  28200. if (r && s(r.renderTarget),
  28201. r = a(l),
  28202. !r) {
  28203. var c = this.initTiledPano(l, !1);
  28204. r = o(c.width),
  28205. r.renderTarget = c
  28206. }
  28207. r.pano = e,
  28208. this.resetPanoDescriptor(e.id),
  28209. this.resetPanoLODDescriptors(e.id),
  28210. this.resetRenderStatus(e.id, !0, !0)
  28211. }
  28212. this.setActiveRenderTargetDescriptor(e.id, r);
  28213. var h = i ? 0 : 1;
  28214. return this.updateActivePanos(e, h),
  28215. r.renderTarget
  28216. }
  28217. ,
  28218. l.prototype.deactivateTiledPano = function(e) {
  28219. var t = this.getActiveRenderTargetDescriptor(e.id);
  28220. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  28221. this.setActiveRenderTargetDescriptor(e.id, null);
  28222. var i = this.getUploadQueueForPano(e.id);
  28223. this.clearUploadQueue(i),
  28224. this.updateActivePanos()
  28225. }
  28226. ,
  28227. l.prototype.updateActivePanos = function() {
  28228. var e = [];
  28229. return function(t, i) {
  28230. e.length = 0;
  28231. for (var n = 0; n < this.activePanos.length; n++) {
  28232. t && e.length === i && e.push(t);
  28233. var r = this.activePanos[n]
  28234. , o = this.getActiveRenderTargetDescriptor(r.id);
  28235. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  28236. }
  28237. t && i >= e.length && e.push(t),
  28238. this.activePanos.length = 0,
  28239. this.activePanos.push.apply(this.activePanos, e)
  28240. }
  28241. }(),
  28242. l.prototype.getActivePanoCount = function() {
  28243. return this.activePanos.length
  28244. }
  28245. ,
  28246. l.prototype.resetRenderStatus = function(e, t, i, n) {
  28247. var r = null;
  28248. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  28249. for (var o = function(e, n, r, o) {
  28250. i && (n.tile.zoomUploaded = !1),
  28251. t && (n.tile.uploaded = !1)
  28252. }, a = 0; a < C.FACES_PER_PANO; a++) {
  28253. var s = this.getTileTree(e, a);
  28254. s.breadthFirst({
  28255. callback: o.bind(this, a),
  28256. minLevel: r
  28257. })
  28258. }
  28259. }
  28260. ,
  28261. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  28262. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  28263. t.tile.zoomUploaded = t.tile.uploaded,
  28264. t.zoomCovered = t.covered
  28265. }, n = 0; n < C.FACES_PER_PANO; n++) {
  28266. var r = this.getTileTree(e, n);
  28267. r.breadthFirst({
  28268. callback: i.bind(this, n),
  28269. maxLevel: t
  28270. })
  28271. }
  28272. }
  28273. ,
  28274. l.prototype.renderPanoTiles = function() {
  28275. var e = [];
  28276. return function(t, i, n, r) {
  28277. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  28278. i = i || this.direction || v.FORWARD;
  28279. var o = this.getActiveRenderTargetDescriptor(t);
  28280. if (!this.isRenderTargetDescriptorValid(o))
  28281. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  28282. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  28283. var s = this.getTileTree(t, a);
  28284. e.length = 0,
  28285. s.breadthFirst({
  28286. saveVisited: e
  28287. });
  28288. for (var l = 0; l < e.length; l++) {
  28289. var c = e[l];
  28290. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  28291. }
  28292. }
  28293. this.updateDirection(i)
  28294. }
  28295. }(),
  28296. l.prototype.isRenderTargetDescriptorValid = function(e) {
  28297. return e && e.renderTarget
  28298. }
  28299. ,
  28300. l.prototype.isPanoActive = function(e) {
  28301. var t = this.getActiveRenderTargetDescriptor(e);
  28302. return this.isRenderTargetDescriptorValid(t)
  28303. }
  28304. ,
  28305. l.prototype.isPanoZoomed = function(e) {
  28306. return this.zoomingActive && this.zoomPanoId === e
  28307. }
  28308. ,
  28309. l.prototype.initTileTree = function(e, t, i) {
  28310. var n = this.tileTrees[e];
  28311. n || (n = [],
  28312. this.tileTrees[e] = n);
  28313. var r = n[t];
  28314. if (!r) {
  28315. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  28316. r = new A(C.TILE_SIZE,o),
  28317. n[t] = r
  28318. }
  28319. }
  28320. ,
  28321. l.prototype.getTileTree = function(e, t) {
  28322. var i = this.tileTrees[e];
  28323. if (!i)
  28324. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  28325. var n = i[t];
  28326. if (!n)
  28327. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  28328. return n
  28329. }
  28330. ,
  28331. l.prototype.initTiledPano = function(e, t) {
  28332. var i = this.sceneRenderer.renderer
  28333. , n = (i.context,
  28334. new h.WebGLRenderTargetCube(e,e,{
  28335. stencilBuffer: !1
  28336. }))
  28337. , r = new h.CubeTexture([]);
  28338. n.texture = r,
  28339. r.image = [null, null, null, null, null, null],
  28340. r.flipY = !0,
  28341. t ? (r.generateMipmaps = !0,
  28342. r.magFilter = h.LinearFilter,
  28343. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  28344. r.magFilter = h.LinearFilter,
  28345. r.minFilter = h.LinearFilter),
  28346. r.format = h.RGBAFormat,
  28347. i.setRenderTarget(n),
  28348. i.setRenderTarget(null);
  28349. var o = i.properties.get(r);
  28350. return o.__image__webglTextureCube = o.__webglTexture,
  28351. n
  28352. }
  28353. ,
  28354. l.prototype.getUploadQueueForPano = function(e) {
  28355. var t = this.uploadQueues[e];
  28356. return t || (t = [],
  28357. this.uploadQueues[e] = t),
  28358. t
  28359. }
  28360. ,
  28361. l.prototype.isTileUploaded = function(e) {
  28362. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  28363. }
  28364. ,
  28365. l.prototype.setUploaded = function(e, t) {
  28366. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  28367. }
  28368. ,
  28369. l.prototype.queueTileUpload = function(e, t, i) {
  28370. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  28371. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  28372. var r = this.getUploadQueueForPano(e.panoId);
  28373. i ? this.uploadTile(e, !1) : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  28374. e.uploadQueued = !0,
  28375. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  28376. }
  28377. }
  28378. ,
  28379. l.prototype.shoulPushToFrontOfQueue = function(e) {
  28380. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  28381. }
  28382. ,
  28383. l.prototype.getTopUploadQueue = function() {
  28384. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  28385. for (var n = 0; n < this.activePanos.length; n++)
  28386. if (e = this.activePanos[n],
  28387. t = this.getUploadQueueForPano(e.id),
  28388. t.length > 0)
  28389. switch (i) {
  28390. case S.Base:
  28391. if (0 === t[0].level)
  28392. return t;
  28393. break;
  28394. case S.Remaining:
  28395. return t
  28396. }
  28397. return null
  28398. }
  28399. ,
  28400. l.prototype.getNextFromUploadQueue = function() {
  28401. var e = function(e) {
  28402. var t = e.shift();
  28403. return t.uploadQueued = !1,
  28404. t
  28405. };
  28406. return function() {
  28407. if (this.forceQueue.length > 0)
  28408. return e(this.forceQueue);
  28409. var t = this.getTopUploadQueue();
  28410. return t && t.length > 0 ? e(t) : null
  28411. }
  28412. }(),
  28413. l.prototype.peekNextFromUploadQueue = function() {
  28414. if (this.forceQueue.length > 0)
  28415. return this.forceQueue[0];
  28416. var e = this.getTopUploadQueue();
  28417. return e && e.length > 0 ? e[0] : null
  28418. }
  28419. ,
  28420. l.prototype.clearAllQueuedUploads = function() {
  28421. this.clearAllUploadQueues(null, 0)
  28422. }
  28423. ,
  28424. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  28425. this.clearAllUploadQueues(e, 0)
  28426. }
  28427. ,
  28428. l.prototype.clearAllUploadQueues = function(e, t) {
  28429. if (e)
  28430. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  28431. this.clearUploadQueue(this.forceQueue, t, e);
  28432. else {
  28433. for (var i = 0; i < this.activePanos.length; i++) {
  28434. var n = this.activePanos[i];
  28435. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  28436. }
  28437. this.clearUploadQueue(this.forceQueue, t)
  28438. }
  28439. }
  28440. ,
  28441. l.prototype.clearUploadQueue = function(e, t, i) {
  28442. void 0 !== t && null !== t || (t = 0);
  28443. for (var n = 0; n < e.length; ) {
  28444. var r = e[n];
  28445. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  28446. e.splice(n, 1)) : n++
  28447. }
  28448. }
  28449. ,
  28450. l.prototype.refreshUploadInterval = function() {
  28451. var e = null;
  28452. return function(t) {
  28453. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  28454. null !== t && void 0 !== t || (t = w),
  28455. b || (t = _),
  28456. this.uploadInterval = window.setTimeout(e, t),
  28457. this.uploadIntervalDelay = t)
  28458. }
  28459. }(),
  28460. l.prototype.update = function() {
  28461. var e = performance.now()
  28462. , t = 0;
  28463. return function() {
  28464. this.uploadIntervalCancelled = !0,
  28465. window.clearTimeout(this.uploadInterval),
  28466. this.uploadInterval = null;
  28467. var i = performance.now() - e;
  28468. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  28469. e = performance.now()),
  28470. t++
  28471. }
  28472. }(),
  28473. l.prototype.updateUploadQueue = function(e, t) {
  28474. e || (e = 1);
  28475. for (var i = 0, n = 0; ; ) {
  28476. if (n >= t || i >= e)
  28477. break;
  28478. var r = this.getNextFromUploadQueue();
  28479. if (!r)
  28480. break;
  28481. if (0 !== r.level ? i++ : n++,
  28482. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  28483. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  28484. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  28485. }
  28486. }
  28487. }
  28488. ,
  28489. l.prototype.updateDirection = function(e) {
  28490. if (e = e || this.direction) {
  28491. this.direction = e;
  28492. for (var t = 0; t < this.activePanos.length; t++) {
  28493. var i = this.activePanos[t]
  28494. , n = this.getUploadQueueForPano(i.id);
  28495. y.sortPanoTiles(n, i, this.direction)
  28496. }
  28497. }
  28498. }
  28499. ,
  28500. l.prototype.uploadTile = function() {
  28501. var e = {}
  28502. , t = (new h.Vector4,
  28503. d.tiling.overlayStyle);
  28504. return function(i, n) {
  28505. var r = i.panoId
  28506. , o = i.image
  28507. , a = i.tileSize
  28508. , s = i.panoSize
  28509. , l = i.tileIndex
  28510. , c = (i.faceTileIndex,
  28511. i.totalTiles)
  28512. , u = (i.face,
  28513. i.tileX)
  28514. , d = i.tileY
  28515. , p = !0
  28516. , g = !1
  28517. , m = (this.getPanoDescriptor(r),
  28518. this.getPanoLODDescriptor(r, s))
  28519. , v = this.getActiveRenderTargetDescriptor(r)
  28520. , A = v.renderTarget
  28521. , y = v.size;
  28522. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  28523. y = this.qualityManager.getMaxZoomPanoSize()),
  28524. this.isRenderTargetDescriptorValid(v) || (p = !1,
  28525. g = !1),
  28526. n || (this.anyUploaded(i.node) && (p = !1,
  28527. g = !0),
  28528. this.isTileUploaded(i) && (p = !1,
  28529. g = !1)),
  28530. p) {
  28531. var C = u * a
  28532. , I = d * a
  28533. , E = a / s * y
  28534. , b = C / s * y
  28535. , w = I / s * y;
  28536. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  28537. var _ = e[a];
  28538. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  28539. 1 === t || 2 === t) {
  28540. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  28541. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  28542. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  28543. } else
  28544. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  28545. m.uploadCount++,
  28546. this.emit(f.TileRenderSuccess, r, s, l, c),
  28547. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  28548. this.setUploaded(i, !0),
  28549. this.addCoverageForNode(i.node)
  28550. } else
  28551. this.setUploaded(i, !1);
  28552. return i.uploadAttempted || (m.uploadAttempts++,
  28553. this.emit(f.TileUploadAttempted, r, s, l, c)),
  28554. i.uploadAttempted = !0,
  28555. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  28556. g
  28557. }
  28558. }(),
  28559. l.prototype.linkTileAndNode = function(e, t) {
  28560. t.tile = e,
  28561. e.node = t
  28562. }
  28563. ,
  28564. l.prototype.linkAllTilesAndNodes = function(e) {
  28565. for (var t = function(t, i, n, r, o) {
  28566. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  28567. this.linkTileAndNode(a, n)
  28568. }, i = 0; i < C.FACES_PER_PANO; i++) {
  28569. var n = this.getTileTree(e.id, i);
  28570. n.breadthFirst({
  28571. callback: t.bind(this, n, i)
  28572. })
  28573. }
  28574. }
  28575. ,
  28576. l.prototype.anyUploaded = function(e) {
  28577. if (!e)
  28578. return !1;
  28579. if (e.tile && this.isTileUploaded(e.tile))
  28580. return !0;
  28581. if (e.children)
  28582. for (var t = 0; t < e.children.length; t++) {
  28583. var i = e.children[t];
  28584. if (this.anyUploaded(i))
  28585. return !0
  28586. }
  28587. return !1
  28588. }
  28589. ,
  28590. l.prototype.setNodeCovered = function(e, t) {
  28591. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  28592. }
  28593. ,
  28594. l.prototype.isNodeCovered = function(e) {
  28595. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  28596. }
  28597. ,
  28598. l.prototype.addCoverageForNode = function(e) {
  28599. if (this.setNodeCovered(e, !0),
  28600. e.parent && e.covered) {
  28601. var t = e.parent;
  28602. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  28603. }
  28604. }
  28605. ,
  28606. l.prototype.calcFullCoverage = function(e) {
  28607. var t = !1;
  28608. if (e.children)
  28609. for (var i = 0; i < e.children.length; i++) {
  28610. var n = e.children[i];
  28611. t = t || this.calcFullCoverage(n)
  28612. }
  28613. e.covered = e.tile.uploaded || t
  28614. }
  28615. ,
  28616. l.prototype.nodeSubcovered = function(e) {
  28617. if (!e.children)
  28618. return !1;
  28619. for (var t = 0; t < e.children.length; t++)
  28620. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  28621. return !1;
  28622. return !0
  28623. }
  28624. ,
  28625. l.prototype.resetPanoDescriptor = function(e) {
  28626. this.getPanoDescriptor(e)
  28627. }
  28628. ,
  28629. l.prototype.getPanoDescriptor = function(e) {
  28630. var t = this.panoDescriptors[e];
  28631. return t || (t = {},
  28632. this.panoDescriptors[e] = t),
  28633. t
  28634. }
  28635. ,
  28636. l.prototype.resetPanoLODDescriptors = function(e) {
  28637. var t = this.getPanoLODDescriptors(e);
  28638. for (var i in t)
  28639. if (t.hasOwnProperty(i)) {
  28640. var n = t[i];
  28641. n.uploadCount = 0,
  28642. n.uploadAttempts = 0
  28643. }
  28644. }
  28645. ,
  28646. l.prototype.getPanoLODDescriptor = function(e, t) {
  28647. var i = this.getPanoLODDescriptors(e)
  28648. , n = i[t];
  28649. return n || (n = {
  28650. uploadCount: 0,
  28651. uploadAttempts: 0
  28652. },
  28653. i[t] = n),
  28654. n
  28655. }
  28656. ,
  28657. l.prototype.getPanoLODDescriptors = function(e) {
  28658. var t = this.panoLODDescriptors[e];
  28659. return t || (t = {},
  28660. this.panoLODDescriptors[e] = t),
  28661. t
  28662. }
  28663. ,
  28664. l.prototype.onTileDownloaded = function(e) {
  28665. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  28666. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  28667. if (i.downloaded = !0,
  28668. i.image = e.image,
  28669. i.panoSize = e.panoSize,
  28670. i.tileX = e.tileX,
  28671. i.tileY = e.tileY,
  28672. i.totalTiles = e.totalTiles,
  28673. i.tileIndex = e.tileIndex,
  28674. i.faceTileIndex = e.faceTileIndex,
  28675. i.face = e.face,
  28676. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  28677. i.panoId = e.panoId,
  28678. i.tileSize = e.tileSize,
  28679. i.direction = (new h.Vector3).copy(e.direction),
  28680. i.node = null,
  28681. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  28682. this.isPanoActive(i.panoId)) {
  28683. var n = this.getTileTree(i.panoId, i.face)
  28684. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  28685. this.linkTileAndNode(i, r),
  28686. this.queueTileUpload(i, !0)
  28687. }
  28688. }
  28689. ,
  28690. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  28691. var r = this.tileDirectory[e];
  28692. r || (r = {},
  28693. this.tileDirectory[e] = r);
  28694. var o = 16384 * t + 1024 * i + n
  28695. , a = r[o];
  28696. return a || (a = {
  28697. downloaded: !1,
  28698. uploaded: !1,
  28699. zoomUploaded: !1
  28700. },
  28701. r[o] = a),
  28702. a._key = e + ":" + t + ":" + i + ":" + n,
  28703. a._tileKey = o,
  28704. a
  28705. }
  28706. ,
  28707. l.prototype.setZoomingActive = function(e, t, i) {
  28708. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  28709. this.zoomPanoId = t.id,
  28710. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  28711. }
  28712. ,
  28713. l.prototype.updateZoomedPanoFromBase = function(e) {
  28714. if (!this.zoomPanoRenderingDisabled) {
  28715. var t = this.getActiveRenderTargetDescriptor(e.id);
  28716. if (t && t.renderTarget) {
  28717. var i = this.qualityManager.getMaxZoomPanoSize()
  28718. , n = t.renderTarget
  28719. , r = t.size;
  28720. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  28721. this.copyBaseRenderStatusToZoomed(e.id)
  28722. }
  28723. }
  28724. }
  28725. ,
  28726. t.exports = l
  28727. }
  28728. , {
  28729. "../enum/GLCubeFaces": 25,
  28730. "../enum/PanoRendererEvents": 35,
  28731. "../enum/PanoSizeClass": 36,
  28732. "../enum/SceneRendererEvents": 43,
  28733. "../enum/TileDownloaderEvents": 45,
  28734. "../enum/Vectors": 50,
  28735. "../exception/BasicException": 55,
  28736. "../objects/Panorama": 148,
  28737. "../settings": 166,
  28738. "../util/browser": 182,
  28739. "../util/panorama": 191,
  28740. "./TileDownloader": 171,
  28741. "./TilePrioritizer": 172,
  28742. "./TileTree": 173,
  28743. "./TileUtils": 174,
  28744. events: 202,
  28745. three: 217
  28746. }],
  28747. 170: [function(e, t, i) {//tile/QualityManager.js
  28748. "use strict";
  28749. function n(e, t, i) {
  28750. this.maxNavPanoSize = -1,
  28751. this.maxZoomPanoSize = -1,
  28752. this.devicePixelDensity = e,
  28753. this.deviceScreenSize = t,
  28754. this.clientBandwidth = i,
  28755. this.panoSizeClassMap = {},
  28756. this.useHighResolutionPanos = !0,
  28757. this.useUltraHighResolutionPanos = !1,
  28758. this.modelHasUltraHighPanos = !1
  28759. }
  28760. var r = e("../enum/PanoSizeClass")
  28761. , o = e("../settings")
  28762. , a = e("../util/browser")
  28763. , s = e("../constants")
  28764. , l = e("../util/showcase")
  28765. , c = e("../enum/ModelManagerEvents");
  28766. n.prototype.init = function(e) {
  28767. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  28768. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  28769. this.highSize = this.getPanoSize(r.HIGH),
  28770. this.standardSize = this.getPanoSize(r.STANDARD),
  28771. this.baseSize = this.getPanoSize(r.BASE),
  28772. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  28773. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  28774. this.updateMaximums(),
  28775. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  28776. }
  28777. ,
  28778. n.prototype.updateFromModel = function(e) {
  28779. this.updateHighResolutionSettings(e),
  28780. this.updateUltraHighResolutionSettings(e)
  28781. }
  28782. ,
  28783. n.prototype.updateHighResolutionSettings = function(e) {
  28784. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  28785. this.updateMaximums()
  28786. }
  28787. ,
  28788. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28789. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28790. this.updateMaximums()
  28791. }
  28792. ,
  28793. n.prototype.enableUltraHighQualityMode = function() {
  28794. this.modelHasUltraHighPanos = !0,
  28795. this.updateUltraHighResolutionSettings(null)
  28796. }
  28797. ,
  28798. n.prototype.ultraHighQualityModeEnabled = function() {
  28799. return this.modelHasUltraHighPanos
  28800. }
  28801. ,
  28802. n.prototype.onModelChanged = function(e) {
  28803. this.updateFromModel(e.model),
  28804. this.updateMaximums()
  28805. }
  28806. ,
  28807. n.prototype.updateMaximums = function() {
  28808. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28809. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28810. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28811. }
  28812. ,
  28813. n.prototype.buildPanoSizeClassMap = function() {
  28814. this.panoSizeClassMap[r.BASE] = 512,
  28815. this.panoSizeClassMap[r.STANDARD] = 1024,
  28816. this.panoSizeClassMap[r.HIGH] = 2048,
  28817. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28818. }
  28819. ,
  28820. n.prototype.getPanoSize = function(e) {
  28821. return this.panoSizeClassMap[e]
  28822. }
  28823. ,
  28824. n.prototype.getMaxPossiblePanoSize = function() {
  28825. return this.getPanoSize(r.ULTRAHIGH)
  28826. }
  28827. ,
  28828. n.prototype.getMaxPanoSize = function() {
  28829. return this.maxZoomPanoSize
  28830. }
  28831. ,
  28832. n.prototype.getMaxNavPanoSize = function() {
  28833. return this.maxNavPanoSize
  28834. }
  28835. ,
  28836. n.prototype.getMaxZoomPanoSize = function() {
  28837. return this.maxZoomPanoSize
  28838. }
  28839. ,
  28840. n.prototype.detectMaxNavPanoSizeClass = function() {
  28841. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : window.innerHeight < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28842. }
  28843. ,
  28844. n.prototype.detectMaxNavPanoSize = function() {
  28845. var e = this.detectMaxNavPanoSizeClass();
  28846. return this.getPanoSize(e)
  28847. }
  28848. ,
  28849. n.prototype.detectMaxZoomPanoSize = function() {
  28850. 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)
  28851. }
  28852. ,
  28853. t.exports = n
  28854. }
  28855. , {
  28856. "../constants": 8,
  28857. "../enum/ModelManagerEvents": 33,
  28858. "../enum/PanoSizeClass": 36,
  28859. "../settings": 166,
  28860. "../util/browser": 182,
  28861. "../util/showcase": 193
  28862. }],
  28863. 171: [function(e, t, i) {///js/tile/TileDownloader.js
  28864. (function(i) {
  28865. "use strict";
  28866. function n(e) {
  28867. this.panos = null,
  28868. this.retryMinimumTime = 1e4,
  28869. this.urls = null,
  28870. this.panoLoadCallbacks = {},
  28871. this.downloadDescriptors = {},
  28872. this.priorityQueue = [],
  28873. this.forceQueue = [],
  28874. this.activeDownloads = [],
  28875. this.qualityManager = null,
  28876. this.tilePrioritizer = null,
  28877. this.refreshInterval = null,
  28878. this.processPriorityQueue = !1,
  28879. this.concurrentDownloads = e.concurrentDownloads || 1,
  28880. this.downloadTestResults = {}
  28881. }
  28882. var r = e("three")
  28883. , o = (e("../enum/Viewmode"),
  28884. e("../settings"))
  28885. , a = (e("../objects/Panorama"),
  28886. e("../util/logger"))
  28887. , s = (e("../enum/Vectors"),
  28888. e("../enum/PanoSizeClass"),
  28889. e("../enum/TileDownloaderEvents"))
  28890. , l = e("./TilePrioritizer")
  28891. , c = e("./TileUtils")
  28892. , h = (e("../enum/GLCubeFaces"),
  28893. e("../enum/DownloadStatus"))
  28894. , u = e("../util/panorama")
  28895. , d = e("../util/ajax")
  28896. , p = e("../ab")
  28897. , f = e("events").EventEmitter
  28898. , g = (new a(i),
  28899. Object.freeze({
  28900. Testing: 1,
  28901. Success: 2,
  28902. Fail: 3
  28903. }));
  28904. n.prototype = Object.create(f.prototype),
  28905. n.IDLE_REFRESH_DELAY = 500,
  28906. n.ACTIVE_REFRESH_DELAY = 16,
  28907. n.DOWNLOAD_RETRIES = 4,
  28908. n.prototype.init = function(e) {
  28909. this.qualityManager = e
  28910. }
  28911. ,
  28912. n.prototype.setUrls = function(e) {
  28913. this.urls = e
  28914. }
  28915. ,
  28916. n.prototype.setPanoData = function(e, t, i) {
  28917. this.panos = e,
  28918. this.imagePanos = t,
  28919. this.panoGroupId = i
  28920. }
  28921. ,
  28922. n.prototype.start = function() {
  28923. this.refreshUpdateInterval(0)
  28924. }
  28925. ,
  28926. n.prototype.stop = function() {
  28927. window.cancel(this.refreshInterval)
  28928. }
  28929. ,
  28930. n.prototype.refreshUpdateInterval = function(e) {
  28931. e || (e = 0),
  28932. this.refreshInterval = window.setTimeout(function() {
  28933. var e = this.update();
  28934. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28935. }
  28936. .bind(this), e)
  28937. }
  28938. ,
  28939. n.prototype.update = function() {
  28940. var e = this.forceQueue.length > 0;
  28941. return this.processQueueForDownloading(this.forceQueue),
  28942. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28943. this.priorityQueue.length > 0 && (e = !0),
  28944. this.processQueueForDownloading(this.priorityQueue)),
  28945. e
  28946. }
  28947. ,
  28948. n.prototype.forceQueueTilesForPano = function() {
  28949. var e = []
  28950. , t = [];
  28951. return function(i, n, r, o, a, s) {
  28952. e.length = 0;
  28953. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28954. var p = u[d];
  28955. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28956. }
  28957. if (r && e.length > 0) {
  28958. l.sortPanoTiles(e, i, r),
  28959. t.length = 0,
  28960. c.matchingTilesInDirection(i, n, r, o, a, t);
  28961. for (var f = 0, g = function(e) {
  28962. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28963. }; f < e.length; ) {
  28964. var m = e[f]
  28965. , v = t.findIndex(g);
  28966. v < 0 ? e.splice(f, 1) : f++
  28967. }
  28968. }
  28969. for (var A = 0; A < e.length; A++)
  28970. this.forceQueue.push(e[A]);
  28971. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28972. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28973. s && this.processQueueForDownloading(this.forceQueue, !0)
  28974. }
  28975. }(),
  28976. n.prototype.clearForceQueue = function() {
  28977. this.clearQueue(this.forceQueue)
  28978. }
  28979. ,
  28980. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28981. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28982. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28983. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28984. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28985. }
  28986. ,
  28987. n.prototype.clearQueue = function(e) {
  28988. this.setStatusForAllDescriptors(e, h.None),
  28989. e.length = 0
  28990. }
  28991. ,
  28992. n.prototype.clearFromQueue = function(e, t, i) {
  28993. for (var n = 0; n < e.length; n++) {
  28994. var r = e[n];
  28995. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28996. }
  28997. }
  28998. ,
  28999. n.prototype.setStatusForAllDescriptors = function(e, t) {
  29000. for (var i = 0; i < e.length; i++) {
  29001. var n = e[i];
  29002. n && (n.status = t)
  29003. }
  29004. }
  29005. ,
  29006. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  29007. for (var i = 0; i < e.length; i++) {
  29008. var n = e[i];
  29009. n && (n.status !== t ? n.status = t : e[i] = null)
  29010. }
  29011. }
  29012. ,
  29013. n.prototype.getTileDownloadDescriptors = function(e, t) {
  29014. var i = this.getAllTileDownloadDescriptorsForPano(e)
  29015. , n = i[t];
  29016. return n || (n = this.buildDownloadDescriptorArray(t),
  29017. i[t] = n,
  29018. this.initTileDownloadDescriptors(n, e, t)),
  29019. n
  29020. }
  29021. ,
  29022. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  29023. var t = this.downloadDescriptors[e.id];
  29024. return t || (t = {},
  29025. this.downloadDescriptors[e.id] = t),
  29026. t
  29027. }
  29028. ,
  29029. n.prototype.processQueueForDownloading = function(e, t) {
  29030. if (this.cleanupActiveDownloads(),
  29031. this.activeDownloads.length < this.concurrentDownloads || t)
  29032. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  29033. var o = e.shift();
  29034. o && (this.startDownload(o),
  29035. n++)
  29036. }
  29037. }
  29038. ,
  29039. n.prototype.testDownload = function(e, t, i) {
  29040. var n = this.downloadTestResults[e];
  29041. if (n)
  29042. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  29043. this.downloadTestResults[e] = g.Testing;
  29044. var r = this.panos.list[0]
  29045. , o = this.getTileUrl(r.id, e, t, 0)
  29046. , a = function(t) {
  29047. this.downloadTestResults[e] = g.Success,
  29048. i(!0)
  29049. }
  29050. .bind(this)
  29051. , s = function() {
  29052. this.downloadTestResults[e] = g.Fail,
  29053. i(!1)
  29054. }
  29055. .bind(this);
  29056. this.loadImage(o, 0, a, s)
  29057. }
  29058. ,
  29059. n.prototype.startDownload = function(e) {
  29060. e.status = h.Downloading;
  29061. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  29062. this.activeDownloads.push(e),
  29063. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  29064. }
  29065. ,
  29066. n.prototype.downloadFailed = function(e, t) {}
  29067. ,
  29068. n.prototype.downloadComplete = function(e, t) {
  29069. if (e.panoGroupId === this.panoGroupId) {
  29070. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  29071. e.status = h.Downloaded,
  29072. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  29073. var n = {
  29074. panoId: e.pano.id,
  29075. image: t,
  29076. tileSize: e.tileSize,
  29077. panoSize: e.panoSize,
  29078. tileIndex: e.tileIndex,
  29079. faceTileIndex: e.faceTileIndex,
  29080. totalTiles: e.totalTiles,
  29081. face: e.face,
  29082. tileX: e.tileX,
  29083. tileY: e.tileY,
  29084. direction: e.direction
  29085. };
  29086. e.image = t,
  29087. this.emit(s.TileDownloadSuccess, n),
  29088. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  29089. panoId: e.pano.id,
  29090. tileSize: e.tileSize,
  29091. panoSize: e.panoSize
  29092. },
  29093. this.emit(s.PanoDownloadComplete, n),
  29094. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  29095. }
  29096. }
  29097. ,
  29098. n.prototype.cleanupActiveDownloads = function() {
  29099. var e = [];
  29100. return function() {
  29101. e.length = 0;
  29102. for (var t = 0; t < this.activeDownloads.length; t++) {
  29103. var i = this.activeDownloads[t];
  29104. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  29105. }
  29106. this.activeDownloads.length = 0,
  29107. this.activeDownloads.push.apply(this.activeDownloads, e)
  29108. }
  29109. }(),
  29110. n.prototype.isPanoDownloaded = function(e, t) {
  29111. var i = this.getTileDownloadDescriptors(e, t);
  29112. if (i.length <= 0)
  29113. return !1;
  29114. for (var n = 0; n < i.length; n++) {
  29115. var r = i[n];
  29116. if (r.status !== h.Downloaded)
  29117. return !1
  29118. }
  29119. return !0
  29120. }
  29121. ,
  29122. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  29123. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  29124. this.panoLoadCallbacks[o] = {
  29125. onLoad: i,
  29126. onFail: n,
  29127. onProgress: r
  29128. }
  29129. }
  29130. ,
  29131. n.prototype.getPanoLoadCallbacks = function(e, t) {
  29132. var i = e.id + ":" + t;
  29133. return this.panoLoadCallbacks[i]
  29134. }
  29135. ,
  29136. n.prototype.buildDownloadDescriptorArray = function(e) {
  29137. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  29138. var r = this.buildDownloadDescriptor();
  29139. i.push(r)
  29140. }
  29141. return i
  29142. }
  29143. ,
  29144. n.prototype.buildDownloadDescriptor = function() {
  29145. var e = {
  29146. panoGroupId: null,
  29147. pano: null,
  29148. panoSize: -1,
  29149. tileSize: -1,
  29150. tileIndex: -1,
  29151. totalTiles: -1,
  29152. faceTileIndex: -1,
  29153. status: h.None,
  29154. url: null,
  29155. image: null,
  29156. direction: new r.Vector3,
  29157. face: -1,
  29158. cubeFace: -1,
  29159. tileX: -1,
  29160. tileY: -1
  29161. };
  29162. return e
  29163. }
  29164. ,
  29165. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  29166. for (var n = 0; n < e.length; n++) {
  29167. var r = e[n];
  29168. this.initTileDownloadDescriptor(r, t, i, n)
  29169. }
  29170. }
  29171. ,
  29172. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  29173. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  29174. e.face = c.getFaceForTile(i, n),
  29175. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  29176. e.panoGroupId = this.panoGroupId,
  29177. e.pano = t,
  29178. e.panoSize = i,
  29179. e.tileSize = r,
  29180. e.tileIndex = n,
  29181. e.totalTiles = c.getTileCountForSize(i),
  29182. e.status = h.None,
  29183. e.image = null,
  29184. c.getTileLocation(e.panoSize, e.tileIndex, e),
  29185. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  29186. }
  29187. ,
  29188. n.prototype.getTileUrl = function() {
  29189. var e = {
  29190. 256: "256",
  29191. 512: "512",
  29192. 1024: "1k",
  29193. 2048: "2k",
  29194. 4096: "4k"
  29195. }
  29196. , t = {
  29197. face: -1,
  29198. faceTileIndex: -1,
  29199. tileX: -1,
  29200. tileY: -1
  29201. };
  29202. return function(i, n, r, a) {
  29203. c.getTileLocation(n, a, t);
  29204. var s = Math.floor(n / r)
  29205. , l = s * s
  29206. , h = Math.floor(a / l)
  29207. , u = "";
  29208. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  29209. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  29210. return d = p.changeIfTileGenerating(d)
  29211. }
  29212. }(),
  29213. n.prototype.loadImage = function(e, t, i, n) {
  29214. d.getImage(e, t).then(function(e) {
  29215. i(e)
  29216. }).fail(n)
  29217. }
  29218. ,
  29219. t.exports = n
  29220. }
  29221. ).call(this, "/js/tile/TileDownloader.js")
  29222. }
  29223. , {
  29224. "../ab": 3,
  29225. "../enum/DownloadStatus": 24,
  29226. "../enum/GLCubeFaces": 25,
  29227. "../enum/PanoSizeClass": 36,
  29228. "../enum/TileDownloaderEvents": 45,
  29229. "../enum/Vectors": 50,
  29230. "../enum/Viewmode": 51,
  29231. "../objects/Panorama": 148,
  29232. "../settings": 166,
  29233. "../util/ajax": 181,
  29234. "../util/logger": 189,
  29235. "../util/panorama": 191,
  29236. "./TilePrioritizer": 172,
  29237. "./TileUtils": 174,
  29238. events: 202,
  29239. three: 217
  29240. }],
  29241. 172: [function(e, t, i) {///js/tile/TilePrioritizer.js
  29242. (function(i) {
  29243. "use strict";
  29244. function n(e, t, i, o, a) {
  29245. this.qualityManager = e,
  29246. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  29247. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  29248. this.baseSize = t,
  29249. this.standardSize = i,
  29250. this.highSize = o,
  29251. this.ultraHighSize = a,
  29252. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  29253. }
  29254. var r = e("three")
  29255. , o = (e("../enum/Viewmode"),
  29256. e("../settings"),
  29257. e("../settings"),
  29258. e("../objects/Panorama"))
  29259. , a = e("../util/logger")
  29260. , s = (e("../enum/Vectors"),
  29261. e("../enum/PanoSizeClass"),
  29262. e("../enum/ModelManagerEvents"),
  29263. e("../enum/GLCubeFaces"),
  29264. e("../enum/DownloadStatus"))
  29265. , l = (e("../util/browser"),
  29266. e("./TileUtils"))
  29267. , c = e("../util/math")
  29268. , h = (e("events").EventEmitter,
  29269. new a(i),
  29270. Object.freeze({
  29271. None: 0,
  29272. DirectionalFOV: 1
  29273. }));
  29274. n.PriorityCriteria = function(e, t, i, n, o) {
  29275. this.pano = e,
  29276. this.cameraPosition = (new r.Vector3).copy(t),
  29277. this.cameraDir = (new r.Vector3).copy(i),
  29278. this.panoSpaceDir = (new r.Vector3).copy(n),
  29279. this.upcomingPanos = o,
  29280. this.copy = function(e) {
  29281. this.pano = e.pano,
  29282. this.cameraPosition.copy(e.cameraPosition),
  29283. this.cameraDir.copy(e.cameraDir),
  29284. this.panoSpaceDir.copy(e.panoSpaceDir),
  29285. this.upcomingPanos = o
  29286. }
  29287. ,
  29288. this.zoomingActive = !1
  29289. }
  29290. ,
  29291. n.DIRECTIONAL_FOV = 180,
  29292. n.DIRECTIONAL_FOV_NARROW = 120,
  29293. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  29294. n.MAX_SCORED_PANOS_TOADD = 2,
  29295. n.MAX_UPCOMING_PANOS_TOADD = 3,
  29296. n.DIRECTION_SCORE_STRICTNESS = .75,
  29297. n.appendQueue = function(e, t) {
  29298. if (e && t)
  29299. for (var i = 0; i < t.length; i++)
  29300. e.push(t[i])
  29301. }
  29302. ,
  29303. n.prototype.updateCriteria = function(e, t, i, n) {
  29304. this.priorityCriteria.pano = e,
  29305. this.priorityCriteria.cameraPosition.copy(t),
  29306. this.priorityCriteria.cameraDir.copy(i),
  29307. this.priorityCriteria.upcomingPanos = n,
  29308. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  29309. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  29310. }
  29311. ,
  29312. n.prototype.filterAndPrioritize = function() {
  29313. var e = []
  29314. , t = []
  29315. , i = [];
  29316. return function(r, o, a) {
  29317. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  29318. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  29319. var s = this.baseSize
  29320. , l = this.standardSize
  29321. , c = this.highSize
  29322. , h = this.ultraHighSize;
  29323. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  29324. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  29325. i.length = 0,
  29326. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  29327. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  29328. n.appendQueue(r, i),
  29329. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  29330. i.length = 0,
  29331. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  29332. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  29333. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  29334. n.appendQueue(r, i),
  29335. i.length = 0,
  29336. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  29337. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  29338. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  29339. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  29340. n.appendQueue(r, i),
  29341. this.queueTilesForPanos(r, e, a, s)
  29342. }
  29343. }(),
  29344. n.prototype.canDownloadSize = function(e) {
  29345. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  29346. }
  29347. ,
  29348. n.prototype.populateNeighborPanos = function(e, t, i) {
  29349. i = i || [],
  29350. i.length = 0;
  29351. var n = t.getNeighbours(e);
  29352. for (var r in n)
  29353. if (n.hasOwnProperty(r)) {
  29354. var o = t.get(r);
  29355. i.push(o)
  29356. }
  29357. return i
  29358. }
  29359. ,
  29360. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  29361. i = i || [],
  29362. i.length = 0;
  29363. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  29364. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  29365. , c = t.sortByScore(s, l);
  29366. if (c)
  29367. for (var h = 0; h < c.length && h < a; h++) {
  29368. var u = c[h].pano;
  29369. i.push(u)
  29370. }
  29371. return i
  29372. }
  29373. ,
  29374. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  29375. for (var o = 0, a = 0; a < t.length; a++) {
  29376. var s = t[a]
  29377. , l = this.queueTilesForPano(e, i, s, n);
  29378. if (o += l > 0 ? 1 : 0,
  29379. r && o >= r)
  29380. break
  29381. }
  29382. return o
  29383. }
  29384. ,
  29385. n.prototype.queueTilesForPano = function() {
  29386. var e = {
  29387. filter: h.None
  29388. };
  29389. return function(t, i, n, r) {
  29390. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  29391. }
  29392. }(),
  29393. n.prototype.queueTilesForPanosInDirection = function() {
  29394. var e = new r.Vector3;
  29395. return function(t, i, n, r, o, a, s, l) {
  29396. for (var h = 0, u = 0; u < n.length; u++) {
  29397. var d = n[u];
  29398. e.copy(d.position),
  29399. e.sub(o),
  29400. e.normalize();
  29401. var p = Math.max(Math.min(a.dot(e), 1), -1)
  29402. , f = c.getFOVDotThreshold(s);
  29403. if (p >= f) {
  29404. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  29405. if (h += g > 0 ? 1 : 0,
  29406. l && h >= l)
  29407. break
  29408. }
  29409. }
  29410. return h
  29411. }
  29412. }(),
  29413. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  29414. for (var l = 0, c = 0; c < i.length; c++) {
  29415. var h = i[c]
  29416. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  29417. if (l += u > 0 ? 1 : 0,
  29418. s && l >= s)
  29419. break
  29420. }
  29421. return l
  29422. }
  29423. ,
  29424. n.prototype.queueTilesInDirectionForPano = function() {
  29425. var e = {
  29426. filter: h.DirectionalFOV,
  29427. direction: new r.Vector3,
  29428. fov: 60
  29429. }
  29430. , t = new r.Vector3;
  29431. return function(i, n, r, o, a, s, c) {
  29432. return t.copy(s),
  29433. l.getRelativeDirection(r.quaternion, t),
  29434. e.direction.copy(t),
  29435. e.fov = c,
  29436. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  29437. }
  29438. }(),
  29439. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  29440. var e = [];
  29441. return function(t, i, n, r, o) {
  29442. var a = i.getTileDownloadDescriptors(n, r);
  29443. e.length = 0,
  29444. this.filterTileDownloadDescriptors(n, a, e, o);
  29445. for (var s = 0, l = 0; l < e.length; l++) {
  29446. var c = e[l];
  29447. c && (t.push(c),
  29448. s++)
  29449. }
  29450. return s
  29451. }
  29452. }(),
  29453. n.prototype.filterTileDownloadDescriptors = function() {
  29454. new r.Vector3;
  29455. return function(e, t, i, n) {
  29456. var r, o;
  29457. switch (n.filter) {
  29458. case h.DirectionalFOV:
  29459. for (r = 0; r < t.length; r++)
  29460. o = t[r],
  29461. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  29462. break;
  29463. default:
  29464. for (r = 0; r < t.length; r++)
  29465. o = t[r],
  29466. i.push(o)
  29467. }
  29468. for (r = 0; r < i.length; r++)
  29469. o = i[r],
  29470. this.canIncludeDescriptor(o) || (i[r] = null)
  29471. }
  29472. }(),
  29473. n.prototype.canIncludeDescriptor = function(e) {
  29474. return e.status !== s.Downloading && e.status !== s.Downloaded
  29475. }
  29476. ,
  29477. n.prototype.canIncludePano = function(e, t) {
  29478. return !e.isLoaded(t)
  29479. }
  29480. ,
  29481. n.getFOVDotThreshold = function(e) {
  29482. return Math.cos(r.Math.degToRad(e / 2))
  29483. }
  29484. ;
  29485. var u = function() {
  29486. var e = function e(t, i) {
  29487. var n = e._panoSpaceDir
  29488. , r = e._fovThreshold
  29489. , o = e._fovThresholdNarrow
  29490. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  29491. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  29492. return t._dot = a,
  29493. i._dot = s,
  29494. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  29495. };
  29496. return e._panoSpaceDir = new r.Vector3,
  29497. e._fovThreshold = -1,
  29498. e._fovThresholdNarrow = -1,
  29499. e
  29500. }();
  29501. n.sortPanoTiles = function(e, t, i) {
  29502. u._panoSpaceDir.copy(i),
  29503. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  29504. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  29505. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  29506. e.sort(u)
  29507. }
  29508. ,
  29509. n.insertSortedPanoTile = function(e, t, i, r) {
  29510. u._panoSpaceDir.copy(r),
  29511. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  29512. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  29513. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  29514. for (var o = -1, a = 0; a < e.length; a++) {
  29515. var s = u(t, e[a]);
  29516. if (s <= 0) {
  29517. o = a;
  29518. break
  29519. }
  29520. }
  29521. if (o === -1)
  29522. e[e.length] = t;
  29523. else {
  29524. for (var h = e.length; h > o; h--)
  29525. e[h] = e[h - 1];
  29526. e[o] = t
  29527. }
  29528. }
  29529. ,
  29530. n.prototype.setZoomingActive = function(e) {
  29531. e !== this.zoomingActive && (this.zoomingActive = e)
  29532. }
  29533. ,
  29534. t.exports = n
  29535. }
  29536. ).call(this, "/js/tile/TilePrioritizer.js")
  29537. }
  29538. , {
  29539. "../enum/DownloadStatus": 24,
  29540. "../enum/GLCubeFaces": 25,
  29541. "../enum/ModelManagerEvents": 33,
  29542. "../enum/PanoSizeClass": 36,
  29543. "../enum/Vectors": 50,
  29544. "../enum/Viewmode": 51,
  29545. "../objects/Panorama": 148,
  29546. "../settings": 166,
  29547. "../util/browser": 182,
  29548. "../util/logger": 189,
  29549. "../util/math": 190,
  29550. "./TileUtils": 174,
  29551. events: 202,
  29552. three: 217
  29553. }],
  29554. 173: [function(e, t, i) {//"./TileTree"
  29555. "use strict";
  29556. function n(e, t) {
  29557. this.levels = t,
  29558. this.tileSize = e,
  29559. this.root = null,
  29560. this.allNodes = [],
  29561. a(this)
  29562. }
  29563. function r(e, t) {
  29564. this.tree = e,
  29565. this.parent = t,
  29566. this.children = [],
  29567. this.id = ++u
  29568. }
  29569. function o(e, t, i, r, a, s, l, h) {
  29570. if (e) {
  29571. l = l || n.TraversalType.PreOrder;
  29572. var u = r * c + i;
  29573. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  29574. s && s.push(e)),
  29575. e.children && 0 !== e.children.length) {
  29576. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  29577. for (var g = 0; g < c; g++)
  29578. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  29579. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  29580. s && s.push(e))
  29581. }
  29582. }
  29583. }
  29584. function a(e) {
  29585. e.root = s(e, null, 0)
  29586. }
  29587. function s(e, t, i) {
  29588. if (i > e.levels)
  29589. return null;
  29590. var n = new r(e,t);
  29591. e.allNodes.push(n);
  29592. for (var o = 0; o < h; o++)
  29593. n.children[o] = s(e, n, i + 1);
  29594. return n
  29595. }
  29596. function l(e, t, i, n, r) {
  29597. if (!e)
  29598. return null;
  29599. if (0 === i)
  29600. return e;
  29601. if (!e.children || 0 === e.children.length)
  29602. return null;
  29603. var o = Math.pow(c, i)
  29604. , a = o / c
  29605. , s = n % a
  29606. , h = r % a
  29607. , u = Math.floor(r / a)
  29608. , d = Math.floor(n / a)
  29609. , p = u * c + d
  29610. , f = e.children[p];
  29611. return l(f, t + 1, i - 1, s, h)
  29612. }
  29613. var c = (e("three"),
  29614. e("./TileUtils"),
  29615. e("../objects/Panorama"),
  29616. e("../util/panorama"),
  29617. e("events").EventEmitter,
  29618. 2)
  29619. , h = c * c;
  29620. n.TraversalType = Object.freeze({
  29621. PreOrder: 0,
  29622. PostOrder: 1
  29623. });
  29624. var u = 0;
  29625. n.getLevelCountForSize = function(e, t) {
  29626. var i = 0;
  29627. for (t < e && (t = e); ; ) {
  29628. if (t /= c,
  29629. t < e)
  29630. break;
  29631. i++
  29632. }
  29633. return i
  29634. }
  29635. ,
  29636. n.getSizeForLevel = function(e, t) {
  29637. return Math.pow(c, t) * e
  29638. }
  29639. ,
  29640. n.prototype.getSubNode = function(e, t, i) {
  29641. (!t || e < this.tileSize) && (t = 0),
  29642. (!i || e < this.tileSize) && (i = 0),
  29643. e < this.tileSize && (e = this.tileSize);
  29644. var r = n.getLevelCountForSize(this.tileSize, e)
  29645. , o = l(this.root, 0, r, t, i);
  29646. return o
  29647. }
  29648. ,
  29649. n.prototype.breadthFirst = function(e) {
  29650. e = e || {};
  29651. var t = !!e.nullLevelEnd
  29652. , i = e.maxLevel
  29653. , n = e.minLevel
  29654. , r = e.callback
  29655. , o = e.saveVisited
  29656. , a = []
  29657. , s = {}
  29658. , l = 0
  29659. , c = 0;
  29660. for (a.push(this.root),
  29661. a.push(s); a.length > 0 && !(i && l > i); ) {
  29662. var h = a.shift();
  29663. if (h === s)
  29664. (!n || l >= n) && (r && t && r(null),
  29665. o && t && o.push(null)),
  29666. a.length > 0 && a.push(s),
  29667. l++,
  29668. c = 0;
  29669. else {
  29670. if (h.children)
  29671. for (var u = 0; u < h.children.length; u++) {
  29672. var d = h.children[u];
  29673. d && a.push(h.children[u])
  29674. }
  29675. var p = this.getFaceIndexFromNode(h);
  29676. (!n || l >= n) && (r && r(h, l, p),
  29677. o && o.push(h)),
  29678. c++
  29679. }
  29680. }
  29681. }
  29682. ,
  29683. n.prototype.getFaceIndexFromNode = function(e) {
  29684. if (!e)
  29685. return -1;
  29686. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  29687. var o = i.parent;
  29688. if (!o)
  29689. break;
  29690. for (var a = -1, s = 0; s < o.children.length; s++)
  29691. o.children[s] === i && (a = s);
  29692. var l = a % c
  29693. , h = Math.floor(a / c);
  29694. n = l * t + n,
  29695. r = h * t + r,
  29696. t *= c,
  29697. i = o
  29698. }
  29699. return r * t + n
  29700. }
  29701. ,
  29702. n.prototype.depthFirst = function(e, t, i) {
  29703. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  29704. }
  29705. ,
  29706. t.exports = n
  29707. }
  29708. , {
  29709. "../objects/Panorama": 148,
  29710. "../util/panorama": 191,
  29711. "./TileUtils": 174,
  29712. events: 202,
  29713. three: 217
  29714. }],
  29715. 174: [function(e, t, i) {//"../tile/TileUtils" or "./TileUtils"
  29716. "use strict";
  29717. var n = e("../enum/GLCubeFaces")
  29718. , r = e("../util/MathLight")
  29719. , o = {};
  29720. o.TILE_SIZE = 512,
  29721. o.FACES_PER_PANO = 6,
  29722. o.LocationOnTile = {
  29723. Center: 0,
  29724. UpperLeft: 1,
  29725. UpperRight: 2,
  29726. LowerRight: 3,
  29727. LowerLeft: 4
  29728. },
  29729. o.getTileVector = function() {
  29730. return function(e, t, i, a, s, l, c, h) {
  29731. l = l || o.LocationOnTile.Center;
  29732. var u = e / t
  29733. , d = a / u;
  29734. s = -s + (u - 1);
  29735. var p = s / u
  29736. , f = t / e
  29737. , g = 2 * f
  29738. , m = g / 2
  29739. , v = 2 * d - 1 + m
  29740. , A = 2 * p - 1 + m;
  29741. switch (l) {
  29742. case o.LocationOnTile.UpperLeft:
  29743. v -= m,
  29744. A += m,
  29745. v += c * g;
  29746. break;
  29747. case o.LocationOnTile.UpperRight:
  29748. v += m,
  29749. A += m,
  29750. A -= c * g;
  29751. break;
  29752. case o.LocationOnTile.LowerRight:
  29753. v += m,
  29754. A -= m,
  29755. v -= c * g;
  29756. break;
  29757. case o.LocationOnTile.LowerLeft:
  29758. v -= m,
  29759. A -= m,
  29760. A += c * g;
  29761. break;
  29762. case o.LocationOnTile.Center:
  29763. }
  29764. switch (i) {
  29765. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29766. r.setVector(h, -1, A, -v);
  29767. break;
  29768. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29769. r.setVector(h, 1, A, v);
  29770. break;
  29771. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29772. r.setVector(h, -v, 1, -A);
  29773. break;
  29774. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29775. r.setVector(h, -v, -1, A);
  29776. break;
  29777. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29778. r.setVector(h, -v, A, 1);
  29779. break;
  29780. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29781. r.setVector(h, v, A, -1)
  29782. }
  29783. r.normalize(h)
  29784. }
  29785. }(),
  29786. o.getFaceForTile = function(e, t) {
  29787. var i = o.TILE_SIZE;
  29788. e < o.TILE_SIZE && (i = e);
  29789. var n = Math.floor(e / i)
  29790. , r = n * n;
  29791. return Math.floor(t / r)
  29792. }
  29793. ,
  29794. o.getTileLocation = function(e, t, i) {
  29795. var n = o.TILE_SIZE;
  29796. e < o.TILE_SIZE && (n = e);
  29797. var r = o.getFaceForTile(e, t)
  29798. , a = Math.floor(e / n)
  29799. , s = a * a
  29800. , l = t - r * s;
  29801. i.tileX = l % a,
  29802. i.tileY = Math.floor(l / a),
  29803. i.face = r,
  29804. i.faceTileIndex = l
  29805. }
  29806. ,
  29807. o.getTileCountForSize = function(e) {
  29808. if (e <= o.TILE_SIZE)
  29809. return o.FACES_PER_PANO;
  29810. var t = Math.floor(e / o.TILE_SIZE)
  29811. , i = t * t
  29812. , n = i * o.FACES_PER_PANO;
  29813. return n
  29814. }
  29815. ,
  29816. o.getRelativeDirection = function() {
  29817. var e = new r.Matrix4
  29818. , t = new r.Quaternion;
  29819. return function(i, n) {
  29820. t.copy(i),
  29821. t.inverse(),
  29822. e.makeRotationFromQuaternion(t),
  29823. e.applyToVector3(n),
  29824. r.normalize(n)
  29825. }
  29826. }(),
  29827. o.matchingTilesInDirection = function() {
  29828. var e = new r.Vector3
  29829. , t = new r.Vector3(0,0,-1)
  29830. , i = new r.Quaternion
  29831. , n = function(e, t) {
  29832. e.push({
  29833. face: t.face,
  29834. faceTileIndex: t.faceTileIndex,
  29835. tileX: t.tileX,
  29836. tileY: t.tileY
  29837. })
  29838. }
  29839. , a = function() {
  29840. var e = {
  29841. face: -1,
  29842. faceTileIndex: -1,
  29843. tileX: -1,
  29844. tileY: -1
  29845. };
  29846. return function(t, i, r) {
  29847. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29848. o.getTileLocation(t, l, e),
  29849. i && !i(e) || (s++,
  29850. r && n(r, e));
  29851. return s
  29852. }
  29853. }();
  29854. return function(n, s, l, c, h, u) {
  29855. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29856. o.getTileCountForSize(s);
  29857. if (!c && !h)
  29858. return a(s, null, u);
  29859. var p = !!h;
  29860. if (h = h || c,
  29861. h = Math.max(0, Math.min(h, 360)),
  29862. c = Math.max(0, Math.min(c, 360)),
  29863. r.copyVector(l, e),
  29864. o.getRelativeDirection(n.quaternion, e),
  29865. p) {
  29866. i.setFromUnitVectors(e, t);
  29867. var f = function(e) {
  29868. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29869. };
  29870. return a(s, f, u)
  29871. }
  29872. var g = function(t) {
  29873. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29874. };
  29875. return a(s, g, u)
  29876. }
  29877. }(),
  29878. o.isTileWithinFrustum = function() {
  29879. var e = new r.Vector3
  29880. , t = 1e-5;
  29881. return function(i, n, a, s, l, c, h, u) {
  29882. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  29883. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29884. r.applyQuaternionToVector(c, e),
  29885. e.z >= -t)
  29886. I++;
  29887. else {
  29888. var w = -1 / e.z
  29889. , _ = e.x * w
  29890. , T = e.y * w;
  29891. T > d ? v++ : T < p && A++,
  29892. _ > f ? y++ : _ < g && C++,
  29893. E++
  29894. }
  29895. return A !== E && v !== E && y !== E && C !== E
  29896. }
  29897. }(),
  29898. o.isTileWithinFOV = function() {
  29899. var e = new r.Vector3
  29900. , t = new r.Vector3(0,1,0)
  29901. , i = new r.Vector3(1,0,0);
  29902. return function(n, a, s, l, c, h, u) {
  29903. var d = o.mapFaceToCubemapFace(s);
  29904. if (r.cross(h, t, i),
  29905. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29906. o.isWithinFOV(e, h, u, null))
  29907. return !0;
  29908. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29909. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29910. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29911. o.isWithinFOV(e, h, u, null))
  29912. return !0;
  29913. g += p
  29914. }
  29915. return !1
  29916. }
  29917. }(),
  29918. o.isWithinFOV = function() {
  29919. var e = new r.Vector3
  29920. , t = new r.Vector3;
  29921. return function(i, n, o, a) {
  29922. if (r.copyVector(i, t),
  29923. a) {
  29924. r.copyVector(a, e),
  29925. r.normalize(e);
  29926. var s = r.dot(e, i);
  29927. e.x *= s,
  29928. e.y *= s,
  29929. e.z *= s,
  29930. r.subVector(t, e)
  29931. }
  29932. var l = o / 2 * r.RADIANS_PER_DEGREE
  29933. , c = Math.cos(l)
  29934. , h = r.dot(t, n);
  29935. return h >= c
  29936. }
  29937. }(),
  29938. o.mapFaceToCubemapFace = function() {
  29939. var e = {
  29940. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29941. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29942. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29943. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29944. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29945. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29946. };
  29947. return function(t) {
  29948. return e[t]
  29949. }
  29950. }(),
  29951. t.exports = o
  29952. }
  29953. , {
  29954. "../enum/GLCubeFaces": 25,
  29955. "../util/MathLight": 176
  29956. }],
  29957. 175: [function(e, t, i) {///js/util/IndexedCollection.j
  29958. (function(i) {
  29959. "use strict";
  29960. function n() {
  29961. this.list = [],
  29962. this.index = {},
  29963. Object.defineProperty(this, "length", {
  29964. get: function() {
  29965. return this.list.length
  29966. }
  29967. })
  29968. }
  29969. var r = (e("./common"),
  29970. e("./logger"));
  29971. new r(i);
  29972. n.prototype.forEach = function(e) {
  29973. this.list.forEach(e)
  29974. }
  29975. ,
  29976. n.prototype.add = function(e) {
  29977. this.list.push(e),
  29978. this.index[this.getIndex(e)] = e
  29979. }
  29980. ,
  29981. n.prototype.getIndex = function(e) {
  29982. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29983. }
  29984. ,
  29985. n.prototype.extend = function(e) {
  29986. for (var t = 0; t < e.length; t++)
  29987. this.add(e[t])
  29988. }
  29989. ,
  29990. n.prototype.get = function(e) {
  29991. return this.index[e]
  29992. }
  29993. ,
  29994. n.prototype.first = function() {
  29995. return this.list[0]
  29996. }
  29997. ,
  29998. n.prototype.last = function() {
  29999. return this.list[this.list.length - 1]
  30000. }
  30001. ,
  30002. n.prototype.reIndex = function() {
  30003. this.index = {};
  30004. var e = this;
  30005. this.forEach(function(t) {
  30006. e.index[e.getIndex(t)] = t
  30007. })
  30008. }
  30009. ,
  30010. n.prototype.filter = function(e) {
  30011. var t = this.list.filter(e);
  30012. return this.reIndex(),
  30013. t
  30014. }
  30015. ,
  30016. n.prototype.reduce = function(e, t) {
  30017. return this.list.reduce(e, t)
  30018. }
  30019. ,
  30020. n.prototype.sort = function(e) {
  30021. return this.list.sort(e)
  30022. }
  30023. ,
  30024. n.prototype.indexOf = function(e) {
  30025. for (var t = 0; t < this.list.length; ++t)
  30026. if (this.list[t] === e)
  30027. return t;
  30028. return -1
  30029. }
  30030. ,
  30031. t.exports = n
  30032. }
  30033. ).call(this, "/js/util/IndexedCollection.js")
  30034. }
  30035. , {
  30036. "./common": 185,
  30037. "./logger": 189
  30038. }],
  30039. 176: [function(e, t, i) {//"../util/MathLight"
  30040. "use strict";
  30041. var n = e("../constants")
  30042. , r = {};
  30043. r.RADIANS_PER_DEGREE = Math.PI / 180,
  30044. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  30045. r.Vector3 = function(e, t, i) {
  30046. this.x = e || 0,
  30047. this.y = t || 0,
  30048. this.z = i || 0
  30049. }
  30050. ,
  30051. r.Matrix4 = function() {
  30052. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  30053. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  30054. }
  30055. ,
  30056. r.Matrix4.prototype = {
  30057. identity: function() {
  30058. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  30059. this
  30060. },
  30061. copy: function(e) {
  30062. return this.elements.set(e.elements),
  30063. this
  30064. },
  30065. applyToVector3: function(e) {
  30066. var t = e.x
  30067. , i = e.y
  30068. , n = e.z
  30069. , r = this.elements;
  30070. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  30071. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  30072. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  30073. this
  30074. },
  30075. getInverse: function(e, t) {
  30076. var i = this.elements
  30077. , n = e.elements
  30078. , r = n[0]
  30079. , o = n[1]
  30080. , a = n[2]
  30081. , s = n[3]
  30082. , l = n[4]
  30083. , c = n[5]
  30084. , h = n[6]
  30085. , u = n[7]
  30086. , d = n[8]
  30087. , p = n[9]
  30088. , f = n[10]
  30089. , g = n[11]
  30090. , m = n[12]
  30091. , v = n[13]
  30092. , A = n[14]
  30093. , y = n[15]
  30094. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  30095. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  30096. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  30097. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  30098. , w = r * C + o * I + a * E + s * b;
  30099. if (0 === w) {
  30100. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  30101. if (t)
  30102. throw new Error(_);
  30103. return console.warn(_),
  30104. this.identity()
  30105. }
  30106. var T = 1 / w;
  30107. return i[0] = C * T,
  30108. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  30109. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  30110. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  30111. i[4] = I * T,
  30112. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  30113. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  30114. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  30115. i[8] = E * T,
  30116. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  30117. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  30118. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  30119. i[12] = b * T,
  30120. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  30121. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  30122. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  30123. this
  30124. },
  30125. makeRotationFromQuaternion: function(e) {
  30126. var t = this.elements
  30127. , i = e.x
  30128. , n = e.y
  30129. , r = e.z
  30130. , o = e.w
  30131. , a = i + i
  30132. , s = n + n
  30133. , l = r + r
  30134. , c = i * a
  30135. , h = i * s
  30136. , u = i * l
  30137. , d = n * s
  30138. , p = n * l
  30139. , f = r * l
  30140. , g = o * a
  30141. , m = o * s
  30142. , v = o * l;
  30143. return t[0] = 1 - (d + f),
  30144. t[4] = h - v,
  30145. t[8] = u + m,
  30146. t[1] = h + v,
  30147. t[5] = 1 - (c + f),
  30148. t[9] = p - g,
  30149. t[2] = u - m,
  30150. t[6] = p + g,
  30151. t[10] = 1 - (c + d),
  30152. t[3] = 0,
  30153. t[7] = 0,
  30154. t[11] = 0,
  30155. t[12] = 0,
  30156. t[13] = 0,
  30157. t[14] = 0,
  30158. t[15] = 1,
  30159. this
  30160. }
  30161. },
  30162. r.Quaternion = function(e, t, i, n) {
  30163. this._x = e || 0,
  30164. this._y = t || 0,
  30165. this._z = i || 0,
  30166. this._w = void 0 !== n ? n : 1
  30167. }
  30168. ,
  30169. r.Quaternion.prototype = {
  30170. get x() {
  30171. return this._x
  30172. },
  30173. set x(e) {
  30174. this._x = e
  30175. },
  30176. get y() {
  30177. return this._y
  30178. },
  30179. set y(e) {
  30180. this._y = e
  30181. },
  30182. get z() {
  30183. return this._z
  30184. },
  30185. set z(e) {
  30186. this._z = e
  30187. },
  30188. get w() {
  30189. return this._w
  30190. },
  30191. set w(e) {
  30192. this._w = e
  30193. },
  30194. copy: function(e) {
  30195. this._x = e.x,
  30196. this._y = e.y,
  30197. this._z = e.z,
  30198. this._w = e.w
  30199. },
  30200. inverse: function() {
  30201. return this.conjugate().normalize()
  30202. },
  30203. conjugate: function() {
  30204. return this._x *= -1,
  30205. this._y *= -1,
  30206. this._z *= -1,
  30207. this
  30208. },
  30209. length: function() {
  30210. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  30211. },
  30212. normalize: function() {
  30213. var e = this.length();
  30214. return 0 === e ? (this._x = 0,
  30215. this._y = 0,
  30216. this._z = 0,
  30217. this._w = 1) : (e = 1 / e,
  30218. this._x = this._x * e,
  30219. this._y = this._y * e,
  30220. this._z = this._z * e,
  30221. this._w = this._w * e),
  30222. this
  30223. },
  30224. setFromAxisAngle: function(e, t) {
  30225. var i = t / 2
  30226. , n = Math.sin(i);
  30227. return this._x = e.x * n,
  30228. this._y = e.y * n,
  30229. this._z = e.z * n,
  30230. this._w = Math.cos(i),
  30231. this
  30232. },
  30233. setFromUnitVectors: function() {
  30234. var e, t, i = 1e-6;
  30235. return function(n, o) {
  30236. return void 0 === e && (e = new r.Vector3),
  30237. t = r.dot(n, o) + 1,
  30238. t < i ? (t = 0,
  30239. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  30240. this._x = e.x,
  30241. this._y = e.y,
  30242. this._z = e.z,
  30243. this._w = t,
  30244. this.normalize()
  30245. }
  30246. }(),
  30247. multiply: function(e) {
  30248. return this.multiplyQuaternions(this, e)
  30249. },
  30250. premultiply: function(e) {
  30251. return this.multiplyQuaternions(e, this)
  30252. },
  30253. multiplyQuaternions: function(e, t) {
  30254. var i = e._x
  30255. , n = e._y
  30256. , r = e._z
  30257. , o = e._w
  30258. , a = t._x
  30259. , s = t._y
  30260. , l = t._z
  30261. , c = t._w;
  30262. return this._x = i * c + o * a + n * l - r * s,
  30263. this._y = n * c + o * s + r * a - i * l,
  30264. this._z = r * c + o * l + i * s - n * a,
  30265. this._w = o * c - i * a - n * s - r * l,
  30266. this
  30267. }
  30268. },
  30269. r.convertWorkshopVector = function(e) {
  30270. return new r.Vector3(-e.x,e.y,e.z)
  30271. }
  30272. ,
  30273. r.convertWorkshopQuaternion = function(e) {
  30274. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  30275. }
  30276. ;
  30277. r.convertWorkshopOrthoZoom = function(e) {
  30278. return e === -1 ? -1 : e / 16 * ($('#player').width() / $('#player').height()) / n.workshopApsect
  30279. }
  30280. ,
  30281. r.convertWorkshopPanoramaQuaternion = function(e) {
  30282. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  30283. }
  30284. ,
  30285. r.normalize = function(e) {
  30286. var t = e.x * e.x + e.y * e.y + e.z * e.z
  30287. , i = Math.sqrt(t);
  30288. e.x /= i,
  30289. e.y /= i,
  30290. e.z /= i
  30291. }
  30292. ,
  30293. r.dot = function(e, t) {
  30294. return e.x * t.x + e.y * t.y + e.z * t.z
  30295. }
  30296. ,
  30297. r.cross = function(e, t, i) {
  30298. var n = e.x
  30299. , r = e.y
  30300. , o = e.z;
  30301. i.x = r * t.z - o * t.y,
  30302. i.y = o * t.x - n * t.z,
  30303. i.z = n * t.y - r * t.x
  30304. }
  30305. ,
  30306. r.setVector = function(e, t, i, n) {
  30307. e.x = t,
  30308. e.y = i,
  30309. e.z = n
  30310. }
  30311. ,
  30312. r.copyVector = function(e, t) {
  30313. t.x = e.x,
  30314. t.y = e.y,
  30315. t.z = e.z
  30316. }
  30317. ,
  30318. r.addVector = function(e, t) {
  30319. e.x += t.x,
  30320. e.y += t.y,
  30321. e.z += t.z
  30322. }
  30323. ,
  30324. r.subVector = function(e, t) {
  30325. e.x -= t.x,
  30326. e.y -= t.y,
  30327. e.z -= t.z
  30328. }
  30329. ,
  30330. r.applyQuaternionToVector = function(e, t) {
  30331. var i = t.x
  30332. , n = t.y
  30333. , r = t.z
  30334. , o = e.x
  30335. , a = e.y
  30336. , s = e.z
  30337. , l = e.w
  30338. , c = l * i + a * r - s * n
  30339. , h = l * n + s * i - o * r
  30340. , u = l * r + o * n - a * i
  30341. , d = -o * i - a * n - s * r;
  30342. t.x = c * l + d * -o + h * -s - u * -a,
  30343. t.y = h * l + d * -a + u * -o - c * -s,
  30344. t.z = u * l + d * -s + c * -a - h * -o
  30345. }
  30346. ,
  30347. r.angleBetweenVectors = function(e, t) {
  30348. return Math.acos(r.dot(e, t))
  30349. }
  30350. ,
  30351. t.exports = r
  30352. }
  30353. , {
  30354. "../constants": 8
  30355. }],
  30356. 177: [function(e, t, i) {///js/util/ModelUrls.js
  30357. (function(i) {
  30358. "use strict";
  30359. function n(e) {
  30360. this.cache = null,
  30361. this.expires = 0
  30362. }
  30363. function r() {
  30364. this.baseUrl = null,
  30365. this.cache = null,
  30366. this.expires = 0
  30367. }
  30368. function o() {
  30369. this.baseUrl = null,
  30370. this.expires = 0
  30371. }
  30372. function a(e) {
  30373. this.initialLoadingPromise = null,
  30374. this.endpoint = e + "?type=3",
  30375. this.urlContainer = null,
  30376. this.authorizationHeader = h.getAuthorizationHeader(),
  30377. this.containerClasses = [o, r, n]
  30378. }
  30379. var s = e("./ajax")
  30380. , l = e("./logger")
  30381. , c = e("../constants")
  30382. , h = e("./showcase")
  30383. , u = (e("../ab"),
  30384. new l(i));
  30385. n.prototype = {
  30386. version: 1,
  30387. validate: function(e) {
  30388. return "catalog.json"in e && Object.keys(e).length > 0
  30389. },
  30390. update: function(e) {
  30391. return this.cache = e,
  30392. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  30393. $.when()
  30394. },
  30395. get: function(e) {
  30396. return this.cache[e]
  30397. }
  30398. },
  30399. r.prototype = {
  30400. version: 2,
  30401. validate: function(e) {
  30402. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  30403. },
  30404. update: function(e) {
  30405. return this.baseUrl = e["base.url"],
  30406. this.cache = e,
  30407. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  30408. $.when()
  30409. },
  30410. get: function(e) {
  30411. var t = this.cache[e];
  30412. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  30413. }
  30414. },
  30415. o.prototype = {
  30416. version: 3,
  30417. validate: function(e) {
  30418. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  30419. },
  30420. update: function(e) {
  30421. e.templates[0] = e.templates[0].replace("{{number}}",window.number);
  30422. return this.baseUrl = e.templates[0],
  30423. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  30424. $.when()
  30425. },
  30426. get: function(e) {
  30427. return this.baseUrl.replace("{{filename}}", e)
  30428. }
  30429. },
  30430. a.prototype = {
  30431. init: function() {
  30432. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  30433. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  30434. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  30435. this.refresh().done(function() {
  30436. u.debug("Refreshed")
  30437. }).fail(function() {
  30438. u.error("Failed url refresh, urls might go stale soon")
  30439. }))
  30440. }.bind(this), c.signedUrlCheckInterval),
  30441. this.initialLoadingPromise = this.refresh(),
  30442. this.initialLoadingPromise)
  30443. },
  30444. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  30445. e = e || {};
  30446. /*var t = void 0 === e.cache || e.cache;
  30447. return s.get( this.endpoint , { //file
  30448. responseType: "json",
  30449. prefetchFrom: t ? "files" : null,
  30450. cache: t,
  30451. auth: this.authorizationHeader
  30452. }).then(function(e) {
  30453. if (this.urlContainer && this.urlContainer.validate(e))
  30454. return this.urlContainer.update(e);
  30455. for (var i = 0; i < this.containerClasses.length; i++) {
  30456. var n = this.containerClasses[i]
  30457. , r = new n;
  30458. if (r.validate(e))
  30459. return u.info("Using urls version " + r.version),
  30460. this.urlContainer = r,
  30461. this.urlContainer.update(e)
  30462. }
  30463. return t ? this.refresh({
  30464. cache: !1
  30465. }) : $.Deferred().reject("missing-urls")
  30466. }
  30467. .bind(this), function(e) {
  30468. return "loading-failed"
  30469. }) */
  30470. return $.Deferred().resolve();
  30471. },
  30472. get: function(e) {
  30473. //return this.urlContainer.get(e)
  30474. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  30475. }
  30476. },
  30477. t.exports = a
  30478. }
  30479. ).call(this, "/js/util/ModelUrls.js")
  30480. }
  30481. , {
  30482. "../ab": 3,
  30483. "../constants": 8,
  30484. "./ajax": 181,
  30485. "./logger": 189,
  30486. "./showcase": 193
  30487. }],
  30488. 178: [function(e, t, i) {///js/util/PanoramaCollection.js
  30489. (function(i) {
  30490. "use strict";
  30491. function n() {
  30492. u.call(this),
  30493. this.neighbourMap = {},
  30494. this.map = null
  30495. }
  30496. var r = e("three")
  30497. , o = e("./common")
  30498. , a = e("../settings")
  30499. , s = e("../objects/Panorama")
  30500. , a = e("../settings")
  30501. , l = e("./aStar")
  30502. , c = e("./logger")
  30503. , h = new c(i)
  30504. , u = e("./IndexedCollection")
  30505. , d = e("./transitions");
  30506. o.inherit(n, u),
  30507. n.prototype.getIndex = function(e) {
  30508. return e.id
  30509. }
  30510. ,
  30511. n.prototype.find = function(e, t) {
  30512. var i = o.filterAll(this.list, e);
  30513. return 0 === i.length ? null : (t && t.forEach(function(e) {
  30514. i = o.stableSort(i, e)
  30515. }),
  30516. i[0])
  30517. }
  30518. ,
  30519. n.prototype.sortByScore = function(e, t, findByScore) {//xzw改
  30520. var i = o.filterAll(this.list, e);
  30521. return 0 === i.length ? null : (i = i.map(function(e) {
  30522. return {
  30523. pano: e,
  30524. score: t.reduce(function(t, i) {
  30525. return t + i(e)
  30526. }, 0)
  30527. }
  30528. }).sort(function(e, t) {
  30529. return t.score - e.score;
  30530. }),
  30531. findByScore ? i[0].pano : i //xzw sort返回整个array find返回第一个
  30532. )
  30533. }
  30534. ,
  30535. n.prototype.lowestByScore = function(e, t, i) {
  30536. return this.findRankedByScore(0, e, t, i)
  30537. }
  30538. ,
  30539. n.prototype.findRankedByScore = function(e, t, i, n) {
  30540. n && (n.candidates = null,
  30541. n.pano = null),
  30542. e || (e = 0);
  30543. var r = this.sortByScore(t, i);
  30544. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  30545. n.pano = r[e].pano),
  30546. r[e].pano)
  30547. }
  30548. ,
  30549. n.prototype.showPanoScores = function(e) {
  30550. this.list.forEach(function(e) {
  30551. e.removeTextSprite()
  30552. });
  30553. var t = 6344768;
  30554. e.forEach(function(e) {
  30555. e.pano.addTextSprite(e.score.toFixed(2), t),
  30556. t = 16428055
  30557. })
  30558. }
  30559. ,
  30560. n.prototype.isNeighbour = function(e, t) {
  30561. return this.neighbourMap[e.id][t.id]
  30562. }
  30563. ,
  30564. n.prototype.getNeighbours = function(e) {
  30565. return this.neighbourMap[e.id]
  30566. }
  30567. ,
  30568. n.prototype.setNeighbour = function(e, t, i) {
  30569. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  30570. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  30571. this.neighbourMap[e.id][e.id] = !0,
  30572. this.neighbourMap[t.id][t.id] = !0,
  30573. this.neighbourMap[e.id][t.id] = i,
  30574. this.neighbourMap[t.id][e.id] = i,
  30575. this.neighbourMap[e.id]
  30576. }
  30577. ,
  30578. n.prototype.findClosest = function(e, t) {
  30579. var i = [s.filters.isPanoAligned()];
  30580. return t && i.push(s.filters.inDirection(e, t, .75)),
  30581. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  30582. }
  30583. ,
  30584. n.prototype.dualNeighbors = function(e, t) {
  30585. var i, n = [];
  30586. for (i in this.neighbourMap[e.id])
  30587. this.neighbourMap[t.id][i] && n.push(i);
  30588. return n
  30589. }
  30590. ,
  30591. n.prototype.populate_path_graph = function() {
  30592. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  30593. for (e = 0; e < this.list.length; e += 1) {
  30594. o = this.list[e],
  30595. s = {},
  30596. l = !1,
  30597. i = o.neighbourPanos || o.findNeighourPanos();
  30598. for (t in i)
  30599. if (i[t]) {
  30600. a = this.index[t],
  30601. p.copy(o.floorPosition),
  30602. p.sub(a.floorPosition);
  30603. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  30604. , v = (Math.abs(p.y) / Math.max(m, .01),
  30605. Math.max(0, Math.abs(p.y) - .2));
  30606. v > 0 ? (f += 1,
  30607. v = Math.pow(4 * v, 2),
  30608. m = Math.pow(m, 2),
  30609. n = Math.sqrt(v * v + m * m)) : (g += 1,
  30610. n = p.length()),
  30611. s[a.id] = n,
  30612. l = !0
  30613. }
  30614. l ? u[o.id] = s : d += 1
  30615. }
  30616. this.map = u,
  30617. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  30618. }
  30619. ,
  30620. n.prototype.aStarSearch = function(e, t) {
  30621. var i = Date.now()
  30622. , n = new l({
  30623. start: e,
  30624. isEnd: function(e) {
  30625. return e === t
  30626. },
  30627. neighbor: function(e) {
  30628. var t = e.neighbourPanos || e.findNeighourPanos()
  30629. , i = [];
  30630. for (var n in t)
  30631. i.push(this.index[n]);
  30632. return i
  30633. }
  30634. .bind(this),
  30635. distance: function(e, t) {
  30636. var i = this.map[e.id]
  30637. , n = i[t.id];
  30638. return n
  30639. }
  30640. .bind(this),
  30641. heuristic: function(e, t) {
  30642. return 1
  30643. }
  30644. .bind(this),
  30645. hash: function(e) {
  30646. return e.id
  30647. },
  30648. timeout: 5e3
  30649. });
  30650. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  30651. "success" !== n.status)
  30652. return h.debug("Did not find A* path from " + e + " to " + t),
  30653. null;
  30654. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  30655. var r = [];
  30656. return n.path.forEach(function(e) {
  30657. r.push(e.id)
  30658. }),
  30659. r
  30660. }
  30661. ,
  30662. n.prototype.includeNodesNearPath = function() {
  30663. var e = new r.Vector3
  30664. , t = new r.Vector3
  30665. , i = new r.Vector3
  30666. , n = new r.Vector3
  30667. , o = new r.Vector3
  30668. , a = new r.Vector3
  30669. , s = new r.Vector3
  30670. , l = new r.Vector3
  30671. , c = []
  30672. , h = new r.Vector3
  30673. , u = new r.Vector3;
  30674. return function(r, d) {
  30675. if (r)
  30676. for (var p = function(e, t, i) {
  30677. return o.copy(t).sub(e),
  30678. o.dot(i)
  30679. }, f = function(e, t) {
  30680. return p(h, e.position, i) - p(h, t.position, i)
  30681. }, g = 0; g < r.length - 1; ) {
  30682. var m = r[g]
  30683. , v = r[g + 1]
  30684. , A = this.index[m]
  30685. , y = this.index[v];
  30686. h.copy(A.position),
  30687. u.copy(y.position),
  30688. c.length = 0,
  30689. e.copy(u).sub(h),
  30690. i.copy(e).normalize();
  30691. for (var C = 0; C < this.list.length; C++) {
  30692. var I = this.list[C];
  30693. o.copy(I.position).sub(h);
  30694. var E = o.dot(i);
  30695. if (E > 0) {
  30696. s.copy(i),
  30697. s.multiplyScalar(E),
  30698. a.copy(o),
  30699. a.sub(s);
  30700. var b = a.length();
  30701. if (b < d) {
  30702. t.copy(e).negate(),
  30703. n.copy(t).normalize(),
  30704. l.copy(I.position).sub(u);
  30705. var w = l.dot(n);
  30706. w > 0 && c.push(I)
  30707. }
  30708. }
  30709. }
  30710. if (c.length > 0) {
  30711. c.sort(f);
  30712. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  30713. r[_] = r[_ - c.length];
  30714. for (var T = 0; T < c.length; T++)
  30715. r[T + g + 1] = c[T].id
  30716. }
  30717. g += c.length + 1
  30718. }
  30719. }
  30720. }(),
  30721. /* n.prototype.fadeMarkerOpacity = function(e, t) {//opacity dur
  30722. var i = void 0 === e ? a.panorama.markerOpacity : e
  30723. , n = this.list.findIndex(function(e) {//why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30724. return e.marker
  30725. });
  30726. if (!(n < 0)) {
  30727. var r = this.list[n].marker.material.opacity;
  30728. if (r !== e) {
  30729. var o = i - r;
  30730. d.trigger({
  30731. func: function(e, t) {
  30732. var i = r + e * o;
  30733. this.forEach(function(e) {
  30734. e.marker && (e.marker.material.opacity = i)
  30735. })
  30736. }.bind(this),
  30737. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30738. name: "_fpm"
  30739. })
  30740. }
  30741. }
  30742. } */
  30743. //xzw:
  30744. n.prototype.fadeMarkerOpacity = function(e, t, gr) {//opacity dur
  30745. var n = this.list.findIndex(function(e) {//why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30746. return e.marker
  30747. });
  30748. if (n < 0) {console.log("marker findIndex<0"); return};
  30749. var group;
  30750. var tran = function(list,index){
  30751. var member = list.member.filter(function(m){
  30752. return m.marker.material.opacity != list.toOp;
  30753. })
  30754. d.trigger({
  30755. func: function(e, t) {//e:0-1
  30756. list.member.forEach(function(m) {
  30757. var o = m.marker.oldOpacity;
  30758. var i = o + e * (list.toOp - o);
  30759. m.marker && (m.marker.material.opacity = i)
  30760. })
  30761. }.bind(this),
  30762. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30763. name: "_fpm_"+index
  30764. })
  30765. }
  30766. this.forEach(function(e) {//先记录旧的opacity
  30767. e.marker && (e.marker.oldOpacity = e.marker.material.opacity);
  30768. })
  30769. e = void 0 == e ? a.panorama.markerOpacity : e;
  30770. if(e>0 && gr){
  30771. group = gr;
  30772. }else{
  30773. group = [{
  30774. member: this.list,
  30775. toOp: e
  30776. }]
  30777. }
  30778. for(var i=0; i<group.length;i++){
  30779. tran(group[i],i)
  30780. }
  30781. }
  30782. t.exports = n
  30783. }
  30784. ).call(this, "/js/util/PanoramaCollection.js")
  30785. }
  30786. , {
  30787. "../objects/Panorama": 148,
  30788. "../settings": 166,
  30789. "./IndexedCollection": 175,
  30790. "./aStar": 180,
  30791. "./common": 185,
  30792. "./logger": 189,
  30793. "./transitions": 195,
  30794. three: 217
  30795. }],
  30796. 179: [function(e, t, i) {//"./util/ZoomStats"
  30797. "use strict";
  30798. function n() {
  30799. this.actionSequence = [],
  30800. this.actionSequenceInProgress = !1
  30801. }
  30802. function r(e, t, i, n) {
  30803. s.trackAlways("zoom_" + e, {
  30804. from: t,
  30805. to: i,
  30806. pano: n
  30807. })
  30808. }
  30809. function o(e, t) {
  30810. r("initial", 1, e, t)
  30811. }
  30812. function a(e, t, i) {
  30813. r("followup", e, t, i)
  30814. }
  30815. var s = e("../analytics");
  30816. n.prototype.reset = function(e) {
  30817. this.actionSequenceInProgress = !1,
  30818. this.actionSequence.length = 0
  30819. }
  30820. ,
  30821. n.prototype.addZoomAction = function() {
  30822. var e = null
  30823. , t = null
  30824. , i = !1
  30825. , n = function() {
  30826. if (e = null,
  30827. this.actionSequence.length > 0) {
  30828. var i = this.actionSequence[0].start
  30829. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30830. 1 === i ? o(n, t) : a(i, n, t)
  30831. }
  30832. this.reset()
  30833. };
  30834. return function(r, o, a) {
  30835. if (r !== o) {
  30836. i || (n = n.bind(this),
  30837. i = !0),
  30838. e && (window.clearTimeout(e),
  30839. e = null),
  30840. a === t && this.actionSequenceInProgress || (this.reset(),
  30841. t = a),
  30842. this.actionSequenceInProgress = !0;
  30843. var s = {
  30844. start: r,
  30845. end: o
  30846. };
  30847. this.actionSequence.push(s),
  30848. e = window.setTimeout(n, 150)
  30849. }
  30850. }
  30851. }(),
  30852. t.exports = n
  30853. }
  30854. , {
  30855. "../analytics": 4
  30856. }],
  30857. 180: [function(e, t, i) {//"./aStar"
  30858. "use strict";
  30859. function n(e) {
  30860. void 0 === e.timeout && (e.timeout = 1 / 0);
  30861. var t = e.hash || o
  30862. , i = {
  30863. data: e.start,
  30864. g: 0,
  30865. h: e.heuristic(e.start)
  30866. }
  30867. , n = i;
  30868. i.f = i.h;
  30869. var h = new s
  30870. , u = new l(a)
  30871. , d = c();
  30872. u.push(i),
  30873. d.set(t(i.data), i);
  30874. for (var p = new Date; u.size(); ) {
  30875. if (new Date - p > e.timeout)
  30876. return {
  30877. status: "timeout",
  30878. cost: n.g,
  30879. path: r(n)
  30880. };
  30881. var f = u.pop();
  30882. if (d.delete(t(f.data)),
  30883. e.isEnd(f.data))
  30884. return {
  30885. status: "success",
  30886. cost: f.g,
  30887. path: r(f)
  30888. };
  30889. h.add(t(f.data));
  30890. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30891. var v = g[m];
  30892. if (!h.contains(t(v))) {
  30893. var A = f.g + e.distance(f.data, v)
  30894. , y = d.get(t(v))
  30895. , C = !1;
  30896. if (void 0 === y)
  30897. y = {
  30898. data: v
  30899. },
  30900. d.set(t(v), y);
  30901. else {
  30902. if (y.g < A)
  30903. continue;
  30904. C = !0
  30905. }
  30906. y.parent = f,
  30907. y.g = A,
  30908. y.h = e.heuristic(v),
  30909. y.f = A + y.h,
  30910. y.h < n.h && (n = y),
  30911. C ? u.heapify() : u.push(y)
  30912. }
  30913. }
  30914. }
  30915. return {
  30916. status: "noPath",
  30917. cost: n.g,
  30918. path: r(n)
  30919. }
  30920. }
  30921. function r(e) {
  30922. if (void 0 !== e.parent) {
  30923. var t = r(e.parent);
  30924. return t.push(e.data),
  30925. t
  30926. }
  30927. return [e.data]
  30928. }
  30929. function o(e) {
  30930. return e.toString()
  30931. }
  30932. function a(e, t) {
  30933. return e.f - t.f
  30934. }
  30935. var s = e("Set")
  30936. , l = e("heap")
  30937. , c = e("dict");
  30938. t.exports = n
  30939. }
  30940. , {
  30941. Set: 196,
  30942. dict: 210,
  30943. heap: 211
  30944. }],
  30945. 181: [function(e, t, i) {////js/util/ajax.js
  30946. (function(i) {
  30947. "use strict";
  30948. function n(e, t, i) {
  30949. var n = new XMLHttpRequest;
  30950. if (i && "withCredentials"in n)
  30951. n.open(e, t, i);
  30952. else if ("undefined" != typeof XDomainRequest)
  30953. n = new XDomainRequest,
  30954. n.open(e, t);
  30955. else {
  30956. if (i)
  30957. throw "Browser does not support CORS!";
  30958. n.open(e, t)
  30959. }
  30960. return n
  30961. }
  30962. function r(e, t, i) {
  30963. function o() {
  30964. u.warn("Retrying ", t),
  30965. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30966. }
  30967. function a(e, t) {
  30968. var i = e.response;
  30969. if ("json" === t && "object" != typeof i)
  30970. try {
  30971. i = JSON.parse(e.responseText)
  30972. } catch (e) {
  30973. return void c.reject({
  30974. error: "Failed parsing JSON"
  30975. })
  30976. }
  30977. else if ("image/jpeg" === t) {
  30978. var n = new Uint8Array(e.response)
  30979. , r = new Blob([n],{
  30980. type: "image/jpeg"
  30981. })
  30982. , o = URL.createObjectURL(r);
  30983. i = new Image,
  30984. i.src = o,
  30985. i.crossOrigin = "Anonymous",
  30986. i.onload = function() {
  30987. URL.revokeObjectURL(o)
  30988. }
  30989. }
  30990. return i
  30991. }
  30992. var s = n(e, t, !1);
  30993. if (i = i || {},
  30994. i.retries = void 0 !== i.retries ? i.retries : 0,
  30995. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30996. i.responseType)
  30997. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30998. s.responseType = i.responseType;
  30999. else {
  31000. if ("image/jpeg" !== i.responseType)
  31001. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  31002. s.responseType = "arraybuffer"
  31003. }
  31004. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  31005. i.auth && s.setRequestHeader("Authorization", i.auth),
  31006. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  31007. s.setRequestHeader("Content-Type", "application/json")),
  31008. "object" == typeof i.headers)
  31009. for (var l in i.headers)
  31010. s.setRequestHeader(l, i.headers[l]);
  31011. var c = $.Deferred();
  31012. return s.onreadystatechange = function(e) {
  31013. if (4 === this.readyState)
  31014. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  31015. i.retries++,
  31016. setTimeout(o, 1e3);
  31017. else if (200 === this.status) {
  31018. var t = a(this, i.responseType);
  31019. c.resolve(t)
  31020. } else
  31021. c.reject(this)
  31022. }
  31023. ,
  31024. s.onprogress = function(e) {
  31025. c.notify(e)
  31026. }
  31027. ,
  31028. s.send(i.data),
  31029. c.promise()
  31030. }
  31031. function o(e) {
  31032. return Object.keys(e).sort().map(function(t) {
  31033. return {
  31034. key: t,
  31035. value: e[t]
  31036. }
  31037. })
  31038. }
  31039. function a(e, t) {
  31040. var i = t.responseType || null
  31041. , n = t.auth || null
  31042. , r = t.prefetchFrom || null
  31043. , a = e + "__" + i + "__" + n + "__" + r;
  31044. return t.headers && o(t.headers).forEach(function(e) {
  31045. a += "__" + e.key + ":" + e.value
  31046. }),
  31047. a
  31048. }
  31049. function s(e, t) {
  31050. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  31051. }
  31052. function l(e, t, i) {
  31053. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  31054. }
  31055. var c = e("./logger")
  31056. , h = e("../ab")
  31057. , u = new c(i);
  31058. window.URL = window.URL || window.webkitURL,
  31059. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  31060. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  31061. /* setTimeout(function() { //?
  31062. window.MP_REQUEST_CACHE = null,
  31063. window.MP_PREFETCHED_MODELDATA = {}
  31064. }, 6e4),
  31065. window.onpageshow = function(e) {
  31066. e.persisted && (window.MP_REQUEST_CACHE = null,
  31067. window.MP_PREFETCHED_MODELDATA = {})
  31068. } */
  31069. ,
  31070. t.exports = {
  31071. get: function(e, t) {
  31072. t = t || {};
  31073. var i = void 0 === t.cache || t.cache;
  31074. if (i) {
  31075. var n = s(e, t);
  31076. if (n)
  31077. return n
  31078. }
  31079. var o;
  31080. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  31081. i && l(e, t, o),
  31082. o
  31083. },
  31084. post: function(e, t) {
  31085. return r("POST", e, t)
  31086. },
  31087. patch: function(e, t) {
  31088. return r("PATCH", e, t)
  31089. },
  31090. getImage: function(e, t) {
  31091. function i() {
  31092. u.warn("Retrying ", e),
  31093. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  31094. }
  31095. var n = $.Deferred()
  31096. , r = new Image
  31097. , o = this;
  31098. return e = h.changeIfImageOptimzing(e),
  31099. null !== t && void 0 !== t || (t = 3),
  31100. r.onerror = function() {
  31101. t > 0 ? setTimeout(i, 1e3) : n.reject()
  31102. }
  31103. ,
  31104. r.onload = function() {
  31105. n.resolve(r)
  31106. }
  31107. ,
  31108. r.crossOrigin = "anonymous",
  31109. r.src = e,
  31110. n
  31111. }
  31112. }
  31113. }
  31114. ).call(this, "/js/util/ajax.js")
  31115. }
  31116. , {
  31117. "../ab": 3,
  31118. "./logger": 189
  31119. }],
  31120. 182: [function(e, t, i) {//"./util/browser"
  31121. "use strict";
  31122. function n(e, t) {
  31123. var i = window.navigator.userAgent
  31124. , n = i.match(e);
  31125. return n = n ? n[1].split(t) : [],
  31126. {
  31127. major: parseInt(n[0]) || 0,
  31128. minor: parseInt(n[1]) || 0,
  31129. patch: parseInt(n[2]) || 0
  31130. }
  31131. }
  31132. var r = e("../exception/DeviceMismatchException");
  31133. t.exports = {
  31134. isFullscreen: function() {
  31135. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  31136. },
  31137. supportsFullscreen: function() {
  31138. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  31139. },
  31140. isPointerLocked: function() {
  31141. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  31142. },
  31143. requestFullscreen: function(e, t) {
  31144. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  31145. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  31146. },
  31147. requestPointerLock: function() {
  31148. var e;
  31149. if (document.fullscreenElement)
  31150. e = document.fullscreenElement();
  31151. else if (document.mozFullscreenElement)
  31152. e = document.mozFullscreenElement();
  31153. else if (document.mozFullScreenElement)
  31154. e = document.mozFullScreenElement();
  31155. else {
  31156. if (!document.webkitFullscreenElement)
  31157. return;
  31158. e = document.webkitFullscreenElement()
  31159. }
  31160. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  31161. e.requestPointerLock(),
  31162. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  31163. },
  31164. exitPointerLock: function() {
  31165. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  31166. document.exitPointerLock()
  31167. },
  31168. exitFullscreen: function() {
  31169. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  31170. },
  31171. details: function() {
  31172. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  31173. return e ? {
  31174. name: e[1],
  31175. version: parseInt(e[2]),
  31176. platform: navigator.platform
  31177. } : {}
  31178. },
  31179. is: function(e) {
  31180. return this.details() && this.details().name === e
  31181. },
  31182. inIframe: function() {
  31183. return window.parent !== window
  31184. },
  31185. aspectRatio: function() {
  31186. var e = $('#player').width() / $('#player').height();
  31187. return isFinite(e) ? e : 0
  31188. },
  31189. userAgent: function() {
  31190. return window.navigator.userAgent
  31191. },
  31192. isMobile: function() {
  31193. var e = navigator.userAgent || navigator.vendor || window.opera;
  31194. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  31195. },
  31196. isLandscape: function() {
  31197. return this.isMobile && this.aspectRatio() > 1
  31198. },
  31199. isSmallScreen: function() {
  31200. var e = screen.width / window.devicePixelRatio;
  31201. return e < 240
  31202. },
  31203. detectIE: function() {
  31204. var e = window.navigator.userAgent
  31205. , t = e.indexOf("MSIE ");
  31206. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  31207. },
  31208. detectSafari: function() {
  31209. var e = window.navigator.userAgent
  31210. , t = e.indexOf("Safari");
  31211. return t !== -1 && !this.detectChrome()
  31212. },
  31213. detectFirefox: function() {
  31214. var e = window.navigator.userAgent;
  31215. return e.indexOf("Firefox") !== -1
  31216. },
  31217. detectChrome: function() {
  31218. var e = window.navigator.userAgent;
  31219. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  31220. },
  31221. detectOpera: function() {
  31222. var e = window.navigator.userAgent;
  31223. return e.indexOf("OPR") !== -1
  31224. },
  31225. detectIOS: function() {
  31226. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  31227. },
  31228. detectIPad: function() {
  31229. var e = window.navigator.userAgent
  31230. , t = /iPad/;
  31231. return t.test(e)
  31232. },
  31233. detectIPod: function() {
  31234. var e = window.navigator.userAgent
  31235. , t = /iPod/;
  31236. return t.test(e)
  31237. },
  31238. detectIPhone: function() {
  31239. var e = window.navigator.userAgent
  31240. , t = /iPhone/;
  31241. return t.test(e)
  31242. },
  31243. detectAndroid: function() {
  31244. var e = window.navigator.userAgent;
  31245. return e.indexOf("Android") !== -1
  31246. },
  31247. detectAndroidMobile: function() {
  31248. var e = window.navigator.userAgent;
  31249. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  31250. },
  31251. detectSamsungNative: function() {
  31252. var e = window.navigator.userAgent;
  31253. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  31254. },
  31255. detectSamsungS6: function() {
  31256. var e = window.navigator.userAgent;
  31257. return e.indexOf("SM-G92") !== -1
  31258. },
  31259. detectWebVR: function() {
  31260. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  31261. },
  31262. getVRDisplay: function() {
  31263. var e = $.Deferred();
  31264. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  31265. t.length >= 1 && e.resolve(t[0]),
  31266. e.reject(null)
  31267. }),
  31268. e) : e.reject(null)
  31269. },
  31270. iosVersion: function() {
  31271. if (!this.detectIOS())
  31272. throw new r("Did not detect an iDevice");
  31273. var e = /((?:\d+\_?){1,3}) like Mac OS/
  31274. , t = "_";
  31275. return n(e, t)
  31276. },
  31277. androidVersion: function() {
  31278. if (!this.detectAndroid())
  31279. throw new r("Did not detect an Android based device");
  31280. var e = /Android ((?:\d+\.?){1,3})/
  31281. , t = ".";
  31282. return n(e, t)
  31283. },
  31284. valueFromCookie: function(e, t) {
  31285. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  31286. if (!i)
  31287. return t;
  31288. var n = i[1];
  31289. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  31290. },
  31291. valueFromHash: function(e, t) {
  31292. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  31293. , n = i.exec(window.location.href);
  31294. if (!n)
  31295. return t;
  31296. var r = n[1];
  31297. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  31298. }
  31299. }
  31300. }
  31301. , {
  31302. "../exception/DeviceMismatchException": 56
  31303. }],
  31304. 183: [function(e, t, i) {///js/util/camera.js 初始化视角
  31305. (function(i) {
  31306. "use strict";
  31307. function n(e, t) {
  31308. var i = r(t);
  31309. if (Object.keys(i).length > 0)
  31310. return i;
  31311. if (e.heroImage) //这些之后都换了
  31312. i = o(e, t);
  31313. else if (e.data.camera_start) {
  31314. var n = e.data.camera_start;
  31315. try {
  31316. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  31317. i.position = n.camera.position,
  31318. i.quaternion = n.camera.quaternion,
  31319. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  31320. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  31321. d.debug("Using camera_start"),
  31322. d.debug("Modeldata pano: ", i.pano.quaternion),
  31323. d.debug("Camera start pano: ", n.pano.quaternion)),
  31324. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  31325. } catch (e) {
  31326. d.warn(e.message)
  31327. }
  31328. }
  31329. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  31330. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  31331. i.pano = t.findClosest(i.position),
  31332. i.quaternion = i.pano.quaternion),
  31333. 0 === Object.keys(i).length) {
  31334. var a = t.list[0];
  31335. a && (i.mode = h.PANORAMA,
  31336. i.pano = a,
  31337. i.position = a.position,
  31338. i.quaternion = a.quaternion,
  31339. d.info("Starting at 1st pano " + a.id))
  31340. }
  31341. return i.mode = i.mode || h.DOLLHOUSE,
  31342. i
  31343. }
  31344. function r(e) {
  31345. var t = c.valueFromHash("start", "")
  31346. , i = {};
  31347. if ("" !== t) {
  31348. d.debug("Start override found in parameters, trying to parse..."),
  31349. i = a(t) || {};
  31350. var n = c.valueFromHash("tag", null);
  31351. n && (i.tag = n),
  31352. i.panoId && (i.pano = e.get(i.panoId))
  31353. }
  31354. return i
  31355. }
  31356. function o(e, t) {
  31357. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  31358. return {};
  31359. var i = {}
  31360. , n = e.heroImage.metadata;
  31361. d.debug("Using start position from thumbnail image"),
  31362. i.position = n.camera_position,
  31363. i.quaternion = n.camera_quaternion;
  31364. try {
  31365. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  31366. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  31367. } catch (e) {
  31368. d.debug(e.message)
  31369. }
  31370. return i
  31371. }
  31372. function a(e) {
  31373. return s.deserialize(e)
  31374. }
  31375. var s = e("../controls/serializer")
  31376. , l = e("../util/math")
  31377. , c = e("./browser")
  31378. , h = e("../enum/Viewmode")
  31379. , u = e("../util/logger")
  31380. , d = new u(i);
  31381. t.exports = {
  31382. getStartCameraOptions: n
  31383. }
  31384. }
  31385. ).call(this, "/js/util/camera.js")
  31386. }
  31387. , {
  31388. "../controls/serializer": 14,
  31389. "../enum/Viewmode": 51,
  31390. "../util/logger": 189,
  31391. "../util/math": 190,
  31392. "./browser": 182
  31393. }],
  31394. 184: [function(e, t, i) {//"../util/cameraLight"
  31395. "use strict";
  31396. function n(e, t, i) {
  31397. return o(e.fov, t, i)
  31398. }
  31399. var r = e("./MathLight")
  31400. , o = function(e, t, i) {
  31401. var n = t
  31402. , o = i
  31403. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  31404. return a
  31405. }
  31406. , a = function(e, t, i) {
  31407. var n = t
  31408. , o = i
  31409. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  31410. return a
  31411. }
  31412. , s = function(e, t, i, n) {
  31413. var r = o(e, i, n);
  31414. return r > t ? a(t, i, n) : e
  31415. };
  31416. t.exports = {
  31417. clampVFOV: s,
  31418. getHFOVForCamera: n,
  31419. getHFOVFromVFOV: o,
  31420. getVFOVFromHFOV: a
  31421. }
  31422. }
  31423. , {
  31424. "./MathLight": 176
  31425. }],
  31426. 185: [function(e, t, i) {//"./util/common"
  31427. "use strict";
  31428. var n = e("three");
  31429. t.exports = {
  31430. delayOneFrame: function(e) {
  31431. window.setTimeout(e, 1)
  31432. },
  31433. normalizeUrl: function(e) {
  31434. return e.replace("https://", "http://")
  31435. },
  31436. domainFromUrl: function(e) {
  31437. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  31438. return t ? t[3] : e
  31439. },
  31440. average: function(e, t) {
  31441. if (0 === e.length)
  31442. return null;
  31443. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  31444. var o = t ? e[r][t] : e[r];
  31445. i += o,
  31446. n++
  31447. }
  31448. return i / n
  31449. },
  31450. countUnique: function(e) {
  31451. for (var t = {}, i = 0; i < e.length; i++)
  31452. t[e[i]] = 1 + (t[e[i]] || 0);
  31453. return Object.keys(t).length
  31454. },
  31455. averageVectors: function(e, t) {
  31456. var i = new n.Vector3;
  31457. if (0 === e.length)
  31458. return i;
  31459. for (var r = 0, o = 0; o < e.length; o++) {
  31460. var a = t ? e[o][t] : e[o];
  31461. i.add(a),
  31462. r++
  31463. }
  31464. return i.divideScalar(r)
  31465. },
  31466. equalLists: function(e, t) {
  31467. if (e.length !== t.length)
  31468. return !1;
  31469. for (var i = 0; i < e.length; i++)
  31470. if (e[i] !== t[i])
  31471. return !1;
  31472. return !0
  31473. },
  31474. lowerMedian: function(e, t) {
  31475. if (0 === e.length)
  31476. return null;
  31477. t = t || 2,
  31478. e.sort(function(e, t) {
  31479. return e - t
  31480. });
  31481. var i = Math.floor(e.length / t);
  31482. return e[i]
  31483. },
  31484. stableSort: function(e, t) {
  31485. return e.map(function(e, t) {
  31486. return {
  31487. value: e,
  31488. index: t
  31489. }
  31490. }).sort(function(e, i) {
  31491. var n = t(e.value, i.value);
  31492. return 0 !== n ? n : e.index - i.index
  31493. }).map(function(e) {
  31494. return e.value
  31495. })
  31496. },
  31497. filterAll: function(e, t) {
  31498. return e.filter(function(e) {
  31499. return t.every(function(t) {
  31500. return t(e)
  31501. })
  31502. })
  31503. },
  31504. formatDate: function(e) {
  31505. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  31506. },
  31507. formatDatetime: function(e) {
  31508. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  31509. },
  31510. randomString: function(e) {
  31511. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  31512. t += i.charAt(Math.floor(Math.random() * i.length));
  31513. return t
  31514. },
  31515. uint8ToBase64: function(e, t) {
  31516. t && "number" == typeof t || (t = 8192);
  31517. for (var i = [], n = 0; n < e.length; n += t)
  31518. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  31519. return btoa(i.join(""))
  31520. },
  31521. uuid4: function e(t) {
  31522. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  31523. },
  31524. nth: function(e) {
  31525. return e %= 10,
  31526. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  31527. },
  31528. extendObject: function(e, t) {
  31529. return Object.keys(t).forEach(function(i) {
  31530. e[i] = t[i]
  31531. }),
  31532. e
  31533. },
  31534. deepExtend: function e(t) {
  31535. t = t || {};
  31536. for (var i = 1; i < arguments.length; i++) {
  31537. var n = arguments[i];
  31538. if (n)
  31539. for (var r in n)
  31540. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  31541. }
  31542. return t
  31543. },
  31544. inherit: function(e, t) {
  31545. e.prototype = Object.create(t.prototype),
  31546. e.prototype.constructor = e
  31547. },
  31548. extend: function(e, t) {
  31549. for (var i in t.prototype)
  31550. e.prototype[i] = t.prototype[i]
  31551. }
  31552. },
  31553. Math.sign = function(e) {
  31554. return e < 0 ? -1 : 1
  31555. }
  31556. }
  31557. , {
  31558. three: 217
  31559. }],
  31560. 186: [function(e, t, i) {//"../util/easing"
  31561. "use strict";
  31562. var n = {};
  31563. n.linearTween = function(e, t, i, n) {
  31564. return i * e / n + t
  31565. }
  31566. ,
  31567. n.easeInQuad = function(e, t, i, n) {
  31568. return e /= n,
  31569. i * e * e + t
  31570. }
  31571. ,
  31572. n.easeOutQuad = function(e, t, i, n) {
  31573. return e /= n,
  31574. -i * e * (e - 2) + t
  31575. }
  31576. ,
  31577. n.easeInOutQuad = function(e, t, i, n) {
  31578. return e /= n / 2,
  31579. e < 1 ? i / 2 * e * e + t : (e--,
  31580. -i / 2 * (e * (e - 2) - 1) + t)
  31581. }
  31582. ,
  31583. n.easeInCubic = function(e, t, i, n) {
  31584. return e /= n,
  31585. i * e * e * e + t
  31586. }
  31587. ,
  31588. n.easeOutCubic = function(e, t, i, n) {
  31589. return e /= n,
  31590. e--,
  31591. i * (e * e * e + 1) + t
  31592. }
  31593. ,
  31594. n.easeInOutCubic = function(e, t, i, n) {
  31595. return e /= n / 2,
  31596. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  31597. i / 2 * (e * e * e + 2) + t)
  31598. }
  31599. ,
  31600. n.easeInQuart = function(e, t, i, n) {
  31601. return e /= n,
  31602. i * e * e * e * e + t
  31603. }
  31604. ,
  31605. n.easeOutQuart = function(e, t, i, n) {
  31606. return e /= n,
  31607. e--,
  31608. -i * (e * e * e * e - 1) + t
  31609. }
  31610. ,
  31611. n.easeInOutQuart = function(e, t, i, n) {
  31612. return e /= n / 2,
  31613. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  31614. -i / 2 * (e * e * e * e - 2) + t)
  31615. }
  31616. ,
  31617. n.easeInQuint = function(e, t, i, n) {
  31618. return e /= n,
  31619. i * e * e * e * e * e + t
  31620. }
  31621. ,
  31622. n.easeOutQuint = function(e, t, i, n) {
  31623. return e /= n,
  31624. e--,
  31625. i * (e * e * e * e * e + 1) + t
  31626. }
  31627. ,
  31628. n.easeInOutQuint = function(e, t, i, n) {
  31629. return e /= n / 2,
  31630. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  31631. i / 2 * (e * e * e * e * e + 2) + t)
  31632. }
  31633. ,
  31634. n.easeInSine = function(e, t, i, n) {
  31635. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  31636. }
  31637. ,
  31638. n.easeOutSine = function(e, t, i, n) {
  31639. return i * Math.sin(e / n * (Math.PI / 2)) + t
  31640. }
  31641. ,
  31642. n.easeInOutSine = function(e, t, i, n) {
  31643. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  31644. }
  31645. ,
  31646. n.easeInExpo = function(e, t, i, n) {
  31647. return i * Math.pow(2, 10 * (e / n - 1)) + t
  31648. }
  31649. ,
  31650. n.easeOutExpo = function(e, t, i, n) {
  31651. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  31652. }
  31653. ,
  31654. n.easeInOutExpo = function(e, t, i, n) {
  31655. return e /= n / 2,
  31656. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  31657. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  31658. }
  31659. ,
  31660. n.easeInCirc = function(e, t, i, n) {
  31661. return e /= n,
  31662. -i * (Math.sqrt(1 - e * e) - 1) + t
  31663. }
  31664. ,
  31665. n.easeOutCirc = function(e, t, i, n) {
  31666. return e /= n,
  31667. e--,
  31668. i * Math.sqrt(1 - e * e) + t
  31669. }
  31670. ,
  31671. n.easeInOutCirc = function(e, t, i, n) {
  31672. return e /= n / 2,
  31673. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  31674. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  31675. }
  31676. ,
  31677. n.easeInElastic = function(e, t, i, n) {
  31678. var r = 1.70158
  31679. , o = 0
  31680. , a = i;
  31681. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31682. a < Math.abs(i) ? (a = i,
  31683. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31684. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  31685. }
  31686. ,
  31687. n.easeOutElastic = function(e, t, i, n) {
  31688. var r = 1.70158
  31689. , o = 0
  31690. , a = i;
  31691. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31692. a < Math.abs(i) ? (a = i,
  31693. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31694. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  31695. }
  31696. ,
  31697. n.easeInOutElastic = function(e, t, i, n) {
  31698. var r = 1.70158
  31699. , o = 0
  31700. , a = i;
  31701. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  31702. a < Math.abs(i) ? (a = i,
  31703. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31704. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  31705. }
  31706. ,
  31707. n.easeInBack = function(e, t, i, n, r) {
  31708. return void 0 === r && (r = 1.70158),
  31709. i * (e /= n) * e * ((r + 1) * e - r) + t
  31710. }
  31711. ,
  31712. n.easeOutBack = function(e, t, i, n, r) {
  31713. return void 0 === r && (r = 1.70158),
  31714. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  31715. }
  31716. ,
  31717. n.easeInOutBack = function(e, t, i, n, r) {
  31718. return void 0 === r && (r = 1.70158),
  31719. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  31720. }
  31721. ,
  31722. n.easeOutBounce = function(e, t, i, n) {
  31723. return (e /= n) < 1 / 2.75 ? i * (7.5625 * e * e) + t : e < 2 / 2.75 ? i * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? i * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : i * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  31724. }
  31725. ,
  31726. n.easeInBounce = function(e, t, i, r) {
  31727. return i - n.easeOutBounce(r - e, 0, i, r) + t
  31728. }
  31729. ,
  31730. n.easeInOutBounce = function(e, t, i, r) {
  31731. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  31732. }
  31733. ,
  31734. t.exports = n
  31735. }
  31736. , {}],
  31737. 187: [function(e, t, i) {//"./util/history"
  31738. "use strict";
  31739. function n() {
  31740. this.events = [],
  31741. this.valid = !1
  31742. }
  31743. var r = e("../enum/Joystick");
  31744. n.prototype.push = function(e, t) {
  31745. this.events.push({
  31746. direction: e,
  31747. pano: t
  31748. }),
  31749. this.valid = !0
  31750. }
  31751. ,
  31752. n.prototype.pop = function(e) {
  31753. var t = this.events.pop();
  31754. return this.events.length < 1 && (this.valid = !1),
  31755. t
  31756. }
  31757. ,
  31758. n.prototype.peek = function() {
  31759. return this.events.length ? this.events[this.events.length - 1] : {
  31760. direction: null,
  31761. pano: null
  31762. }
  31763. }
  31764. ,
  31765. n.prototype.invalidate = function() {
  31766. this.events = [],
  31767. this.valid = !1
  31768. }
  31769. ,
  31770. n.prototype.reversePano = function(e) {
  31771. if (!this.valid)
  31772. return null;
  31773. var t = this.peek();
  31774. return r.opposite(e) === t.direction ? (this.pop(),
  31775. t.pano) : null
  31776. }
  31777. ,
  31778. t.exports = n
  31779. }
  31780. , {
  31781. "../enum/Joystick": 29
  31782. }],
  31783. 188: [function(e, t, i) {//"./util/lerp"
  31784. "use strict";
  31785. t.exports = {
  31786. vector: function(e, t) {
  31787. var i = e.clone();
  31788. return t = t.clone(),
  31789. function(n) {
  31790. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31791. }
  31792. },
  31793. quaternion: function(e, t) {
  31794. var i = e.clone();
  31795. return function(n) {
  31796. e.copy(i).slerp(t, n)
  31797. }
  31798. },
  31799. property: function(e, t, i, n) {
  31800. var r = e[t];
  31801. return function(o) {
  31802. e[t] = r * (1 - o) + i * o,
  31803. n && n(e[t])
  31804. }
  31805. },
  31806. uniform: function(e, t, i) {
  31807. var n = e.material.uniforms[t].value;
  31808. return function(r) {
  31809. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31810. }
  31811. },
  31812. matrix4: function(e, t) {
  31813. var i = e.clone();
  31814. return function(n) {
  31815. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31816. r[s] = o[s] * (1 - n) + a[s] * n
  31817. }
  31818. },
  31819. allUniforms: function(e, t, i) {
  31820. var n = e.map(function(e) {
  31821. return this.uniform(e, t, i)
  31822. }
  31823. .bind(this));
  31824. return function(e) {
  31825. n.forEach(function(t) {
  31826. t(e)
  31827. })
  31828. }
  31829. }
  31830. }
  31831. }
  31832. , {}],
  31833. 189: [function(e, t, i) {//"./util/logger"
  31834. "use strict";
  31835. function n(e) {
  31836. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31837. if (n.consoleEnabled) {
  31838. var h = function(e) {
  31839. $("#debug-console").append("<p>" + e + "</p>"),
  31840. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31841. };
  31842. t = function(e) {
  31843. h(Array.prototype.slice.call(arguments).join(" "))
  31844. }
  31845. ,
  31846. i = function(e) {
  31847. h(Array.prototype.slice.call(arguments).join(" "))
  31848. }
  31849. ,
  31850. o = function(e) {
  31851. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31852. }
  31853. ,
  31854. a = function(e) {
  31855. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31856. }
  31857. } else
  31858. console.log ? (t = console.log,
  31859. i = console.info ? console.info : console.log,
  31860. o = console.warn ? console.warn : console.log,
  31861. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31862. ;
  31863. var u = function(e) {
  31864. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31865. }
  31866. , d = function(t, i) {
  31867. if (r) {
  31868. var o = Array.prototype.slice.call(t).join(" ");
  31869. r.captureMessage(o, {
  31870. level: i,
  31871. path: e,
  31872. timestamp: n.timestamp()
  31873. })
  31874. }
  31875. }
  31876. , p = function(t, i) {
  31877. if (r) {
  31878. var o = Array.prototype.slice.call(t).join(" ");
  31879. r.captureException(new Error(o), {
  31880. level: i,
  31881. path: e,
  31882. timestamp: n.timestamp()
  31883. })
  31884. }
  31885. };
  31886. return {
  31887. debug: function() {
  31888. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31889. },
  31890. info: function() {
  31891. n.level >= n.levels.info && i.apply(console, u(arguments))
  31892. },
  31893. warn: function() {
  31894. d(arguments, "warn"),
  31895. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31896. },
  31897. error: function() {
  31898. p(arguments, "error"),
  31899. n.level >= n.levels.error && a.apply(console, u(arguments))
  31900. },
  31901. v3str: function(e, t) {
  31902. var i = void 0 === t ? 2 : t;
  31903. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31904. },
  31905. eulstr: function(e, t) {
  31906. var i = void 0 === t ? 2 : t;
  31907. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31908. },
  31909. time: function(e) {
  31910. n.level >= n.levels.debug && (c[e] = Date.now())
  31911. },
  31912. timeEnd: function(e) {
  31913. if (n.level >= n.levels.debug) {
  31914. var t = c[e];
  31915. if (!t)
  31916. return;
  31917. var i = (Date.now() - t) / 1e3;
  31918. this.debug(e, i + "s")
  31919. }
  31920. }
  31921. }
  31922. }
  31923. var r = window.Raven;
  31924. n.timestamp = function() {
  31925. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31926. }
  31927. ,
  31928. n.levels = {
  31929. debug: 3,
  31930. info: 2,
  31931. warn: 1,
  31932. error: 0
  31933. },
  31934. n.level = n.levels.info,
  31935. t.exports = n
  31936. }
  31937. , {}],
  31938. 190: [function(e, t, i) {//"../util/math"
  31939. "use strict";
  31940. var n = e("three")
  31941. , r = e("../enum/GLCubeFaces")
  31942. , o = e("../constants");
  31943. t.exports = {
  31944. convertVisionVector: function(e) {
  31945. return new n.Vector3(e.x,e.z,-e.y)
  31946. },
  31947. convertVisionQuaternion: function(e) {
  31948. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  31949. },
  31950. convertWorkshopVector: function(e) {
  31951. return new n.Vector3(-e.x,e.y,e.z)
  31952. },
  31953. convertWorkshopQuaternion: function(e) {
  31954. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  31955. },
  31956. convertWorkshopPanoramaQuaternion: function(e) {
  31957. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  31958. },
  31959. convertWorkshopOrthoZoom: function(e) {
  31960. return e === -1 ? -1 : e / 16 * ($('#player').width() / $('#player').height()) / o.workshopApsect
  31961. },
  31962. toPrecision: function(e, t) {
  31963. var i = Math.pow(10, t);
  31964. return Math.round(e * i) / i
  31965. },
  31966. isEmptyQuaternion: function(e) {
  31967. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31968. },
  31969. projectPositionToCanvas: function(e, t, i) {
  31970. i = i || new n.Vector3,
  31971. i.copy(e);
  31972. var r = .5 * $('#player').width()
  31973. , o = .5 * $('#player').height();
  31974. return i.project(t),
  31975. i.x = i.x * r + r,
  31976. i.y = -(i.y * o) + o,
  31977. i
  31978. },
  31979. convertScreenPositionToNDC: function(e, t, i) {
  31980. return i = i || new n.Vector2,
  31981. i.x = e / $('#player').width() * 2 - 1,
  31982. i.y = 2 * -(t / $('#player').height()) + 1,
  31983. i
  31984. },
  31985. constrainedTurn: function(e) {
  31986. var t = e % (2 * Math.PI);
  31987. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31988. },
  31989. getFOVDotThreshold: function(e) {
  31990. return Math.cos(n.Math.degToRad(e / 2))
  31991. },
  31992. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31993. switch (e) {
  31994. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31995. i.set(1, t.y, t.x);
  31996. break;
  31997. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31998. i.set(-1, t.y, -t.x);
  31999. break;
  32000. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  32001. i.set(-t.x, 1, -t.y);
  32002. break;
  32003. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  32004. i.set(-t.x, -1, t.y);
  32005. break;
  32006. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  32007. i.set(-t.x, t.y, 1);
  32008. break;
  32009. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  32010. i.set(t.x, t.y, -1)
  32011. }
  32012. n && i.normalize()
  32013. }
  32014. }
  32015. }
  32016. , {
  32017. "../constants": 8,
  32018. "../enum/GLCubeFaces": 25,
  32019. three: 217
  32020. }],
  32021. 191: [function(e, t, i) {//"../util/panorama"
  32022. "use strict";
  32023. function n(e, t, i) {
  32024. return a.map(function(n, o) {
  32025. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  32026. }
  32027. .bind(this))
  32028. }
  32029. function r(e) {
  32030. return s[e]
  32031. }
  32032. var o = e("../enum/GLCubeFaces")
  32033. , a = [0, 1, 2, 3, 4, 5]
  32034. , s = {
  32035. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  32036. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  32037. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  32038. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  32039. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  32040. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  32041. };
  32042. t.exports = {
  32043. mapFaceToCubemapFace: r,
  32044. getCubemapUrls: n
  32045. }
  32046. }
  32047. , {
  32048. "../enum/GLCubeFaces": 25
  32049. }],
  32050. 192: [function(e, t, i) {//"./util/sentry"
  32051. "use strict";
  32052. t.exports = {
  32053. captureErrors: function(e, t, i) {
  32054. if ("Raven"in window) {
  32055. Raven.config(e, t).install(),
  32056. i && Raven.setTagsContext(i);
  32057. var n = console.warn
  32058. , r = console.error;
  32059. console.warn = function() {
  32060. var e = Array.prototype.slice.call(arguments);
  32061. Raven.captureMessage(e.join(" "), {
  32062. level: "warning"
  32063. }),
  32064. n.apply(console, e)
  32065. }
  32066. ,
  32067. console.error = function() {
  32068. var e = Array.prototype.slice.call(arguments);
  32069. Raven.captureException(new Error(e.join(" ")), {
  32070. level: "error"
  32071. }),
  32072. r.apply(console, e)
  32073. }
  32074. } else
  32075. console.error("Raven not found, not capturing errors.")
  32076. }
  32077. }
  32078. }
  32079. , {}],
  32080. 193: [function(e, t, i) {///js/util/showcase.js
  32081. (function(i) {
  32082. "use strict";
  32083. var n = e("./browser")
  32084. , r = e("../constants")
  32085. , o = e("url")
  32086. , a = e("./logger")
  32087. , s = new a(i)
  32088. , l = {
  32089. getAuthorizationHeader: function() {
  32090. var e = n.valueFromHash("auth");
  32091. if (e)
  32092. return e.replace(",", " ");
  32093. var t = n.valueFromCookie("token");
  32094. return t ? "Token " + t : null
  32095. },
  32096. parseSidUrl: function(e) {
  32097. var t, i;
  32098. if (e = e || "",
  32099. e.match(/^https?/)) {//改
  32100. var n = o.parse(e);
  32101. t = n.protocol + "//" + n.host,
  32102. i = e
  32103. } else //xzw 原先的不能用
  32104. //t = window.location.protocol + "//" + window.location.host, //MP
  32105. t = ""
  32106. //i = t + "/api/player/models/" + e; //MP
  32107. i = t + "data/" + e;
  32108. return {
  32109. urlBase: t ,
  32110. urlModel: i,
  32111. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  32112. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  32113. }
  32114. },
  32115. getModelIDFromQueryString: function() {
  32116. return n.valueFromHash("model") || n.valueFromHash("m")
  32117. },
  32118. normalizeModeldata: function(e, t) {
  32119. e = JSON.parse(JSON.stringify(e));
  32120. var i = null;
  32121. if (e.images.forEach(function(n) {
  32122. if (n.metadata && "string" == typeof n.metadata)
  32123. try {
  32124. n.metadata = JSON.parse(n.metadata)
  32125. } catch (e) {
  32126. s.warn("Unable to parse image metadata"),
  32127. n.metadata = null
  32128. }
  32129. else
  32130. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  32131. n.metadata && (n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  32132. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position)),
  32133. !i && e.icon && e.icon === n.sid && (i = n.metadata))
  32134. }),
  32135. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  32136. var n = {};
  32137. n.pano = {
  32138. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  32139. position: t.convertWorkshopVector(i.scan_position),
  32140. uuid: i.scan_id
  32141. },
  32142. n.camera = {
  32143. quaternion: i.camera_quaternion,
  32144. position: i.camera_position
  32145. },
  32146. e.startPano = n
  32147. }
  32148. return e
  32149. },
  32150. visionVersionToInt: function() {
  32151. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  32152. return function(t) {
  32153. if (!t)
  32154. throw new Error("Vision version is required");
  32155. var i = e.exec(t);
  32156. if (null === i)
  32157. throw new Error("String is not a vision version: " + t);
  32158. return parseInt(i[1])
  32159. }
  32160. }(),
  32161. modelDataPromisesTiles: function(e) {
  32162. if (e.vision_version)
  32163. try {
  32164. return l.visionVersionToInt(e.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  32165. } catch (t) {
  32166. s.warn("Invalid vision version: " + e.vision_version)
  32167. }
  32168. var t = e.created ? new Date(e.created) : null;
  32169. return t && t >= r.visionTilingStartDate
  32170. }
  32171. };
  32172. t.exports = l
  32173. }
  32174. ).call(this, "/js/util/showcase.js")
  32175. }
  32176. , {
  32177. "../constants": 8,
  32178. "./browser": 182,
  32179. "./logger": 189,
  32180. url: 208
  32181. }],
  32182. 194: [function(e, t, i) {//"../util/texture"
  32183. "use strict";
  32184. var n = e("../util/ajax")
  32185. , r = e("three")
  32186. , o = e("../settings")
  32187. , a = {};
  32188. t.exports = {
  32189. load: function(e, t, i) {
  32190. var s = a[e];
  32191. return s ? (t && setTimeout(function() {
  32192. t(s)
  32193. }, 1),
  32194. s) : (s = new r.Texture,
  32195. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  32196. s.magFilter = r.LinearFilter,
  32197. s.generateMipmaps = !1),
  32198. s.sourceFile = e,
  32199. a[e] = s,
  32200. n.getImage(e).then(function(e) {
  32201. s.image = e,
  32202. s.needsUpdate = !0,
  32203. t && t(s)
  32204. }).fail(i),
  32205. s)
  32206. },
  32207. loadBase64: function(e, t) {
  32208. t = t || "png";
  32209. var i = new r.Texture;
  32210. return i.image = document.createElement("img"),
  32211. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  32212. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  32213. i.magFilter = r.LinearFilter,
  32214. i.generateMipmaps = !1),
  32215. i.needsUpdate = !0,
  32216. i
  32217. },
  32218. isLoaded: function(e) {
  32219. return !!a[e]
  32220. }
  32221. }
  32222. }
  32223. , {
  32224. "../settings": 166,
  32225. "../util/ajax": 181,
  32226. three: 217
  32227. }],
  32228. 195: [function(e, t, i) {//"./util/transitions"
  32229. "use strict";
  32230. var n = e("./easing");
  32231. t.exports = {
  32232. globalDone: null,
  32233. funcs: [],
  32234. counter: 0,
  32235. uniqueID: 0,
  32236. start: function(e, t, i, r, o, a, s) {
  32237. return r = r || 0,
  32238. this.funcs.push({
  32239. func: e,
  32240. current: -r * Math.abs(t),
  32241. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  32242. done: i,
  32243. easing: o || n.linearTween,
  32244. cycling: t < 0,
  32245. running: !0,
  32246. debug: r < 0,
  32247. name: a || "T" + this.counter,
  32248. id: void 0 === s ? this.counter : s,
  32249. paused: !1
  32250. }),
  32251. e(0, 16),
  32252. this.counter += 1,
  32253. e
  32254. },
  32255. trigger: function(e) {
  32256. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  32257. , i = e.func || function() {}
  32258. , r = void 0 === e.duration ? 0 : e.duration;
  32259. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  32260. var o = e.done || null
  32261. , a = e.easing || n.linearTween
  32262. , s = e.name || "R" + this.counter
  32263. , l = void 0 === e.id ? this.counter : e.id;
  32264. return this.start(i, r, o, t, a, s, l)
  32265. },
  32266. setTimeout: function(e, t, i) {
  32267. var n = void 0 === i ? this.counter : i;
  32268. return this.trigger({
  32269. done: e,
  32270. duration: void 0 === t ? 0 : t,
  32271. name: "O" + this.counter,
  32272. id: n
  32273. })
  32274. },
  32275. pause: function() {
  32276. this.paused = !0
  32277. },
  32278. resume: function() {
  32279. this.paused = !1
  32280. },
  32281. update: function(e) {
  32282. this.funcs.forEach(function(t) {
  32283. if (!(t.paused || (t.current += 1e3 * e,
  32284. t.current < 0)))
  32285. if (t.current >= t.duration && !t.cycling) {
  32286. var i = t.easing(1, 0, 1, 1);
  32287. t.func(i, 1e3 * e),
  32288. t.done && t.done(),
  32289. t.running = !1
  32290. } else {
  32291. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  32292. , r = t.func(n, 1e3 * e) || !1;
  32293. r && (t.done && t.done(),
  32294. t.running = !1)
  32295. }
  32296. });
  32297. var t = this.funcs.length;
  32298. this.funcs = this.funcs.filter(function(e) {
  32299. return e.running
  32300. });
  32301. var i = this.funcs.length;
  32302. if (t > 0 && 0 === i && this.globalDone) {
  32303. var n = this.globalDone;
  32304. this.globalDone = null,
  32305. n()
  32306. }
  32307. },
  32308. adjustSpeed: function(e, t) {
  32309. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  32310. var r = i[n];
  32311. r.duration /= t,
  32312. r.current /= t
  32313. }
  32314. },
  32315. getById: function(e) {
  32316. return this.funcs.filter(function(t) {
  32317. return e === t.id
  32318. })
  32319. },
  32320. get: function(e) {
  32321. for (var t = 0; t < this.funcs.length; t += 1)
  32322. if (this.funcs[t].func === e)
  32323. return this.funcs[t];
  32324. return null
  32325. },
  32326. isRunning: function(e) {
  32327. var t = this.get(e);
  32328. return null !== t && t.running
  32329. },
  32330. countActive: function() {
  32331. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  32332. e += this.funcs[t].running;
  32333. return e
  32334. },
  32335. listActive: function() {
  32336. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  32337. this.funcs[t].running && e.push(this.funcs[t].name);
  32338. return e
  32339. },
  32340. done: function(e) {
  32341. this.globalDone = e
  32342. },
  32343. cancelById: function(e) {
  32344. var t = void 0 === e ? 0 : e;
  32345. this.funcs = this.funcs.filter(function(e) {
  32346. return e.id !== t
  32347. })
  32348. },
  32349. cancel: function(e) {
  32350. this.funcs = this.funcs.filter(function(t) {
  32351. return t.func !== e
  32352. })
  32353. },
  32354. getUniqueId: function() {
  32355. return this.uniqueID -= 1,
  32356. this.uniqueID
  32357. }
  32358. }
  32359. }
  32360. , {
  32361. "./easing": 186
  32362. }],
  32363. 196: [function(e, t, i) {//Set
  32364. function n(e) {
  32365. if (this.set = {},
  32366. this.infContains = function() {
  32367. return !0
  32368. }
  32369. ,
  32370. "object" == typeof e)
  32371. if (e instanceof Array)
  32372. for (var t = 0; t < e.length; t++)
  32373. this.set[e[t]] = !0;
  32374. else
  32375. this.set = e;
  32376. else if ("function" == typeof e)
  32377. this.infContains = e;
  32378. else if ("undefined" != typeof e)
  32379. throw new Error("set must be either an array or an object.")
  32380. }
  32381. t.exports = n,
  32382. n.prototype.contains = function(e) {
  32383. return !!this.set[e]
  32384. }
  32385. ,
  32386. n.prototype.has = n.prototype.contains,
  32387. n.prototype.add = function(e) {
  32388. if (1 == arguments.length)
  32389. this.set[e] = !0;
  32390. else
  32391. for (var t = 0; t < arguments.length; t++)
  32392. this.set[arguments[t]] = !0
  32393. }
  32394. ,
  32395. n.prototype.addAll = function(e) {
  32396. if ("object" != typeof e && !(e instanceof Array))
  32397. throw new Error("arr must be an array.");
  32398. for (var t = 0; t < e.length; t++)
  32399. this.add(e[t])
  32400. }
  32401. ,
  32402. n.prototype.remove = function(e) {
  32403. if (1 == arguments.length)
  32404. delete this.set[e];
  32405. else
  32406. for (var t = 0; t < arguments.length; t++)
  32407. delete this.set[arguments[t]]
  32408. }
  32409. ,
  32410. n.prototype.delete = n.prototype.remove,
  32411. n.prototype.clear = function() {
  32412. this.set = {}
  32413. }
  32414. ,
  32415. n.prototype.size = function() {
  32416. return Object.keys(this.set).length
  32417. }
  32418. ,
  32419. n.prototype.toString = function() {
  32420. return "{" + Object.keys(this.set).toString() + "}"
  32421. }
  32422. ,
  32423. n.prototype.toArray = function() {
  32424. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  32425. }
  32426. ,
  32427. n.prototype["*values"] = n.prototype.toArray
  32428. }
  32429. , {}],
  32430. 197: [function(e, t, i) {}//fs path ?
  32431. , {}],
  32432. 198: [function(e, t, i) {//buffer
  32433. (function(t) {
  32434. "use strict";
  32435. function n() {
  32436. try {
  32437. var e = new Uint8Array(1);
  32438. return e.__proto__ = {
  32439. __proto__: Uint8Array.prototype,
  32440. foo: function() {
  32441. return 42
  32442. }
  32443. },
  32444. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  32445. } catch (e) {
  32446. return !1
  32447. }
  32448. }
  32449. function r() {
  32450. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  32451. }
  32452. function o(e, t) {
  32453. if (r() < t)
  32454. throw new RangeError("Invalid typed array length");
  32455. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  32456. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  32457. e.length = t),
  32458. e
  32459. }
  32460. function a(e, t, i) {
  32461. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  32462. return new a(e,t,i);
  32463. if ("number" == typeof e) {
  32464. if ("string" == typeof t)
  32465. throw new Error("If encoding is specified then the first argument must be a string");
  32466. return h(this, e)
  32467. }
  32468. return s(this, e, t, i)
  32469. }
  32470. function s(e, t, i, n) {
  32471. if ("number" == typeof t)
  32472. throw new TypeError('"value" argument must not be a number');
  32473. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  32474. }
  32475. function l(e) {
  32476. if ("number" != typeof e)
  32477. throw new TypeError('"size" argument must be a number');
  32478. if (e < 0)
  32479. throw new RangeError('"size" argument must not be negative')
  32480. }
  32481. function c(e, t, i, n) {
  32482. return l(t),
  32483. t <= 0 ? o(e, t) : void 0 !== i ? "string" == typeof n ? o(e, t).fill(i, n) : o(e, t).fill(i) : o(e, t)
  32484. }
  32485. function h(e, t) {
  32486. if (l(t),
  32487. e = o(e, t < 0 ? 0 : 0 | g(t)),
  32488. !a.TYPED_ARRAY_SUPPORT)
  32489. for (var i = 0; i < t; ++i)
  32490. e[i] = 0;
  32491. return e
  32492. }
  32493. function u(e, t, i) {
  32494. if ("string" == typeof i && "" !== i || (i = "utf8"),
  32495. !a.isEncoding(i))
  32496. throw new TypeError('"encoding" must be a valid string encoding');
  32497. var n = 0 | v(t, i);
  32498. e = o(e, n);
  32499. var r = e.write(t, i);
  32500. return r !== n && (e = e.slice(0, r)),
  32501. e
  32502. }
  32503. function d(e, t) {
  32504. var i = t.length < 0 ? 0 : 0 | g(t.length);
  32505. e = o(e, i);
  32506. for (var n = 0; n < i; n += 1)
  32507. e[n] = 255 & t[n];
  32508. return e
  32509. }
  32510. function p(e, t, i, n) {
  32511. if (t.byteLength,
  32512. i < 0 || t.byteLength < i)
  32513. throw new RangeError("'offset' is out of bounds");
  32514. if (t.byteLength < i + (n || 0))
  32515. throw new RangeError("'length' is out of bounds");
  32516. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  32517. a.TYPED_ARRAY_SUPPORT ? (e = t,
  32518. e.__proto__ = a.prototype) : e = d(e, t),
  32519. e
  32520. }
  32521. function f(e, t) {
  32522. if (a.isBuffer(t)) {
  32523. var i = 0 | g(t.length);
  32524. return e = o(e, i),
  32525. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  32526. e)
  32527. }
  32528. if (t) {
  32529. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  32530. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  32531. if ("Buffer" === t.type && $(t.data))
  32532. return d(e, t.data)
  32533. }
  32534. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  32535. }
  32536. function g(e) {
  32537. if (e >= r())
  32538. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  32539. return 0 | e
  32540. }
  32541. function m(e) {
  32542. return +e != e && (e = 0),
  32543. a.alloc(+e)
  32544. }
  32545. function v(e, t) {
  32546. if (a.isBuffer(e))
  32547. return e.length;
  32548. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  32549. return e.byteLength;
  32550. "string" != typeof e && (e = "" + e);
  32551. var i = e.length;
  32552. if (0 === i)
  32553. return 0;
  32554. for (var n = !1; ; )
  32555. switch (t) {
  32556. case "ascii":
  32557. case "latin1":
  32558. case "binary":
  32559. return i;
  32560. case "utf8":
  32561. case "utf-8":
  32562. case void 0:
  32563. return j(e).length;
  32564. case "ucs2":
  32565. case "ucs-2":
  32566. case "utf16le":
  32567. case "utf-16le":
  32568. return 2 * i;
  32569. case "hex":
  32570. return i >>> 1;
  32571. case "base64":
  32572. return Z(e).length;
  32573. default:
  32574. if (n)
  32575. return j(e).length;
  32576. t = ("" + t).toLowerCase(),
  32577. n = !0
  32578. }
  32579. }
  32580. function A(e, t, i) {
  32581. var n = !1;
  32582. if ((void 0 === t || t < 0) && (t = 0),
  32583. t > this.length)
  32584. return "";
  32585. if ((void 0 === i || i > this.length) && (i = this.length),
  32586. i <= 0)
  32587. return "";
  32588. if (i >>>= 0,
  32589. t >>>= 0,
  32590. i <= t)
  32591. return "";
  32592. for (e || (e = "utf8"); ; )
  32593. switch (e) {
  32594. case "hex":
  32595. return L(this, t, i);
  32596. case "utf8":
  32597. case "utf-8":
  32598. return M(this, t, i);
  32599. case "ascii":
  32600. return P(this, t, i);
  32601. case "latin1":
  32602. case "binary":
  32603. return O(this, t, i);
  32604. case "base64":
  32605. return S(this, t, i);
  32606. case "ucs2":
  32607. case "ucs-2":
  32608. case "utf16le":
  32609. case "utf-16le":
  32610. return D(this, t, i);
  32611. default:
  32612. if (n)
  32613. throw new TypeError("Unknown encoding: " + e);
  32614. e = (e + "").toLowerCase(),
  32615. n = !0
  32616. }
  32617. }
  32618. function y(e, t, i) {
  32619. var n = e[t];
  32620. e[t] = e[i],
  32621. e[i] = n
  32622. }
  32623. function C(e, t, i, n, r) {
  32624. if (0 === e.length)
  32625. return -1;
  32626. if ("string" == typeof i ? (n = i,
  32627. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  32628. i = +i,
  32629. isNaN(i) && (i = r ? 0 : e.length - 1),
  32630. i < 0 && (i = e.length + i),
  32631. i >= e.length) {
  32632. if (r)
  32633. return -1;
  32634. i = e.length - 1
  32635. } else if (i < 0) {
  32636. if (!r)
  32637. return -1;
  32638. i = 0
  32639. }
  32640. if ("string" == typeof t && (t = a.from(t, n)),
  32641. a.isBuffer(t))
  32642. return 0 === t.length ? -1 : I(e, t, i, n, r);
  32643. if ("number" == typeof t)
  32644. return t &= 255,
  32645. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  32646. throw new TypeError("val must be string, number or Buffer")
  32647. }
  32648. function I(e, t, i, n, r) {
  32649. function o(e, t) {
  32650. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32651. }
  32652. var a = 1
  32653. , s = e.length
  32654. , l = t.length;
  32655. if (void 0 !== n && (n = String(n).toLowerCase(),
  32656. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32657. if (e.length < 2 || t.length < 2)
  32658. return -1;
  32659. a = 2,
  32660. s /= 2,
  32661. l /= 2,
  32662. i /= 2
  32663. }
  32664. var c;
  32665. if (r) {
  32666. var h = -1;
  32667. for (c = i; c < s; c++)
  32668. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32669. if (h === -1 && (h = c),
  32670. c - h + 1 === l)
  32671. return h * a
  32672. } else
  32673. h !== -1 && (c -= c - h),
  32674. h = -1
  32675. } else
  32676. for (i + l > s && (i = s - l),
  32677. c = i; c >= 0; c--) {
  32678. for (var u = !0, d = 0; d < l; d++)
  32679. if (o(e, c + d) !== o(t, d)) {
  32680. u = !1;
  32681. break
  32682. }
  32683. if (u)
  32684. return c
  32685. }
  32686. return -1
  32687. }
  32688. function E(e, t, i, n) {
  32689. i = Number(i) || 0;
  32690. var r = e.length - i;
  32691. n ? (n = Number(n),
  32692. n > r && (n = r)) : n = r;
  32693. var o = t.length;
  32694. if (o % 2 !== 0)
  32695. throw new TypeError("Invalid hex string");
  32696. n > o / 2 && (n = o / 2);
  32697. for (var a = 0; a < n; ++a) {
  32698. var s = parseInt(t.substr(2 * a, 2), 16);
  32699. if (isNaN(s))
  32700. return a;
  32701. e[i + a] = s
  32702. }
  32703. return a
  32704. }
  32705. function b(e, t, i, n) {
  32706. return q(j(t, e.length - i), e, i, n)
  32707. }
  32708. function w(e, t, i, n) {
  32709. return q(Y(t), e, i, n)
  32710. }
  32711. function _(e, t, i, n) {
  32712. return w(e, t, i, n)
  32713. }
  32714. function T(e, t, i, n) {
  32715. return q(Z(t), e, i, n)
  32716. }
  32717. function x(e, t, i, n) {
  32718. return q(X(t, e.length - i), e, i, n)
  32719. }
  32720. function S(e, t, i) {
  32721. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32722. }
  32723. function M(e, t, i) {
  32724. i = Math.min(e.length, i);
  32725. for (var n = [], r = t; r < i; ) {
  32726. var o = e[r]
  32727. , a = null
  32728. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32729. if (r + s <= i) {
  32730. var l, c, h, u;
  32731. switch (s) {
  32732. case 1:
  32733. o < 128 && (a = o);
  32734. break;
  32735. case 2:
  32736. l = e[r + 1],
  32737. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32738. u > 127 && (a = u));
  32739. break;
  32740. case 3:
  32741. l = e[r + 1],
  32742. c = e[r + 2],
  32743. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32744. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32745. break;
  32746. case 4:
  32747. l = e[r + 1],
  32748. c = e[r + 2],
  32749. h = e[r + 3],
  32750. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32751. u > 65535 && u < 1114112 && (a = u))
  32752. }
  32753. }
  32754. null === a ? (a = 65533,
  32755. s = 1) : a > 65535 && (a -= 65536,
  32756. n.push(a >>> 10 & 1023 | 55296),
  32757. a = 56320 | 1023 & a),
  32758. n.push(a),
  32759. r += s
  32760. }
  32761. return R(n)
  32762. }
  32763. function R(e) {
  32764. var t = e.length;
  32765. if (t <= ee)
  32766. return String.fromCharCode.apply(String, e);
  32767. for (var i = "", n = 0; n < t; )
  32768. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32769. return i
  32770. }
  32771. function P(e, t, i) {
  32772. var n = "";
  32773. i = Math.min(e.length, i);
  32774. for (var r = t; r < i; ++r)
  32775. n += String.fromCharCode(127 & e[r]);
  32776. return n
  32777. }
  32778. function O(e, t, i) {
  32779. var n = "";
  32780. i = Math.min(e.length, i);
  32781. for (var r = t; r < i; ++r)
  32782. n += String.fromCharCode(e[r]);
  32783. return n
  32784. }
  32785. function L(e, t, i) {
  32786. var n = e.length;
  32787. (!t || t < 0) && (t = 0),
  32788. (!i || i < 0 || i > n) && (i = n);
  32789. for (var r = "", o = t; o < i; ++o)
  32790. r += W(e[o]);
  32791. return r
  32792. }
  32793. function D(e, t, i) {
  32794. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32795. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32796. return r
  32797. }
  32798. function N(e, t, i) {
  32799. if (e % 1 !== 0 || e < 0)
  32800. throw new RangeError("offset is not uint");
  32801. if (e + t > i)
  32802. throw new RangeError("Trying to access beyond buffer length")
  32803. }
  32804. function B(e, t, i, n, r, o) {
  32805. if (!a.isBuffer(e))
  32806. throw new TypeError('"buffer" argument must be a Buffer instance');
  32807. if (t > r || t < o)
  32808. throw new RangeError('"value" argument is out of bounds');
  32809. if (i + n > e.length)
  32810. throw new RangeError("Index out of range")
  32811. }
  32812. function F(e, t, i, n) {
  32813. t < 0 && (t = 65535 + t + 1);
  32814. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32815. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32816. }
  32817. function V(e, t, i, n) {
  32818. t < 0 && (t = 4294967295 + t + 1);
  32819. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32820. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32821. }
  32822. function U(e, t, i, n, r, o) {
  32823. if (i + n > e.length)
  32824. throw new RangeError("Index out of range");
  32825. if (i < 0)
  32826. throw new RangeError("Index out of range")
  32827. }
  32828. function k(e, t, i, n, r) {
  32829. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32830. J.write(e, t, i, n, 23, 4),
  32831. i + 4
  32832. }
  32833. function H(e, t, i, n, r) {
  32834. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32835. J.write(e, t, i, n, 52, 8),
  32836. i + 8
  32837. }
  32838. function G(e) {
  32839. if (e = z(e).replace(te, ""),
  32840. e.length < 2)
  32841. return "";
  32842. for (; e.length % 4 !== 0; )
  32843. e += "=";
  32844. return e
  32845. }
  32846. function z(e) {
  32847. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32848. }
  32849. function W(e) {
  32850. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32851. }
  32852. function j(e, t) {
  32853. t = t || 1 / 0;
  32854. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32855. if (i = e.charCodeAt(a),
  32856. i > 55295 && i < 57344) {
  32857. if (!r) {
  32858. if (i > 56319) {
  32859. (t -= 3) > -1 && o.push(239, 191, 189);
  32860. continue
  32861. }
  32862. if (a + 1 === n) {
  32863. (t -= 3) > -1 && o.push(239, 191, 189);
  32864. continue
  32865. }
  32866. r = i;
  32867. continue
  32868. }
  32869. if (i < 56320) {
  32870. (t -= 3) > -1 && o.push(239, 191, 189),
  32871. r = i;
  32872. continue
  32873. }
  32874. i = (r - 55296 << 10 | i - 56320) + 65536
  32875. } else
  32876. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32877. if (r = null,
  32878. i < 128) {
  32879. if ((t -= 1) < 0)
  32880. break;
  32881. o.push(i)
  32882. } else if (i < 2048) {
  32883. if ((t -= 2) < 0)
  32884. break;
  32885. o.push(i >> 6 | 192, 63 & i | 128)
  32886. } else if (i < 65536) {
  32887. if ((t -= 3) < 0)
  32888. break;
  32889. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32890. } else {
  32891. if (!(i < 1114112))
  32892. throw new Error("Invalid code point");
  32893. if ((t -= 4) < 0)
  32894. break;
  32895. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32896. }
  32897. }
  32898. return o
  32899. }
  32900. function Y(e) {
  32901. for (var t = [], i = 0; i < e.length; ++i)
  32902. t.push(255 & e.charCodeAt(i));
  32903. return t
  32904. }
  32905. function X(e, t) {
  32906. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32907. i = e.charCodeAt(a),
  32908. n = i >> 8,
  32909. r = i % 256,
  32910. o.push(r),
  32911. o.push(n);
  32912. return o
  32913. }
  32914. function Z(e) {
  32915. return Q.toByteArray(G(e))
  32916. }
  32917. function q(e, t, i, n) {
  32918. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32919. t[r + i] = e[r];
  32920. return r
  32921. }
  32922. function K(e) {
  32923. return e !== e
  32924. }
  32925. var Q = e("base64-js")
  32926. , J = e("ieee754")
  32927. , $ = e("isarray");
  32928. i.Buffer = a,
  32929. i.SlowBuffer = m,
  32930. i.INSPECT_MAX_BYTES = 50,
  32931. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32932. i.kMaxLength = r(),
  32933. a.poolSize = 8192,
  32934. a._augment = function(e) {
  32935. return e.__proto__ = a.prototype,
  32936. e
  32937. }
  32938. ,
  32939. a.from = function(e, t, i) {
  32940. return s(null, e, t, i)
  32941. }
  32942. ,
  32943. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32944. a.__proto__ = Uint8Array,
  32945. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32946. value: null,
  32947. configurable: !0
  32948. })),
  32949. a.alloc = function(e, t, i) {
  32950. return c(null, e, t, i)
  32951. }
  32952. ,
  32953. a.allocUnsafe = function(e) {
  32954. return h(null, e)
  32955. }
  32956. ,
  32957. a.allocUnsafeSlow = function(e) {
  32958. return h(null, e)
  32959. }
  32960. ,
  32961. a.isBuffer = function(e) {
  32962. return !(null == e || !e._isBuffer)
  32963. }
  32964. ,
  32965. a.compare = function(e, t) {
  32966. if (!a.isBuffer(e) || !a.isBuffer(t))
  32967. throw new TypeError("Arguments must be Buffers");
  32968. if (e === t)
  32969. return 0;
  32970. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32971. if (e[r] !== t[r]) {
  32972. i = e[r],
  32973. n = t[r];
  32974. break
  32975. }
  32976. return i < n ? -1 : n < i ? 1 : 0
  32977. }
  32978. ,
  32979. a.isEncoding = function(e) {
  32980. switch (String(e).toLowerCase()) {
  32981. case "hex":
  32982. case "utf8":
  32983. case "utf-8":
  32984. case "ascii":
  32985. case "latin1":
  32986. case "binary":
  32987. case "base64":
  32988. case "ucs2":
  32989. case "ucs-2":
  32990. case "utf16le":
  32991. case "utf-16le":
  32992. return !0;
  32993. default:
  32994. return !1
  32995. }
  32996. }
  32997. ,
  32998. a.concat = function(e, t) {
  32999. if (!$(e))
  33000. throw new TypeError('"list" argument must be an Array of Buffers');
  33001. if (0 === e.length)
  33002. return a.alloc(0);
  33003. var i;
  33004. if (void 0 === t)
  33005. for (t = 0,
  33006. i = 0; i < e.length; ++i)
  33007. t += e[i].length;
  33008. var n = a.allocUnsafe(t)
  33009. , r = 0;
  33010. for (i = 0; i < e.length; ++i) {
  33011. var o = e[i];
  33012. if (!a.isBuffer(o))
  33013. throw new TypeError('"list" argument must be an Array of Buffers');
  33014. o.copy(n, r),
  33015. r += o.length
  33016. }
  33017. return n
  33018. }
  33019. ,
  33020. a.byteLength = v,
  33021. a.prototype._isBuffer = !0,
  33022. a.prototype.swap16 = function() {
  33023. var e = this.length;
  33024. if (e % 2 !== 0)
  33025. throw new RangeError("Buffer size must be a multiple of 16-bits");
  33026. for (var t = 0; t < e; t += 2)
  33027. y(this, t, t + 1);
  33028. return this
  33029. }
  33030. ,
  33031. a.prototype.swap32 = function() {
  33032. var e = this.length;
  33033. if (e % 4 !== 0)
  33034. throw new RangeError("Buffer size must be a multiple of 32-bits");
  33035. for (var t = 0; t < e; t += 4)
  33036. y(this, t, t + 3),
  33037. y(this, t + 1, t + 2);
  33038. return this
  33039. }
  33040. ,
  33041. a.prototype.swap64 = function() {
  33042. var e = this.length;
  33043. if (e % 8 !== 0)
  33044. throw new RangeError("Buffer size must be a multiple of 64-bits");
  33045. for (var t = 0; t < e; t += 8)
  33046. y(this, t, t + 7),
  33047. y(this, t + 1, t + 6),
  33048. y(this, t + 2, t + 5),
  33049. y(this, t + 3, t + 4);
  33050. return this
  33051. }
  33052. ,
  33053. a.prototype.toString = function() {
  33054. var e = 0 | this.length;
  33055. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  33056. }
  33057. ,
  33058. a.prototype.equals = function(e) {
  33059. if (!a.isBuffer(e))
  33060. throw new TypeError("Argument must be a Buffer");
  33061. return this === e || 0 === a.compare(this, e)
  33062. }
  33063. ,
  33064. a.prototype.inspect = function() {
  33065. var e = ""
  33066. , t = i.INSPECT_MAX_BYTES;
  33067. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  33068. this.length > t && (e += " ... ")),
  33069. "<Buffer " + e + ">"
  33070. }
  33071. ,
  33072. a.prototype.compare = function(e, t, i, n, r) {
  33073. if (!a.isBuffer(e))
  33074. throw new TypeError("Argument must be a Buffer");
  33075. if (void 0 === t && (t = 0),
  33076. void 0 === i && (i = e ? e.length : 0),
  33077. void 0 === n && (n = 0),
  33078. void 0 === r && (r = this.length),
  33079. t < 0 || i > e.length || n < 0 || r > this.length)
  33080. throw new RangeError("out of range index");
  33081. if (n >= r && t >= i)
  33082. return 0;
  33083. if (n >= r)
  33084. return -1;
  33085. if (t >= i)
  33086. return 1;
  33087. if (t >>>= 0,
  33088. i >>>= 0,
  33089. n >>>= 0,
  33090. r >>>= 0,
  33091. this === e)
  33092. return 0;
  33093. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  33094. if (c[u] !== h[u]) {
  33095. o = c[u],
  33096. s = h[u];
  33097. break
  33098. }
  33099. return o < s ? -1 : s < o ? 1 : 0
  33100. }
  33101. ,
  33102. a.prototype.includes = function(e, t, i) {
  33103. return this.indexOf(e, t, i) !== -1
  33104. }
  33105. ,
  33106. a.prototype.indexOf = function(e, t, i) {
  33107. return C(this, e, t, i, !0)
  33108. }
  33109. ,
  33110. a.prototype.lastIndexOf = function(e, t, i) {
  33111. return C(this, e, t, i, !1)
  33112. }
  33113. ,
  33114. a.prototype.write = function(e, t, i, n) {
  33115. if (void 0 === t)
  33116. n = "utf8",
  33117. i = this.length,
  33118. t = 0;
  33119. else if (void 0 === i && "string" == typeof t)
  33120. n = t,
  33121. i = this.length,
  33122. t = 0;
  33123. else {
  33124. if (!isFinite(t))
  33125. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  33126. t |= 0,
  33127. isFinite(i) ? (i |= 0,
  33128. void 0 === n && (n = "utf8")) : (n = i,
  33129. i = void 0)
  33130. }
  33131. var r = this.length - t;
  33132. if ((void 0 === i || i > r) && (i = r),
  33133. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  33134. throw new RangeError("Attempt to write outside buffer bounds");
  33135. n || (n = "utf8");
  33136. for (var o = !1; ; )
  33137. switch (n) {
  33138. case "hex":
  33139. return E(this, e, t, i);
  33140. case "utf8":
  33141. case "utf-8":
  33142. return b(this, e, t, i);
  33143. case "ascii":
  33144. return w(this, e, t, i);
  33145. case "latin1":
  33146. case "binary":
  33147. return _(this, e, t, i);
  33148. case "base64":
  33149. return T(this, e, t, i);
  33150. case "ucs2":
  33151. case "ucs-2":
  33152. case "utf16le":
  33153. case "utf-16le":
  33154. return x(this, e, t, i);
  33155. default:
  33156. if (o)
  33157. throw new TypeError("Unknown encoding: " + n);
  33158. n = ("" + n).toLowerCase(),
  33159. o = !0
  33160. }
  33161. }
  33162. ,
  33163. a.prototype.toJSON = function() {
  33164. return {
  33165. type: "Buffer",
  33166. data: Array.prototype.slice.call(this._arr || this, 0)
  33167. }
  33168. }
  33169. ;
  33170. var ee = 4096;
  33171. a.prototype.slice = function(e, t) {
  33172. var i = this.length;
  33173. e = ~~e,
  33174. t = void 0 === t ? i : ~~t,
  33175. e < 0 ? (e += i,
  33176. e < 0 && (e = 0)) : e > i && (e = i),
  33177. t < 0 ? (t += i,
  33178. t < 0 && (t = 0)) : t > i && (t = i),
  33179. t < e && (t = e);
  33180. var n;
  33181. if (a.TYPED_ARRAY_SUPPORT)
  33182. n = this.subarray(e, t),
  33183. n.__proto__ = a.prototype;
  33184. else {
  33185. var r = t - e;
  33186. n = new a(r,void 0);
  33187. for (var o = 0; o < r; ++o)
  33188. n[o] = this[o + e]
  33189. }
  33190. return n
  33191. }
  33192. ,
  33193. a.prototype.readUIntLE = function(e, t, i) {
  33194. e |= 0,
  33195. t |= 0,
  33196. i || N(e, t, this.length);
  33197. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  33198. n += this[e + o] * r;
  33199. return n
  33200. }
  33201. ,
  33202. a.prototype.readUIntBE = function(e, t, i) {
  33203. e |= 0,
  33204. t |= 0,
  33205. i || N(e, t, this.length);
  33206. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  33207. n += this[e + --t] * r;
  33208. return n
  33209. }
  33210. ,
  33211. a.prototype.readUInt8 = function(e, t) {
  33212. return t || N(e, 1, this.length),
  33213. this[e]
  33214. }
  33215. ,
  33216. a.prototype.readUInt16LE = function(e, t) {
  33217. return t || N(e, 2, this.length),
  33218. this[e] | this[e + 1] << 8
  33219. }
  33220. ,
  33221. a.prototype.readUInt16BE = function(e, t) {
  33222. return t || N(e, 2, this.length),
  33223. this[e] << 8 | this[e + 1]
  33224. }
  33225. ,
  33226. a.prototype.readUInt32LE = function(e, t) {
  33227. return t || N(e, 4, this.length),
  33228. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  33229. }
  33230. ,
  33231. a.prototype.readUInt32BE = function(e, t) {
  33232. return t || N(e, 4, this.length),
  33233. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  33234. }
  33235. ,
  33236. a.prototype.readIntLE = function(e, t, i) {
  33237. e |= 0,
  33238. t |= 0,
  33239. i || N(e, t, this.length);
  33240. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  33241. n += this[e + o] * r;
  33242. return r *= 128,
  33243. n >= r && (n -= Math.pow(2, 8 * t)),
  33244. n
  33245. }
  33246. ,
  33247. a.prototype.readIntBE = function(e, t, i) {
  33248. e |= 0,
  33249. t |= 0,
  33250. i || N(e, t, this.length);
  33251. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  33252. o += this[e + --n] * r;
  33253. return r *= 128,
  33254. o >= r && (o -= Math.pow(2, 8 * t)),
  33255. o
  33256. }
  33257. ,
  33258. a.prototype.readInt8 = function(e, t) {
  33259. return t || N(e, 1, this.length),
  33260. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  33261. }
  33262. ,
  33263. a.prototype.readInt16LE = function(e, t) {
  33264. t || N(e, 2, this.length);
  33265. var i = this[e] | this[e + 1] << 8;
  33266. return 32768 & i ? 4294901760 | i : i
  33267. }
  33268. ,
  33269. a.prototype.readInt16BE = function(e, t) {
  33270. t || N(e, 2, this.length);
  33271. var i = this[e + 1] | this[e] << 8;
  33272. return 32768 & i ? 4294901760 | i : i
  33273. }
  33274. ,
  33275. a.prototype.readInt32LE = function(e, t) {
  33276. return t || N(e, 4, this.length),
  33277. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  33278. }
  33279. ,
  33280. a.prototype.readInt32BE = function(e, t) {
  33281. return t || N(e, 4, this.length),
  33282. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  33283. }
  33284. ,
  33285. a.prototype.readFloatLE = function(e, t) {
  33286. return t || N(e, 4, this.length),
  33287. J.read(this, e, !0, 23, 4)
  33288. }
  33289. ,
  33290. a.prototype.readFloatBE = function(e, t) {
  33291. return t || N(e, 4, this.length),
  33292. J.read(this, e, !1, 23, 4)
  33293. }
  33294. ,
  33295. a.prototype.readDoubleLE = function(e, t) {
  33296. return t || N(e, 8, this.length),
  33297. J.read(this, e, !0, 52, 8)
  33298. }
  33299. ,
  33300. a.prototype.readDoubleBE = function(e, t) {
  33301. return t || N(e, 8, this.length),
  33302. J.read(this, e, !1, 52, 8)
  33303. }
  33304. ,
  33305. a.prototype.writeUIntLE = function(e, t, i, n) {
  33306. if (e = +e,
  33307. t |= 0,
  33308. i |= 0,
  33309. !n) {
  33310. var r = Math.pow(2, 8 * i) - 1;
  33311. B(this, e, t, i, r, 0)
  33312. }
  33313. var o = 1
  33314. , a = 0;
  33315. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  33316. this[t + a] = e / o & 255;
  33317. return t + i
  33318. }
  33319. ,
  33320. a.prototype.writeUIntBE = function(e, t, i, n) {
  33321. if (e = +e,
  33322. t |= 0,
  33323. i |= 0,
  33324. !n) {
  33325. var r = Math.pow(2, 8 * i) - 1;
  33326. B(this, e, t, i, r, 0)
  33327. }
  33328. var o = i - 1
  33329. , a = 1;
  33330. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33331. this[t + o] = e / a & 255;
  33332. return t + i
  33333. }
  33334. ,
  33335. a.prototype.writeUInt8 = function(e, t, i) {
  33336. return e = +e,
  33337. t |= 0,
  33338. i || B(this, e, t, 1, 255, 0),
  33339. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33340. this[t] = 255 & e,
  33341. t + 1
  33342. }
  33343. ,
  33344. a.prototype.writeUInt16LE = function(e, t, i) {
  33345. return e = +e,
  33346. t |= 0,
  33347. i || B(this, e, t, 2, 65535, 0),
  33348. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33349. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33350. t + 2
  33351. }
  33352. ,
  33353. a.prototype.writeUInt16BE = function(e, t, i) {
  33354. return e = +e,
  33355. t |= 0,
  33356. i || B(this, e, t, 2, 65535, 0),
  33357. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33358. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33359. t + 2
  33360. }
  33361. ,
  33362. a.prototype.writeUInt32LE = function(e, t, i) {
  33363. return e = +e,
  33364. t |= 0,
  33365. i || B(this, e, t, 4, 4294967295, 0),
  33366. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  33367. this[t + 2] = e >>> 16,
  33368. this[t + 1] = e >>> 8,
  33369. this[t] = 255 & e) : V(this, e, t, !0),
  33370. t + 4
  33371. }
  33372. ,
  33373. a.prototype.writeUInt32BE = function(e, t, i) {
  33374. return e = +e,
  33375. t |= 0,
  33376. i || B(this, e, t, 4, 4294967295, 0),
  33377. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33378. this[t + 1] = e >>> 16,
  33379. this[t + 2] = e >>> 8,
  33380. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33381. t + 4
  33382. }
  33383. ,
  33384. a.prototype.writeIntLE = function(e, t, i, n) {
  33385. if (e = +e,
  33386. t |= 0,
  33387. !n) {
  33388. var r = Math.pow(2, 8 * i - 1);
  33389. B(this, e, t, i, r - 1, -r)
  33390. }
  33391. var o = 0
  33392. , a = 1
  33393. , s = 0;
  33394. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  33395. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  33396. this[t + o] = (e / a >> 0) - s & 255;
  33397. return t + i
  33398. }
  33399. ,
  33400. a.prototype.writeIntBE = function(e, t, i, n) {
  33401. if (e = +e,
  33402. t |= 0,
  33403. !n) {
  33404. var r = Math.pow(2, 8 * i - 1);
  33405. B(this, e, t, i, r - 1, -r)
  33406. }
  33407. var o = i - 1
  33408. , a = 1
  33409. , s = 0;
  33410. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33411. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  33412. this[t + o] = (e / a >> 0) - s & 255;
  33413. return t + i
  33414. }
  33415. ,
  33416. a.prototype.writeInt8 = function(e, t, i) {
  33417. return e = +e,
  33418. t |= 0,
  33419. i || B(this, e, t, 1, 127, -128),
  33420. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33421. e < 0 && (e = 255 + e + 1),
  33422. this[t] = 255 & e,
  33423. t + 1
  33424. }
  33425. ,
  33426. a.prototype.writeInt16LE = function(e, t, i) {
  33427. return e = +e,
  33428. t |= 0,
  33429. i || B(this, e, t, 2, 32767, -32768),
  33430. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33431. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33432. t + 2
  33433. }
  33434. ,
  33435. a.prototype.writeInt16BE = function(e, t, i) {
  33436. return e = +e,
  33437. t |= 0,
  33438. i || B(this, e, t, 2, 32767, -32768),
  33439. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33440. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33441. t + 2
  33442. }
  33443. ,
  33444. a.prototype.writeInt32LE = function(e, t, i) {
  33445. return e = +e,
  33446. t |= 0,
  33447. i || B(this, e, t, 4, 2147483647, -2147483648),
  33448. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33449. this[t + 1] = e >>> 8,
  33450. this[t + 2] = e >>> 16,
  33451. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  33452. t + 4
  33453. }
  33454. ,
  33455. a.prototype.writeInt32BE = function(e, t, i) {
  33456. return e = +e,
  33457. t |= 0,
  33458. i || B(this, e, t, 4, 2147483647, -2147483648),
  33459. e < 0 && (e = 4294967295 + e + 1),
  33460. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33461. this[t + 1] = e >>> 16,
  33462. this[t + 2] = e >>> 8,
  33463. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33464. t + 4
  33465. }
  33466. ,
  33467. a.prototype.writeFloatLE = function(e, t, i) {
  33468. return k(this, e, t, !0, i)
  33469. }
  33470. ,
  33471. a.prototype.writeFloatBE = function(e, t, i) {
  33472. return k(this, e, t, !1, i)
  33473. }
  33474. ,
  33475. a.prototype.writeDoubleLE = function(e, t, i) {
  33476. return H(this, e, t, !0, i)
  33477. }
  33478. ,
  33479. a.prototype.writeDoubleBE = function(e, t, i) {
  33480. return H(this, e, t, !1, i)
  33481. }
  33482. ,
  33483. a.prototype.copy = function(e, t, i, n) {
  33484. if (i || (i = 0),
  33485. n || 0 === n || (n = this.length),
  33486. t >= e.length && (t = e.length),
  33487. t || (t = 0),
  33488. n > 0 && n < i && (n = i),
  33489. n === i)
  33490. return 0;
  33491. if (0 === e.length || 0 === this.length)
  33492. return 0;
  33493. if (t < 0)
  33494. throw new RangeError("targetStart out of bounds");
  33495. if (i < 0 || i >= this.length)
  33496. throw new RangeError("sourceStart out of bounds");
  33497. if (n < 0)
  33498. throw new RangeError("sourceEnd out of bounds");
  33499. n > this.length && (n = this.length),
  33500. e.length - t < n - i && (n = e.length - t + i);
  33501. var r, o = n - i;
  33502. if (this === e && i < t && t < n)
  33503. for (r = o - 1; r >= 0; --r)
  33504. e[r + t] = this[r + i];
  33505. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  33506. for (r = 0; r < o; ++r)
  33507. e[r + t] = this[r + i];
  33508. else
  33509. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  33510. return o
  33511. }
  33512. ,
  33513. a.prototype.fill = function(e, t, i, n) {
  33514. if ("string" == typeof e) {
  33515. if ("string" == typeof t ? (n = t,
  33516. t = 0,
  33517. i = this.length) : "string" == typeof i && (n = i,
  33518. i = this.length),
  33519. 1 === e.length) {
  33520. var r = e.charCodeAt(0);
  33521. r < 256 && (e = r)
  33522. }
  33523. if (void 0 !== n && "string" != typeof n)
  33524. throw new TypeError("encoding must be a string");
  33525. if ("string" == typeof n && !a.isEncoding(n))
  33526. throw new TypeError("Unknown encoding: " + n)
  33527. } else
  33528. "number" == typeof e && (e &= 255);
  33529. if (t < 0 || this.length < t || this.length < i)
  33530. throw new RangeError("Out of range index");
  33531. if (i <= t)
  33532. return this;
  33533. t >>>= 0,
  33534. i = void 0 === i ? this.length : i >>> 0,
  33535. e || (e = 0);
  33536. var o;
  33537. if ("number" == typeof e)
  33538. for (o = t; o < i; ++o)
  33539. this[o] = e;
  33540. else {
  33541. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  33542. , l = s.length;
  33543. for (o = 0; o < i - t; ++o)
  33544. this[o + t] = s[o % l]
  33545. }
  33546. return this
  33547. }
  33548. ;
  33549. var te = /[^+\/0-9A-Za-z-_]/g
  33550. }
  33551. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33552. }
  33553. , {
  33554. "base64-js": 199,
  33555. ieee754: 200,
  33556. isarray: 201
  33557. }],
  33558. 199: [function(e, t, i) {//base64-js
  33559. "use strict";
  33560. function n(e) {
  33561. var t = e.length;
  33562. if (t % 4 > 0)
  33563. throw new Error("Invalid string. Length must be a multiple of 4");
  33564. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  33565. }
  33566. function r(e) {
  33567. return 3 * e.length / 4 - n(e)
  33568. }
  33569. function o(e) {
  33570. var t, i, r, o, a, s, l = e.length;
  33571. a = n(e),
  33572. s = new u(3 * l / 4 - a),
  33573. r = a > 0 ? l - 4 : l;
  33574. var c = 0;
  33575. for (t = 0,
  33576. i = 0; t < r; t += 4,
  33577. i += 3)
  33578. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  33579. s[c++] = o >> 16 & 255,
  33580. s[c++] = o >> 8 & 255,
  33581. s[c++] = 255 & o;
  33582. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  33583. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  33584. s[c++] = o >> 8 & 255,
  33585. s[c++] = 255 & o),
  33586. s
  33587. }
  33588. function a(e) {
  33589. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  33590. }
  33591. function s(e, t, i) {
  33592. for (var n, r = [], o = t; o < i; o += 3)
  33593. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  33594. r.push(a(n));
  33595. return r.join("")
  33596. }
  33597. function l(e) {
  33598. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  33599. o.push(s(e, l, l + a > h ? h : l + a));
  33600. return 1 === n ? (t = e[i - 1],
  33601. r += c[t >> 2],
  33602. r += c[t << 4 & 63],
  33603. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  33604. r += c[t >> 10],
  33605. r += c[t >> 4 & 63],
  33606. r += c[t << 2 & 63],
  33607. r += "="),
  33608. o.push(r),
  33609. o.join("")
  33610. }
  33611. i.byteLength = r,
  33612. i.toByteArray = o,
  33613. i.fromByteArray = l;
  33614. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  33615. c[p] = d[p],
  33616. h[d.charCodeAt(p)] = p;
  33617. h["-".charCodeAt(0)] = 62,
  33618. h["_".charCodeAt(0)] = 63
  33619. }
  33620. , {}],
  33621. 200: [function(e, t, i) {//ieee754
  33622. i.read = function(e, t, i, n, r) {
  33623. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  33624. for (u += d,
  33625. o = p & (1 << -h) - 1,
  33626. p >>= -h,
  33627. h += s; h > 0; o = 256 * o + e[t + u],
  33628. u += d,
  33629. h -= 8)
  33630. ;
  33631. for (a = o & (1 << -h) - 1,
  33632. o >>= -h,
  33633. h += n; h > 0; a = 256 * a + e[t + u],
  33634. u += d,
  33635. h -= 8)
  33636. ;
  33637. if (0 === o)
  33638. o = 1 - c;
  33639. else {
  33640. if (o === l)
  33641. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  33642. a += Math.pow(2, n),
  33643. o -= c
  33644. }
  33645. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33646. }
  33647. ,
  33648. i.write = function(e, t, i, n, r, o) {
  33649. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  33650. for (t = Math.abs(t),
  33651. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33652. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33653. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33654. l *= 2),
  33655. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33656. t * l >= 2 && (a++,
  33657. l /= 2),
  33658. a + u >= h ? (s = 0,
  33659. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33660. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33661. a = 0)); r >= 8; e[i + p] = 255 & s,
  33662. p += f,
  33663. s /= 256,
  33664. r -= 8)
  33665. ;
  33666. for (a = a << r | s,
  33667. c += r; c > 0; e[i + p] = 255 & a,
  33668. p += f,
  33669. a /= 256,
  33670. c -= 8)
  33671. ;
  33672. e[i + p - f] |= 128 * g
  33673. }
  33674. }
  33675. , {}],
  33676. 201: [function(e, t, i) {//isarray
  33677. var n = {}.toString;
  33678. t.exports = Array.isArray || function(e) {
  33679. return "[object Array]" == n.call(e)
  33680. }
  33681. }
  33682. , {}],
  33683. 202: [function(e, t, i) {//events
  33684. function n() {
  33685. this._events = this._events || {},
  33686. this._maxListeners = this._maxListeners || void 0
  33687. }
  33688. function r(e) {
  33689. return "function" == typeof e
  33690. }
  33691. function o(e) {
  33692. return "number" == typeof e
  33693. }
  33694. function a(e) {
  33695. return "object" == typeof e && null !== e
  33696. }
  33697. function s(e) {
  33698. return void 0 === e
  33699. }
  33700. t.exports = n,
  33701. n.EventEmitter = n,
  33702. n.prototype._events = void 0,
  33703. n.prototype._maxListeners = void 0,
  33704. n.defaultMaxListeners = 10,
  33705. n.prototype.setMaxListeners = function(e) {
  33706. if (!o(e) || e < 0 || isNaN(e))
  33707. throw TypeError("n must be a positive number");
  33708. return this._maxListeners = e,
  33709. this
  33710. }
  33711. ,
  33712. n.prototype.emit = function(e) {
  33713. var t, i, n, o, l, c;
  33714. if (this._events || (this._events = {}),
  33715. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33716. if (t = arguments[1],
  33717. t instanceof Error)
  33718. throw t;
  33719. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33720. throw h.context = t,
  33721. h
  33722. }
  33723. if (i = this._events[e],
  33724. s(i))
  33725. return !1;
  33726. if (r(i))
  33727. switch (arguments.length) {
  33728. case 1:
  33729. i.call(this);
  33730. break;
  33731. case 2:
  33732. i.call(this, arguments[1]);
  33733. break;
  33734. case 3:
  33735. i.call(this, arguments[1], arguments[2]);
  33736. break;
  33737. default:
  33738. o = Array.prototype.slice.call(arguments, 1),
  33739. i.apply(this, o)
  33740. }
  33741. else if (a(i))
  33742. for (o = Array.prototype.slice.call(arguments, 1),
  33743. c = i.slice(),
  33744. n = c.length,
  33745. l = 0; l < n; l++)
  33746. c[l].apply(this, o);
  33747. return !0
  33748. }
  33749. ,
  33750. n.prototype.addListener = function(e, t) {
  33751. var i;
  33752. if (!r(t))
  33753. throw TypeError("listener must be a function");
  33754. return this._events || (this._events = {}),
  33755. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33756. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33757. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33758. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33759. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33760. "function" == typeof console.trace && console.trace())),
  33761. this
  33762. }
  33763. ,
  33764. n.prototype.on = n.prototype.addListener,
  33765. n.prototype.once = function(e, t) {
  33766. function i() {
  33767. this.removeListener(e, i),
  33768. n || (n = !0,
  33769. t.apply(this, arguments))
  33770. }
  33771. if (!r(t))
  33772. throw TypeError("listener must be a function");
  33773. var n = !1;
  33774. return i.listener = t,
  33775. this.on(e, i),
  33776. this
  33777. }
  33778. ,
  33779. n.prototype.removeListener = function(e, t) {
  33780. var i, n, o, s;
  33781. if (!r(t))
  33782. throw TypeError("listener must be a function");
  33783. if (!this._events || !this._events[e])
  33784. return this;
  33785. if (i = this._events[e],
  33786. o = i.length,
  33787. n = -1,
  33788. i === t || r(i.listener) && i.listener === t)
  33789. delete this._events[e],
  33790. this._events.removeListener && this.emit("removeListener", e, t);
  33791. else if (a(i)) {
  33792. for (s = o; s-- > 0; )
  33793. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33794. n = s;
  33795. break
  33796. }
  33797. if (n < 0)
  33798. return this;
  33799. 1 === i.length ? (i.length = 0,
  33800. delete this._events[e]) : i.splice(n, 1),
  33801. this._events.removeListener && this.emit("removeListener", e, t)
  33802. }
  33803. return this
  33804. }
  33805. ,
  33806. n.prototype.removeAllListeners = function(e) {
  33807. var t, i;
  33808. if (!this._events)
  33809. return this;
  33810. if (!this._events.removeListener)
  33811. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33812. this;
  33813. if (0 === arguments.length) {
  33814. for (t in this._events)
  33815. "removeListener" !== t && this.removeAllListeners(t);
  33816. return this.removeAllListeners("removeListener"),
  33817. this._events = {},
  33818. this
  33819. }
  33820. if (i = this._events[e],
  33821. r(i))
  33822. this.removeListener(e, i);
  33823. else if (i)
  33824. for (; i.length; )
  33825. this.removeListener(e, i[i.length - 1]);
  33826. return delete this._events[e],
  33827. this
  33828. }
  33829. ,
  33830. n.prototype.listeners = function(e) {
  33831. var t;
  33832. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33833. }
  33834. ,
  33835. n.prototype.listenerCount = function(e) {
  33836. if (this._events) {
  33837. var t = this._events[e];
  33838. if (r(t))
  33839. return 1;
  33840. if (t)
  33841. return t.length
  33842. }
  33843. return 0
  33844. }
  33845. ,
  33846. n.listenerCount = function(e, t) {
  33847. return e.listenerCount(t)
  33848. }
  33849. }
  33850. , {}],
  33851. 203: [function(e, t, i) {//_process
  33852. function n() {
  33853. throw new Error("setTimeout has not been defined")
  33854. }
  33855. function r() {
  33856. throw new Error("clearTimeout has not been defined")
  33857. }
  33858. function o(e) {
  33859. if (u === setTimeout)
  33860. return setTimeout(e, 0);
  33861. if ((u === n || !u) && setTimeout)
  33862. return u = setTimeout,
  33863. setTimeout(e, 0);
  33864. try {
  33865. return u(e, 0)
  33866. } catch (t) {
  33867. try {
  33868. return u.call(null, e, 0)
  33869. } catch (t) {
  33870. return u.call(this, e, 0)
  33871. }
  33872. }
  33873. }
  33874. function a(e) {
  33875. if (d === clearTimeout)
  33876. return clearTimeout(e);
  33877. if ((d === r || !d) && clearTimeout)
  33878. return d = clearTimeout,
  33879. clearTimeout(e);
  33880. try {
  33881. return d(e)
  33882. } catch (t) {
  33883. try {
  33884. return d.call(null, e)
  33885. } catch (t) {
  33886. return d.call(this, e)
  33887. }
  33888. }
  33889. }
  33890. function s() {
  33891. m && f && (m = !1,
  33892. f.length ? g = f.concat(g) : v = -1,
  33893. g.length && l())
  33894. }
  33895. function l() {
  33896. if (!m) {
  33897. var e = o(s);
  33898. m = !0;
  33899. for (var t = g.length; t; ) {
  33900. for (f = g,
  33901. g = []; ++v < t; )
  33902. f && f[v].run();
  33903. v = -1,
  33904. t = g.length
  33905. }
  33906. f = null,
  33907. m = !1,
  33908. a(e)
  33909. }
  33910. }
  33911. function c(e, t) {
  33912. this.fun = e,
  33913. this.array = t
  33914. }
  33915. function h() {}
  33916. var u, d, p = t.exports = {};
  33917. !function() {
  33918. try {
  33919. u = "function" == typeof setTimeout ? setTimeout : n
  33920. } catch (e) {
  33921. u = n
  33922. }
  33923. try {
  33924. d = "function" == typeof clearTimeout ? clearTimeout : r
  33925. } catch (e) {
  33926. d = r
  33927. }
  33928. }();
  33929. var f, g = [], m = !1, v = -1;
  33930. p.nextTick = function(e) {
  33931. var t = new Array(arguments.length - 1);
  33932. if (arguments.length > 1)
  33933. for (var i = 1; i < arguments.length; i++)
  33934. t[i - 1] = arguments[i];
  33935. g.push(new c(e,t)),
  33936. 1 !== g.length || m || o(l)
  33937. }
  33938. ,
  33939. c.prototype.run = function() {
  33940. this.fun.apply(null, this.array)
  33941. }
  33942. ,
  33943. p.title = "browser",
  33944. p.browser = !0,
  33945. p.env = {},
  33946. p.argv = [],
  33947. p.version = "",
  33948. p.versions = {},
  33949. p.on = h,
  33950. p.addListener = h,
  33951. p.once = h,
  33952. p.off = h,
  33953. p.removeListener = h,
  33954. p.removeAllListeners = h,
  33955. p.emit = h,
  33956. p.binding = function(e) {
  33957. throw new Error("process.binding is not supported")
  33958. }
  33959. ,
  33960. p.cwd = function() {
  33961. return "/"
  33962. }
  33963. ,
  33964. p.chdir = function(e) {
  33965. throw new Error("process.chdir is not supported")
  33966. }
  33967. ,
  33968. p.umask = function() {
  33969. return 0
  33970. }
  33971. }
  33972. , {}],
  33973. 204: [function(e, t, i) {//punycode
  33974. (function(e) {
  33975. !function(n) {
  33976. function r(e) {
  33977. throw new RangeError(L[e])
  33978. }
  33979. function o(e, t) {
  33980. for (var i = e.length, n = []; i--; )
  33981. n[i] = t(e[i]);
  33982. return n
  33983. }
  33984. function a(e, t) {
  33985. var i = e.split("@")
  33986. , n = "";
  33987. i.length > 1 && (n = i[0] + "@",
  33988. e = i[1]),
  33989. e = e.replace(O, ".");
  33990. var r = e.split(".")
  33991. , a = o(r, t).join(".");
  33992. return n + a
  33993. }
  33994. function s(e) {
  33995. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33996. t = e.charCodeAt(r++),
  33997. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33998. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33999. r--)) : n.push(t);
  34000. return n
  34001. }
  34002. function l(e) {
  34003. return o(e, function(e) {
  34004. var t = "";
  34005. return e > 65535 && (e -= 65536,
  34006. t += B(e >>> 10 & 1023 | 55296),
  34007. e = 56320 | 1023 & e),
  34008. t += B(e)
  34009. }).join("")
  34010. }
  34011. function c(e) {
  34012. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  34013. }
  34014. function h(e, t) {
  34015. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  34016. }
  34017. function u(e, t, i) {
  34018. var n = 0;
  34019. for (e = i ? N(e / T) : e >> 1,
  34020. e += N(e / t); e > D * w >> 1; n += E)
  34021. e = N(e / D);
  34022. return N(n + (D + 1) * e / (e + _))
  34023. }
  34024. function d(e) {
  34025. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  34026. for (i = e.lastIndexOf(M),
  34027. i < 0 && (i = 0),
  34028. n = 0; n < i; ++n)
  34029. e.charCodeAt(n) >= 128 && r("not-basic"),
  34030. g.push(e.charCodeAt(n));
  34031. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  34032. for (a = v,
  34033. s = 1,
  34034. h = E; o >= m && r("invalid-input"),
  34035. d = c(e.charCodeAt(o++)),
  34036. (d >= E || d > N((I - v) / s)) && r("overflow"),
  34037. v += d * s,
  34038. p = h <= y ? b : h >= y + w ? w : h - y,
  34039. !(d < p); h += E)
  34040. f = E - p,
  34041. s > N(I / f) && r("overflow"),
  34042. s *= f;
  34043. t = g.length + 1,
  34044. y = u(v - a, t, 0 == a),
  34045. N(v / t) > I - A && r("overflow"),
  34046. A += N(v / t),
  34047. v %= t,
  34048. g.splice(v++, 0, A)
  34049. }
  34050. return l(g)
  34051. }
  34052. function p(e) {
  34053. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  34054. for (e = s(e),
  34055. m = e.length,
  34056. t = S,
  34057. i = 0,
  34058. a = x,
  34059. l = 0; l < m; ++l)
  34060. g = e[l],
  34061. g < 128 && C.push(B(g));
  34062. for (n = o = C.length,
  34063. o && C.push(M); n < m; ) {
  34064. for (c = I,
  34065. l = 0; l < m; ++l)
  34066. g = e[l],
  34067. g >= t && g < c && (c = g);
  34068. for (v = n + 1,
  34069. c - t > N((I - i) / v) && r("overflow"),
  34070. i += (c - t) * v,
  34071. t = c,
  34072. l = 0; l < m; ++l)
  34073. if (g = e[l],
  34074. g < t && ++i > I && r("overflow"),
  34075. g == t) {
  34076. for (d = i,
  34077. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  34078. !(d < f); p += E)
  34079. y = d - f,
  34080. A = E - f,
  34081. C.push(B(h(f + y % A, 0))),
  34082. d = N(y / A);
  34083. C.push(B(h(d, 0))),
  34084. a = u(i, v, n == o),
  34085. i = 0,
  34086. ++n
  34087. }
  34088. ++i,
  34089. ++t
  34090. }
  34091. return C.join("")
  34092. }
  34093. function f(e) {
  34094. return a(e, function(e) {
  34095. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  34096. })
  34097. }
  34098. function g(e) {
  34099. return a(e, function(e) {
  34100. return P.test(e) ? "xn--" + p(e) : e
  34101. })
  34102. }
  34103. var m = "object" == typeof i && i && !i.nodeType && i
  34104. , v = "object" == typeof t && t && !t.nodeType && t
  34105. , A = "object" == typeof e && e;
  34106. A.global !== A && A.window !== A && A.self !== A || (n = A);
  34107. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  34108. overflow: "Overflow: input needs wider integers to process",
  34109. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  34110. "invalid-input": "Invalid input"
  34111. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  34112. if (y = {
  34113. version: "1.4.1",
  34114. ucs2: {
  34115. decode: s,
  34116. encode: l
  34117. },
  34118. decode: d,
  34119. encode: p,
  34120. toASCII: g,
  34121. toUnicode: f
  34122. },
  34123. "function" == typeof define && "object" == typeof define.amd && define.amd)
  34124. define("punycode", function() {
  34125. return y
  34126. });
  34127. else if (m && v)
  34128. if (t.exports == m)
  34129. v.exports = y;
  34130. else
  34131. for (C in y)
  34132. y.hasOwnProperty(C) && (m[C] = y[C]);
  34133. else
  34134. n.punycode = y
  34135. }(this)
  34136. }
  34137. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  34138. }
  34139. , {}],
  34140. 205: [function(e, t, i) {//"./decode"
  34141. "use strict";
  34142. function n(e, t) {
  34143. return Object.prototype.hasOwnProperty.call(e, t)
  34144. }
  34145. t.exports = function(e, t, i, o) {
  34146. t = t || "&",
  34147. i = i || "=";
  34148. var a = {};
  34149. if ("string" != typeof e || 0 === e.length)
  34150. return a;
  34151. var s = /\+/g;
  34152. e = e.split(t);
  34153. var l = 1e3;
  34154. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  34155. var c = e.length;
  34156. l > 0 && c > l && (c = l);
  34157. for (var h = 0; h < c; ++h) {
  34158. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  34159. m >= 0 ? (u = g.substr(0, m),
  34160. d = g.substr(m + 1)) : (u = g,
  34161. d = ""),
  34162. p = decodeURIComponent(u),
  34163. f = decodeURIComponent(d),
  34164. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  34165. }
  34166. return a
  34167. }
  34168. ;
  34169. var r = Array.isArray || function(e) {
  34170. return "[object Array]" === Object.prototype.toString.call(e)
  34171. }
  34172. }
  34173. , {}],
  34174. 206: [function(e, t, i) {//"./encode"
  34175. "use strict";
  34176. function n(e, t) {
  34177. if (e.map)
  34178. return e.map(t);
  34179. for (var i = [], n = 0; n < e.length; n++)
  34180. i.push(t(e[n], n));
  34181. return i
  34182. }
  34183. var r = function(e) {
  34184. switch (typeof e) {
  34185. case "string":
  34186. return e;
  34187. case "boolean":
  34188. return e ? "true" : "false";
  34189. case "number":
  34190. return isFinite(e) ? e : "";
  34191. default:
  34192. return ""
  34193. }
  34194. };
  34195. t.exports = function(e, t, i, s) {
  34196. return t = t || "&",
  34197. i = i || "=",
  34198. null === e && (e = void 0),
  34199. "object" == typeof e ? n(a(e), function(a) {
  34200. var s = encodeURIComponent(r(a)) + i;
  34201. return o(e[a]) ? n(e[a], function(e) {
  34202. return s + encodeURIComponent(r(e))
  34203. }).join(t) : s + encodeURIComponent(r(e[a]))
  34204. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  34205. }
  34206. ;
  34207. var o = Array.isArray || function(e) {
  34208. return "[object Array]" === Object.prototype.toString.call(e)
  34209. }
  34210. , a = Object.keys || function(e) {
  34211. var t = [];
  34212. for (var i in e)
  34213. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  34214. return t
  34215. }
  34216. }
  34217. , {}],
  34218. 207: [function(e, t, i) {//querystring
  34219. "use strict";
  34220. i.decode = i.parse = e("./decode"),
  34221. i.encode = i.stringify = e("./encode")
  34222. }
  34223. , {
  34224. "./decode": 205,
  34225. "./encode": 206
  34226. }],
  34227. 208: [function(e, t, i) {//url
  34228. "use strict";
  34229. function n() {
  34230. this.protocol = null,
  34231. this.slashes = null,
  34232. this.auth = null,
  34233. this.host = null,
  34234. this.port = null,
  34235. this.hostname = null,
  34236. this.hash = null,
  34237. this.search = null,
  34238. this.query = null,
  34239. this.pathname = null,
  34240. this.path = null,
  34241. this.href = null
  34242. }
  34243. function r(e, t, i) {
  34244. if (e && c.isObject(e) && e instanceof n)
  34245. return e;
  34246. var r = new n;
  34247. return r.parse(e, t, i),
  34248. r
  34249. }
  34250. function o(e) {
  34251. return c.isString(e) && (e = r(e)),
  34252. e instanceof n ? e.format() : n.prototype.format.call(e)
  34253. }
  34254. function a(e, t) {
  34255. return r(e, !1, !0).resolve(t)
  34256. }
  34257. function s(e, t) {
  34258. return e ? r(e, !1, !0).resolveObject(t) : t
  34259. }
  34260. var l = e("punycode")
  34261. , c = e("./util");
  34262. i.parse = r,
  34263. i.resolve = a,
  34264. i.resolveObject = s,
  34265. i.format = o,
  34266. i.Url = n;
  34267. var h = /^([a-z0-9.+-]+:)/i
  34268. , u = /:[0-9]*$/
  34269. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  34270. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  34271. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  34272. , g = ["'"].concat(f)
  34273. , m = ["%", "/", "?", ";", "#"].concat(g)
  34274. , v = ["/", "?", "#"]
  34275. , A = 255
  34276. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  34277. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  34278. , I = {
  34279. javascript: !0,
  34280. "javascript:": !0
  34281. }
  34282. , E = {
  34283. javascript: !0,
  34284. "javascript:": !0
  34285. }
  34286. , b = {
  34287. http: !0,
  34288. https: !0,
  34289. ftp: !0,
  34290. gopher: !0,
  34291. file: !0,
  34292. "http:": !0,
  34293. "https:": !0,
  34294. "ftp:": !0,
  34295. "gopher:": !0,
  34296. "file:": !0
  34297. }
  34298. , w = e("querystring");
  34299. n.prototype.parse = function(e, t, i) {
  34300. if (!c.isString(e))
  34301. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  34302. var n = e.indexOf("?")
  34303. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  34304. , o = e.split(r)
  34305. , a = /\\/g;
  34306. o[0] = o[0].replace(a, "/"),
  34307. e = o.join(r);
  34308. var s = e;
  34309. if (s = s.trim(),
  34310. !i && 1 === e.split("#").length) {
  34311. var u = d.exec(s);
  34312. if (u)
  34313. return this.path = s,
  34314. this.href = s,
  34315. this.pathname = u[1],
  34316. u[2] ? (this.search = u[2],
  34317. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  34318. this.query = {}),
  34319. this
  34320. }
  34321. var p = h.exec(s);
  34322. if (p) {
  34323. p = p[0];
  34324. var f = p.toLowerCase();
  34325. this.protocol = f,
  34326. s = s.substr(p.length)
  34327. }
  34328. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  34329. var _ = "//" === s.substr(0, 2);
  34330. !_ || p && E[p] || (s = s.substr(2),
  34331. this.slashes = !0)
  34332. }
  34333. if (!E[p] && (_ || p && !b[p])) {
  34334. for (var T = -1, x = 0; x < v.length; x++) {
  34335. var S = s.indexOf(v[x]);
  34336. S !== -1 && (T === -1 || S < T) && (T = S)
  34337. }
  34338. var M, R;
  34339. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  34340. R !== -1 && (M = s.slice(0, R),
  34341. s = s.slice(R + 1),
  34342. this.auth = decodeURIComponent(M)),
  34343. T = -1;
  34344. for (var x = 0; x < m.length; x++) {
  34345. var S = s.indexOf(m[x]);
  34346. S !== -1 && (T === -1 || S < T) && (T = S)
  34347. }
  34348. T === -1 && (T = s.length),
  34349. this.host = s.slice(0, T),
  34350. s = s.slice(T),
  34351. this.parseHost(),
  34352. this.hostname = this.hostname || "";
  34353. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  34354. if (!P)
  34355. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  34356. var D = O[x];
  34357. if (D && !D.match(y)) {
  34358. for (var N = "", B = 0, F = D.length; B < F; B++)
  34359. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  34360. if (!N.match(y)) {
  34361. var V = O.slice(0, x)
  34362. , U = O.slice(x + 1)
  34363. , k = D.match(C);
  34364. k && (V.push(k[1]),
  34365. U.unshift(k[2])),
  34366. U.length && (s = "/" + U.join(".") + s),
  34367. this.hostname = V.join(".");
  34368. break
  34369. }
  34370. }
  34371. }
  34372. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  34373. P || (this.hostname = l.toASCII(this.hostname));
  34374. var H = this.port ? ":" + this.port : ""
  34375. , G = this.hostname || "";
  34376. this.host = G + H,
  34377. this.href += this.host,
  34378. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  34379. "/" !== s[0] && (s = "/" + s))
  34380. }
  34381. if (!I[f])
  34382. for (var x = 0, L = g.length; x < L; x++) {
  34383. var z = g[x];
  34384. if (s.indexOf(z) !== -1) {
  34385. var W = encodeURIComponent(z);
  34386. W === z && (W = escape(z)),
  34387. s = s.split(z).join(W)
  34388. }
  34389. }
  34390. var j = s.indexOf("#");
  34391. j !== -1 && (this.hash = s.substr(j),
  34392. s = s.slice(0, j));
  34393. var Y = s.indexOf("?");
  34394. if (Y !== -1 ? (this.search = s.substr(Y),
  34395. this.query = s.substr(Y + 1),
  34396. t && (this.query = w.parse(this.query)),
  34397. s = s.slice(0, Y)) : t && (this.search = "",
  34398. this.query = {}),
  34399. s && (this.pathname = s),
  34400. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  34401. this.pathname || this.search) {
  34402. var H = this.pathname || ""
  34403. , X = this.search || "";
  34404. this.path = H + X
  34405. }
  34406. return this.href = this.format(),
  34407. this
  34408. }
  34409. ,
  34410. n.prototype.format = function() {
  34411. var e = this.auth || "";
  34412. e && (e = encodeURIComponent(e),
  34413. e = e.replace(/%3A/i, ":"),
  34414. e += "@");
  34415. var t = this.protocol || ""
  34416. , i = this.pathname || ""
  34417. , n = this.hash || ""
  34418. , r = !1
  34419. , o = "";
  34420. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  34421. this.port && (r += ":" + this.port)),
  34422. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  34423. var a = this.search || o && "?" + o || "";
  34424. return t && ":" !== t.substr(-1) && (t += ":"),
  34425. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  34426. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  34427. n && "#" !== n.charAt(0) && (n = "#" + n),
  34428. a && "?" !== a.charAt(0) && (a = "?" + a),
  34429. i = i.replace(/[?#]/g, function(e) {
  34430. return encodeURIComponent(e)
  34431. }),
  34432. a = a.replace("#", "%23"),
  34433. t + r + i + a + n
  34434. }
  34435. ,
  34436. n.prototype.resolve = function(e) {
  34437. return this.resolveObject(r(e, !1, !0)).format()
  34438. }
  34439. ,
  34440. n.prototype.resolveObject = function(e) {
  34441. if (c.isString(e)) {
  34442. var t = new n;
  34443. t.parse(e, !1, !0),
  34444. e = t
  34445. }
  34446. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  34447. var a = r[o];
  34448. i[a] = this[a]
  34449. }
  34450. if (i.hash = e.hash,
  34451. "" === e.href)
  34452. return i.href = i.format(),
  34453. i;
  34454. if (e.slashes && !e.protocol) {
  34455. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  34456. var h = s[l];
  34457. "protocol" !== h && (i[h] = e[h])
  34458. }
  34459. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  34460. i.href = i.format(),
  34461. i
  34462. }
  34463. if (e.protocol && e.protocol !== i.protocol) {
  34464. if (!b[e.protocol]) {
  34465. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  34466. var p = u[d];
  34467. i[p] = e[p]
  34468. }
  34469. return i.href = i.format(),
  34470. i
  34471. }
  34472. if (i.protocol = e.protocol,
  34473. e.host || E[e.protocol])
  34474. i.pathname = e.pathname;
  34475. else {
  34476. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  34477. ;
  34478. e.host || (e.host = ""),
  34479. e.hostname || (e.hostname = ""),
  34480. "" !== f[0] && f.unshift(""),
  34481. f.length < 2 && f.unshift(""),
  34482. i.pathname = f.join("/")
  34483. }
  34484. if (i.search = e.search,
  34485. i.query = e.query,
  34486. i.host = e.host || "",
  34487. i.auth = e.auth,
  34488. i.hostname = e.hostname || e.host,
  34489. i.port = e.port,
  34490. i.pathname || i.search) {
  34491. var g = i.pathname || ""
  34492. , m = i.search || "";
  34493. i.path = g + m
  34494. }
  34495. return i.slashes = i.slashes || e.slashes,
  34496. i.href = i.format(),
  34497. i
  34498. }
  34499. var v = i.pathname && "/" === i.pathname.charAt(0)
  34500. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  34501. , y = A || v || i.host && e.pathname
  34502. , C = y
  34503. , I = i.pathname && i.pathname.split("/") || []
  34504. , f = e.pathname && e.pathname.split("/") || []
  34505. , w = i.protocol && !b[i.protocol];
  34506. if (w && (i.hostname = "",
  34507. i.port = null,
  34508. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  34509. i.host = "",
  34510. e.protocol && (e.hostname = null,
  34511. e.port = null,
  34512. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  34513. e.host = null),
  34514. y = y && ("" === f[0] || "" === I[0])),
  34515. A)
  34516. i.host = e.host || "" === e.host ? e.host : i.host,
  34517. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  34518. i.search = e.search,
  34519. i.query = e.query,
  34520. I = f;
  34521. else if (f.length)
  34522. I || (I = []),
  34523. I.pop(),
  34524. I = I.concat(f),
  34525. i.search = e.search,
  34526. i.query = e.query;
  34527. else if (!c.isNullOrUndefined(e.search)) {
  34528. if (w) {
  34529. i.hostname = i.host = I.shift();
  34530. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34531. _ && (i.auth = _.shift(),
  34532. i.host = i.hostname = _.shift())
  34533. }
  34534. return i.search = e.search,
  34535. i.query = e.query,
  34536. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34537. i.href = i.format(),
  34538. i
  34539. }
  34540. if (!I.length)
  34541. return i.pathname = null,
  34542. i.search ? i.path = "/" + i.search : i.path = null,
  34543. i.href = i.format(),
  34544. i;
  34545. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  34546. T = I[M],
  34547. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  34548. S++) : S && (I.splice(M, 1),
  34549. S--);
  34550. if (!y && !C)
  34551. for (; S--; S)
  34552. I.unshift("..");
  34553. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  34554. x && "/" !== I.join("/").substr(-1) && I.push("");
  34555. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  34556. if (w) {
  34557. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  34558. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34559. _ && (i.auth = _.shift(),
  34560. i.host = i.hostname = _.shift())
  34561. }
  34562. return y = y || i.host && I.length,
  34563. y && !R && I.unshift(""),
  34564. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  34565. i.path = null),
  34566. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34567. i.auth = e.auth || i.auth,
  34568. i.slashes = i.slashes || e.slashes,
  34569. i.href = i.format(),
  34570. i
  34571. }
  34572. ,
  34573. n.prototype.parseHost = function() {
  34574. var e = this.host
  34575. , t = u.exec(e);
  34576. t && (t = t[0],
  34577. ":" !== t && (this.port = t.substr(1)),
  34578. e = e.substr(0, e.length - t.length)),
  34579. e && (this.hostname = e)
  34580. }
  34581. }
  34582. , {
  34583. "./util": 209,
  34584. punycode: 204,
  34585. querystring: 207
  34586. }],
  34587. 209: [function(e, t, i) {//"./util"
  34588. "use strict";
  34589. t.exports = {
  34590. isString: function(e) {
  34591. return "string" == typeof e
  34592. },
  34593. isObject: function(e) {
  34594. return "object" == typeof e && null !== e
  34595. },
  34596. isNull: function(e) {
  34597. return null === e
  34598. },
  34599. isNullOrUndefined: function(e) {
  34600. return null == e
  34601. }
  34602. }
  34603. }
  34604. , {}],
  34605. 210: [function(e, t, i) {//dict
  34606. "use strict";
  34607. function n(e) {
  34608. return l + e
  34609. }
  34610. function r(e) {
  34611. return e.substring(l.length)
  34612. }
  34613. function o(e, t) {
  34614. for (var i in t)
  34615. Object.defineProperty(e, i, {
  34616. value: t[i],
  34617. configurable: !0,
  34618. writable: !0
  34619. })
  34620. }
  34621. function a(e) {
  34622. if ("string" != typeof e)
  34623. throw new TypeError("key must be a string.")
  34624. }
  34625. var s = Object.prototype.hasOwnProperty
  34626. , l = "~";
  34627. t.exports = function(e) {
  34628. var t = Object.create(null)
  34629. , i = 0
  34630. , l = {};
  34631. return o(l, {
  34632. get: function(e, i) {
  34633. a(e);
  34634. var r = n(e);
  34635. return r in t ? t[r] : i
  34636. },
  34637. set: function(e, r) {
  34638. a(e);
  34639. var o = n(e);
  34640. return o in t || ++i,
  34641. t[o] = r
  34642. },
  34643. has: function(e) {
  34644. return a(e),
  34645. n(e)in t
  34646. },
  34647. delete: function(e) {
  34648. a(e);
  34649. var r = n(e);
  34650. return r in t && (--i,
  34651. delete t[r],
  34652. !0)
  34653. },
  34654. clear: function() {
  34655. t = Object.create(null),
  34656. i = 0
  34657. },
  34658. forEach: function(e, i) {
  34659. if ("function" != typeof e)
  34660. throw new TypeError("`callback` must be a function");
  34661. for (var n in t)
  34662. if (s.call(t, n)) {
  34663. var o = r(n)
  34664. , a = t[n];
  34665. e.call(i, a, o, l)
  34666. }
  34667. }
  34668. }),
  34669. Object.defineProperty(l, "size", {
  34670. get: function() {
  34671. return i
  34672. },
  34673. configurable: !0
  34674. }),
  34675. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34676. l.set(t, e[t])
  34677. }),
  34678. l
  34679. }
  34680. }
  34681. , {}],
  34682. 211: [function(e, t, i) {//heap
  34683. t.exports = e("./lib/heap")
  34684. }
  34685. , {
  34686. "./lib/heap": 212
  34687. }],
  34688. 212: [function(e, t, i) {//"./lib/heap"
  34689. (function() {
  34690. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34691. r = Math.floor,
  34692. u = Math.min,
  34693. n = function(e, t) {
  34694. return e < t ? -1 : e > t ? 1 : 0
  34695. }
  34696. ,
  34697. h = function(e, t, i, o, a) {
  34698. var s;
  34699. if (null == i && (i = 0),
  34700. null == a && (a = n),
  34701. i < 0)
  34702. throw new Error("lo must be non-negative");
  34703. for (null == o && (o = e.length); i < o; )
  34704. s = r((i + o) / 2),
  34705. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34706. return [].splice.apply(e, [i, i - i].concat(t)),
  34707. t
  34708. }
  34709. ,
  34710. s = function(e, t, i) {
  34711. return null == i && (i = n),
  34712. e.push(t),
  34713. g(e, 0, e.length - 1, i)
  34714. }
  34715. ,
  34716. a = function(e, t) {
  34717. var i, r;
  34718. return null == t && (t = n),
  34719. i = e.pop(),
  34720. e.length ? (r = e[0],
  34721. e[0] = i,
  34722. m(e, 0, t)) : r = i,
  34723. r
  34724. }
  34725. ,
  34726. c = function(e, t, i) {
  34727. var r;
  34728. return null == i && (i = n),
  34729. r = e[0],
  34730. e[0] = t,
  34731. m(e, 0, i),
  34732. r
  34733. }
  34734. ,
  34735. l = function(e, t, i) {
  34736. var r;
  34737. return null == i && (i = n),
  34738. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34739. t = r[0],
  34740. e[0] = r[1],
  34741. m(e, 0, i)),
  34742. t
  34743. }
  34744. ,
  34745. o = function(e, t) {
  34746. var i, o, a, s, l, c;
  34747. for (null == t && (t = n),
  34748. s = function() {
  34749. c = [];
  34750. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34751. c.push(t);
  34752. return c
  34753. }
  34754. .apply(this).reverse(),
  34755. l = [],
  34756. o = 0,
  34757. a = s.length; o < a; o++)
  34758. i = s[o],
  34759. l.push(m(e, i, t));
  34760. return l
  34761. }
  34762. ,
  34763. f = function(e, t, i) {
  34764. var r;
  34765. if (null == i && (i = n),
  34766. r = e.indexOf(t),
  34767. r !== -1)
  34768. return g(e, 0, r, i),
  34769. m(e, r, i)
  34770. }
  34771. ,
  34772. d = function(e, t, i) {
  34773. var r, a, s, c, h;
  34774. if (null == i && (i = n),
  34775. a = e.slice(0, t),
  34776. !a.length)
  34777. return a;
  34778. for (o(a, i),
  34779. h = e.slice(t),
  34780. s = 0,
  34781. c = h.length; s < c; s++)
  34782. r = h[s],
  34783. l(a, r, i);
  34784. return a.sort(i).reverse()
  34785. }
  34786. ,
  34787. p = function(e, t, i) {
  34788. var r, s, l, c, d, p, f, g, m, v;
  34789. if (null == i && (i = n),
  34790. 10 * t <= e.length) {
  34791. if (c = e.slice(0, t).sort(i),
  34792. !c.length)
  34793. return c;
  34794. for (l = c[c.length - 1],
  34795. g = e.slice(t),
  34796. d = 0,
  34797. f = g.length; d < f; d++)
  34798. r = g[d],
  34799. i(r, l) < 0 && (h(c, r, 0, null, i),
  34800. c.pop(),
  34801. l = c[c.length - 1]);
  34802. return c
  34803. }
  34804. for (o(e, i),
  34805. v = [],
  34806. s = p = 0,
  34807. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34808. v.push(a(e, i));
  34809. return v
  34810. }
  34811. ,
  34812. g = function(e, t, i, r) {
  34813. var o, a, s;
  34814. for (null == r && (r = n),
  34815. o = e[i]; i > t && (s = i - 1 >> 1,
  34816. a = e[s],
  34817. r(o, a) < 0); )
  34818. e[i] = a,
  34819. i = s;
  34820. return e[i] = o
  34821. }
  34822. ,
  34823. m = function(e, t, i) {
  34824. var r, o, a, s, l;
  34825. for (null == i && (i = n),
  34826. o = e.length,
  34827. l = t,
  34828. a = e[t],
  34829. r = 2 * t + 1; r < o; )
  34830. s = r + 1,
  34831. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34832. e[t] = e[r],
  34833. t = r,
  34834. r = 2 * t + 1;
  34835. return e[t] = a,
  34836. g(e, l, t, i)
  34837. }
  34838. ,
  34839. e = function() {
  34840. function e(e) {
  34841. this.cmp = null != e ? e : n,
  34842. this.nodes = []
  34843. }
  34844. return e.push = s,
  34845. e.pop = a,
  34846. e.replace = c,
  34847. e.pushpop = l,
  34848. e.heapify = o,
  34849. e.updateItem = f,
  34850. e.nlargest = d,
  34851. e.nsmallest = p,
  34852. e.prototype.push = function(e) {
  34853. return s(this.nodes, e, this.cmp)
  34854. }
  34855. ,
  34856. e.prototype.pop = function() {
  34857. return a(this.nodes, this.cmp)
  34858. }
  34859. ,
  34860. e.prototype.peek = function() {
  34861. return this.nodes[0]
  34862. }
  34863. ,
  34864. e.prototype.contains = function(e) {
  34865. return this.nodes.indexOf(e) !== -1
  34866. }
  34867. ,
  34868. e.prototype.replace = function(e) {
  34869. return c(this.nodes, e, this.cmp)
  34870. }
  34871. ,
  34872. e.prototype.pushpop = function(e) {
  34873. return l(this.nodes, e, this.cmp)
  34874. }
  34875. ,
  34876. e.prototype.heapify = function() {
  34877. return o(this.nodes, this.cmp)
  34878. }
  34879. ,
  34880. e.prototype.updateItem = function(e) {
  34881. return f(this.nodes, e, this.cmp)
  34882. }
  34883. ,
  34884. e.prototype.clear = function() {
  34885. return this.nodes = []
  34886. }
  34887. ,
  34888. e.prototype.empty = function() {
  34889. return 0 === this.nodes.length
  34890. }
  34891. ,
  34892. e.prototype.size = function() {
  34893. return this.nodes.length
  34894. }
  34895. ,
  34896. e.prototype.clone = function() {
  34897. var t;
  34898. return t = new e,
  34899. t.nodes = this.nodes.slice(0),
  34900. t
  34901. }
  34902. ,
  34903. e.prototype.toArray = function() {
  34904. return this.nodes.slice(0)
  34905. }
  34906. ,
  34907. e.prototype.insert = e.prototype.push,
  34908. e.prototype.top = e.prototype.peek,
  34909. e.prototype.front = e.prototype.peek,
  34910. e.prototype.has = e.prototype.contains,
  34911. e.prototype.copy = e.prototype.clone,
  34912. e
  34913. }(),
  34914. function(e, n) {
  34915. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34916. }(this, function() {
  34917. return e
  34918. })
  34919. }
  34920. ).call(this)
  34921. }
  34922. , {}],
  34923. 213: [function(e, t, i) {//"promise-polyfill"
  34924. !function(e) {
  34925. function i() {}
  34926. function n(e, t) {
  34927. return function() {
  34928. e.apply(t, arguments)
  34929. }
  34930. }
  34931. function r(e) {
  34932. if ("object" != typeof this)
  34933. throw new TypeError("Promises must be constructed via new");
  34934. if ("function" != typeof e)
  34935. throw new TypeError("not a function");
  34936. this._state = 0,
  34937. this._handled = !1,
  34938. this._value = void 0,
  34939. this._deferreds = [],
  34940. h(e, this)
  34941. }
  34942. function o(e, t) {
  34943. for (; 3 === e._state; )
  34944. e = e._value;
  34945. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34946. void r._immediateFn(function() {
  34947. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34948. if (null === i)
  34949. return void (1 === e._state ? a : s)(t.promise, e._value);
  34950. var n;
  34951. try {
  34952. n = i(e._value)
  34953. } catch (e) {
  34954. return void s(t.promise, e)
  34955. }
  34956. a(t.promise, n)
  34957. }))
  34958. }
  34959. function a(e, t) {
  34960. try {
  34961. if (t === e)
  34962. throw new TypeError("A promise cannot be resolved with itself.");
  34963. if (t && ("object" == typeof t || "function" == typeof t)) {
  34964. var i = t.then;
  34965. if (t instanceof r)
  34966. return e._state = 3,
  34967. e._value = t,
  34968. void l(e);
  34969. if ("function" == typeof i)
  34970. return void h(n(i, t), e)
  34971. }
  34972. e._state = 1,
  34973. e._value = t,
  34974. l(e)
  34975. } catch (t) {
  34976. s(e, t)
  34977. }
  34978. }
  34979. function s(e, t) {
  34980. e._state = 2,
  34981. e._value = t,
  34982. l(e)
  34983. }
  34984. function l(e) {
  34985. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34986. e._handled || r._unhandledRejectionFn(e._value)
  34987. });
  34988. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34989. o(e, e._deferreds[t]);
  34990. e._deferreds = null
  34991. }
  34992. function c(e, t, i) {
  34993. this.onFulfilled = "function" == typeof e ? e : null,
  34994. this.onRejected = "function" == typeof t ? t : null,
  34995. this.promise = i
  34996. }
  34997. function h(e, t) {
  34998. var i = !1;
  34999. try {
  35000. e(function(e) {
  35001. i || (i = !0,
  35002. a(t, e))
  35003. }, function(e) {
  35004. i || (i = !0,
  35005. s(t, e))
  35006. })
  35007. } catch (e) {
  35008. if (i)
  35009. return;
  35010. i = !0,
  35011. s(t, e)
  35012. }
  35013. }
  35014. var u = setTimeout;
  35015. r.prototype.catch = function(e) {
  35016. return this.then(null, e)
  35017. }
  35018. ,
  35019. r.prototype.then = function(e, t) {
  35020. var n = new this.constructor(i);
  35021. return o(this, new c(e,t,n)),
  35022. n
  35023. }
  35024. ,
  35025. r.all = function(e) {
  35026. var t = Array.prototype.slice.call(e);
  35027. return new r(function(e, i) {
  35028. function n(o, a) {
  35029. try {
  35030. if (a && ("object" == typeof a || "function" == typeof a)) {
  35031. var s = a.then;
  35032. if ("function" == typeof s)
  35033. return void s.call(a, function(e) {
  35034. n(o, e)
  35035. }, i)
  35036. }
  35037. t[o] = a,
  35038. 0 === --r && e(t)
  35039. } catch (e) {
  35040. i(e)
  35041. }
  35042. }
  35043. if (0 === t.length)
  35044. return e([]);
  35045. for (var r = t.length, o = 0; o < t.length; o++)
  35046. n(o, t[o])
  35047. }
  35048. )
  35049. }
  35050. ,
  35051. r.resolve = function(e) {
  35052. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  35053. t(e)
  35054. }
  35055. )
  35056. }
  35057. ,
  35058. r.reject = function(e) {
  35059. return new r(function(t, i) {
  35060. i(e)
  35061. }
  35062. )
  35063. }
  35064. ,
  35065. r.race = function(e) {
  35066. return new r(function(t, i) {
  35067. for (var n = 0, r = e.length; n < r; n++)
  35068. e[n].then(t, i)
  35069. }
  35070. )
  35071. }
  35072. ,
  35073. r._immediateFn = "function" == typeof setImmediate && function(e) {
  35074. setImmediate(e)
  35075. }
  35076. || function(e) {
  35077. u(e, 0)
  35078. }
  35079. ,
  35080. r._unhandledRejectionFn = function(e) {
  35081. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  35082. }
  35083. ,
  35084. r._setImmediateFn = function(e) {
  35085. r._immediateFn = e
  35086. }
  35087. ,
  35088. r._setUnhandledRejectionFn = function(e) {
  35089. r._unhandledRejectionFn = e
  35090. }
  35091. ,
  35092. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  35093. }(this)
  35094. }
  35095. , {}],
  35096. 214: [function(e, t, i) {//protobufjs
  35097. (function(i) {
  35098. !function(i, n) {
  35099. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  35100. }(this, function(t, n) {
  35101. "use strict";
  35102. var r = {};
  35103. return r.ByteBuffer = t,
  35104. r.Long = t.Long || null,
  35105. r.VERSION = "5.0.1",
  35106. r.WIRE_TYPES = {},
  35107. r.WIRE_TYPES.VARINT = 0,
  35108. r.WIRE_TYPES.BITS64 = 1,
  35109. r.WIRE_TYPES.LDELIM = 2,
  35110. r.WIRE_TYPES.STARTGROUP = 3,
  35111. r.WIRE_TYPES.ENDGROUP = 4,
  35112. r.WIRE_TYPES.BITS32 = 5,
  35113. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  35114. r.TYPES = {
  35115. int32: {
  35116. name: "int32",
  35117. wireType: r.WIRE_TYPES.VARINT,
  35118. defaultValue: 0
  35119. },
  35120. uint32: {
  35121. name: "uint32",
  35122. wireType: r.WIRE_TYPES.VARINT,
  35123. defaultValue: 0
  35124. },
  35125. sint32: {
  35126. name: "sint32",
  35127. wireType: r.WIRE_TYPES.VARINT,
  35128. defaultValue: 0
  35129. },
  35130. int64: {
  35131. name: "int64",
  35132. wireType: r.WIRE_TYPES.VARINT,
  35133. defaultValue: r.Long ? r.Long.ZERO : void 0
  35134. },
  35135. uint64: {
  35136. name: "uint64",
  35137. wireType: r.WIRE_TYPES.VARINT,
  35138. defaultValue: r.Long ? r.Long.UZERO : void 0
  35139. },
  35140. sint64: {
  35141. name: "sint64",
  35142. wireType: r.WIRE_TYPES.VARINT,
  35143. defaultValue: r.Long ? r.Long.ZERO : void 0
  35144. },
  35145. bool: {
  35146. name: "bool",
  35147. wireType: r.WIRE_TYPES.VARINT,
  35148. defaultValue: !1
  35149. },
  35150. double: {
  35151. name: "double",
  35152. wireType: r.WIRE_TYPES.BITS64,
  35153. defaultValue: 0
  35154. },
  35155. string: {
  35156. name: "string",
  35157. wireType: r.WIRE_TYPES.LDELIM,
  35158. defaultValue: ""
  35159. },
  35160. bytes: {
  35161. name: "bytes",
  35162. wireType: r.WIRE_TYPES.LDELIM,
  35163. defaultValue: null
  35164. },
  35165. fixed32: {
  35166. name: "fixed32",
  35167. wireType: r.WIRE_TYPES.BITS32,
  35168. defaultValue: 0
  35169. },
  35170. sfixed32: {
  35171. name: "sfixed32",
  35172. wireType: r.WIRE_TYPES.BITS32,
  35173. defaultValue: 0
  35174. },
  35175. fixed64: {
  35176. name: "fixed64",
  35177. wireType: r.WIRE_TYPES.BITS64,
  35178. defaultValue: r.Long ? r.Long.UZERO : void 0
  35179. },
  35180. sfixed64: {
  35181. name: "sfixed64",
  35182. wireType: r.WIRE_TYPES.BITS64,
  35183. defaultValue: r.Long ? r.Long.ZERO : void 0
  35184. },
  35185. float: {
  35186. name: "float",
  35187. wireType: r.WIRE_TYPES.BITS32,
  35188. defaultValue: 0
  35189. },
  35190. enum: {
  35191. name: "enum",
  35192. wireType: r.WIRE_TYPES.VARINT,
  35193. defaultValue: 0
  35194. },
  35195. message: {
  35196. name: "message",
  35197. wireType: r.WIRE_TYPES.LDELIM,
  35198. defaultValue: null
  35199. },
  35200. group: {
  35201. name: "group",
  35202. wireType: r.WIRE_TYPES.STARTGROUP,
  35203. defaultValue: null
  35204. }
  35205. },
  35206. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  35207. r.ID_MIN = 1,
  35208. r.ID_MAX = 536870911,
  35209. r.convertFieldsToCamelCase = !1,
  35210. r.populateAccessors = !0,
  35211. r.populateDefaults = !0,
  35212. r.Util = function() {
  35213. var t = {};
  35214. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  35215. t.XHR = function() {
  35216. for (var e = [function() {
  35217. return new XMLHttpRequest
  35218. }
  35219. , function() {
  35220. return new ActiveXObject("Msxml2.XMLHTTP")
  35221. }
  35222. , function() {
  35223. return new ActiveXObject("Msxml3.XMLHTTP")
  35224. }
  35225. , function() {
  35226. return new ActiveXObject("Microsoft.XMLHTTP")
  35227. }
  35228. ], t = null, i = 0; i < e.length; i++) {
  35229. try {
  35230. t = e[i]()
  35231. } catch (e) {
  35232. continue
  35233. }
  35234. break
  35235. }
  35236. if (!t)
  35237. throw Error("XMLHttpRequest is not supported");
  35238. return t
  35239. }
  35240. ,
  35241. t.fetch = function(i, n) {
  35242. if (n && "function" != typeof n && (n = null),
  35243. t.IS_NODE) {
  35244. var r = e("fs");
  35245. if (n)
  35246. r.readFile(i, function(e, t) {
  35247. n(e ? null : "" + t)
  35248. });
  35249. else
  35250. try {
  35251. return r.readFileSync(i)
  35252. } catch (e) {
  35253. return null
  35254. }
  35255. } else {
  35256. var o = t.XHR();
  35257. if (o.open("GET", i, !!n),
  35258. o.setRequestHeader("Accept", "text/plain"),
  35259. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  35260. !n)
  35261. return o.send(null),
  35262. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  35263. if (o.onreadystatechange = function() {
  35264. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  35265. }
  35266. ,
  35267. 4 == o.readyState)
  35268. return;
  35269. o.send(null)
  35270. }
  35271. }
  35272. ,
  35273. t.toCamelCase = function(e) {
  35274. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  35275. return t.toUpperCase()
  35276. })
  35277. }
  35278. ,
  35279. t
  35280. }(),
  35281. r.Lang = {
  35282. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  35283. RULE: /^(?:required|optional|repeated|map)$/,
  35284. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  35285. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  35286. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  35287. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  35288. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  35289. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  35290. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  35291. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  35292. NUMBER_OCT: /^0[0-7]+$/,
  35293. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  35294. BOOL: /^(?:true|false)$/i,
  35295. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  35296. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  35297. WHITESPACE: /\s/,
  35298. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  35299. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  35300. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  35301. },
  35302. r.DotProto = function(e, t) {
  35303. function i(e, i) {
  35304. var n = -1
  35305. , r = 1;
  35306. if ("-" == e.charAt(0) && (r = -1,
  35307. e = e.substring(1)),
  35308. t.NUMBER_DEC.test(e))
  35309. n = parseInt(e);
  35310. else if (t.NUMBER_HEX.test(e))
  35311. n = parseInt(e.substring(2), 16);
  35312. else {
  35313. if (!t.NUMBER_OCT.test(e))
  35314. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  35315. n = parseInt(e.substring(1), 8)
  35316. }
  35317. if (n = r * n | 0,
  35318. !i && n < 0)
  35319. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  35320. return n
  35321. }
  35322. function n(e) {
  35323. var i = 1;
  35324. if ("-" == e.charAt(0) && (i = -1,
  35325. e = e.substring(1)),
  35326. t.NUMBER_DEC.test(e))
  35327. return i * parseInt(e, 10);
  35328. if (t.NUMBER_HEX.test(e))
  35329. return i * parseInt(e.substring(2), 16);
  35330. if (t.NUMBER_OCT.test(e))
  35331. return i * parseInt(e.substring(1), 8);
  35332. if ("inf" === e)
  35333. return i * (1 / 0);
  35334. if ("nan" === e)
  35335. return NaN;
  35336. if (t.NUMBER_FLT.test(e))
  35337. return i * parseFloat(e);
  35338. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  35339. }
  35340. function r(e, t, i) {
  35341. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  35342. e[t].push(i))
  35343. }
  35344. var o = {}
  35345. , a = function(e) {
  35346. this.source = e + "",
  35347. this.index = 0,
  35348. this.line = 1,
  35349. this.stack = [],
  35350. this._stringOpen = null
  35351. }
  35352. , s = a.prototype;
  35353. s._readString = function() {
  35354. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  35355. e.lastIndex = this.index - 1;
  35356. var i = e.exec(this.source);
  35357. if (!i)
  35358. throw Error("unterminated string");
  35359. return this.index = e.lastIndex,
  35360. this.stack.push(this._stringOpen),
  35361. this._stringOpen = null,
  35362. i[1]
  35363. }
  35364. ,
  35365. s.next = function() {
  35366. if (this.stack.length > 0)
  35367. return this.stack.shift();
  35368. if (this.index >= this.source.length)
  35369. return null;
  35370. if (null !== this._stringOpen)
  35371. return this._readString();
  35372. var e, i, n;
  35373. do {
  35374. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  35375. if ("\n" === n && ++this.line,
  35376. ++this.index === this.source.length)
  35377. return null;
  35378. if ("/" === this.source.charAt(this.index))
  35379. if (++this.index,
  35380. "/" === this.source.charAt(this.index)) {
  35381. for (; "\n" !== this.source.charAt(++this.index); )
  35382. if (this.index == this.source.length)
  35383. return null;
  35384. ++this.index,
  35385. ++this.line,
  35386. e = !0
  35387. } else {
  35388. if ("*" !== (n = this.source.charAt(this.index)))
  35389. return "/";
  35390. do {
  35391. if ("\n" === n && ++this.line,
  35392. ++this.index === this.source.length)
  35393. return null;
  35394. i = n,
  35395. n = this.source.charAt(this.index)
  35396. } while ("*" !== i || "/" !== n);++this.index,
  35397. e = !0
  35398. }
  35399. } while (e);if (this.index === this.source.length)
  35400. return null;
  35401. var r = this.index;
  35402. t.DELIM.lastIndex = 0;
  35403. var o = t.DELIM.test(this.source.charAt(r++));
  35404. if (!o)
  35405. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  35406. ++r;
  35407. var a = this.source.substring(this.index, this.index = r);
  35408. return '"' !== a && "'" !== a || (this._stringOpen = a),
  35409. a
  35410. }
  35411. ,
  35412. s.peek = function() {
  35413. if (0 === this.stack.length) {
  35414. var e = this.next();
  35415. if (null === e)
  35416. return null;
  35417. this.stack.push(e)
  35418. }
  35419. return this.stack[0]
  35420. }
  35421. ,
  35422. s.skip = function(e) {
  35423. var t = this.next();
  35424. if (t !== e)
  35425. throw Error("illegal '" + t + "', '" + e + "' expected")
  35426. }
  35427. ,
  35428. s.omit = function(e) {
  35429. return this.peek() === e && (this.next(),
  35430. !0)
  35431. }
  35432. ,
  35433. s.toString = function() {
  35434. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  35435. }
  35436. ,
  35437. o.Tokenizer = a;
  35438. var l = function(e) {
  35439. this.tn = new a(e),
  35440. this.proto3 = !1
  35441. }
  35442. , c = l.prototype;
  35443. return c.parse = function() {
  35444. var e, i, n = {
  35445. name: "[ROOT]",
  35446. package: null,
  35447. messages: [],
  35448. enums: [],
  35449. imports: [],
  35450. options: {},
  35451. services: []
  35452. }, r = !0;
  35453. try {
  35454. for (; e = this.tn.next(); )
  35455. switch (e) {
  35456. case "package":
  35457. if (!r || null !== n.package)
  35458. throw Error("unexpected 'package'");
  35459. if (e = this.tn.next(),
  35460. !t.TYPEREF.test(e))
  35461. throw Error("illegal package name: " + e);
  35462. this.tn.skip(";"),
  35463. n.package = e;
  35464. break;
  35465. case "import":
  35466. if (!r)
  35467. throw Error("unexpected 'import'");
  35468. e = this.tn.peek(),
  35469. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  35470. e = this._readString(),
  35471. this.tn.skip(";"),
  35472. i || n.imports.push(e);
  35473. break;
  35474. case "syntax":
  35475. if (!r)
  35476. throw Error("unexpected 'syntax'");
  35477. this.tn.skip("="),
  35478. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  35479. this.tn.skip(";");
  35480. break;
  35481. case "message":
  35482. this._parseMessage(n, null),
  35483. r = !1;
  35484. break;
  35485. case "enum":
  35486. this._parseEnum(n),
  35487. r = !1;
  35488. break;
  35489. case "option":
  35490. this._parseOption(n);
  35491. break;
  35492. case "service":
  35493. this._parseService(n);
  35494. break;
  35495. case "extend":
  35496. this._parseExtend(n);
  35497. break;
  35498. default:
  35499. throw Error("unexpected '" + e + "'")
  35500. }
  35501. } catch (e) {
  35502. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  35503. e
  35504. }
  35505. return delete n.name,
  35506. n
  35507. }
  35508. ,
  35509. l.parse = function(e) {
  35510. return new l(e).parse()
  35511. }
  35512. ,
  35513. c._readString = function() {
  35514. var e, t, i = "";
  35515. do {
  35516. if (t = this.tn.next(),
  35517. "'" !== t && '"' !== t)
  35518. throw Error("illegal string delimiter: " + t);
  35519. i += this.tn.next(),
  35520. this.tn.skip(t),
  35521. e = this.tn.peek()
  35522. } while ('"' === e || '"' === e);return i
  35523. }
  35524. ,
  35525. c._readValue = function(e) {
  35526. var i = this.tn.peek();
  35527. if ('"' === i || "'" === i)
  35528. return this._readString();
  35529. if (this.tn.next(),
  35530. t.NUMBER.test(i))
  35531. return n(i);
  35532. if (t.BOOL.test(i))
  35533. return "true" === i.toLowerCase();
  35534. if (e && t.TYPEREF.test(i))
  35535. return i;
  35536. throw Error("illegal value: " + i)
  35537. }
  35538. ,
  35539. c._parseOption = function(e, i) {
  35540. var n = this.tn.next()
  35541. , r = !1;
  35542. if ("(" === n && (r = !0,
  35543. n = this.tn.next()),
  35544. !t.TYPEREF.test(n))
  35545. throw Error("illegal option name: " + n);
  35546. var o = n;
  35547. r && (this.tn.skip(")"),
  35548. o = "(" + o + ")",
  35549. n = this.tn.peek(),
  35550. t.FQTYPEREF.test(n) && (o += n,
  35551. this.tn.next())),
  35552. this.tn.skip("="),
  35553. this._parseOptionValue(e, o),
  35554. i || this.tn.skip(";")
  35555. }
  35556. ,
  35557. c._parseOptionValue = function(e, i) {
  35558. var n = this.tn.peek();
  35559. if ("{" !== n)
  35560. r(e.options, i, this._readValue(!0));
  35561. else
  35562. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  35563. if (!t.NAME.test(n))
  35564. throw Error("illegal option name: " + i + "." + n);
  35565. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  35566. }
  35567. }
  35568. ,
  35569. c._parseService = function(e) {
  35570. var i = this.tn.next();
  35571. if (!t.NAME.test(i))
  35572. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  35573. var n = i
  35574. , r = {
  35575. name: n,
  35576. rpc: {},
  35577. options: {}
  35578. };
  35579. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35580. if ("option" === i)
  35581. this._parseOption(r);
  35582. else {
  35583. if ("rpc" !== i)
  35584. throw Error("illegal service token: " + i);
  35585. this._parseServiceRPC(r)
  35586. }
  35587. this.tn.omit(";"),
  35588. e.services.push(r)
  35589. }
  35590. ,
  35591. c._parseServiceRPC = function(e) {
  35592. var i = "rpc"
  35593. , n = this.tn.next();
  35594. if (!t.NAME.test(n))
  35595. throw Error("illegal rpc service method name: " + n);
  35596. var r = n
  35597. , o = {
  35598. request: null,
  35599. response: null,
  35600. request_stream: !1,
  35601. response_stream: !1,
  35602. options: {}
  35603. };
  35604. if (this.tn.skip("("),
  35605. n = this.tn.next(),
  35606. "stream" === n.toLowerCase() && (o.request_stream = !0,
  35607. n = this.tn.next()),
  35608. !t.TYPEREF.test(n))
  35609. throw Error("illegal rpc service request type: " + n);
  35610. if (o.request = n,
  35611. this.tn.skip(")"),
  35612. n = this.tn.next(),
  35613. "returns" !== n.toLowerCase())
  35614. throw Error("illegal rpc service request type delimiter: " + n);
  35615. if (this.tn.skip("("),
  35616. n = this.tn.next(),
  35617. "stream" === n.toLowerCase() && (o.response_stream = !0,
  35618. n = this.tn.next()),
  35619. o.response = n,
  35620. this.tn.skip(")"),
  35621. n = this.tn.peek(),
  35622. "{" === n) {
  35623. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  35624. if ("option" !== n)
  35625. throw Error("illegal rpc service token: " + n);
  35626. this._parseOption(o)
  35627. }
  35628. this.tn.omit(";")
  35629. } else
  35630. this.tn.skip(";");
  35631. "undefined" == typeof e[i] && (e[i] = {}),
  35632. e[i][r] = o
  35633. }
  35634. ,
  35635. c._parseMessage = function(e, n) {
  35636. var r = !!n
  35637. , o = this.tn.next()
  35638. , a = {
  35639. name: "",
  35640. fields: [],
  35641. enums: [],
  35642. messages: [],
  35643. options: {},
  35644. services: [],
  35645. oneofs: {}
  35646. };
  35647. if (!t.NAME.test(o))
  35648. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35649. for (a.name = o,
  35650. r && (this.tn.skip("="),
  35651. n.id = i(this.tn.next()),
  35652. a.isGroup = !0),
  35653. o = this.tn.peek(),
  35654. "[" === o && n && this._parseFieldOptions(n),
  35655. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35656. if (t.RULE.test(o))
  35657. this._parseMessageField(a, o);
  35658. else if ("oneof" === o)
  35659. this._parseMessageOneOf(a);
  35660. else if ("enum" === o)
  35661. this._parseEnum(a);
  35662. else if ("message" === o)
  35663. this._parseMessage(a);
  35664. else if ("option" === o)
  35665. this._parseOption(a);
  35666. else if ("service" === o)
  35667. this._parseService(a);
  35668. else if ("extensions" === o)
  35669. a.extensions = this._parseExtensionRanges();
  35670. else if ("reserved" === o)
  35671. this._parseIgnored();
  35672. else if ("extend" === o)
  35673. this._parseExtend(a);
  35674. else {
  35675. if (!t.TYPEREF.test(o))
  35676. throw Error("illegal message token: " + o);
  35677. if (!this.proto3)
  35678. throw Error("illegal field rule: " + o);
  35679. this._parseMessageField(a, "optional", o)
  35680. }
  35681. return this.tn.omit(";"),
  35682. e.messages.push(a),
  35683. a
  35684. }
  35685. ,
  35686. c._parseIgnored = function() {
  35687. for (; ";" !== this.tn.peek(); )
  35688. this.tn.next();
  35689. this.tn.skip(";")
  35690. }
  35691. ,
  35692. c._parseMessageField = function(e, n, r) {
  35693. if (!t.RULE.test(n))
  35694. throw Error("illegal message field rule: " + n);
  35695. var o, a = {
  35696. rule: n,
  35697. type: "",
  35698. name: "",
  35699. options: {},
  35700. id: 0
  35701. };
  35702. if ("map" === n) {
  35703. if (r)
  35704. throw Error("illegal type: " + r);
  35705. if (this.tn.skip("<"),
  35706. o = this.tn.next(),
  35707. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35708. throw Error("illegal message field type: " + o);
  35709. if (a.keytype = o,
  35710. this.tn.skip(","),
  35711. o = this.tn.next(),
  35712. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35713. throw Error("illegal message field: " + o);
  35714. if (a.type = o,
  35715. this.tn.skip(">"),
  35716. o = this.tn.next(),
  35717. !t.NAME.test(o))
  35718. throw Error("illegal message field name: " + o);
  35719. a.name = o,
  35720. this.tn.skip("="),
  35721. a.id = i(this.tn.next()),
  35722. o = this.tn.peek(),
  35723. "[" === o && this._parseFieldOptions(a),
  35724. this.tn.skip(";")
  35725. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35726. "group" === r) {
  35727. var s = this._parseMessage(e, a);
  35728. if (!/^[A-Z]/.test(s.name))
  35729. throw Error("illegal group name: " + s.name);
  35730. a.type = s.name,
  35731. a.name = s.name.toLowerCase(),
  35732. this.tn.omit(";")
  35733. } else {
  35734. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35735. throw Error("illegal message field type: " + r);
  35736. if (a.type = r,
  35737. o = this.tn.next(),
  35738. !t.NAME.test(o))
  35739. throw Error("illegal message field name: " + o);
  35740. a.name = o,
  35741. this.tn.skip("="),
  35742. a.id = i(this.tn.next()),
  35743. o = this.tn.peek(),
  35744. "[" === o && this._parseFieldOptions(a),
  35745. this.tn.skip(";")
  35746. }
  35747. return e.fields.push(a),
  35748. a
  35749. }
  35750. ,
  35751. c._parseMessageOneOf = function(e) {
  35752. var i = this.tn.next();
  35753. if (!t.NAME.test(i))
  35754. throw Error("illegal oneof name: " + i);
  35755. var n, r = i, o = [];
  35756. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35757. n = this._parseMessageField(e, "optional", i),
  35758. n.oneof = r,
  35759. o.push(n.id);
  35760. this.tn.omit(";"),
  35761. e.oneofs[r] = o
  35762. }
  35763. ,
  35764. c._parseFieldOptions = function(e) {
  35765. this.tn.skip("[");
  35766. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35767. i || this.tn.skip(","),
  35768. this._parseOption(e, !0),
  35769. i = !1;
  35770. this.tn.next()
  35771. }
  35772. ,
  35773. c._parseEnum = function(e) {
  35774. var n = {
  35775. name: "",
  35776. values: [],
  35777. options: {}
  35778. }
  35779. , r = this.tn.next();
  35780. if (!t.NAME.test(r))
  35781. throw Error("illegal name: " + r);
  35782. for (n.name = r,
  35783. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35784. if ("option" === r)
  35785. this._parseOption(n);
  35786. else {
  35787. if (!t.NAME.test(r))
  35788. throw Error("illegal name: " + r);
  35789. this.tn.skip("=");
  35790. var o = {
  35791. name: r,
  35792. id: i(this.tn.next(), !0)
  35793. };
  35794. r = this.tn.peek(),
  35795. "[" === r && this._parseFieldOptions({
  35796. options: {}
  35797. }),
  35798. this.tn.skip(";"),
  35799. n.values.push(o)
  35800. }
  35801. this.tn.omit(";"),
  35802. e.enums.push(n)
  35803. }
  35804. ,
  35805. c._parseExtensionRanges = function() {
  35806. var t, i, r, o = [];
  35807. do {
  35808. for (i = []; ; ) {
  35809. switch (t = this.tn.next()) {
  35810. case "min":
  35811. r = e.ID_MIN;
  35812. break;
  35813. case "max":
  35814. r = e.ID_MAX;
  35815. break;
  35816. default:
  35817. r = n(t)
  35818. }
  35819. if (i.push(r),
  35820. 2 === i.length)
  35821. break;
  35822. if ("to" !== this.tn.peek()) {
  35823. i.push(r);
  35824. break
  35825. }
  35826. this.tn.next()
  35827. }
  35828. o.push(i)
  35829. } while (this.tn.omit(","));return this.tn.skip(";"),
  35830. o
  35831. }
  35832. ,
  35833. c._parseExtend = function(e) {
  35834. var i = this.tn.next();
  35835. if (!t.TYPEREF.test(i))
  35836. throw Error("illegal extend reference: " + i);
  35837. var n = {
  35838. ref: i,
  35839. fields: []
  35840. };
  35841. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35842. if (t.RULE.test(i))
  35843. this._parseMessageField(n, i);
  35844. else {
  35845. if (!t.TYPEREF.test(i))
  35846. throw Error("illegal extend token: " + i);
  35847. if (!this.proto3)
  35848. throw Error("illegal field rule: " + i);
  35849. this._parseMessageField(n, "optional", i)
  35850. }
  35851. return this.tn.omit(";"),
  35852. e.messages.push(n),
  35853. n
  35854. }
  35855. ,
  35856. c.toString = function() {
  35857. return "Parser at line " + this.tn.line
  35858. }
  35859. ,
  35860. o.Parser = l,
  35861. o
  35862. }(r, r.Lang),
  35863. r.Reflect = function(e) {
  35864. function i(i) {
  35865. if ("string" == typeof i && (i = e.TYPES[i]),
  35866. "undefined" == typeof i.defaultValue)
  35867. throw Error("default value for type " + i.name + " is not supported");
  35868. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35869. }
  35870. function n(t, i) {
  35871. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35872. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35873. if ("string" == typeof t)
  35874. return e.Long.fromString(t, i || !1, 10);
  35875. if ("number" == typeof t)
  35876. return e.Long.fromNumber(t, i || !1);
  35877. throw Error("not convertible to Long")
  35878. }
  35879. function r(t, i) {
  35880. var n = i.readVarint32()
  35881. , o = 7 & n
  35882. , a = n >>> 3;
  35883. switch (o) {
  35884. case e.WIRE_TYPES.VARINT:
  35885. do
  35886. n = i.readUint8();
  35887. while (128 === (128 & n));break;
  35888. case e.WIRE_TYPES.BITS64:
  35889. i.offset += 8;
  35890. break;
  35891. case e.WIRE_TYPES.LDELIM:
  35892. n = i.readVarint32(),
  35893. i.offset += n;
  35894. break;
  35895. case e.WIRE_TYPES.STARTGROUP:
  35896. r(a, i);
  35897. break;
  35898. case e.WIRE_TYPES.ENDGROUP:
  35899. if (a === t)
  35900. return !1;
  35901. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35902. case e.WIRE_TYPES.BITS32:
  35903. i.offset += 4;
  35904. break;
  35905. default:
  35906. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35907. }
  35908. return !0
  35909. }
  35910. var o = {}
  35911. , a = function(e, t, i) {
  35912. this.builder = e,
  35913. this.parent = t,
  35914. this.name = i,
  35915. this.className
  35916. }
  35917. , s = a.prototype;
  35918. s.fqn = function() {
  35919. for (var e = this.name, t = this; ; ) {
  35920. if (t = t.parent,
  35921. null == t)
  35922. break;
  35923. e = t.name + "." + e
  35924. }
  35925. return e
  35926. }
  35927. ,
  35928. s.toString = function(e) {
  35929. return (e ? this.className + " " : "") + this.fqn()
  35930. }
  35931. ,
  35932. s.build = function() {
  35933. throw Error(this.toString(!0) + " cannot be built directly")
  35934. }
  35935. ,
  35936. o.T = a;
  35937. var l = function(e, t, i, n, r) {
  35938. a.call(this, e, t, i),
  35939. this.className = "Namespace",
  35940. this.children = [],
  35941. this.options = n || {},
  35942. this.syntax = r || "proto2"
  35943. }
  35944. , c = l.prototype = Object.create(a.prototype);
  35945. c.getChildren = function(e) {
  35946. if (e = e || null,
  35947. null == e)
  35948. return this.children.slice();
  35949. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35950. this.children[i]instanceof e && t.push(this.children[i]);
  35951. return t
  35952. }
  35953. ,
  35954. c.addChild = function(e) {
  35955. var t;
  35956. if (t = this.getChild(e.name))
  35957. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35958. t.name = t.originalName;
  35959. else {
  35960. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35961. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35962. e.name = e.originalName
  35963. }
  35964. this.children.push(e)
  35965. }
  35966. ,
  35967. c.getChild = function(e) {
  35968. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35969. if (this.children[i][t] === e)
  35970. return this.children[i];
  35971. return null
  35972. }
  35973. ,
  35974. c.resolve = function(e, t) {
  35975. var i = "string" == typeof e ? e.split(".") : e
  35976. , n = this
  35977. , r = 0;
  35978. if ("" === i[r]) {
  35979. for (; null !== n.parent; )
  35980. n = n.parent;
  35981. r++
  35982. }
  35983. var a;
  35984. do {
  35985. do {
  35986. if (!(n instanceof o.Namespace)) {
  35987. n = null;
  35988. break
  35989. }
  35990. if (a = n.getChild(i[r]),
  35991. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35992. n = null;
  35993. break
  35994. }
  35995. n = a,
  35996. r++
  35997. } while (r < i.length);if (null != n)
  35998. break;
  35999. if (null !== this.parent)
  36000. return this.parent.resolve(e, t)
  36001. } while (null != n);return n
  36002. }
  36003. ,
  36004. c.qn = function(e) {
  36005. var t = []
  36006. , i = e;
  36007. do
  36008. t.unshift(i.name),
  36009. i = i.parent;
  36010. while (null !== i);for (var n = 1; n <= t.length; n++) {
  36011. var r = t.slice(t.length - n);
  36012. if (e === this.resolve(r, e instanceof o.Namespace))
  36013. return r.join(".")
  36014. }
  36015. return e.fqn()
  36016. }
  36017. ,
  36018. c.build = function() {
  36019. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  36020. e = i[n],
  36021. e instanceof l && (t[e.name] = e.build());
  36022. return Object.defineProperty && Object.defineProperty(t, "$options", {
  36023. value: this.buildOpt()
  36024. }),
  36025. t
  36026. }
  36027. ,
  36028. c.buildOpt = function() {
  36029. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  36030. var r = t[i]
  36031. , o = this.options[t[i]];
  36032. e[r] = o
  36033. }
  36034. return e
  36035. }
  36036. ,
  36037. c.getOption = function(e) {
  36038. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  36039. }
  36040. ,
  36041. o.Namespace = l;
  36042. var h = function(t, i, n, r) {
  36043. if (this.type = t,
  36044. this.resolvedType = i,
  36045. this.isMapKey = n,
  36046. this.syntax = r,
  36047. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  36048. throw Error("Invalid map key type: " + t.name)
  36049. }
  36050. , u = h.prototype;
  36051. h.defaultFieldValue = i,
  36052. u.verifyValue = function(i) {
  36053. function r(e, t) {
  36054. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  36055. }
  36056. var o = this;
  36057. switch (this.type) {
  36058. case e.TYPES.int32:
  36059. case e.TYPES.sint32:
  36060. case e.TYPES.sfixed32:
  36061. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  36062. i > 4294967295 ? 0 | i : i;
  36063. case e.TYPES.uint32:
  36064. case e.TYPES.fixed32:
  36065. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  36066. i < 0 ? i >>> 0 : i;
  36067. case e.TYPES.int64:
  36068. case e.TYPES.sint64:
  36069. case e.TYPES.sfixed64:
  36070. if (e.Long)
  36071. try {
  36072. return n(i, !1)
  36073. } catch (e) {
  36074. r(typeof i, e.message)
  36075. }
  36076. else
  36077. r(typeof i, "requires Long.js");
  36078. case e.TYPES.uint64:
  36079. case e.TYPES.fixed64:
  36080. if (e.Long)
  36081. try {
  36082. return n(i, !0)
  36083. } catch (e) {
  36084. r(typeof i, e.message)
  36085. }
  36086. else
  36087. r(typeof i, "requires Long.js");
  36088. case e.TYPES.bool:
  36089. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  36090. i;
  36091. case e.TYPES.float:
  36092. case e.TYPES.double:
  36093. return "number" != typeof i && r(typeof i, "not a number"),
  36094. i;
  36095. case e.TYPES.string:
  36096. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  36097. "" + i;
  36098. case e.TYPES.bytes:
  36099. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  36100. case e.TYPES.enum:
  36101. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  36102. for (l = 0; l < a.length; l++) {
  36103. if (a[l].name == i)
  36104. return a[l].id;
  36105. if (a[l].id == i)
  36106. return a[l].id
  36107. }
  36108. if ("proto3" === this.syntax)
  36109. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  36110. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  36111. i;
  36112. r(i, "not a valid enum value");
  36113. case e.TYPES.group:
  36114. case e.TYPES.message:
  36115. if (i && "object" == typeof i || r(typeof i, "object expected"),
  36116. i instanceof this.resolvedType.clazz)
  36117. return i;
  36118. if (i instanceof e.Builder.Message) {
  36119. var s = {};
  36120. for (var l in i)
  36121. i.hasOwnProperty(l) && (s[l] = i[l]);
  36122. i = s
  36123. }
  36124. return new this.resolvedType.clazz(i)
  36125. }
  36126. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  36127. }
  36128. ,
  36129. u.calculateLength = function(i, n) {
  36130. if (null === n)
  36131. return 0;
  36132. var r;
  36133. switch (this.type) {
  36134. case e.TYPES.int32:
  36135. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  36136. case e.TYPES.uint32:
  36137. return t.calculateVarint32(n);
  36138. case e.TYPES.sint32:
  36139. return t.calculateVarint32(t.zigZagEncode32(n));
  36140. case e.TYPES.fixed32:
  36141. case e.TYPES.sfixed32:
  36142. case e.TYPES.float:
  36143. return 4;
  36144. case e.TYPES.int64:
  36145. case e.TYPES.uint64:
  36146. return t.calculateVarint64(n);
  36147. case e.TYPES.sint64:
  36148. return t.calculateVarint64(t.zigZagEncode64(n));
  36149. case e.TYPES.fixed64:
  36150. case e.TYPES.sfixed64:
  36151. return 8;
  36152. case e.TYPES.bool:
  36153. return 1;
  36154. case e.TYPES.enum:
  36155. return t.calculateVarint32(n);
  36156. case e.TYPES.double:
  36157. return 8;
  36158. case e.TYPES.string:
  36159. return r = t.calculateUTF8Bytes(n),
  36160. t.calculateVarint32(r) + r;
  36161. case e.TYPES.bytes:
  36162. if (n.remaining() < 0)
  36163. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  36164. return t.calculateVarint32(n.remaining()) + n.remaining();
  36165. case e.TYPES.message:
  36166. return r = this.resolvedType.calculate(n),
  36167. t.calculateVarint32(r) + r;
  36168. case e.TYPES.group:
  36169. return r = this.resolvedType.calculate(n),
  36170. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  36171. }
  36172. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  36173. }
  36174. ,
  36175. u.encodeValue = function(i, n, r) {
  36176. if (null === n)
  36177. return r;
  36178. switch (this.type) {
  36179. case e.TYPES.int32:
  36180. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  36181. break;
  36182. case e.TYPES.uint32:
  36183. r.writeVarint32(n);
  36184. break;
  36185. case e.TYPES.sint32:
  36186. r.writeVarint32ZigZag(n);
  36187. break;
  36188. case e.TYPES.fixed32:
  36189. r.writeUint32(n);
  36190. break;
  36191. case e.TYPES.sfixed32:
  36192. r.writeInt32(n);
  36193. break;
  36194. case e.TYPES.int64:
  36195. case e.TYPES.uint64:
  36196. r.writeVarint64(n);
  36197. break;
  36198. case e.TYPES.sint64:
  36199. r.writeVarint64ZigZag(n);
  36200. break;
  36201. case e.TYPES.fixed64:
  36202. r.writeUint64(n);
  36203. break;
  36204. case e.TYPES.sfixed64:
  36205. r.writeInt64(n);
  36206. break;
  36207. case e.TYPES.bool:
  36208. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  36209. break;
  36210. case e.TYPES.enum:
  36211. r.writeVarint32(n);
  36212. break;
  36213. case e.TYPES.float:
  36214. r.writeFloat32(n);
  36215. break;
  36216. case e.TYPES.double:
  36217. r.writeFloat64(n);
  36218. break;
  36219. case e.TYPES.string:
  36220. r.writeVString(n);
  36221. break;
  36222. case e.TYPES.bytes:
  36223. if (n.remaining() < 0)
  36224. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  36225. var o = n.offset;
  36226. r.writeVarint32(n.remaining()),
  36227. r.append(n),
  36228. n.offset = o;
  36229. break;
  36230. case e.TYPES.message:
  36231. var a = (new t).LE();
  36232. this.resolvedType.encode(n, a),
  36233. r.writeVarint32(a.offset),
  36234. r.append(a.flip());
  36235. break;
  36236. case e.TYPES.group:
  36237. this.resolvedType.encode(n, r),
  36238. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  36239. break;
  36240. default:
  36241. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  36242. }
  36243. return r
  36244. }
  36245. ,
  36246. u.decode = function(t, i, n) {
  36247. if (i != this.type.wireType)
  36248. throw Error("Unexpected wire type for element");
  36249. var r, o;
  36250. switch (this.type) {
  36251. case e.TYPES.int32:
  36252. return 0 | t.readVarint32();
  36253. case e.TYPES.uint32:
  36254. return t.readVarint32() >>> 0;
  36255. case e.TYPES.sint32:
  36256. return 0 | t.readVarint32ZigZag();
  36257. case e.TYPES.fixed32:
  36258. return t.readUint32() >>> 0;
  36259. case e.TYPES.sfixed32:
  36260. return 0 | t.readInt32();
  36261. case e.TYPES.int64:
  36262. return t.readVarint64();
  36263. case e.TYPES.uint64:
  36264. return t.readVarint64().toUnsigned();
  36265. case e.TYPES.sint64:
  36266. return t.readVarint64ZigZag();
  36267. case e.TYPES.fixed64:
  36268. return t.readUint64();
  36269. case e.TYPES.sfixed64:
  36270. return t.readInt64();
  36271. case e.TYPES.bool:
  36272. return !!t.readVarint32();
  36273. case e.TYPES.enum:
  36274. return t.readVarint32();
  36275. case e.TYPES.float:
  36276. return t.readFloat();
  36277. case e.TYPES.double:
  36278. return t.readDouble();
  36279. case e.TYPES.string:
  36280. return t.readVString();
  36281. case e.TYPES.bytes:
  36282. if (o = t.readVarint32(),
  36283. t.remaining() < o)
  36284. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  36285. return r = t.clone(),
  36286. r.limit = r.offset + o,
  36287. t.offset += o,
  36288. r;
  36289. case e.TYPES.message:
  36290. return o = t.readVarint32(),
  36291. this.resolvedType.decode(t, o);
  36292. case e.TYPES.group:
  36293. return this.resolvedType.decode(t, -1, n)
  36294. }
  36295. throw Error("[INTERNAL] Illegal decode type")
  36296. }
  36297. ,
  36298. u.valueFromString = function(i) {
  36299. if (!this.isMapKey)
  36300. throw Error("valueFromString() called on non-map-key element");
  36301. switch (this.type) {
  36302. case e.TYPES.int32:
  36303. case e.TYPES.sint32:
  36304. case e.TYPES.sfixed32:
  36305. case e.TYPES.uint32:
  36306. case e.TYPES.fixed32:
  36307. return this.verifyValue(parseInt(i));
  36308. case e.TYPES.int64:
  36309. case e.TYPES.sint64:
  36310. case e.TYPES.sfixed64:
  36311. case e.TYPES.uint64:
  36312. case e.TYPES.fixed64:
  36313. return this.verifyValue(i);
  36314. case e.TYPES.bool:
  36315. return "true" === i;
  36316. case e.TYPES.string:
  36317. return this.verifyValue(i);
  36318. case e.TYPES.bytes:
  36319. return t.fromBinary(i)
  36320. }
  36321. }
  36322. ,
  36323. u.valueToString = function(t) {
  36324. if (!this.isMapKey)
  36325. throw Error("valueToString() called on non-map-key element");
  36326. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  36327. }
  36328. ,
  36329. o.Element = h;
  36330. var d = function(e, t, i, n, r, o) {
  36331. l.call(this, e, t, i, n, o),
  36332. this.className = "Message",
  36333. this.extensions = void 0,
  36334. this.clazz = null,
  36335. this.isGroup = !!r,
  36336. this._fields = null,
  36337. this._fieldsById = null,
  36338. this._fieldsByName = null
  36339. }
  36340. , p = d.prototype = Object.create(l.prototype);
  36341. p.build = function(i) {
  36342. if (this.clazz && !i)
  36343. return this.clazz;
  36344. var n = function(e, i) {
  36345. function n(i, r, o, a) {
  36346. if (null === i || "object" != typeof i) {
  36347. if (a && a instanceof e.Reflect.Enum) {
  36348. var s = e.Reflect.Enum.getName(a.object, i);
  36349. if (null !== s)
  36350. return s
  36351. }
  36352. return i
  36353. }
  36354. if (t.isByteBuffer(i))
  36355. return r ? i.toBase64() : i.toBuffer();
  36356. if (e.Long.isLong(i))
  36357. return o ? i.toString() : e.Long.fromValue(i);
  36358. var l;
  36359. if (Array.isArray(i))
  36360. return l = [],
  36361. i.forEach(function(e, t) {
  36362. l[t] = n(e, r, o, a)
  36363. }),
  36364. l;
  36365. if (l = {},
  36366. i instanceof e.Map) {
  36367. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  36368. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  36369. return l
  36370. }
  36371. var u = i.$type
  36372. , d = void 0;
  36373. for (var p in i)
  36374. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  36375. return l
  36376. }
  36377. var r = i.getChildren(e.Reflect.Message.Field)
  36378. , o = i.getChildren(e.Reflect.Message.OneOf)
  36379. , a = function(n, s) {
  36380. e.Builder.Message.call(this);
  36381. for (var l = 0, c = o.length; l < c; ++l)
  36382. this[o[l].name] = null;
  36383. for (l = 0,
  36384. c = r.length; l < c; ++l) {
  36385. var h = r[l];
  36386. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  36387. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  36388. }
  36389. if (arguments.length > 0) {
  36390. var u;
  36391. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  36392. for (l = 0,
  36393. c = arguments.length; l < c; ++l)
  36394. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  36395. else
  36396. this.$set(n)
  36397. }
  36398. }
  36399. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  36400. s.add = function(t, n, r) {
  36401. var o = i._fieldsByName[t];
  36402. if (!r) {
  36403. if (!o)
  36404. throw Error(this + "#" + t + " is undefined");
  36405. if (!(o instanceof e.Reflect.Message.Field))
  36406. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  36407. if (!o.repeated)
  36408. throw Error(this + "#" + t + " is not a repeated field");
  36409. n = o.verifyValue(n, !0)
  36410. }
  36411. return null === this[t] && (this[t] = []),
  36412. this[t].push(n),
  36413. this
  36414. }
  36415. ,
  36416. s.$add = s.add,
  36417. s.set = function(t, n, r) {
  36418. if (t && "object" == typeof t) {
  36419. r = n;
  36420. for (var o in t)
  36421. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  36422. return this
  36423. }
  36424. var a = i._fieldsByName[t];
  36425. if (r)
  36426. this[t] = n;
  36427. else {
  36428. if (!a)
  36429. throw Error(this + "#" + t + " is not a field: undefined");
  36430. if (!(a instanceof e.Reflect.Message.Field))
  36431. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  36432. this[a.name] = n = a.verifyValue(n)
  36433. }
  36434. if (a && a.oneof) {
  36435. var s = this[a.oneof.name];
  36436. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  36437. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  36438. }
  36439. return this
  36440. }
  36441. ,
  36442. s.$set = s.set,
  36443. s.get = function(t, n) {
  36444. if (n)
  36445. return this[t];
  36446. var r = i._fieldsByName[t];
  36447. if (!(r && r instanceof e.Reflect.Message.Field))
  36448. throw Error(this + "#" + t + " is not a field: undefined");
  36449. if (!(r instanceof e.Reflect.Message.Field))
  36450. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  36451. return this[r.name]
  36452. }
  36453. ,
  36454. s.$get = s.get;
  36455. for (var l = 0; l < r.length; l++) {
  36456. var c = r[l];
  36457. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  36458. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  36459. return e.toUpperCase().replace("_", "")
  36460. });
  36461. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  36462. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  36463. return "_" + e
  36464. })
  36465. , r = function(t, i) {
  36466. return this[e.name] = i ? t : e.verifyValue(t),
  36467. this
  36468. }
  36469. , o = function() {
  36470. return this[e.name]
  36471. };
  36472. null === i.getChild("set" + t) && (s["set" + t] = r),
  36473. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  36474. null === i.getChild("get" + t) && (s["get" + t] = o),
  36475. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  36476. }(c)
  36477. }
  36478. s.encode = function(e, n) {
  36479. "boolean" == typeof e && (n = e,
  36480. e = void 0);
  36481. var r = !1;
  36482. e || (e = new t,
  36483. r = !0);
  36484. var o = e.littleEndian;
  36485. try {
  36486. return i.encode(this, e.LE(), n),
  36487. (r ? e.flip() : e).LE(o)
  36488. } catch (t) {
  36489. throw e.LE(o),
  36490. t
  36491. }
  36492. }
  36493. ,
  36494. a.encode = function(e, t, i) {
  36495. return new a(e).encode(t, i)
  36496. }
  36497. ,
  36498. s.calculate = function() {
  36499. return i.calculate(this)
  36500. }
  36501. ,
  36502. s.encodeDelimited = function(e, n) {
  36503. var r = !1;
  36504. e || (e = new t,
  36505. r = !0);
  36506. var o = (new t).LE();
  36507. return i.encode(this, o, n).flip(),
  36508. e.writeVarint32(o.remaining()),
  36509. e.append(o),
  36510. r ? e.flip() : e
  36511. }
  36512. ,
  36513. s.encodeAB = function() {
  36514. try {
  36515. return this.encode().toArrayBuffer()
  36516. } catch (e) {
  36517. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  36518. e
  36519. }
  36520. }
  36521. ,
  36522. s.toArrayBuffer = s.encodeAB,
  36523. s.encodeNB = function() {
  36524. try {
  36525. return this.encode().toBuffer()
  36526. } catch (e) {
  36527. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  36528. e
  36529. }
  36530. }
  36531. ,
  36532. s.toBuffer = s.encodeNB,
  36533. s.encode64 = function() {
  36534. try {
  36535. return this.encode().toBase64()
  36536. } catch (e) {
  36537. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  36538. e
  36539. }
  36540. }
  36541. ,
  36542. s.toBase64 = s.encode64,
  36543. s.encodeHex = function() {
  36544. try {
  36545. return this.encode().toHex()
  36546. } catch (e) {
  36547. throw e.encoded && (e.encoded = e.encoded.toHex()),
  36548. e
  36549. }
  36550. }
  36551. ,
  36552. s.toHex = s.encodeHex,
  36553. s.toRaw = function(e, t) {
  36554. return n(this, !!e, !!t, this.$type)
  36555. }
  36556. ,
  36557. s.encodeJSON = function() {
  36558. return JSON.stringify(n(this, !0, !0, this.$type))
  36559. }
  36560. ,
  36561. a.decode = function(e, n, r) {
  36562. "string" == typeof n && (r = n,
  36563. n = -1),
  36564. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  36565. e = t.isByteBuffer(e) ? e : t.wrap(e);
  36566. var o = e.littleEndian;
  36567. try {
  36568. var a = i.decode(e.LE());
  36569. return e.LE(o),
  36570. a
  36571. } catch (t) {
  36572. throw e.LE(o),
  36573. t
  36574. }
  36575. }
  36576. ,
  36577. a.decodeDelimited = function(e, n) {
  36578. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  36579. e = t.isByteBuffer(e) ? e : t.wrap(e),
  36580. e.remaining() < 1)
  36581. return null;
  36582. var r = e.offset
  36583. , o = e.readVarint32();
  36584. if (e.remaining() < o)
  36585. return e.offset = r,
  36586. null;
  36587. try {
  36588. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  36589. return e.offset += o,
  36590. a
  36591. } catch (t) {
  36592. throw e.offset += o,
  36593. t
  36594. }
  36595. }
  36596. ,
  36597. a.decode64 = function(e) {
  36598. return a.decode(e, "base64")
  36599. }
  36600. ,
  36601. a.decodeHex = function(e) {
  36602. return a.decode(e, "hex")
  36603. }
  36604. ,
  36605. a.decodeJSON = function(e) {
  36606. return new a(JSON.parse(e))
  36607. }
  36608. ,
  36609. s.toString = function() {
  36610. return i.toString()
  36611. }
  36612. ;
  36613. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  36614. value: i.buildOpt()
  36615. }),
  36616. Object.defineProperty(s, "$options", {
  36617. value: a.$options
  36618. }),
  36619. Object.defineProperty(a, "$type", {
  36620. value: i
  36621. }),
  36622. Object.defineProperty(s, "$type", {
  36623. value: i
  36624. })),
  36625. a
  36626. }(e, this);
  36627. this._fields = [],
  36628. this._fieldsById = {},
  36629. this._fieldsByName = {};
  36630. for (var r, o = 0, a = this.children.length; o < a; o++)
  36631. if (r = this.children[o],
  36632. r instanceof A || r instanceof d || r instanceof E) {
  36633. if (n.hasOwnProperty(r.name))
  36634. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  36635. n[r.name] = r.build()
  36636. } else if (r instanceof d.Field)
  36637. r.build(),
  36638. this._fields.push(r),
  36639. this._fieldsById[r.id] = r,
  36640. this._fieldsByName[r.name] = r;
  36641. else if (!(r instanceof d.OneOf || r instanceof I))
  36642. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  36643. return this.clazz = n
  36644. }
  36645. ,
  36646. p.encode = function(e, t, i) {
  36647. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  36648. n = this._fields[a],
  36649. r = e[n.name],
  36650. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36651. if (null !== o) {
  36652. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36653. throw l.encoded = t,
  36654. l
  36655. }
  36656. return t
  36657. }
  36658. ,
  36659. p.calculate = function(e) {
  36660. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36661. if (t = this._fields[r],
  36662. i = e[t.name],
  36663. t.required && null === i)
  36664. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36665. n += t.calculate(i, e)
  36666. }
  36667. return n
  36668. }
  36669. ,
  36670. p.decode = function(t, i, n) {
  36671. i = "number" == typeof i ? i : -1;
  36672. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36673. if (o = t.readVarint32(),
  36674. a = 7 & o,
  36675. s = o >>> 3,
  36676. a === e.WIRE_TYPES.ENDGROUP) {
  36677. if (s !== n)
  36678. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36679. break
  36680. }
  36681. if (l = this._fieldsById[s]) {
  36682. if (l.repeated && !l.options.packed)
  36683. h[l.name].push(l.decode(a, t));
  36684. else if (l.map) {
  36685. var u = l.decode(a, t);
  36686. h[l.name].set(u[0], u[1])
  36687. } else if (h[l.name] = l.decode(a, t),
  36688. l.oneof) {
  36689. var d = h[l.oneof.name];
  36690. null !== d && d !== l.name && (h[d] = null),
  36691. h[l.oneof.name] = l.name
  36692. }
  36693. } else
  36694. switch (a) {
  36695. case e.WIRE_TYPES.VARINT:
  36696. t.readVarint32();
  36697. break;
  36698. case e.WIRE_TYPES.BITS32:
  36699. t.offset += 4;
  36700. break;
  36701. case e.WIRE_TYPES.BITS64:
  36702. t.offset += 8;
  36703. break;
  36704. case e.WIRE_TYPES.LDELIM:
  36705. var p = t.readVarint32();
  36706. t.offset += p;
  36707. break;
  36708. case e.WIRE_TYPES.STARTGROUP:
  36709. for (; r(s, t); )
  36710. ;
  36711. break;
  36712. default:
  36713. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36714. }
  36715. }
  36716. for (var f = 0, g = this._fields.length; f < g; ++f)
  36717. if (l = this._fields[f],
  36718. null === h[l.name])
  36719. if ("proto3" === this.syntax)
  36720. h[l.name] = l.defaultValue;
  36721. else {
  36722. if (l.required) {
  36723. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36724. throw m.decoded = h,
  36725. m
  36726. }
  36727. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36728. }
  36729. return h
  36730. }
  36731. ,
  36732. o.Message = d;
  36733. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36734. a.call(this, t, i, s),
  36735. this.className = "Message.Field",
  36736. this.required = "required" === n,
  36737. this.repeated = "repeated" === n,
  36738. this.map = "map" === n,
  36739. this.keyType = r || null,
  36740. this.type = o,
  36741. this.resolvedType = null,
  36742. this.id = l,
  36743. this.options = c || {},
  36744. this.defaultValue = null,
  36745. this.oneof = h || null,
  36746. this.syntax = u || "proto2",
  36747. this.originalName = this.name,
  36748. this.element = null,
  36749. this.keyElement = null,
  36750. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36751. }
  36752. , g = f.prototype = Object.create(a.prototype);
  36753. g.build = function() {
  36754. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36755. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36756. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  36757. }
  36758. ,
  36759. g.verifyValue = function(t, i) {
  36760. function n(e, t) {
  36761. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36762. }
  36763. i = i || !1;
  36764. var r = this;
  36765. if (null === t)
  36766. return this.required && n(typeof t, "required"),
  36767. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36768. null;
  36769. var o;
  36770. if (this.repeated && !i) {
  36771. Array.isArray(t) || (t = [t]);
  36772. var a = [];
  36773. for (o = 0; o < t.length; o++)
  36774. a.push(this.element.verifyValue(t[o]));
  36775. return a
  36776. }
  36777. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36778. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36779. this.element.verifyValue(t))
  36780. }
  36781. ,
  36782. g.hasWirePresence = function(t, i) {
  36783. if ("proto3" !== this.syntax)
  36784. return null !== t;
  36785. if (this.oneof && i[this.oneof.name] === this.name)
  36786. return !0;
  36787. switch (this.type) {
  36788. case e.TYPES.int32:
  36789. case e.TYPES.sint32:
  36790. case e.TYPES.sfixed32:
  36791. case e.TYPES.uint32:
  36792. case e.TYPES.fixed32:
  36793. return 0 !== t;
  36794. case e.TYPES.int64:
  36795. case e.TYPES.sint64:
  36796. case e.TYPES.sfixed64:
  36797. case e.TYPES.uint64:
  36798. case e.TYPES.fixed64:
  36799. return 0 !== t.low || 0 !== t.high;
  36800. case e.TYPES.bool:
  36801. return t;
  36802. case e.TYPES.float:
  36803. case e.TYPES.double:
  36804. return 0 !== t;
  36805. case e.TYPES.string:
  36806. return t.length > 0;
  36807. case e.TYPES.bytes:
  36808. return t.remaining() > 0;
  36809. case e.TYPES.enum:
  36810. return 0 !== t;
  36811. case e.TYPES.message:
  36812. return null !== t;
  36813. default:
  36814. return !0
  36815. }
  36816. }
  36817. ,
  36818. g.encode = function(i, n, r) {
  36819. if (null === this.type || "object" != typeof this.type)
  36820. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36821. if (null === i || this.repeated && 0 == i.length)
  36822. return n;
  36823. try {
  36824. if (this.repeated) {
  36825. var o;
  36826. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36827. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36828. n.ensureCapacity(n.offset += 1);
  36829. var a = n.offset;
  36830. for (o = 0; o < i.length; o++)
  36831. this.element.encodeValue(this.id, i[o], n);
  36832. var s = n.offset - a
  36833. , l = t.calculateVarint32(s);
  36834. if (l > 1) {
  36835. var c = n.slice(a, n.offset);
  36836. a += l - 1,
  36837. n.offset = a,
  36838. n.append(c)
  36839. }
  36840. n.writeVarint32(s, a - l)
  36841. } else
  36842. for (o = 0; o < i.length; o++)
  36843. n.writeVarint32(this.id << 3 | this.type.wireType),
  36844. this.element.encodeValue(this.id, i[o], n)
  36845. } else
  36846. this.map ? i.forEach(function(i, r, o) {
  36847. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36848. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36849. n.writeVarint32(a),
  36850. n.writeVarint32(8 | this.keyType.wireType),
  36851. this.keyElement.encodeValue(1, r, n),
  36852. n.writeVarint32(16 | this.type.wireType),
  36853. this.element.encodeValue(2, i, n)
  36854. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36855. this.element.encodeValue(this.id, i, n))
  36856. } catch (e) {
  36857. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36858. }
  36859. return n
  36860. }
  36861. ,
  36862. g.calculate = function(i, n) {
  36863. if (i = this.verifyValue(i),
  36864. null === this.type || "object" != typeof this.type)
  36865. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36866. if (null === i || this.repeated && 0 == i.length)
  36867. return 0;
  36868. var r = 0;
  36869. try {
  36870. if (this.repeated) {
  36871. var o, a;
  36872. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36873. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36874. a = 0,
  36875. o = 0; o < i.length; o++)
  36876. a += this.element.calculateLength(this.id, i[o]);
  36877. r += t.calculateVarint32(a),
  36878. r += a
  36879. } else
  36880. for (o = 0; o < i.length; o++)
  36881. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36882. r += this.element.calculateLength(this.id, i[o])
  36883. } else
  36884. this.map ? i.forEach(function(i, n, o) {
  36885. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36886. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36887. r += t.calculateVarint32(a),
  36888. r += a
  36889. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36890. r += this.element.calculateLength(this.id, i))
  36891. } catch (e) {
  36892. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36893. }
  36894. return r
  36895. }
  36896. ,
  36897. g.decode = function(t, i, n) {
  36898. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  36899. if (!a)
  36900. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36901. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36902. o = i.readVarint32(),
  36903. o = i.offset + o;
  36904. for (var s = []; i.offset < o; )
  36905. s.push(this.decode(this.type.wireType, i, !0));
  36906. return s
  36907. }
  36908. if (this.map) {
  36909. var l = h.defaultFieldValue(this.keyType);
  36910. if (r = h.defaultFieldValue(this.type),
  36911. o = i.readVarint32(),
  36912. i.remaining() < o)
  36913. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36914. var c = i.clone();
  36915. for (c.limit = c.offset + o,
  36916. i.offset += o; c.remaining() > 0; ) {
  36917. var u = c.readVarint32();
  36918. t = 7 & u;
  36919. var d = u >>> 3;
  36920. if (1 === d)
  36921. l = this.keyElement.decode(c, t, d);
  36922. else {
  36923. if (2 !== d)
  36924. throw Error("Unexpected tag in map field key/value submessage");
  36925. r = this.element.decode(c, t, d)
  36926. }
  36927. }
  36928. return [l, r]
  36929. }
  36930. return this.element.decode(i, t, this.id)
  36931. }
  36932. ,
  36933. o.Message.Field = f;
  36934. var m = function(e, t, i, n, r, o, a) {
  36935. f.call(this, e, t, i, null, n, r, o, a),
  36936. this.extension
  36937. };
  36938. m.prototype = Object.create(f.prototype),
  36939. o.Message.ExtensionField = m;
  36940. var v = function(e, t, i) {
  36941. a.call(this, e, t, i),
  36942. this.fields = []
  36943. };
  36944. o.Message.OneOf = v;
  36945. var A = function(e, t, i, n, r) {
  36946. l.call(this, e, t, i, n, r),
  36947. this.className = "Enum",
  36948. this.object = null
  36949. };
  36950. A.getName = function(e, t) {
  36951. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36952. if (e[i = n[r]] === t)
  36953. return i;
  36954. return null
  36955. }
  36956. ;
  36957. var y = A.prototype = Object.create(l.prototype);
  36958. y.build = function(t) {
  36959. if (this.object && !t)
  36960. return this.object;
  36961. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36962. i[n[r].name] = n[r].id;
  36963. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36964. value: this.buildOpt(),
  36965. enumerable: !1
  36966. }),
  36967. this.object = i
  36968. }
  36969. ,
  36970. o.Enum = A;
  36971. var C = function(e, t, i, n) {
  36972. a.call(this, e, t, i),
  36973. this.className = "Enum.Value",
  36974. this.id = n
  36975. };
  36976. C.prototype = Object.create(a.prototype),
  36977. o.Enum.Value = C;
  36978. var I = function(e, t, i, n) {
  36979. a.call(this, e, t, i),
  36980. this.field = n
  36981. };
  36982. I.prototype = Object.create(a.prototype),
  36983. o.Extension = I;
  36984. var E = function(e, t, i, n) {
  36985. l.call(this, e, t, i, n),
  36986. this.className = "Service",
  36987. this.clazz = null
  36988. }
  36989. , b = E.prototype = Object.create(l.prototype);
  36990. b.build = function(i) {
  36991. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36992. for (var n = function(t) {
  36993. e.Builder.Service.call(this),
  36994. this.rpcImpl = t || function(e, t, i) {
  36995. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36996. }
  36997. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36998. !function(e) {
  36999. r[e.name] = function(n, r) {
  37000. try {
  37001. try {
  37002. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  37003. } catch (e) {
  37004. if (!(e instanceof TypeError))
  37005. throw e
  37006. }
  37007. if (null === n || "object" != typeof n)
  37008. throw Error("Illegal arguments");
  37009. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  37010. this.rpcImpl(e.fqn(), n, function(t, n) {
  37011. if (t)
  37012. return void r(t);
  37013. null === n && (n = "");
  37014. try {
  37015. n = e.resolvedResponseType.clazz.decode(n)
  37016. } catch (e) {}
  37017. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  37018. })
  37019. } catch (e) {
  37020. setTimeout(r.bind(this, e), 0)
  37021. }
  37022. }
  37023. ,
  37024. n[e.name] = function(t, i, r) {
  37025. new n(t)[e.name](i, r)
  37026. }
  37027. ,
  37028. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  37029. value: e.buildOpt()
  37030. }),
  37031. Object.defineProperty(r[e.name], "$options", {
  37032. value: n[e.name].$options
  37033. }))
  37034. }(o[a]);
  37035. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  37036. value: i.buildOpt()
  37037. }),
  37038. Object.defineProperty(r, "$options", {
  37039. value: n.$options
  37040. }),
  37041. Object.defineProperty(n, "$type", {
  37042. value: i
  37043. }),
  37044. Object.defineProperty(r, "$type", {
  37045. value: i
  37046. })),
  37047. n
  37048. }(e, this)
  37049. }
  37050. ,
  37051. o.Service = E;
  37052. var w = function(e, t, i, n) {
  37053. a.call(this, e, t, i),
  37054. this.className = "Service.Method",
  37055. this.options = n || {}
  37056. }
  37057. , _ = w.prototype = Object.create(a.prototype);
  37058. _.buildOpt = c.buildOpt,
  37059. o.Service.Method = w;
  37060. var T = function(e, t, i, n, r, o, a, s) {
  37061. w.call(this, e, t, i, s),
  37062. this.className = "Service.RPCMethod",
  37063. this.requestName = n,
  37064. this.responseName = r,
  37065. this.requestStream = o,
  37066. this.responseStream = a,
  37067. this.resolvedRequestType = null,
  37068. this.resolvedResponseType = null
  37069. };
  37070. return T.prototype = Object.create(w.prototype),
  37071. o.Service.RPCMethod = T,
  37072. o
  37073. }(r),
  37074. r.Builder = function(t, i, n) {
  37075. function r(e) {
  37076. e.messages && e.messages.forEach(function(t) {
  37077. t.syntax = e.syntax,
  37078. r(t)
  37079. }),
  37080. e.enums && e.enums.forEach(function(t) {
  37081. t.syntax = e.syntax
  37082. })
  37083. }
  37084. var o = function(e) {
  37085. this.ns = new n.Namespace(this,null,""),
  37086. this.ptr = this.ns,
  37087. this.resolved = !1,
  37088. this.result = null,
  37089. this.files = {},
  37090. this.importRoot = null,
  37091. this.options = e || {}
  37092. }
  37093. , a = o.prototype;
  37094. return o.isMessage = function(e) {
  37095. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  37096. }
  37097. ,
  37098. o.isMessageField = function(e) {
  37099. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  37100. }
  37101. ,
  37102. o.isEnum = function(e) {
  37103. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  37104. }
  37105. ,
  37106. o.isService = function(e) {
  37107. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  37108. }
  37109. ,
  37110. o.isExtend = function(e) {
  37111. return "string" == typeof e.ref
  37112. }
  37113. ,
  37114. a.reset = function() {
  37115. return this.ptr = this.ns,
  37116. this
  37117. }
  37118. ,
  37119. a.define = function(e) {
  37120. if ("string" != typeof e || !i.TYPEREF.test(e))
  37121. throw Error("illegal namespace: " + e);
  37122. return e.split(".").forEach(function(e) {
  37123. var t = this.ptr.getChild(e);
  37124. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  37125. this.ptr = t
  37126. }, this),
  37127. this
  37128. }
  37129. ,
  37130. a.create = function(e) {
  37131. if (!e)
  37132. return this;
  37133. if (Array.isArray(e)) {
  37134. if (0 === e.length)
  37135. return this;
  37136. e = e.slice()
  37137. } else
  37138. e = [e];
  37139. for (var i = [e]; i.length > 0; ) {
  37140. if (e = i.pop(),
  37141. !Array.isArray(e))
  37142. throw Error("not a valid namespace: " + JSON.stringify(e));
  37143. for (; e.length > 0; ) {
  37144. var r = e.shift();
  37145. if (o.isMessage(r)) {
  37146. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  37147. , s = {};
  37148. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  37149. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  37150. }, this),
  37151. r.fields && r.fields.forEach(function(e) {
  37152. if (null !== a.getChild(0 | e.id))
  37153. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  37154. if (e.options && "object" != typeof e.options)
  37155. throw Error("illegal field options in " + a.name + "#" + e.name);
  37156. var t = null;
  37157. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  37158. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  37159. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  37160. t && t.fields.push(e),
  37161. a.addChild(e)
  37162. }, this);
  37163. var l = [];
  37164. if (r.enums && r.enums.forEach(function(e) {
  37165. l.push(e)
  37166. }),
  37167. r.messages && r.messages.forEach(function(e) {
  37168. l.push(e)
  37169. }),
  37170. r.services && r.services.forEach(function(e) {
  37171. l.push(e)
  37172. }),
  37173. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  37174. this.ptr.addChild(a),
  37175. l.length > 0) {
  37176. i.push(e),
  37177. e = l,
  37178. l = null,
  37179. this.ptr = a,
  37180. a = null;
  37181. continue
  37182. }
  37183. l = null
  37184. } else if (o.isEnum(r))
  37185. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  37186. r.values.forEach(function(e) {
  37187. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  37188. }, this),
  37189. this.ptr.addChild(a);
  37190. else if (o.isService(r))
  37191. a = new n.Service(this,this.ptr,r.name,r.options),
  37192. Object.keys(r.rpc).forEach(function(e) {
  37193. var t = r.rpc[e];
  37194. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  37195. }, this),
  37196. this.ptr.addChild(a);
  37197. else {
  37198. if (!o.isExtend(r))
  37199. throw Error("not a valid definition: " + JSON.stringify(r));
  37200. if (a = this.ptr.resolve(r.ref, !0))
  37201. r.fields.forEach(function(e) {
  37202. if (null !== a.getChild(0 | e.id))
  37203. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  37204. if (a.extensions) {
  37205. var i = !1;
  37206. if (a.extensions.forEach(function(t) {
  37207. e.id >= t[0] && e.id <= t[1] && (i = !0)
  37208. }),
  37209. !i)
  37210. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  37211. }
  37212. var r = e.name;
  37213. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  37214. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  37215. , s = new n.Extension(this,this.ptr,e.name,o);
  37216. o.extension = s,
  37217. this.ptr.addChild(s),
  37218. a.addChild(o)
  37219. }, this);
  37220. else if (!/\.?google\.protobuf\./.test(r.ref))
  37221. throw Error("extended message " + r.ref + " is not defined")
  37222. }
  37223. r = null,
  37224. a = null
  37225. }
  37226. e = null,
  37227. this.ptr = this.ptr.parent
  37228. }
  37229. return this.resolved = !1,
  37230. this.result = null,
  37231. this
  37232. }
  37233. ,
  37234. a.import = function(i, n) {
  37235. var o = "/";
  37236. if ("string" == typeof n) {
  37237. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  37238. this.files[n] === !0)
  37239. return this.reset();
  37240. this.files[n] = !0
  37241. } else if ("object" == typeof n) {
  37242. var a = n.root;
  37243. t.Util.IS_NODE && (a = e("path").resolve(a)),
  37244. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  37245. var s = a + o + n.file;
  37246. if (this.files[s] === !0)
  37247. return this.reset();
  37248. this.files[s] = !0
  37249. }
  37250. if (i.imports && i.imports.length > 0) {
  37251. var l, c = !1;
  37252. "object" == typeof n ? (this.importRoot = n.root,
  37253. c = !0,
  37254. l = this.importRoot,
  37255. n = n.file,
  37256. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  37257. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  37258. o = "\\") : l = "." : l = null;
  37259. for (var h = 0; h < i.imports.length; h++)
  37260. if ("string" == typeof i.imports[h]) {
  37261. if (!l)
  37262. throw Error("cannot determine import root");
  37263. var u = i.imports[h];
  37264. if ("google/protobuf/descriptor.proto" === u)
  37265. continue;
  37266. if (u = l + o + u,
  37267. this.files[u] === !0)
  37268. continue;
  37269. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  37270. var d = t.Util.fetch(u);
  37271. if (null === d)
  37272. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  37273. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  37274. } else
  37275. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  37276. return t + "_import" + h + "." + i
  37277. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  37278. c && (this.importRoot = null)
  37279. }
  37280. i.package && this.define(i.package),
  37281. i.syntax && r(i);
  37282. var p = this.ptr;
  37283. return i.options && Object.keys(i.options).forEach(function(e) {
  37284. p.options[e] = i.options[e]
  37285. }),
  37286. i.messages && (this.create(i.messages),
  37287. this.ptr = p),
  37288. i.enums && (this.create(i.enums),
  37289. this.ptr = p),
  37290. i.services && (this.create(i.services),
  37291. this.ptr = p),
  37292. i.extends && this.create(i.extends),
  37293. this.reset()
  37294. }
  37295. ,
  37296. a.resolveAll = function() {
  37297. var e;
  37298. if (null == this.ptr || "object" == typeof this.ptr.type)
  37299. return this;
  37300. if (this.ptr instanceof n.Namespace)
  37301. this.ptr.children.forEach(function(e) {
  37302. this.ptr = e,
  37303. this.resolveAll()
  37304. }, this);
  37305. else if (this.ptr instanceof n.Message.Field) {
  37306. if (i.TYPE.test(this.ptr.type))
  37307. this.ptr.type = t.TYPES[this.ptr.type];
  37308. else {
  37309. if (!i.TYPEREF.test(this.ptr.type))
  37310. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  37311. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  37312. !e)
  37313. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  37314. if (this.ptr.resolvedType = e,
  37315. e instanceof n.Enum) {
  37316. if (this.ptr.type = t.TYPES.enum,
  37317. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  37318. throw Error("proto3 message cannot reference proto2 enum")
  37319. } else {
  37320. if (!(e instanceof n.Message))
  37321. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  37322. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  37323. }
  37324. }
  37325. if (this.ptr.map) {
  37326. if (!i.TYPE.test(this.ptr.keyType))
  37327. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  37328. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  37329. }
  37330. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  37331. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  37332. throw Error("illegal service type in " + this.ptr.toString(!0));
  37333. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  37334. !(e && e instanceof t.Reflect.Message))
  37335. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  37336. if (this.ptr.resolvedRequestType = e,
  37337. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  37338. !(e && e instanceof t.Reflect.Message))
  37339. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  37340. this.ptr.resolvedResponseType = e
  37341. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  37342. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  37343. return this.reset()
  37344. }
  37345. ,
  37346. a.build = function(e) {
  37347. if (this.reset(),
  37348. this.resolved || (this.resolveAll(),
  37349. this.resolved = !0,
  37350. this.result = null),
  37351. null === this.result && (this.result = this.ns.build()),
  37352. !e)
  37353. return this.result;
  37354. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  37355. if (!i[t[n]]) {
  37356. i = null;
  37357. break
  37358. }
  37359. i = i[t[n]]
  37360. }
  37361. return i
  37362. }
  37363. ,
  37364. a.lookup = function(e, t) {
  37365. return e ? this.ns.resolve(e, t) : this.ns
  37366. }
  37367. ,
  37368. a.toString = function() {
  37369. return "Builder"
  37370. }
  37371. ,
  37372. o.Message = function() {}
  37373. ,
  37374. o.Enum = function() {}
  37375. ,
  37376. o.Service = function() {}
  37377. ,
  37378. o
  37379. }(r, r.Lang, r.Reflect),
  37380. r.Map = function(e, t) {
  37381. function i(e) {
  37382. var t = 0;
  37383. return {
  37384. next: function() {
  37385. return t < e.length ? {
  37386. done: !1,
  37387. value: e[t++]
  37388. } : {
  37389. done: !0
  37390. }
  37391. }
  37392. }
  37393. }
  37394. var n = function(e, i) {
  37395. if (!e.map)
  37396. throw Error("field is not a map");
  37397. if (this.field = e,
  37398. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  37399. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  37400. this.map = {},
  37401. Object.defineProperty(this, "size", {
  37402. get: function() {
  37403. return Object.keys(this.map).length
  37404. }
  37405. }),
  37406. i)
  37407. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  37408. var o = this.keyElem.valueFromString(n[r])
  37409. , a = this.valueElem.verifyValue(i[n[r]]);
  37410. this.map[this.keyElem.valueToString(o)] = {
  37411. key: o,
  37412. value: a
  37413. }
  37414. }
  37415. }
  37416. , r = n.prototype;
  37417. return r.clear = function() {
  37418. this.map = {}
  37419. }
  37420. ,
  37421. r.delete = function(e) {
  37422. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  37423. , i = t in this.map;
  37424. return delete this.map[t],
  37425. i
  37426. }
  37427. ,
  37428. r.entries = function() {
  37429. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  37430. t.push([(e = this.map[n[r]]).key, e.value]);
  37431. return i(t)
  37432. }
  37433. ,
  37434. r.keys = function() {
  37435. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37436. e.push(this.map[t[n]].key);
  37437. return i(e)
  37438. }
  37439. ,
  37440. r.values = function() {
  37441. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37442. e.push(this.map[t[n]].value);
  37443. return i(e)
  37444. }
  37445. ,
  37446. r.forEach = function(e, t) {
  37447. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  37448. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  37449. }
  37450. ,
  37451. r.set = function(e, t) {
  37452. var i = this.keyElem.verifyValue(e)
  37453. , n = this.valueElem.verifyValue(t);
  37454. return this.map[this.keyElem.valueToString(i)] = {
  37455. key: i,
  37456. value: n
  37457. },
  37458. this
  37459. }
  37460. ,
  37461. r.get = function(e) {
  37462. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37463. if (t in this.map)
  37464. return this.map[t].value
  37465. }
  37466. ,
  37467. r.has = function(e) {
  37468. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37469. return t in this.map
  37470. }
  37471. ,
  37472. n
  37473. }(r, r.Reflect),
  37474. r.loadProto = function(e, t, i) {
  37475. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37476. t = void 0),
  37477. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  37478. }
  37479. ,
  37480. r.protoFromString = r.loadProto,
  37481. r.loadProtoFile = function(e, t, i) {
  37482. if (t && "object" == typeof t ? (i = t,
  37483. t = null) : t && "function" == typeof t || (t = null),
  37484. t)
  37485. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37486. if (null === n)
  37487. return void t(Error("Failed to fetch file"));
  37488. try {
  37489. t(null, r.loadProto(n, i, e))
  37490. } catch (e) {
  37491. t(e)
  37492. }
  37493. });
  37494. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37495. return null === n ? null : r.loadProto(n, i, e)
  37496. }
  37497. ,
  37498. r.protoFromFile = r.loadProtoFile,
  37499. r.newBuilder = function(e) {
  37500. return e = e || {},
  37501. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  37502. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  37503. new r.Builder(e)
  37504. }
  37505. ,
  37506. r.loadJson = function(e, t, i) {
  37507. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37508. t = null),
  37509. t && "object" == typeof t || (t = r.newBuilder()),
  37510. "string" == typeof e && (e = JSON.parse(e)),
  37511. t.import(e, i),
  37512. t.resolveAll(),
  37513. t
  37514. }
  37515. ,
  37516. r.loadJsonFile = function(e, t, i) {
  37517. if (t && "object" == typeof t ? (i = t,
  37518. t = null) : t && "function" == typeof t || (t = null),
  37519. t)
  37520. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37521. if (null === n)
  37522. return void t(Error("Failed to fetch file"));
  37523. try {
  37524. t(null, r.loadJson(JSON.parse(n), i, e))
  37525. } catch (e) {
  37526. t(e)
  37527. }
  37528. });
  37529. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37530. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  37531. }
  37532. ,
  37533. r
  37534. })
  37535. }
  37536. ).call(this, e("_process"))
  37537. }
  37538. , {
  37539. _process: 203,
  37540. bytebuffer: 215,
  37541. fs: 197,
  37542. path: 197
  37543. }],
  37544. 215: [function(e, t, i) {//bytebuffer
  37545. !function(i, n) {
  37546. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  37547. var t;
  37548. try {
  37549. t = e("long")
  37550. } catch (e) {}
  37551. return n(t)
  37552. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  37553. }(this, function(e) {
  37554. "use strict";
  37555. function t(e) {
  37556. var t = 0;
  37557. return function() {
  37558. return t < e.length ? e.charCodeAt(t++) : null
  37559. }
  37560. }
  37561. function i() {
  37562. var e = []
  37563. , t = [];
  37564. return function() {
  37565. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  37566. e.length = 0),
  37567. void Array.prototype.push.apply(e, arguments))
  37568. }
  37569. }
  37570. function n(e, t, i, n, r) {
  37571. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  37572. for (u += d,
  37573. o = p & (1 << -h) - 1,
  37574. p >>= -h,
  37575. h += s; h > 0; o = 256 * o + e[t + u],
  37576. u += d,
  37577. h -= 8)
  37578. ;
  37579. for (a = o & (1 << -h) - 1,
  37580. o >>= -h,
  37581. h += n; h > 0; a = 256 * a + e[t + u],
  37582. u += d,
  37583. h -= 8)
  37584. ;
  37585. if (0 === o)
  37586. o = 1 - c;
  37587. else {
  37588. if (o === l)
  37589. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  37590. a += Math.pow(2, n),
  37591. o -= c
  37592. }
  37593. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  37594. }
  37595. function r(e, t, i, n, r, o) {
  37596. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  37597. for (t = Math.abs(t),
  37598. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  37599. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  37600. t * (l = Math.pow(2, -a)) < 1 && (a--,
  37601. l *= 2),
  37602. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  37603. t * l >= 2 && (a++,
  37604. l /= 2),
  37605. a + u >= h ? (s = 0,
  37606. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  37607. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  37608. a = 0)); r >= 8; e[i + p] = 255 & s,
  37609. p += f,
  37610. s /= 256,
  37611. r -= 8)
  37612. ;
  37613. for (a = a << r | s,
  37614. c += r; c > 0; e[i + p] = 255 & a,
  37615. p += f,
  37616. a /= 256,
  37617. c -= 8)
  37618. ;
  37619. e[i + p - f] |= 128 * g
  37620. }
  37621. var o = function(e, t, i) {
  37622. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  37623. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  37624. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  37625. !i) {
  37626. if (e |= 0,
  37627. e < 0)
  37628. throw RangeError("Illegal capacity");
  37629. t = !!t,
  37630. i = !!i
  37631. }
  37632. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  37633. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  37634. this.offset = 0,
  37635. this.markedOffset = -1,
  37636. this.limit = e,
  37637. this.littleEndian = t,
  37638. this.noAssert = i
  37639. };
  37640. o.VERSION = "5.0.1",
  37641. o.LITTLE_ENDIAN = !0,
  37642. o.BIG_ENDIAN = !1,
  37643. o.DEFAULT_CAPACITY = 16,
  37644. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  37645. o.DEFAULT_NOASSERT = !1,
  37646. o.Long = e || null;
  37647. var a = o.prototype;
  37648. a.__isByteBuffer__,
  37649. Object.defineProperty(a, "__isByteBuffer__", {
  37650. value: !0,
  37651. enumerable: !1,
  37652. configurable: !1
  37653. });
  37654. var s = new ArrayBuffer(0)
  37655. , l = String.fromCharCode;
  37656. o.accessor = function() {
  37657. return Uint8Array
  37658. }
  37659. ,
  37660. o.allocate = function(e, t, i) {
  37661. return new o(e,t,i)
  37662. }
  37663. ,
  37664. o.concat = function(e, t, i, n) {
  37665. "boolean" != typeof t && "string" == typeof t || (n = i,
  37666. i = t,
  37667. t = void 0);
  37668. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37669. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37670. r = e[s].limit - e[s].offset,
  37671. r > 0 && (a += r);
  37672. if (0 === a)
  37673. return new o(0,i,n);
  37674. var c, h = new o(a,i,n);
  37675. for (s = 0; s < l; )
  37676. c = e[s++],
  37677. r = c.limit - c.offset,
  37678. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37679. h.offset += r);
  37680. return h.limit = h.offset,
  37681. h.offset = 0,
  37682. h
  37683. }
  37684. ,
  37685. o.isByteBuffer = function(e) {
  37686. return (e && e.__isByteBuffer__) === !0
  37687. }
  37688. ,
  37689. o.type = function() {
  37690. return ArrayBuffer
  37691. }
  37692. ,
  37693. o.wrap = function(e, t, i, n) {
  37694. if ("string" != typeof t && (n = i,
  37695. i = t,
  37696. t = void 0),
  37697. "string" == typeof e)
  37698. switch ("undefined" == typeof t && (t = "utf8"),
  37699. t) {
  37700. case "base64":
  37701. return o.fromBase64(e, i);
  37702. case "hex":
  37703. return o.fromHex(e, i);
  37704. case "binary":
  37705. return o.fromBinary(e, i);
  37706. case "utf8":
  37707. return o.fromUTF8(e, i);
  37708. case "debug":
  37709. return o.fromDebug(e, i);
  37710. default:
  37711. throw Error("Unsupported encoding: " + t)
  37712. }
  37713. if (null === e || "object" != typeof e)
  37714. throw TypeError("Illegal buffer");
  37715. var r;
  37716. if (o.isByteBuffer(e))
  37717. return r = a.clone.call(e),
  37718. r.markedOffset = -1,
  37719. r;
  37720. if (e instanceof Uint8Array)
  37721. r = new o(0,i,n),
  37722. e.length > 0 && (r.buffer = e.buffer,
  37723. r.offset = e.byteOffset,
  37724. r.limit = e.byteOffset + e.byteLength,
  37725. r.view = new Uint8Array(e.buffer));
  37726. else if (e instanceof ArrayBuffer)
  37727. r = new o(0,i,n),
  37728. e.byteLength > 0 && (r.buffer = e,
  37729. r.offset = 0,
  37730. r.limit = e.byteLength,
  37731. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37732. else {
  37733. if ("[object Array]" !== Object.prototype.toString.call(e))
  37734. throw TypeError("Illegal buffer");
  37735. r = new o(e.length,i,n),
  37736. r.limit = e.length;
  37737. for (var s = 0; s < e.length; ++s)
  37738. r.view[s] = e[s]
  37739. }
  37740. return r
  37741. }
  37742. ,
  37743. a.writeBitSet = function(e, t) {
  37744. var i = "undefined" == typeof t;
  37745. if (i && (t = this.offset),
  37746. !this.noAssert) {
  37747. if (!(e instanceof Array))
  37748. throw TypeError("Illegal BitSet: Not an array");
  37749. if ("number" != typeof t || t % 1 !== 0)
  37750. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37751. if (t >>>= 0,
  37752. t < 0 || t + 0 > this.buffer.byteLength)
  37753. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37754. }
  37755. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37756. for (t += this.writeVarint32(o, t); a--; )
  37757. n = 1 & !!e[s++] | (1 & !!e[s++]) << 1 | (1 & !!e[s++]) << 2 | (1 & !!e[s++]) << 3 | (1 & !!e[s++]) << 4 | (1 & !!e[s++]) << 5 | (1 & !!e[s++]) << 6 | (1 & !!e[s++]) << 7,
  37758. this.writeByte(n, t++);
  37759. if (s < o) {
  37760. var l = 0;
  37761. for (n = 0; s < o; )
  37762. n |= (1 & !!e[s++]) << l++;
  37763. this.writeByte(n, t++)
  37764. }
  37765. return i ? (this.offset = t,
  37766. this) : t - r
  37767. }
  37768. ,
  37769. a.readBitSet = function(e) {
  37770. var t = "undefined" == typeof e;
  37771. t && (e = this.offset);
  37772. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37773. for (e += n.length; o--; )
  37774. i = this.readByte(e++),
  37775. s[a++] = !!(1 & i),
  37776. s[a++] = !!(2 & i),
  37777. s[a++] = !!(4 & i),
  37778. s[a++] = !!(8 & i),
  37779. s[a++] = !!(16 & i),
  37780. s[a++] = !!(32 & i),
  37781. s[a++] = !!(64 & i),
  37782. s[a++] = !!(128 & i);
  37783. if (a < r) {
  37784. var l = 0;
  37785. for (i = this.readByte(e++); a < r; )
  37786. s[a++] = !!(i >> l++ & 1)
  37787. }
  37788. return t && (this.offset = e),
  37789. s
  37790. }
  37791. ,
  37792. a.readBytes = function(e, t) {
  37793. var i = "undefined" == typeof t;
  37794. if (i && (t = this.offset),
  37795. !this.noAssert) {
  37796. if ("number" != typeof t || t % 1 !== 0)
  37797. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37798. if (t >>>= 0,
  37799. t < 0 || t + e > this.buffer.byteLength)
  37800. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37801. }
  37802. var n = this.slice(t, t + e);
  37803. return i && (this.offset += e),
  37804. n
  37805. }
  37806. ,
  37807. a.writeBytes = a.append,
  37808. a.writeInt8 = function(e, t) {
  37809. var i = "undefined" == typeof t;
  37810. if (i && (t = this.offset),
  37811. !this.noAssert) {
  37812. if ("number" != typeof e || e % 1 !== 0)
  37813. throw TypeError("Illegal value: " + e + " (not an integer)");
  37814. if (e |= 0,
  37815. "number" != typeof t || t % 1 !== 0)
  37816. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37817. if (t >>>= 0,
  37818. t < 0 || t + 0 > this.buffer.byteLength)
  37819. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37820. }
  37821. t += 1;
  37822. var n = this.buffer.byteLength;
  37823. return t > n && this.resize((n *= 2) > t ? n : t),
  37824. t -= 1,
  37825. this.view[t] = e,
  37826. i && (this.offset += 1),
  37827. this
  37828. }
  37829. ,
  37830. a.writeByte = a.writeInt8,
  37831. a.readInt8 = function(e) {
  37832. var t = "undefined" == typeof e;
  37833. if (t && (e = this.offset),
  37834. !this.noAssert) {
  37835. if ("number" != typeof e || e % 1 !== 0)
  37836. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37837. if (e >>>= 0,
  37838. e < 0 || e + 1 > this.buffer.byteLength)
  37839. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37840. }
  37841. var i = this.view[e];
  37842. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37843. t && (this.offset += 1),
  37844. i
  37845. }
  37846. ,
  37847. a.readByte = a.readInt8,
  37848. a.writeUint8 = function(e, t) {
  37849. var i = "undefined" == typeof t;
  37850. if (i && (t = this.offset),
  37851. !this.noAssert) {
  37852. if ("number" != typeof e || e % 1 !== 0)
  37853. throw TypeError("Illegal value: " + e + " (not an integer)");
  37854. if (e >>>= 0,
  37855. "number" != typeof t || t % 1 !== 0)
  37856. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37857. if (t >>>= 0,
  37858. t < 0 || t + 0 > this.buffer.byteLength)
  37859. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37860. }
  37861. t += 1;
  37862. var n = this.buffer.byteLength;
  37863. return t > n && this.resize((n *= 2) > t ? n : t),
  37864. t -= 1,
  37865. this.view[t] = e,
  37866. i && (this.offset += 1),
  37867. this
  37868. }
  37869. ,
  37870. a.writeUInt8 = a.writeUint8,
  37871. a.readUint8 = function(e) {
  37872. var t = "undefined" == typeof e;
  37873. if (t && (e = this.offset),
  37874. !this.noAssert) {
  37875. if ("number" != typeof e || e % 1 !== 0)
  37876. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37877. if (e >>>= 0,
  37878. e < 0 || e + 1 > this.buffer.byteLength)
  37879. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37880. }
  37881. var i = this.view[e];
  37882. return t && (this.offset += 1),
  37883. i
  37884. }
  37885. ,
  37886. a.readUInt8 = a.readUint8,
  37887. a.writeInt16 = function(e, t) {
  37888. var i = "undefined" == typeof t;
  37889. if (i && (t = this.offset),
  37890. !this.noAssert) {
  37891. if ("number" != typeof e || e % 1 !== 0)
  37892. throw TypeError("Illegal value: " + e + " (not an integer)");
  37893. if (e |= 0,
  37894. "number" != typeof t || t % 1 !== 0)
  37895. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37896. if (t >>>= 0,
  37897. t < 0 || t + 0 > this.buffer.byteLength)
  37898. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37899. }
  37900. t += 2;
  37901. var n = this.buffer.byteLength;
  37902. return t > n && this.resize((n *= 2) > t ? n : t),
  37903. t -= 2,
  37904. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37905. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37906. this.view[t + 1] = 255 & e),
  37907. i && (this.offset += 2),
  37908. this
  37909. }
  37910. ,
  37911. a.writeShort = a.writeInt16,
  37912. a.readInt16 = function(e) {
  37913. var t = "undefined" == typeof e;
  37914. if (t && (e = this.offset),
  37915. !this.noAssert) {
  37916. if ("number" != typeof e || e % 1 !== 0)
  37917. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37918. if (e >>>= 0,
  37919. e < 0 || e + 2 > this.buffer.byteLength)
  37920. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37921. }
  37922. var i = 0;
  37923. return this.littleEndian ? (i = this.view[e],
  37924. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37925. i |= this.view[e + 1]),
  37926. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37927. t && (this.offset += 2),
  37928. i
  37929. }
  37930. ,
  37931. a.readShort = a.readInt16,
  37932. a.writeUint16 = function(e, t) {
  37933. var i = "undefined" == typeof t;
  37934. if (i && (t = this.offset),
  37935. !this.noAssert) {
  37936. if ("number" != typeof e || e % 1 !== 0)
  37937. throw TypeError("Illegal value: " + e + " (not an integer)");
  37938. if (e >>>= 0,
  37939. "number" != typeof t || t % 1 !== 0)
  37940. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37941. if (t >>>= 0,
  37942. t < 0 || t + 0 > this.buffer.byteLength)
  37943. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37944. }
  37945. t += 2;
  37946. var n = this.buffer.byteLength;
  37947. return t > n && this.resize((n *= 2) > t ? n : t),
  37948. t -= 2,
  37949. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37950. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37951. this.view[t + 1] = 255 & e),
  37952. i && (this.offset += 2),
  37953. this
  37954. }
  37955. ,
  37956. a.writeUInt16 = a.writeUint16,
  37957. a.readUint16 = function(e) {
  37958. var t = "undefined" == typeof e;
  37959. if (t && (e = this.offset),
  37960. !this.noAssert) {
  37961. if ("number" != typeof e || e % 1 !== 0)
  37962. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37963. if (e >>>= 0,
  37964. e < 0 || e + 2 > this.buffer.byteLength)
  37965. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37966. }
  37967. var i = 0;
  37968. return this.littleEndian ? (i = this.view[e],
  37969. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37970. i |= this.view[e + 1]),
  37971. t && (this.offset += 2),
  37972. i
  37973. }
  37974. ,
  37975. a.readUInt16 = a.readUint16,
  37976. a.writeInt32 = function(e, t) {
  37977. var i = "undefined" == typeof t;
  37978. if (i && (t = this.offset),
  37979. !this.noAssert) {
  37980. if ("number" != typeof e || e % 1 !== 0)
  37981. throw TypeError("Illegal value: " + e + " (not an integer)");
  37982. if (e |= 0,
  37983. "number" != typeof t || t % 1 !== 0)
  37984. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37985. if (t >>>= 0,
  37986. t < 0 || t + 0 > this.buffer.byteLength)
  37987. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37988. }
  37989. t += 4;
  37990. var n = this.buffer.byteLength;
  37991. return t > n && this.resize((n *= 2) > t ? n : t),
  37992. t -= 4,
  37993. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37994. this.view[t + 2] = e >>> 16 & 255,
  37995. this.view[t + 1] = e >>> 8 & 255,
  37996. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37997. this.view[t + 1] = e >>> 16 & 255,
  37998. this.view[t + 2] = e >>> 8 & 255,
  37999. this.view[t + 3] = 255 & e),
  38000. i && (this.offset += 4),
  38001. this
  38002. }
  38003. ,
  38004. a.writeInt = a.writeInt32,
  38005. a.readInt32 = function(e) {
  38006. var t = "undefined" == typeof e;
  38007. if (t && (e = this.offset),
  38008. !this.noAssert) {
  38009. if ("number" != typeof e || e % 1 !== 0)
  38010. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38011. if (e >>>= 0,
  38012. e < 0 || e + 4 > this.buffer.byteLength)
  38013. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38014. }
  38015. var i = 0;
  38016. return this.littleEndian ? (i = this.view[e + 2] << 16,
  38017. i |= this.view[e + 1] << 8,
  38018. i |= this.view[e],
  38019. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  38020. i |= this.view[e + 2] << 8,
  38021. i |= this.view[e + 3],
  38022. i += this.view[e] << 24 >>> 0),
  38023. i |= 0,
  38024. t && (this.offset += 4),
  38025. i
  38026. }
  38027. ,
  38028. a.readInt = a.readInt32,
  38029. a.writeUint32 = function(e, t) {
  38030. var i = "undefined" == typeof t;
  38031. if (i && (t = this.offset),
  38032. !this.noAssert) {
  38033. if ("number" != typeof e || e % 1 !== 0)
  38034. throw TypeError("Illegal value: " + e + " (not an integer)");
  38035. if (e >>>= 0,
  38036. "number" != typeof t || t % 1 !== 0)
  38037. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38038. if (t >>>= 0,
  38039. t < 0 || t + 0 > this.buffer.byteLength)
  38040. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38041. }
  38042. t += 4;
  38043. var n = this.buffer.byteLength;
  38044. return t > n && this.resize((n *= 2) > t ? n : t),
  38045. t -= 4,
  38046. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  38047. this.view[t + 2] = e >>> 16 & 255,
  38048. this.view[t + 1] = e >>> 8 & 255,
  38049. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  38050. this.view[t + 1] = e >>> 16 & 255,
  38051. this.view[t + 2] = e >>> 8 & 255,
  38052. this.view[t + 3] = 255 & e),
  38053. i && (this.offset += 4),
  38054. this
  38055. }
  38056. ,
  38057. a.writeUInt32 = a.writeUint32,
  38058. a.readUint32 = function(e) {
  38059. var t = "undefined" == typeof e;
  38060. if (t && (e = this.offset),
  38061. !this.noAssert) {
  38062. if ("number" != typeof e || e % 1 !== 0)
  38063. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38064. if (e >>>= 0,
  38065. e < 0 || e + 4 > this.buffer.byteLength)
  38066. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38067. }
  38068. var i = 0;
  38069. return this.littleEndian ? (i = this.view[e + 2] << 16,
  38070. i |= this.view[e + 1] << 8,
  38071. i |= this.view[e],
  38072. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  38073. i |= this.view[e + 2] << 8,
  38074. i |= this.view[e + 3],
  38075. i += this.view[e] << 24 >>> 0),
  38076. t && (this.offset += 4),
  38077. i
  38078. }
  38079. ,
  38080. a.readUInt32 = a.readUint32,
  38081. e && (a.writeInt64 = function(t, i) {
  38082. var n = "undefined" == typeof i;
  38083. if (n && (i = this.offset),
  38084. !this.noAssert) {
  38085. if ("number" == typeof t)
  38086. t = e.fromNumber(t);
  38087. else if ("string" == typeof t)
  38088. t = e.fromString(t);
  38089. else if (!(t && t instanceof e))
  38090. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38091. if ("number" != typeof i || i % 1 !== 0)
  38092. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38093. if (i >>>= 0,
  38094. i < 0 || i + 0 > this.buffer.byteLength)
  38095. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38096. }
  38097. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  38098. i += 8;
  38099. var r = this.buffer.byteLength;
  38100. i > r && this.resize((r *= 2) > i ? r : i),
  38101. i -= 8;
  38102. var o = t.low
  38103. , a = t.high;
  38104. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  38105. this.view[i + 2] = o >>> 16 & 255,
  38106. this.view[i + 1] = o >>> 8 & 255,
  38107. this.view[i] = 255 & o,
  38108. i += 4,
  38109. this.view[i + 3] = a >>> 24 & 255,
  38110. this.view[i + 2] = a >>> 16 & 255,
  38111. this.view[i + 1] = a >>> 8 & 255,
  38112. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  38113. this.view[i + 1] = a >>> 16 & 255,
  38114. this.view[i + 2] = a >>> 8 & 255,
  38115. this.view[i + 3] = 255 & a,
  38116. i += 4,
  38117. this.view[i] = o >>> 24 & 255,
  38118. this.view[i + 1] = o >>> 16 & 255,
  38119. this.view[i + 2] = o >>> 8 & 255,
  38120. this.view[i + 3] = 255 & o),
  38121. n && (this.offset += 8),
  38122. this
  38123. }
  38124. ,
  38125. a.writeLong = a.writeInt64,
  38126. a.readInt64 = function(t) {
  38127. var i = "undefined" == typeof t;
  38128. if (i && (t = this.offset),
  38129. !this.noAssert) {
  38130. if ("number" != typeof t || t % 1 !== 0)
  38131. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38132. if (t >>>= 0,
  38133. t < 0 || t + 8 > this.buffer.byteLength)
  38134. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  38135. }
  38136. var n = 0
  38137. , r = 0;
  38138. this.littleEndian ? (n = this.view[t + 2] << 16,
  38139. n |= this.view[t + 1] << 8,
  38140. n |= this.view[t],
  38141. n += this.view[t + 3] << 24 >>> 0,
  38142. t += 4,
  38143. r = this.view[t + 2] << 16,
  38144. r |= this.view[t + 1] << 8,
  38145. r |= this.view[t],
  38146. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  38147. r |= this.view[t + 2] << 8,
  38148. r |= this.view[t + 3],
  38149. r += this.view[t] << 24 >>> 0,
  38150. t += 4,
  38151. n = this.view[t + 1] << 16,
  38152. n |= this.view[t + 2] << 8,
  38153. n |= this.view[t + 3],
  38154. n += this.view[t] << 24 >>> 0);
  38155. var o = new e(n,r,!1);
  38156. return i && (this.offset += 8),
  38157. o
  38158. }
  38159. ,
  38160. a.readLong = a.readInt64,
  38161. a.writeUint64 = function(t, i) {
  38162. var n = "undefined" == typeof i;
  38163. if (n && (i = this.offset),
  38164. !this.noAssert) {
  38165. if ("number" == typeof t)
  38166. t = e.fromNumber(t);
  38167. else if ("string" == typeof t)
  38168. t = e.fromString(t);
  38169. else if (!(t && t instanceof e))
  38170. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38171. if ("number" != typeof i || i % 1 !== 0)
  38172. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38173. if (i >>>= 0,
  38174. i < 0 || i + 0 > this.buffer.byteLength)
  38175. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38176. }
  38177. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  38178. i += 8;
  38179. var r = this.buffer.byteLength;
  38180. i > r && this.resize((r *= 2) > i ? r : i),
  38181. i -= 8;
  38182. var o = t.low
  38183. , a = t.high;
  38184. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  38185. this.view[i + 2] = o >>> 16 & 255,
  38186. this.view[i + 1] = o >>> 8 & 255,
  38187. this.view[i] = 255 & o,
  38188. i += 4,
  38189. this.view[i + 3] = a >>> 24 & 255,
  38190. this.view[i + 2] = a >>> 16 & 255,
  38191. this.view[i + 1] = a >>> 8 & 255,
  38192. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  38193. this.view[i + 1] = a >>> 16 & 255,
  38194. this.view[i + 2] = a >>> 8 & 255,
  38195. this.view[i + 3] = 255 & a,
  38196. i += 4,
  38197. this.view[i] = o >>> 24 & 255,
  38198. this.view[i + 1] = o >>> 16 & 255,
  38199. this.view[i + 2] = o >>> 8 & 255,
  38200. this.view[i + 3] = 255 & o),
  38201. n && (this.offset += 8),
  38202. this
  38203. }
  38204. ,
  38205. a.writeUInt64 = a.writeUint64,
  38206. a.readUint64 = function(t) {
  38207. var i = "undefined" == typeof t;
  38208. if (i && (t = this.offset),
  38209. !this.noAssert) {
  38210. if ("number" != typeof t || t % 1 !== 0)
  38211. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38212. if (t >>>= 0,
  38213. t < 0 || t + 8 > this.buffer.byteLength)
  38214. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  38215. }
  38216. var n = 0
  38217. , r = 0;
  38218. this.littleEndian ? (n = this.view[t + 2] << 16,
  38219. n |= this.view[t + 1] << 8,
  38220. n |= this.view[t],
  38221. n += this.view[t + 3] << 24 >>> 0,
  38222. t += 4,
  38223. r = this.view[t + 2] << 16,
  38224. r |= this.view[t + 1] << 8,
  38225. r |= this.view[t],
  38226. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  38227. r |= this.view[t + 2] << 8,
  38228. r |= this.view[t + 3],
  38229. r += this.view[t] << 24 >>> 0,
  38230. t += 4,
  38231. n = this.view[t + 1] << 16,
  38232. n |= this.view[t + 2] << 8,
  38233. n |= this.view[t + 3],
  38234. n += this.view[t] << 24 >>> 0);
  38235. var o = new e(n,r,!0);
  38236. return i && (this.offset += 8),
  38237. o
  38238. }
  38239. ,
  38240. a.readUInt64 = a.readUint64),
  38241. a.writeFloat32 = function(e, t) {
  38242. var i = "undefined" == typeof t;
  38243. if (i && (t = this.offset),
  38244. !this.noAssert) {
  38245. if ("number" != typeof e)
  38246. throw TypeError("Illegal value: " + e + " (not a number)");
  38247. if ("number" != typeof t || t % 1 !== 0)
  38248. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38249. if (t >>>= 0,
  38250. t < 0 || t + 0 > this.buffer.byteLength)
  38251. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38252. }
  38253. t += 4;
  38254. var n = this.buffer.byteLength;
  38255. return t > n && this.resize((n *= 2) > t ? n : t),
  38256. t -= 4,
  38257. r(this.view, e, t, this.littleEndian, 23, 4),
  38258. i && (this.offset += 4),
  38259. this
  38260. }
  38261. ,
  38262. a.writeFloat = a.writeFloat32,
  38263. a.readFloat32 = function(e) {
  38264. var t = "undefined" == typeof e;
  38265. if (t && (e = this.offset),
  38266. !this.noAssert) {
  38267. if ("number" != typeof e || e % 1 !== 0)
  38268. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38269. if (e >>>= 0,
  38270. e < 0 || e + 4 > this.buffer.byteLength)
  38271. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38272. }
  38273. var i = n(this.view, e, this.littleEndian, 23, 4);
  38274. return t && (this.offset += 4),
  38275. i
  38276. }
  38277. ,
  38278. a.readFloat = a.readFloat32,
  38279. a.writeFloat64 = function(e, t) {
  38280. var i = "undefined" == typeof t;
  38281. if (i && (t = this.offset),
  38282. !this.noAssert) {
  38283. if ("number" != typeof e)
  38284. throw TypeError("Illegal value: " + e + " (not a number)");
  38285. if ("number" != typeof t || t % 1 !== 0)
  38286. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38287. if (t >>>= 0,
  38288. t < 0 || t + 0 > this.buffer.byteLength)
  38289. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38290. }
  38291. t += 8;
  38292. var n = this.buffer.byteLength;
  38293. return t > n && this.resize((n *= 2) > t ? n : t),
  38294. t -= 8,
  38295. r(this.view, e, t, this.littleEndian, 52, 8),
  38296. i && (this.offset += 8),
  38297. this
  38298. }
  38299. ,
  38300. a.writeDouble = a.writeFloat64,
  38301. a.readFloat64 = function(e) {
  38302. var t = "undefined" == typeof e;
  38303. if (t && (e = this.offset),
  38304. !this.noAssert) {
  38305. if ("number" != typeof e || e % 1 !== 0)
  38306. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38307. if (e >>>= 0,
  38308. e < 0 || e + 8 > this.buffer.byteLength)
  38309. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  38310. }
  38311. var i = n(this.view, e, this.littleEndian, 52, 8);
  38312. return t && (this.offset += 8),
  38313. i
  38314. }
  38315. ,
  38316. a.readDouble = a.readFloat64,
  38317. o.MAX_VARINT32_BYTES = 5,
  38318. o.calculateVarint32 = function(e) {
  38319. return e >>>= 0,
  38320. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  38321. }
  38322. ,
  38323. o.zigZagEncode32 = function(e) {
  38324. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  38325. }
  38326. ,
  38327. o.zigZagDecode32 = function(e) {
  38328. return e >>> 1 ^ -(1 & e) | 0
  38329. }
  38330. ,
  38331. a.writeVarint32 = function(e, t) {
  38332. var i = "undefined" == typeof t;
  38333. if (i && (t = this.offset),
  38334. !this.noAssert) {
  38335. if ("number" != typeof e || e % 1 !== 0)
  38336. throw TypeError("Illegal value: " + e + " (not an integer)");
  38337. if (e |= 0,
  38338. "number" != typeof t || t % 1 !== 0)
  38339. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38340. if (t >>>= 0,
  38341. t < 0 || t + 0 > this.buffer.byteLength)
  38342. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  38343. }
  38344. var n, r = o.calculateVarint32(e);
  38345. t += r;
  38346. var a = this.buffer.byteLength;
  38347. for (t > a && this.resize((a *= 2) > t ? a : t),
  38348. t -= r,
  38349. e >>>= 0; e >= 128; )
  38350. n = 127 & e | 128,
  38351. this.view[t++] = n,
  38352. e >>>= 7;
  38353. return this.view[t++] = e,
  38354. i ? (this.offset = t,
  38355. this) : r
  38356. }
  38357. ,
  38358. a.writeVarint32ZigZag = function(e, t) {
  38359. return this.writeVarint32(o.zigZagEncode32(e), t)
  38360. }
  38361. ,
  38362. a.readVarint32 = function(e) {
  38363. var t = "undefined" == typeof e;
  38364. if (t && (e = this.offset),
  38365. !this.noAssert) {
  38366. if ("number" != typeof e || e % 1 !== 0)
  38367. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38368. if (e >>>= 0,
  38369. e < 0 || e + 1 > this.buffer.byteLength)
  38370. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38371. }
  38372. var i, n = 0, r = 0;
  38373. do {
  38374. if (!this.noAssert && e > this.limit) {
  38375. var o = Error("Truncated");
  38376. throw o.truncated = !0,
  38377. o
  38378. }
  38379. i = this.view[e++],
  38380. n < 5 && (r |= (127 & i) << 7 * n),
  38381. ++n
  38382. } while (0 !== (128 & i));return r |= 0,
  38383. t ? (this.offset = e,
  38384. r) : {
  38385. value: r,
  38386. length: n
  38387. }
  38388. }
  38389. ,
  38390. a.readVarint32ZigZag = function(e) {
  38391. var t = this.readVarint32(e);
  38392. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  38393. t
  38394. }
  38395. ,
  38396. e && (o.MAX_VARINT64_BYTES = 10,
  38397. o.calculateVarint64 = function(t) {
  38398. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  38399. var i = t.toInt() >>> 0
  38400. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  38401. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  38402. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  38403. }
  38404. ,
  38405. o.zigZagEncode64 = function(t) {
  38406. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38407. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  38408. }
  38409. ,
  38410. o.zigZagDecode64 = function(t) {
  38411. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38412. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  38413. }
  38414. ,
  38415. a.writeVarint64 = function(t, i) {
  38416. var n = "undefined" == typeof i;
  38417. if (n && (i = this.offset),
  38418. !this.noAssert) {
  38419. if ("number" == typeof t)
  38420. t = e.fromNumber(t);
  38421. else if ("string" == typeof t)
  38422. t = e.fromString(t);
  38423. else if (!(t && t instanceof e))
  38424. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38425. if ("number" != typeof i || i % 1 !== 0)
  38426. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38427. if (i >>>= 0,
  38428. i < 0 || i + 0 > this.buffer.byteLength)
  38429. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38430. }
  38431. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  38432. var r = o.calculateVarint64(t)
  38433. , a = t.toInt() >>> 0
  38434. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  38435. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  38436. i += r;
  38437. var c = this.buffer.byteLength;
  38438. switch (i > c && this.resize((c *= 2) > i ? c : i),
  38439. i -= r,
  38440. r) {
  38441. case 10:
  38442. this.view[i + 9] = l >>> 7 & 1;
  38443. case 9:
  38444. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  38445. case 8:
  38446. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  38447. case 7:
  38448. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  38449. case 6:
  38450. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  38451. case 5:
  38452. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  38453. case 4:
  38454. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  38455. case 3:
  38456. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  38457. case 2:
  38458. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  38459. case 1:
  38460. this.view[i] = 1 !== r ? 128 | a : 127 & a
  38461. }
  38462. return n ? (this.offset += r,
  38463. this) : r
  38464. }
  38465. ,
  38466. a.writeVarint64ZigZag = function(e, t) {
  38467. return this.writeVarint64(o.zigZagEncode64(e), t)
  38468. }
  38469. ,
  38470. a.readVarint64 = function(t) {
  38471. var i = "undefined" == typeof t;
  38472. if (i && (t = this.offset),
  38473. !this.noAssert) {
  38474. if ("number" != typeof t || t % 1 !== 0)
  38475. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38476. if (t >>>= 0,
  38477. t < 0 || t + 1 > this.buffer.byteLength)
  38478. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  38479. }
  38480. var n = t
  38481. , r = 0
  38482. , o = 0
  38483. , a = 0
  38484. , s = 0;
  38485. if (s = this.view[t++],
  38486. r = 127 & s,
  38487. 128 & s && (s = this.view[t++],
  38488. r |= (127 & s) << 7,
  38489. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38490. r |= (127 & s) << 14,
  38491. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38492. r |= (127 & s) << 21,
  38493. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38494. o = 127 & s,
  38495. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38496. o |= (127 & s) << 7,
  38497. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38498. o |= (127 & s) << 14,
  38499. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38500. o |= (127 & s) << 21,
  38501. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38502. a = 127 & s,
  38503. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38504. a |= (127 & s) << 7,
  38505. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  38506. throw Error("Buffer overrun");
  38507. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  38508. return i ? (this.offset = t,
  38509. l) : {
  38510. value: l,
  38511. length: t - n
  38512. }
  38513. }
  38514. ,
  38515. a.readVarint64ZigZag = function(t) {
  38516. var i = this.readVarint64(t);
  38517. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  38518. i
  38519. }
  38520. ),
  38521. a.writeCString = function(e, i) {
  38522. var n = "undefined" == typeof i;
  38523. n && (i = this.offset);
  38524. var r, o = e.length;
  38525. if (!this.noAssert) {
  38526. if ("string" != typeof e)
  38527. throw TypeError("Illegal str: Not a string");
  38528. for (r = 0; r < o; ++r)
  38529. if (0 === e.charCodeAt(r))
  38530. throw RangeError("Illegal str: Contains NULL-characters");
  38531. if ("number" != typeof i || i % 1 !== 0)
  38532. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38533. if (i >>>= 0,
  38534. i < 0 || i + 0 > this.buffer.byteLength)
  38535. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38536. }
  38537. o = h.calculateUTF16asUTF8(t(e))[1],
  38538. i += o + 1;
  38539. var a = this.buffer.byteLength;
  38540. return i > a && this.resize((a *= 2) > i ? a : i),
  38541. i -= o + 1,
  38542. h.encodeUTF16toUTF8(t(e), function(e) {
  38543. this.view[i++] = e
  38544. }
  38545. .bind(this)),
  38546. this.view[i++] = 0,
  38547. n ? (this.offset = i,
  38548. this) : o
  38549. }
  38550. ,
  38551. a.readCString = function(e) {
  38552. var t = "undefined" == typeof e;
  38553. if (t && (e = this.offset),
  38554. !this.noAssert) {
  38555. if ("number" != typeof e || e % 1 !== 0)
  38556. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38557. if (e >>>= 0,
  38558. e < 0 || e + 1 > this.buffer.byteLength)
  38559. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38560. }
  38561. var n, r = e, o = -1;
  38562. return h.decodeUTF8toUTF16(function() {
  38563. if (0 === o)
  38564. return null;
  38565. if (e >= this.limit)
  38566. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  38567. return o = this.view[e++],
  38568. 0 === o ? null : o
  38569. }
  38570. .bind(this), n = i(), !0),
  38571. t ? (this.offset = e,
  38572. n()) : {
  38573. string: n(),
  38574. length: e - r
  38575. }
  38576. }
  38577. ,
  38578. a.writeIString = function(e, i) {
  38579. var n = "undefined" == typeof i;
  38580. if (n && (i = this.offset),
  38581. !this.noAssert) {
  38582. if ("string" != typeof e)
  38583. throw TypeError("Illegal str: Not a string");
  38584. if ("number" != typeof i || i % 1 !== 0)
  38585. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38586. if (i >>>= 0,
  38587. i < 0 || i + 0 > this.buffer.byteLength)
  38588. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38589. }
  38590. var r, o = i;
  38591. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38592. i += 4 + r;
  38593. var a = this.buffer.byteLength;
  38594. if (i > a && this.resize((a *= 2) > i ? a : i),
  38595. i -= 4 + r,
  38596. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  38597. this.view[i + 2] = r >>> 16 & 255,
  38598. this.view[i + 1] = r >>> 8 & 255,
  38599. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  38600. this.view[i + 1] = r >>> 16 & 255,
  38601. this.view[i + 2] = r >>> 8 & 255,
  38602. this.view[i + 3] = 255 & r),
  38603. i += 4,
  38604. h.encodeUTF16toUTF8(t(e), function(e) {
  38605. this.view[i++] = e
  38606. }
  38607. .bind(this)),
  38608. i !== o + 4 + r)
  38609. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  38610. return n ? (this.offset = i,
  38611. this) : i - o
  38612. }
  38613. ,
  38614. a.readIString = function(e) {
  38615. var t = "undefined" == typeof e;
  38616. if (t && (e = this.offset),
  38617. !this.noAssert) {
  38618. if ("number" != typeof e || e % 1 !== 0)
  38619. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38620. if (e >>>= 0,
  38621. e < 0 || e + 4 > this.buffer.byteLength)
  38622. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38623. }
  38624. var i = e
  38625. , n = this.readUint32(e)
  38626. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  38627. return e += r.length,
  38628. t ? (this.offset = e,
  38629. r.string) : {
  38630. string: r.string,
  38631. length: e - i
  38632. }
  38633. }
  38634. ,
  38635. o.METRICS_CHARS = "c",
  38636. o.METRICS_BYTES = "b",
  38637. a.writeUTF8String = function(e, i) {
  38638. var n = "undefined" == typeof i;
  38639. if (n && (i = this.offset),
  38640. !this.noAssert) {
  38641. if ("number" != typeof i || i % 1 !== 0)
  38642. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38643. if (i >>>= 0,
  38644. i < 0 || i + 0 > this.buffer.byteLength)
  38645. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38646. }
  38647. var r, o = i;
  38648. r = h.calculateUTF16asUTF8(t(e))[1],
  38649. i += r;
  38650. var a = this.buffer.byteLength;
  38651. return i > a && this.resize((a *= 2) > i ? a : i),
  38652. i -= r,
  38653. h.encodeUTF16toUTF8(t(e), function(e) {
  38654. this.view[i++] = e
  38655. }
  38656. .bind(this)),
  38657. n ? (this.offset = i,
  38658. this) : i - o
  38659. }
  38660. ,
  38661. a.writeString = a.writeUTF8String,
  38662. o.calculateUTF8Chars = function(e) {
  38663. return h.calculateUTF16asUTF8(t(e))[0]
  38664. }
  38665. ,
  38666. o.calculateUTF8Bytes = function(e) {
  38667. return h.calculateUTF16asUTF8(t(e))[1]
  38668. }
  38669. ,
  38670. o.calculateString = o.calculateUTF8Bytes,
  38671. a.readUTF8String = function(e, t, n) {
  38672. "number" == typeof t && (n = t,
  38673. t = void 0);
  38674. var r = "undefined" == typeof n;
  38675. if (r && (n = this.offset),
  38676. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38677. !this.noAssert) {
  38678. if ("number" != typeof e || e % 1 !== 0)
  38679. throw TypeError("Illegal length: " + e + " (not an integer)");
  38680. if (e |= 0,
  38681. "number" != typeof n || n % 1 !== 0)
  38682. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38683. if (n >>>= 0,
  38684. n < 0 || n + 0 > this.buffer.byteLength)
  38685. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38686. }
  38687. var a, s = 0, l = n;
  38688. if (t === o.METRICS_CHARS) {
  38689. if (a = i(),
  38690. h.decodeUTF8(function() {
  38691. return s < e && n < this.limit ? this.view[n++] : null
  38692. }
  38693. .bind(this), function(e) {
  38694. ++s,
  38695. h.UTF8toUTF16(e, a)
  38696. }),
  38697. s !== e)
  38698. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38699. return r ? (this.offset = n,
  38700. a()) : {
  38701. string: a(),
  38702. length: n - l
  38703. }
  38704. }
  38705. if (t === o.METRICS_BYTES) {
  38706. if (!this.noAssert) {
  38707. if ("number" != typeof n || n % 1 !== 0)
  38708. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38709. if (n >>>= 0,
  38710. n < 0 || n + e > this.buffer.byteLength)
  38711. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38712. }
  38713. var c = n + e;
  38714. if (h.decodeUTF8toUTF16(function() {
  38715. return n < c ? this.view[n++] : null
  38716. }
  38717. .bind(this), a = i(), this.noAssert),
  38718. n !== c)
  38719. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38720. return r ? (this.offset = n,
  38721. a()) : {
  38722. string: a(),
  38723. length: n - l
  38724. }
  38725. }
  38726. throw TypeError("Unsupported metrics: " + t)
  38727. }
  38728. ,
  38729. a.readString = a.readUTF8String,
  38730. a.writeVString = function(e, i) {
  38731. var n = "undefined" == typeof i;
  38732. if (n && (i = this.offset),
  38733. !this.noAssert) {
  38734. if ("string" != typeof e)
  38735. throw TypeError("Illegal str: Not a string");
  38736. if ("number" != typeof i || i % 1 !== 0)
  38737. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38738. if (i >>>= 0,
  38739. i < 0 || i + 0 > this.buffer.byteLength)
  38740. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38741. }
  38742. var r, a, s = i;
  38743. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38744. a = o.calculateVarint32(r),
  38745. i += a + r;
  38746. var l = this.buffer.byteLength;
  38747. if (i > l && this.resize((l *= 2) > i ? l : i),
  38748. i -= a + r,
  38749. i += this.writeVarint32(r, i),
  38750. h.encodeUTF16toUTF8(t(e), function(e) {
  38751. this.view[i++] = e
  38752. }
  38753. .bind(this)),
  38754. i !== s + r + a)
  38755. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38756. return n ? (this.offset = i,
  38757. this) : i - s
  38758. }
  38759. ,
  38760. a.readVString = function(e) {
  38761. var t = "undefined" == typeof e;
  38762. if (t && (e = this.offset),
  38763. !this.noAssert) {
  38764. if ("number" != typeof e || e % 1 !== 0)
  38765. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38766. if (e >>>= 0,
  38767. e < 0 || e + 1 > this.buffer.byteLength)
  38768. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38769. }
  38770. var i = e
  38771. , n = this.readVarint32(e)
  38772. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38773. return e += r.length,
  38774. t ? (this.offset = e,
  38775. r.string) : {
  38776. string: r.string,
  38777. length: e - i
  38778. }
  38779. }
  38780. ,
  38781. a.append = function(e, t, i) {
  38782. "number" != typeof t && "string" == typeof t || (i = t,
  38783. t = void 0);
  38784. var n = "undefined" == typeof i;
  38785. if (n && (i = this.offset),
  38786. !this.noAssert) {
  38787. if ("number" != typeof i || i % 1 !== 0)
  38788. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38789. if (i >>>= 0,
  38790. i < 0 || i + 0 > this.buffer.byteLength)
  38791. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38792. }
  38793. e instanceof o || (e = o.wrap(e, t));
  38794. var r = e.limit - e.offset;
  38795. if (r <= 0)
  38796. return this;
  38797. i += r;
  38798. var a = this.buffer.byteLength;
  38799. return i > a && this.resize((a *= 2) > i ? a : i),
  38800. i -= r,
  38801. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38802. e.offset += r,
  38803. n && (this.offset += r),
  38804. this
  38805. }
  38806. ,
  38807. a.appendTo = function(e, t) {
  38808. return e.append(this, t),
  38809. this
  38810. }
  38811. ,
  38812. a.assert = function(e) {
  38813. return this.noAssert = !e,
  38814. this
  38815. }
  38816. ,
  38817. a.capacity = function() {
  38818. return this.buffer.byteLength
  38819. }
  38820. ,
  38821. a.clear = function() {
  38822. return this.offset = 0,
  38823. this.limit = this.buffer.byteLength,
  38824. this.markedOffset = -1,
  38825. this
  38826. }
  38827. ,
  38828. a.clone = function(e) {
  38829. var t = new o(0,this.littleEndian,this.noAssert);
  38830. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38831. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38832. t.view = this.view),
  38833. t.offset = this.offset,
  38834. t.markedOffset = this.markedOffset,
  38835. t.limit = this.limit,
  38836. t
  38837. }
  38838. ,
  38839. a.compact = function(e, t) {
  38840. if ("undefined" == typeof e && (e = this.offset),
  38841. "undefined" == typeof t && (t = this.limit),
  38842. !this.noAssert) {
  38843. if ("number" != typeof e || e % 1 !== 0)
  38844. throw TypeError("Illegal begin: Not an integer");
  38845. if (e >>>= 0,
  38846. "number" != typeof t || t % 1 !== 0)
  38847. throw TypeError("Illegal end: Not an integer");
  38848. if (t >>>= 0,
  38849. e < 0 || e > t || t > this.buffer.byteLength)
  38850. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38851. }
  38852. if (0 === e && t === this.buffer.byteLength)
  38853. return this;
  38854. var i = t - e;
  38855. if (0 === i)
  38856. return this.buffer = s,
  38857. this.view = null,
  38858. this.markedOffset >= 0 && (this.markedOffset -= e),
  38859. this.offset = 0,
  38860. this.limit = 0,
  38861. this;
  38862. var n = new ArrayBuffer(i)
  38863. , r = new Uint8Array(n);
  38864. return r.set(this.view.subarray(e, t)),
  38865. this.buffer = n,
  38866. this.view = r,
  38867. this.markedOffset >= 0 && (this.markedOffset -= e),
  38868. this.offset = 0,
  38869. this.limit = i,
  38870. this
  38871. }
  38872. ,
  38873. a.copy = function(e, t) {
  38874. if ("undefined" == typeof e && (e = this.offset),
  38875. "undefined" == typeof t && (t = this.limit),
  38876. !this.noAssert) {
  38877. if ("number" != typeof e || e % 1 !== 0)
  38878. throw TypeError("Illegal begin: Not an integer");
  38879. if (e >>>= 0,
  38880. "number" != typeof t || t % 1 !== 0)
  38881. throw TypeError("Illegal end: Not an integer");
  38882. if (t >>>= 0,
  38883. e < 0 || e > t || t > this.buffer.byteLength)
  38884. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38885. }
  38886. if (e === t)
  38887. return new o(0,this.littleEndian,this.noAssert);
  38888. var i = t - e
  38889. , n = new o(i,this.littleEndian,this.noAssert);
  38890. return n.offset = 0,
  38891. n.limit = i,
  38892. n.markedOffset >= 0 && (n.markedOffset -= e),
  38893. this.copyTo(n, 0, e, t),
  38894. n
  38895. }
  38896. ,
  38897. a.copyTo = function(e, t, i, n) {
  38898. var r, a;
  38899. if (!this.noAssert && !o.isByteBuffer(e))
  38900. throw TypeError("Illegal target: Not a ByteBuffer");
  38901. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38902. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38903. n = "undefined" == typeof n ? this.limit : 0 | n,
  38904. t < 0 || t > e.buffer.byteLength)
  38905. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38906. if (i < 0 || n > this.buffer.byteLength)
  38907. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38908. var s = n - i;
  38909. return 0 === s ? e : (e.ensureCapacity(t + s),
  38910. e.view.set(this.view.subarray(i, n), t),
  38911. r && (this.offset += s),
  38912. a && (e.offset += s),
  38913. this)
  38914. }
  38915. ,
  38916. a.ensureCapacity = function(e) {
  38917. var t = this.buffer.byteLength;
  38918. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38919. }
  38920. ,
  38921. a.fill = function(e, t, i) {
  38922. var n = "undefined" == typeof t;
  38923. if (n && (t = this.offset),
  38924. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38925. "undefined" == typeof t && (t = this.offset),
  38926. "undefined" == typeof i && (i = this.limit),
  38927. !this.noAssert) {
  38928. if ("number" != typeof e || e % 1 !== 0)
  38929. throw TypeError("Illegal value: " + e + " (not an integer)");
  38930. if (e |= 0,
  38931. "number" != typeof t || t % 1 !== 0)
  38932. throw TypeError("Illegal begin: Not an integer");
  38933. if (t >>>= 0,
  38934. "number" != typeof i || i % 1 !== 0)
  38935. throw TypeError("Illegal end: Not an integer");
  38936. if (i >>>= 0,
  38937. t < 0 || t > i || i > this.buffer.byteLength)
  38938. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38939. }
  38940. if (t >= i)
  38941. return this;
  38942. for (; t < i; )
  38943. this.view[t++] = e;
  38944. return n && (this.offset = t),
  38945. this
  38946. }
  38947. ,
  38948. a.flip = function() {
  38949. return this.limit = this.offset,
  38950. this.offset = 0,
  38951. this
  38952. }
  38953. ,
  38954. a.mark = function(e) {
  38955. if (e = "undefined" == typeof e ? this.offset : e,
  38956. !this.noAssert) {
  38957. if ("number" != typeof e || e % 1 !== 0)
  38958. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38959. if (e >>>= 0,
  38960. e < 0 || e + 0 > this.buffer.byteLength)
  38961. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38962. }
  38963. return this.markedOffset = e,
  38964. this
  38965. }
  38966. ,
  38967. a.order = function(e) {
  38968. if (!this.noAssert && "boolean" != typeof e)
  38969. throw TypeError("Illegal littleEndian: Not a boolean");
  38970. return this.littleEndian = !!e,
  38971. this
  38972. }
  38973. ,
  38974. a.LE = function(e) {
  38975. return this.littleEndian = "undefined" == typeof e || !!e,
  38976. this
  38977. }
  38978. ,
  38979. a.BE = function(e) {
  38980. return this.littleEndian = "undefined" != typeof e && !e,
  38981. this
  38982. }
  38983. ,
  38984. a.prepend = function(e, t, i) {
  38985. "number" != typeof t && "string" == typeof t || (i = t,
  38986. t = void 0);
  38987. var n = "undefined" == typeof i;
  38988. if (n && (i = this.offset),
  38989. !this.noAssert) {
  38990. if ("number" != typeof i || i % 1 !== 0)
  38991. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38992. if (i >>>= 0,
  38993. i < 0 || i + 0 > this.buffer.byteLength)
  38994. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38995. }
  38996. e instanceof o || (e = o.wrap(e, t));
  38997. var r = e.limit - e.offset;
  38998. if (r <= 0)
  38999. return this;
  39000. var a = r - i;
  39001. if (a > 0) {
  39002. var s = new ArrayBuffer(this.buffer.byteLength + a)
  39003. , l = new Uint8Array(s);
  39004. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  39005. this.buffer = s,
  39006. this.view = l,
  39007. this.offset += a,
  39008. this.markedOffset >= 0 && (this.markedOffset += a),
  39009. this.limit += a,
  39010. i += a
  39011. } else {
  39012. new Uint8Array(this.buffer)
  39013. }
  39014. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  39015. e.offset = e.limit,
  39016. n && (this.offset -= r),
  39017. this
  39018. }
  39019. ,
  39020. a.prependTo = function(e, t) {
  39021. return e.prepend(this, t),
  39022. this
  39023. }
  39024. ,
  39025. a.printDebug = function(e) {
  39026. "function" != typeof e && (e = console.log.bind(console)),
  39027. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  39028. }
  39029. ,
  39030. a.remaining = function() {
  39031. return this.limit - this.offset
  39032. }
  39033. ,
  39034. a.reset = function() {
  39035. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  39036. this.markedOffset = -1) : this.offset = 0,
  39037. this
  39038. }
  39039. ,
  39040. a.resize = function(e) {
  39041. if (!this.noAssert) {
  39042. if ("number" != typeof e || e % 1 !== 0)
  39043. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  39044. if (e |= 0,
  39045. e < 0)
  39046. throw RangeError("Illegal capacity: 0 <= " + e)
  39047. }
  39048. if (this.buffer.byteLength < e) {
  39049. var t = new ArrayBuffer(e)
  39050. , i = new Uint8Array(t);
  39051. i.set(this.view),
  39052. this.buffer = t,
  39053. this.view = i
  39054. }
  39055. return this
  39056. }
  39057. ,
  39058. a.reverse = function(e, t) {
  39059. if ("undefined" == typeof e && (e = this.offset),
  39060. "undefined" == typeof t && (t = this.limit),
  39061. !this.noAssert) {
  39062. if ("number" != typeof e || e % 1 !== 0)
  39063. throw TypeError("Illegal begin: Not an integer");
  39064. if (e >>>= 0,
  39065. "number" != typeof t || t % 1 !== 0)
  39066. throw TypeError("Illegal end: Not an integer");
  39067. if (t >>>= 0,
  39068. e < 0 || e > t || t > this.buffer.byteLength)
  39069. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39070. }
  39071. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  39072. this)
  39073. }
  39074. ,
  39075. a.skip = function(e) {
  39076. if (!this.noAssert) {
  39077. if ("number" != typeof e || e % 1 !== 0)
  39078. throw TypeError("Illegal length: " + e + " (not an integer)");
  39079. e |= 0
  39080. }
  39081. var t = this.offset + e;
  39082. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  39083. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  39084. return this.offset = t,
  39085. this
  39086. }
  39087. ,
  39088. a.slice = function(e, t) {
  39089. if ("undefined" == typeof e && (e = this.offset),
  39090. "undefined" == typeof t && (t = this.limit),
  39091. !this.noAssert) {
  39092. if ("number" != typeof e || e % 1 !== 0)
  39093. throw TypeError("Illegal begin: Not an integer");
  39094. if (e >>>= 0,
  39095. "number" != typeof t || t % 1 !== 0)
  39096. throw TypeError("Illegal end: Not an integer");
  39097. if (t >>>= 0,
  39098. e < 0 || e > t || t > this.buffer.byteLength)
  39099. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39100. }
  39101. var i = this.clone();
  39102. return i.offset = e,
  39103. i.limit = t,
  39104. i
  39105. }
  39106. ,
  39107. a.toBuffer = function(e) {
  39108. var t = this.offset
  39109. , i = this.limit;
  39110. if (!this.noAssert) {
  39111. if ("number" != typeof t || t % 1 !== 0)
  39112. throw TypeError("Illegal offset: Not an integer");
  39113. if (t >>>= 0,
  39114. "number" != typeof i || i % 1 !== 0)
  39115. throw TypeError("Illegal limit: Not an integer");
  39116. if (i >>>= 0,
  39117. t < 0 || t > i || i > this.buffer.byteLength)
  39118. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  39119. }
  39120. if (!e && 0 === t && i === this.buffer.byteLength)
  39121. return this.buffer;
  39122. if (t === i)
  39123. return s;
  39124. var n = new ArrayBuffer(i - t);
  39125. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  39126. n
  39127. }
  39128. ,
  39129. a.toArrayBuffer = a.toBuffer,
  39130. a.toString = function(e, t, i) {
  39131. if ("undefined" == typeof e)
  39132. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  39133. switch ("number" == typeof e && (e = "utf8",
  39134. t = e,
  39135. i = t),
  39136. e) {
  39137. case "utf8":
  39138. return this.toUTF8(t, i);
  39139. case "base64":
  39140. return this.toBase64(t, i);
  39141. case "hex":
  39142. return this.toHex(t, i);
  39143. case "binary":
  39144. return this.toBinary(t, i);
  39145. case "debug":
  39146. return this.toDebug();
  39147. case "columns":
  39148. return this.toColumns();
  39149. default:
  39150. throw Error("Unsupported encoding: " + e)
  39151. }
  39152. }
  39153. ;
  39154. var c = function() {
  39155. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  39156. i[t[n]] = n;
  39157. return e.encode = function(e, i) {
  39158. for (var n, r; null !== (n = e()); )
  39159. i(t[n >> 2 & 63]),
  39160. r = (3 & n) << 4,
  39161. null !== (n = e()) ? (r |= n >> 4 & 15,
  39162. i(t[63 & (r | n >> 4 & 15)]),
  39163. r = (15 & n) << 2,
  39164. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  39165. i(t[63 & n])) : (i(t[63 & r]),
  39166. i(61))) : (i(t[63 & r]),
  39167. i(61),
  39168. i(61))
  39169. }
  39170. ,
  39171. e.decode = function(e, t) {
  39172. function n(e) {
  39173. throw Error("Illegal character code: " + e)
  39174. }
  39175. for (var r, o, a; null !== (r = e()); )
  39176. if (o = i[r],
  39177. "undefined" == typeof o && n(r),
  39178. null !== (r = e()) && (a = i[r],
  39179. "undefined" == typeof a && n(r),
  39180. t(o << 2 >>> 0 | (48 & a) >> 4),
  39181. null !== (r = e()))) {
  39182. if (o = i[r],
  39183. "undefined" == typeof o) {
  39184. if (61 === r)
  39185. break;
  39186. n(r)
  39187. }
  39188. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  39189. null !== (r = e())) {
  39190. if (a = i[r],
  39191. "undefined" == typeof a) {
  39192. if (61 === r)
  39193. break;
  39194. n(r)
  39195. }
  39196. t((3 & o) << 6 >>> 0 | a)
  39197. }
  39198. }
  39199. }
  39200. ,
  39201. e.test = function(e) {
  39202. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  39203. }
  39204. ,
  39205. e
  39206. }();
  39207. a.toBase64 = function(e, t) {
  39208. if ("undefined" == typeof e && (e = this.offset),
  39209. "undefined" == typeof t && (t = this.limit),
  39210. e |= 0,
  39211. t |= 0,
  39212. e < 0 || t > this.capacity || e > t)
  39213. throw RangeError("begin, end");
  39214. var n;
  39215. return c.encode(function() {
  39216. return e < t ? this.view[e++] : null
  39217. }
  39218. .bind(this), n = i()),
  39219. n()
  39220. }
  39221. ,
  39222. o.fromBase64 = function(e, i) {
  39223. if ("string" != typeof e)
  39224. throw TypeError("str");
  39225. var n = new o(e.length / 4 * 3,i)
  39226. , r = 0;
  39227. return c.decode(t(e), function(e) {
  39228. n.view[r++] = e
  39229. }),
  39230. n.limit = r,
  39231. n
  39232. }
  39233. ,
  39234. o.btoa = function(e) {
  39235. return o.fromBinary(e).toBase64()
  39236. }
  39237. ,
  39238. o.atob = function(e) {
  39239. return o.fromBase64(e).toBinary()
  39240. }
  39241. ,
  39242. a.toBinary = function(e, t) {
  39243. if ("undefined" == typeof e && (e = this.offset),
  39244. "undefined" == typeof t && (t = this.limit),
  39245. e |= 0,
  39246. t |= 0,
  39247. e < 0 || t > this.capacity() || e > t)
  39248. throw RangeError("begin, end");
  39249. if (e === t)
  39250. return "";
  39251. for (var i = [], n = []; e < t; )
  39252. i.push(this.view[e++]),
  39253. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  39254. i = []);
  39255. return n.join("") + String.fromCharCode.apply(String, i)
  39256. }
  39257. ,
  39258. o.fromBinary = function(e, t) {
  39259. if ("string" != typeof e)
  39260. throw TypeError("str");
  39261. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  39262. if (i = e.charCodeAt(n),
  39263. i > 255)
  39264. throw RangeError("illegal char code: " + i);
  39265. a.view[n++] = i
  39266. }
  39267. return a.limit = r,
  39268. a
  39269. }
  39270. ,
  39271. a.toDebug = function(e) {
  39272. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  39273. if (i !== -1 && (t = this.view[i],
  39274. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  39275. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  39276. ++i,
  39277. e && i > 0 && i % 16 === 0 && i !== n) {
  39278. for (; r.length < 51; )
  39279. r += " ";
  39280. a += r + o + "\n",
  39281. r = o = ""
  39282. }
  39283. r += i === this.offset && i === this.limit ? i === this.markedOffset ? "!" : "|" : i === this.offset ? i === this.markedOffset ? "[" : "<" : i === this.limit ? i === this.markedOffset ? "]" : ">" : i === this.markedOffset ? "'" : e || 0 !== i && i !== n ? " " : ""
  39284. }
  39285. if (e && " " !== r) {
  39286. for (; r.length < 51; )
  39287. r += " ";
  39288. a += r + o + "\n"
  39289. }
  39290. return e ? a : r
  39291. }
  39292. ,
  39293. o.fromDebug = function(e, t, i) {
  39294. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  39295. switch (n = e.charAt(l++)) {
  39296. case "!":
  39297. if (!i) {
  39298. if (u || d || p) {
  39299. f = !0;
  39300. break
  39301. }
  39302. u = d = p = !0
  39303. }
  39304. s.offset = s.markedOffset = s.limit = c,
  39305. h = !1;
  39306. break;
  39307. case "|":
  39308. if (!i) {
  39309. if (u || p) {
  39310. f = !0;
  39311. break
  39312. }
  39313. u = p = !0
  39314. }
  39315. s.offset = s.limit = c,
  39316. h = !1;
  39317. break;
  39318. case "[":
  39319. if (!i) {
  39320. if (u || d) {
  39321. f = !0;
  39322. break
  39323. }
  39324. u = d = !0
  39325. }
  39326. s.offset = s.markedOffset = c,
  39327. h = !1;
  39328. break;
  39329. case "<":
  39330. if (!i) {
  39331. if (u) {
  39332. f = !0;
  39333. break
  39334. }
  39335. u = !0
  39336. }
  39337. s.offset = c,
  39338. h = !1;
  39339. break;
  39340. case "]":
  39341. if (!i) {
  39342. if (p || d) {
  39343. f = !0;
  39344. break
  39345. }
  39346. p = d = !0
  39347. }
  39348. s.limit = s.markedOffset = c,
  39349. h = !1;
  39350. break;
  39351. case ">":
  39352. if (!i) {
  39353. if (p) {
  39354. f = !0;
  39355. break
  39356. }
  39357. p = !0
  39358. }
  39359. s.limit = c,
  39360. h = !1;
  39361. break;
  39362. case "'":
  39363. if (!i) {
  39364. if (d) {
  39365. f = !0;
  39366. break
  39367. }
  39368. d = !0
  39369. }
  39370. s.markedOffset = c,
  39371. h = !1;
  39372. break;
  39373. case " ":
  39374. h = !1;
  39375. break;
  39376. default:
  39377. if (!i && h) {
  39378. f = !0;
  39379. break
  39380. }
  39381. if (r = parseInt(n + e.charAt(l++), 16),
  39382. !i && (isNaN(r) || r < 0 || r > 255))
  39383. throw TypeError("Illegal str: Not a debug encoded string");
  39384. s.view[c++] = r,
  39385. h = !0
  39386. }
  39387. if (f)
  39388. throw TypeError("Illegal str: Invalid symbol at " + l)
  39389. }
  39390. if (!i) {
  39391. if (!u || !p)
  39392. throw TypeError("Illegal str: Missing offset or limit");
  39393. if (c < s.buffer.byteLength)
  39394. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  39395. }
  39396. return s
  39397. }
  39398. ,
  39399. a.toHex = function(e, t) {
  39400. if (e = "undefined" == typeof e ? this.offset : e,
  39401. t = "undefined" == typeof t ? this.limit : t,
  39402. !this.noAssert) {
  39403. if ("number" != typeof e || e % 1 !== 0)
  39404. throw TypeError("Illegal begin: Not an integer");
  39405. if (e >>>= 0,
  39406. "number" != typeof t || t % 1 !== 0)
  39407. throw TypeError("Illegal end: Not an integer");
  39408. if (t >>>= 0,
  39409. e < 0 || e > t || t > this.buffer.byteLength)
  39410. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39411. }
  39412. for (var i, n = new Array(t - e); e < t; )
  39413. i = this.view[e++],
  39414. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  39415. return n.join("")
  39416. }
  39417. ,
  39418. o.fromHex = function(e, t, i) {
  39419. if (!i) {
  39420. if ("string" != typeof e)
  39421. throw TypeError("Illegal str: Not a string");
  39422. if (e.length % 2 !== 0)
  39423. throw TypeError("Illegal str: Length not a multiple of 2")
  39424. }
  39425. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  39426. if (n = parseInt(e.substring(s, s + 2), 16),
  39427. !i && (!isFinite(n) || n < 0 || n > 255))
  39428. throw TypeError("Illegal str: Contains non-hex characters");
  39429. a.view[l++] = n
  39430. }
  39431. return a.limit = l,
  39432. a
  39433. }
  39434. ;
  39435. var h = function() {
  39436. var e = {};
  39437. return e.MAX_CODEPOINT = 1114111,
  39438. e.encodeUTF8 = function(e, t) {
  39439. var i = null;
  39440. for ("number" == typeof e && (i = e,
  39441. e = function() {
  39442. return null
  39443. }
  39444. ); null !== i || null !== (i = e()); )
  39445. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  39446. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  39447. t(i >> 6 & 63 | 128),
  39448. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  39449. t(i >> 12 & 63 | 128),
  39450. t(i >> 6 & 63 | 128),
  39451. t(63 & i | 128)),
  39452. i = null
  39453. }
  39454. ,
  39455. e.decodeUTF8 = function(e, t) {
  39456. for (var i, n, r, o, a = function(e) {
  39457. e = e.slice(0, e.indexOf(null));
  39458. var t = Error(e.toString());
  39459. throw t.name = "TruncatedError",
  39460. t.bytes = e,
  39461. t
  39462. }; null !== (i = e()); )
  39463. if (0 === (128 & i))
  39464. t(i);
  39465. else if (192 === (224 & i))
  39466. null === (n = e()) && a([i, n]),
  39467. t((31 & i) << 6 | 63 & n);
  39468. else if (224 === (240 & i))
  39469. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  39470. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  39471. else {
  39472. if (240 !== (248 & i))
  39473. throw RangeError("Illegal starting byte: " + i);
  39474. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  39475. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  39476. }
  39477. }
  39478. ,
  39479. e.UTF16toUTF8 = function(e, t) {
  39480. for (var i, n = null; ; ) {
  39481. if (null === (i = null !== n ? n : e()))
  39482. break;
  39483. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  39484. n = null) : t(i)
  39485. }
  39486. null !== n && t(n)
  39487. }
  39488. ,
  39489. e.UTF8toUTF16 = function(e, t) {
  39490. var i = null;
  39491. for ("number" == typeof e && (i = e,
  39492. e = function() {
  39493. return null
  39494. }
  39495. ); null !== i || null !== (i = e()); )
  39496. i <= 65535 ? t(i) : (i -= 65536,
  39497. t((i >> 10) + 55296),
  39498. t(i % 1024 + 56320)),
  39499. i = null
  39500. }
  39501. ,
  39502. e.encodeUTF16toUTF8 = function(t, i) {
  39503. e.UTF16toUTF8(t, function(t) {
  39504. e.encodeUTF8(t, i)
  39505. })
  39506. }
  39507. ,
  39508. e.decodeUTF8toUTF16 = function(t, i) {
  39509. e.decodeUTF8(t, function(t) {
  39510. e.UTF8toUTF16(t, i)
  39511. })
  39512. }
  39513. ,
  39514. e.calculateCodePoint = function(e) {
  39515. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39516. }
  39517. ,
  39518. e.calculateUTF8 = function(e) {
  39519. for (var t, i = 0; null !== (t = e()); )
  39520. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  39521. return i
  39522. }
  39523. ,
  39524. e.calculateUTF16asUTF8 = function(t) {
  39525. var i = 0
  39526. , n = 0;
  39527. return e.UTF16toUTF8(t, function(e) {
  39528. ++i,
  39529. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39530. }),
  39531. [i, n]
  39532. }
  39533. ,
  39534. e
  39535. }();
  39536. return a.toUTF8 = function(e, t) {
  39537. if ("undefined" == typeof e && (e = this.offset),
  39538. "undefined" == typeof t && (t = this.limit),
  39539. !this.noAssert) {
  39540. if ("number" != typeof e || e % 1 !== 0)
  39541. throw TypeError("Illegal begin: Not an integer");
  39542. if (e >>>= 0,
  39543. "number" != typeof t || t % 1 !== 0)
  39544. throw TypeError("Illegal end: Not an integer");
  39545. if (t >>>= 0,
  39546. e < 0 || e > t || t > this.buffer.byteLength)
  39547. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39548. }
  39549. var n;
  39550. try {
  39551. h.decodeUTF8toUTF16(function() {
  39552. return e < t ? this.view[e++] : null
  39553. }
  39554. .bind(this), n = i())
  39555. } catch (i) {
  39556. if (e !== t)
  39557. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  39558. }
  39559. return n()
  39560. }
  39561. ,
  39562. o.fromUTF8 = function(e, i, n) {
  39563. if (!n && "string" != typeof e)
  39564. throw TypeError("Illegal str: Not a string");
  39565. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  39566. , a = 0;
  39567. return h.encodeUTF16toUTF8(t(e), function(e) {
  39568. r.view[a++] = e
  39569. }),
  39570. r.limit = a,
  39571. r
  39572. }
  39573. ,
  39574. o
  39575. })
  39576. }
  39577. , {
  39578. long: 216
  39579. }],
  39580. 216: [function(e, t, i) {//long
  39581. !function(i, n) {
  39582. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  39583. }(this, function() {
  39584. "use strict";
  39585. function e(e, t, i) {
  39586. this.low = 0 | e,
  39587. this.high = 0 | t,
  39588. this.unsigned = !!i
  39589. }
  39590. function t(e) {
  39591. return (e && e.__isLong__) === !0
  39592. }
  39593. function i(e, t) {
  39594. var i, n, o;
  39595. return t ? (e >>>= 0,
  39596. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  39597. o && (l[e] = i),
  39598. i)) : (e |= 0,
  39599. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  39600. o && (s[e] = i),
  39601. i))
  39602. }
  39603. function n(e, t) {
  39604. if (isNaN(e) || !isFinite(e))
  39605. return t ? m : g;
  39606. if (t) {
  39607. if (e < 0)
  39608. return m;
  39609. if (e >= d)
  39610. return I
  39611. } else {
  39612. if (e <= -p)
  39613. return E;
  39614. if (e + 1 >= p)
  39615. return C
  39616. }
  39617. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  39618. }
  39619. function r(t, i, n) {
  39620. return new e(t,i,n)
  39621. }
  39622. function o(e, t, i) {
  39623. if (0 === e.length)
  39624. throw Error("empty string");
  39625. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  39626. return g;
  39627. if ("number" == typeof t ? (i = t,
  39628. t = !1) : t = !!t,
  39629. i = i || 10,
  39630. i < 2 || 36 < i)
  39631. throw RangeError("radix");
  39632. var r;
  39633. if ((r = e.indexOf("-")) > 0)
  39634. throw Error("interior hyphen");
  39635. if (0 === r)
  39636. return o(e.substring(1), t, i).neg();
  39637. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  39638. var h = Math.min(8, e.length - l)
  39639. , u = parseInt(e.substring(l, l + h), i);
  39640. if (h < 8) {
  39641. var d = n(c(i, h));
  39642. s = s.mul(d).add(n(u))
  39643. } else
  39644. s = s.mul(a),
  39645. s = s.add(n(u))
  39646. }
  39647. return s.unsigned = t,
  39648. s
  39649. }
  39650. function a(t) {
  39651. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39652. }
  39653. e.prototype.__isLong__,
  39654. Object.defineProperty(e.prototype, "__isLong__", {
  39655. value: !0,
  39656. enumerable: !1,
  39657. configurable: !1
  39658. }),
  39659. e.isLong = t;
  39660. var s = {}
  39661. , l = {};
  39662. e.fromInt = i,
  39663. e.fromNumber = n,
  39664. e.fromBits = r;
  39665. var c = Math.pow;
  39666. e.fromString = o,
  39667. e.fromValue = a;
  39668. var h = 1 << 24
  39669. , u = 4294967296
  39670. , d = 0x10000000000000000
  39671. , p = d / 2
  39672. , f = i(h)
  39673. , g = i(0);
  39674. e.ZERO = g;
  39675. var m = i(0, !0);
  39676. e.UZERO = m;
  39677. var v = i(1);
  39678. e.ONE = v;
  39679. var A = i(1, !0);
  39680. e.UONE = A;
  39681. var y = i(-1);
  39682. e.NEG_ONE = y;
  39683. var C = r(-1, 2147483647, !1);
  39684. e.MAX_VALUE = C;
  39685. var I = r(-1, -1, !0);
  39686. e.MAX_UNSIGNED_VALUE = I;
  39687. var E = r(0, -2147483648, !1);
  39688. e.MIN_VALUE = E;
  39689. var b = e.prototype;
  39690. return b.toInt = function() {
  39691. return this.unsigned ? this.low >>> 0 : this.low
  39692. }
  39693. ,
  39694. b.toNumber = function() {
  39695. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39696. }
  39697. ,
  39698. b.toString = function(e) {
  39699. if (e = e || 10,
  39700. e < 2 || 36 < e)
  39701. throw RangeError("radix");
  39702. if (this.isZero())
  39703. return "0";
  39704. if (this.isNegative()) {
  39705. if (this.eq(E)) {
  39706. var t = n(e)
  39707. , i = this.div(t)
  39708. , r = i.mul(t).sub(this);
  39709. return i.toString(e) + r.toInt().toString(e)
  39710. }
  39711. return "-" + this.neg().toString(e)
  39712. }
  39713. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39714. var l = a.div(o)
  39715. , h = a.sub(l.mul(o)).toInt() >>> 0
  39716. , u = h.toString(e);
  39717. if (a = l,
  39718. a.isZero())
  39719. return u + s;
  39720. for (; u.length < 6; )
  39721. u = "0" + u;
  39722. s = "" + u + s
  39723. }
  39724. }
  39725. ,
  39726. b.getHighBits = function() {
  39727. return this.high
  39728. }
  39729. ,
  39730. b.getHighBitsUnsigned = function() {
  39731. return this.high >>> 0
  39732. }
  39733. ,
  39734. b.getLowBits = function() {
  39735. return this.low
  39736. }
  39737. ,
  39738. b.getLowBitsUnsigned = function() {
  39739. return this.low >>> 0
  39740. }
  39741. ,
  39742. b.getNumBitsAbs = function() {
  39743. if (this.isNegative())
  39744. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39745. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39746. ;
  39747. return 0 != this.high ? t + 33 : t + 1
  39748. }
  39749. ,
  39750. b.isZero = function() {
  39751. return 0 === this.high && 0 === this.low
  39752. }
  39753. ,
  39754. b.isNegative = function() {
  39755. return !this.unsigned && this.high < 0
  39756. }
  39757. ,
  39758. b.isPositive = function() {
  39759. return this.unsigned || this.high >= 0
  39760. }
  39761. ,
  39762. b.isOdd = function() {
  39763. return 1 === (1 & this.low)
  39764. }
  39765. ,
  39766. b.isEven = function() {
  39767. return 0 === (1 & this.low)
  39768. }
  39769. ,
  39770. b.equals = function(e) {
  39771. return t(e) || (e = a(e)),
  39772. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39773. }
  39774. ,
  39775. b.eq = b.equals,
  39776. b.notEquals = function(e) {
  39777. return !this.eq(e)
  39778. }
  39779. ,
  39780. b.neq = b.notEquals,
  39781. b.lessThan = function(e) {
  39782. return this.comp(e) < 0
  39783. }
  39784. ,
  39785. b.lt = b.lessThan,
  39786. b.lessThanOrEqual = function(e) {
  39787. return this.comp(e) <= 0
  39788. }
  39789. ,
  39790. b.lte = b.lessThanOrEqual,
  39791. b.greaterThan = function(e) {
  39792. return this.comp(e) > 0
  39793. }
  39794. ,
  39795. b.gt = b.greaterThan,
  39796. b.greaterThanOrEqual = function(e) {
  39797. return this.comp(e) >= 0
  39798. }
  39799. ,
  39800. b.gte = b.greaterThanOrEqual,
  39801. b.compare = function(e) {
  39802. if (t(e) || (e = a(e)),
  39803. this.eq(e))
  39804. return 0;
  39805. var i = this.isNegative()
  39806. , n = e.isNegative();
  39807. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  39808. }
  39809. ,
  39810. b.comp = b.compare,
  39811. b.negate = function() {
  39812. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39813. }
  39814. ,
  39815. b.neg = b.negate,
  39816. b.add = function(e) {
  39817. t(e) || (e = a(e));
  39818. var i = this.high >>> 16
  39819. , n = 65535 & this.high
  39820. , o = this.low >>> 16
  39821. , s = 65535 & this.low
  39822. , l = e.high >>> 16
  39823. , c = 65535 & e.high
  39824. , h = e.low >>> 16
  39825. , u = 65535 & e.low
  39826. , d = 0
  39827. , p = 0
  39828. , f = 0
  39829. , g = 0;
  39830. return g += s + u,
  39831. f += g >>> 16,
  39832. g &= 65535,
  39833. f += o + h,
  39834. p += f >>> 16,
  39835. f &= 65535,
  39836. p += n + c,
  39837. d += p >>> 16,
  39838. p &= 65535,
  39839. d += i + l,
  39840. d &= 65535,
  39841. r(f << 16 | g, d << 16 | p, this.unsigned)
  39842. }
  39843. ,
  39844. b.subtract = function(e) {
  39845. return t(e) || (e = a(e)),
  39846. this.add(e.neg())
  39847. }
  39848. ,
  39849. b.sub = b.subtract,
  39850. b.multiply = function(e) {
  39851. if (this.isZero())
  39852. return g;
  39853. if (t(e) || (e = a(e)),
  39854. e.isZero())
  39855. return g;
  39856. if (this.eq(E))
  39857. return e.isOdd() ? E : g;
  39858. if (e.eq(E))
  39859. return this.isOdd() ? E : g;
  39860. if (this.isNegative())
  39861. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39862. if (e.isNegative())
  39863. return this.mul(e.neg()).neg();
  39864. if (this.lt(f) && e.lt(f))
  39865. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39866. var i = this.high >>> 16
  39867. , o = 65535 & this.high
  39868. , s = this.low >>> 16
  39869. , l = 65535 & this.low
  39870. , c = e.high >>> 16
  39871. , h = 65535 & e.high
  39872. , u = e.low >>> 16
  39873. , d = 65535 & e.low
  39874. , p = 0
  39875. , m = 0
  39876. , v = 0
  39877. , A = 0;
  39878. return A += l * d,
  39879. v += A >>> 16,
  39880. A &= 65535,
  39881. v += s * d,
  39882. m += v >>> 16,
  39883. v &= 65535,
  39884. v += l * u,
  39885. m += v >>> 16,
  39886. v &= 65535,
  39887. m += o * d,
  39888. p += m >>> 16,
  39889. m &= 65535,
  39890. m += s * u,
  39891. p += m >>> 16,
  39892. m &= 65535,
  39893. m += l * h,
  39894. p += m >>> 16,
  39895. m &= 65535,
  39896. p += i * d + o * u + s * h + l * c,
  39897. p &= 65535,
  39898. r(v << 16 | A, p << 16 | m, this.unsigned)
  39899. }
  39900. ,
  39901. b.mul = b.multiply,
  39902. b.divide = function(e) {
  39903. if (t(e) || (e = a(e)),
  39904. e.isZero())
  39905. throw Error("division by zero");
  39906. if (this.isZero())
  39907. return this.unsigned ? m : g;
  39908. var i, r, o;
  39909. if (this.unsigned) {
  39910. if (e.unsigned || (e = e.toUnsigned()),
  39911. e.gt(this))
  39912. return m;
  39913. if (e.gt(this.shru(1)))
  39914. return A;
  39915. o = m
  39916. } else {
  39917. if (this.eq(E)) {
  39918. if (e.eq(v) || e.eq(y))
  39919. return E;
  39920. if (e.eq(E))
  39921. return v;
  39922. var s = this.shr(1);
  39923. return i = s.div(e).shl(1),
  39924. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39925. o = i.add(r.div(e)))
  39926. }
  39927. if (e.eq(E))
  39928. return this.unsigned ? m : g;
  39929. if (this.isNegative())
  39930. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39931. if (e.isNegative())
  39932. return this.div(e.neg()).neg();
  39933. o = g
  39934. }
  39935. for (r = this; r.gte(e); ) {
  39936. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39937. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  39938. i -= h,
  39939. u = n(i, this.unsigned),
  39940. d = u.mul(e);
  39941. u.isZero() && (u = v),
  39942. o = o.add(u),
  39943. r = r.sub(d)
  39944. }
  39945. return o
  39946. }
  39947. ,
  39948. b.div = b.divide,
  39949. b.modulo = function(e) {
  39950. return t(e) || (e = a(e)),
  39951. this.sub(this.div(e).mul(e))
  39952. }
  39953. ,
  39954. b.mod = b.modulo,
  39955. b.not = function() {
  39956. return r(~this.low, ~this.high, this.unsigned)
  39957. }
  39958. ,
  39959. b.and = function(e) {
  39960. return t(e) || (e = a(e)),
  39961. r(this.low & e.low, this.high & e.high, this.unsigned)
  39962. }
  39963. ,
  39964. b.or = function(e) {
  39965. return t(e) || (e = a(e)),
  39966. r(this.low | e.low, this.high | e.high, this.unsigned)
  39967. }
  39968. ,
  39969. b.xor = function(e) {
  39970. return t(e) || (e = a(e)),
  39971. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39972. }
  39973. ,
  39974. b.shiftLeft = function(e) {
  39975. return t(e) && (e = e.toInt()),
  39976. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  39977. }
  39978. ,
  39979. b.shl = b.shiftLeft,
  39980. b.shiftRight = function(e) {
  39981. return t(e) && (e = e.toInt()),
  39982. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  39983. }
  39984. ,
  39985. b.shr = b.shiftRight,
  39986. b.shiftRightUnsigned = function(e) {
  39987. if (t(e) && (e = e.toInt()),
  39988. e &= 63,
  39989. 0 === e)
  39990. return this;
  39991. var i = this.high;
  39992. if (e < 32) {
  39993. var n = this.low;
  39994. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39995. }
  39996. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39997. }
  39998. ,
  39999. b.shru = b.shiftRightUnsigned,
  40000. b.toSigned = function() {
  40001. return this.unsigned ? r(this.low, this.high, !1) : this
  40002. }
  40003. ,
  40004. b.toUnsigned = function() {
  40005. return this.unsigned ? this : r(this.low, this.high, !0)
  40006. }
  40007. ,
  40008. b.toBytes = function(e) {
  40009. return e ? this.toBytesLE() : this.toBytesBE()
  40010. }
  40011. ,
  40012. b.toBytesLE = function() {
  40013. var e = this.high
  40014. , t = this.low;
  40015. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  40016. }
  40017. ,
  40018. b.toBytesBE = function() {
  40019. var e = this.high
  40020. , t = this.low;
  40021. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  40022. }
  40023. ,
  40024. e
  40025. })
  40026. }
  40027. , {}],
  40028. 217: [function(e, t, i) {//three.js
  40029. var n = {
  40030. REVISION: "75"
  40031. };
  40032. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  40033. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  40034. void 0 === Math.sign && (Math.sign = function(e) {
  40035. return e < 0 ? -1 : e > 0 ? 1 : +e
  40036. }
  40037. ),
  40038. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  40039. get: function() {
  40040. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  40041. }
  40042. }),
  40043. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  40044. writable: !0,
  40045. configurable: !0,
  40046. value: function(e) {
  40047. "use strict";
  40048. if (void 0 === e || null === e)
  40049. throw new TypeError("Cannot convert first argument to object");
  40050. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  40051. var r = arguments[i];
  40052. if (void 0 !== r && null !== r) {
  40053. r = Object(r);
  40054. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  40055. var l = o[a]
  40056. , c = Object.getOwnPropertyDescriptor(r, l);
  40057. void 0 !== c && c.enumerable && (t[l] = r[l])
  40058. }
  40059. }
  40060. }
  40061. return t
  40062. }
  40063. }),
  40064. n.MOUSE = {
  40065. LEFT: 0,
  40066. MIDDLE: 1,
  40067. RIGHT: 2
  40068. },
  40069. n.CullFaceNone = 0,
  40070. n.CullFaceBack = 1,
  40071. n.CullFaceFront = 2,
  40072. n.CullFaceFrontBack = 3,
  40073. n.FrontFaceDirectionCW = 0,
  40074. n.FrontFaceDirectionCCW = 1,
  40075. n.BasicShadowMap = 0,
  40076. n.PCFShadowMap = 1,
  40077. n.PCFSoftShadowMap = 2,
  40078. n.FrontSide = 0,
  40079. n.BackSide = 1,
  40080. n.DoubleSide = 2,
  40081. n.FlatShading = 1,
  40082. n.SmoothShading = 2,
  40083. n.NoColors = 0,
  40084. n.FaceColors = 1,
  40085. n.VertexColors = 2,
  40086. n.NoBlending = 0,
  40087. n.NormalBlending = 1,
  40088. n.AdditiveBlending = 2,
  40089. n.SubtractiveBlending = 3,
  40090. n.MultiplyBlending = 4,
  40091. n.CustomBlending = 5,
  40092. n.AddEquation = 100,
  40093. n.SubtractEquation = 101,
  40094. n.ReverseSubtractEquation = 102,
  40095. n.MinEquation = 103,
  40096. n.MaxEquation = 104,
  40097. n.ZeroFactor = 200,
  40098. n.OneFactor = 201,
  40099. n.SrcColorFactor = 202,
  40100. n.OneMinusSrcColorFactor = 203,
  40101. n.SrcAlphaFactor = 204,
  40102. n.OneMinusSrcAlphaFactor = 205,
  40103. n.DstAlphaFactor = 206,
  40104. n.OneMinusDstAlphaFactor = 207,
  40105. n.DstColorFactor = 208,
  40106. n.OneMinusDstColorFactor = 209,
  40107. n.SrcAlphaSaturateFactor = 210,
  40108. n.NeverDepth = 0,
  40109. n.AlwaysDepth = 1,
  40110. n.LessDepth = 2,
  40111. n.LessEqualDepth = 3,
  40112. n.EqualDepth = 4,
  40113. n.GreaterEqualDepth = 5,
  40114. n.GreaterDepth = 6,
  40115. n.NotEqualDepth = 7,
  40116. n.MultiplyOperation = 0,
  40117. n.MixOperation = 1,
  40118. n.AddOperation = 2,
  40119. n.NoToneMapping = 0,
  40120. n.LinearToneMapping = 1,
  40121. n.ReinhardToneMapping = 2,
  40122. n.Uncharted2ToneMapping = 3,
  40123. n.CineonToneMapping = 4,
  40124. n.UVMapping = 300,
  40125. n.CubeReflectionMapping = 301,
  40126. n.CubeRefractionMapping = 302,
  40127. n.EquirectangularReflectionMapping = 303,
  40128. n.EquirectangularRefractionMapping = 304,
  40129. n.SphericalReflectionMapping = 305,
  40130. n.CubeUVReflectionMapping = 306,
  40131. n.CubeUVRefractionMapping = 307,
  40132. n.RepeatWrapping = 1e3,
  40133. n.ClampToEdgeWrapping = 1001,
  40134. n.MirroredRepeatWrapping = 1002,
  40135. n.NearestFilter = 1003,
  40136. n.NearestMipMapNearestFilter = 1004,
  40137. n.NearestMipMapLinearFilter = 1005,
  40138. n.LinearFilter = 1006,
  40139. n.LinearMipMapNearestFilter = 1007,
  40140. n.LinearMipMapLinearFilter = 1008,
  40141. n.UnsignedByteType = 1009,
  40142. n.ByteType = 1010,
  40143. n.ShortType = 1011,
  40144. n.UnsignedShortType = 1012,
  40145. n.IntType = 1013,
  40146. n.UnsignedIntType = 1014,
  40147. n.FloatType = 1015,
  40148. n.HalfFloatType = 1025,
  40149. n.UnsignedShort4444Type = 1016,
  40150. n.UnsignedShort5551Type = 1017,
  40151. n.UnsignedShort565Type = 1018,
  40152. n.AlphaFormat = 1019,
  40153. n.RGBFormat = 1020,
  40154. n.RGBAFormat = 1021,
  40155. n.LuminanceFormat = 1022,
  40156. n.LuminanceAlphaFormat = 1023,
  40157. n.RGBEFormat = n.RGBAFormat,
  40158. n.RGB_S3TC_DXT1_Format = 2001,
  40159. n.RGBA_S3TC_DXT1_Format = 2002,
  40160. n.RGBA_S3TC_DXT3_Format = 2003,
  40161. n.RGBA_S3TC_DXT5_Format = 2004,
  40162. n.RGB_PVRTC_4BPPV1_Format = 2100,
  40163. n.RGB_PVRTC_2BPPV1_Format = 2101,
  40164. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  40165. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  40166. n.RGB_ETC1_Format = 2151,
  40167. n.LoopOnce = 2200,
  40168. n.LoopRepeat = 2201,
  40169. n.LoopPingPong = 2202,
  40170. n.InterpolateDiscrete = 2300,
  40171. n.InterpolateLinear = 2301,
  40172. n.InterpolateSmooth = 2302,
  40173. n.ZeroCurvatureEnding = 2400,
  40174. n.ZeroSlopeEnding = 2401,
  40175. n.WrapAroundEnding = 2402,
  40176. n.TrianglesDrawMode = 0,
  40177. n.TriangleStripDrawMode = 1,
  40178. n.TriangleFanDrawMode = 2,
  40179. n.LinearEncoding = 3e3,
  40180. n.sRGBEncoding = 3001,
  40181. n.GammaEncoding = 3007,
  40182. n.RGBEEncoding = 3002,
  40183. n.LogLuvEncoding = 3003,
  40184. n.RGBM7Encoding = 3004,
  40185. n.RGBM16Encoding = 3005,
  40186. n.RGBDEncoding = 3006,
  40187. n.Color = function(e) {
  40188. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  40189. }
  40190. ,
  40191. n.Color.prototype = {
  40192. constructor: n.Color,
  40193. r: 1,
  40194. g: 1,
  40195. b: 1,
  40196. set: function(e) {
  40197. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  40198. this
  40199. },
  40200. setScalar: function(e) {
  40201. this.r = e,
  40202. this.g = e,
  40203. this.b = e
  40204. },
  40205. setHex: function(e) {
  40206. return e = Math.floor(e),
  40207. this.r = (e >> 16 & 255) / 255,
  40208. this.g = (e >> 8 & 255) / 255,
  40209. this.b = (255 & e) / 255,
  40210. this
  40211. },
  40212. setRGB: function(e, t, i) {
  40213. return this.r = e,
  40214. this.g = t,
  40215. this.b = i,
  40216. this
  40217. },
  40218. setHSL: function() {
  40219. function e(e, t, i) {
  40220. return i < 0 && (i += 1),
  40221. i > 1 && (i -= 1),
  40222. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  40223. }
  40224. return function(t, i, r) {
  40225. if (t = n.Math.euclideanModulo(t, 1),
  40226. i = n.Math.clamp(i, 0, 1),
  40227. r = n.Math.clamp(r, 0, 1),
  40228. 0 === i)
  40229. this.r = this.g = this.b = r;
  40230. else {
  40231. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  40232. , a = 2 * r - o;
  40233. this.r = e(a, o, t + 1 / 3),
  40234. this.g = e(a, o, t),
  40235. this.b = e(a, o, t - 1 / 3)
  40236. }
  40237. return this
  40238. }
  40239. }(),
  40240. setStyle: function(e) {
  40241. function t(t) {
  40242. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  40243. }
  40244. var i;
  40245. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  40246. var r, o = i[1], a = i[2];
  40247. switch (o) {
  40248. case "rgb":
  40249. case "rgba":
  40250. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  40251. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  40252. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  40253. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  40254. t(r[5]),
  40255. this;
  40256. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  40257. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  40258. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  40259. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  40260. t(r[5]),
  40261. this;
  40262. break;
  40263. case "hsl":
  40264. case "hsla":
  40265. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  40266. var s = parseFloat(r[1]) / 360
  40267. , l = parseInt(r[2], 10) / 100
  40268. , c = parseInt(r[3], 10) / 100;
  40269. return t(r[5]),
  40270. this.setHSL(s, l, c)
  40271. }
  40272. }
  40273. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  40274. var h = i[1]
  40275. , u = h.length;
  40276. if (3 === u)
  40277. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  40278. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  40279. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  40280. this;
  40281. if (6 === u)
  40282. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  40283. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  40284. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  40285. this
  40286. }
  40287. if (e && e.length > 0) {
  40288. var h = n.ColorKeywords[e];
  40289. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  40290. }
  40291. return this
  40292. },
  40293. clone: function() {
  40294. return new this.constructor(this.r,this.g,this.b)
  40295. },
  40296. copy: function(e) {
  40297. return this.r = e.r,
  40298. this.g = e.g,
  40299. this.b = e.b,
  40300. this
  40301. },
  40302. copyGammaToLinear: function(e, t) {
  40303. return void 0 === t && (t = 2),
  40304. this.r = Math.pow(e.r, t),
  40305. this.g = Math.pow(e.g, t),
  40306. this.b = Math.pow(e.b, t),
  40307. this
  40308. },
  40309. copyLinearToGamma: function(e, t) {
  40310. void 0 === t && (t = 2);
  40311. var i = t > 0 ? 1 / t : 1;
  40312. return this.r = Math.pow(e.r, i),
  40313. this.g = Math.pow(e.g, i),
  40314. this.b = Math.pow(e.b, i),
  40315. this
  40316. },
  40317. convertGammaToLinear: function() {
  40318. var e = this.r
  40319. , t = this.g
  40320. , i = this.b;
  40321. return this.r = e * e,
  40322. this.g = t * t,
  40323. this.b = i * i,
  40324. this
  40325. },
  40326. convertLinearToGamma: function() {
  40327. return this.r = Math.sqrt(this.r),
  40328. this.g = Math.sqrt(this.g),
  40329. this.b = Math.sqrt(this.b),
  40330. this
  40331. },
  40332. getHex: function() {
  40333. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  40334. },
  40335. getHexString: function() {
  40336. return ("000000" + this.getHex().toString(16)).slice(-6)
  40337. },
  40338. getHSL: function(e) {
  40339. var t, i, n = e || {
  40340. h: 0,
  40341. s: 0,
  40342. l: 0
  40343. }, r = this.r, o = this.g, a = this.b, s = Math.max(r, o, a), l = Math.min(r, o, a), c = (l + s) / 2;
  40344. if (l === s)
  40345. t = 0,
  40346. i = 0;
  40347. else {
  40348. var h = s - l;
  40349. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  40350. s) {
  40351. case r:
  40352. t = (o - a) / h + (o < a ? 6 : 0);
  40353. break;
  40354. case o:
  40355. t = (a - r) / h + 2;
  40356. break;
  40357. case a:
  40358. t = (r - o) / h + 4
  40359. }
  40360. t /= 6
  40361. }
  40362. return n.h = t,
  40363. n.s = i,
  40364. n.l = c,
  40365. n
  40366. },
  40367. getStyle: function() {
  40368. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  40369. },
  40370. offsetHSL: function(e, t, i) {
  40371. var n = this.getHSL();
  40372. return n.h += e,
  40373. n.s += t,
  40374. n.l += i,
  40375. this.setHSL(n.h, n.s, n.l),
  40376. this
  40377. },
  40378. add: function(e) {
  40379. return this.r += e.r,
  40380. this.g += e.g,
  40381. this.b += e.b,
  40382. this
  40383. },
  40384. addColors: function(e, t) {
  40385. return this.r = e.r + t.r,
  40386. this.g = e.g + t.g,
  40387. this.b = e.b + t.b,
  40388. this
  40389. },
  40390. addScalar: function(e) {
  40391. return this.r += e,
  40392. this.g += e,
  40393. this.b += e,
  40394. this
  40395. },
  40396. multiply: function(e) {
  40397. return this.r *= e.r,
  40398. this.g *= e.g,
  40399. this.b *= e.b,
  40400. this
  40401. },
  40402. multiplyScalar: function(e) {
  40403. return this.r *= e,
  40404. this.g *= e,
  40405. this.b *= e,
  40406. this
  40407. },
  40408. lerp: function(e, t) {
  40409. return this.r += (e.r - this.r) * t,
  40410. this.g += (e.g - this.g) * t,
  40411. this.b += (e.b - this.b) * t,
  40412. this
  40413. },
  40414. equals: function(e) {
  40415. return e.r === this.r && e.g === this.g && e.b === this.b
  40416. },
  40417. fromArray: function(e, t) {
  40418. return void 0 === t && (t = 0),
  40419. this.r = e[t],
  40420. this.g = e[t + 1],
  40421. this.b = e[t + 2],
  40422. this
  40423. },
  40424. toArray: function(e, t) {
  40425. return void 0 === e && (e = []),
  40426. void 0 === t && (t = 0),
  40427. e[t] = this.r,
  40428. e[t + 1] = this.g,
  40429. e[t + 2] = this.b,
  40430. e
  40431. }
  40432. },
  40433. n.ColorKeywords = {
  40434. aliceblue: 15792383,
  40435. antiquewhite: 16444375,
  40436. aqua: 65535,
  40437. aquamarine: 8388564,
  40438. azure: 15794175,
  40439. beige: 16119260,
  40440. bisque: 16770244,
  40441. black: 0,
  40442. blanchedalmond: 16772045,
  40443. blue: 255,
  40444. blueviolet: 9055202,
  40445. brown: 10824234,
  40446. burlywood: 14596231,
  40447. cadetblue: 6266528,
  40448. chartreuse: 8388352,
  40449. chocolate: 13789470,
  40450. coral: 16744272,
  40451. cornflowerblue: 6591981,
  40452. cornsilk: 16775388,
  40453. crimson: 14423100,
  40454. cyan: 65535,
  40455. darkblue: 139,
  40456. darkcyan: 35723,
  40457. darkgoldenrod: 12092939,
  40458. darkgray: 11119017,
  40459. darkgreen: 25600,
  40460. darkgrey: 11119017,
  40461. darkkhaki: 12433259,
  40462. darkmagenta: 9109643,
  40463. darkolivegreen: 5597999,
  40464. darkorange: 16747520,
  40465. darkorchid: 10040012,
  40466. darkred: 9109504,
  40467. darksalmon: 15308410,
  40468. darkseagreen: 9419919,
  40469. darkslateblue: 4734347,
  40470. darkslategray: 3100495,
  40471. darkslategrey: 3100495,
  40472. darkturquoise: 52945,
  40473. darkviolet: 9699539,
  40474. deeppink: 16716947,
  40475. deepskyblue: 49151,
  40476. dimgray: 6908265,
  40477. dimgrey: 6908265,
  40478. dodgerblue: 2003199,
  40479. firebrick: 11674146,
  40480. floralwhite: 16775920,
  40481. forestgreen: 2263842,
  40482. fuchsia: 16711935,
  40483. gainsboro: 14474460,
  40484. ghostwhite: 16316671,
  40485. gold: 16766720,
  40486. goldenrod: 14329120,
  40487. gray: 8421504,
  40488. green: 32768,
  40489. greenyellow: 11403055,
  40490. grey: 8421504,
  40491. honeydew: 15794160,
  40492. hotpink: 16738740,
  40493. indianred: 13458524,
  40494. indigo: 4915330,
  40495. ivory: 16777200,
  40496. khaki: 15787660,
  40497. lavender: 15132410,
  40498. lavenderblush: 16773365,
  40499. lawngreen: 8190976,
  40500. lemonchiffon: 16775885,
  40501. lightblue: 11393254,
  40502. lightcoral: 15761536,
  40503. lightcyan: 14745599,
  40504. lightgoldenrodyellow: 16448210,
  40505. lightgray: 13882323,
  40506. lightgreen: 9498256,
  40507. lightgrey: 13882323,
  40508. lightpink: 16758465,
  40509. lightsalmon: 16752762,
  40510. lightseagreen: 2142890,
  40511. lightskyblue: 8900346,
  40512. lightslategray: 7833753,
  40513. lightslategrey: 7833753,
  40514. lightsteelblue: 11584734,
  40515. lightyellow: 16777184,
  40516. lime: 65280,
  40517. limegreen: 3329330,
  40518. linen: 16445670,
  40519. magenta: 16711935,
  40520. maroon: 8388608,
  40521. mediumaquamarine: 6737322,
  40522. mediumblue: 205,
  40523. mediumorchid: 12211667,
  40524. mediumpurple: 9662683,
  40525. mediumseagreen: 3978097,
  40526. mediumslateblue: 8087790,
  40527. mediumspringgreen: 64154,
  40528. mediumturquoise: 4772300,
  40529. mediumvioletred: 13047173,
  40530. midnightblue: 1644912,
  40531. mintcream: 16121850,
  40532. mistyrose: 16770273,
  40533. moccasin: 16770229,
  40534. navajowhite: 16768685,
  40535. navy: 128,
  40536. oldlace: 16643558,
  40537. olive: 8421376,
  40538. olivedrab: 7048739,
  40539. orange: 16753920,
  40540. orangered: 16729344,
  40541. orchid: 14315734,
  40542. palegoldenrod: 15657130,
  40543. palegreen: 10025880,
  40544. paleturquoise: 11529966,
  40545. palevioletred: 14381203,
  40546. papayawhip: 16773077,
  40547. peachpuff: 16767673,
  40548. peru: 13468991,
  40549. pink: 16761035,
  40550. plum: 14524637,
  40551. powderblue: 11591910,
  40552. purple: 8388736,
  40553. red: 16711680,
  40554. rosybrown: 12357519,
  40555. royalblue: 4286945,
  40556. saddlebrown: 9127187,
  40557. salmon: 16416882,
  40558. sandybrown: 16032864,
  40559. seagreen: 3050327,
  40560. seashell: 16774638,
  40561. sienna: 10506797,
  40562. silver: 12632256,
  40563. skyblue: 8900331,
  40564. slateblue: 6970061,
  40565. slategray: 7372944,
  40566. slategrey: 7372944,
  40567. snow: 16775930,
  40568. springgreen: 65407,
  40569. steelblue: 4620980,
  40570. tan: 13808780,
  40571. teal: 32896,
  40572. thistle: 14204888,
  40573. tomato: 16737095,
  40574. turquoise: 4251856,
  40575. violet: 15631086,
  40576. wheat: 16113331,
  40577. white: 16777215,
  40578. whitesmoke: 16119285,
  40579. yellow: 16776960,
  40580. yellowgreen: 10145074
  40581. },
  40582. n.Quaternion = function(e, t, i, n) {
  40583. this._x = e || 0,
  40584. this._y = t || 0,
  40585. this._z = i || 0,
  40586. this._w = void 0 !== n ? n : 1
  40587. }
  40588. ,
  40589. n.Quaternion.prototype = {
  40590. constructor: n.Quaternion,
  40591. get x() {
  40592. return this._x
  40593. },
  40594. set x(e) {
  40595. this._x = e,
  40596. this.onChangeCallback()
  40597. },
  40598. get y() {
  40599. return this._y
  40600. },
  40601. set y(e) {
  40602. this._y = e,
  40603. this.onChangeCallback()
  40604. },
  40605. get z() {
  40606. return this._z
  40607. },
  40608. set z(e) {
  40609. this._z = e,
  40610. this.onChangeCallback()
  40611. },
  40612. get w() {
  40613. return this._w
  40614. },
  40615. set w(e) {
  40616. this._w = e,
  40617. this.onChangeCallback()
  40618. },
  40619. set: function(e, t, i, n) {
  40620. return this._x = e,
  40621. this._y = t,
  40622. this._z = i,
  40623. this._w = n,
  40624. this.onChangeCallback(),
  40625. this
  40626. },
  40627. clone: function() {
  40628. return new this.constructor(this._x,this._y,this._z,this._w)
  40629. },
  40630. copy: function(e) {
  40631. return this._x = e.x,
  40632. this._y = e.y,
  40633. this._z = e.z,
  40634. this._w = e.w,
  40635. this.onChangeCallback(),
  40636. this
  40637. },
  40638. setFromEuler: function(e, t) {
  40639. if (e instanceof n.Euler == !1)
  40640. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40641. var i = Math.cos(e._x / 2)
  40642. , r = Math.cos(e._y / 2)
  40643. , o = Math.cos(e._z / 2)
  40644. , a = Math.sin(e._x / 2)
  40645. , s = Math.sin(e._y / 2)
  40646. , l = Math.sin(e._z / 2)
  40647. , c = e.order;
  40648. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40649. this._y = i * s * o - a * r * l,
  40650. this._z = i * r * l + a * s * o,
  40651. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40652. this._y = i * s * o - a * r * l,
  40653. this._z = i * r * l - a * s * o,
  40654. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40655. this._y = i * s * o + a * r * l,
  40656. this._z = i * r * l + a * s * o,
  40657. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40658. this._y = i * s * o + a * r * l,
  40659. this._z = i * r * l - a * s * o,
  40660. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40661. this._y = i * s * o + a * r * l,
  40662. this._z = i * r * l - a * s * o,
  40663. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40664. this._y = i * s * o - a * r * l,
  40665. this._z = i * r * l + a * s * o,
  40666. this._w = i * r * o + a * s * l),
  40667. t !== !1 && this.onChangeCallback(),
  40668. this
  40669. },
  40670. setFromAxisAngle: function(e, t) {
  40671. var i = t / 2
  40672. , n = Math.sin(i);
  40673. return this._x = e.x * n,
  40674. this._y = e.y * n,
  40675. this._z = e.z * n,
  40676. this._w = Math.cos(i),
  40677. this.onChangeCallback(),
  40678. this
  40679. },
  40680. setFromRotationMatrix: function(e) {
  40681. var t, i = e.elements, n = i[0], r = i[4], o = i[8], a = i[1], s = i[5], l = i[9], c = i[2], h = i[6], u = i[10], d = n + s + u;
  40682. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40683. this._w = .25 / t,
  40684. this._x = (h - l) * t,
  40685. this._y = (o - c) * t,
  40686. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40687. this._w = (h - l) / t,
  40688. this._x = .25 * t,
  40689. this._y = (r + a) / t,
  40690. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40691. this._w = (o - c) / t,
  40692. this._x = (r + a) / t,
  40693. this._y = .25 * t,
  40694. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40695. this._w = (a - r) / t,
  40696. this._x = (o + c) / t,
  40697. this._y = (l + h) / t,
  40698. this._z = .25 * t),
  40699. this.onChangeCallback(),
  40700. this
  40701. },
  40702. setFromUnitVectors: function() {
  40703. var e, t, i = 1e-6;
  40704. return function(r, o) {
  40705. return void 0 === e && (e = new n.Vector3),
  40706. t = r.dot(o) + 1,
  40707. t < i ? (t = 0,
  40708. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  40709. this._x = e.x,
  40710. this._y = e.y,
  40711. this._z = e.z,
  40712. this._w = t,
  40713. this.normalize(),
  40714. this
  40715. }
  40716. }(),
  40717. inverse: function() {
  40718. return this.conjugate().normalize(),
  40719. this
  40720. },
  40721. conjugate: function() {
  40722. return this._x *= -1,
  40723. this._y *= -1,
  40724. this._z *= -1,
  40725. this.onChangeCallback(),
  40726. this
  40727. },
  40728. dot: function(e) {
  40729. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40730. },
  40731. lengthSq: function() {
  40732. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40733. },
  40734. length: function() {
  40735. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40736. },
  40737. normalize: function() {
  40738. var e = this.length();
  40739. return 0 === e ? (this._x = 0,
  40740. this._y = 0,
  40741. this._z = 0,
  40742. this._w = 1) : (e = 1 / e,
  40743. this._x = this._x * e,
  40744. this._y = this._y * e,
  40745. this._z = this._z * e,
  40746. this._w = this._w * e),
  40747. this.onChangeCallback(),
  40748. this
  40749. },
  40750. multiply: function(e, t) {
  40751. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40752. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40753. },
  40754. multiplyQuaternions: function(e, t) {
  40755. var i = e._x
  40756. , n = e._y
  40757. , r = e._z
  40758. , o = e._w
  40759. , a = t._x
  40760. , s = t._y
  40761. , l = t._z
  40762. , c = t._w;
  40763. return this._x = i * c + o * a + n * l - r * s,
  40764. this._y = n * c + o * s + r * a - i * l,
  40765. this._z = r * c + o * l + i * s - n * a,
  40766. this._w = o * c - i * a - n * s - r * l,
  40767. this.onChangeCallback(),
  40768. this
  40769. },
  40770. slerp: function(e, t) {
  40771. if (0 === t)
  40772. return this;
  40773. if (1 === t)
  40774. return this.copy(e);
  40775. var i = this._x
  40776. , n = this._y
  40777. , r = this._z
  40778. , o = this._w
  40779. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40780. if (a < 0 ? (this._w = -e._w,
  40781. this._x = -e._x,
  40782. this._y = -e._y,
  40783. this._z = -e._z,
  40784. a = -a) : this.copy(e),
  40785. a >= 1)
  40786. return this._w = o,
  40787. this._x = i,
  40788. this._y = n,
  40789. this._z = r,
  40790. this;
  40791. var s = Math.sqrt(1 - a * a);
  40792. if (Math.abs(s) < .001)
  40793. return this._w = .5 * (o + this._w),
  40794. this._x = .5 * (i + this._x),
  40795. this._y = .5 * (n + this._y),
  40796. this._z = .5 * (r + this._z),
  40797. this;
  40798. var l = Math.atan2(s, a)
  40799. , c = Math.sin((1 - t) * l) / s
  40800. , h = Math.sin(t * l) / s;
  40801. return this._w = o * c + this._w * h,
  40802. this._x = i * c + this._x * h,
  40803. this._y = n * c + this._y * h,
  40804. this._z = r * c + this._z * h,
  40805. this.onChangeCallback(),
  40806. this
  40807. },
  40808. equals: function(e) {
  40809. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40810. },
  40811. fromArray: function(e, t) {
  40812. return void 0 === t && (t = 0),
  40813. this._x = e[t],
  40814. this._y = e[t + 1],
  40815. this._z = e[t + 2],
  40816. this._w = e[t + 3],
  40817. this.onChangeCallback(),
  40818. this
  40819. },
  40820. toArray: function(e, t) {
  40821. return void 0 === e && (e = []),
  40822. void 0 === t && (t = 0),
  40823. e[t] = this._x,
  40824. e[t + 1] = this._y,
  40825. e[t + 2] = this._z,
  40826. e[t + 3] = this._w,
  40827. e
  40828. },
  40829. onChange: function(e) {
  40830. return this.onChangeCallback = e,
  40831. this
  40832. },
  40833. onChangeCallback: function() {}
  40834. },
  40835. Object.assign(n.Quaternion, {
  40836. slerp: function(e, t, i, n) {
  40837. return i.copy(e).slerp(t, n)
  40838. },
  40839. slerpFlat: function(e, t, i, n, r, o, a) {
  40840. var s = i[n + 0]
  40841. , l = i[n + 1]
  40842. , c = i[n + 2]
  40843. , h = i[n + 3]
  40844. , u = r[o + 0]
  40845. , d = r[o + 1]
  40846. , p = r[o + 2]
  40847. , f = r[o + 3];
  40848. if (h !== f || s !== u || l !== d || c !== p) {
  40849. var g = 1 - a
  40850. , m = s * u + l * d + c * p + h * f
  40851. , v = m >= 0 ? 1 : -1
  40852. , A = 1 - m * m;
  40853. if (A > Number.EPSILON) {
  40854. var y = Math.sqrt(A)
  40855. , C = Math.atan2(y, m * v);
  40856. g = Math.sin(g * C) / y,
  40857. a = Math.sin(a * C) / y
  40858. }
  40859. var I = a * v;
  40860. if (s = s * g + u * I,
  40861. l = l * g + d * I,
  40862. c = c * g + p * I,
  40863. h = h * g + f * I,
  40864. g === 1 - a) {
  40865. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40866. s *= E,
  40867. l *= E,
  40868. c *= E,
  40869. h *= E
  40870. }
  40871. }
  40872. e[t] = s,
  40873. e[t + 1] = l,
  40874. e[t + 2] = c,
  40875. e[t + 3] = h
  40876. }
  40877. }),
  40878. n.Vector2 = function(e, t) {
  40879. this.x = e || 0,
  40880. this.y = t || 0
  40881. }
  40882. ,
  40883. n.Vector2.prototype = {
  40884. constructor: n.Vector2,
  40885. get width() {
  40886. return this.x
  40887. },
  40888. set width(e) {
  40889. this.x = e
  40890. },
  40891. get height() {
  40892. return this.y
  40893. },
  40894. set height(e) {
  40895. this.y = e
  40896. },
  40897. set: function(e, t) {
  40898. return this.x = e,
  40899. this.y = t,
  40900. this
  40901. },
  40902. setScalar: function(e) {
  40903. return this.x = e,
  40904. this.y = e,
  40905. this
  40906. },
  40907. setX: function(e) {
  40908. return this.x = e,
  40909. this
  40910. },
  40911. setY: function(e) {
  40912. return this.y = e,
  40913. this
  40914. },
  40915. setComponent: function(e, t) {
  40916. switch (e) {
  40917. case 0:
  40918. this.x = t;
  40919. break;
  40920. case 1:
  40921. this.y = t;
  40922. break;
  40923. default:
  40924. throw new Error("index is out of range: " + e)
  40925. }
  40926. },
  40927. getComponent: function(e) {
  40928. switch (e) {
  40929. case 0:
  40930. return this.x;
  40931. case 1:
  40932. return this.y;
  40933. default:
  40934. throw new Error("index is out of range: " + e)
  40935. }
  40936. },
  40937. clone: function() {
  40938. return new this.constructor(this.x,this.y)
  40939. },
  40940. copy: function(e) {
  40941. return this.x = e.x,
  40942. this.y = e.y,
  40943. this
  40944. },
  40945. add: function(e, t) {
  40946. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40947. this.addVectors(e, t)) : (this.x += e.x,
  40948. this.y += e.y,
  40949. this)
  40950. },
  40951. addScalar: function(e) {
  40952. return this.x += e,
  40953. this.y += e,
  40954. this
  40955. },
  40956. addVectors: function(e, t) {
  40957. return this.x = e.x + t.x,
  40958. this.y = e.y + t.y,
  40959. this
  40960. },
  40961. addScaledVector: function(e, t) {
  40962. return this.x += e.x * t,
  40963. this.y += e.y * t,
  40964. this
  40965. },
  40966. sub: function(e, t) {
  40967. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40968. this.subVectors(e, t)) : (this.x -= e.x,
  40969. this.y -= e.y,
  40970. this)
  40971. },
  40972. subScalar: function(e) {
  40973. return this.x -= e,
  40974. this.y -= e,
  40975. this
  40976. },
  40977. subVectors: function(e, t) {
  40978. return this.x = e.x - t.x,
  40979. this.y = e.y - t.y,
  40980. this
  40981. },
  40982. multiply: function(e) {
  40983. return this.x *= e.x,
  40984. this.y *= e.y,
  40985. this
  40986. },
  40987. multiplyScalar: function(e) {
  40988. return isFinite(e) ? (this.x *= e,
  40989. this.y *= e) : (this.x = 0,
  40990. this.y = 0),
  40991. this
  40992. },
  40993. divide: function(e) {
  40994. return this.x /= e.x,
  40995. this.y /= e.y,
  40996. this
  40997. },
  40998. divideScalar: function(e) {
  40999. return this.multiplyScalar(1 / e)
  41000. },
  41001. min: function(e) {
  41002. return this.x = Math.min(this.x, e.x),
  41003. this.y = Math.min(this.y, e.y),
  41004. this
  41005. },
  41006. max: function(e) {
  41007. return this.x = Math.max(this.x, e.x),
  41008. this.y = Math.max(this.y, e.y),
  41009. this
  41010. },
  41011. clamp: function(e, t) {
  41012. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41013. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41014. this
  41015. },
  41016. clampScalar: function() {
  41017. var e, t;
  41018. return function(i, r) {
  41019. return void 0 === e && (e = new n.Vector2,
  41020. t = new n.Vector2),
  41021. e.set(i, i),
  41022. t.set(r, r),
  41023. this.clamp(e, t)
  41024. }
  41025. }(),
  41026. clampLength: function(e, t) {
  41027. var i = this.length();
  41028. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  41029. this
  41030. },
  41031. floor: function() {
  41032. return this.x = Math.floor(this.x),
  41033. this.y = Math.floor(this.y),
  41034. this
  41035. },
  41036. ceil: function() {
  41037. return this.x = Math.ceil(this.x),
  41038. this.y = Math.ceil(this.y),
  41039. this
  41040. },
  41041. round: function() {
  41042. return this.x = Math.round(this.x),
  41043. this.y = Math.round(this.y),
  41044. this
  41045. },
  41046. roundToZero: function() {
  41047. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41048. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41049. this
  41050. },
  41051. negate: function() {
  41052. return this.x = -this.x,
  41053. this.y = -this.y,
  41054. this
  41055. },
  41056. dot: function(e) {
  41057. return this.x * e.x + this.y * e.y
  41058. },
  41059. lengthSq: function() {
  41060. return this.x * this.x + this.y * this.y
  41061. },
  41062. length: function() {
  41063. return Math.sqrt(this.x * this.x + this.y * this.y)
  41064. },
  41065. lengthManhattan: function() {
  41066. return Math.abs(this.x) + Math.abs(this.y)
  41067. },
  41068. normalize: function() {
  41069. return this.divideScalar(this.length())
  41070. },
  41071. angle: function() {
  41072. var e = Math.atan2(this.y, this.x);
  41073. return e < 0 && (e += 2 * Math.PI),
  41074. e
  41075. },
  41076. distanceTo: function(e) {
  41077. return Math.sqrt(this.distanceToSquared(e))
  41078. },
  41079. distanceToSquared: function(e) {
  41080. var t = this.x - e.x
  41081. , i = this.y - e.y;
  41082. return t * t + i * i
  41083. },
  41084. setLength: function(e) {
  41085. return this.multiplyScalar(e / this.length())
  41086. },
  41087. lerp: function(e, t) {
  41088. return this.x += (e.x - this.x) * t,
  41089. this.y += (e.y - this.y) * t,
  41090. this
  41091. },
  41092. lerpVectors: function(e, t, i) {
  41093. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41094. this
  41095. },
  41096. equals: function(e) {
  41097. return e.x === this.x && e.y === this.y
  41098. },
  41099. fromArray: function(e, t) {
  41100. return void 0 === t && (t = 0),
  41101. this.x = e[t],
  41102. this.y = e[t + 1],
  41103. this
  41104. },
  41105. toArray: function(e, t) {
  41106. return void 0 === e && (e = []),
  41107. void 0 === t && (t = 0),
  41108. e[t] = this.x,
  41109. e[t + 1] = this.y,
  41110. e
  41111. },
  41112. fromAttribute: function(e, t, i) {
  41113. return void 0 === i && (i = 0),
  41114. t = t * e.itemSize + i,
  41115. this.x = e.array[t],
  41116. this.y = e.array[t + 1],
  41117. this
  41118. },
  41119. rotateAround: function(e, t) {
  41120. var i = Math.cos(t)
  41121. , n = Math.sin(t)
  41122. , r = this.x - e.x
  41123. , o = this.y - e.y;
  41124. return this.x = r * i - o * n + e.x,
  41125. this.y = r * n + o * i + e.y,
  41126. this
  41127. }
  41128. },
  41129. n.Vector3 = function(e, t, i) {
  41130. this.x = e || 0,
  41131. this.y = t || 0,
  41132. this.z = i || 0
  41133. }
  41134. ,
  41135. n.Vector3.prototype = {
  41136. constructor: n.Vector3,
  41137. set: function(e, t, i) {
  41138. return this.x = e,
  41139. this.y = t,
  41140. this.z = i,
  41141. this
  41142. },
  41143. setScalar: function(e) {
  41144. return this.x = e,
  41145. this.y = e,
  41146. this.z = e,
  41147. this
  41148. },
  41149. setX: function(e) {
  41150. return this.x = e,
  41151. this
  41152. },
  41153. setY: function(e) {
  41154. return this.y = e,
  41155. this
  41156. },
  41157. setZ: function(e) {
  41158. return this.z = e,
  41159. this
  41160. },
  41161. setComponent: function(e, t) {
  41162. switch (e) {
  41163. case 0:
  41164. this.x = t;
  41165. break;
  41166. case 1:
  41167. this.y = t;
  41168. break;
  41169. case 2:
  41170. this.z = t;
  41171. break;
  41172. default:
  41173. throw new Error("index is out of range: " + e)
  41174. }
  41175. },
  41176. getComponent: function(e) {
  41177. switch (e) {
  41178. case 0:
  41179. return this.x;
  41180. case 1:
  41181. return this.y;
  41182. case 2:
  41183. return this.z;
  41184. default:
  41185. throw new Error("index is out of range: " + e)
  41186. }
  41187. },
  41188. clone: function() {
  41189. return new this.constructor(this.x,this.y,this.z)
  41190. },
  41191. copy: function(e) {
  41192. return this.x = e.x,
  41193. this.y = e.y,
  41194. this.z = e.z,
  41195. this
  41196. },
  41197. add: function(e, t) {
  41198. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41199. this.addVectors(e, t)) : (this.x += e.x,
  41200. this.y += e.y,
  41201. this.z += e.z,
  41202. this)
  41203. },
  41204. addScalar: function(e) {
  41205. return this.x += e,
  41206. this.y += e,
  41207. this.z += e,
  41208. this
  41209. },
  41210. addVectors: function(e, t) {
  41211. return this.x = e.x + t.x,
  41212. this.y = e.y + t.y,
  41213. this.z = e.z + t.z,
  41214. this
  41215. },
  41216. addScaledVector: function(e, t) {
  41217. return this.x += e.x * t,
  41218. this.y += e.y * t,
  41219. this.z += e.z * t,
  41220. this
  41221. },
  41222. sub: function(e, t) {
  41223. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41224. this.subVectors(e, t)) : (this.x -= e.x,
  41225. this.y -= e.y,
  41226. this.z -= e.z,
  41227. this)
  41228. },
  41229. subScalar: function(e) {
  41230. return this.x -= e,
  41231. this.y -= e,
  41232. this.z -= e,
  41233. this
  41234. },
  41235. subVectors: function(e, t) {
  41236. return this.x = e.x - t.x,
  41237. this.y = e.y - t.y,
  41238. this.z = e.z - t.z,
  41239. this
  41240. },
  41241. multiply: function(e, t) {
  41242. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  41243. this.multiplyVectors(e, t)) : (this.x *= e.x,
  41244. this.y *= e.y,
  41245. this.z *= e.z,
  41246. this)
  41247. },
  41248. multiplyScalar: function(e) {
  41249. return isFinite(e) ? (this.x *= e,
  41250. this.y *= e,
  41251. this.z *= e) : (this.x = 0,
  41252. this.y = 0,
  41253. this.z = 0),
  41254. this
  41255. },
  41256. multiplyVectors: function(e, t) {
  41257. return this.x = e.x * t.x,
  41258. this.y = e.y * t.y,
  41259. this.z = e.z * t.z,
  41260. this
  41261. },
  41262. applyEuler: function() {
  41263. var e;
  41264. return function(t) {
  41265. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  41266. void 0 === e && (e = new n.Quaternion),
  41267. this.applyQuaternion(e.setFromEuler(t)),
  41268. this
  41269. }
  41270. }(),
  41271. applyAxisAngle: function() {
  41272. var e;
  41273. return function(t, i) {
  41274. return void 0 === e && (e = new n.Quaternion),
  41275. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  41276. this
  41277. }
  41278. }(),
  41279. applyMatrix3: function(e) {
  41280. var t = this.x
  41281. , i = this.y
  41282. , n = this.z
  41283. , r = e.elements;
  41284. return this.x = r[0] * t + r[3] * i + r[6] * n,
  41285. this.y = r[1] * t + r[4] * i + r[7] * n,
  41286. this.z = r[2] * t + r[5] * i + r[8] * n,
  41287. this
  41288. },
  41289. applyMatrix4: function(e) {
  41290. var t = this.x
  41291. , i = this.y
  41292. , n = this.z
  41293. , r = e.elements;
  41294. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  41295. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  41296. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  41297. this
  41298. },
  41299. applyProjection: function(e) {
  41300. var t = this.x
  41301. , i = this.y
  41302. , n = this.z
  41303. , r = e.elements
  41304. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  41305. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  41306. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  41307. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  41308. this
  41309. },
  41310. applyQuaternion: function(e) {
  41311. var t = this.x
  41312. , i = this.y
  41313. , n = this.z
  41314. , r = e.x
  41315. , o = e.y
  41316. , a = e.z
  41317. , s = e.w
  41318. , l = s * t + o * n - a * i
  41319. , c = s * i + a * t - r * n
  41320. , h = s * n + r * i - o * t
  41321. , u = -r * t - o * i - a * n;
  41322. return this.x = l * s + u * -r + c * -a - h * -o,
  41323. this.y = c * s + u * -o + h * -r - l * -a,
  41324. this.z = h * s + u * -a + l * -o - c * -r,
  41325. this
  41326. },
  41327. project: function() {
  41328. var e;
  41329. return function(t) {
  41330. return void 0 === e && (e = new n.Matrix4),
  41331. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  41332. this.applyProjection(e)
  41333. }
  41334. }(),
  41335. unproject: function() {
  41336. var e;
  41337. return function(t) {
  41338. return void 0 === e && (e = new n.Matrix4),
  41339. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  41340. this.applyProjection(e)
  41341. }
  41342. }(),
  41343. transformDirection: function(e) {
  41344. var t = this.x
  41345. , i = this.y
  41346. , n = this.z
  41347. , r = e.elements;
  41348. return this.x = r[0] * t + r[4] * i + r[8] * n,
  41349. this.y = r[1] * t + r[5] * i + r[9] * n,
  41350. this.z = r[2] * t + r[6] * i + r[10] * n,
  41351. this.normalize(),
  41352. this
  41353. },
  41354. divide: function(e) {
  41355. return this.x /= e.x,
  41356. this.y /= e.y,
  41357. this.z /= e.z,
  41358. this
  41359. },
  41360. divideScalar: function(e) {
  41361. return this.multiplyScalar(1 / e)
  41362. },
  41363. min: function(e) {
  41364. return this.x = Math.min(this.x, e.x),
  41365. this.y = Math.min(this.y, e.y),
  41366. this.z = Math.min(this.z, e.z),
  41367. this
  41368. },
  41369. max: function(e) {
  41370. return this.x = Math.max(this.x, e.x),
  41371. this.y = Math.max(this.y, e.y),
  41372. this.z = Math.max(this.z, e.z),
  41373. this
  41374. },
  41375. clamp: function(e, t) {
  41376. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41377. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41378. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41379. this
  41380. },
  41381. clampScalar: function() {
  41382. var e, t;
  41383. return function(i, r) {
  41384. return void 0 === e && (e = new n.Vector3,
  41385. t = new n.Vector3),
  41386. e.set(i, i, i),
  41387. t.set(r, r, r),
  41388. this.clamp(e, t)
  41389. }
  41390. }(),
  41391. clampLength: function(e, t) {
  41392. var i = this.length();
  41393. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  41394. this
  41395. },
  41396. floor: function() {
  41397. return this.x = Math.floor(this.x),
  41398. this.y = Math.floor(this.y),
  41399. this.z = Math.floor(this.z),
  41400. this
  41401. },
  41402. ceil: function() {
  41403. return this.x = Math.ceil(this.x),
  41404. this.y = Math.ceil(this.y),
  41405. this.z = Math.ceil(this.z),
  41406. this
  41407. },
  41408. round: function() {
  41409. return this.x = Math.round(this.x),
  41410. this.y = Math.round(this.y),
  41411. this.z = Math.round(this.z),
  41412. this
  41413. },
  41414. roundToZero: function() {
  41415. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41416. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41417. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41418. this
  41419. },
  41420. negate: function() {
  41421. return this.x = -this.x,
  41422. this.y = -this.y,
  41423. this.z = -this.z,
  41424. this
  41425. },
  41426. dot: function(e) {
  41427. return this.x * e.x + this.y * e.y + this.z * e.z
  41428. },
  41429. lengthSq: function() {
  41430. return this.x * this.x + this.y * this.y + this.z * this.z
  41431. },
  41432. length: function() {
  41433. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  41434. },
  41435. lengthManhattan: function() {
  41436. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  41437. },
  41438. normalize: function() {
  41439. return this.divideScalar(this.length())
  41440. },
  41441. setLength: function(e) {
  41442. return this.multiplyScalar(e / this.length())
  41443. },
  41444. lerp: function(e, t) {
  41445. return this.x += (e.x - this.x) * t,
  41446. this.y += (e.y - this.y) * t,
  41447. this.z += (e.z - this.z) * t,
  41448. this
  41449. },
  41450. lerpVectors: function(e, t, i) {
  41451. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41452. this
  41453. },
  41454. cross: function(e, t) {
  41455. if (void 0 !== t)
  41456. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  41457. this.crossVectors(e, t);
  41458. var i = this.x
  41459. , n = this.y
  41460. , r = this.z;
  41461. return this.x = n * e.z - r * e.y,
  41462. this.y = r * e.x - i * e.z,
  41463. this.z = i * e.y - n * e.x,
  41464. this
  41465. },
  41466. crossVectors: function(e, t) {
  41467. var i = e.x
  41468. , n = e.y
  41469. , r = e.z
  41470. , o = t.x
  41471. , a = t.y
  41472. , s = t.z;
  41473. return this.x = n * s - r * a,
  41474. this.y = r * o - i * s,
  41475. this.z = i * a - n * o,
  41476. this
  41477. },
  41478. projectOnVector: function() {
  41479. var e, t;
  41480. return function(i) {
  41481. return void 0 === e && (e = new n.Vector3),
  41482. e.copy(i).normalize(),
  41483. t = this.dot(e),
  41484. this.copy(e).multiplyScalar(t)
  41485. }
  41486. }(),
  41487. projectOnPlane: function() {
  41488. var e;
  41489. return function(t) {
  41490. return void 0 === e && (e = new n.Vector3),
  41491. e.copy(this).projectOnVector(t),
  41492. this.sub(e)
  41493. }
  41494. }(),
  41495. reflect: function() {
  41496. var e;
  41497. return function(t) {
  41498. return void 0 === e && (e = new n.Vector3),
  41499. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  41500. }
  41501. }(),
  41502. angleTo: function(e) {
  41503. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  41504. return Math.acos(n.Math.clamp(t, -1, 1))
  41505. },
  41506. distanceTo: function(e) {
  41507. return Math.sqrt(this.distanceToSquared(e))
  41508. },
  41509. distanceToSquared: function(e) {
  41510. var t = this.x - e.x
  41511. , i = this.y - e.y
  41512. , n = this.z - e.z;
  41513. return t * t + i * i + n * n
  41514. },
  41515. setFromSpherical: function(e) {
  41516. var t = Math.sin(e.phi) * e.radius;
  41517. return this.x = t * Math.sin(e.theta),
  41518. this.y = Math.cos(e.phi) * e.radius,
  41519. this.z = t * Math.cos(e.theta),
  41520. this
  41521. },
  41522. setFromMatrixPosition: function(e) {
  41523. return this.setFromMatrixColumn(e, 3)
  41524. },
  41525. setFromMatrixScale: function(e) {
  41526. var t = this.setFromMatrixColumn(e, 0).length()
  41527. , i = this.setFromMatrixColumn(e, 1).length()
  41528. , n = this.setFromMatrixColumn(e, 2).length();
  41529. return this.x = t,
  41530. this.y = i,
  41531. this.z = n,
  41532. this
  41533. },
  41534. setFromMatrixColumn: function(e, t) {
  41535. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  41536. e = arguments[1],
  41537. t = arguments[0]),
  41538. this.fromArray(e.elements, 4 * t)
  41539. },
  41540. equals: function(e) {
  41541. return e.x === this.x && e.y === this.y && e.z === this.z
  41542. },
  41543. fromArray: function(e, t) {
  41544. return void 0 === t && (t = 0),
  41545. this.x = e[t],
  41546. this.y = e[t + 1],
  41547. this.z = e[t + 2],
  41548. this
  41549. },
  41550. toArray: function(e, t) {
  41551. return void 0 === e && (e = []),
  41552. void 0 === t && (t = 0),
  41553. e[t] = this.x,
  41554. e[t + 1] = this.y,
  41555. e[t + 2] = this.z,
  41556. e
  41557. },
  41558. fromAttribute: function(e, t, i) {
  41559. return void 0 === i && (i = 0),
  41560. t = t * e.itemSize + i,
  41561. this.x = e.array[t],
  41562. this.y = e.array[t + 1],
  41563. this.z = e.array[t + 2],
  41564. this
  41565. }
  41566. },
  41567. n.Vector4 = function(e, t, i, n) {
  41568. this.x = e || 0,
  41569. this.y = t || 0,
  41570. this.z = i || 0,
  41571. this.w = void 0 !== n ? n : 1
  41572. }
  41573. ,
  41574. n.Vector4.prototype = {
  41575. constructor: n.Vector4,
  41576. set: function(e, t, i, n) {
  41577. return this.x = e,
  41578. this.y = t,
  41579. this.z = i,
  41580. this.w = n,
  41581. this
  41582. },
  41583. setScalar: function(e) {
  41584. return this.x = e,
  41585. this.y = e,
  41586. this.z = e,
  41587. this.w = e,
  41588. this
  41589. },
  41590. setX: function(e) {
  41591. return this.x = e,
  41592. this
  41593. },
  41594. setY: function(e) {
  41595. return this.y = e,
  41596. this
  41597. },
  41598. setZ: function(e) {
  41599. return this.z = e,
  41600. this
  41601. },
  41602. setW: function(e) {
  41603. return this.w = e,
  41604. this
  41605. },
  41606. setComponent: function(e, t) {
  41607. switch (e) {
  41608. case 0:
  41609. this.x = t;
  41610. break;
  41611. case 1:
  41612. this.y = t;
  41613. break;
  41614. case 2:
  41615. this.z = t;
  41616. break;
  41617. case 3:
  41618. this.w = t;
  41619. break;
  41620. default:
  41621. throw new Error("index is out of range: " + e)
  41622. }
  41623. },
  41624. getComponent: function(e) {
  41625. switch (e) {
  41626. case 0:
  41627. return this.x;
  41628. case 1:
  41629. return this.y;
  41630. case 2:
  41631. return this.z;
  41632. case 3:
  41633. return this.w;
  41634. default:
  41635. throw new Error("index is out of range: " + e)
  41636. }
  41637. },
  41638. clone: function() {
  41639. return new this.constructor(this.x,this.y,this.z,this.w)
  41640. },
  41641. copy: function(e) {
  41642. return this.x = e.x,
  41643. this.y = e.y,
  41644. this.z = e.z,
  41645. this.w = void 0 !== e.w ? e.w : 1,
  41646. this
  41647. },
  41648. add: function(e, t) {
  41649. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41650. this.addVectors(e, t)) : (this.x += e.x,
  41651. this.y += e.y,
  41652. this.z += e.z,
  41653. this.w += e.w,
  41654. this)
  41655. },
  41656. addScalar: function(e) {
  41657. return this.x += e,
  41658. this.y += e,
  41659. this.z += e,
  41660. this.w += e,
  41661. this
  41662. },
  41663. addVectors: function(e, t) {
  41664. return this.x = e.x + t.x,
  41665. this.y = e.y + t.y,
  41666. this.z = e.z + t.z,
  41667. this.w = e.w + t.w,
  41668. this
  41669. },
  41670. addScaledVector: function(e, t) {
  41671. return this.x += e.x * t,
  41672. this.y += e.y * t,
  41673. this.z += e.z * t,
  41674. this.w += e.w * t,
  41675. this
  41676. },
  41677. sub: function(e, t) {
  41678. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41679. this.subVectors(e, t)) : (this.x -= e.x,
  41680. this.y -= e.y,
  41681. this.z -= e.z,
  41682. this.w -= e.w,
  41683. this)
  41684. },
  41685. subScalar: function(e) {
  41686. return this.x -= e,
  41687. this.y -= e,
  41688. this.z -= e,
  41689. this.w -= e,
  41690. this
  41691. },
  41692. subVectors: function(e, t) {
  41693. return this.x = e.x - t.x,
  41694. this.y = e.y - t.y,
  41695. this.z = e.z - t.z,
  41696. this.w = e.w - t.w,
  41697. this
  41698. },
  41699. multiplyScalar: function(e) {
  41700. return isFinite(e) ? (this.x *= e,
  41701. this.y *= e,
  41702. this.z *= e,
  41703. this.w *= e) : (this.x = 0,
  41704. this.y = 0,
  41705. this.z = 0,
  41706. this.w = 0),
  41707. this
  41708. },
  41709. applyMatrix4: function(e) {
  41710. var t = this.x
  41711. , i = this.y
  41712. , n = this.z
  41713. , r = this.w
  41714. , o = e.elements;
  41715. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41716. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41717. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41718. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41719. this
  41720. },
  41721. divideScalar: function(e) {
  41722. return this.multiplyScalar(1 / e)
  41723. },
  41724. setAxisAngleFromQuaternion: function(e) {
  41725. this.w = 2 * Math.acos(e.w);
  41726. var t = Math.sqrt(1 - e.w * e.w);
  41727. return t < 1e-4 ? (this.x = 1,
  41728. this.y = 0,
  41729. this.z = 0) : (this.x = e.x / t,
  41730. this.y = e.y / t,
  41731. this.z = e.z / t),
  41732. this
  41733. },
  41734. setAxisAngleFromRotationMatrix: function(e) {
  41735. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  41736. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41737. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41738. return this.set(1, 0, 0, 0),
  41739. this;
  41740. t = Math.PI;
  41741. var v = (l + 1) / 2
  41742. , A = (d + 1) / 2
  41743. , y = (m + 1) / 2
  41744. , C = (c + u) / 4
  41745. , I = (h + f) / 4
  41746. , E = (p + g) / 4;
  41747. return v > A && v > y ? v < o ? (i = 0,
  41748. n = .707106781,
  41749. r = .707106781) : (i = Math.sqrt(v),
  41750. n = C / i,
  41751. r = I / i) : A > y ? A < o ? (i = .707106781,
  41752. n = 0,
  41753. r = .707106781) : (n = Math.sqrt(A),
  41754. i = C / n,
  41755. r = E / n) : y < o ? (i = .707106781,
  41756. n = .707106781,
  41757. r = 0) : (r = Math.sqrt(y),
  41758. i = I / r,
  41759. n = E / r),
  41760. this.set(i, n, r, t),
  41761. this
  41762. }
  41763. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41764. return Math.abs(b) < .001 && (b = 1),
  41765. this.x = (g - p) / b,
  41766. this.y = (h - f) / b,
  41767. this.z = (u - c) / b,
  41768. this.w = Math.acos((l + d + m - 1) / 2),
  41769. this
  41770. },
  41771. min: function(e) {
  41772. return this.x = Math.min(this.x, e.x),
  41773. this.y = Math.min(this.y, e.y),
  41774. this.z = Math.min(this.z, e.z),
  41775. this.w = Math.min(this.w, e.w),
  41776. this
  41777. },
  41778. max: function(e) {
  41779. return this.x = Math.max(this.x, e.x),
  41780. this.y = Math.max(this.y, e.y),
  41781. this.z = Math.max(this.z, e.z),
  41782. this.w = Math.max(this.w, e.w),
  41783. this
  41784. },
  41785. clamp: function(e, t) {
  41786. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41787. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41788. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41789. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41790. this
  41791. },
  41792. clampScalar: function() {
  41793. var e, t;
  41794. return function(i, r) {
  41795. return void 0 === e && (e = new n.Vector4,
  41796. t = new n.Vector4),
  41797. e.set(i, i, i, i),
  41798. t.set(r, r, r, r),
  41799. this.clamp(e, t)
  41800. }
  41801. }(),
  41802. floor: function() {
  41803. return this.x = Math.floor(this.x),
  41804. this.y = Math.floor(this.y),
  41805. this.z = Math.floor(this.z),
  41806. this.w = Math.floor(this.w),
  41807. this
  41808. },
  41809. ceil: function() {
  41810. return this.x = Math.ceil(this.x),
  41811. this.y = Math.ceil(this.y),
  41812. this.z = Math.ceil(this.z),
  41813. this.w = Math.ceil(this.w),
  41814. this
  41815. },
  41816. round: function() {
  41817. return this.x = Math.round(this.x),
  41818. this.y = Math.round(this.y),
  41819. this.z = Math.round(this.z),
  41820. this.w = Math.round(this.w),
  41821. this
  41822. },
  41823. roundToZero: function() {
  41824. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41825. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41826. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41827. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41828. this
  41829. },
  41830. negate: function() {
  41831. return this.x = -this.x,
  41832. this.y = -this.y,
  41833. this.z = -this.z,
  41834. this.w = -this.w,
  41835. this
  41836. },
  41837. dot: function(e) {
  41838. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41839. },
  41840. lengthSq: function() {
  41841. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41842. },
  41843. length: function() {
  41844. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41845. },
  41846. lengthManhattan: function() {
  41847. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41848. },
  41849. normalize: function() {
  41850. return this.divideScalar(this.length())
  41851. },
  41852. setLength: function(e) {
  41853. return this.multiplyScalar(e / this.length())
  41854. },
  41855. lerp: function(e, t) {
  41856. return this.x += (e.x - this.x) * t,
  41857. this.y += (e.y - this.y) * t,
  41858. this.z += (e.z - this.z) * t,
  41859. this.w += (e.w - this.w) * t,
  41860. this
  41861. },
  41862. lerpVectors: function(e, t, i) {
  41863. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41864. this
  41865. },
  41866. equals: function(e) {
  41867. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41868. },
  41869. fromArray: function(e, t) {
  41870. return void 0 === t && (t = 0),
  41871. this.x = e[t],
  41872. this.y = e[t + 1],
  41873. this.z = e[t + 2],
  41874. this.w = e[t + 3],
  41875. this
  41876. },
  41877. toArray: function(e, t) {
  41878. return void 0 === e && (e = []),
  41879. void 0 === t && (t = 0),
  41880. e[t] = this.x,
  41881. e[t + 1] = this.y,
  41882. e[t + 2] = this.z,
  41883. e[t + 3] = this.w,
  41884. e
  41885. },
  41886. fromAttribute: function(e, t, i) {
  41887. return void 0 === i && (i = 0),
  41888. t = t * e.itemSize + i,
  41889. this.x = e.array[t],
  41890. this.y = e.array[t + 1],
  41891. this.z = e.array[t + 2],
  41892. this.w = e.array[t + 3],
  41893. this
  41894. }
  41895. },
  41896. n.Euler = function(e, t, i, r) {
  41897. this._x = e || 0,
  41898. this._y = t || 0,
  41899. this._z = i || 0,
  41900. this._order = r || n.Euler.DefaultOrder
  41901. }
  41902. ,
  41903. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41904. n.Euler.DefaultOrder = "XYZ",
  41905. n.Euler.prototype = {
  41906. constructor: n.Euler,
  41907. get x() {
  41908. return this._x
  41909. },
  41910. set x(e) {
  41911. this._x = e,
  41912. this.onChangeCallback()
  41913. },
  41914. get y() {
  41915. return this._y
  41916. },
  41917. set y(e) {
  41918. this._y = e,
  41919. this.onChangeCallback()
  41920. },
  41921. get z() {
  41922. return this._z
  41923. },
  41924. set z(e) {
  41925. this._z = e,
  41926. this.onChangeCallback()
  41927. },
  41928. get order() {
  41929. return this._order
  41930. },
  41931. set order(e) {
  41932. this._order = e,
  41933. this.onChangeCallback()
  41934. },
  41935. set: function(e, t, i, n) {
  41936. return this._x = e,
  41937. this._y = t,
  41938. this._z = i,
  41939. this._order = n || this._order,
  41940. this.onChangeCallback(),
  41941. this
  41942. },
  41943. clone: function() {
  41944. return new this.constructor(this._x,this._y,this._z,this._order)
  41945. },
  41946. copy: function(e) {
  41947. return this._x = e._x,
  41948. this._y = e._y,
  41949. this._z = e._z,
  41950. this._order = e._order,
  41951. this.onChangeCallback(),
  41952. this
  41953. },
  41954. setFromRotationMatrix: function(e, t, i) {
  41955. var r = n.Math.clamp
  41956. , o = e.elements
  41957. , a = o[0]
  41958. , s = o[4]
  41959. , l = o[8]
  41960. , c = o[1]
  41961. , h = o[5]
  41962. , u = o[9]
  41963. , d = o[2]
  41964. , p = o[6]
  41965. , f = o[10];
  41966. return t = t || this._order,
  41967. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41968. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41969. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41970. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41971. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41972. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41973. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41974. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41975. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41976. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41977. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41978. this._z = Math.atan2(c, a)) : (this._x = 0,
  41979. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41980. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41981. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41982. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41983. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41984. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41985. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41986. this._order = t,
  41987. i !== !1 && this.onChangeCallback(),
  41988. this
  41989. },
  41990. setFromQuaternion: function() {
  41991. var e;
  41992. return function(t, i, r) {
  41993. return void 0 === e && (e = new n.Matrix4),
  41994. e.makeRotationFromQuaternion(t),
  41995. this.setFromRotationMatrix(e, i, r),
  41996. this
  41997. }
  41998. }(),
  41999. setFromVector3: function(e, t) {
  42000. return this.set(e.x, e.y, e.z, t || this._order)
  42001. },
  42002. reorder: function() {
  42003. var e = new n.Quaternion;
  42004. return function(t) {
  42005. e.setFromEuler(this),
  42006. this.setFromQuaternion(e, t)
  42007. }
  42008. }(),
  42009. equals: function(e) {
  42010. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  42011. },
  42012. fromArray: function(e) {
  42013. return this._x = e[0],
  42014. this._y = e[1],
  42015. this._z = e[2],
  42016. void 0 !== e[3] && (this._order = e[3]),
  42017. this.onChangeCallback(),
  42018. this
  42019. },
  42020. toArray: function(e, t) {
  42021. return void 0 === e && (e = []),
  42022. void 0 === t && (t = 0),
  42023. e[t] = this._x,
  42024. e[t + 1] = this._y,
  42025. e[t + 2] = this._z,
  42026. e[t + 3] = this._order,
  42027. e
  42028. },
  42029. toVector3: function(e) {
  42030. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  42031. },
  42032. onChange: function(e) {
  42033. return this.onChangeCallback = e,
  42034. this
  42035. },
  42036. onChangeCallback: function() {}
  42037. },
  42038. n.Line3 = function(e, t) {
  42039. this.start = void 0 !== e ? e : new n.Vector3,
  42040. this.end = void 0 !== t ? t : new n.Vector3
  42041. }
  42042. ,
  42043. n.Line3.prototype = {
  42044. constructor: n.Line3,
  42045. set: function(e, t) {
  42046. return this.start.copy(e),
  42047. this.end.copy(t),
  42048. this
  42049. },
  42050. clone: function() {
  42051. return (new this.constructor).copy(this)
  42052. },
  42053. copy: function(e) {
  42054. return this.start.copy(e.start),
  42055. this.end.copy(e.end),
  42056. this
  42057. },
  42058. center: function(e) {
  42059. var t = e || new n.Vector3;
  42060. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  42061. },
  42062. delta: function(e) {
  42063. var t = e || new n.Vector3;
  42064. return t.subVectors(this.end, this.start)
  42065. },
  42066. distanceSq: function() {
  42067. return this.start.distanceToSquared(this.end)
  42068. },
  42069. distance: function() {
  42070. return this.start.distanceTo(this.end)
  42071. },
  42072. at: function(e, t) {
  42073. var i = t || new n.Vector3;
  42074. return this.delta(i).multiplyScalar(e).add(this.start)
  42075. },
  42076. closestPointToPointParameter: function() {
  42077. var e = new n.Vector3
  42078. , t = new n.Vector3;
  42079. return function(i, r) {
  42080. e.subVectors(i, this.start),
  42081. t.subVectors(this.end, this.start);
  42082. var o = t.dot(t)
  42083. , a = t.dot(e)
  42084. , s = a / o;
  42085. return r && (s = n.Math.clamp(s, 0, 1)),
  42086. s
  42087. }
  42088. }(),
  42089. closestPointToPoint: function(e, t, i) {
  42090. var r = this.closestPointToPointParameter(e, t)
  42091. , o = i || new n.Vector3;
  42092. return this.delta(o).multiplyScalar(r).add(this.start)
  42093. },
  42094. applyMatrix4: function(e) {
  42095. return this.start.applyMatrix4(e),
  42096. this.end.applyMatrix4(e),
  42097. this
  42098. },
  42099. equals: function(e) {
  42100. return e.start.equals(this.start) && e.end.equals(this.end)
  42101. }
  42102. },
  42103. n.Box2 = function(e, t) {
  42104. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  42105. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  42106. }
  42107. ,
  42108. n.Box2.prototype = {
  42109. constructor: n.Box2,
  42110. set: function(e, t) {
  42111. return this.min.copy(e),
  42112. this.max.copy(t),
  42113. this
  42114. },
  42115. setFromPoints: function(e) {
  42116. this.makeEmpty();
  42117. for (var t = 0, i = e.length; t < i; t++)
  42118. this.expandByPoint(e[t]);
  42119. return this
  42120. },
  42121. setFromCenterAndSize: function() {
  42122. var e = new n.Vector2;
  42123. return function(t, i) {
  42124. var n = e.copy(i).multiplyScalar(.5);
  42125. return this.min.copy(t).sub(n),
  42126. this.max.copy(t).add(n),
  42127. this
  42128. }
  42129. }(),
  42130. clone: function() {
  42131. return (new this.constructor).copy(this)
  42132. },
  42133. copy: function(e) {
  42134. return this.min.copy(e.min),
  42135. this.max.copy(e.max),
  42136. this
  42137. },
  42138. makeEmpty: function() {
  42139. return this.min.x = this.min.y = +(1 / 0),
  42140. this.max.x = this.max.y = -(1 / 0),
  42141. this
  42142. },
  42143. isEmpty: function() {
  42144. return this.max.x < this.min.x || this.max.y < this.min.y
  42145. },
  42146. center: function(e) {
  42147. var t = e || new n.Vector2;
  42148. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  42149. },
  42150. size: function(e) {
  42151. var t = e || new n.Vector2;
  42152. return t.subVectors(this.max, this.min)
  42153. },
  42154. expandByPoint: function(e) {
  42155. return this.min.min(e),
  42156. this.max.max(e),
  42157. this
  42158. },
  42159. expandByVector: function(e) {
  42160. return this.min.sub(e),
  42161. this.max.add(e),
  42162. this
  42163. },
  42164. expandByScalar: function(e) {
  42165. return this.min.addScalar(-e),
  42166. this.max.addScalar(e),
  42167. this
  42168. },
  42169. containsPoint: function(e) {
  42170. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  42171. },
  42172. containsBox: function(e) {
  42173. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y
  42174. },
  42175. getParameter: function(e, t) {
  42176. var i = t || new n.Vector2;
  42177. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  42178. },
  42179. intersectsBox: function(e) {
  42180. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y)
  42181. },
  42182. clampPoint: function(e, t) {
  42183. var i = t || new n.Vector2;
  42184. return i.copy(e).clamp(this.min, this.max)
  42185. },
  42186. distanceToPoint: function() {
  42187. var e = new n.Vector2;
  42188. return function(t) {
  42189. var i = e.copy(t).clamp(this.min, this.max);
  42190. return i.sub(t).length()
  42191. }
  42192. }(),
  42193. intersect: function(e) {
  42194. return this.min.max(e.min),
  42195. this.max.min(e.max),
  42196. this
  42197. },
  42198. union: function(e) {
  42199. return this.min.min(e.min),
  42200. this.max.max(e.max),
  42201. this
  42202. },
  42203. translate: function(e) {
  42204. return this.min.add(e),
  42205. this.max.add(e),
  42206. this
  42207. },
  42208. equals: function(e) {
  42209. return e.min.equals(this.min) && e.max.equals(this.max)
  42210. }
  42211. },
  42212. n.Box3 = function(e, t) {
  42213. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  42214. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  42215. }
  42216. ,
  42217. n.Box3.prototype = {
  42218. constructor: n.Box3,
  42219. set: function(e, t) {
  42220. return this.min.copy(e),
  42221. this.max.copy(t),
  42222. this
  42223. },
  42224. setFromArray: function(e) {
  42225. this.makeEmpty();
  42226. for (var t = +(1 / 0), i = +(1 / 0), n = +(1 / 0), r = -(1 / 0), o = -(1 / 0), a = -(1 / 0), s = 0, l = e.length; s < l; s += 3) {
  42227. var c = e[s]
  42228. , h = e[s + 1]
  42229. , u = e[s + 2];
  42230. c < t && (t = c),
  42231. h < i && (i = h),
  42232. u < n && (n = u),
  42233. c > r && (r = c),
  42234. h > o && (o = h),
  42235. u > a && (a = u)
  42236. }
  42237. this.min.set(t, i, n),
  42238. this.max.set(r, o, a)
  42239. },
  42240. setFromPoints: function(e) {
  42241. this.makeEmpty();
  42242. for (var t = 0, i = e.length; t < i; t++)
  42243. this.expandByPoint(e[t]);
  42244. return this
  42245. },
  42246. setFromCenterAndSize: function() {
  42247. var e = new n.Vector3;
  42248. return function(t, i) {
  42249. var n = e.copy(i).multiplyScalar(.5);
  42250. return this.min.copy(t).sub(n),
  42251. this.max.copy(t).add(n),
  42252. this
  42253. }
  42254. }(),
  42255. setFromObject: function() {
  42256. var e;
  42257. return function(t) {
  42258. void 0 === e && (e = new n.Box3);
  42259. var i = this;
  42260. return this.makeEmpty(),
  42261. t.updateMatrixWorld(!0),
  42262. t.traverse(function(t) {
  42263. var n = t.geometry;
  42264. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  42265. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  42266. e.applyMatrix4(t.matrixWorld),
  42267. i.union(e)))
  42268. }),
  42269. this
  42270. }
  42271. }(),
  42272. clone: function() {
  42273. return (new this.constructor).copy(this)
  42274. },
  42275. copy: function(e) {
  42276. return this.min.copy(e.min),
  42277. this.max.copy(e.max),
  42278. this
  42279. },
  42280. makeEmpty: function() {
  42281. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  42282. this.max.x = this.max.y = this.max.z = -(1 / 0),
  42283. this
  42284. },
  42285. isEmpty: function() {
  42286. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  42287. },
  42288. center: function(e) {
  42289. var t = e || new n.Vector3;
  42290. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  42291. },
  42292. size: function(e) {
  42293. var t = e || new n.Vector3;
  42294. return t.subVectors(this.max, this.min)
  42295. },
  42296. expandByPoint: function(e) {
  42297. return this.min.min(e),
  42298. this.max.max(e),
  42299. this
  42300. },
  42301. expandByVector: function(e) {
  42302. return this.min.sub(e),
  42303. this.max.add(e),
  42304. this
  42305. },
  42306. expandByScalar: function(e) {
  42307. return this.min.addScalar(-e),
  42308. this.max.addScalar(e),
  42309. this
  42310. },
  42311. containsPoint: function(e) {
  42312. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  42313. },
  42314. containsBox: function(e) {
  42315. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  42316. },
  42317. getParameter: function(e, t) {
  42318. var i = t || new n.Vector3;
  42319. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  42320. },
  42321. intersectsBox: function(e) {
  42322. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  42323. },
  42324. intersectsSphere: function() {
  42325. var e;
  42326. return function(t) {
  42327. return void 0 === e && (e = new n.Vector3),
  42328. this.clampPoint(t.center, e),
  42329. e.distanceToSquared(t.center) <= t.radius * t.radius
  42330. }
  42331. }(),
  42332. intersectsPlane: function(e) {
  42333. var t, i;
  42334. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  42335. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  42336. i = e.normal.x * this.min.x),
  42337. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  42338. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  42339. i += e.normal.y * this.min.y),
  42340. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  42341. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  42342. i += e.normal.z * this.min.z),
  42343. t <= e.constant && i >= e.constant
  42344. },
  42345. clampPoint: function(e, t) {
  42346. var i = t || new n.Vector3;
  42347. return i.copy(e).clamp(this.min, this.max)
  42348. },
  42349. distanceToPoint: function() {
  42350. var e = new n.Vector3;
  42351. return function(t) {
  42352. var i = e.copy(t).clamp(this.min, this.max);
  42353. return i.sub(t).length()
  42354. }
  42355. }(),
  42356. getBoundingSphere: function() {
  42357. var e = new n.Vector3;
  42358. return function(t) {
  42359. var i = t || new n.Sphere;
  42360. return i.center = this.center(),
  42361. i.radius = .5 * this.size(e).length(),
  42362. i
  42363. }
  42364. }(),
  42365. intersect: function(e) {
  42366. return this.min.max(e.min),
  42367. this.max.min(e.max),
  42368. this
  42369. },
  42370. union: function(e) {
  42371. return this.min.min(e.min),
  42372. this.max.max(e.max),
  42373. this
  42374. },
  42375. applyMatrix4: function() {
  42376. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  42377. return function(t) {
  42378. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  42379. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  42380. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  42381. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  42382. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  42383. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  42384. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  42385. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  42386. this.makeEmpty(),
  42387. this.setFromPoints(e),
  42388. this
  42389. }
  42390. }(),
  42391. translate: function(e) {
  42392. return this.min.add(e),
  42393. this.max.add(e),
  42394. this
  42395. },
  42396. equals: function(e) {
  42397. return e.min.equals(this.min) && e.max.equals(this.max)
  42398. }
  42399. },
  42400. n.Matrix3 = function() {
  42401. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  42402. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  42403. }
  42404. ,
  42405. n.Matrix3.prototype = {
  42406. constructor: n.Matrix3,
  42407. set: function(e, t, i, n, r, o, a, s, l) {
  42408. var c = this.elements;
  42409. return c[0] = e,
  42410. c[1] = n,
  42411. c[2] = a,
  42412. c[3] = t,
  42413. c[4] = r,
  42414. c[5] = s,
  42415. c[6] = i,
  42416. c[7] = o,
  42417. c[8] = l,
  42418. this
  42419. },
  42420. identity: function() {
  42421. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  42422. this
  42423. },
  42424. clone: function() {
  42425. return (new this.constructor).fromArray(this.elements)
  42426. },
  42427. copy: function(e) {
  42428. var t = e.elements;
  42429. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  42430. this
  42431. },
  42432. setFromMatrix4: function(e) {
  42433. var t = e.elements;
  42434. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  42435. this
  42436. },
  42437. applyToVector3Array: function() {
  42438. var e;
  42439. return function(t, i, r) {
  42440. void 0 === e && (e = new n.Vector3),
  42441. void 0 === i && (i = 0),
  42442. void 0 === r && (r = t.length);
  42443. for (var o = 0, a = i; o < r; o += 3,
  42444. a += 3)
  42445. e.fromArray(t, a),
  42446. e.applyMatrix3(this),
  42447. e.toArray(t, a);
  42448. return t
  42449. }
  42450. }(),
  42451. applyToBuffer: function() {
  42452. var e;
  42453. return function(t, i, r) {
  42454. void 0 === e && (e = new n.Vector3),
  42455. void 0 === i && (i = 0),
  42456. void 0 === r && (r = t.length / t.itemSize);
  42457. for (var o = 0, a = i; o < r; o++,
  42458. a++)
  42459. e.x = t.getX(a),
  42460. e.y = t.getY(a),
  42461. e.z = t.getZ(a),
  42462. e.applyMatrix3(this),
  42463. t.setXYZ(e.x, e.y, e.z);
  42464. return t
  42465. }
  42466. }(),
  42467. multiplyScalar: function(e) {
  42468. var t = this.elements;
  42469. return t[0] *= e,
  42470. t[3] *= e,
  42471. t[6] *= e,
  42472. t[1] *= e,
  42473. t[4] *= e,
  42474. t[7] *= e,
  42475. t[2] *= e,
  42476. t[5] *= e,
  42477. t[8] *= e,
  42478. this
  42479. },
  42480. determinant: function() {
  42481. var e = this.elements
  42482. , t = e[0]
  42483. , i = e[1]
  42484. , n = e[2]
  42485. , r = e[3]
  42486. , o = e[4]
  42487. , a = e[5]
  42488. , s = e[6]
  42489. , l = e[7]
  42490. , c = e[8];
  42491. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  42492. },
  42493. getInverse: function(e, t) {
  42494. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  42495. var i = e.elements
  42496. , r = this.elements
  42497. , o = i[0]
  42498. , a = i[1]
  42499. , s = i[2]
  42500. , l = i[3]
  42501. , c = i[4]
  42502. , h = i[5]
  42503. , u = i[6]
  42504. , d = i[7]
  42505. , p = i[8]
  42506. , f = p * c - h * d
  42507. , g = h * u - p * l
  42508. , m = d * l - c * u
  42509. , v = o * f + a * g + s * m;
  42510. if (0 === v) {
  42511. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  42512. if (t)
  42513. throw new Error(A);
  42514. return console.warn(A),
  42515. this.identity()
  42516. }
  42517. return r[0] = f,
  42518. r[1] = s * d - p * a,
  42519. r[2] = h * a - s * c,
  42520. r[3] = g,
  42521. r[4] = p * o - s * u,
  42522. r[5] = s * l - h * o,
  42523. r[6] = m,
  42524. r[7] = a * u - d * o,
  42525. r[8] = c * o - a * l,
  42526. this.multiplyScalar(1 / v)
  42527. },
  42528. transpose: function() {
  42529. var e, t = this.elements;
  42530. return e = t[1],
  42531. t[1] = t[3],
  42532. t[3] = e,
  42533. e = t[2],
  42534. t[2] = t[6],
  42535. t[6] = e,
  42536. e = t[5],
  42537. t[5] = t[7],
  42538. t[7] = e,
  42539. this
  42540. },
  42541. flattenToArrayOffset: function(e, t) {
  42542. var i = this.elements;
  42543. return e[t] = i[0],
  42544. e[t + 1] = i[1],
  42545. e[t + 2] = i[2],
  42546. e[t + 3] = i[3],
  42547. e[t + 4] = i[4],
  42548. e[t + 5] = i[5],
  42549. e[t + 6] = i[6],
  42550. e[t + 7] = i[7],
  42551. e[t + 8] = i[8],
  42552. e
  42553. },
  42554. getNormalMatrix: function(e) {
  42555. return this.setFromMatrix4(e).getInverse(this).transpose()
  42556. },
  42557. transposeIntoArray: function(e) {
  42558. var t = this.elements;
  42559. return e[0] = t[0],
  42560. e[1] = t[3],
  42561. e[2] = t[6],
  42562. e[3] = t[1],
  42563. e[4] = t[4],
  42564. e[5] = t[7],
  42565. e[6] = t[2],
  42566. e[7] = t[5],
  42567. e[8] = t[8],
  42568. this
  42569. },
  42570. fromArray: function(e) {
  42571. return this.elements.set(e),
  42572. this
  42573. },
  42574. toArray: function() {
  42575. var e = this.elements;
  42576. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  42577. }
  42578. },
  42579. n.Matrix4 = function() {
  42580. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  42581. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  42582. }
  42583. ,
  42584. n.Matrix4.prototype = {
  42585. constructor: n.Matrix4,
  42586. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  42587. var m = this.elements;
  42588. return m[0] = e,
  42589. m[4] = t,
  42590. m[8] = i,
  42591. m[12] = n,
  42592. m[1] = r,
  42593. m[5] = o,
  42594. m[9] = a,
  42595. m[13] = s,
  42596. m[2] = l,
  42597. m[6] = c,
  42598. m[10] = h,
  42599. m[14] = u,
  42600. m[3] = d,
  42601. m[7] = p,
  42602. m[11] = f,
  42603. m[15] = g,
  42604. this
  42605. },
  42606. identity: function() {
  42607. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42608. this
  42609. },
  42610. clone: function() {
  42611. return (new n.Matrix4).fromArray(this.elements)
  42612. },
  42613. copy: function(e) {
  42614. return this.elements.set(e.elements),
  42615. this
  42616. },
  42617. copyPosition: function(e) {
  42618. var t = this.elements
  42619. , i = e.elements;
  42620. return t[12] = i[12],
  42621. t[13] = i[13],
  42622. t[14] = i[14],
  42623. this
  42624. },
  42625. extractBasis: function(e, t, i) {
  42626. return e.setFromMatrixColumn(this, 0),
  42627. t.setFromMatrixColumn(this, 1),
  42628. i.setFromMatrixColumn(this, 2),
  42629. this
  42630. },
  42631. makeBasis: function(e, t, i) {
  42632. return this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1),
  42633. this
  42634. },
  42635. extractRotation: function() {
  42636. var e;
  42637. return function(t) {
  42638. void 0 === e && (e = new n.Vector3);
  42639. var i = this.elements
  42640. , r = t.elements
  42641. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  42642. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  42643. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  42644. return i[0] = r[0] * o,
  42645. i[1] = r[1] * o,
  42646. i[2] = r[2] * o,
  42647. i[4] = r[4] * a,
  42648. i[5] = r[5] * a,
  42649. i[6] = r[6] * a,
  42650. i[8] = r[8] * s,
  42651. i[9] = r[9] * s,
  42652. i[10] = r[10] * s,
  42653. this
  42654. }
  42655. }(),
  42656. makeRotationFromEuler: function(e) {
  42657. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42658. var t = this.elements
  42659. , i = e.x
  42660. , r = e.y
  42661. , o = e.z
  42662. , a = Math.cos(i)
  42663. , s = Math.sin(i)
  42664. , l = Math.cos(r)
  42665. , c = Math.sin(r)
  42666. , h = Math.cos(o)
  42667. , u = Math.sin(o);
  42668. if ("XYZ" === e.order) {
  42669. var d = a * h
  42670. , p = a * u
  42671. , f = s * h
  42672. , g = s * u;
  42673. t[0] = l * h,
  42674. t[4] = -l * u,
  42675. t[8] = c,
  42676. t[1] = p + f * c,
  42677. t[5] = d - g * c,
  42678. t[9] = -s * l,
  42679. t[2] = g - d * c,
  42680. t[6] = f + p * c,
  42681. t[10] = a * l
  42682. } else if ("YXZ" === e.order) {
  42683. var m = l * h
  42684. , v = l * u
  42685. , A = c * h
  42686. , y = c * u;
  42687. t[0] = m + y * s,
  42688. t[4] = A * s - v,
  42689. t[8] = a * c,
  42690. t[1] = a * u,
  42691. t[5] = a * h,
  42692. t[9] = -s,
  42693. t[2] = v * s - A,
  42694. t[6] = y + m * s,
  42695. t[10] = a * l
  42696. } else if ("ZXY" === e.order) {
  42697. var m = l * h
  42698. , v = l * u
  42699. , A = c * h
  42700. , y = c * u;
  42701. t[0] = m - y * s,
  42702. t[4] = -a * u,
  42703. t[8] = A + v * s,
  42704. t[1] = v + A * s,
  42705. t[5] = a * h,
  42706. t[9] = y - m * s,
  42707. t[2] = -a * c,
  42708. t[6] = s,
  42709. t[10] = a * l
  42710. } else if ("ZYX" === e.order) {
  42711. var d = a * h
  42712. , p = a * u
  42713. , f = s * h
  42714. , g = s * u;
  42715. t[0] = l * h,
  42716. t[4] = f * c - p,
  42717. t[8] = d * c + g,
  42718. t[1] = l * u,
  42719. t[5] = g * c + d,
  42720. t[9] = p * c - f,
  42721. t[2] = -c,
  42722. t[6] = s * l,
  42723. t[10] = a * l
  42724. } else if ("YZX" === e.order) {
  42725. var C = a * l
  42726. , I = a * c
  42727. , E = s * l
  42728. , b = s * c;
  42729. t[0] = l * h,
  42730. t[4] = b - C * u,
  42731. t[8] = E * u + I,
  42732. t[1] = u,
  42733. t[5] = a * h,
  42734. t[9] = -s * h,
  42735. t[2] = -c * h,
  42736. t[6] = I * u + E,
  42737. t[10] = C - b * u
  42738. } else if ("XZY" === e.order) {
  42739. var C = a * l
  42740. , I = a * c
  42741. , E = s * l
  42742. , b = s * c;
  42743. t[0] = l * h,
  42744. t[4] = -u,
  42745. t[8] = c * h,
  42746. t[1] = C * u + b,
  42747. t[5] = a * h,
  42748. t[9] = I * u - E,
  42749. t[2] = E * u - I,
  42750. t[6] = s * h,
  42751. t[10] = b * u + C
  42752. }
  42753. return t[3] = 0,
  42754. t[7] = 0,
  42755. t[11] = 0,
  42756. t[12] = 0,
  42757. t[13] = 0,
  42758. t[14] = 0,
  42759. t[15] = 1,
  42760. this
  42761. },
  42762. makeRotationFromQuaternion: function(e) {
  42763. var t = this.elements
  42764. , i = e.x
  42765. , n = e.y
  42766. , r = e.z
  42767. , o = e.w
  42768. , a = i + i
  42769. , s = n + n
  42770. , l = r + r
  42771. , c = i * a
  42772. , h = i * s
  42773. , u = i * l
  42774. , d = n * s
  42775. , p = n * l
  42776. , f = r * l
  42777. , g = o * a
  42778. , m = o * s
  42779. , v = o * l;
  42780. return t[0] = 1 - (d + f),
  42781. t[4] = h - v,
  42782. t[8] = u + m,
  42783. t[1] = h + v,
  42784. t[5] = 1 - (c + f),
  42785. t[9] = p - g,
  42786. t[2] = u - m,
  42787. t[6] = p + g,
  42788. t[10] = 1 - (c + d),
  42789. t[3] = 0,
  42790. t[7] = 0,
  42791. t[11] = 0,
  42792. t[12] = 0,
  42793. t[13] = 0,
  42794. t[14] = 0,
  42795. t[15] = 1,
  42796. this
  42797. },
  42798. lookAt: function() {
  42799. var e, t, i;
  42800. return function(r, o, a) {
  42801. void 0 === e && (e = new n.Vector3),
  42802. void 0 === t && (t = new n.Vector3),
  42803. void 0 === i && (i = new n.Vector3);
  42804. var s = this.elements;
  42805. return i.subVectors(r, o).normalize(),
  42806. 0 === i.lengthSq() && (i.z = 1),
  42807. e.crossVectors(a, i).normalize(),
  42808. 0 === e.lengthSq() && (i.x += 1e-4,
  42809. e.crossVectors(a, i).normalize()),
  42810. t.crossVectors(i, e),
  42811. s[0] = e.x,
  42812. s[4] = t.x,
  42813. s[8] = i.x,
  42814. s[1] = e.y,
  42815. s[5] = t.y,
  42816. s[9] = i.y,
  42817. s[2] = e.z,
  42818. s[6] = t.z,
  42819. s[10] = i.z,
  42820. this
  42821. }
  42822. }(),
  42823. multiply: function(e, t) {
  42824. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42825. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42826. },
  42827. multiplyMatrices: function(e, t) {
  42828. var i = e.elements
  42829. , n = t.elements
  42830. , r = this.elements
  42831. , o = i[0]
  42832. , a = i[4]
  42833. , s = i[8]
  42834. , l = i[12]
  42835. , c = i[1]
  42836. , h = i[5]
  42837. , u = i[9]
  42838. , d = i[13]
  42839. , p = i[2]
  42840. , f = i[6]
  42841. , g = i[10]
  42842. , m = i[14]
  42843. , v = i[3]
  42844. , A = i[7]
  42845. , y = i[11]
  42846. , C = i[15]
  42847. , I = n[0]
  42848. , E = n[4]
  42849. , b = n[8]
  42850. , w = n[12]
  42851. , _ = n[1]
  42852. , T = n[5]
  42853. , x = n[9]
  42854. , S = n[13]
  42855. , M = n[2]
  42856. , R = n[6]
  42857. , P = n[10]
  42858. , O = n[14]
  42859. , L = n[3]
  42860. , D = n[7]
  42861. , N = n[11]
  42862. , B = n[15];
  42863. return r[0] = o * I + a * _ + s * M + l * L,
  42864. r[4] = o * E + a * T + s * R + l * D,
  42865. r[8] = o * b + a * x + s * P + l * N,
  42866. r[12] = o * w + a * S + s * O + l * B,
  42867. r[1] = c * I + h * _ + u * M + d * L,
  42868. r[5] = c * E + h * T + u * R + d * D,
  42869. r[9] = c * b + h * x + u * P + d * N,
  42870. r[13] = c * w + h * S + u * O + d * B,
  42871. r[2] = p * I + f * _ + g * M + m * L,
  42872. r[6] = p * E + f * T + g * R + m * D,
  42873. r[10] = p * b + f * x + g * P + m * N,
  42874. r[14] = p * w + f * S + g * O + m * B,
  42875. r[3] = v * I + A * _ + y * M + C * L,
  42876. r[7] = v * E + A * T + y * R + C * D,
  42877. r[11] = v * b + A * x + y * P + C * N,
  42878. r[15] = v * w + A * S + y * O + C * B,
  42879. this
  42880. },
  42881. multiplyToArray: function(e, t, i) {
  42882. var n = this.elements;
  42883. return this.multiplyMatrices(e, t),
  42884. i[0] = n[0],
  42885. i[1] = n[1],
  42886. i[2] = n[2],
  42887. i[3] = n[3],
  42888. i[4] = n[4],
  42889. i[5] = n[5],
  42890. i[6] = n[6],
  42891. i[7] = n[7],
  42892. i[8] = n[8],
  42893. i[9] = n[9],
  42894. i[10] = n[10],
  42895. i[11] = n[11],
  42896. i[12] = n[12],
  42897. i[13] = n[13],
  42898. i[14] = n[14],
  42899. i[15] = n[15],
  42900. this
  42901. },
  42902. multiplyScalar: function(e) {
  42903. var t = this.elements;
  42904. return t[0] *= e,
  42905. t[4] *= e,
  42906. t[8] *= e,
  42907. t[12] *= e,
  42908. t[1] *= e,
  42909. t[5] *= e,
  42910. t[9] *= e,
  42911. t[13] *= e,
  42912. t[2] *= e,
  42913. t[6] *= e,
  42914. t[10] *= e,
  42915. t[14] *= e,
  42916. t[3] *= e,
  42917. t[7] *= e,
  42918. t[11] *= e,
  42919. t[15] *= e,
  42920. this
  42921. },
  42922. applyToVector3Array: function() {
  42923. var e;
  42924. return function(t, i, r) {
  42925. void 0 === e && (e = new n.Vector3),
  42926. void 0 === i && (i = 0),
  42927. void 0 === r && (r = t.length);
  42928. for (var o = 0, a = i; o < r; o += 3,
  42929. a += 3)
  42930. e.fromArray(t, a),
  42931. e.applyMatrix4(this),
  42932. e.toArray(t, a);
  42933. return t
  42934. }
  42935. }(),
  42936. applyToBuffer: function() {
  42937. var e;
  42938. return function(t, i, r) {
  42939. void 0 === e && (e = new n.Vector3),
  42940. void 0 === i && (i = 0),
  42941. void 0 === r && (r = t.length / t.itemSize);
  42942. for (var o = 0, a = i; o < r; o++,
  42943. a++)
  42944. e.x = t.getX(a),
  42945. e.y = t.getY(a),
  42946. e.z = t.getZ(a),
  42947. e.applyMatrix4(this),
  42948. t.setXYZ(e.x, e.y, e.z);
  42949. return t
  42950. }
  42951. }(),
  42952. determinant: function() {
  42953. var e = this.elements
  42954. , t = e[0]
  42955. , i = e[4]
  42956. , n = e[8]
  42957. , r = e[12]
  42958. , o = e[1]
  42959. , a = e[5]
  42960. , s = e[9]
  42961. , l = e[13]
  42962. , c = e[2]
  42963. , h = e[6]
  42964. , u = e[10]
  42965. , d = e[14]
  42966. , p = e[3]
  42967. , f = e[7]
  42968. , g = e[11]
  42969. , m = e[15];
  42970. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  42971. },
  42972. transpose: function() {
  42973. var e, t = this.elements;
  42974. return e = t[1],
  42975. t[1] = t[4],
  42976. t[4] = e,
  42977. e = t[2],
  42978. t[2] = t[8],
  42979. t[8] = e,
  42980. e = t[6],
  42981. t[6] = t[9],
  42982. t[9] = e,
  42983. e = t[3],
  42984. t[3] = t[12],
  42985. t[12] = e,
  42986. e = t[7],
  42987. t[7] = t[13],
  42988. t[13] = e,
  42989. e = t[11],
  42990. t[11] = t[14],
  42991. t[14] = e,
  42992. this
  42993. },
  42994. flattenToArrayOffset: function(e, t) {
  42995. var i = this.elements;
  42996. return e[t] = i[0],
  42997. e[t + 1] = i[1],
  42998. e[t + 2] = i[2],
  42999. e[t + 3] = i[3],
  43000. e[t + 4] = i[4],
  43001. e[t + 5] = i[5],
  43002. e[t + 6] = i[6],
  43003. e[t + 7] = i[7],
  43004. e[t + 8] = i[8],
  43005. e[t + 9] = i[9],
  43006. e[t + 10] = i[10],
  43007. e[t + 11] = i[11],
  43008. e[t + 12] = i[12],
  43009. e[t + 13] = i[13],
  43010. e[t + 14] = i[14],
  43011. e[t + 15] = i[15],
  43012. e
  43013. },
  43014. getPosition: function() {
  43015. var e;
  43016. return function() {
  43017. return void 0 === e && (e = new n.Vector3),
  43018. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  43019. e.setFromMatrixColumn(this, 3)
  43020. }
  43021. }(),
  43022. setPosition: function(e) {
  43023. var t = this.elements;
  43024. return t[12] = e.x,
  43025. t[13] = e.y,
  43026. t[14] = e.z,
  43027. this
  43028. },
  43029. getInverse: function(e, t) {
  43030. var i = this.elements
  43031. , n = e.elements
  43032. , r = n[0]
  43033. , o = n[1]
  43034. , a = n[2]
  43035. , s = n[3]
  43036. , l = n[4]
  43037. , c = n[5]
  43038. , h = n[6]
  43039. , u = n[7]
  43040. , d = n[8]
  43041. , p = n[9]
  43042. , f = n[10]
  43043. , g = n[11]
  43044. , m = n[12]
  43045. , v = n[13]
  43046. , A = n[14]
  43047. , y = n[15]
  43048. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  43049. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  43050. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  43051. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  43052. , w = r * C + o * I + a * E + s * b;
  43053. if (0 === w) {
  43054. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  43055. if (t)
  43056. throw new Error(_);
  43057. return console.warn(_),
  43058. this.identity()
  43059. }
  43060. return i[0] = C,
  43061. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  43062. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  43063. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  43064. i[4] = I,
  43065. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  43066. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  43067. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  43068. i[8] = E,
  43069. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  43070. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  43071. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  43072. i[12] = b,
  43073. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  43074. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  43075. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  43076. this.multiplyScalar(1 / w)
  43077. },
  43078. scale: function(e) {
  43079. var t = this.elements
  43080. , i = e.x
  43081. , n = e.y
  43082. , r = e.z;
  43083. return t[0] *= i,
  43084. t[4] *= n,
  43085. t[8] *= r,
  43086. t[1] *= i,
  43087. t[5] *= n,
  43088. t[9] *= r,
  43089. t[2] *= i,
  43090. t[6] *= n,
  43091. t[10] *= r,
  43092. t[3] *= i,
  43093. t[7] *= n,
  43094. t[11] *= r,
  43095. this
  43096. },
  43097. getMaxScaleOnAxis: function() {
  43098. var e = this.elements
  43099. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  43100. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  43101. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  43102. return Math.sqrt(Math.max(t, i, n))
  43103. },
  43104. makeTranslation: function(e, t, i) {
  43105. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  43106. this
  43107. },
  43108. makeRotationX: function(e) {
  43109. var t = Math.cos(e)
  43110. , i = Math.sin(e);
  43111. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  43112. this
  43113. },
  43114. makeRotationY: function(e) {
  43115. var t = Math.cos(e)
  43116. , i = Math.sin(e);
  43117. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  43118. this
  43119. },
  43120. makeRotationZ: function(e) {
  43121. var t = Math.cos(e)
  43122. , i = Math.sin(e);
  43123. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  43124. this
  43125. },
  43126. makeRotationAxis: function(e, t) {
  43127. var i = Math.cos(t)
  43128. , n = Math.sin(t)
  43129. , r = 1 - i
  43130. , o = e.x
  43131. , a = e.y
  43132. , s = e.z
  43133. , l = r * o
  43134. , c = r * a;
  43135. return this.set(l * o + i, l * a - n * s, l * s + n * a, 0, l * a + n * s, c * a + i, c * s - n * o, 0, l * s - n * a, c * s + n * o, r * s * s + i, 0, 0, 0, 0, 1),
  43136. this
  43137. },
  43138. makeScale: function(e, t, i) {
  43139. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  43140. this
  43141. },
  43142. compose: function(e, t, i) {
  43143. return this.makeRotationFromQuaternion(t),
  43144. this.scale(i),
  43145. this.setPosition(e),
  43146. this
  43147. },
  43148. decompose: function() {
  43149. var e, t;
  43150. return function(i, r, o) {
  43151. void 0 === e && (e = new n.Vector3),
  43152. void 0 === t && (t = new n.Matrix4);
  43153. var a = this.elements
  43154. , s = e.set(a[0], a[1], a[2]).length()
  43155. , l = e.set(a[4], a[5], a[6]).length()
  43156. , c = e.set(a[8], a[9], a[10]).length()
  43157. , h = this.determinant();
  43158. h < 0 && (s = -s),
  43159. i.x = a[12],
  43160. i.y = a[13],
  43161. i.z = a[14],
  43162. t.elements.set(this.elements);
  43163. var u = 1 / s
  43164. , d = 1 / l
  43165. , p = 1 / c;
  43166. return t.elements[0] *= u,
  43167. t.elements[1] *= u,
  43168. t.elements[2] *= u,
  43169. t.elements[4] *= d,
  43170. t.elements[5] *= d,
  43171. t.elements[6] *= d,
  43172. t.elements[8] *= p,
  43173. t.elements[9] *= p,
  43174. t.elements[10] *= p,
  43175. r.setFromRotationMatrix(t),
  43176. o.x = s,
  43177. o.y = l,
  43178. o.z = c,
  43179. this
  43180. }
  43181. }(),
  43182. makeFrustum: function(e, t, i, n, r, o) {
  43183. var a = this.elements
  43184. , s = 2 * r / (t - e)
  43185. , l = 2 * r / (n - i)
  43186. , c = (t + e) / (t - e)
  43187. , h = (n + i) / (n - i)
  43188. , u = -(o + r) / (o - r)
  43189. , d = -2 * o * r / (o - r);
  43190. return a[0] = s,
  43191. a[4] = 0,
  43192. a[8] = c,
  43193. a[12] = 0,
  43194. a[1] = 0,
  43195. a[5] = l,
  43196. a[9] = h,
  43197. a[13] = 0,
  43198. a[2] = 0,
  43199. a[6] = 0,
  43200. a[10] = u,
  43201. a[14] = d,
  43202. a[3] = 0,
  43203. a[7] = 0,
  43204. a[11] = -1,
  43205. a[15] = 0,
  43206. this
  43207. },
  43208. makePerspective: function(e, t, i, r) {
  43209. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  43210. , a = -o
  43211. , s = a * t
  43212. , l = o * t;
  43213. return this.makeFrustum(s, l, a, o, i, r)
  43214. },
  43215. makeOrthographic: function(e, t, i, n, r, o) {
  43216. var a = this.elements
  43217. , s = 1 / (t - e)
  43218. , l = 1 / (i - n)
  43219. , c = 1 / (o - r)
  43220. , h = (t + e) * s
  43221. , u = (i + n) * l
  43222. , d = (o + r) * c;
  43223. return a[0] = 2 * s,
  43224. a[4] = 0,
  43225. a[8] = 0,
  43226. a[12] = -h,
  43227. a[1] = 0,
  43228. a[5] = 2 * l,
  43229. a[9] = 0,
  43230. a[13] = -u,
  43231. a[2] = 0,
  43232. a[6] = 0,
  43233. a[10] = -2 * c,
  43234. a[14] = -d,
  43235. a[3] = 0,
  43236. a[7] = 0,
  43237. a[11] = 0,
  43238. a[15] = 1,
  43239. this
  43240. },
  43241. equals: function(e) {
  43242. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  43243. if (t[n] !== i[n])
  43244. return !1;
  43245. return !0
  43246. },
  43247. fromArray: function(e) {
  43248. return this.elements.set(e),
  43249. this
  43250. },
  43251. toArray: function() {
  43252. var e = this.elements;
  43253. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]]
  43254. }
  43255. },
  43256. n.Ray = function(e, t) {
  43257. this.origin = void 0 !== e ? e : new n.Vector3,
  43258. this.direction = void 0 !== t ? t : new n.Vector3
  43259. }
  43260. ,
  43261. n.Ray.prototype = {
  43262. constructor: n.Ray,
  43263. set: function(e, t) {
  43264. return this.origin.copy(e),
  43265. this.direction.copy(t),
  43266. this
  43267. },
  43268. clone: function() {
  43269. return (new this.constructor).copy(this)
  43270. },
  43271. copy: function(e) {
  43272. return this.origin.copy(e.origin),
  43273. this.direction.copy(e.direction),
  43274. this
  43275. },
  43276. at: function(e, t) {
  43277. var i = t || new n.Vector3;
  43278. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  43279. },
  43280. lookAt: function(e) {
  43281. this.direction.copy(e).sub(this.origin).normalize()
  43282. },
  43283. recast: function() {
  43284. var e = new n.Vector3;
  43285. return function(t) {
  43286. return this.origin.copy(this.at(t, e)),
  43287. this
  43288. }
  43289. }(),
  43290. closestPointToPoint: function(e, t) {
  43291. var i = t || new n.Vector3;
  43292. i.subVectors(e, this.origin);
  43293. var r = i.dot(this.direction);
  43294. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  43295. },
  43296. distanceToPoint: function(e) {
  43297. return Math.sqrt(this.distanceSqToPoint(e))
  43298. },
  43299. distanceSqToPoint: function() {
  43300. var e = new n.Vector3;
  43301. return function(t) {
  43302. var i = e.subVectors(t, this.origin).dot(this.direction);
  43303. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  43304. e.distanceToSquared(t))
  43305. }
  43306. }(),
  43307. distanceSqToSegment: function() {
  43308. var e = new n.Vector3
  43309. , t = new n.Vector3
  43310. , i = new n.Vector3;
  43311. return function(n, r, o, a) {
  43312. e.copy(n).add(r).multiplyScalar(.5),
  43313. t.copy(r).sub(n).normalize(),
  43314. i.copy(this.origin).sub(e);
  43315. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  43316. if (m > 0)
  43317. if (s = d * f - p,
  43318. l = d * p - f,
  43319. h = u * m,
  43320. s >= 0)
  43321. if (l >= -h)
  43322. if (l <= h) {
  43323. var v = 1 / m;
  43324. s *= v,
  43325. l *= v,
  43326. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  43327. } else
  43328. l = u,
  43329. s = Math.max(0, -(d * l + p)),
  43330. c = -s * s + l * (l + 2 * f) + g;
  43331. else
  43332. l = -u,
  43333. s = Math.max(0, -(d * l + p)),
  43334. c = -s * s + l * (l + 2 * f) + g;
  43335. else
  43336. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  43337. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  43338. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  43339. l = Math.min(Math.max(-u, -f), u),
  43340. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  43341. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  43342. c = -s * s + l * (l + 2 * f) + g);
  43343. else
  43344. l = d > 0 ? -u : u,
  43345. s = Math.max(0, -(d * l + p)),
  43346. c = -s * s + l * (l + 2 * f) + g;
  43347. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  43348. a && a.copy(t).multiplyScalar(l).add(e),
  43349. c
  43350. }
  43351. }(),
  43352. intersectSphere: function() {
  43353. var e = new n.Vector3;
  43354. return function(t, i) {
  43355. e.subVectors(t.center, this.origin);
  43356. var n = e.dot(this.direction)
  43357. , r = e.dot(e) - n * n
  43358. , o = t.radius * t.radius;
  43359. if (r > o)
  43360. return null;
  43361. var a = Math.sqrt(o - r)
  43362. , s = n - a
  43363. , l = n + a;
  43364. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  43365. }
  43366. }(),
  43367. intersectsSphere: function(e) {
  43368. return this.distanceToPoint(e.center) <= e.radius
  43369. },
  43370. distanceToPlane: function(e) {
  43371. var t = e.normal.dot(this.direction);
  43372. if (0 === t)
  43373. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  43374. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  43375. return i >= 0 ? i : null
  43376. },
  43377. intersectPlane: function(e, t) {
  43378. var i = this.distanceToPlane(e);
  43379. return null === i ? null : this.at(i, t)
  43380. },
  43381. intersectsPlane: function(e) {
  43382. var t = e.distanceToPoint(this.origin);
  43383. if (0 === t)
  43384. return !0;
  43385. var i = e.normal.dot(this.direction);
  43386. return i * t < 0
  43387. },
  43388. intersectBox: function(e, t) {
  43389. var i, n, r, o, a, s, l = 1 / this.direction.x, c = 1 / this.direction.y, h = 1 / this.direction.z, u = this.origin;
  43390. return l >= 0 ? (i = (e.min.x - u.x) * l,
  43391. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  43392. n = (e.min.x - u.x) * l),
  43393. c >= 0 ? (r = (e.min.y - u.y) * c,
  43394. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  43395. o = (e.min.y - u.y) * c),
  43396. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  43397. (o < n || n !== n) && (n = o),
  43398. h >= 0 ? (a = (e.min.z - u.z) * h,
  43399. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  43400. s = (e.min.z - u.z) * h),
  43401. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  43402. (s < n || n !== n) && (n = s),
  43403. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  43404. },
  43405. intersectsBox: function() {
  43406. var e = new n.Vector3;
  43407. return function(t) {
  43408. return null !== this.intersectBox(t, e)
  43409. }
  43410. }(),
  43411. intersectTriangle: function() {
  43412. var e = new n.Vector3
  43413. , t = new n.Vector3
  43414. , i = new n.Vector3
  43415. , r = new n.Vector3;
  43416. return function(n, o, a, s, l) {
  43417. t.subVectors(o, n),
  43418. i.subVectors(a, n),
  43419. r.crossVectors(t, i);
  43420. var c, h = this.direction.dot(r);
  43421. if (h > 0) {
  43422. if (s)
  43423. return null;
  43424. c = 1
  43425. } else {
  43426. if (!(h < 0))
  43427. return null;
  43428. c = -1,
  43429. h = -h
  43430. }
  43431. e.subVectors(this.origin, n);
  43432. var u = c * this.direction.dot(i.crossVectors(e, i));
  43433. if (u < 0)
  43434. return null;
  43435. var d = c * this.direction.dot(t.cross(e));
  43436. if (d < 0)
  43437. return null;
  43438. if (u + d > h)
  43439. return null;
  43440. var p = -c * e.dot(r);
  43441. return p < 0 ? null : this.at(p / h, l)
  43442. }
  43443. }(),
  43444. applyMatrix4: function(e) {
  43445. return this.direction.add(this.origin).applyMatrix4(e),
  43446. this.origin.applyMatrix4(e),
  43447. this.direction.sub(this.origin),
  43448. this.direction.normalize(),
  43449. this
  43450. },
  43451. equals: function(e) {
  43452. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  43453. }
  43454. },
  43455. n.Sphere = function(e, t) {
  43456. this.center = void 0 !== e ? e : new n.Vector3,
  43457. this.radius = void 0 !== t ? t : 0
  43458. }
  43459. ,
  43460. n.Sphere.prototype = {
  43461. constructor: n.Sphere,
  43462. set: function(e, t) {
  43463. return this.center.copy(e),
  43464. this.radius = t,
  43465. this
  43466. },
  43467. setFromPoints: function() {
  43468. var e = new n.Box3;
  43469. return function(t, i) {
  43470. var n = this.center;
  43471. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  43472. for (var r = 0, o = 0, a = t.length; o < a; o++)
  43473. r = Math.max(r, n.distanceToSquared(t[o]));
  43474. return this.radius = Math.sqrt(r),
  43475. this
  43476. }
  43477. }(),
  43478. clone: function() {
  43479. return (new this.constructor).copy(this)
  43480. },
  43481. copy: function(e) {
  43482. return this.center.copy(e.center),
  43483. this.radius = e.radius,
  43484. this
  43485. },
  43486. empty: function() {
  43487. return this.radius <= 0
  43488. },
  43489. containsPoint: function(e) {
  43490. return e.distanceToSquared(this.center) <= this.radius * this.radius
  43491. },
  43492. distanceToPoint: function(e) {
  43493. return e.distanceTo(this.center) - this.radius
  43494. },
  43495. intersectsSphere: function(e) {
  43496. var t = this.radius + e.radius;
  43497. return e.center.distanceToSquared(this.center) <= t * t
  43498. },
  43499. intersectsBox: function(e) {
  43500. return e.intersectsSphere(this)
  43501. },
  43502. intersectsPlane: function(e) {
  43503. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  43504. },
  43505. clampPoint: function(e, t) {
  43506. var i = this.center.distanceToSquared(e)
  43507. , r = t || new n.Vector3;
  43508. return r.copy(e),
  43509. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  43510. r.multiplyScalar(this.radius).add(this.center)),
  43511. r
  43512. },
  43513. getBoundingBox: function(e) {
  43514. var t = e || new n.Box3;
  43515. return t.set(this.center, this.center),
  43516. t.expandByScalar(this.radius),
  43517. t
  43518. },
  43519. applyMatrix4: function(e) {
  43520. return this.center.applyMatrix4(e),
  43521. this.radius = this.radius * e.getMaxScaleOnAxis(),
  43522. this
  43523. },
  43524. translate: function(e) {
  43525. return this.center.add(e),
  43526. this
  43527. },
  43528. equals: function(e) {
  43529. return e.center.equals(this.center) && e.radius === this.radius
  43530. }
  43531. },
  43532. n.Frustum = function(e, t, i, r, o, a) {
  43533. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  43534. }
  43535. ,
  43536. n.Frustum.prototype = {
  43537. constructor: n.Frustum,
  43538. set: function(e, t, i, n, r, o) {
  43539. var a = this.planes;
  43540. return a[0].copy(e),
  43541. a[1].copy(t),
  43542. a[2].copy(i),
  43543. a[3].copy(n),
  43544. a[4].copy(r),
  43545. a[5].copy(o),
  43546. this
  43547. },
  43548. clone: function() {
  43549. return (new this.constructor).copy(this)
  43550. },
  43551. copy: function(e) {
  43552. for (var t = this.planes, i = 0; i < 6; i++)
  43553. t[i].copy(e.planes[i]);
  43554. return this
  43555. },
  43556. setFromMatrix: function(e) {
  43557. var t = this.planes
  43558. , i = e.elements
  43559. , n = i[0]
  43560. , r = i[1]
  43561. , o = i[2]
  43562. , a = i[3]
  43563. , s = i[4]
  43564. , l = i[5]
  43565. , c = i[6]
  43566. , h = i[7]
  43567. , u = i[8]
  43568. , d = i[9]
  43569. , p = i[10]
  43570. , f = i[11]
  43571. , g = i[12]
  43572. , m = i[13]
  43573. , v = i[14]
  43574. , A = i[15];
  43575. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  43576. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  43577. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  43578. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  43579. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  43580. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  43581. this
  43582. },
  43583. intersectsObject: function() {
  43584. var e = new n.Sphere;
  43585. return function(t) {
  43586. var i = t.geometry;
  43587. return null === i.boundingSphere && i.computeBoundingSphere(),
  43588. e.copy(i.boundingSphere),
  43589. e.applyMatrix4(t.matrixWorld),
  43590. this.intersectsSphere(e)
  43591. }
  43592. }(),
  43593. intersectsSphere: function(e) {
  43594. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  43595. var o = t[r].distanceToPoint(i);
  43596. if (o < n)
  43597. return !1
  43598. }
  43599. return !0
  43600. },
  43601. intersectsBox: function() {
  43602. var e = new n.Vector3
  43603. , t = new n.Vector3;
  43604. return function(i) {
  43605. for (var n = this.planes, r = 0; r < 6; r++) {
  43606. var o = n[r];
  43607. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  43608. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  43609. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  43610. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  43611. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  43612. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  43613. var a = o.distanceToPoint(e)
  43614. , s = o.distanceToPoint(t);
  43615. if (a < 0 && s < 0)
  43616. return !1
  43617. }
  43618. return !0
  43619. }
  43620. }(),
  43621. containsPoint: function(e) {
  43622. for (var t = this.planes, i = 0; i < 6; i++)
  43623. if (t[i].distanceToPoint(e) < 0)
  43624. return !1;
  43625. return !0
  43626. }
  43627. },
  43628. n.Plane = function(e, t) {
  43629. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  43630. this.constant = void 0 !== t ? t : 0
  43631. }
  43632. ,
  43633. n.Plane.prototype = {
  43634. constructor: n.Plane,
  43635. set: function(e, t) {
  43636. return this.normal.copy(e),
  43637. this.constant = t,
  43638. this
  43639. },
  43640. setComponents: function(e, t, i, n) {
  43641. return this.normal.set(e, t, i),
  43642. this.constant = n,
  43643. this
  43644. },
  43645. setFromNormalAndCoplanarPoint: function(e, t) {
  43646. return this.normal.copy(e),
  43647. this.constant = -t.dot(this.normal),
  43648. this
  43649. },
  43650. setFromCoplanarPoints: function() {
  43651. var e = new n.Vector3
  43652. , t = new n.Vector3;
  43653. return function(i, n, r) {
  43654. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43655. return this.setFromNormalAndCoplanarPoint(o, i),
  43656. this
  43657. }
  43658. }(),
  43659. clone: function() {
  43660. return (new this.constructor).copy(this)
  43661. },
  43662. copy: function(e) {
  43663. return this.normal.copy(e.normal),
  43664. this.constant = e.constant,
  43665. this
  43666. },
  43667. normalize: function() {
  43668. var e = 1 / this.normal.length();
  43669. return this.normal.multiplyScalar(e),
  43670. this.constant *= e,
  43671. this
  43672. },
  43673. negate: function() {
  43674. return this.constant *= -1,
  43675. this.normal.negate(),
  43676. this
  43677. },
  43678. distanceToPoint: function(e) {
  43679. return this.normal.dot(e) + this.constant
  43680. },
  43681. distanceToSphere: function(e) {
  43682. return this.distanceToPoint(e.center) - e.radius
  43683. },
  43684. projectPoint: function(e, t) {
  43685. return this.orthoPoint(e, t).sub(e).negate()
  43686. },
  43687. orthoPoint: function(e, t) {
  43688. var i = this.distanceToPoint(e)
  43689. , r = t || new n.Vector3;
  43690. return r.copy(this.normal).multiplyScalar(i)
  43691. },
  43692. intersectLine: function() {
  43693. var e = new n.Vector3;
  43694. return function(t, i) {
  43695. var r = i || new n.Vector3
  43696. , o = t.delta(e)
  43697. , a = this.normal.dot(o);
  43698. if (0 !== a) {
  43699. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43700. if (!(s < 0 || s > 1))
  43701. return r.copy(o).multiplyScalar(s).add(t.start)
  43702. } else if (0 === this.distanceToPoint(t.start))
  43703. return r.copy(t.start)
  43704. }
  43705. }(),
  43706. intersectsLine: function(e) {
  43707. var t = this.distanceToPoint(e.start)
  43708. , i = this.distanceToPoint(e.end);
  43709. return t < 0 && i > 0 || i < 0 && t > 0
  43710. },
  43711. intersectsBox: function(e) {
  43712. return e.intersectsPlane(this)
  43713. },
  43714. intersectsSphere: function(e) {
  43715. return e.intersectsPlane(this)
  43716. },
  43717. coplanarPoint: function(e) {
  43718. var t = e || new n.Vector3;
  43719. return t.copy(this.normal).multiplyScalar(-this.constant)
  43720. },
  43721. applyMatrix4: function() {
  43722. var e = new n.Vector3
  43723. , t = new n.Vector3
  43724. , i = new n.Matrix3;
  43725. return function(n, r) {
  43726. var o = r || i.getNormalMatrix(n)
  43727. , a = e.copy(this.normal).applyMatrix3(o)
  43728. , s = this.coplanarPoint(t);
  43729. return s.applyMatrix4(n),
  43730. this.setFromNormalAndCoplanarPoint(a, s),
  43731. this
  43732. }
  43733. }(),
  43734. translate: function(e) {
  43735. return this.constant = this.constant - e.dot(this.normal),
  43736. this
  43737. },
  43738. equals: function(e) {
  43739. return e.normal.equals(this.normal) && e.constant === this.constant
  43740. }
  43741. },
  43742. n.Spherical = function(e, t, i) {
  43743. return this.radius = void 0 !== e ? e : 1,
  43744. this.phi = void 0 !== t ? t : 0,
  43745. this.theta = void 0 !== i ? i : 0,
  43746. this
  43747. }
  43748. ,
  43749. n.Spherical.prototype = {
  43750. constructor: n.Spherical,
  43751. set: function(e, t, i) {
  43752. this.radius = e,
  43753. this.phi = t,
  43754. this.theta = i
  43755. },
  43756. clone: function() {
  43757. return (new this.constructor).copy(this)
  43758. },
  43759. copy: function(e) {
  43760. return this.radius.copy(e.radius),
  43761. this.phi.copy(e.phi),
  43762. this.theta.copy(e.theta),
  43763. this
  43764. },
  43765. makeSafe: function() {
  43766. var e = 1e-6;
  43767. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43768. },
  43769. setFromVector3: function(e) {
  43770. return this.radius = e.length(),
  43771. 0 === this.radius ? (this.theta = 0,
  43772. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43773. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43774. this
  43775. }
  43776. },
  43777. n.Math = {
  43778. generateUUID: function() {
  43779. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43780. return function() {
  43781. for (var r = 0; r < 36; r++)
  43782. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43783. e = 15 & n,
  43784. n >>= 4,
  43785. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43786. return i.join("")
  43787. }
  43788. }(),
  43789. clamp: function(e, t, i) {
  43790. return Math.max(t, Math.min(i, e))
  43791. },
  43792. euclideanModulo: function(e, t) {
  43793. return (e % t + t) % t
  43794. },
  43795. mapLinear: function(e, t, i, n, r) {
  43796. return n + (e - t) * (r - n) / (i - t)
  43797. },
  43798. smoothstep: function(e, t, i) {
  43799. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43800. e * e * (3 - 2 * e))
  43801. },
  43802. smootherstep: function(e, t, i) {
  43803. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43804. e * e * e * (e * (6 * e - 15) + 10))
  43805. },
  43806. random16: function() {
  43807. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43808. Math.random()
  43809. },
  43810. randInt: function(e, t) {
  43811. return e + Math.floor(Math.random() * (t - e + 1))
  43812. },
  43813. randFloat: function(e, t) {
  43814. return e + Math.random() * (t - e)
  43815. },
  43816. randFloatSpread: function(e) {
  43817. return e * (.5 - Math.random())
  43818. },
  43819. degToRad: function() {
  43820. var e = Math.PI / 180;
  43821. return function(t) {
  43822. return t * e
  43823. }
  43824. }(),
  43825. radToDeg: function() {
  43826. var e = 180 / Math.PI;
  43827. return function(t) {
  43828. return t * e
  43829. }
  43830. }(),
  43831. isPowerOfTwo: function(e) {
  43832. return 0 === (e & e - 1) && 0 !== e
  43833. },
  43834. nearestPowerOfTwo: function(e) {
  43835. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43836. },
  43837. nextPowerOfTwo: function(e) {
  43838. return e--,
  43839. e |= e >> 1,
  43840. e |= e >> 2,
  43841. e |= e >> 4,
  43842. e |= e >> 8,
  43843. e |= e >> 16,
  43844. e++,
  43845. e
  43846. }
  43847. },
  43848. n.Spline = function(e) {
  43849. function t(e, t, i, n, r, o, a) {
  43850. var s = .5 * (i - e)
  43851. , l = .5 * (n - t);
  43852. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43853. }
  43854. this.points = e;
  43855. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43856. x: 0,
  43857. y: 0,
  43858. z: 0
  43859. };
  43860. this.initFromArray = function(e) {
  43861. this.points = [];
  43862. for (var t = 0; t < e.length; t++)
  43863. this.points[t] = {
  43864. x: e[t][0],
  43865. y: e[t][1],
  43866. z: e[t][2]
  43867. }
  43868. }
  43869. ,
  43870. this.getPoint = function(e) {
  43871. return i = (this.points.length - 1) * e,
  43872. r = Math.floor(i),
  43873. o = i - r,
  43874. d[0] = 0 === r ? r : r - 1,
  43875. d[1] = r,
  43876. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43877. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43878. l = this.points[d[0]],
  43879. c = this.points[d[1]],
  43880. h = this.points[d[2]],
  43881. u = this.points[d[3]],
  43882. a = o * o,
  43883. s = o * a,
  43884. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43885. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43886. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43887. p
  43888. }
  43889. ,
  43890. this.getControlPointsArray = function() {
  43891. var e, t, i = this.points.length, n = [];
  43892. for (e = 0; e < i; e++)
  43893. t = this.points[e],
  43894. n[e] = [t.x, t.y, t.z];
  43895. return n
  43896. }
  43897. ,
  43898. this.getLength = function(e) {
  43899. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43900. for (u[0] = 0,
  43901. e || (e = 100),
  43902. r = this.points.length * e,
  43903. c.copy(this.points[0]),
  43904. t = 1; t < r; t++)
  43905. i = t / r,
  43906. o = this.getPoint(i),
  43907. h.copy(o),
  43908. d += h.distanceTo(c),
  43909. c.copy(o),
  43910. a = (this.points.length - 1) * i,
  43911. s = Math.floor(a),
  43912. s !== l && (u[s] = d,
  43913. l = s);
  43914. return u[u.length] = d,
  43915. {
  43916. chunks: u,
  43917. total: d
  43918. }
  43919. }
  43920. ,
  43921. this.reparametrizeByArcLength = function(e) {
  43922. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43923. for (h.push(u.copy(this.points[0]).clone()),
  43924. t = 1; t < this.points.length; t++) {
  43925. for (s = d.chunks[t] - d.chunks[t - 1],
  43926. l = Math.ceil(e * s / d.total),
  43927. o = (t - 1) / (this.points.length - 1),
  43928. a = t / (this.points.length - 1),
  43929. i = 1; i < l - 1; i++)
  43930. r = o + i * (1 / l) * (a - o),
  43931. c = this.getPoint(r),
  43932. h.push(u.copy(c).clone());
  43933. h.push(u.copy(this.points[t]).clone())
  43934. }
  43935. this.points = h
  43936. }
  43937. }
  43938. ,
  43939. n.Triangle = function(e, t, i) {
  43940. this.a = void 0 !== e ? e : new n.Vector3,
  43941. this.b = void 0 !== t ? t : new n.Vector3,
  43942. this.c = void 0 !== i ? i : new n.Vector3
  43943. }
  43944. ,
  43945. n.Triangle.normal = function() {
  43946. var e = new n.Vector3;
  43947. return function(t, i, r, o) {
  43948. var a = o || new n.Vector3;
  43949. a.subVectors(r, i),
  43950. e.subVectors(t, i),
  43951. a.cross(e);
  43952. var s = a.lengthSq();
  43953. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43954. }
  43955. }(),
  43956. n.Triangle.barycoordFromPoint = function() {
  43957. var e = new n.Vector3
  43958. , t = new n.Vector3
  43959. , i = new n.Vector3;
  43960. return function(r, o, a, s, l) {
  43961. e.subVectors(s, o),
  43962. t.subVectors(a, o),
  43963. i.subVectors(r, o);
  43964. var c = e.dot(e)
  43965. , h = e.dot(t)
  43966. , u = e.dot(i)
  43967. , d = t.dot(t)
  43968. , p = t.dot(i)
  43969. , f = c * d - h * h
  43970. , g = l || new n.Vector3;
  43971. if (0 === f)
  43972. return g.set(-2, -1, -1);
  43973. var m = 1 / f
  43974. , v = (d * u - h * p) * m
  43975. , A = (c * p - h * u) * m;
  43976. return g.set(1 - v - A, A, v)
  43977. }
  43978. }(),
  43979. n.Triangle.containsPoint = function() {
  43980. var e = new n.Vector3;
  43981. return function(t, i, r, o) {
  43982. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43983. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43984. }
  43985. }(),
  43986. n.Triangle.prototype = {
  43987. constructor: n.Triangle,
  43988. set: function(e, t, i) {
  43989. return this.a.copy(e),
  43990. this.b.copy(t),
  43991. this.c.copy(i),
  43992. this
  43993. },
  43994. setFromPointsAndIndices: function(e, t, i, n) {
  43995. return this.a.copy(e[t]),
  43996. this.b.copy(e[i]),
  43997. this.c.copy(e[n]),
  43998. this
  43999. },
  44000. clone: function() {
  44001. return (new this.constructor).copy(this)
  44002. },
  44003. copy: function(e) {
  44004. return this.a.copy(e.a),
  44005. this.b.copy(e.b),
  44006. this.c.copy(e.c),
  44007. this
  44008. },
  44009. area: function() {
  44010. var e = new n.Vector3
  44011. , t = new n.Vector3;
  44012. return function() {
  44013. return e.subVectors(this.c, this.b),
  44014. t.subVectors(this.a, this.b),
  44015. .5 * e.cross(t).length()
  44016. }
  44017. }(),
  44018. midpoint: function(e) {
  44019. var t = e || new n.Vector3;
  44020. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  44021. },
  44022. normal: function(e) {
  44023. return n.Triangle.normal(this.a, this.b, this.c, e)
  44024. },
  44025. plane: function(e) {
  44026. var t = e || new n.Plane;
  44027. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  44028. },
  44029. barycoordFromPoint: function(e, t) {
  44030. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  44031. },
  44032. containsPoint: function(e) {
  44033. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  44034. },
  44035. equals: function(e) {
  44036. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  44037. }
  44038. },
  44039. n.Interpolant = function(e, t, i, n) {
  44040. this.parameterPositions = e,
  44041. this._cachedIndex = 0,
  44042. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  44043. this.sampleValues = t,
  44044. this.valueSize = i
  44045. }
  44046. ,
  44047. n.Interpolant.prototype = {
  44048. constructor: n.Interpolant,
  44049. evaluate: function(e) {
  44050. var t = this.parameterPositions
  44051. , i = this._cachedIndex
  44052. , n = t[i]
  44053. , r = t[i - 1];
  44054. e: {
  44055. t: {
  44056. var o;
  44057. i: {
  44058. n: if (!(e < n)) {
  44059. for (var a = i + 2; ; ) {
  44060. if (void 0 === n) {
  44061. if (e < r)
  44062. break n;
  44063. return i = t.length,
  44064. this._cachedIndex = i,
  44065. this.afterEnd_(i - 1, e, r)
  44066. }
  44067. if (i === a)
  44068. break;
  44069. if (r = n,
  44070. n = t[++i],
  44071. e < n)
  44072. break t
  44073. }
  44074. o = t.length;
  44075. break i
  44076. }
  44077. {
  44078. if (e >= r)
  44079. break e;
  44080. var s = t[1];
  44081. e < s && (i = 2,
  44082. r = s);
  44083. for (var a = i - 2; ; ) {
  44084. if (void 0 === r)
  44085. return this._cachedIndex = 0,
  44086. this.beforeStart_(0, e, n);
  44087. if (i === a)
  44088. break;
  44089. if (n = r,
  44090. r = t[--i - 1],
  44091. e >= r)
  44092. break t
  44093. }
  44094. o = i,
  44095. i = 0
  44096. }
  44097. }
  44098. for (; i < o; ) {
  44099. var l = i + o >>> 1;
  44100. e < t[l] ? o = l : i = l + 1
  44101. }
  44102. if (n = t[i],
  44103. r = t[i - 1],
  44104. void 0 === r)
  44105. return this._cachedIndex = 0,
  44106. this.beforeStart_(0, e, n);
  44107. if (void 0 === n)
  44108. return i = t.length,
  44109. this._cachedIndex = i,
  44110. this.afterEnd_(i - 1, r, e)
  44111. }
  44112. this._cachedIndex = i,
  44113. this.intervalChanged_(i, r, n)
  44114. }
  44115. return this.interpolate_(i, r, e, n)
  44116. },
  44117. settings: null,
  44118. DefaultSettings_: {},
  44119. getSettings_: function() {
  44120. return this.settings || this.DefaultSettings_
  44121. },
  44122. copySampleValue_: function(e) {
  44123. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  44124. t[o] = i[r + o];
  44125. return t
  44126. },
  44127. interpolate_: function(e, t, i, n) {
  44128. throw new Error("call to abstract method")
  44129. },
  44130. intervalChanged_: function(e, t, i) {}
  44131. },
  44132. Object.assign(n.Interpolant.prototype, {
  44133. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  44134. afterEnd_: n.Interpolant.prototype.copySampleValue_
  44135. }),
  44136. n.CubicInterpolant = function(e, t, i, r) {
  44137. n.Interpolant.call(this, e, t, i, r),
  44138. this._weightPrev = -0,
  44139. this._offsetPrev = -0,
  44140. this._weightNext = -0,
  44141. this._offsetNext = -0
  44142. }
  44143. ,
  44144. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44145. constructor: n.CubicInterpolant,
  44146. DefaultSettings_: {
  44147. endingStart: n.ZeroCurvatureEnding,
  44148. endingEnd: n.ZeroCurvatureEnding
  44149. },
  44150. intervalChanged_: function(e, t, i) {
  44151. var r = this.parameterPositions
  44152. , o = e - 2
  44153. , a = e + 1
  44154. , s = r[o]
  44155. , l = r[a];
  44156. if (void 0 === s)
  44157. switch (this.getSettings_().endingStart) {
  44158. case n.ZeroSlopeEnding:
  44159. o = e,
  44160. s = 2 * t - i;
  44161. break;
  44162. case n.WrapAroundEnding:
  44163. o = r.length - 2,
  44164. s = t + r[o] - r[o + 1];
  44165. break;
  44166. default:
  44167. o = e,
  44168. s = i
  44169. }
  44170. if (void 0 === l)
  44171. switch (this.getSettings_().endingEnd) {
  44172. case n.ZeroSlopeEnding:
  44173. a = e,
  44174. l = 2 * i - t;
  44175. break;
  44176. case n.WrapAroundEnding:
  44177. a = 1,
  44178. l = i + r[1] - r[0];
  44179. break;
  44180. default:
  44181. a = e - 1,
  44182. l = t
  44183. }
  44184. var c = .5 * (i - t)
  44185. , h = this.valueSize;
  44186. this._weightPrev = c / (t - s),
  44187. this._weightNext = c / (l - i),
  44188. this._offsetPrev = o * h,
  44189. this._offsetNext = a * h
  44190. },
  44191. interpolate_: function(e, t, i, n) {
  44192. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  44193. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  44194. return r
  44195. }
  44196. }),
  44197. n.DiscreteInterpolant = function(e, t, i, r) {
  44198. n.Interpolant.call(this, e, t, i, r)
  44199. }
  44200. ,
  44201. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44202. constructor: n.DiscreteInterpolant,
  44203. interpolate_: function(e, t, i, n) {
  44204. return this.copySampleValue_(e - 1)
  44205. }
  44206. }),
  44207. n.LinearInterpolant = function(e, t, i, r) {
  44208. n.Interpolant.call(this, e, t, i, r)
  44209. }
  44210. ,
  44211. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44212. constructor: n.LinearInterpolant,
  44213. interpolate_: function(e, t, i, n) {
  44214. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (i - t) / (n - t), h = 1 - c, u = 0; u !== a; ++u)
  44215. r[u] = o[l + u] * h + o[s + u] * c;
  44216. return r
  44217. }
  44218. }),
  44219. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  44220. n.Interpolant.call(this, e, t, i, r)
  44221. }
  44222. ,
  44223. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  44224. constructor: n.QuaternionLinearInterpolant,
  44225. interpolate_: function(e, t, i, r) {
  44226. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  44227. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  44228. return o
  44229. }
  44230. }),
  44231. n.Clock = function(e) {
  44232. this.autoStart = void 0 === e || e,
  44233. this.startTime = 0,
  44234. this.oldTime = 0,
  44235. this.elapsedTime = 0,
  44236. this.running = !1
  44237. }
  44238. ,
  44239. n.Clock.prototype = {
  44240. constructor: n.Clock,
  44241. start: function() {
  44242. this.startTime = performance.now(),
  44243. this.oldTime = this.startTime,
  44244. this.running = !0
  44245. },
  44246. stop: function() {
  44247. this.getElapsedTime(),
  44248. this.running = !1
  44249. },
  44250. getElapsedTime: function() {
  44251. return this.getDelta(),
  44252. this.elapsedTime
  44253. },
  44254. getDelta: function() {
  44255. var e = 0;
  44256. if (this.autoStart && !this.running && this.start(),
  44257. this.running) {
  44258. var t = performance.now();
  44259. e = .001 * (t - this.oldTime),
  44260. this.oldTime = t,
  44261. this.elapsedTime += e
  44262. }
  44263. return e
  44264. }
  44265. },
  44266. n.EventDispatcher = function() {}
  44267. ,
  44268. n.EventDispatcher.prototype = {
  44269. constructor: n.EventDispatcher,
  44270. apply: function(e) {
  44271. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  44272. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  44273. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  44274. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  44275. },
  44276. addEventListener: function(e, t) {
  44277. void 0 === this._listeners && (this._listeners = {});
  44278. var i = this._listeners;
  44279. void 0 === i[e] && (i[e] = []),
  44280. i[e].indexOf(t) === -1 && i[e].push(t)
  44281. },
  44282. hasEventListener: function(e, t) {
  44283. if (void 0 === this._listeners)
  44284. return !1;
  44285. var i = this._listeners;
  44286. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  44287. },
  44288. removeEventListener: function(e, t) {
  44289. if (void 0 !== this._listeners) {
  44290. var i = this._listeners
  44291. , n = i[e];
  44292. if (void 0 !== n) {
  44293. var r = n.indexOf(t);
  44294. r !== -1 && n.splice(r, 1)
  44295. }
  44296. }
  44297. },
  44298. dispatchEvent: function(e) {
  44299. if (void 0 !== this._listeners) {
  44300. var t = this._listeners
  44301. , i = t[e.type];
  44302. if (void 0 !== i) {
  44303. e.target = this;
  44304. for (var n = [], r = i.length, o = 0; o < r; o++)
  44305. n[o] = i[o];
  44306. for (var o = 0; o < r; o++)
  44307. n[o].call(this, e)
  44308. }
  44309. }
  44310. }
  44311. },
  44312. n.Layers = function() {
  44313. this.mask = 1
  44314. }
  44315. ,
  44316. n.Layers.prototype = {
  44317. constructor: n.Layers,
  44318. set: function(e) {
  44319. this.mask = 1 << e
  44320. },
  44321. enable: function(e) {
  44322. this.mask |= 1 << e
  44323. },
  44324. toggle: function(e) {
  44325. this.mask ^= 1 << e
  44326. },
  44327. disable: function(e) {
  44328. this.mask &= ~(1 << e)
  44329. },
  44330. test: function(e) {
  44331. return 0 !== (this.mask & e.mask)
  44332. }
  44333. },
  44334. function(e) {
  44335. function t(e, t) {
  44336. return e.distance - t.distance
  44337. }
  44338. function i(e, t, n, r) {
  44339. if (e.visible !== !1 && (e.raycast(t, n),
  44340. r === !0))
  44341. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  44342. i(o[a], t, n, !0)
  44343. }
  44344. e.Raycaster = function(t, i, n, r) {
  44345. this.ray = new e.Ray(t,i),
  44346. this.near = n || 0,
  44347. this.far = r || 1 / 0,
  44348. this.params = {
  44349. Mesh: {},
  44350. Line: {},
  44351. LOD: {},
  44352. Points: {
  44353. threshold: 1
  44354. },
  44355. Sprite: {}
  44356. },
  44357. Object.defineProperties(this.params, {
  44358. PointCloud: {
  44359. get: function() {
  44360. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  44361. this.Points
  44362. }
  44363. }
  44364. })
  44365. }
  44366. ,
  44367. e.Raycaster.prototype = {
  44368. constructor: e.Raycaster,
  44369. linePrecision: 1,
  44370. set: function(e, t) {
  44371. this.ray.set(e, t)
  44372. },
  44373. setFromCamera: function(t, i) {
  44374. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  44375. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  44376. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  44377. },
  44378. intersectObject: function(e, n) {
  44379. var r = [];
  44380. return i(e, this, r, n),
  44381. r.sort(t),
  44382. r
  44383. },
  44384. intersectObjects: function(e, n) {
  44385. var r = [];
  44386. if (Array.isArray(e) === !1)
  44387. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  44388. r;
  44389. for (var o = 0, a = e.length; o < a; o++)
  44390. i(e[o], this, r, n);
  44391. return r.sort(t),
  44392. r
  44393. }
  44394. }
  44395. }(n),
  44396. n.Object3D = function() {
  44397. function e() {
  44398. o.setFromEuler(r, !1)
  44399. }
  44400. function t() {
  44401. r.setFromQuaternion(o, void 0, !1)
  44402. }
  44403. Object.defineProperty(this, "id", {
  44404. value: n.Object3DIdCount++
  44405. }),
  44406. this.uuid = n.Math.generateUUID(),
  44407. this.name = "",
  44408. this.type = "Object3D",
  44409. this.parent = null,
  44410. this.children = [],
  44411. this.up = n.Object3D.DefaultUp.clone();
  44412. var i = new n.Vector3
  44413. , r = new n.Euler
  44414. , o = new n.Quaternion
  44415. , a = new n.Vector3(1,1,1);
  44416. r.onChange(e),
  44417. o.onChange(t),
  44418. Object.defineProperties(this, {
  44419. position: {
  44420. enumerable: !0,
  44421. value: i
  44422. },
  44423. rotation: {
  44424. enumerable: !0,
  44425. value: r
  44426. },
  44427. quaternion: {
  44428. enumerable: !0,
  44429. value: o
  44430. },
  44431. scale: {
  44432. enumerable: !0,
  44433. value: a
  44434. },
  44435. modelViewMatrix: {
  44436. value: new n.Matrix4
  44437. },
  44438. normalMatrix: {
  44439. value: new n.Matrix3
  44440. }
  44441. }),
  44442. this.rotationAutoUpdate = !0,
  44443. this.matrix = new n.Matrix4,
  44444. this.matrixWorld = new n.Matrix4,
  44445. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  44446. this.matrixWorldNeedsUpdate = !1,
  44447. this.layers = new n.Layers,
  44448. this.visible = !0,
  44449. this.castShadow = !1,
  44450. this.receiveShadow = !1,
  44451. this.frustumCulled = !0,
  44452. this.renderOrder = 0,
  44453. this.userData = {}
  44454. }
  44455. ,
  44456. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  44457. n.Object3D.DefaultMatrixAutoUpdate = !0,
  44458. n.Object3D.prototype = {
  44459. constructor: n.Object3D,
  44460. applyMatrix: function(e) {
  44461. this.matrix.multiplyMatrices(e, this.matrix),
  44462. this.matrix.decompose(this.position, this.quaternion, this.scale)
  44463. },
  44464. setRotationFromAxisAngle: function(e, t) {
  44465. this.quaternion.setFromAxisAngle(e, t)
  44466. },
  44467. setRotationFromEuler: function(e) {
  44468. this.quaternion.setFromEuler(e, !0)
  44469. },
  44470. setRotationFromMatrix: function(e) {
  44471. this.quaternion.setFromRotationMatrix(e)
  44472. },
  44473. setRotationFromQuaternion: function(e) {
  44474. this.quaternion.copy(e)
  44475. },
  44476. rotateOnAxis: function() {
  44477. var e = new n.Quaternion;
  44478. return function(t, i) {
  44479. return e.setFromAxisAngle(t, i),
  44480. this.quaternion.multiply(e),
  44481. this
  44482. }
  44483. }(),
  44484. rotateX: function() {
  44485. var e = new n.Vector3(1,0,0);
  44486. return function(t) {
  44487. return this.rotateOnAxis(e, t)
  44488. }
  44489. }(),
  44490. rotateY: function() {
  44491. var e = new n.Vector3(0,1,0);
  44492. return function(t) {
  44493. return this.rotateOnAxis(e, t)
  44494. }
  44495. }(),
  44496. rotateZ: function() {
  44497. var e = new n.Vector3(0,0,1);
  44498. return function(t) {
  44499. return this.rotateOnAxis(e, t)
  44500. }
  44501. }(),
  44502. translateOnAxis: function() {
  44503. var e = new n.Vector3;
  44504. return function(t, i) {
  44505. return e.copy(t).applyQuaternion(this.quaternion),
  44506. this.position.add(e.multiplyScalar(i)),
  44507. this
  44508. }
  44509. }(),
  44510. translateX: function() {
  44511. var e = new n.Vector3(1,0,0);
  44512. return function(t) {
  44513. return this.translateOnAxis(e, t)
  44514. }
  44515. }(),
  44516. translateY: function() {
  44517. var e = new n.Vector3(0,1,0);
  44518. return function(t) {
  44519. return this.translateOnAxis(e, t)
  44520. }
  44521. }(),
  44522. translateZ: function() {
  44523. var e = new n.Vector3(0,0,1);
  44524. return function(t) {
  44525. return this.translateOnAxis(e, t)
  44526. }
  44527. }(),
  44528. localToWorld: function(e) {
  44529. return e.applyMatrix4(this.matrixWorld)
  44530. },
  44531. worldToLocal: function() {
  44532. var e = new n.Matrix4;
  44533. return function(t) {
  44534. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  44535. }
  44536. }(),
  44537. lookAt: function() {
  44538. var e = new n.Matrix4;
  44539. return function(t) {
  44540. e.lookAt(t, this.position, this.up),
  44541. this.quaternion.setFromRotationMatrix(e)
  44542. }
  44543. }(),
  44544. add: function(e) {
  44545. if (arguments.length > 1) {
  44546. for (var t = 0; t < arguments.length; t++)
  44547. this.add(arguments[t]);
  44548. return this
  44549. }
  44550. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  44551. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  44552. e.parent = this,
  44553. e.dispatchEvent({
  44554. type: "added"
  44555. }),
  44556. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  44557. this)
  44558. },
  44559. remove: function(e) {
  44560. if (arguments.length > 1)
  44561. for (var t = 0; t < arguments.length; t++)
  44562. this.remove(arguments[t]);
  44563. var i = this.children.indexOf(e);
  44564. i !== -1 && (e.parent = null,
  44565. e.dispatchEvent({
  44566. type: "removed"
  44567. }),
  44568. this.children.splice(i, 1))
  44569. },
  44570. getObjectById: function(e) {
  44571. return this.getObjectByProperty("id", e)
  44572. },
  44573. getObjectByName: function(e) {
  44574. return this.getObjectByProperty("name", e)
  44575. },
  44576. getObjectByProperty: function(e, t) {
  44577. if (this[e] === t)
  44578. return this;
  44579. for (var i = 0, n = this.children.length; i < n; i++) {
  44580. var r = this.children[i]
  44581. , o = r.getObjectByProperty(e, t);
  44582. if (void 0 !== o)
  44583. return o
  44584. }
  44585. },
  44586. getWorldPosition: function(e) {
  44587. var t = e || new n.Vector3;
  44588. return this.updateMatrixWorld(!0),
  44589. t.setFromMatrixPosition(this.matrixWorld)
  44590. },
  44591. getWorldQuaternion: function() {
  44592. var e = new n.Vector3
  44593. , t = new n.Vector3;
  44594. return function(i) {
  44595. var r = i || new n.Quaternion;
  44596. return this.updateMatrixWorld(!0),
  44597. this.matrixWorld.decompose(e, r, t),
  44598. r
  44599. }
  44600. }(),
  44601. getWorldRotation: function() {
  44602. var e = new n.Quaternion;
  44603. return function(t) {
  44604. var i = t || new n.Euler;
  44605. return this.getWorldQuaternion(e),
  44606. i.setFromQuaternion(e, this.rotation.order, !1)
  44607. }
  44608. }(),
  44609. getWorldScale: function() {
  44610. var e = new n.Vector3
  44611. , t = new n.Quaternion;
  44612. return function(i) {
  44613. var r = i || new n.Vector3;
  44614. return this.updateMatrixWorld(!0),
  44615. this.matrixWorld.decompose(e, t, r),
  44616. r
  44617. }
  44618. }(),
  44619. getWorldDirection: function() {
  44620. var e = new n.Quaternion;
  44621. return function(t) {
  44622. var i = t || new n.Vector3;
  44623. return this.getWorldQuaternion(e),
  44624. i.set(0, 0, 1).applyQuaternion(e)
  44625. }
  44626. }(),
  44627. raycast: function() {},
  44628. traverse: function(e) {
  44629. e(this);
  44630. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44631. t[i].traverse(e)
  44632. },
  44633. traverseVisible: function(e) {
  44634. if (this.visible !== !1) {
  44635. e(this);
  44636. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44637. t[i].traverseVisible(e)
  44638. }
  44639. },
  44640. traverseAncestors: function(e) {
  44641. var t = this.parent;
  44642. null !== t && (e(t),
  44643. t.traverseAncestors(e))
  44644. },
  44645. updateMatrix: function() {
  44646. this.matrix.compose(this.position, this.quaternion, this.scale),
  44647. this.matrixWorldNeedsUpdate = !0
  44648. },
  44649. updateMatrixWorld: function(e) {
  44650. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44651. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44652. this.matrixWorldNeedsUpdate = !1,
  44653. e = !0);
  44654. for (var t = 0, i = this.children.length; t < i; t++)
  44655. this.children[t].updateMatrixWorld(e)
  44656. },
  44657. toJSON: function(e) {
  44658. function t(e) {
  44659. var t = [];
  44660. for (var i in e) {
  44661. var n = e[i];
  44662. delete n.metadata,
  44663. t.push(n)
  44664. }
  44665. return t
  44666. }
  44667. var i = void 0 === e
  44668. , n = {};
  44669. i && (e = {
  44670. geometries: {},
  44671. materials: {},
  44672. textures: {},
  44673. images: {}
  44674. },
  44675. n.metadata = {
  44676. version: 4.4,
  44677. type: "Object",
  44678. generator: "Object3D.toJSON"
  44679. });
  44680. var r = {};
  44681. if (r.uuid = this.uuid,
  44682. r.type = this.type,
  44683. "" !== this.name && (r.name = this.name),
  44684. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44685. this.castShadow === !0 && (r.castShadow = !0),
  44686. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44687. this.visible === !1 && (r.visible = !1),
  44688. r.matrix = this.matrix.toArray(),
  44689. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44690. r.geometry = this.geometry.uuid),
  44691. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44692. r.material = this.material.uuid),
  44693. this.children.length > 0) {
  44694. r.children = [];
  44695. for (var o = 0; o < this.children.length; o++)
  44696. r.children.push(this.children[o].toJSON(e).object)
  44697. }
  44698. if (i) {
  44699. var a = t(e.geometries)
  44700. , s = t(e.materials)
  44701. , l = t(e.textures)
  44702. , c = t(e.images);
  44703. a.length > 0 && (n.geometries = a),
  44704. s.length > 0 && (n.materials = s),
  44705. l.length > 0 && (n.textures = l),
  44706. c.length > 0 && (n.images = c)
  44707. }
  44708. return n.object = r,
  44709. n
  44710. },
  44711. clone: function(e) {
  44712. return (new this.constructor).copy(this, e)
  44713. },
  44714. copy: function(e, t) {
  44715. if (void 0 === t && (t = !0),
  44716. this.name = e.name,
  44717. this.up.copy(e.up),
  44718. this.position.copy(e.position),
  44719. this.quaternion.copy(e.quaternion),
  44720. this.scale.copy(e.scale),
  44721. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44722. this.matrix.copy(e.matrix),
  44723. this.matrixWorld.copy(e.matrixWorld),
  44724. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44725. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44726. this.visible = e.visible,
  44727. this.castShadow = e.castShadow,
  44728. this.receiveShadow = e.receiveShadow,
  44729. this.frustumCulled = e.frustumCulled,
  44730. this.renderOrder = e.renderOrder,
  44731. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44732. t === !0)
  44733. for (var i = 0; i < e.children.length; i++) {
  44734. var n = e.children[i];
  44735. this.add(n.clone())
  44736. }
  44737. return this
  44738. }
  44739. },
  44740. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44741. n.Object3DIdCount = 0,
  44742. n.Face3 = function(e, t, i, r, o, a) {
  44743. this.a = e,
  44744. this.b = t,
  44745. this.c = i,
  44746. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44747. this.vertexNormals = Array.isArray(r) ? r : [],
  44748. this.color = o instanceof n.Color ? o : new n.Color,
  44749. this.vertexColors = Array.isArray(o) ? o : [],
  44750. this.materialIndex = void 0 !== a ? a : 0
  44751. }
  44752. ,
  44753. n.Face3.prototype = {
  44754. constructor: n.Face3,
  44755. clone: function() {
  44756. return (new this.constructor).copy(this)
  44757. },
  44758. copy: function(e) {
  44759. this.a = e.a,
  44760. this.b = e.b,
  44761. this.c = e.c,
  44762. this.normal.copy(e.normal),
  44763. this.color.copy(e.color),
  44764. this.materialIndex = e.materialIndex;
  44765. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44766. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44767. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44768. this.vertexColors[t] = e.vertexColors[t].clone();
  44769. return this
  44770. }
  44771. },
  44772. n.BufferAttribute = function(e, t) {
  44773. this.uuid = n.Math.generateUUID(),
  44774. this.array = e,
  44775. this.itemSize = t,
  44776. this.dynamic = !1,
  44777. this.updateRange = {
  44778. offset: 0,
  44779. count: -1
  44780. },
  44781. this.version = 0
  44782. }
  44783. ,
  44784. n.BufferAttribute.prototype = {
  44785. constructor: n.BufferAttribute,
  44786. get count() {
  44787. return this.array.length / this.itemSize
  44788. },
  44789. set needsUpdate(e) {
  44790. e === !0 && this.version++
  44791. },
  44792. setDynamic: function(e) {
  44793. return this.dynamic = e,
  44794. this
  44795. },
  44796. copy: function(e) {
  44797. return this.array = new e.array.constructor(e.array),
  44798. this.itemSize = e.itemSize,
  44799. this.dynamic = e.dynamic,
  44800. this
  44801. },
  44802. copyAt: function(e, t, i) {
  44803. e *= this.itemSize,
  44804. i *= t.itemSize;
  44805. for (var n = 0, r = this.itemSize; n < r; n++)
  44806. this.array[e + n] = t.array[i + n];
  44807. return this
  44808. },
  44809. copyArray: function(e) {
  44810. return this.array.set(e),
  44811. this
  44812. },
  44813. copyColorsArray: function(e) {
  44814. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44815. var a = e[r];
  44816. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44817. a = new n.Color),
  44818. t[i++] = a.r,
  44819. t[i++] = a.g,
  44820. t[i++] = a.b
  44821. }
  44822. return this
  44823. },
  44824. copyIndicesArray: function(e) {
  44825. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44826. var o = e[n];
  44827. t[i++] = o.a,
  44828. t[i++] = o.b,
  44829. t[i++] = o.c
  44830. }
  44831. return this
  44832. },
  44833. copyVector2sArray: function(e) {
  44834. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44835. var a = e[r];
  44836. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44837. a = new n.Vector2),
  44838. t[i++] = a.x,
  44839. t[i++] = a.y
  44840. }
  44841. return this
  44842. },
  44843. copyVector3sArray: function(e) {
  44844. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44845. var a = e[r];
  44846. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44847. a = new n.Vector3),
  44848. t[i++] = a.x,
  44849. t[i++] = a.y,
  44850. t[i++] = a.z
  44851. }
  44852. return this
  44853. },
  44854. copyVector4sArray: function(e) {
  44855. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44856. var a = e[r];
  44857. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44858. a = new n.Vector4),
  44859. t[i++] = a.x,
  44860. t[i++] = a.y,
  44861. t[i++] = a.z,
  44862. t[i++] = a.w
  44863. }
  44864. return this
  44865. },
  44866. set: function(e, t) {
  44867. return void 0 === t && (t = 0),
  44868. this.array.set(e, t),
  44869. this
  44870. },
  44871. getX: function(e) {
  44872. return this.array[e * this.itemSize]
  44873. },
  44874. setX: function(e, t) {
  44875. return this.array[e * this.itemSize] = t,
  44876. this
  44877. },
  44878. getY: function(e) {
  44879. return this.array[e * this.itemSize + 1]
  44880. },
  44881. setY: function(e, t) {
  44882. return this.array[e * this.itemSize + 1] = t,
  44883. this
  44884. },
  44885. getZ: function(e) {
  44886. return this.array[e * this.itemSize + 2]
  44887. },
  44888. setZ: function(e, t) {
  44889. return this.array[e * this.itemSize + 2] = t,
  44890. this
  44891. },
  44892. getW: function(e) {
  44893. return this.array[e * this.itemSize + 3]
  44894. },
  44895. setW: function(e, t) {
  44896. return this.array[e * this.itemSize + 3] = t,
  44897. this
  44898. },
  44899. setXY: function(e, t, i) {
  44900. return e *= this.itemSize,
  44901. this.array[e + 0] = t,
  44902. this.array[e + 1] = i,
  44903. this
  44904. },
  44905. setXYZ: function(e, t, i, n) {
  44906. return e *= this.itemSize,
  44907. this.array[e + 0] = t,
  44908. this.array[e + 1] = i,
  44909. this.array[e + 2] = n,
  44910. this
  44911. },
  44912. setXYZW: function(e, t, i, n, r) {
  44913. return e *= this.itemSize,
  44914. this.array[e + 0] = t,
  44915. this.array[e + 1] = i,
  44916. this.array[e + 2] = n,
  44917. this.array[e + 3] = r,
  44918. this
  44919. },
  44920. clone: function() {
  44921. return (new this.constructor).copy(this)
  44922. }
  44923. },
  44924. n.Int8Attribute = function(e, t) {
  44925. return new n.BufferAttribute(new Int8Array(e),t)
  44926. }
  44927. ,
  44928. n.Uint8Attribute = function(e, t) {
  44929. return new n.BufferAttribute(new Uint8Array(e),t)
  44930. }
  44931. ,
  44932. n.Uint8ClampedAttribute = function(e, t) {
  44933. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44934. }
  44935. ,
  44936. n.Int16Attribute = function(e, t) {
  44937. return new n.BufferAttribute(new Int16Array(e),t)
  44938. }
  44939. ,
  44940. n.Uint16Attribute = function(e, t) {
  44941. return new n.BufferAttribute(new Uint16Array(e),t)
  44942. }
  44943. ;
  44944. n.Int32Attribute = function(e, t) {
  44945. return new n.BufferAttribute(new Int32Array(e),t)
  44946. }
  44947. ;
  44948. n.Uint32Attribute = function(e, t) {
  44949. return new n.BufferAttribute(new Uint32Array(e),t)
  44950. }
  44951. ,
  44952. n.Float32Attribute = function(e, t) {
  44953. return new n.BufferAttribute(new Float32Array(e),t)
  44954. }
  44955. ,
  44956. n.Float64Attribute = function(e, t) {
  44957. return new n.BufferAttribute(new Float64Array(e),t)
  44958. }
  44959. ,
  44960. n.DynamicBufferAttribute = function(e, t) {
  44961. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44962. new n.BufferAttribute(e,t).setDynamic(!0)
  44963. }
  44964. ,
  44965. n.InstancedBufferAttribute = function(e, t, i) {
  44966. n.BufferAttribute.call(this, e, t),
  44967. this.meshPerAttribute = i || 1
  44968. }
  44969. ,
  44970. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44971. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44972. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44973. return n.BufferAttribute.prototype.copy.call(this, e),
  44974. this.meshPerAttribute = e.meshPerAttribute,
  44975. this
  44976. }
  44977. ,
  44978. n.InterleavedBuffer = function(e, t) {
  44979. this.uuid = n.Math.generateUUID(),
  44980. this.array = e,
  44981. this.stride = t,
  44982. this.dynamic = !1,
  44983. this.updateRange = {
  44984. offset: 0,
  44985. count: -1
  44986. },
  44987. this.version = 0
  44988. }
  44989. ,
  44990. n.InterleavedBuffer.prototype = {
  44991. constructor: n.InterleavedBuffer,
  44992. get length() {
  44993. return this.array.length
  44994. },
  44995. get count() {
  44996. return this.array.length / this.stride
  44997. },
  44998. set needsUpdate(e) {
  44999. e === !0 && this.version++
  45000. },
  45001. setDynamic: function(e) {
  45002. return this.dynamic = e,
  45003. this
  45004. },
  45005. copy: function(e) {
  45006. return this.array = new e.array.constructor(e.array),
  45007. this.stride = e.stride,
  45008. this.dynamic = e.dynamic,
  45009. this
  45010. },
  45011. copyAt: function(e, t, i) {
  45012. e *= this.stride,
  45013. i *= t.stride;
  45014. for (var n = 0, r = this.stride; n < r; n++)
  45015. this.array[e + n] = t.array[i + n];
  45016. return this
  45017. },
  45018. set: function(e, t) {
  45019. return void 0 === t && (t = 0),
  45020. this.array.set(e, t),
  45021. this
  45022. },
  45023. clone: function() {
  45024. return (new this.constructor).copy(this)
  45025. }
  45026. },
  45027. n.InstancedInterleavedBuffer = function(e, t, i) {
  45028. n.InterleavedBuffer.call(this, e, t),
  45029. this.meshPerAttribute = i || 1
  45030. }
  45031. ,
  45032. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  45033. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  45034. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  45035. return n.InterleavedBuffer.prototype.copy.call(this, e),
  45036. this.meshPerAttribute = e.meshPerAttribute,
  45037. this
  45038. }
  45039. ,
  45040. n.InterleavedBufferAttribute = function(e, t, i) {
  45041. this.uuid = n.Math.generateUUID(),
  45042. this.data = e,
  45043. this.itemSize = t,
  45044. this.offset = i
  45045. }
  45046. ,
  45047. n.InterleavedBufferAttribute.prototype = {
  45048. constructor: n.InterleavedBufferAttribute,
  45049. get length() {
  45050. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  45051. this.array.length
  45052. },
  45053. get count() {
  45054. return this.data.count
  45055. },
  45056. setX: function(e, t) {
  45057. return this.data.array[e * this.data.stride + this.offset] = t,
  45058. this
  45059. },
  45060. setY: function(e, t) {
  45061. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  45062. this
  45063. },
  45064. setZ: function(e, t) {
  45065. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  45066. this
  45067. },
  45068. setW: function(e, t) {
  45069. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  45070. this
  45071. },
  45072. getX: function(e) {
  45073. return this.data.array[e * this.data.stride + this.offset]
  45074. },
  45075. getY: function(e) {
  45076. return this.data.array[e * this.data.stride + this.offset + 1]
  45077. },
  45078. getZ: function(e) {
  45079. return this.data.array[e * this.data.stride + this.offset + 2]
  45080. },
  45081. getW: function(e) {
  45082. return this.data.array[e * this.data.stride + this.offset + 3]
  45083. },
  45084. setXY: function(e, t, i) {
  45085. return e = e * this.data.stride + this.offset,
  45086. this.data.array[e + 0] = t,
  45087. this.data.array[e + 1] = i,
  45088. this
  45089. },
  45090. setXYZ: function(e, t, i, n) {
  45091. return e = e * this.data.stride + this.offset,
  45092. this.data.array[e + 0] = t,
  45093. this.data.array[e + 1] = i,
  45094. this.data.array[e + 2] = n,
  45095. this
  45096. },
  45097. setXYZW: function(e, t, i, n, r) {
  45098. return e = e * this.data.stride + this.offset,
  45099. this.data.array[e + 0] = t,
  45100. this.data.array[e + 1] = i,
  45101. this.data.array[e + 2] = n,
  45102. this.data.array[e + 3] = r,
  45103. this
  45104. }
  45105. },
  45106. n.Geometry = function() {
  45107. Object.defineProperty(this, "id", {
  45108. value: n.GeometryIdCount++
  45109. }),
  45110. this.uuid = n.Math.generateUUID(),
  45111. this.name = "",
  45112. this.type = "Geometry",
  45113. this.vertices = [],
  45114. this.colors = [],
  45115. this.faces = [],
  45116. this.faceVertexUvs = [[]],
  45117. this.morphTargets = [],
  45118. this.morphNormals = [],
  45119. this.skinWeights = [],
  45120. this.skinIndices = [],
  45121. this.lineDistances = [],
  45122. this.boundingBox = null,
  45123. this.boundingSphere = null,
  45124. this.verticesNeedUpdate = !1,
  45125. this.elementsNeedUpdate = !1,
  45126. this.uvsNeedUpdate = !1,
  45127. this.normalsNeedUpdate = !1,
  45128. this.colorsNeedUpdate = !1,
  45129. this.lineDistancesNeedUpdate = !1,
  45130. this.groupsNeedUpdate = !1
  45131. }
  45132. ,
  45133. n.Geometry.prototype = {
  45134. constructor: n.Geometry,
  45135. applyMatrix: function(e) {
  45136. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  45137. var o = this.vertices[i];
  45138. o.applyMatrix4(e)
  45139. }
  45140. for (var i = 0, r = this.faces.length; i < r; i++) {
  45141. var a = this.faces[i];
  45142. a.normal.applyMatrix3(t).normalize();
  45143. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  45144. a.vertexNormals[s].applyMatrix3(t).normalize()
  45145. }
  45146. return null !== this.boundingBox && this.computeBoundingBox(),
  45147. null !== this.boundingSphere && this.computeBoundingSphere(),
  45148. this.verticesNeedUpdate = !0,
  45149. this.normalsNeedUpdate = !0,
  45150. this
  45151. },
  45152. rotateX: function() {
  45153. var e;
  45154. return function(t) {
  45155. return void 0 === e && (e = new n.Matrix4),
  45156. e.makeRotationX(t),
  45157. this.applyMatrix(e),
  45158. this
  45159. }
  45160. }(),
  45161. rotateY: function() {
  45162. var e;
  45163. return function(t) {
  45164. return void 0 === e && (e = new n.Matrix4),
  45165. e.makeRotationY(t),
  45166. this.applyMatrix(e),
  45167. this
  45168. }
  45169. }(),
  45170. rotateZ: function() {
  45171. var e;
  45172. return function(t) {
  45173. return void 0 === e && (e = new n.Matrix4),
  45174. e.makeRotationZ(t),
  45175. this.applyMatrix(e),
  45176. this
  45177. }
  45178. }(),
  45179. translate: function() {
  45180. var e;
  45181. return function(t, i, r) {
  45182. return void 0 === e && (e = new n.Matrix4),
  45183. e.makeTranslation(t, i, r),
  45184. this.applyMatrix(e),
  45185. this
  45186. }
  45187. }(),
  45188. scale: function() {
  45189. var e;
  45190. return function(t, i, r) {
  45191. return void 0 === e && (e = new n.Matrix4),
  45192. e.makeScale(t, i, r),
  45193. this.applyMatrix(e),
  45194. this
  45195. }
  45196. }(),
  45197. lookAt: function() {
  45198. var e;
  45199. return function(t) {
  45200. void 0 === e && (e = new n.Object3D),
  45201. e.lookAt(t),
  45202. e.updateMatrix(),
  45203. this.applyMatrix(e.matrix)
  45204. }
  45205. }(),
  45206. fromBufferGeometry: function(e) {
  45207. function t(e, t, r, o) {
  45208. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  45209. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  45210. , g = new n.Face3(e,t,r,a,f,o);
  45211. i.faces.push(g),
  45212. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  45213. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  45214. }
  45215. var i = this
  45216. , r = null !== e.index ? e.index.array : void 0
  45217. , o = e.attributes
  45218. , a = o.position.array
  45219. , s = void 0 !== o.normal ? o.normal.array : void 0
  45220. , l = void 0 !== o.color ? o.color.array : void 0
  45221. , c = void 0 !== o.uv ? o.uv.array : void 0
  45222. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  45223. void 0 !== h && (this.faceVertexUvs[1] = []);
  45224. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  45225. g += 2)
  45226. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  45227. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  45228. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  45229. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  45230. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  45231. if (void 0 !== r) {
  45232. var m = e.groups;
  45233. if (m.length > 0)
  45234. for (var f = 0; f < m.length; f++)
  45235. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  45236. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  45237. else
  45238. for (var f = 0; f < r.length; f += 3)
  45239. t(r[f], r[f + 1], r[f + 2])
  45240. } else
  45241. for (var f = 0; f < a.length / 3; f += 3)
  45242. t(f, f + 1, f + 2);
  45243. return this.computeFaceNormals(),
  45244. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45245. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45246. this
  45247. },
  45248. center: function() {
  45249. this.computeBoundingBox();
  45250. var e = this.boundingBox.center().negate();
  45251. return this.translate(e.x, e.y, e.z),
  45252. e
  45253. },
  45254. normalize: function() {
  45255. this.computeBoundingSphere();
  45256. var e = this.boundingSphere.center
  45257. , t = this.boundingSphere.radius
  45258. , i = 0 === t ? 1 : 1 / t
  45259. , r = new n.Matrix4;
  45260. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  45261. this.applyMatrix(r),
  45262. this
  45263. },
  45264. computeFaceNormals: function() {
  45265. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  45266. var o = this.faces[i]
  45267. , a = this.vertices[o.a]
  45268. , s = this.vertices[o.b]
  45269. , l = this.vertices[o.c];
  45270. e.subVectors(l, s),
  45271. t.subVectors(a, s),
  45272. e.cross(t),
  45273. e.normalize(),
  45274. o.normal.copy(e)
  45275. }
  45276. },
  45277. computeVertexNormals: function(e) {
  45278. void 0 === e && (e = !0);
  45279. var t, i, r, o, a, s;
  45280. for (s = new Array(this.vertices.length),
  45281. t = 0,
  45282. i = this.vertices.length; t < i; t++)
  45283. s[t] = new n.Vector3;
  45284. if (e) {
  45285. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  45286. for (r = 0,
  45287. o = this.faces.length; r < o; r++)
  45288. a = this.faces[r],
  45289. l = this.vertices[a.a],
  45290. c = this.vertices[a.b],
  45291. h = this.vertices[a.c],
  45292. u.subVectors(h, c),
  45293. d.subVectors(l, c),
  45294. u.cross(d),
  45295. s[a.a].add(u),
  45296. s[a.b].add(u),
  45297. s[a.c].add(u)
  45298. } else
  45299. for (r = 0,
  45300. o = this.faces.length; r < o; r++)
  45301. a = this.faces[r],
  45302. s[a.a].add(a.normal),
  45303. s[a.b].add(a.normal),
  45304. s[a.c].add(a.normal);
  45305. for (t = 0,
  45306. i = this.vertices.length; t < i; t++)
  45307. s[t].normalize();
  45308. for (r = 0,
  45309. o = this.faces.length; r < o; r++) {
  45310. a = this.faces[r];
  45311. var p = a.vertexNormals;
  45312. 3 === p.length ? (p[0].copy(s[a.a]),
  45313. p[1].copy(s[a.b]),
  45314. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  45315. p[1] = s[a.b].clone(),
  45316. p[2] = s[a.c].clone())
  45317. }
  45318. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  45319. },
  45320. computeMorphNormals: function() {
  45321. var e, t, i, r, o;
  45322. for (i = 0,
  45323. r = this.faces.length; i < r; i++)
  45324. for (o = this.faces[i],
  45325. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  45326. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  45327. e = 0,
  45328. t = o.vertexNormals.length; e < t; e++)
  45329. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  45330. var a = new n.Geometry;
  45331. for (a.faces = this.faces,
  45332. e = 0,
  45333. t = this.morphTargets.length; e < t; e++) {
  45334. if (!this.morphNormals[e]) {
  45335. this.morphNormals[e] = {},
  45336. this.morphNormals[e].faceNormals = [],
  45337. this.morphNormals[e].vertexNormals = [];
  45338. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  45339. for (i = 0,
  45340. r = this.faces.length; i < r; i++)
  45341. s = new n.Vector3,
  45342. l = {
  45343. a: new n.Vector3,
  45344. b: new n.Vector3,
  45345. c: new n.Vector3
  45346. },
  45347. c.push(s),
  45348. h.push(l)
  45349. }
  45350. var u = this.morphNormals[e];
  45351. a.vertices = this.morphTargets[e].vertices,
  45352. a.computeFaceNormals(),
  45353. a.computeVertexNormals();
  45354. var s, l;
  45355. for (i = 0,
  45356. r = this.faces.length; i < r; i++)
  45357. o = this.faces[i],
  45358. s = u.faceNormals[i],
  45359. l = u.vertexNormals[i],
  45360. s.copy(o.normal),
  45361. l.a.copy(o.vertexNormals[0]),
  45362. l.b.copy(o.vertexNormals[1]),
  45363. l.c.copy(o.vertexNormals[2])
  45364. }
  45365. for (i = 0,
  45366. r = this.faces.length; i < r; i++)
  45367. o = this.faces[i],
  45368. o.normal = o.__originalFaceNormal,
  45369. o.vertexNormals = o.__originalVertexNormals
  45370. },
  45371. computeTangents: function() {
  45372. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  45373. },
  45374. computeLineDistances: function() {
  45375. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  45376. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  45377. this.lineDistances[i] = e
  45378. },
  45379. computeBoundingBox: function() {
  45380. null === this.boundingBox && (this.boundingBox = new n.Box3),
  45381. this.boundingBox.setFromPoints(this.vertices)
  45382. },
  45383. computeBoundingSphere: function() {
  45384. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  45385. this.boundingSphere.setFromPoints(this.vertices)
  45386. },
  45387. merge: function(e, t, i) {
  45388. if (e instanceof n.Geometry == !1)
  45389. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  45390. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  45391. void 0 === i && (i = 0),
  45392. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  45393. for (var d = 0, p = s.length; d < p; d++) {
  45394. var f = s[d]
  45395. , g = f.clone();
  45396. void 0 !== t && g.applyMatrix4(t),
  45397. a.push(g)
  45398. }
  45399. for (d = 0,
  45400. p = c.length; d < p; d++) {
  45401. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  45402. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  45403. m.normal.copy(y.normal),
  45404. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  45405. for (var E = 0, b = C.length; E < b; E++)
  45406. v = C[E].clone(),
  45407. void 0 !== r && v.applyMatrix3(r).normalize(),
  45408. m.vertexNormals.push(v);
  45409. m.color.copy(y.color);
  45410. for (var E = 0, b = I.length; E < b; E++)
  45411. A = I[E],
  45412. m.vertexColors.push(A.clone());
  45413. m.materialIndex = y.materialIndex + i,
  45414. l.push(m)
  45415. }
  45416. for (d = 0,
  45417. p = u.length; d < p; d++) {
  45418. var w = u[d]
  45419. , _ = [];
  45420. if (void 0 !== w) {
  45421. for (var E = 0, b = w.length; E < b; E++)
  45422. _.push(w[E].clone());
  45423. h.push(_)
  45424. }
  45425. }
  45426. },
  45427. mergeMesh: function(e) {
  45428. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  45429. void this.merge(e.geometry, e.matrix))
  45430. },
  45431. mergeVertices: function() {
  45432. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  45433. for (i = 0,
  45434. n = this.vertices.length; i < n; i++)
  45435. e = this.vertices[i],
  45436. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  45437. void 0 === l[t] ? (l[t] = i,
  45438. c.push(this.vertices[i]),
  45439. h[i] = c.length - 1) : h[i] = h[l[t]];
  45440. var p = [];
  45441. for (i = 0,
  45442. n = this.faces.length; i < n; i++) {
  45443. r = this.faces[i],
  45444. r.a = h[r.a],
  45445. r.b = h[r.b],
  45446. r.c = h[r.c],
  45447. o = [r.a, r.b, r.c];
  45448. for (var f = -1, g = 0; g < 3; g++)
  45449. if (o[g] === o[(g + 1) % 3]) {
  45450. f = g,
  45451. p.push(i);
  45452. break
  45453. }
  45454. }
  45455. for (i = p.length - 1; i >= 0; i--) {
  45456. var m = p[i];
  45457. for (this.faces.splice(m, 1),
  45458. a = 0,
  45459. s = this.faceVertexUvs.length; a < s; a++)
  45460. this.faceVertexUvs[a].splice(m, 1)
  45461. }
  45462. var v = this.vertices.length - c.length;
  45463. return this.vertices = c,
  45464. v
  45465. },
  45466. sortFacesByMaterialIndex: function() {
  45467. function e(e, t) {
  45468. return e.materialIndex - t.materialIndex
  45469. }
  45470. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  45471. t[n]._id = n;
  45472. t.sort(e);
  45473. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  45474. a && a.length === i && (r = []),
  45475. s && s.length === i && (o = []);
  45476. for (var n = 0; n < i; n++) {
  45477. var l = t[n]._id;
  45478. r && r.push(a[l]),
  45479. o && o.push(s[l])
  45480. }
  45481. r && (this.faceVertexUvs[0] = r),
  45482. o && (this.faceVertexUvs[1] = o)
  45483. },
  45484. toJSON: function() {
  45485. function e(e, t, i) {
  45486. return i ? e | 1 << t : e & ~(1 << t)
  45487. }
  45488. function t(e) {
  45489. var t = e.x.toString() + e.y.toString() + e.z.toString();
  45490. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  45491. u.push(e.x, e.y, e.z),
  45492. d[t])
  45493. }
  45494. function i(e) {
  45495. var t = e.r.toString() + e.g.toString() + e.b.toString();
  45496. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  45497. p.push(e.getHex()),
  45498. f[t])
  45499. }
  45500. function n(e) {
  45501. var t = e.x.toString() + e.y.toString();
  45502. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  45503. g.push(e.x, e.y),
  45504. m[t])
  45505. }
  45506. var r = {
  45507. metadata: {
  45508. version: 4.4,
  45509. type: "Geometry",
  45510. generator: "Geometry.toJSON"
  45511. }
  45512. };
  45513. if (r.uuid = this.uuid,
  45514. r.type = this.type,
  45515. "" !== this.name && (r.name = this.name),
  45516. void 0 !== this.parameters) {
  45517. var o = this.parameters;
  45518. for (var a in o)
  45519. void 0 !== o[a] && (r[a] = o[a]);
  45520. return r
  45521. }
  45522. for (var s = [], l = 0; l < this.vertices.length; l++) {
  45523. var c = this.vertices[l];
  45524. s.push(c.x, c.y, c.z)
  45525. }
  45526. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  45527. var v = this.faces[l]
  45528. , A = !0
  45529. , y = !1
  45530. , C = void 0 !== this.faceVertexUvs[0][l]
  45531. , I = v.normal.length() > 0
  45532. , E = v.vertexNormals.length > 0
  45533. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  45534. , w = v.vertexColors.length > 0
  45535. , _ = 0;
  45536. if (_ = e(_, 0, 0),
  45537. _ = e(_, 1, A),
  45538. _ = e(_, 2, y),
  45539. _ = e(_, 3, C),
  45540. _ = e(_, 4, I),
  45541. _ = e(_, 5, E),
  45542. _ = e(_, 6, b),
  45543. _ = e(_, 7, w),
  45544. h.push(_),
  45545. h.push(v.a, v.b, v.c),
  45546. h.push(v.materialIndex),
  45547. C) {
  45548. var T = this.faceVertexUvs[0][l];
  45549. h.push(n(T[0]), n(T[1]), n(T[2]))
  45550. }
  45551. if (I && h.push(t(v.normal)),
  45552. E) {
  45553. var x = v.vertexNormals;
  45554. h.push(t(x[0]), t(x[1]), t(x[2]))
  45555. }
  45556. if (b && h.push(i(v.color)),
  45557. w) {
  45558. var S = v.vertexColors;
  45559. h.push(i(S[0]), i(S[1]), i(S[2]))
  45560. }
  45561. }
  45562. return r.data = {},
  45563. r.data.vertices = s,
  45564. r.data.normals = u,
  45565. p.length > 0 && (r.data.colors = p),
  45566. g.length > 0 && (r.data.uvs = [g]),
  45567. r.data.faces = h,
  45568. r
  45569. },
  45570. clone: function() {
  45571. return (new n.Geometry).copy(this)
  45572. },
  45573. copy: function(e) {
  45574. this.vertices = [],
  45575. this.faces = [],
  45576. this.faceVertexUvs = [[]];
  45577. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  45578. this.vertices.push(t[i].clone());
  45579. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  45580. this.faces.push(r[i].clone());
  45581. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  45582. var o = e.faceVertexUvs[i];
  45583. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  45584. for (var a = 0, s = o.length; a < s; a++) {
  45585. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  45586. var d = l[h];
  45587. c.push(d.clone())
  45588. }
  45589. this.faceVertexUvs[i].push(c)
  45590. }
  45591. }
  45592. return this
  45593. },
  45594. dispose: function() {
  45595. this.dispatchEvent({
  45596. type: "dispose"
  45597. })
  45598. }
  45599. },
  45600. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  45601. n.GeometryIdCount = 0,
  45602. n.DirectGeometry = function() {
  45603. Object.defineProperty(this, "id", {
  45604. value: n.GeometryIdCount++
  45605. }),
  45606. this.uuid = n.Math.generateUUID(),
  45607. this.name = "",
  45608. this.type = "DirectGeometry",
  45609. this.indices = [],
  45610. this.vertices = [],
  45611. this.normals = [],
  45612. this.colors = [],
  45613. this.uvs = [],
  45614. this.uvs2 = [],
  45615. this.groups = [],
  45616. this.morphTargets = {},
  45617. this.skinWeights = [],
  45618. this.skinIndices = [],
  45619. this.boundingBox = null,
  45620. this.boundingSphere = null,
  45621. this.verticesNeedUpdate = !1,
  45622. this.normalsNeedUpdate = !1,
  45623. this.colorsNeedUpdate = !1,
  45624. this.uvsNeedUpdate = !1,
  45625. this.groupsNeedUpdate = !1
  45626. }
  45627. ,
  45628. n.DirectGeometry.prototype = {
  45629. constructor: n.DirectGeometry,
  45630. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  45631. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  45632. computeFaceNormals: function() {
  45633. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  45634. },
  45635. computeVertexNormals: function() {
  45636. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  45637. },
  45638. computeGroups: function(e) {
  45639. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  45640. var a = r[o];
  45641. a.materialIndex !== i && (i = a.materialIndex,
  45642. void 0 !== t && (t.count = 3 * o - t.start,
  45643. n.push(t)),
  45644. t = {
  45645. start: 3 * o,
  45646. materialIndex: i
  45647. })
  45648. }
  45649. void 0 !== t && (t.count = 3 * o - t.start,
  45650. n.push(t)),
  45651. this.groups = n
  45652. },
  45653. fromGeometry: function(e) {
  45654. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  45655. if (c > 0) {
  45656. t = [];
  45657. for (var h = 0; h < c; h++)
  45658. t[h] = [];
  45659. this.morphTargets.position = t
  45660. }
  45661. var u, d = e.morphNormals, p = d.length;
  45662. if (p > 0) {
  45663. u = [];
  45664. for (var h = 0; h < p; h++)
  45665. u[h] = [];
  45666. this.morphTargets.normal = u
  45667. }
  45668. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45669. var A = i[h];
  45670. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45671. var y = A.vertexNormals;
  45672. if (3 === y.length)
  45673. this.normals.push(y[0], y[1], y[2]);
  45674. else {
  45675. var C = A.normal;
  45676. this.normals.push(C, C, C)
  45677. }
  45678. var I = A.vertexColors;
  45679. if (3 === I.length)
  45680. this.colors.push(I[0], I[1], I[2]);
  45681. else {
  45682. var E = A.color;
  45683. this.colors.push(E, E, E)
  45684. }
  45685. if (a === !0) {
  45686. var b = o[0][h];
  45687. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45688. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45689. }
  45690. if (s === !0) {
  45691. var b = o[1][h];
  45692. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45693. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45694. }
  45695. for (var w = 0; w < c; w++) {
  45696. var _ = l[w].vertices;
  45697. t[w].push(_[A.a], _[A.b], _[A.c])
  45698. }
  45699. for (var w = 0; w < p; w++) {
  45700. var T = d[w].vertexNormals[h];
  45701. u[w].push(T.a, T.b, T.c)
  45702. }
  45703. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45704. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45705. }
  45706. return this.computeGroups(e),
  45707. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45708. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45709. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45710. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45711. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45712. this
  45713. },
  45714. dispose: function() {
  45715. this.dispatchEvent({
  45716. type: "dispose"
  45717. })
  45718. }
  45719. },
  45720. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45721. n.BufferGeometry = function() {
  45722. Object.defineProperty(this, "id", {
  45723. value: n.GeometryIdCount++
  45724. }),
  45725. this.uuid = n.Math.generateUUID(),
  45726. this.name = "",
  45727. this.type = "BufferGeometry",
  45728. this.index = null,
  45729. this.attributes = {},
  45730. this.morphAttributes = {},
  45731. this.groups = [],
  45732. this.boundingBox = null,
  45733. this.boundingSphere = null,
  45734. this.drawRange = {
  45735. start: 0,
  45736. count: 1 / 0
  45737. }
  45738. }
  45739. ,
  45740. n.BufferGeometry.prototype = {
  45741. constructor: n.BufferGeometry,
  45742. getIndex: function() {
  45743. return this.index
  45744. },
  45745. setIndex: function(e) {
  45746. this.index = e
  45747. },
  45748. addAttribute: function(e, t) {
  45749. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45750. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45751. void this.setIndex(t)) : (this.attributes[e] = t,
  45752. this)
  45753. },
  45754. getAttribute: function(e) {
  45755. return this.attributes[e]
  45756. },
  45757. removeAttribute: function(e) {
  45758. return delete this.attributes[e],
  45759. this
  45760. },
  45761. addGroup: function(e, t, i) {
  45762. this.groups.push({
  45763. start: e,
  45764. count: t,
  45765. materialIndex: void 0 !== i ? i : 0
  45766. })
  45767. },
  45768. clearGroups: function() {
  45769. this.groups = []
  45770. },
  45771. setDrawRange: function(e, t) {
  45772. this.drawRange.start = e,
  45773. this.drawRange.count = t
  45774. },
  45775. applyMatrix: function(e) {
  45776. var t = this.attributes.position;
  45777. void 0 !== t && (e.applyToVector3Array(t.array),
  45778. t.needsUpdate = !0);
  45779. var i = this.attributes.normal;
  45780. if (void 0 !== i) {
  45781. var r = (new n.Matrix3).getNormalMatrix(e);
  45782. r.applyToVector3Array(i.array),
  45783. i.needsUpdate = !0
  45784. }
  45785. return null !== this.boundingBox && this.computeBoundingBox(),
  45786. null !== this.boundingSphere && this.computeBoundingSphere(),
  45787. this
  45788. },
  45789. rotateX: function() {
  45790. var e;
  45791. return function(t) {
  45792. return void 0 === e && (e = new n.Matrix4),
  45793. e.makeRotationX(t),
  45794. this.applyMatrix(e),
  45795. this
  45796. }
  45797. }(),
  45798. rotateY: function() {
  45799. var e;
  45800. return function(t) {
  45801. return void 0 === e && (e = new n.Matrix4),
  45802. e.makeRotationY(t),
  45803. this.applyMatrix(e),
  45804. this
  45805. }
  45806. }(),
  45807. rotateZ: function() {
  45808. var e;
  45809. return function(t) {
  45810. return void 0 === e && (e = new n.Matrix4),
  45811. e.makeRotationZ(t),
  45812. this.applyMatrix(e),
  45813. this
  45814. }
  45815. }(),
  45816. translate: function() {
  45817. var e;
  45818. return function(t, i, r) {
  45819. return void 0 === e && (e = new n.Matrix4),
  45820. e.makeTranslation(t, i, r),
  45821. this.applyMatrix(e),
  45822. this
  45823. }
  45824. }(),
  45825. scale: function() {
  45826. var e;
  45827. return function(t, i, r) {
  45828. return void 0 === e && (e = new n.Matrix4),
  45829. e.makeScale(t, i, r),
  45830. this.applyMatrix(e),
  45831. this
  45832. }
  45833. }(),
  45834. lookAt: function() {
  45835. var e;
  45836. return function(t) {
  45837. void 0 === e && (e = new n.Object3D),
  45838. e.lookAt(t),
  45839. e.updateMatrix(),
  45840. this.applyMatrix(e.matrix)
  45841. }
  45842. }(),
  45843. center: function() {
  45844. this.computeBoundingBox();
  45845. var e = this.boundingBox.center().negate();
  45846. return this.translate(e.x, e.y, e.z),
  45847. e
  45848. },
  45849. setFromObject: function(e) {
  45850. var t = e.geometry;
  45851. if (e instanceof n.Points || e instanceof n.Line) {
  45852. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45853. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45854. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45855. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45856. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45857. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45858. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45859. }
  45860. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45861. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45862. } else
  45863. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45864. return this
  45865. },
  45866. updateFromObject: function(e) {
  45867. var t = e.geometry;
  45868. if (e instanceof n.Mesh) {
  45869. var i = t.__directGeometry;
  45870. if (void 0 === i)
  45871. return this.fromGeometry(t);
  45872. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45873. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45874. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45875. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45876. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45877. t.verticesNeedUpdate = !1,
  45878. t.normalsNeedUpdate = !1,
  45879. t.colorsNeedUpdate = !1,
  45880. t.uvsNeedUpdate = !1,
  45881. t.groupsNeedUpdate = !1,
  45882. t = i
  45883. }
  45884. if (t.verticesNeedUpdate === !0) {
  45885. var r = this.attributes.position;
  45886. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45887. r.needsUpdate = !0),
  45888. t.verticesNeedUpdate = !1
  45889. }
  45890. if (t.normalsNeedUpdate === !0) {
  45891. var r = this.attributes.normal;
  45892. void 0 !== r && (r.copyVector3sArray(t.normals),
  45893. r.needsUpdate = !0),
  45894. t.normalsNeedUpdate = !1
  45895. }
  45896. if (t.colorsNeedUpdate === !0) {
  45897. var r = this.attributes.color;
  45898. void 0 !== r && (r.copyColorsArray(t.colors),
  45899. r.needsUpdate = !0),
  45900. t.colorsNeedUpdate = !1
  45901. }
  45902. if (t.uvsNeedUpdate) {
  45903. var r = this.attributes.uv;
  45904. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45905. r.needsUpdate = !0),
  45906. t.uvsNeedUpdate = !1
  45907. }
  45908. if (t.lineDistancesNeedUpdate) {
  45909. var r = this.attributes.lineDistance;
  45910. void 0 !== r && (r.copyArray(t.lineDistances),
  45911. r.needsUpdate = !0),
  45912. t.lineDistancesNeedUpdate = !1
  45913. }
  45914. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45915. this.groups = t.groups,
  45916. t.groupsNeedUpdate = !1),
  45917. this
  45918. },
  45919. fromGeometry: function(e) {
  45920. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45921. this.fromDirectGeometry(e.__directGeometry)
  45922. },
  45923. fromDirectGeometry: function(e) {
  45924. var t = new Float32Array(3 * e.vertices.length);
  45925. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45926. e.normals.length > 0) {
  45927. var i = new Float32Array(3 * e.normals.length);
  45928. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45929. }
  45930. if (e.colors.length > 0) {
  45931. var r = new Float32Array(3 * e.colors.length);
  45932. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45933. }
  45934. if (e.uvs.length > 0) {
  45935. var o = new Float32Array(2 * e.uvs.length);
  45936. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45937. }
  45938. if (e.uvs2.length > 0) {
  45939. var a = new Float32Array(2 * e.uvs2.length);
  45940. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45941. }
  45942. if (e.indices.length > 0) {
  45943. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45944. , l = new s(3 * e.indices.length);
  45945. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45946. }
  45947. this.groups = e.groups;
  45948. for (var c in e.morphTargets) {
  45949. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45950. var f = u[d]
  45951. , g = new n.Float32Attribute(3 * f.length,3);
  45952. h.push(g.copyVector3sArray(f))
  45953. }
  45954. this.morphAttributes[c] = h
  45955. }
  45956. if (e.skinIndices.length > 0) {
  45957. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45958. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45959. }
  45960. if (e.skinWeights.length > 0) {
  45961. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45962. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45963. }
  45964. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45965. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45966. this
  45967. },
  45968. computeBoundingBox: function() {
  45969. new n.Vector3;
  45970. return function() {
  45971. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45972. var e = this.attributes.position.array;
  45973. e && this.boundingBox.setFromArray(e),
  45974. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45975. this.boundingBox.max.set(0, 0, 0)),
  45976. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  45977. }
  45978. }(),
  45979. computeBoundingSphere: function() {
  45980. var e = new n.Box3
  45981. , t = new n.Vector3;
  45982. return function() {
  45983. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45984. var i = this.attributes.position.array;
  45985. if (i) {
  45986. var r = this.boundingSphere.center;
  45987. e.setFromArray(i),
  45988. e.center(r);
  45989. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45990. t.fromArray(i, a),
  45991. o = Math.max(o, r.distanceToSquared(t));
  45992. this.boundingSphere.radius = Math.sqrt(o),
  45993. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45994. }
  45995. }
  45996. }(),
  45997. computeFaceNormals: function() {},
  45998. computeVertexNormals: function() {
  45999. var e = this.index
  46000. , t = this.attributes
  46001. , i = this.groups;
  46002. if (t.position) {
  46003. var r = t.position.array;
  46004. if (void 0 === t.normal)
  46005. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  46006. else
  46007. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  46008. o[a] = 0;
  46009. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  46010. if (e) {
  46011. var v = e.array;
  46012. 0 === i.length && this.addGroup(0, v.length);
  46013. for (var A = 0, y = i.length; A < y; ++A)
  46014. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  46015. l = 3 * v[a + 0],
  46016. c = 3 * v[a + 1],
  46017. h = 3 * v[a + 2],
  46018. d.fromArray(r, l),
  46019. p.fromArray(r, c),
  46020. f.fromArray(r, h),
  46021. g.subVectors(f, p),
  46022. m.subVectors(d, p),
  46023. g.cross(m),
  46024. u[l] += g.x,
  46025. u[l + 1] += g.y,
  46026. u[l + 2] += g.z,
  46027. u[c] += g.x,
  46028. u[c + 1] += g.y,
  46029. u[c + 2] += g.z,
  46030. u[h] += g.x,
  46031. u[h + 1] += g.y,
  46032. u[h + 2] += g.z
  46033. } else
  46034. for (var a = 0, s = r.length; a < s; a += 9)
  46035. d.fromArray(r, a),
  46036. p.fromArray(r, a + 3),
  46037. f.fromArray(r, a + 6),
  46038. g.subVectors(f, p),
  46039. m.subVectors(d, p),
  46040. g.cross(m),
  46041. u[a] = g.x,
  46042. u[a + 1] = g.y,
  46043. u[a + 2] = g.z,
  46044. u[a + 3] = g.x,
  46045. u[a + 4] = g.y,
  46046. u[a + 5] = g.z,
  46047. u[a + 6] = g.x,
  46048. u[a + 7] = g.y,
  46049. u[a + 8] = g.z;
  46050. this.normalizeNormals(),
  46051. t.normal.needsUpdate = !0
  46052. }
  46053. },
  46054. merge: function(e, t) {
  46055. if (e instanceof n.BufferGeometry == !1)
  46056. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  46057. void 0 === t && (t = 0);
  46058. var i = this.attributes;
  46059. for (var r in i)
  46060. if (void 0 !== e.attributes[r])
  46061. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  46062. u++)
  46063. a[u] = l[h];
  46064. return this
  46065. },
  46066. normalizeNormals: function() {
  46067. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  46068. e = r[o],
  46069. t = r[o + 1],
  46070. i = r[o + 2],
  46071. n = 1 / Math.sqrt(e * e + t * t + i * i),
  46072. r[o] *= n,
  46073. r[o + 1] *= n,
  46074. r[o + 2] *= n
  46075. },
  46076. toNonIndexed: function() {
  46077. if (null === this.index)
  46078. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  46079. this;
  46080. var e = new n.BufferGeometry
  46081. , t = this.index.array
  46082. , i = this.attributes;
  46083. for (var r in i) {
  46084. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  46085. c = t[u] * s;
  46086. for (var p = 0; p < s; p++)
  46087. l[h++] = a[c++]
  46088. }
  46089. e.addAttribute(r, new n.BufferAttribute(l,s))
  46090. }
  46091. return e
  46092. },
  46093. toJSON: function() {
  46094. var e = {
  46095. metadata: {
  46096. version: 4.4,
  46097. type: "BufferGeometry",
  46098. generator: "BufferGeometry.toJSON"
  46099. }
  46100. };
  46101. if (e.uuid = this.uuid,
  46102. e.type = this.type,
  46103. "" !== this.name && (e.name = this.name),
  46104. void 0 !== this.parameters) {
  46105. var t = this.parameters;
  46106. for (var i in t)
  46107. void 0 !== t[i] && (e[i] = t[i]);
  46108. return e
  46109. }
  46110. e.data = {
  46111. attributes: {}
  46112. };
  46113. var n = this.index;
  46114. if (null !== n) {
  46115. var r = Array.prototype.slice.call(n.array);
  46116. e.data.index = {
  46117. type: n.array.constructor.name,
  46118. array: r
  46119. }
  46120. }
  46121. var o = this.attributes;
  46122. for (var i in o) {
  46123. var a = o[i]
  46124. , r = Array.prototype.slice.call(a.array);
  46125. e.data.attributes[i] = {
  46126. itemSize: a.itemSize,
  46127. type: a.array.constructor.name,
  46128. array: r
  46129. }
  46130. }
  46131. var s = this.groups;
  46132. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  46133. var l = this.boundingSphere;
  46134. return null !== l && (e.data.boundingSphere = {
  46135. center: l.center.toArray(),
  46136. radius: l.radius
  46137. }),
  46138. e
  46139. },
  46140. clone: function() {
  46141. return (new n.BufferGeometry).copy(this)
  46142. },
  46143. copy: function(e) {
  46144. var t = e.index;
  46145. null !== t && this.setIndex(t.clone());
  46146. var i = e.attributes;
  46147. for (var n in i) {
  46148. var r = i[n];
  46149. this.addAttribute(n, r.clone())
  46150. }
  46151. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  46152. var l = o[a];
  46153. this.addGroup(l.start, l.count)
  46154. }
  46155. return this
  46156. },
  46157. dispose: function() {
  46158. this.dispatchEvent({
  46159. type: "dispose"
  46160. })
  46161. }
  46162. },
  46163. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  46164. n.BufferGeometry.MaxIndex = 65535,
  46165. n.InstancedBufferGeometry = function() {
  46166. n.BufferGeometry.call(this),
  46167. this.type = "InstancedBufferGeometry",
  46168. this.maxInstancedCount = void 0
  46169. }
  46170. ,
  46171. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  46172. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  46173. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  46174. this.groups.push({
  46175. start: e,
  46176. count: t,
  46177. instances: i
  46178. })
  46179. }
  46180. ,
  46181. n.InstancedBufferGeometry.prototype.copy = function(e) {
  46182. var t = e.index;
  46183. null !== t && this.setIndex(t.clone());
  46184. var i = e.attributes;
  46185. for (var n in i) {
  46186. var r = i[n];
  46187. this.addAttribute(n, r.clone())
  46188. }
  46189. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  46190. var l = o[a];
  46191. this.addGroup(l.start, l.count, l.instances)
  46192. }
  46193. return this
  46194. }
  46195. ,
  46196. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  46197. n.Uniform = function(e, t) {
  46198. this.type = e,
  46199. this.value = t,
  46200. this.dynamic = !1
  46201. }
  46202. ,
  46203. n.Uniform.prototype = {
  46204. constructor: n.Uniform,
  46205. onUpdate: function(e) {
  46206. return this.dynamic = !0,
  46207. this.onUpdateCallback = e,
  46208. this
  46209. }
  46210. },
  46211. n.AnimationClip = function(e, t, i) {
  46212. this.name = e || n.Math.generateUUID(),
  46213. this.tracks = i,
  46214. this.duration = void 0 !== t ? t : -1,
  46215. this.duration < 0 && this.resetDuration(),
  46216. this.trim(),
  46217. this.optimize()
  46218. }
  46219. ,
  46220. n.AnimationClip.prototype = {
  46221. constructor: n.AnimationClip,
  46222. resetDuration: function() {
  46223. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  46224. var r = this.tracks[i];
  46225. t = Math.max(t, r.times[r.times.length - 1])
  46226. }
  46227. this.duration = t
  46228. },
  46229. trim: function() {
  46230. for (var e = 0; e < this.tracks.length; e++)
  46231. this.tracks[e].trim(0, this.duration);
  46232. return this
  46233. },
  46234. optimize: function() {
  46235. for (var e = 0; e < this.tracks.length; e++)
  46236. this.tracks[e].optimize();
  46237. return this
  46238. }
  46239. },
  46240. Object.assign(n.AnimationClip, {
  46241. parse: function(e) {
  46242. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  46243. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  46244. return new n.AnimationClip(e.name,e.duration,t)
  46245. },
  46246. toJSON: function(e) {
  46247. for (var t = [], i = e.tracks, r = {
  46248. name: e.name,
  46249. duration: e.duration,
  46250. tracks: t
  46251. }, o = 0, a = i.length; o !== a; ++o)
  46252. t.push(n.KeyframeTrack.toJSON(i[o]));
  46253. return r
  46254. },
  46255. CreateFromMorphTargetSequence: function(e, t, i) {
  46256. for (var r = t.length, o = [], a = 0; a < r; a++) {
  46257. var s = []
  46258. , l = [];
  46259. s.push((a + r - 1) % r, a, (a + 1) % r),
  46260. l.push(0, 1, 0);
  46261. var c = n.AnimationUtils.getKeyframeOrder(s);
  46262. s = n.AnimationUtils.sortedArray(s, 1, c),
  46263. l = n.AnimationUtils.sortedArray(l, 1, c),
  46264. 0 === s[0] && (s.push(r),
  46265. l.push(l[0])),
  46266. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  46267. }
  46268. return new n.AnimationClip(e,-1,o)
  46269. },
  46270. findByName: function(e, t) {
  46271. for (var i = 0; i < e.length; i++)
  46272. if (e[i].name === t)
  46273. return e[i];
  46274. return null
  46275. },
  46276. CreateClipsFromMorphTargetSequences: function(e, t) {
  46277. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  46278. var s = e[o]
  46279. , l = s.name.match(r);
  46280. if (l && l.length > 1) {
  46281. var c = l[1]
  46282. , h = i[c];
  46283. h || (i[c] = h = []),
  46284. h.push(s)
  46285. }
  46286. }
  46287. var u = [];
  46288. for (var c in i)
  46289. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  46290. return u
  46291. },
  46292. parseAnimation: function(e, t, i) {
  46293. if (!e)
  46294. return console.error(" no animation in JSONLoader data"),
  46295. null;
  46296. for (var r = function(e, t, i, r, o) {
  46297. if (0 !== i.length) {
  46298. var a = []
  46299. , s = [];
  46300. n.AnimationUtils.flattenJSON(i, a, s, r),
  46301. 0 !== a.length && o.push(new e(t,a,s))
  46302. }
  46303. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  46304. var u = c[h].keys;
  46305. if (u && 0 != u.length)
  46306. if (u[0].morphTargets) {
  46307. for (var d = {}, p = 0; p < u.length; p++)
  46308. if (u[p].morphTargets)
  46309. for (var f = 0; f < u[p].morphTargets.length; f++)
  46310. d[u[p].morphTargets[f]] = -1;
  46311. for (var g in d) {
  46312. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  46313. var A = u[p];
  46314. m.push(A.time),
  46315. v.push(A.morphTarget === g ? 1 : 0)
  46316. }
  46317. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  46318. }
  46319. s = d.length * (l || 1)
  46320. } else {
  46321. var y = ".bones[" + t[h].name + "]";
  46322. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  46323. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  46324. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  46325. }
  46326. }
  46327. if (0 === o.length)
  46328. return null;
  46329. var C = new n.AnimationClip(a,s,o);
  46330. return C
  46331. }
  46332. }),
  46333. n.AnimationMixer = function(e) {
  46334. this._root = e,
  46335. this._initMemoryManager(),
  46336. this._accuIndex = 0,
  46337. this.time = 0,
  46338. this.timeScale = 1
  46339. }
  46340. ,
  46341. n.AnimationMixer.prototype = {
  46342. constructor: n.AnimationMixer,
  46343. clipAction: function(e, t) {
  46344. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  46345. if (void 0 !== l) {
  46346. var c = l.actionByRoot[o];
  46347. if (void 0 !== c)
  46348. return c;
  46349. if (i = l.knownActions[0],
  46350. s = i._clip,
  46351. e !== a && e !== s)
  46352. throw new Error("Different clips with the same name detected!")
  46353. }
  46354. if (null === s)
  46355. return null;
  46356. var h = new n.AnimationMixer._Action(this,s,t);
  46357. return this._bindAction(h, i),
  46358. this._addInactiveAction(h, a, o),
  46359. h
  46360. },
  46361. existingAction: function(e, t) {
  46362. var i = t || this._root
  46363. , n = i.uuid
  46364. , r = "string" == typeof e ? e : e.name
  46365. , o = this._actionsByClip[r];
  46366. return void 0 !== o ? o.actionByRoot[n] || null : null
  46367. },
  46368. stopAllAction: function() {
  46369. var e = this._actions
  46370. , t = this._nActiveActions
  46371. , i = this._bindings
  46372. , n = this._nActiveBindings;
  46373. this._nActiveActions = 0,
  46374. this._nActiveBindings = 0;
  46375. for (var r = 0; r !== t; ++r)
  46376. e[r].reset();
  46377. for (var r = 0; r !== n; ++r)
  46378. i[r].useCount = 0;
  46379. return this
  46380. },
  46381. update: function(e) {
  46382. e *= this.timeScale;
  46383. for (var t = this._actions, i = this._nActiveActions, n = this.time += e, r = Math.sign(e), o = this._accuIndex ^= 1, a = 0; a !== i; ++a) {
  46384. var s = t[a];
  46385. s.enabled && s._update(n, e, r, o)
  46386. }
  46387. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  46388. l[a].apply(o);
  46389. return this
  46390. },
  46391. getRoot: function() {
  46392. return this._root
  46393. },
  46394. uncacheClip: function(e) {
  46395. var t = this._actions
  46396. , i = e.name
  46397. , n = this._actionsByClip
  46398. , r = n[i];
  46399. if (void 0 !== r) {
  46400. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  46401. var l = o[a];
  46402. this._deactivateAction(l);
  46403. var c = l._cacheIndex
  46404. , h = t[t.length - 1];
  46405. l._cacheIndex = null,
  46406. l._byClipCacheIndex = null,
  46407. h._cacheIndex = c,
  46408. t[c] = h,
  46409. t.pop(),
  46410. this._removeInactiveBindingsForAction(l)
  46411. }
  46412. delete n[i]
  46413. }
  46414. },
  46415. uncacheRoot: function(e) {
  46416. var t = e.uuid
  46417. , i = this._actionsByClip;
  46418. for (var n in i) {
  46419. var r = i[n].actionByRoot
  46420. , o = r[t];
  46421. void 0 !== o && (this._deactivateAction(o),
  46422. this._removeInactiveAction(o))
  46423. }
  46424. var a = this._bindingsByRootAndName
  46425. , s = a[t];
  46426. if (void 0 !== s)
  46427. for (var l in s) {
  46428. var c = s[l];
  46429. c.restoreOriginalState(),
  46430. this._removeInactiveBinding(c)
  46431. }
  46432. },
  46433. uncacheAction: function(e, t) {
  46434. var i = this.existingAction(e, t);
  46435. null !== i && (this._deactivateAction(i),
  46436. this._removeInactiveAction(i))
  46437. }
  46438. },
  46439. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  46440. n.AnimationMixer._Action = function(e, t, i) {
  46441. this._mixer = e,
  46442. this._clip = t,
  46443. this._localRoot = i || null;
  46444. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  46445. endingStart: n.ZeroCurvatureEnding,
  46446. endingEnd: n.ZeroCurvatureEnding
  46447. }, l = 0; l !== o; ++l) {
  46448. var c = r[l].createInterpolant(null);
  46449. a[l] = c,
  46450. c.settings = s
  46451. }
  46452. this._interpolantSettings = s,
  46453. this._interpolants = a,
  46454. this._propertyBindings = new Array(o),
  46455. this._cacheIndex = null,
  46456. this._byClipCacheIndex = null,
  46457. this._timeScaleInterpolant = null,
  46458. this._weightInterpolant = null,
  46459. this.loop = n.LoopRepeat,
  46460. this._loopCount = -1,
  46461. this._startTime = null,
  46462. this.time = 0,
  46463. this.timeScale = 1,
  46464. this._effectiveTimeScale = 1,
  46465. this.weight = 1,
  46466. this._effectiveWeight = 1,
  46467. this.repetitions = 1 / 0,
  46468. this.paused = !1,
  46469. this.enabled = !0,
  46470. this.clampWhenFinished = !1,
  46471. this.zeroSlopeAtStart = !0,
  46472. this.zeroSlopeAtEnd = !0
  46473. }
  46474. ,
  46475. n.AnimationMixer._Action.prototype = {
  46476. constructor: n.AnimationMixer._Action,
  46477. play: function() {
  46478. return this._mixer._activateAction(this),
  46479. this
  46480. },
  46481. stop: function() {
  46482. return this._mixer._deactivateAction(this),
  46483. this.reset()
  46484. },
  46485. reset: function() {
  46486. return this.paused = !1,
  46487. this.enabled = !0,
  46488. this.time = 0,
  46489. this._loopCount = -1,
  46490. this._startTime = null,
  46491. this.stopFading().stopWarping()
  46492. },
  46493. isRunning: function() {
  46494. this._startTime;
  46495. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  46496. },
  46497. isScheduled: function() {
  46498. return this._mixer._isActiveAction(this)
  46499. },
  46500. startAt: function(e) {
  46501. return this._startTime = e,
  46502. this
  46503. },
  46504. setLoop: function(e, t) {
  46505. return this.loop = e,
  46506. this.repetitions = t,
  46507. this
  46508. },
  46509. setEffectiveWeight: function(e) {
  46510. return this.weight = e,
  46511. this._effectiveWeight = this.enabled ? e : 0,
  46512. this.stopFading()
  46513. },
  46514. getEffectiveWeight: function() {
  46515. return this._effectiveWeight
  46516. },
  46517. fadeIn: function(e) {
  46518. return this._scheduleFading(e, 0, 1)
  46519. },
  46520. fadeOut: function(e) {
  46521. return this._scheduleFading(e, 1, 0)
  46522. },
  46523. crossFadeFrom: function(e, t, i) {
  46524. this._mixer;
  46525. if (e.fadeOut(t),
  46526. this.fadeIn(t),
  46527. i) {
  46528. var n = this._clip.duration
  46529. , r = e._clip.duration
  46530. , o = r / n
  46531. , a = n / r;
  46532. e.warp(1, o, t),
  46533. this.warp(a, 1, t)
  46534. }
  46535. return this
  46536. },
  46537. crossFadeTo: function(e, t, i) {
  46538. return e.crossFadeFrom(this, t, i)
  46539. },
  46540. stopFading: function() {
  46541. var e = this._weightInterpolant;
  46542. return null !== e && (this._weightInterpolant = null,
  46543. this._mixer._takeBackControlInterpolant(e)),
  46544. this
  46545. },
  46546. setEffectiveTimeScale: function(e) {
  46547. return this.timeScale = e,
  46548. this._effectiveTimeScale = this.paused ? 0 : e,
  46549. this.stopWarping()
  46550. },
  46551. getEffectiveTimeScale: function() {
  46552. return this._effectiveTimeScale
  46553. },
  46554. setDuration: function(e) {
  46555. return this.timeScale = this._clip.duration / e,
  46556. this.stopWarping()
  46557. },
  46558. syncWith: function(e) {
  46559. return this.time = e.time,
  46560. this.timeScale = e.timeScale,
  46561. this.stopWarping()
  46562. },
  46563. halt: function(e) {
  46564. return this.warp(this._currentTimeScale, 0, e)
  46565. },
  46566. warp: function(e, t, i) {
  46567. var n = this._mixer
  46568. , r = n.time
  46569. , o = this._timeScaleInterpolant
  46570. , a = this.timeScale;
  46571. null === o && (o = n._lendControlInterpolant(),
  46572. this._timeScaleInterpolant = o);
  46573. var s = o.parameterPositions
  46574. , l = o.sampleValues;
  46575. return s[0] = r,
  46576. s[1] = r + i,
  46577. l[0] = e / a,
  46578. l[1] = t / a,
  46579. this
  46580. },
  46581. stopWarping: function() {
  46582. var e = this._timeScaleInterpolant;
  46583. return null !== e && (this._timeScaleInterpolant = null,
  46584. this._mixer._takeBackControlInterpolant(e)),
  46585. this
  46586. },
  46587. getMixer: function() {
  46588. return this._mixer
  46589. },
  46590. getClip: function() {
  46591. return this._clip
  46592. },
  46593. getRoot: function() {
  46594. return this._localRoot || this._mixer._root
  46595. },
  46596. _update: function(e, t, i, n) {
  46597. var r = this._startTime;
  46598. if (null !== r) {
  46599. var o = (e - r) * i;
  46600. if (o < 0 || 0 === i)
  46601. return;
  46602. this._startTime = null,
  46603. t = i * o
  46604. }
  46605. t *= this._updateTimeScale(e);
  46606. var a = this._updateTime(t)
  46607. , s = this._updateWeight(e);
  46608. if (s > 0)
  46609. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  46610. l[h].evaluate(a),
  46611. c[h].accumulate(n, s)
  46612. },
  46613. _updateWeight: function(e) {
  46614. var t = 0;
  46615. if (this.enabled) {
  46616. t = this.weight;
  46617. var i = this._weightInterpolant;
  46618. if (null !== i) {
  46619. var n = i.evaluate(e)[0];
  46620. t *= n,
  46621. e > i.parameterPositions[1] && (this.stopFading(),
  46622. 0 === n && (this.enabled = !1))
  46623. }
  46624. }
  46625. return this._effectiveWeight = t,
  46626. t
  46627. },
  46628. _updateTimeScale: function(e) {
  46629. var t = 0;
  46630. if (!this.paused) {
  46631. t = this.timeScale;
  46632. var i = this._timeScaleInterpolant;
  46633. if (null !== i) {
  46634. var n = i.evaluate(e)[0];
  46635. t *= n,
  46636. e > i.parameterPositions[1] && (this.stopWarping(),
  46637. 0 === t ? this.pause = !0 : this.timeScale = t)
  46638. }
  46639. }
  46640. return this._effectiveTimeScale = t,
  46641. t
  46642. },
  46643. _updateTime: function(e) {
  46644. var t = this.time + e;
  46645. if (0 === e)
  46646. return t;
  46647. var i = this._clip.duration
  46648. , r = this.loop
  46649. , o = this._loopCount
  46650. , a = !1;
  46651. switch (r) {
  46652. case n.LoopOnce:
  46653. if (o === -1 && (this.loopCount = 0,
  46654. this._setEndings(!0, !0, !1)),
  46655. t >= i)
  46656. t = i;
  46657. else {
  46658. if (!(t < 0))
  46659. break;
  46660. t = 0
  46661. }
  46662. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46663. this._mixer.dispatchEvent({
  46664. type: "finished",
  46665. action: this,
  46666. direction: e < 0 ? -1 : 1
  46667. });
  46668. break;
  46669. case n.LoopPingPong:
  46670. a = !0;
  46671. case n.LoopRepeat:
  46672. if (o === -1 && (e > 0 ? (o = 0,
  46673. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46674. t >= i || t < 0) {
  46675. var s = Math.floor(t / i);
  46676. t -= i * s,
  46677. o += Math.abs(s);
  46678. var l = this.repetitions - o;
  46679. if (l < 0) {
  46680. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46681. t = e > 0 ? i : 0,
  46682. this._mixer.dispatchEvent({
  46683. type: "finished",
  46684. action: this,
  46685. direction: e > 0 ? 1 : -1
  46686. });
  46687. break
  46688. }
  46689. if (0 === l) {
  46690. var c = e < 0;
  46691. this._setEndings(c, !c, a)
  46692. } else
  46693. this._setEndings(!1, !1, a);
  46694. this._loopCount = o,
  46695. this._mixer.dispatchEvent({
  46696. type: "loop",
  46697. action: this,
  46698. loopDelta: s
  46699. })
  46700. }
  46701. if (r === n.LoopPingPong && 1 === (1 & o))
  46702. return this.time = t,
  46703. i - t
  46704. }
  46705. return this.time = t,
  46706. t
  46707. },
  46708. _setEndings: function(e, t, i) {
  46709. var r = this._interpolantSettings;
  46710. i ? (r.endingStart = n.ZeroSlopeEnding,
  46711. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46712. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46713. },
  46714. _scheduleFading: function(e, t, i) {
  46715. var n = this._mixer
  46716. , r = n.time
  46717. , o = this._weightInterpolant;
  46718. null === o && (o = n._lendControlInterpolant(),
  46719. this._weightInterpolant = o);
  46720. var a = o.parameterPositions
  46721. , s = o.sampleValues;
  46722. return a[0] = r,
  46723. s[0] = t,
  46724. a[1] = r + e,
  46725. s[1] = i,
  46726. this
  46727. }
  46728. },
  46729. Object.assign(n.AnimationMixer.prototype, {
  46730. _bindAction: function(e, t) {
  46731. var i = e._localRoot || this._root
  46732. , r = e._clip.tracks
  46733. , o = r.length
  46734. , a = e._propertyBindings
  46735. , s = e._interpolants
  46736. , l = i.uuid
  46737. , c = this._bindingsByRootAndName
  46738. , h = c[l];
  46739. void 0 === h && (h = {},
  46740. c[l] = h);
  46741. for (var u = 0; u !== o; ++u) {
  46742. var d = r[u]
  46743. , p = d.name
  46744. , f = h[p];
  46745. if (void 0 !== f)
  46746. a[u] = f;
  46747. else {
  46748. if (f = a[u],
  46749. void 0 !== f) {
  46750. null === f._cacheIndex && (++f.referenceCount,
  46751. this._addInactiveBinding(f, l, p));
  46752. continue
  46753. }
  46754. var g = t && t._propertyBindings[u].binding.parsedPath;
  46755. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46756. ++f.referenceCount,
  46757. this._addInactiveBinding(f, l, p),
  46758. a[u] = f
  46759. }
  46760. s[u].resultBuffer = f.buffer
  46761. }
  46762. },
  46763. _activateAction: function(e) {
  46764. if (!this._isActiveAction(e)) {
  46765. if (null === e._cacheIndex) {
  46766. var t = (e._localRoot || this._root).uuid
  46767. , i = e._clip.name
  46768. , n = this._actionsByClip[i];
  46769. this._bindAction(e, n && n.knownActions[0]),
  46770. this._addInactiveAction(e, i, t)
  46771. }
  46772. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46773. var s = r[o];
  46774. 0 === s.useCount++ && (this._lendBinding(s),
  46775. s.saveOriginalState())
  46776. }
  46777. this._lendAction(e)
  46778. }
  46779. },
  46780. _deactivateAction: function(e) {
  46781. if (this._isActiveAction(e)) {
  46782. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46783. var r = t[i];
  46784. 0 === --r.useCount && (r.restoreOriginalState(),
  46785. this._takeBackBinding(r))
  46786. }
  46787. this._takeBackAction(e)
  46788. }
  46789. },
  46790. _initMemoryManager: function() {
  46791. this._actions = [],
  46792. this._nActiveActions = 0,
  46793. this._actionsByClip = {},
  46794. this._bindings = [],
  46795. this._nActiveBindings = 0,
  46796. this._bindingsByRootAndName = {},
  46797. this._controlInterpolants = [],
  46798. this._nActiveControlInterpolants = 0;
  46799. var e = this;
  46800. this.stats = {
  46801. actions: {
  46802. get total() {
  46803. return e._actions.length
  46804. },
  46805. get inUse() {
  46806. return e._nActiveActions
  46807. }
  46808. },
  46809. bindings: {
  46810. get total() {
  46811. return e._bindings.length
  46812. },
  46813. get inUse() {
  46814. return e._nActiveBindings
  46815. }
  46816. },
  46817. controlInterpolants: {
  46818. get total() {
  46819. return e._controlInterpolants.length
  46820. },
  46821. get inUse() {
  46822. return e._nActiveControlInterpolants
  46823. }
  46824. }
  46825. }
  46826. },
  46827. _isActiveAction: function(e) {
  46828. var t = e._cacheIndex;
  46829. return null !== t && t < this._nActiveActions
  46830. },
  46831. _addInactiveAction: function(e, t, i) {
  46832. var n = this._actions
  46833. , r = this._actionsByClip
  46834. , o = r[t];
  46835. if (void 0 === o)
  46836. o = {
  46837. knownActions: [e],
  46838. actionByRoot: {}
  46839. },
  46840. e._byClipCacheIndex = 0,
  46841. r[t] = o;
  46842. else {
  46843. var a = o.knownActions;
  46844. e._byClipCacheIndex = a.length,
  46845. a.push(e)
  46846. }
  46847. e._cacheIndex = n.length,
  46848. n.push(e),
  46849. o.actionByRoot[i] = e
  46850. },
  46851. _removeInactiveAction: function(e) {
  46852. var t = this._actions
  46853. , i = t[t.length - 1]
  46854. , n = e._cacheIndex;
  46855. i._cacheIndex = n,
  46856. t[n] = i,
  46857. t.pop(),
  46858. e._cacheIndex = null;
  46859. var r = e._clip.name
  46860. , o = this._actionsByClip
  46861. , a = o[r]
  46862. , s = a.knownActions
  46863. , l = s[s.length - 1]
  46864. , c = e._byClipCacheIndex;
  46865. l._byClipCacheIndex = c,
  46866. s[c] = l,
  46867. s.pop(),
  46868. e._byClipCacheIndex = null;
  46869. var h = a.actionByRoot
  46870. , u = (t._localRoot || this._root).uuid;
  46871. delete h[u],
  46872. 0 === s.length && delete o[r],
  46873. this._removeInactiveBindingsForAction(e)
  46874. },
  46875. _removeInactiveBindingsForAction: function(e) {
  46876. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46877. var r = t[i];
  46878. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46879. }
  46880. },
  46881. _lendAction: function(e) {
  46882. var t = this._actions
  46883. , i = e._cacheIndex
  46884. , n = this._nActiveActions++
  46885. , r = t[n];
  46886. e._cacheIndex = n,
  46887. t[n] = e,
  46888. r._cacheIndex = i,
  46889. t[i] = r
  46890. },
  46891. _takeBackAction: function(e) {
  46892. var t = this._actions
  46893. , i = e._cacheIndex
  46894. , n = --this._nActiveActions
  46895. , r = t[n];
  46896. e._cacheIndex = n,
  46897. t[n] = e,
  46898. r._cacheIndex = i,
  46899. t[i] = r
  46900. },
  46901. _addInactiveBinding: function(e, t, i) {
  46902. var n = this._bindingsByRootAndName
  46903. , r = n[t]
  46904. , o = this._bindings;
  46905. void 0 === r && (r = {},
  46906. n[t] = r),
  46907. r[i] = e,
  46908. e._cacheIndex = o.length,
  46909. o.push(e)
  46910. },
  46911. _removeInactiveBinding: function(e) {
  46912. var t = this._bindings
  46913. , i = e.binding
  46914. , n = i.rootNode.uuid
  46915. , r = i.path
  46916. , o = this._bindingsByRootAndName
  46917. , a = o[n]
  46918. , s = t[t.length - 1]
  46919. , l = e._cacheIndex;
  46920. s._cacheIndex = l,
  46921. t[l] = s,
  46922. t.pop(),
  46923. delete a[r];
  46924. e: {
  46925. for (var c in a)
  46926. break e;
  46927. delete o[n]
  46928. }
  46929. },
  46930. _lendBinding: function(e) {
  46931. var t = this._bindings
  46932. , i = e._cacheIndex
  46933. , n = this._nActiveBindings++
  46934. , r = t[n];
  46935. e._cacheIndex = n,
  46936. t[n] = e,
  46937. r._cacheIndex = i,
  46938. t[i] = r
  46939. },
  46940. _takeBackBinding: function(e) {
  46941. var t = this._bindings
  46942. , i = e._cacheIndex
  46943. , n = --this._nActiveBindings
  46944. , r = t[n];
  46945. e._cacheIndex = n,
  46946. t[n] = e,
  46947. r._cacheIndex = i,
  46948. t[i] = r
  46949. },
  46950. _lendControlInterpolant: function() {
  46951. var e = this._controlInterpolants
  46952. , t = this._nActiveControlInterpolants++
  46953. , i = e[t];
  46954. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46955. i.__cacheIndex = t,
  46956. e[t] = i),
  46957. i
  46958. },
  46959. _takeBackControlInterpolant: function(e) {
  46960. var t = this._controlInterpolants
  46961. , i = e.__cacheIndex
  46962. , n = --this._nActiveControlInterpolants
  46963. , r = t[n];
  46964. e.__cacheIndex = n,
  46965. t[n] = e,
  46966. r.__cacheIndex = i,
  46967. t[i] = r
  46968. },
  46969. _controlInterpolantsResultBuffer: new Float32Array(1)
  46970. }),
  46971. n.AnimationObjectGroup = function(e) {
  46972. this.uuid = n.Math.generateUUID(),
  46973. this._objects = Array.prototype.slice.call(arguments),
  46974. this.nCachedObjects_ = 0;
  46975. var t = {};
  46976. this._indicesByUUID = t;
  46977. for (var i = 0, r = arguments.length; i !== r; ++i)
  46978. t[arguments[i].uuid] = i;
  46979. this._paths = [],
  46980. this._parsedPaths = [],
  46981. this._bindings = [],
  46982. this._bindingsIndicesByPath = {};
  46983. var o = this;
  46984. this.stats = {
  46985. objects: {
  46986. get total() {
  46987. return o._objects.length
  46988. },
  46989. get inUse() {
  46990. return this.total - o.nCachedObjects_
  46991. }
  46992. },
  46993. get bindingsPerObject() {
  46994. return o._bindings.length
  46995. }
  46996. }
  46997. }
  46998. ,
  46999. n.AnimationObjectGroup.prototype = {
  47000. constructor: n.AnimationObjectGroup,
  47001. add: function(e) {
  47002. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  47003. var d = arguments[h]
  47004. , p = d.uuid
  47005. , f = o[p];
  47006. if (void 0 === f) {
  47007. f = i++,
  47008. o[p] = f,
  47009. t.push(d);
  47010. for (var g = 0, m = c; g !== m; ++g)
  47011. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  47012. } else if (f < r) {
  47013. var v = t[f]
  47014. , A = --r
  47015. , y = t[A];
  47016. o[y.uuid] = f,
  47017. t[f] = y,
  47018. o[p] = A,
  47019. t[A] = d;
  47020. for (var g = 0, m = c; g !== m; ++g) {
  47021. var C = l[g]
  47022. , I = C[A]
  47023. , E = C[f];
  47024. C[f] = I,
  47025. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  47026. C[A] = E
  47027. }
  47028. } else
  47029. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  47030. }
  47031. this.nCachedObjects_ = r
  47032. },
  47033. remove: function(e) {
  47034. for (var t = this._objects, i = (t.length,
  47035. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  47036. var l = arguments[a]
  47037. , c = l.uuid
  47038. , h = n[c];
  47039. if (void 0 !== h && h >= i) {
  47040. var u = i++
  47041. , d = t[u];
  47042. n[d.uuid] = h,
  47043. t[h] = d,
  47044. n[c] = u,
  47045. t[u] = l;
  47046. for (var p = 0, f = o; p !== f; ++p) {
  47047. var g = r[p]
  47048. , m = g[u]
  47049. , v = g[h];
  47050. g[h] = m,
  47051. g[u] = v
  47052. }
  47053. }
  47054. }
  47055. this.nCachedObjects_ = i
  47056. },
  47057. uncache: function(e) {
  47058. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._bindings, a = o.length, s = 0, l = arguments.length; s !== l; ++s) {
  47059. var c = arguments[s]
  47060. , h = c.uuid
  47061. , u = r[h];
  47062. if (void 0 !== u)
  47063. if (delete r[h],
  47064. u < n) {
  47065. var d = --n
  47066. , p = t[d]
  47067. , f = --i
  47068. , g = t[f];
  47069. r[p.uuid] = u,
  47070. t[u] = p,
  47071. r[g.uuid] = d,
  47072. t[d] = g,
  47073. t.pop();
  47074. for (var m = 0, v = a; m !== v; ++m) {
  47075. var A = o[m]
  47076. , y = A[d]
  47077. , C = A[f];
  47078. A[u] = y,
  47079. A[d] = C,
  47080. A.pop()
  47081. }
  47082. } else {
  47083. var f = --i
  47084. , g = t[f];
  47085. r[g.uuid] = u,
  47086. t[u] = g,
  47087. t.pop();
  47088. for (var m = 0, v = a; m !== v; ++m) {
  47089. var A = o[m];
  47090. A[u] = A[f],
  47091. A.pop()
  47092. }
  47093. }
  47094. }
  47095. this.nCachedObjects_ = n
  47096. },
  47097. subscribe_: function(e, t) {
  47098. var i = this._bindingsIndicesByPath
  47099. , r = i[e]
  47100. , o = this._bindings;
  47101. if (void 0 !== r)
  47102. return o[r];
  47103. var a = this._paths
  47104. , s = this._parsedPaths
  47105. , l = this._objects
  47106. , c = l.length
  47107. , h = this.nCachedObjects_
  47108. , u = new Array(c);
  47109. r = o.length,
  47110. i[e] = r,
  47111. a.push(e),
  47112. s.push(t),
  47113. o.push(u);
  47114. for (var d = h, p = l.length; d !== p; ++d) {
  47115. var f = l[d];
  47116. u[d] = new n.PropertyBinding(f,e,t)
  47117. }
  47118. return u
  47119. },
  47120. unsubscribe_: function(e) {
  47121. var t = this._bindingsIndicesByPath
  47122. , i = t[e];
  47123. if (void 0 !== i) {
  47124. var n = this._paths
  47125. , r = this._parsedPaths
  47126. , o = this._bindings
  47127. , a = o.length - 1
  47128. , s = o[a]
  47129. , l = e[a];
  47130. t[l] = i,
  47131. o[i] = s,
  47132. o.pop(),
  47133. r[i] = r[a],
  47134. r.pop(),
  47135. n[i] = n[a],
  47136. n.pop()
  47137. }
  47138. }
  47139. },
  47140. n.AnimationUtils = {
  47141. arraySlice: function(e, t, i) {
  47142. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  47143. },
  47144. convertArray: function(e, t, i) {
  47145. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  47146. },
  47147. isTypedArray: function(e) {
  47148. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  47149. },
  47150. getKeyframeOrder: function(e) {
  47151. function t(t, i) {
  47152. return e[t] - e[i]
  47153. }
  47154. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  47155. n[r] = r;
  47156. return n.sort(t),
  47157. n
  47158. },
  47159. sortedArray: function(e, t, i) {
  47160. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  47161. for (var s = i[o] * t, l = 0; l !== t; ++l)
  47162. r[a++] = e[s + l];
  47163. return r
  47164. },
  47165. flattenJSON: function(e, t, i, n) {
  47166. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  47167. o = e[r++];
  47168. if (void 0 !== o) {
  47169. var a = o[n];
  47170. if (void 0 !== a)
  47171. if (Array.isArray(a)) {
  47172. do
  47173. a = o[n],
  47174. void 0 !== a && (t.push(o.time),
  47175. i.push.apply(i, a)),
  47176. o = e[r++];
  47177. while (void 0 !== o)
  47178. } else if (void 0 !== a.toArray) {
  47179. do
  47180. a = o[n],
  47181. void 0 !== a && (t.push(o.time),
  47182. a.toArray(i, i.length)),
  47183. o = e[r++];
  47184. while (void 0 !== o)
  47185. } else
  47186. do
  47187. a = o[n],
  47188. void 0 !== a && (t.push(o.time),
  47189. i.push(a)),
  47190. o = e[r++];
  47191. while (void 0 !== o)
  47192. }
  47193. }
  47194. },
  47195. n.KeyframeTrack = function(e, t, i, r) {
  47196. if (void 0 === e)
  47197. throw new Error("track name is undefined");
  47198. if (void 0 === t || 0 === t.length)
  47199. throw new Error("no keyframes in track named " + e);
  47200. this.name = e,
  47201. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  47202. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  47203. this.setInterpolation(r || this.DefaultInterpolation),
  47204. this.validate(),
  47205. this.optimize()
  47206. }
  47207. ,
  47208. n.KeyframeTrack.prototype = {
  47209. constructor: n.KeyframeTrack,
  47210. TimeBufferType: Float32Array,
  47211. ValueBufferType: Float32Array,
  47212. DefaultInterpolation: n.InterpolateLinear,
  47213. InterpolantFactoryMethodDiscrete: function(e) {
  47214. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  47215. },
  47216. InterpolantFactoryMethodLinear: function(e) {
  47217. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47218. },
  47219. InterpolantFactoryMethodSmooth: function(e) {
  47220. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  47221. },
  47222. setInterpolation: function(e) {
  47223. var t = void 0;
  47224. switch (e) {
  47225. case n.InterpolateDiscrete:
  47226. t = this.InterpolantFactoryMethodDiscrete;
  47227. break;
  47228. case n.InterpolateLinear:
  47229. t = this.InterpolantFactoryMethodLinear;
  47230. break;
  47231. case n.InterpolateSmooth:
  47232. t = this.InterpolantFactoryMethodSmooth
  47233. }
  47234. if (void 0 === t) {
  47235. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  47236. if (void 0 === this.createInterpolant) {
  47237. if (e === this.DefaultInterpolation)
  47238. throw new Error(i);
  47239. this.setInterpolation(this.DefaultInterpolation)
  47240. }
  47241. return void console.warn(i)
  47242. }
  47243. this.createInterpolant = t
  47244. },
  47245. getInterpolation: function() {
  47246. switch (this.createInterpolant) {
  47247. case this.InterpolantFactoryMethodDiscrete:
  47248. return n.InterpolateDiscrete;
  47249. case this.InterpolantFactoryMethodLinear:
  47250. return n.InterpolateLinear;
  47251. case this.InterpolantFactoryMethodSmooth:
  47252. return n.InterpolateSmooth
  47253. }
  47254. },
  47255. getValueSize: function() {
  47256. return this.values.length / this.times.length
  47257. },
  47258. shift: function(e) {
  47259. if (0 !== e)
  47260. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  47261. t[i] += e;
  47262. return this
  47263. },
  47264. scale: function(e) {
  47265. if (1 !== e)
  47266. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  47267. t[i] *= e;
  47268. return this
  47269. },
  47270. trim: function(e, t) {
  47271. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  47272. ++o;
  47273. for (; a !== -1 && i[a] > t; )
  47274. --a;
  47275. if (++a,
  47276. 0 !== o || a !== r) {
  47277. o >= a && (a = Math.max(a, 1),
  47278. o = a - 1);
  47279. var s = this.getValueSize();
  47280. this.times = n.AnimationUtils.arraySlice(i, o, a),
  47281. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  47282. }
  47283. return this
  47284. },
  47285. validate: function() {
  47286. var e = !0
  47287. , t = this.getValueSize();
  47288. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  47289. e = !1);
  47290. var i = this.times
  47291. , r = this.values
  47292. , o = i.length;
  47293. 0 === o && (console.error("track is empty", this),
  47294. e = !1);
  47295. for (var a = null, s = 0; s !== o; s++) {
  47296. var l = i[s];
  47297. if ("number" == typeof l && isNaN(l)) {
  47298. console.error("time is not a valid number", this, s, l),
  47299. e = !1;
  47300. break
  47301. }
  47302. if (null !== a && a > l) {
  47303. console.error("out of order keys", this, s, l, a),
  47304. e = !1;
  47305. break
  47306. }
  47307. a = l
  47308. }
  47309. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  47310. for (var s = 0, c = r.length; s !== c; ++s) {
  47311. var h = r[s];
  47312. if (isNaN(h)) {
  47313. console.error("value is not a valid number", this, s, h),
  47314. e = !1;
  47315. break
  47316. }
  47317. }
  47318. return e
  47319. },
  47320. optimize: function() {
  47321. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  47322. var s = !1
  47323. , l = e[o]
  47324. , c = e[o + 1];
  47325. if (l !== c && (1 !== o || l !== l[0]))
  47326. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  47327. var f = t[h + p];
  47328. if (f !== t[u + p] || f !== t[d + p]) {
  47329. s = !0;
  47330. break
  47331. }
  47332. }
  47333. if (s) {
  47334. if (o !== r) {
  47335. e[r] = e[o];
  47336. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  47337. t[m + p] = t[g + p]
  47338. }
  47339. ++r
  47340. }
  47341. }
  47342. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  47343. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  47344. this
  47345. }
  47346. },
  47347. Object.assign(n.KeyframeTrack, {
  47348. parse: function(e) {
  47349. if (void 0 === e.type)
  47350. throw new Error("track type undefined, can not parse");
  47351. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  47352. if (void 0 === e.times) {
  47353. console.warn("legacy JSON format detected, converting");
  47354. var i = []
  47355. , r = [];
  47356. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  47357. e.times = i,
  47358. e.values = r
  47359. }
  47360. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  47361. },
  47362. toJSON: function(e) {
  47363. var t, i = e.constructor;
  47364. if (void 0 !== i.toJSON)
  47365. t = i.toJSON(e);
  47366. else {
  47367. t = {
  47368. name: e.name,
  47369. times: n.AnimationUtils.convertArray(e.times, Array),
  47370. values: n.AnimationUtils.convertArray(e.values, Array)
  47371. };
  47372. var r = e.getInterpolation();
  47373. r !== e.DefaultInterpolation && (t.interpolation = r)
  47374. }
  47375. return t.type = e.ValueTypeName,
  47376. t
  47377. },
  47378. _getTrackTypeForValueTypeName: function(e) {
  47379. switch (e.toLowerCase()) {
  47380. case "scalar":
  47381. case "double":
  47382. case "float":
  47383. case "number":
  47384. case "integer":
  47385. return n.NumberKeyframeTrack;
  47386. case "vector":
  47387. case "vector2":
  47388. case "vector3":
  47389. case "vector4":
  47390. return n.VectorKeyframeTrack;
  47391. case "color":
  47392. return n.ColorKeyframeTrack;
  47393. case "quaternion":
  47394. return n.QuaternionKeyframeTrack;
  47395. case "bool":
  47396. case "boolean":
  47397. return n.BooleanKeyframeTrack;
  47398. case "string":
  47399. return n.StringKeyframeTrack
  47400. }
  47401. throw new Error("Unsupported typeName: " + e)
  47402. }
  47403. }),
  47404. n.PropertyBinding = function(e, t, i) {
  47405. this.path = t,
  47406. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  47407. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  47408. this.rootNode = e
  47409. }
  47410. ,
  47411. n.PropertyBinding.prototype = {
  47412. constructor: n.PropertyBinding,
  47413. getValue: function(e, t) {
  47414. this.bind(),
  47415. this.getValue(e, t)
  47416. },
  47417. setValue: function(e, t) {
  47418. this.bind(),
  47419. this.setValue(e, t)
  47420. },
  47421. bind: function() {
  47422. var e = this.node
  47423. , t = this.parsedPath
  47424. , i = t.objectName
  47425. , r = t.propertyName
  47426. , o = t.propertyIndex;
  47427. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  47428. this.node = e),
  47429. this.getValue = this._getValue_unavailable,
  47430. this.setValue = this._setValue_unavailable,
  47431. !e)
  47432. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  47433. if (i) {
  47434. var a = t.objectIndex;
  47435. switch (i) {
  47436. case "materials":
  47437. if (!e.material)
  47438. return void console.error(" can not bind to material as node does not have a material", this);
  47439. if (!e.material.materials)
  47440. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  47441. e = e.material.materials;
  47442. break;
  47443. case "bones":
  47444. if (!e.skeleton)
  47445. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  47446. e = e.skeleton.bones;
  47447. for (var s = 0; s < e.length; s++)
  47448. if (e[s].name === a) {
  47449. a = s;
  47450. break
  47451. }
  47452. break;
  47453. default:
  47454. if (void 0 === e[i])
  47455. return void console.error(" can not bind to objectName of node, undefined", this);
  47456. e = e[i]
  47457. }
  47458. if (void 0 !== a) {
  47459. if (void 0 === e[a])
  47460. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  47461. e = e[a]
  47462. }
  47463. }
  47464. var l = e[r];
  47465. if (!l) {
  47466. var c = t.nodeName;
  47467. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  47468. }
  47469. var h = this.Versioning.None;
  47470. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  47471. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  47472. this.targetObject = e);
  47473. var u = this.BindingType.Direct;
  47474. if (void 0 !== o) {
  47475. if ("morphTargetInfluences" === r) {
  47476. if (!e.geometry)
  47477. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  47478. if (!e.geometry.morphTargets)
  47479. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  47480. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  47481. if (e.geometry.morphTargets[s].name === o) {
  47482. o = s;
  47483. break
  47484. }
  47485. }
  47486. u = this.BindingType.ArrayElement,
  47487. this.resolvedProperty = l,
  47488. this.propertyIndex = o
  47489. } else
  47490. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  47491. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  47492. this.resolvedProperty = l) : this.propertyName = r;
  47493. this.getValue = this.GetterByBindingType[u],
  47494. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  47495. },
  47496. unbind: function() {
  47497. this.node = null,
  47498. this.getValue = this._getValue_unbound,
  47499. this.setValue = this._setValue_unbound
  47500. }
  47501. },
  47502. Object.assign(n.PropertyBinding.prototype, {
  47503. _getValue_unavailable: function() {},
  47504. _setValue_unavailable: function() {},
  47505. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  47506. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  47507. BindingType: {
  47508. Direct: 0,
  47509. EntireArray: 1,
  47510. ArrayElement: 2,
  47511. HasFromToArray: 3
  47512. },
  47513. Versioning: {
  47514. None: 0,
  47515. NeedsUpdate: 1,
  47516. MatrixWorldNeedsUpdate: 2
  47517. },
  47518. GetterByBindingType: [function(e, t) {
  47519. e[t] = this.node[this.propertyName]
  47520. }
  47521. , function(e, t) {
  47522. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47523. e[t++] = i[n]
  47524. }
  47525. , function(e, t) {
  47526. e[t] = this.resolvedProperty[this.propertyIndex]
  47527. }
  47528. , function(e, t) {
  47529. this.resolvedProperty.toArray(e, t)
  47530. }
  47531. ],
  47532. SetterByBindingTypeAndVersioning: [[function(e, t) {
  47533. this.node[this.propertyName] = e[t]
  47534. }
  47535. , function(e, t) {
  47536. this.node[this.propertyName] = e[t],
  47537. this.targetObject.needsUpdate = !0
  47538. }
  47539. , function(e, t) {
  47540. this.node[this.propertyName] = e[t],
  47541. this.targetObject.matrixWorldNeedsUpdate = !0
  47542. }
  47543. ], [function(e, t) {
  47544. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47545. i[n] = e[t++]
  47546. }
  47547. , function(e, t) {
  47548. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47549. i[n] = e[t++];
  47550. this.targetObject.needsUpdate = !0
  47551. }
  47552. , function(e, t) {
  47553. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47554. i[n] = e[t++];
  47555. this.targetObject.matrixWorldNeedsUpdate = !0
  47556. }
  47557. ], [function(e, t) {
  47558. this.resolvedProperty[this.propertyIndex] = e[t]
  47559. }
  47560. , function(e, t) {
  47561. this.resolvedProperty[this.propertyIndex] = e[t],
  47562. this.targetObject.needsUpdate = !0
  47563. }
  47564. , function(e, t) {
  47565. this.resolvedProperty[this.propertyIndex] = e[t],
  47566. this.targetObject.matrixWorldNeedsUpdate = !0
  47567. }
  47568. ], [function(e, t) {
  47569. this.resolvedProperty.fromArray(e, t)
  47570. }
  47571. , function(e, t) {
  47572. this.resolvedProperty.fromArray(e, t),
  47573. this.targetObject.needsUpdate = !0
  47574. }
  47575. , function(e, t) {
  47576. this.resolvedProperty.fromArray(e, t),
  47577. this.targetObject.matrixWorldNeedsUpdate = !0
  47578. }
  47579. ]]
  47580. }),
  47581. n.PropertyBinding.Composite = function(e, t, i) {
  47582. var r = i || n.PropertyBinding.parseTrackName(t);
  47583. this._targetGroup = e,
  47584. this._bindings = e.subscribe_(t, r)
  47585. }
  47586. ,
  47587. n.PropertyBinding.Composite.prototype = {
  47588. constructor: n.PropertyBinding.Composite,
  47589. getValue: function(e, t) {
  47590. this.bind();
  47591. var i = this._targetGroup.nCachedObjects_
  47592. , n = this._bindings[i];
  47593. void 0 !== n && n.getValue(e, t)
  47594. },
  47595. setValue: function(e, t) {
  47596. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  47597. i[n].setValue(e, t)
  47598. },
  47599. bind: function() {
  47600. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47601. e[t].bind()
  47602. },
  47603. unbind: function() {
  47604. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47605. e[t].unbind()
  47606. }
  47607. },
  47608. n.PropertyBinding.create = function(e, t, i) {
  47609. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  47610. }
  47611. ,
  47612. n.PropertyBinding.parseTrackName = function(e) {
  47613. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  47614. , i = t.exec(e);
  47615. if (!i)
  47616. throw new Error("cannot parse trackName at all: " + e);
  47617. i.index === t.lastIndex && t.lastIndex++;
  47618. var n = {
  47619. nodeName: i[3],
  47620. objectName: i[5],
  47621. objectIndex: i[7],
  47622. propertyName: i[9],
  47623. propertyIndex: i[11]
  47624. };
  47625. if (null === n.propertyName || 0 === n.propertyName.length)
  47626. throw new Error("can not parse propertyName from trackName: " + e);
  47627. return n
  47628. }
  47629. ,
  47630. n.PropertyBinding.findNode = function(e, t) {
  47631. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  47632. return e;
  47633. if (e.skeleton) {
  47634. var i = function(e) {
  47635. for (var i = 0; i < e.bones.length; i++) {
  47636. var n = e.bones[i];
  47637. if (n.name === t)
  47638. return n
  47639. }
  47640. return null
  47641. }
  47642. , n = i(e.skeleton);
  47643. if (n)
  47644. return n
  47645. }
  47646. if (e.children) {
  47647. var r = function(e) {
  47648. for (var i = 0; i < e.length; i++) {
  47649. var n = e[i];
  47650. if (n.name === t || n.uuid === t)
  47651. return n;
  47652. var o = r(n.children);
  47653. if (o)
  47654. return o
  47655. }
  47656. return null
  47657. }
  47658. , o = r(e.children);
  47659. if (o)
  47660. return o
  47661. }
  47662. return null
  47663. }
  47664. ,
  47665. n.PropertyMixer = function(e, t, i) {
  47666. this.binding = e,
  47667. this.valueSize = i;
  47668. var n, r = Float64Array;
  47669. switch (t) {
  47670. case "quaternion":
  47671. n = this._slerp;
  47672. break;
  47673. case "string":
  47674. case "bool":
  47675. r = Array,
  47676. n = this._select;
  47677. break;
  47678. default:
  47679. n = this._lerp
  47680. }
  47681. this.buffer = new r(4 * i),
  47682. this._mixBufferRegion = n,
  47683. this.cumulativeWeight = 0,
  47684. this.useCount = 0,
  47685. this.referenceCount = 0
  47686. }
  47687. ,
  47688. n.PropertyMixer.prototype = {
  47689. constructor: n.PropertyMixer,
  47690. accumulate: function(e, t) {
  47691. var i = this.buffer
  47692. , n = this.valueSize
  47693. , r = e * n + n
  47694. , o = this.cumulativeWeight;
  47695. if (0 === o) {
  47696. for (var a = 0; a !== n; ++a)
  47697. i[r + a] = i[a];
  47698. o = t
  47699. } else {
  47700. o += t;
  47701. var s = t / o;
  47702. this._mixBufferRegion(i, r, 0, s, n)
  47703. }
  47704. this.cumulativeWeight = o
  47705. },
  47706. apply: function(e) {
  47707. var t = this.valueSize
  47708. , i = this.buffer
  47709. , n = e * t + t
  47710. , r = this.cumulativeWeight
  47711. , o = this.binding;
  47712. if (this.cumulativeWeight = 0,
  47713. r < 1) {
  47714. var a = 3 * t;
  47715. this._mixBufferRegion(i, n, a, 1 - r, t)
  47716. }
  47717. for (var s = t, l = t + t; s !== l; ++s)
  47718. if (i[s] !== i[s + t]) {
  47719. o.setValue(i, n);
  47720. break
  47721. }
  47722. },
  47723. saveOriginalState: function() {
  47724. var e = this.binding
  47725. , t = this.buffer
  47726. , i = this.valueSize
  47727. , n = 3 * i;
  47728. e.getValue(t, n);
  47729. for (var r = i, o = n; r !== o; ++r)
  47730. t[r] = t[n + r % i];
  47731. this.cumulativeWeight = 0
  47732. },
  47733. restoreOriginalState: function() {
  47734. var e = 3 * this.valueSize;
  47735. this.binding.setValue(this.buffer, e)
  47736. },
  47737. _select: function(e, t, i, n, r) {
  47738. if (n >= .5)
  47739. for (var o = 0; o !== r; ++o)
  47740. e[t + o] = e[i + o]
  47741. },
  47742. _slerp: function(e, t, i, r, o) {
  47743. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47744. },
  47745. _lerp: function(e, t, i, n, r) {
  47746. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47747. var s = t + a;
  47748. e[s] = e[s] * o + e[i + a] * n
  47749. }
  47750. }
  47751. },
  47752. n.BooleanKeyframeTrack = function(e, t, i) {
  47753. n.KeyframeTrack.call(this, e, t, i)
  47754. }
  47755. ,
  47756. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47757. constructor: n.BooleanKeyframeTrack,
  47758. ValueTypeName: "bool",
  47759. ValueBufferType: Array,
  47760. DefaultInterpolation: n.IntepolateDiscrete,
  47761. InterpolantFactoryMethodLinear: void 0,
  47762. InterpolantFactoryMethodSmooth: void 0
  47763. }),
  47764. n.NumberKeyframeTrack = function(e, t, i, r) {
  47765. n.KeyframeTrack.call(this, e, t, i, r)
  47766. }
  47767. ,
  47768. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47769. constructor: n.NumberKeyframeTrack,
  47770. ValueTypeName: "number"
  47771. }),
  47772. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47773. n.KeyframeTrack.call(this, e, t, i, r)
  47774. }
  47775. ,
  47776. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47777. constructor: n.QuaternionKeyframeTrack,
  47778. ValueTypeName: "quaternion",
  47779. DefaultInterpolation: n.InterpolateLinear,
  47780. InterpolantFactoryMethodLinear: function(e) {
  47781. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47782. },
  47783. InterpolantFactoryMethodSmooth: void 0
  47784. }),
  47785. n.StringKeyframeTrack = function(e, t, i, r) {
  47786. n.KeyframeTrack.call(this, e, t, i, r)
  47787. }
  47788. ,
  47789. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47790. constructor: n.StringKeyframeTrack,
  47791. ValueTypeName: "string",
  47792. ValueBufferType: Array,
  47793. DefaultInterpolation: n.IntepolateDiscrete,
  47794. InterpolantFactoryMethodLinear: void 0,
  47795. InterpolantFactoryMethodSmooth: void 0
  47796. }),
  47797. n.VectorKeyframeTrack = function(e, t, i, r) {
  47798. n.KeyframeTrack.call(this, e, t, i, r)
  47799. }
  47800. ,
  47801. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47802. constructor: n.VectorKeyframeTrack,
  47803. ValueTypeName: "vector"
  47804. }),
  47805. n.Audio = function(e) {
  47806. n.Object3D.call(this),
  47807. this.type = "Audio",
  47808. this.context = e.context,
  47809. this.source = this.context.createBufferSource(),
  47810. this.source.onended = this.onEnded.bind(this),
  47811. this.gain = this.context.createGain(),
  47812. this.gain.connect(e.getInput()),
  47813. this.autoplay = !1,
  47814. this.startTime = 0,
  47815. this.playbackRate = 1,
  47816. this.isPlaying = !1,
  47817. this.hasPlaybackControl = !0,
  47818. this.sourceType = "empty",
  47819. this.filter = null
  47820. }
  47821. ,
  47822. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47823. n.Audio.prototype.constructor = n.Audio,
  47824. n.Audio.prototype.getOutput = function() {
  47825. return this.gain
  47826. }
  47827. ,
  47828. n.Audio.prototype.load = function(e) {
  47829. var t = new n.AudioBuffer(this.context);
  47830. return t.load(e),
  47831. this.setBuffer(t),
  47832. this
  47833. }
  47834. ,
  47835. n.Audio.prototype.setNodeSource = function(e) {
  47836. return this.hasPlaybackControl = !1,
  47837. this.sourceType = "audioNode",
  47838. this.source = e,
  47839. this.connect(),
  47840. this
  47841. }
  47842. ,
  47843. n.Audio.prototype.setBuffer = function(e) {
  47844. var t = this;
  47845. return e.onReady(function(e) {
  47846. t.source.buffer = e,
  47847. t.sourceType = "buffer",
  47848. t.autoplay && t.play()
  47849. }),
  47850. this
  47851. }
  47852. ,
  47853. n.Audio.prototype.play = function() {
  47854. if (this.isPlaying === !0)
  47855. return void console.warn("THREE.Audio: Audio is already playing.");
  47856. if (this.hasPlaybackControl === !1)
  47857. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47858. var e = this.context.createBufferSource();
  47859. e.buffer = this.source.buffer,
  47860. e.loop = this.source.loop,
  47861. e.onended = this.source.onended,
  47862. e.start(0, this.startTime),
  47863. e.playbackRate.value = this.playbackRate,
  47864. this.isPlaying = !0,
  47865. this.source = e,
  47866. this.connect()
  47867. }
  47868. ,
  47869. n.Audio.prototype.pause = function() {
  47870. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47871. void (this.startTime = this.context.currentTime))
  47872. }
  47873. ,
  47874. n.Audio.prototype.stop = function() {
  47875. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47876. void (this.startTime = 0))
  47877. }
  47878. ,
  47879. n.Audio.prototype.connect = function() {
  47880. null !== this.filter ? (this.source.connect(this.filter),
  47881. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47882. }
  47883. ,
  47884. n.Audio.prototype.disconnect = function() {
  47885. null !== this.filter ? (this.source.disconnect(this.filter),
  47886. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47887. }
  47888. ,
  47889. n.Audio.prototype.getFilter = function() {
  47890. return this.filter
  47891. }
  47892. ,
  47893. n.Audio.prototype.setFilter = function(e) {
  47894. void 0 === e && (e = null),
  47895. this.isPlaying === !0 ? (this.disconnect(),
  47896. this.filter = e,
  47897. this.connect()) : this.filter = e
  47898. }
  47899. ,
  47900. n.Audio.prototype.setPlaybackRate = function(e) {
  47901. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47902. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47903. }
  47904. ,
  47905. n.Audio.prototype.getPlaybackRate = function() {
  47906. return this.playbackRate
  47907. }
  47908. ,
  47909. n.Audio.prototype.onEnded = function() {
  47910. this.isPlaying = !1
  47911. }
  47912. ,
  47913. n.Audio.prototype.setLoop = function(e) {
  47914. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47915. }
  47916. ,
  47917. n.Audio.prototype.getLoop = function() {
  47918. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47919. !1) : this.source.loop
  47920. }
  47921. ,
  47922. n.Audio.prototype.setVolume = function(e) {
  47923. this.gain.gain.value = e
  47924. }
  47925. ,
  47926. n.Audio.prototype.getVolume = function() {
  47927. return this.gain.gain.value
  47928. }
  47929. ,
  47930. n.AudioAnalyser = function(e, t) {
  47931. this.analyser = e.context.createAnalyser(),
  47932. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47933. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47934. e.getOutput().connect(this.analyser)
  47935. }
  47936. ,
  47937. n.AudioAnalyser.prototype = {
  47938. constructor: n.AudioAnalyser,
  47939. getData: function() {
  47940. return this.analyser.getByteFrequencyData(this.data),
  47941. this.data
  47942. }
  47943. },
  47944. n.AudioBuffer = function(e) {
  47945. this.context = e,
  47946. this.ready = !1,
  47947. this.readyCallbacks = []
  47948. }
  47949. ,
  47950. n.AudioBuffer.prototype.load = function(e) {
  47951. var t = this
  47952. , i = new XMLHttpRequest;
  47953. return i.open("GET", e, !0),
  47954. i.responseType = "arraybuffer",
  47955. i.onload = function(e) {
  47956. t.context.decodeAudioData(this.response, function(e) {
  47957. t.buffer = e,
  47958. t.ready = !0;
  47959. for (var i = 0; i < t.readyCallbacks.length; i++)
  47960. t.readyCallbacks[i](t.buffer);
  47961. t.readyCallbacks = []
  47962. })
  47963. }
  47964. ,
  47965. i.send(),
  47966. this
  47967. }
  47968. ,
  47969. n.AudioBuffer.prototype.onReady = function(e) {
  47970. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47971. }
  47972. ,
  47973. n.PositionalAudio = function(e) {
  47974. n.Audio.call(this, e),
  47975. this.panner = this.context.createPanner(),
  47976. this.panner.connect(this.gain)
  47977. }
  47978. ,
  47979. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47980. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47981. n.PositionalAudio.prototype.getOutput = function() {
  47982. return this.panner
  47983. }
  47984. ,
  47985. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47986. this.panner.refDistance = e
  47987. }
  47988. ,
  47989. n.PositionalAudio.prototype.getRefDistance = function() {
  47990. return this.panner.refDistance
  47991. }
  47992. ,
  47993. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47994. this.panner.rolloffFactor = e
  47995. }
  47996. ,
  47997. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47998. return this.panner.rolloffFactor
  47999. }
  48000. ,
  48001. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  48002. this.panner.distanceModel = e
  48003. }
  48004. ,
  48005. n.PositionalAudio.prototype.getDistanceModel = function() {
  48006. return this.panner.distanceModel
  48007. }
  48008. ,
  48009. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  48010. this.panner.maxDistance = e
  48011. }
  48012. ,
  48013. n.PositionalAudio.prototype.getMaxDistance = function() {
  48014. return this.panner.maxDistance
  48015. }
  48016. ,
  48017. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  48018. var e = new n.Vector3;
  48019. return function(t) {
  48020. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  48021. e.setFromMatrixPosition(this.matrixWorld),
  48022. this.panner.setPosition(e.x, e.y, e.z)
  48023. }
  48024. }(),
  48025. n.AudioListener = function() {
  48026. n.Object3D.call(this),
  48027. this.type = "AudioListener",
  48028. this.context = new (window.AudioContext || window.webkitAudioContext),
  48029. this.gain = this.context.createGain(),
  48030. this.gain.connect(this.context.destination),
  48031. this.filter = null
  48032. }
  48033. ,
  48034. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  48035. n.AudioListener.prototype.constructor = n.AudioListener,
  48036. n.AudioListener.prototype.getInput = function() {
  48037. return this.gain
  48038. }
  48039. ,
  48040. n.AudioListener.prototype.removeFilter = function() {
  48041. null !== this.filter && (this.gain.disconnect(this.filter),
  48042. this.filter.disconnect(this.context.destination),
  48043. this.gain.connect(this.context.destination),
  48044. this.filter = null)
  48045. }
  48046. ,
  48047. n.AudioListener.prototype.setFilter = function(e) {
  48048. null !== this.filter ? (this.gain.disconnect(this.filter),
  48049. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  48050. this.filter = e,
  48051. this.gain.connect(this.filter),
  48052. this.filter.connect(this.context.destination)
  48053. }
  48054. ,
  48055. n.AudioListener.prototype.getFilter = function() {
  48056. return this.filter
  48057. }
  48058. ,
  48059. n.AudioListener.prototype.setMasterVolume = function(e) {
  48060. this.gain.gain.value = e
  48061. }
  48062. ,
  48063. n.AudioListener.prototype.getMasterVolume = function() {
  48064. return this.gain.gain.value
  48065. }
  48066. ,
  48067. n.AudioListener.prototype.updateMatrixWorld = function() {
  48068. var e = new n.Vector3
  48069. , t = new n.Quaternion
  48070. , i = new n.Vector3
  48071. , r = new n.Vector3;
  48072. return function(o) {
  48073. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  48074. var a = this.context.listener
  48075. , s = this.up;
  48076. this.matrixWorld.decompose(e, t, i),
  48077. r.set(0, 0, -1).applyQuaternion(t),
  48078. a.setPosition(e.x, e.y, e.z),
  48079. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  48080. }
  48081. }(),
  48082. n.Camera = function() {
  48083. n.Object3D.call(this),
  48084. this.type = "Camera",
  48085. this.matrixWorldInverse = new n.Matrix4,
  48086. this.projectionMatrix = new n.Matrix4
  48087. }
  48088. ,
  48089. n.Camera.prototype = Object.create(n.Object3D.prototype),
  48090. n.Camera.prototype.constructor = n.Camera,
  48091. n.Camera.prototype.getWorldDirection = function() {
  48092. var e = new n.Quaternion;
  48093. return function(t) {
  48094. var i = t || new n.Vector3;
  48095. return this.getWorldQuaternion(e),
  48096. i.set(0, 0, -1).applyQuaternion(e)
  48097. }
  48098. }(),
  48099. n.Camera.prototype.lookAt = function() {
  48100. var e = new n.Matrix4;
  48101. return function(t) {
  48102. e.lookAt(this.position, t, this.up),
  48103. this.quaternion.setFromRotationMatrix(e)
  48104. }
  48105. }(),
  48106. n.Camera.prototype.clone = function() {
  48107. return (new this.constructor).copy(this)
  48108. }
  48109. ,
  48110. n.Camera.prototype.copy = function(e) {
  48111. return n.Object3D.prototype.copy.call(this, e),
  48112. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  48113. this.projectionMatrix.copy(e.projectionMatrix),
  48114. this
  48115. }
  48116. ,
  48117. n.CubeCamera = function(e, t, i) {
  48118. n.Object3D.call(this),
  48119. this.type = "CubeCamera";
  48120. var r = 90
  48121. , o = 1
  48122. , a = new n.PerspectiveCamera(r,o,e,t);
  48123. a.up.set(0, -1, 0),
  48124. a.lookAt(new n.Vector3(1,0,0)),
  48125. this.add(a);
  48126. var s = new n.PerspectiveCamera(r,o,e,t);
  48127. s.up.set(0, -1, 0),
  48128. s.lookAt(new n.Vector3(-1,0,0)),
  48129. this.add(s);
  48130. var l = new n.PerspectiveCamera(r,o,e,t);
  48131. l.up.set(0, 0, 1),
  48132. l.lookAt(new n.Vector3(0,1,0)),
  48133. this.add(l);
  48134. var c = new n.PerspectiveCamera(r,o,e,t);
  48135. c.up.set(0, 0, -1),
  48136. c.lookAt(new n.Vector3(0,-1,0)),
  48137. this.add(c);
  48138. var h = new n.PerspectiveCamera(r,o,e,t);
  48139. h.up.set(0, -1, 0),
  48140. h.lookAt(new n.Vector3(0,0,1)),
  48141. this.add(h);
  48142. var u = new n.PerspectiveCamera(r,o,e,t);
  48143. u.up.set(0, -1, 0),
  48144. u.lookAt(new n.Vector3(0,0,-1)),
  48145. this.add(u);
  48146. var d = {
  48147. format: n.RGBFormat,
  48148. magFilter: n.LinearFilter,
  48149. minFilter: n.LinearFilter
  48150. };
  48151. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  48152. this.updateCubeMap = function(e, t) {
  48153. null === this.parent && this.updateMatrixWorld();
  48154. var i = this.renderTarget
  48155. , n = i.texture.generateMipmaps;
  48156. i.texture.generateMipmaps = !1,
  48157. i.activeCubeFace = 0,
  48158. e.render(t, a, i),
  48159. i.activeCubeFace = 1,
  48160. e.render(t, s, i),
  48161. i.activeCubeFace = 2,
  48162. e.render(t, l, i),
  48163. i.activeCubeFace = 3,
  48164. e.render(t, c, i),
  48165. i.activeCubeFace = 4,
  48166. e.render(t, h, i),
  48167. i.texture.generateMipmaps = n,
  48168. i.activeCubeFace = 5,
  48169. e.render(t, u, i),
  48170. e.setRenderTarget(null)
  48171. }
  48172. }
  48173. ,
  48174. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  48175. n.CubeCamera.prototype.constructor = n.CubeCamera,
  48176. n.OrthographicCamera = function(e, t, i, r, o, a) {
  48177. n.Camera.call(this),
  48178. this.type = "OrthographicCamera",
  48179. this.zoom = 1,
  48180. this.left = e,
  48181. this.right = t,
  48182. this.top = i,
  48183. this.bottom = r,
  48184. this.near = void 0 !== o ? o : .1,
  48185. this.far = void 0 !== a ? a : 2e3,
  48186. this.updateProjectionMatrix()
  48187. }
  48188. ,
  48189. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  48190. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  48191. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  48192. var e = (this.right - this.left) / (2 * this.zoom)
  48193. , t = (this.top - this.bottom) / (2 * this.zoom)
  48194. , i = (this.right + this.left) / 2
  48195. , n = (this.top + this.bottom) / 2;
  48196. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  48197. }
  48198. ,
  48199. n.OrthographicCamera.prototype.copy = function(e) {
  48200. return n.Camera.prototype.copy.call(this, e),
  48201. this.left = e.left,
  48202. this.right = e.right,
  48203. this.top = e.top,
  48204. this.bottom = e.bottom,
  48205. this.near = e.near,
  48206. this.far = e.far,
  48207. this.zoom = e.zoom,
  48208. this
  48209. }
  48210. ,
  48211. n.OrthographicCamera.prototype.toJSON = function(e) {
  48212. var t = n.Object3D.prototype.toJSON.call(this, e);
  48213. return t.object.zoom = this.zoom,
  48214. t.object.left = this.left,
  48215. t.object.right = this.right,
  48216. t.object.top = this.top,
  48217. t.object.bottom = this.bottom,
  48218. t.object.near = this.near,
  48219. t.object.far = this.far,
  48220. t
  48221. }
  48222. ,
  48223. n.PerspectiveCamera = function(e, t, i, r) {
  48224. n.Camera.call(this),
  48225. this.type = "PerspectiveCamera",
  48226. this.focalLength = 10,
  48227. this.zoom = 1,
  48228. this.fov = void 0 !== e ? e : 50,
  48229. this.aspect = void 0 !== t ? t : 1,
  48230. this.near = void 0 !== i ? i : .1,
  48231. this.far = void 0 !== r ? r : 2e3,
  48232. this.updateProjectionMatrix()
  48233. }
  48234. ,
  48235. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  48236. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  48237. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  48238. void 0 === t && (t = 24),
  48239. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  48240. this.updateProjectionMatrix()
  48241. }
  48242. ,
  48243. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  48244. this.fullWidth = e,
  48245. this.fullHeight = t,
  48246. this.x = i,
  48247. this.y = n,
  48248. this.width = r,
  48249. this.height = o,
  48250. this.updateProjectionMatrix()
  48251. }
  48252. ,
  48253. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  48254. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  48255. if (this.fullWidth) {
  48256. var t = this.fullWidth / this.fullHeight
  48257. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  48258. , r = -i
  48259. , o = t * r
  48260. , a = t * i
  48261. , s = Math.abs(a - o)
  48262. , l = Math.abs(i - r);
  48263. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  48264. } else
  48265. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  48266. }
  48267. ,
  48268. n.PerspectiveCamera.prototype.copy = function(e) {
  48269. return n.Camera.prototype.copy.call(this, e),
  48270. this.focalLength = e.focalLength,
  48271. this.zoom = e.zoom,
  48272. this.fov = e.fov,
  48273. this.aspect = e.aspect,
  48274. this.near = e.near,
  48275. this.far = e.far,
  48276. this
  48277. }
  48278. ,
  48279. n.PerspectiveCamera.prototype.toJSON = function(e) {
  48280. var t = n.Object3D.prototype.toJSON.call(this, e);
  48281. return t.object.focalLength = this.focalLength,
  48282. t.object.zoom = this.zoom,
  48283. t.object.fov = this.fov,
  48284. t.object.aspect = this.aspect,
  48285. t.object.near = this.near,
  48286. t.object.far = this.far,
  48287. t
  48288. }
  48289. ,
  48290. n.StereoCamera = function() {
  48291. this.type = "StereoCamera",
  48292. this.aspect = 1,
  48293. this.cameraL = new n.PerspectiveCamera,
  48294. this.cameraL.layers.enable(1),
  48295. this.cameraL.matrixAutoUpdate = !1,
  48296. this.cameraR = new n.PerspectiveCamera,
  48297. this.cameraR.layers.enable(2),
  48298. this.cameraR.matrixAutoUpdate = !1
  48299. }
  48300. ,
  48301. n.StereoCamera.prototype = {
  48302. constructor: n.StereoCamera,
  48303. update: function() {
  48304. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  48305. return function(l) {
  48306. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  48307. if (c) {
  48308. e = l.focalLength,
  48309. t = l.fov,
  48310. i = l.aspect * this.aspect,
  48311. r = l.near,
  48312. o = l.far;
  48313. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  48314. s.elements[12] = -p,
  48315. a.elements[12] = p,
  48316. h = -g * i + f,
  48317. u = g * i + f,
  48318. d.elements[0] = 2 * r / (u - h),
  48319. d.elements[8] = (u + h) / (u - h),
  48320. this.cameraL.projectionMatrix.copy(d),
  48321. h = -g * i - f,
  48322. u = g * i - f,
  48323. d.elements[0] = 2 * r / (u - h),
  48324. d.elements[8] = (u + h) / (u - h),
  48325. this.cameraR.projectionMatrix.copy(d)
  48326. }
  48327. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  48328. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  48329. }
  48330. }()
  48331. },
  48332. n.Light = function(e, t) {
  48333. n.Object3D.call(this),
  48334. this.type = "Light",
  48335. this.color = new n.Color(e),
  48336. this.intensity = void 0 !== t ? t : 1,
  48337. this.receiveShadow = void 0
  48338. }
  48339. ,
  48340. n.Light.prototype = Object.create(n.Object3D.prototype),
  48341. n.Light.prototype.constructor = n.Light,
  48342. n.Light.prototype.copy = function(e) {
  48343. return n.Object3D.prototype.copy.call(this, e),
  48344. this.color.copy(e.color),
  48345. this.intensity = e.intensity,
  48346. this
  48347. }
  48348. ,
  48349. n.Light.prototype.toJSON = function(e) {
  48350. var t = n.Object3D.prototype.toJSON.call(this, e);
  48351. return t.object.color = this.color.getHex(),
  48352. t.object.intensity = this.intensity,
  48353. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  48354. void 0 !== this.distance && (t.object.distance = this.distance),
  48355. void 0 !== this.angle && (t.object.angle = this.angle),
  48356. void 0 !== this.decay && (t.object.decay = this.decay),
  48357. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  48358. t
  48359. }
  48360. ,
  48361. n.LightShadow = function(e) {
  48362. this.camera = e,
  48363. this.bias = 0,
  48364. this.radius = 1,
  48365. this.mapSize = new n.Vector2(512,512),
  48366. this.map = null,
  48367. this.matrix = new n.Matrix4
  48368. }
  48369. ,
  48370. n.LightShadow.prototype = {
  48371. constructor: n.LightShadow,
  48372. copy: function(e) {
  48373. return this.camera = e.camera.clone(),
  48374. this.bias = e.bias,
  48375. this.radius = e.radius,
  48376. this.mapSize.copy(e.mapSize),
  48377. this
  48378. },
  48379. clone: function() {
  48380. return (new this.constructor).copy(this)
  48381. }
  48382. },
  48383. n.AmbientLight = function(e, t) {
  48384. n.Light.call(this, e, t),
  48385. this.type = "AmbientLight",
  48386. this.castShadow = void 0
  48387. }
  48388. ,
  48389. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  48390. n.AmbientLight.prototype.constructor = n.AmbientLight,
  48391. n.DirectionalLight = function(e, t) {
  48392. n.Light.call(this, e, t),
  48393. this.type = "DirectionalLight",
  48394. this.position.set(0, 1, 0),
  48395. this.updateMatrix(),
  48396. this.target = new n.Object3D,
  48397. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  48398. }
  48399. ,
  48400. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  48401. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  48402. n.DirectionalLight.prototype.copy = function(e) {
  48403. return n.Light.prototype.copy.call(this, e),
  48404. this.target = e.target.clone(),
  48405. this.shadow = e.shadow.clone(),
  48406. this
  48407. }
  48408. ,
  48409. n.HemisphereLight = function(e, t, i) {
  48410. n.Light.call(this, e, i),
  48411. this.type = "HemisphereLight",
  48412. this.castShadow = void 0,
  48413. this.position.set(0, 1, 0),
  48414. this.updateMatrix(),
  48415. this.groundColor = new n.Color(t)
  48416. }
  48417. ,
  48418. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  48419. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  48420. n.HemisphereLight.prototype.copy = function(e) {
  48421. return n.Light.prototype.copy.call(this, e),
  48422. this.groundColor.copy(e.groundColor),
  48423. this
  48424. }
  48425. ,
  48426. n.PointLight = function(e, t, i, r) {
  48427. n.Light.call(this, e, t),
  48428. this.type = "PointLight",
  48429. this.distance = void 0 !== i ? i : 0,
  48430. this.decay = void 0 !== r ? r : 1,
  48431. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  48432. }
  48433. ,
  48434. n.PointLight.prototype = Object.create(n.Light.prototype),
  48435. n.PointLight.prototype.constructor = n.PointLight,
  48436. Object.defineProperty(n.PointLight.prototype, "power", {
  48437. get: function() {
  48438. return 4 * this.intensity * Math.PI
  48439. },
  48440. set: function(e) {
  48441. this.intensity = e / (4 * Math.PI)
  48442. }
  48443. }),
  48444. n.PointLight.prototype.copy = function(e) {
  48445. return n.Light.prototype.copy.call(this, e),
  48446. this.distance = e.distance,
  48447. this.decay = e.decay,
  48448. this.shadow = e.shadow.clone(),
  48449. this
  48450. }
  48451. ,
  48452. n.SpotLight = function(e, t, i, r, o, a) {
  48453. n.Light.call(this, e, t),
  48454. this.type = "SpotLight",
  48455. this.position.set(0, 1, 0),
  48456. this.updateMatrix(),
  48457. this.target = new n.Object3D,
  48458. this.distance = void 0 !== i ? i : 0,
  48459. this.angle = void 0 !== r ? r : Math.PI / 3,
  48460. this.penumbra = void 0 !== o ? o : 0,
  48461. this.decay = void 0 !== a ? a : 1,
  48462. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  48463. }
  48464. ,
  48465. n.SpotLight.prototype = Object.create(n.Light.prototype),
  48466. n.SpotLight.prototype.constructor = n.SpotLight,
  48467. Object.defineProperty(n.SpotLight.prototype, "power", {
  48468. get: function() {
  48469. return this.intensity * Math.PI
  48470. },
  48471. set: function(e) {
  48472. this.intensity = e / Math.PI
  48473. }
  48474. }),
  48475. n.SpotLight.prototype.copy = function(e) {
  48476. return n.Light.prototype.copy.call(this, e),
  48477. this.distance = e.distance,
  48478. this.angle = e.angle,
  48479. this.penumbra = e.penumbra,
  48480. this.decay = e.decay,
  48481. this.target = e.target.clone(),
  48482. this.shadow = e.shadow.clone(),
  48483. this
  48484. }
  48485. ,
  48486. n.Cache = {
  48487. enabled: !1,
  48488. files: {},
  48489. add: function(e, t) {
  48490. this.enabled !== !1 && (this.files[e] = t)
  48491. },
  48492. get: function(e) {
  48493. if (this.enabled !== !1)
  48494. return this.files[e]
  48495. },
  48496. remove: function(e) {
  48497. delete this.files[e]
  48498. },
  48499. clear: function() {
  48500. this.files = {}
  48501. }
  48502. },
  48503. n.Loader = function() {
  48504. this.onLoadStart = function() {}
  48505. ,
  48506. this.onLoadProgress = function() {}
  48507. ,
  48508. this.onLoadComplete = function() {}
  48509. }
  48510. ,
  48511. n.Loader.prototype = {
  48512. constructor: n.Loader,
  48513. crossOrigin: void 0,
  48514. extractUrlBase: function(e) {
  48515. var t = e.split("/");
  48516. return 1 === t.length ? "./" : (t.pop(),
  48517. t.join("/") + "/")
  48518. },
  48519. initMaterials: function(e, t, i) {
  48520. for (var n = [], r = 0; r < e.length; ++r)
  48521. n[r] = this.createMaterial(e[r], t, i);
  48522. return n
  48523. },
  48524. createMaterial: function() {
  48525. var e, t, i;
  48526. return function(r, o, a) {
  48527. function s(e, i, r, s, c) {
  48528. var h, u = o + e, d = n.Loader.Handlers.get(u);
  48529. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  48530. h = t.load(u)),
  48531. void 0 !== i && (h.repeat.fromArray(i),
  48532. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  48533. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  48534. void 0 !== r && h.offset.fromArray(r),
  48535. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  48536. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  48537. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  48538. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  48539. void 0 !== c && (h.anisotropy = c);
  48540. var p = n.Math.generateUUID();
  48541. return l[p] = h,
  48542. p
  48543. }
  48544. void 0 === e && (e = new n.Color),
  48545. void 0 === t && (t = new n.TextureLoader),
  48546. void 0 === i && (i = new n.MaterialLoader);
  48547. var l = {}
  48548. , c = {
  48549. uuid: n.Math.generateUUID(),
  48550. type: "MeshLambertMaterial"
  48551. };
  48552. for (var h in r) {
  48553. var u = r[h];
  48554. switch (h) {
  48555. case "DbgColor":
  48556. case "DbgIndex":
  48557. case "opticalDensity":
  48558. case "illumination":
  48559. break;
  48560. case "DbgName":
  48561. c.name = u;
  48562. break;
  48563. case "blending":
  48564. c.blending = n[u];
  48565. break;
  48566. case "colorAmbient":
  48567. case "mapAmbient":
  48568. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  48569. break;
  48570. case "colorDiffuse":
  48571. c.color = e.fromArray(u).getHex();
  48572. break;
  48573. case "colorSpecular":
  48574. c.specular = e.fromArray(u).getHex();
  48575. break;
  48576. case "colorEmissive":
  48577. c.emissive = e.fromArray(u).getHex();
  48578. break;
  48579. case "specularCoef":
  48580. c.shininess = u;
  48581. break;
  48582. case "shading":
  48583. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  48584. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  48585. break;
  48586. case "mapDiffuse":
  48587. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  48588. break;
  48589. case "mapDiffuseRepeat":
  48590. case "mapDiffuseOffset":
  48591. case "mapDiffuseWrap":
  48592. case "mapDiffuseAnisotropy":
  48593. break;
  48594. case "mapLight":
  48595. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  48596. break;
  48597. case "mapLightRepeat":
  48598. case "mapLightOffset":
  48599. case "mapLightWrap":
  48600. case "mapLightAnisotropy":
  48601. break;
  48602. case "mapAO":
  48603. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  48604. break;
  48605. case "mapAORepeat":
  48606. case "mapAOOffset":
  48607. case "mapAOWrap":
  48608. case "mapAOAnisotropy":
  48609. break;
  48610. case "mapBump":
  48611. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  48612. break;
  48613. case "mapBumpScale":
  48614. c.bumpScale = u;
  48615. break;
  48616. case "mapBumpRepeat":
  48617. case "mapBumpOffset":
  48618. case "mapBumpWrap":
  48619. case "mapBumpAnisotropy":
  48620. break;
  48621. case "mapNormal":
  48622. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  48623. break;
  48624. case "mapNormalFactor":
  48625. c.normalScale = [u, u];
  48626. break;
  48627. case "mapNormalRepeat":
  48628. case "mapNormalOffset":
  48629. case "mapNormalWrap":
  48630. case "mapNormalAnisotropy":
  48631. break;
  48632. case "mapSpecular":
  48633. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  48634. break;
  48635. case "mapSpecularRepeat":
  48636. case "mapSpecularOffset":
  48637. case "mapSpecularWrap":
  48638. case "mapSpecularAnisotropy":
  48639. break;
  48640. case "mapAlpha":
  48641. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  48642. break;
  48643. case "mapAlphaRepeat":
  48644. case "mapAlphaOffset":
  48645. case "mapAlphaWrap":
  48646. case "mapAlphaAnisotropy":
  48647. break;
  48648. case "flipSided":
  48649. c.side = n.BackSide;
  48650. break;
  48651. case "doubleSided":
  48652. c.side = n.DoubleSide;
  48653. break;
  48654. case "transparency":
  48655. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48656. c.opacity = u;
  48657. break;
  48658. case "depthTest":
  48659. case "depthWrite":
  48660. case "colorWrite":
  48661. case "opacity":
  48662. case "reflectivity":
  48663. case "transparent":
  48664. case "visible":
  48665. case "wireframe":
  48666. c[h] = u;
  48667. break;
  48668. case "vertexColors":
  48669. u === !0 && (c.vertexColors = n.VertexColors),
  48670. "face" === u && (c.vertexColors = n.FaceColors);
  48671. break;
  48672. default:
  48673. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48674. }
  48675. }
  48676. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48677. "MeshPhongMaterial" !== c.type && delete c.specular,
  48678. c.opacity < 1 && (c.transparent = !0),
  48679. i.setTextures(l),
  48680. i.parse(c)
  48681. }
  48682. }()
  48683. },
  48684. n.Loader.Handlers = {
  48685. handlers: [],
  48686. add: function(e, t) {
  48687. this.handlers.push(e, t)
  48688. },
  48689. get: function(e) {
  48690. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48691. var r = t[i]
  48692. , o = t[i + 1];
  48693. if (r.test(e))
  48694. return o
  48695. }
  48696. return null
  48697. }
  48698. },
  48699. n.XHRLoader = function(e) {
  48700. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48701. }
  48702. ,
  48703. n.XHRLoader.prototype = {
  48704. constructor: n.XHRLoader,
  48705. load: function(e, t, i, r) {
  48706. void 0 !== this.path && (e = this.path + e);
  48707. var o = this
  48708. , a = n.Cache.get(e);
  48709. if (void 0 !== a)
  48710. return t && setTimeout(function() {
  48711. t(a)
  48712. }, 0),
  48713. a;
  48714. var s = new XMLHttpRequest;
  48715. return s.overrideMimeType("text/plain"),
  48716. s.open("GET", e, !0),
  48717. s.addEventListener("load", function(i) {
  48718. var a = i.target.response;
  48719. n.Cache.add(e, a),
  48720. 200 === this.status ? (t && t(a),
  48721. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48722. t && t(a),
  48723. o.manager.itemEnd(e)) : (r && r(i),
  48724. o.manager.itemError(e))
  48725. }, !1),
  48726. void 0 !== i && s.addEventListener("progress", function(e) {
  48727. i(e)
  48728. }, !1),
  48729. s.addEventListener("error", function(t) {
  48730. r && r(t),
  48731. o.manager.itemError(e)
  48732. }, !1),
  48733. void 0 !== this.responseType && (s.responseType = this.responseType),
  48734. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48735. s.send(null),
  48736. o.manager.itemStart(e),
  48737. s
  48738. },
  48739. setPath: function(e) {
  48740. this.path = e
  48741. },
  48742. setResponseType: function(e) {
  48743. this.responseType = e
  48744. },
  48745. setWithCredentials: function(e) {
  48746. this.withCredentials = e
  48747. }
  48748. },
  48749. n.FontLoader = function(e) {
  48750. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48751. }
  48752. ,
  48753. n.FontLoader.prototype = {
  48754. constructor: n.FontLoader,
  48755. load: function(e, t, i, r) {
  48756. var o = new n.XHRLoader(this.manager);
  48757. o.load(e, function(e) {
  48758. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48759. }, i, r)
  48760. }
  48761. },
  48762. n.ImageLoader = function(e) {
  48763. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48764. }
  48765. ,
  48766. n.ImageLoader.prototype = {
  48767. constructor: n.ImageLoader,
  48768. load: function(e, t, i, r) {
  48769. void 0 !== this.path && (e = this.path + e);
  48770. var o = this
  48771. , a = n.Cache.get(e);
  48772. if (void 0 !== a)
  48773. return o.manager.itemStart(e),
  48774. t ? setTimeout(function() {
  48775. t(a),
  48776. o.manager.itemEnd(e)
  48777. }, 0) : o.manager.itemEnd(e),
  48778. a;
  48779. var s = document.createElement("img");
  48780. return s.addEventListener("load", function(i) {
  48781. n.Cache.add(e, this),
  48782. t && t(this),
  48783. o.manager.itemEnd(e)
  48784. }, !1),
  48785. void 0 !== i && s.addEventListener("progress", function(e) {
  48786. i(e)
  48787. }, !1),
  48788. s.addEventListener("error", function(t) {
  48789. r && r(t),
  48790. o.manager.itemError(e)
  48791. }, !1),
  48792. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48793. o.manager.itemStart(e),
  48794. s.src = e,
  48795. s
  48796. },
  48797. setCrossOrigin: function(e) {
  48798. this.crossOrigin = e
  48799. },
  48800. setPath: function(e) {
  48801. this.path = e
  48802. }
  48803. },
  48804. n.JSONLoader = function(e) {
  48805. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48806. e = void 0),
  48807. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48808. this.withCredentials = !1
  48809. }
  48810. ,
  48811. n.JSONLoader.prototype = {
  48812. constructor: n.JSONLoader,
  48813. get statusDomElement() {
  48814. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48815. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48816. this._statusDomElement
  48817. },
  48818. load: function(e, t, i, r) {
  48819. var o = this
  48820. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48821. , s = new n.XHRLoader(this.manager);
  48822. s.setWithCredentials(this.withCredentials),
  48823. s.load(e, function(i) {
  48824. var n = JSON.parse(i)
  48825. , r = n.metadata;
  48826. if (void 0 !== r) {
  48827. var s = r.type;
  48828. if (void 0 !== s) {
  48829. if ("object" === s.toLowerCase())
  48830. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48831. if ("scene" === s.toLowerCase())
  48832. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48833. }
  48834. }
  48835. var l = o.parse(n, a);
  48836. t(l.geometry, l.materials)
  48837. }, i, r)
  48838. },
  48839. setTexturePath: function(e) {
  48840. this.texturePath = e
  48841. },
  48842. parse: function(e, t) {
  48843. function i(t) {
  48844. function i(e, t) {
  48845. return e & 1 << t
  48846. }
  48847. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  48848. if (void 0 !== e.uvs) {
  48849. for (r = 0; r < e.uvs.length; r++)
  48850. e.uvs[r].length && B++;
  48851. for (r = 0; r < B; r++)
  48852. s.faceVertexUvs[r] = []
  48853. }
  48854. for (l = 0,
  48855. c = L.length; l < c; )
  48856. E = new n.Vector3,
  48857. E.x = L[l++] * t,
  48858. E.y = L[l++] * t,
  48859. E.z = L[l++] * t,
  48860. s.vertices.push(E);
  48861. for (l = 0,
  48862. c = O.length; l < c; )
  48863. if (f = O[l++],
  48864. g = i(f, 0),
  48865. m = i(f, 1),
  48866. v = i(f, 3),
  48867. A = i(f, 4),
  48868. y = i(f, 5),
  48869. C = i(f, 6),
  48870. I = i(f, 7),
  48871. g) {
  48872. if (w = new n.Face3,
  48873. w.a = O[l],
  48874. w.b = O[l + 1],
  48875. w.c = O[l + 3],
  48876. _ = new n.Face3,
  48877. _.a = O[l + 1],
  48878. _.b = O[l + 2],
  48879. _.c = O[l + 3],
  48880. l += 4,
  48881. m && (p = O[l++],
  48882. w.materialIndex = p,
  48883. _.materialIndex = p),
  48884. a = s.faces.length,
  48885. v)
  48886. for (r = 0; r < B; r++)
  48887. for (S = e.uvs[r],
  48888. s.faceVertexUvs[r][a] = [],
  48889. s.faceVertexUvs[r][a + 1] = [],
  48890. o = 0; o < 4; o++)
  48891. d = O[l++],
  48892. R = S[2 * d],
  48893. P = S[2 * d + 1],
  48894. M = new n.Vector2(R,P),
  48895. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48896. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48897. if (A && (u = 3 * O[l++],
  48898. w.normal.set(D[u++], D[u++], D[u]),
  48899. _.normal.copy(w.normal)),
  48900. y)
  48901. for (r = 0; r < 4; r++)
  48902. u = 3 * O[l++],
  48903. x = new n.Vector3(D[u++],D[u++],D[u]),
  48904. 2 !== r && w.vertexNormals.push(x),
  48905. 0 !== r && _.vertexNormals.push(x);
  48906. if (C && (h = O[l++],
  48907. T = N[h],
  48908. w.color.setHex(T),
  48909. _.color.setHex(T)),
  48910. I)
  48911. for (r = 0; r < 4; r++)
  48912. h = O[l++],
  48913. T = N[h],
  48914. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48915. 0 !== r && _.vertexColors.push(new n.Color(T));
  48916. s.faces.push(w),
  48917. s.faces.push(_)
  48918. } else {
  48919. if (b = new n.Face3,
  48920. b.a = O[l++],
  48921. b.b = O[l++],
  48922. b.c = O[l++],
  48923. m && (p = O[l++],
  48924. b.materialIndex = p),
  48925. a = s.faces.length,
  48926. v)
  48927. for (r = 0; r < B; r++)
  48928. for (S = e.uvs[r],
  48929. s.faceVertexUvs[r][a] = [],
  48930. o = 0; o < 3; o++)
  48931. d = O[l++],
  48932. R = S[2 * d],
  48933. P = S[2 * d + 1],
  48934. M = new n.Vector2(R,P),
  48935. s.faceVertexUvs[r][a].push(M);
  48936. if (A && (u = 3 * O[l++],
  48937. b.normal.set(D[u++], D[u++], D[u])),
  48938. y)
  48939. for (r = 0; r < 3; r++)
  48940. u = 3 * O[l++],
  48941. x = new n.Vector3(D[u++],D[u++],D[u]),
  48942. b.vertexNormals.push(x);
  48943. if (C && (h = O[l++],
  48944. b.color.setHex(N[h])),
  48945. I)
  48946. for (r = 0; r < 3; r++)
  48947. h = O[l++],
  48948. b.vertexColors.push(new n.Color(N[h]));
  48949. s.faces.push(b)
  48950. }
  48951. }
  48952. function r() {
  48953. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48954. if (e.skinWeights)
  48955. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48956. var o = e.skinWeights[i]
  48957. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48958. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48959. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48960. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48961. }
  48962. if (e.skinIndices)
  48963. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48964. var h = e.skinIndices[i]
  48965. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48966. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48967. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48968. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48969. }
  48970. s.bones = e.bones,
  48971. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  48972. }
  48973. function o(t) {
  48974. if (void 0 !== e.morphTargets)
  48975. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48976. s.morphTargets[i] = {},
  48977. s.morphTargets[i].name = e.morphTargets[i].name,
  48978. s.morphTargets[i].vertices = [];
  48979. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48980. var h = new n.Vector3;
  48981. h.x = a[l] * t,
  48982. h.y = a[l + 1] * t,
  48983. h.z = a[l + 2] * t,
  48984. o.push(h)
  48985. }
  48986. }
  48987. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48988. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48989. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48990. u[i].color.fromArray(d, 3 * i)
  48991. }
  48992. }
  48993. function a() {
  48994. var t = []
  48995. , i = [];
  48996. void 0 !== e.animation && i.push(e.animation),
  48997. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48998. for (var r = 0; r < i.length; r++) {
  48999. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  49000. o && t.push(o)
  49001. }
  49002. if (s.morphTargets) {
  49003. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  49004. t = t.concat(a)
  49005. }
  49006. t.length > 0 && (s.animations = t)
  49007. }
  49008. var s = new n.Geometry
  49009. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  49010. if (i(l),
  49011. r(),
  49012. o(l),
  49013. a(),
  49014. s.computeFaceNormals(),
  49015. s.computeBoundingSphere(),
  49016. void 0 === e.materials || 0 === e.materials.length)
  49017. return {
  49018. geometry: s
  49019. };
  49020. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  49021. return {
  49022. geometry: s,
  49023. materials: c
  49024. }
  49025. }
  49026. },
  49027. n.LoadingManager = function(e, t, i) {
  49028. var n = this
  49029. , r = !1
  49030. , o = 0
  49031. , a = 0;
  49032. this.onStart = void 0,
  49033. this.onLoad = e,
  49034. this.onProgress = t,
  49035. this.onError = i,
  49036. this.itemStart = function(e) {
  49037. a++,
  49038. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  49039. r = !0
  49040. }
  49041. ,
  49042. this.itemEnd = function(e) {
  49043. o++,
  49044. void 0 !== n.onProgress && n.onProgress(e, o, a),
  49045. o === a && (r = !1,
  49046. void 0 !== n.onLoad && n.onLoad())
  49047. }
  49048. ,
  49049. this.itemError = function(e) {
  49050. void 0 !== n.onError && n.onError(e)
  49051. }
  49052. }
  49053. ,
  49054. n.DefaultLoadingManager = new n.LoadingManager,
  49055. n.BufferGeometryLoader = function(e) {
  49056. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49057. }
  49058. ,
  49059. n.BufferGeometryLoader.prototype = {
  49060. constructor: n.BufferGeometryLoader,
  49061. load: function(e, t, i, r) {
  49062. var o = this
  49063. , a = new n.XHRLoader(o.manager);
  49064. a.load(e, function(e) {
  49065. t(o.parse(JSON.parse(e)))
  49066. }, i, r)
  49067. },
  49068. parse: function(e) {
  49069. var t = new n.BufferGeometry
  49070. , i = e.data.index
  49071. , r = {
  49072. Int8Array: Int8Array,
  49073. Uint8Array: Uint8Array,
  49074. Uint8ClampedArray: Uint8ClampedArray,
  49075. Int16Array: Int16Array,
  49076. Uint16Array: Uint16Array,
  49077. Int32Array: Int32Array,
  49078. Uint32Array: Uint32Array,
  49079. Float32Array: Float32Array,
  49080. Float64Array: Float64Array
  49081. };
  49082. if (void 0 !== i) {
  49083. var o = new r[i.type](i.array);
  49084. t.setIndex(new n.BufferAttribute(o,1))
  49085. }
  49086. var a = e.data.attributes;
  49087. for (var s in a) {
  49088. var l = a[s]
  49089. , o = new r[l.type](l.array);
  49090. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  49091. }
  49092. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  49093. if (void 0 !== c)
  49094. for (var h = 0, u = c.length; h !== u; ++h) {
  49095. var d = c[h];
  49096. t.addGroup(d.start, d.count, d.materialIndex)
  49097. }
  49098. var p = e.data.boundingSphere;
  49099. if (void 0 !== p) {
  49100. var f = new n.Vector3;
  49101. void 0 !== p.center && f.fromArray(p.center),
  49102. t.boundingSphere = new n.Sphere(f,p.radius)
  49103. }
  49104. return t
  49105. }
  49106. },
  49107. n.MaterialLoader = function(e) {
  49108. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49109. this.textures = {}
  49110. }
  49111. ,
  49112. n.MaterialLoader.prototype = {
  49113. constructor: n.MaterialLoader,
  49114. load: function(e, t, i, r) {
  49115. var o = this
  49116. , a = new n.XHRLoader(o.manager);
  49117. a.load(e, function(e) {
  49118. t(o.parse(JSON.parse(e)))
  49119. }, i, r)
  49120. },
  49121. setTextures: function(e) {
  49122. this.textures = e
  49123. },
  49124. getTexture: function(e) {
  49125. var t = this.textures;
  49126. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  49127. t[e]
  49128. },
  49129. parse: function(e) {
  49130. var t = new n[e.type];
  49131. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  49132. void 0 !== e.name && (t.name = e.name),
  49133. void 0 !== e.color && t.color.setHex(e.color),
  49134. void 0 !== e.roughness && (t.roughness = e.roughness),
  49135. void 0 !== e.metalness && (t.metalness = e.metalness),
  49136. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  49137. void 0 !== e.specular && t.specular.setHex(e.specular),
  49138. void 0 !== e.shininess && (t.shininess = e.shininess),
  49139. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  49140. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  49141. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  49142. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  49143. void 0 !== e.shading && (t.shading = e.shading),
  49144. void 0 !== e.blending && (t.blending = e.blending),
  49145. void 0 !== e.side && (t.side = e.side),
  49146. void 0 !== e.opacity && (t.opacity = e.opacity),
  49147. void 0 !== e.transparent && (t.transparent = e.transparent),
  49148. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  49149. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  49150. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  49151. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  49152. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  49153. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  49154. void 0 !== e.size && (t.size = e.size),
  49155. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  49156. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  49157. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  49158. t.transparent = !0),
  49159. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  49160. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  49161. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  49162. void 0 !== e.normalScale) {
  49163. var i = e.normalScale;
  49164. Array.isArray(i) === !1 && (i = [i, i]),
  49165. t.normalScale = (new n.Vector2).fromArray(i)
  49166. }
  49167. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  49168. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  49169. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  49170. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  49171. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  49172. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  49173. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  49174. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  49175. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  49176. t.combine = n.MultiplyOperation),
  49177. e.reflectivity && (t.reflectivity = e.reflectivity),
  49178. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  49179. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  49180. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  49181. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  49182. void 0 !== e.materials)
  49183. for (var r = 0, o = e.materials.length; r < o; r++)
  49184. t.materials.push(this.parse(e.materials[r]));
  49185. return t
  49186. }
  49187. },
  49188. n.ObjectLoader = function(e) {
  49189. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49190. this.texturePath = ""
  49191. }
  49192. ,
  49193. n.ObjectLoader.prototype = {
  49194. constructor: n.ObjectLoader,
  49195. load: function(e, t, i, r) {
  49196. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  49197. var o = this
  49198. , a = new n.XHRLoader(o.manager);
  49199. a.load(e, function(e) {
  49200. o.parse(JSON.parse(e), t)
  49201. }, i, r)
  49202. },
  49203. setTexturePath: function(e) {
  49204. this.texturePath = e
  49205. },
  49206. setCrossOrigin: function(e) {
  49207. this.crossOrigin = e
  49208. },
  49209. parse: function(e, t) {
  49210. var i = this.parseGeometries(e.geometries)
  49211. , n = this.parseImages(e.images, function() {
  49212. void 0 !== t && t(a)
  49213. })
  49214. , r = this.parseTextures(e.textures, n)
  49215. , o = this.parseMaterials(e.materials, r)
  49216. , a = this.parseObject(e.object, i, o);
  49217. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  49218. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  49219. a
  49220. },
  49221. parseGeometries: function(e) {
  49222. var t = {};
  49223. if (void 0 !== e)
  49224. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  49225. var s, l = e[o];
  49226. switch (l.type) {
  49227. case "PlaneGeometry":
  49228. case "PlaneBufferGeometry":
  49229. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  49230. break;
  49231. case "BoxGeometry":
  49232. case "BoxBufferGeometry":
  49233. case "CubeGeometry":
  49234. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  49235. break;
  49236. case "CircleGeometry":
  49237. case "CircleBufferGeometry":
  49238. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  49239. break;
  49240. case "CylinderGeometry":
  49241. case "CylinderBufferGeometry":
  49242. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  49243. break;
  49244. case "SphereGeometry":
  49245. case "SphereBufferGeometry":
  49246. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  49247. break;
  49248. case "DodecahedronGeometry":
  49249. s = new n.DodecahedronGeometry(l.radius,l.detail);
  49250. break;
  49251. case "IcosahedronGeometry":
  49252. s = new n.IcosahedronGeometry(l.radius,l.detail);
  49253. break;
  49254. case "OctahedronGeometry":
  49255. s = new n.OctahedronGeometry(l.radius,l.detail);
  49256. break;
  49257. case "TetrahedronGeometry":
  49258. s = new n.TetrahedronGeometry(l.radius,l.detail);
  49259. break;
  49260. case "RingGeometry":
  49261. case "RingBufferGeometry":
  49262. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  49263. break;
  49264. case "TorusGeometry":
  49265. case "TorusBufferGeometry":
  49266. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  49267. break;
  49268. case "TorusKnotGeometry":
  49269. case "TorusKnotBufferGeometry":
  49270. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  49271. break;
  49272. case "LatheGeometry":
  49273. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  49274. break;
  49275. case "BufferGeometry":
  49276. s = r.parse(l);
  49277. break;
  49278. case "Geometry":
  49279. s = i.parse(l.data, this.texturePath).geometry;
  49280. break;
  49281. default:
  49282. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  49283. continue
  49284. }
  49285. s.uuid = l.uuid,
  49286. void 0 !== l.name && (s.name = l.name),
  49287. t[l.uuid] = s
  49288. }
  49289. return t
  49290. },
  49291. parseMaterials: function(e, t) {
  49292. var i = {};
  49293. if (void 0 !== e) {
  49294. var r = new n.MaterialLoader;
  49295. r.setTextures(t);
  49296. for (var o = 0, a = e.length; o < a; o++) {
  49297. var s = r.parse(e[o]);
  49298. i[s.uuid] = s
  49299. }
  49300. }
  49301. return i
  49302. },
  49303. parseAnimations: function(e) {
  49304. for (var t = [], i = 0; i < e.length; i++) {
  49305. var r = n.AnimationClip.parse(e[i]);
  49306. t.push(r)
  49307. }
  49308. return t
  49309. },
  49310. parseImages: function(e, t) {
  49311. function i(e) {
  49312. return r.manager.itemStart(e),
  49313. s.load(e, function() {
  49314. r.manager.itemEnd(e)
  49315. })
  49316. }
  49317. var r = this
  49318. , o = {};
  49319. if (void 0 !== e && e.length > 0) {
  49320. var a = new n.LoadingManager(t)
  49321. , s = new n.ImageLoader(a);
  49322. s.setCrossOrigin(this.crossOrigin);
  49323. for (var l = 0, c = e.length; l < c; l++) {
  49324. var h = e[l]
  49325. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  49326. o[h.uuid] = i(u)
  49327. }
  49328. }
  49329. return o
  49330. },
  49331. parseTextures: function(e, t) {
  49332. function i(e) {
  49333. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  49334. n[e])
  49335. }
  49336. var r = {};
  49337. if (void 0 !== e)
  49338. for (var o = 0, a = e.length; o < a; o++) {
  49339. var s = e[o];
  49340. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  49341. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  49342. var l = new n.Texture(t[s.image]);
  49343. l.needsUpdate = !0,
  49344. l.uuid = s.uuid,
  49345. void 0 !== s.name && (l.name = s.name),
  49346. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  49347. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  49348. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  49349. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  49350. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  49351. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  49352. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  49353. l.wrapT = i(s.wrap[1])),
  49354. r[s.uuid] = l
  49355. }
  49356. return r
  49357. },
  49358. parseObject: function() {
  49359. var e = new n.Matrix4;
  49360. return function(t, i, r) {
  49361. function o(e) {
  49362. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  49363. i[e]
  49364. }
  49365. function a(e) {
  49366. if (void 0 !== e)
  49367. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  49368. r[e]
  49369. }
  49370. var s;
  49371. switch (t.type) {
  49372. case "Scene":
  49373. s = new n.Scene;
  49374. break;
  49375. case "PerspectiveCamera":
  49376. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  49377. break;
  49378. case "OrthographicCamera":
  49379. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  49380. break;
  49381. case "AmbientLight":
  49382. s = new n.AmbientLight(t.color,t.intensity);
  49383. break;
  49384. case "DirectionalLight":
  49385. s = new n.DirectionalLight(t.color,t.intensity);
  49386. break;
  49387. case "PointLight":
  49388. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  49389. break;
  49390. case "SpotLight":
  49391. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  49392. break;
  49393. case "HemisphereLight":
  49394. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  49395. break;
  49396. case "Mesh":
  49397. var l = o(t.geometry)
  49398. , c = a(t.material);
  49399. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  49400. break;
  49401. case "LOD":
  49402. s = new n.LOD;
  49403. break;
  49404. case "Line":
  49405. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  49406. break;
  49407. case "PointCloud":
  49408. case "Points":
  49409. s = new n.Points(o(t.geometry),a(t.material));
  49410. break;
  49411. case "Sprite":
  49412. s = new n.Sprite(a(t.material));
  49413. break;
  49414. case "Group":
  49415. s = new n.Group;
  49416. break;
  49417. default:
  49418. s = new n.Object3D
  49419. }
  49420. if (s.uuid = t.uuid,
  49421. void 0 !== t.name && (s.name = t.name),
  49422. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  49423. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  49424. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  49425. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  49426. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  49427. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  49428. void 0 !== t.visible && (s.visible = t.visible),
  49429. void 0 !== t.userData && (s.userData = t.userData),
  49430. void 0 !== t.children)
  49431. for (var h in t.children)
  49432. s.add(this.parseObject(t.children[h], i, r));
  49433. if ("LOD" === t.type)
  49434. for (var u = t.levels, d = 0; d < u.length; d++) {
  49435. var p = u[d]
  49436. , h = s.getObjectByProperty("uuid", p.object);
  49437. void 0 !== h && s.addLevel(h, p.distance)
  49438. }
  49439. return s
  49440. }
  49441. }()
  49442. },
  49443. n.TextureLoader = function(e) {
  49444. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49445. }
  49446. ,
  49447. n.TextureLoader.prototype = {
  49448. constructor: n.TextureLoader,
  49449. load: function(e, t, i, r) {
  49450. var o = new n.Texture
  49451. , a = new n.ImageLoader(this.manager);
  49452. return a.setCrossOrigin(this.crossOrigin),
  49453. a.setPath(this.path),
  49454. a.load(e, function(e) {
  49455. o.image = e,
  49456. o.needsUpdate = !0,
  49457. void 0 !== t && t(o)
  49458. }, i, r),
  49459. o
  49460. },
  49461. setCrossOrigin: function(e) {
  49462. this.crossOrigin = e
  49463. },
  49464. setPath: function(e) {
  49465. this.path = e
  49466. }
  49467. },
  49468. n.CubeTextureLoader = function(e) {
  49469. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49470. }
  49471. ,
  49472. n.CubeTextureLoader.prototype = {
  49473. constructor: n.CubeTextureLoader,
  49474. load: function(e, t, i, r) {
  49475. function o(i) {
  49476. s.load(e[i], function(e) {
  49477. a.images[i] = e,
  49478. l++,
  49479. 6 === l && (a.needsUpdate = !0,
  49480. t && t(a))
  49481. }, void 0, r)
  49482. }
  49483. var a = new n.CubeTexture
  49484. , s = new n.ImageLoader(this.manager);
  49485. s.setCrossOrigin(this.crossOrigin),
  49486. s.setPath(this.path);
  49487. for (var l = 0, c = 0; c < e.length; ++c)
  49488. o(c);
  49489. return a
  49490. },
  49491. setCrossOrigin: function(e) {
  49492. this.crossOrigin = e
  49493. },
  49494. setPath: function(e) {
  49495. this.path = e
  49496. }
  49497. },
  49498. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  49499. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49500. this._parser = null
  49501. }
  49502. ,
  49503. n.BinaryTextureLoader.prototype = {
  49504. constructor: n.BinaryTextureLoader,
  49505. load: function(e, t, i, r) {
  49506. var o = this
  49507. , a = new n.DataTexture
  49508. , s = new n.XHRLoader(this.manager);
  49509. return s.setResponseType("arraybuffer"),
  49510. s.load(e, function(e) {
  49511. var i = o._parser(e);
  49512. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  49513. a.image.height = i.height,
  49514. a.image.data = i.data),
  49515. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  49516. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  49517. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  49518. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  49519. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  49520. void 0 !== i.format && (a.format = i.format),
  49521. void 0 !== i.type && (a.type = i.type),
  49522. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  49523. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  49524. a.needsUpdate = !0,
  49525. t && t(a, i))
  49526. }, i, r),
  49527. a
  49528. }
  49529. },
  49530. n.CompressedTextureLoader = function(e) {
  49531. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49532. this._parser = null
  49533. }
  49534. ;
  49535. n.CompressedTextureLoader.prototype = {
  49536. constructor: n.CompressedTextureLoader,
  49537. load: function(e, t, i, r) {
  49538. function o(o) {
  49539. c.load(e[o], function(e) {
  49540. var i = a._parser(e, !0);
  49541. s[o] = {
  49542. width: i.width,
  49543. height: i.height,
  49544. format: i.format,
  49545. mipmaps: i.mipmaps
  49546. },
  49547. h += 1,
  49548. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49549. l.format = i.format,
  49550. l.needsUpdate = !0,
  49551. t && t(l))
  49552. }, i, r)
  49553. }
  49554. var a = this
  49555. , s = []
  49556. , l = new n.CompressedTexture;
  49557. l.image = s;
  49558. var c = new n.XHRLoader(this.manager);
  49559. if (c.setPath(this.path),
  49560. c.setResponseType("arraybuffer"),
  49561. Array.isArray(e))
  49562. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  49563. o(u);
  49564. else
  49565. c.load(e, function(e) {
  49566. var i = a._parser(e, !0);
  49567. if (i.isCubemap)
  49568. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  49569. s[o] = {
  49570. mipmaps: []
  49571. };
  49572. for (var c = 0; c < i.mipmapCount; c++)
  49573. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  49574. s[o].format = i.format,
  49575. s[o].width = i.width,
  49576. s[o].height = i.height
  49577. }
  49578. else
  49579. l.image.width = i.width,
  49580. l.image.height = i.height,
  49581. l.mipmaps = i.mipmaps;
  49582. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49583. l.format = i.format,
  49584. l.needsUpdate = !0,
  49585. t && t(l)
  49586. }, i, r);
  49587. return l
  49588. },
  49589. setPath: function(e) {
  49590. this.path = e
  49591. }
  49592. };
  49593. n.Material = function() {
  49594. Object.defineProperty(this, "id", {
  49595. value: n.MaterialIdCount++
  49596. }),
  49597. this.uuid = n.Math.generateUUID(),
  49598. this.name = "",
  49599. this.type = "Material",
  49600. this.side = n.FrontSide,
  49601. this.opacity = 1,
  49602. this.transparent = !1,
  49603. this.blending = n.NormalBlending,
  49604. this.blendSrc = n.SrcAlphaFactor,
  49605. this.blendDst = n.OneMinusSrcAlphaFactor,
  49606. this.blendEquation = n.AddEquation,
  49607. this.blendSrcAlpha = null,
  49608. this.blendDstAlpha = null,
  49609. this.blendEquationAlpha = null,
  49610. this.depthFunc = n.LessEqualDepth,
  49611. this.depthTest = !0,
  49612. this.depthWrite = !0,
  49613. this.colorWrite = !0,
  49614. this.precision = null,
  49615. this.polygonOffset = !1,
  49616. this.polygonOffsetFactor = 0,
  49617. this.polygonOffsetUnits = 0,
  49618. this.alphaTest = 0,
  49619. this.premultipliedAlpha = !1,
  49620. this.overdraw = 0,
  49621. this.visible = !0,
  49622. this._needsUpdate = !0
  49623. }
  49624. ,
  49625. n.Material.prototype = {
  49626. constructor: n.Material,
  49627. get needsUpdate() {
  49628. return this._needsUpdate
  49629. },
  49630. set needsUpdate(e) {
  49631. e === !0 && this.update(),
  49632. this._needsUpdate = e
  49633. },
  49634. setValues: function(e) {
  49635. if (void 0 !== e)
  49636. for (var t in e) {
  49637. var i = e[t];
  49638. if (void 0 !== i) {
  49639. var r = this[t];
  49640. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  49641. } else
  49642. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  49643. }
  49644. },
  49645. toJSON: function(e) {
  49646. function t(e) {
  49647. var t = [];
  49648. for (var i in e) {
  49649. var n = e[i];
  49650. delete n.metadata,
  49651. t.push(n)
  49652. }
  49653. return t
  49654. }
  49655. var i = void 0 === e;
  49656. i && (e = {
  49657. textures: {},
  49658. images: {}
  49659. });
  49660. var r = {
  49661. metadata: {
  49662. version: 4.4,
  49663. type: "Material",
  49664. generator: "Material.toJSON"
  49665. }
  49666. };
  49667. if (r.uuid = this.uuid,
  49668. r.type = this.type,
  49669. "" !== this.name && (r.name = this.name),
  49670. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49671. .5 !== this.roughness && (r.roughness = this.roughness),
  49672. .5 !== this.metalness && (r.metalness = this.metalness),
  49673. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49674. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49675. void 0 !== this.shininess && (r.shininess = this.shininess),
  49676. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49677. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49678. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49679. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49680. r.bumpScale = this.bumpScale),
  49681. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49682. r.normalScale = this.normalScale.toArray()),
  49683. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49684. r.displacementScale = this.displacementScale,
  49685. r.displacementBias = this.displacementBias),
  49686. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49687. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49688. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49689. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49690. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49691. r.reflectivity = this.reflectivity),
  49692. void 0 !== this.size && (r.size = this.size),
  49693. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49694. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49695. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49696. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49697. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49698. this.opacity < 1 && (r.opacity = this.opacity),
  49699. this.transparent === !0 && (r.transparent = this.transparent),
  49700. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49701. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49702. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49703. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49704. i) {
  49705. var o = t(e.textures)
  49706. , a = t(e.images);
  49707. o.length > 0 && (r.textures = o),
  49708. a.length > 0 && (r.images = a)
  49709. }
  49710. return r
  49711. },
  49712. clone: function() {
  49713. return (new this.constructor).copy(this)
  49714. },
  49715. copy: function(e) {
  49716. return this.name = e.name,
  49717. this.side = e.side,
  49718. this.opacity = e.opacity,
  49719. this.transparent = e.transparent,
  49720. this.blending = e.blending,
  49721. this.blendSrc = e.blendSrc,
  49722. this.blendDst = e.blendDst,
  49723. this.blendEquation = e.blendEquation,
  49724. this.blendSrcAlpha = e.blendSrcAlpha,
  49725. this.blendDstAlpha = e.blendDstAlpha,
  49726. this.blendEquationAlpha = e.blendEquationAlpha,
  49727. this.depthFunc = e.depthFunc,
  49728. this.depthTest = e.depthTest,
  49729. this.depthWrite = e.depthWrite,
  49730. this.colorWrite = e.colorWrite,
  49731. this.precision = e.precision,
  49732. this.polygonOffset = e.polygonOffset,
  49733. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49734. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49735. this.alphaTest = e.alphaTest,
  49736. this.premultipliedAlpha = e.premultipliedAlpha,
  49737. this.overdraw = e.overdraw,
  49738. this.visible = e.visible,
  49739. this
  49740. },
  49741. update: function() {
  49742. this.dispatchEvent({
  49743. type: "update"
  49744. })
  49745. },
  49746. dispose: function() {
  49747. this.dispatchEvent({
  49748. type: "dispose"
  49749. })
  49750. }
  49751. },
  49752. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49753. n.MaterialIdCount = 0,
  49754. n.LineBasicMaterial = function(e) {
  49755. n.Material.call(this),
  49756. this.type = "LineBasicMaterial",
  49757. this.color = new n.Color(16777215),
  49758. this.linewidth = 1,
  49759. this.linecap = "round",
  49760. this.linejoin = "round",
  49761. this.blending = n.NormalBlending,
  49762. this.vertexColors = n.NoColors,
  49763. this.fog = !0,
  49764. this.setValues(e)
  49765. }
  49766. ,
  49767. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49768. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49769. n.LineBasicMaterial.prototype.copy = function(e) {
  49770. return n.Material.prototype.copy.call(this, e),
  49771. this.color.copy(e.color),
  49772. this.linewidth = e.linewidth,
  49773. this.linecap = e.linecap,
  49774. this.linejoin = e.linejoin,
  49775. this.vertexColors = e.vertexColors,
  49776. this.fog = e.fog,
  49777. this
  49778. }
  49779. ,
  49780. n.LineDashedMaterial = function(e) {
  49781. n.Material.call(this),
  49782. this.type = "LineDashedMaterial",
  49783. this.color = new n.Color(16777215),
  49784. this.linewidth = 1,
  49785. this.scale = 1,
  49786. this.dashSize = 3,
  49787. this.gapSize = 1,
  49788. this.blending = n.NormalBlending,
  49789. this.vertexColors = n.NoColors,
  49790. this.fog = !0,
  49791. this.setValues(e)
  49792. }
  49793. ,
  49794. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49795. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49796. n.LineDashedMaterial.prototype.copy = function(e) {
  49797. return n.Material.prototype.copy.call(this, e),
  49798. this.color.copy(e.color),
  49799. this.linewidth = e.linewidth,
  49800. this.scale = e.scale,
  49801. this.dashSize = e.dashSize,
  49802. this.gapSize = e.gapSize,
  49803. this.vertexColors = e.vertexColors,
  49804. this.fog = e.fog,
  49805. this
  49806. }
  49807. ,
  49808. n.MeshBasicMaterial = function(e) {
  49809. n.Material.call(this),
  49810. this.type = "MeshBasicMaterial",
  49811. this.color = new n.Color(16777215),
  49812. this.map = null,
  49813. this.aoMap = null,
  49814. this.aoMapIntensity = 1,
  49815. this.specularMap = null,
  49816. this.alphaMap = null,
  49817. this.envMap = null,
  49818. this.combine = n.MultiplyOperation,
  49819. this.reflectivity = 1,
  49820. this.refractionRatio = .98,
  49821. this.fog = !0,
  49822. this.shading = n.SmoothShading,
  49823. this.blending = n.NormalBlending,
  49824. this.wireframe = !1,
  49825. this.wireframeLinewidth = 1,
  49826. this.wireframeLinecap = "round",
  49827. this.wireframeLinejoin = "round",
  49828. this.vertexColors = n.NoColors,
  49829. this.skinning = !1,
  49830. this.morphTargets = !1,
  49831. this.setValues(e)
  49832. }
  49833. ,
  49834. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49835. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49836. n.MeshBasicMaterial.prototype.copy = function(e) {
  49837. return n.Material.prototype.copy.call(this, e),
  49838. this.color.copy(e.color),
  49839. this.map = e.map,
  49840. this.aoMap = e.aoMap,
  49841. this.aoMapIntensity = e.aoMapIntensity,
  49842. this.specularMap = e.specularMap,
  49843. this.alphaMap = e.alphaMap,
  49844. this.envMap = e.envMap,
  49845. this.combine = e.combine,
  49846. this.reflectivity = e.reflectivity,
  49847. this.refractionRatio = e.refractionRatio,
  49848. this.fog = e.fog,
  49849. this.shading = e.shading,
  49850. this.wireframe = e.wireframe,
  49851. this.wireframeLinewidth = e.wireframeLinewidth,
  49852. this.wireframeLinecap = e.wireframeLinecap,
  49853. this.wireframeLinejoin = e.wireframeLinejoin,
  49854. this.vertexColors = e.vertexColors,
  49855. this.skinning = e.skinning,
  49856. this.morphTargets = e.morphTargets,
  49857. this
  49858. }
  49859. ,
  49860. n.MeshLambertMaterial = function(e) {
  49861. n.Material.call(this),
  49862. this.type = "MeshLambertMaterial",
  49863. this.color = new n.Color(16777215),
  49864. this.map = null,
  49865. this.lightMap = null,
  49866. this.lightMapIntensity = 1,
  49867. this.aoMap = null,
  49868. this.aoMapIntensity = 1,
  49869. this.emissive = new n.Color(0),
  49870. this.emissiveIntensity = 1,
  49871. this.emissiveMap = null,
  49872. this.specularMap = null,
  49873. this.alphaMap = null,
  49874. this.envMap = null,
  49875. this.combine = n.MultiplyOperation,
  49876. this.reflectivity = 1,
  49877. this.refractionRatio = .98,
  49878. this.fog = !0,
  49879. this.blending = n.NormalBlending,
  49880. this.wireframe = !1,
  49881. this.wireframeLinewidth = 1,
  49882. this.wireframeLinecap = "round",
  49883. this.wireframeLinejoin = "round",
  49884. this.vertexColors = n.NoColors,
  49885. this.skinning = !1,
  49886. this.morphTargets = !1,
  49887. this.morphNormals = !1,
  49888. this.setValues(e)
  49889. }
  49890. ,
  49891. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49892. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49893. n.MeshLambertMaterial.prototype.copy = function(e) {
  49894. return n.Material.prototype.copy.call(this, e),
  49895. this.color.copy(e.color),
  49896. this.map = e.map,
  49897. this.lightMap = e.lightMap,
  49898. this.lightMapIntensity = e.lightMapIntensity,
  49899. this.aoMap = e.aoMap,
  49900. this.aoMapIntensity = e.aoMapIntensity,
  49901. this.emissive.copy(e.emissive),
  49902. this.emissiveMap = e.emissiveMap,
  49903. this.emissiveIntensity = e.emissiveIntensity,
  49904. this.specularMap = e.specularMap,
  49905. this.alphaMap = e.alphaMap,
  49906. this.envMap = e.envMap,
  49907. this.combine = e.combine,
  49908. this.reflectivity = e.reflectivity,
  49909. this.refractionRatio = e.refractionRatio,
  49910. this.fog = e.fog,
  49911. this.wireframe = e.wireframe,
  49912. this.wireframeLinewidth = e.wireframeLinewidth,
  49913. this.wireframeLinecap = e.wireframeLinecap,
  49914. this.wireframeLinejoin = e.wireframeLinejoin,
  49915. this.vertexColors = e.vertexColors,
  49916. this.skinning = e.skinning,
  49917. this.morphTargets = e.morphTargets,
  49918. this.morphNormals = e.morphNormals,
  49919. this
  49920. }
  49921. ,
  49922. n.MeshPhongMaterial = function(e) {
  49923. n.Material.call(this),
  49924. this.type = "MeshPhongMaterial",
  49925. this.color = new n.Color(16777215),
  49926. this.specular = new n.Color(1118481),
  49927. this.shininess = 30,
  49928. this.map = null,
  49929. this.lightMap = null,
  49930. this.lightMapIntensity = 1,
  49931. this.aoMap = null,
  49932. this.aoMapIntensity = 1,
  49933. this.emissive = new n.Color(0),
  49934. this.emissiveIntensity = 1,
  49935. this.emissiveMap = null,
  49936. this.bumpMap = null,
  49937. this.bumpScale = 1,
  49938. this.normalMap = null,
  49939. this.normalScale = new n.Vector2(1,1),
  49940. this.displacementMap = null,
  49941. this.displacementScale = 1,
  49942. this.displacementBias = 0,
  49943. this.specularMap = null,
  49944. this.alphaMap = null,
  49945. this.envMap = null,
  49946. this.combine = n.MultiplyOperation,
  49947. this.reflectivity = 1,
  49948. this.refractionRatio = .98,
  49949. this.fog = !0,
  49950. this.shading = n.SmoothShading,
  49951. this.blending = n.NormalBlending,
  49952. this.wireframe = !1,
  49953. this.wireframeLinewidth = 1,
  49954. this.wireframeLinecap = "round",
  49955. this.wireframeLinejoin = "round",
  49956. this.vertexColors = n.NoColors,
  49957. this.skinning = !1,
  49958. this.morphTargets = !1,
  49959. this.morphNormals = !1,
  49960. this.setValues(e)
  49961. }
  49962. ,
  49963. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49964. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49965. n.MeshPhongMaterial.prototype.copy = function(e) {
  49966. return n.Material.prototype.copy.call(this, e),
  49967. this.color.copy(e.color),
  49968. this.specular.copy(e.specular),
  49969. this.shininess = e.shininess,
  49970. this.map = e.map,
  49971. this.lightMap = e.lightMap,
  49972. this.lightMapIntensity = e.lightMapIntensity,
  49973. this.aoMap = e.aoMap,
  49974. this.aoMapIntensity = e.aoMapIntensity,
  49975. this.emissive.copy(e.emissive),
  49976. this.emissiveMap = e.emissiveMap,
  49977. this.emissiveIntensity = e.emissiveIntensity,
  49978. this.bumpMap = e.bumpMap,
  49979. this.bumpScale = e.bumpScale,
  49980. this.normalMap = e.normalMap,
  49981. this.normalScale.copy(e.normalScale),
  49982. this.displacementMap = e.displacementMap,
  49983. this.displacementScale = e.displacementScale,
  49984. this.displacementBias = e.displacementBias,
  49985. this.specularMap = e.specularMap,
  49986. this.alphaMap = e.alphaMap,
  49987. this.envMap = e.envMap,
  49988. this.combine = e.combine,
  49989. this.reflectivity = e.reflectivity,
  49990. this.refractionRatio = e.refractionRatio,
  49991. this.fog = e.fog,
  49992. this.shading = e.shading,
  49993. this.wireframe = e.wireframe,
  49994. this.wireframeLinewidth = e.wireframeLinewidth,
  49995. this.wireframeLinecap = e.wireframeLinecap,
  49996. this.wireframeLinejoin = e.wireframeLinejoin,
  49997. this.vertexColors = e.vertexColors,
  49998. this.skinning = e.skinning,
  49999. this.morphTargets = e.morphTargets,
  50000. this.morphNormals = e.morphNormals,
  50001. this
  50002. }
  50003. ,
  50004. n.MeshStandardMaterial = function(e) {
  50005. n.Material.call(this),
  50006. this.type = "MeshStandardMaterial",
  50007. this.color = new n.Color(16777215),
  50008. this.roughness = .5,
  50009. this.metalness = .5,
  50010. this.map = null,
  50011. this.lightMap = null,
  50012. this.lightMapIntensity = 1,
  50013. this.aoMap = null,
  50014. this.aoMapIntensity = 1,
  50015. this.emissive = new n.Color(0),
  50016. this.emissiveIntensity = 1,
  50017. this.emissiveMap = null,
  50018. this.bumpMap = null,
  50019. this.bumpScale = 1,
  50020. this.normalMap = null,
  50021. this.normalScale = new n.Vector2(1,1),
  50022. this.displacementMap = null,
  50023. this.displacementScale = 1,
  50024. this.displacementBias = 0,
  50025. this.roughnessMap = null,
  50026. this.metalnessMap = null,
  50027. this.alphaMap = null,
  50028. this.envMap = null,
  50029. this.envMapIntensity = 1,
  50030. this.refractionRatio = .98,
  50031. this.fog = !0,
  50032. this.shading = n.SmoothShading,
  50033. this.blending = n.NormalBlending,
  50034. this.wireframe = !1,
  50035. this.wireframeLinewidth = 1,
  50036. this.wireframeLinecap = "round",
  50037. this.wireframeLinejoin = "round",
  50038. this.vertexColors = n.NoColors,
  50039. this.skinning = !1,
  50040. this.morphTargets = !1,
  50041. this.morphNormals = !1,
  50042. this.setValues(e)
  50043. }
  50044. ,
  50045. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  50046. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  50047. n.MeshStandardMaterial.prototype.copy = function(e) {
  50048. return n.Material.prototype.copy.call(this, e),
  50049. this.color.copy(e.color),
  50050. this.roughness = e.roughness,
  50051. this.metalness = e.metalness,
  50052. this.map = e.map,
  50053. this.lightMap = e.lightMap,
  50054. this.lightMapIntensity = e.lightMapIntensity,
  50055. this.aoMap = e.aoMap,
  50056. this.aoMapIntensity = e.aoMapIntensity,
  50057. this.emissive.copy(e.emissive),
  50058. this.emissiveMap = e.emissiveMap,
  50059. this.emissiveIntensity = e.emissiveIntensity,
  50060. this.bumpMap = e.bumpMap,
  50061. this.bumpScale = e.bumpScale,
  50062. this.normalMap = e.normalMap,
  50063. this.normalScale.copy(e.normalScale),
  50064. this.displacementMap = e.displacementMap,
  50065. this.displacementScale = e.displacementScale,
  50066. this.displacementBias = e.displacementBias,
  50067. this.roughnessMap = e.roughnessMap,
  50068. this.metalnessMap = e.metalnessMap,
  50069. this.alphaMap = e.alphaMap,
  50070. this.envMap = e.envMap,
  50071. this.envMapIntensity = e.envMapIntensity,
  50072. this.refractionRatio = e.refractionRatio,
  50073. this.fog = e.fog,
  50074. this.shading = e.shading,
  50075. this.wireframe = e.wireframe,
  50076. this.wireframeLinewidth = e.wireframeLinewidth,
  50077. this.wireframeLinecap = e.wireframeLinecap,
  50078. this.wireframeLinejoin = e.wireframeLinejoin,
  50079. this.vertexColors = e.vertexColors,
  50080. this.skinning = e.skinning,
  50081. this.morphTargets = e.morphTargets,
  50082. this.morphNormals = e.morphNormals,
  50083. this
  50084. }
  50085. ,
  50086. n.MeshDepthMaterial = function(e) {
  50087. n.Material.call(this),
  50088. this.type = "MeshDepthMaterial",
  50089. this.morphTargets = !1,
  50090. this.wireframe = !1,
  50091. this.wireframeLinewidth = 1,
  50092. this.setValues(e)
  50093. }
  50094. ,
  50095. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  50096. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  50097. n.MeshDepthMaterial.prototype.copy = function(e) {
  50098. return n.Material.prototype.copy.call(this, e),
  50099. this.wireframe = e.wireframe,
  50100. this.wireframeLinewidth = e.wireframeLinewidth,
  50101. this
  50102. }
  50103. ,
  50104. n.MeshNormalMaterial = function(e) {
  50105. n.Material.call(this, e),
  50106. this.type = "MeshNormalMaterial",
  50107. this.wireframe = !1,
  50108. this.wireframeLinewidth = 1,
  50109. this.morphTargets = !1,
  50110. this.setValues(e)
  50111. }
  50112. ,
  50113. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  50114. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  50115. n.MeshNormalMaterial.prototype.copy = function(e) {
  50116. return n.Material.prototype.copy.call(this, e),
  50117. this.wireframe = e.wireframe,
  50118. this.wireframeLinewidth = e.wireframeLinewidth,
  50119. this
  50120. }
  50121. ,
  50122. n.MultiMaterial = function(e) {
  50123. this.uuid = n.Math.generateUUID(),
  50124. this.type = "MultiMaterial",
  50125. this.materials = e instanceof Array ? e : [],
  50126. this.visible = !0
  50127. }
  50128. ,
  50129. n.MultiMaterial.prototype = {
  50130. constructor: n.MultiMaterial,
  50131. toJSON: function(e) {
  50132. for (var t = {
  50133. metadata: {
  50134. version: 4.2,
  50135. type: "material",
  50136. generator: "MaterialExporter"
  50137. },
  50138. uuid: this.uuid,
  50139. type: this.type,
  50140. materials: []
  50141. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  50142. var o = i[n].toJSON(e);
  50143. delete o.metadata,
  50144. t.materials.push(o)
  50145. }
  50146. return t.visible = this.visible,
  50147. t
  50148. },
  50149. clone: function() {
  50150. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  50151. e.materials.push(this.materials[t].clone());
  50152. return e.visible = this.visible,
  50153. e
  50154. }
  50155. },
  50156. n.PointsMaterial = function(e) {
  50157. n.Material.call(this),
  50158. this.type = "PointsMaterial",
  50159. this.color = new n.Color(16777215),
  50160. this.map = null,
  50161. this.size = 1,
  50162. this.sizeAttenuation = !0,
  50163. this.blending = n.NormalBlending,
  50164. this.vertexColors = n.NoColors,
  50165. this.fog = !0,
  50166. this.setValues(e)
  50167. }
  50168. ,
  50169. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  50170. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  50171. n.PointsMaterial.prototype.copy = function(e) {
  50172. return n.Material.prototype.copy.call(this, e),
  50173. this.color.copy(e.color),
  50174. this.map = e.map,
  50175. this.size = e.size,
  50176. this.sizeAttenuation = e.sizeAttenuation,
  50177. this.vertexColors = e.vertexColors,
  50178. this.fog = e.fog,
  50179. this
  50180. }
  50181. ,
  50182. n.ShaderMaterial = function(e) {
  50183. n.Material.call(this),
  50184. this.type = "ShaderMaterial",
  50185. this.defines = {},
  50186. this.uniforms = {},
  50187. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  50188. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  50189. this.shading = n.SmoothShading,
  50190. this.linewidth = 1,
  50191. this.wireframe = !1,
  50192. this.wireframeLinewidth = 1,
  50193. this.fog = !1,
  50194. this.lights = !1,
  50195. this.vertexColors = n.NoColors,
  50196. this.skinning = !1,
  50197. this.morphTargets = !1,
  50198. this.morphNormals = !1,
  50199. this.extensions = {
  50200. derivatives: !1,
  50201. fragDepth: !1,
  50202. drawBuffers: !1,
  50203. shaderTextureLOD: !1
  50204. },
  50205. this.defaultAttributeValues = {
  50206. color: [1, 1, 1],
  50207. uv: [0, 0],
  50208. uv2: [0, 0]
  50209. },
  50210. this.index0AttributeName = void 0,
  50211. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  50212. this.setValues(e))
  50213. }
  50214. ,
  50215. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  50216. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  50217. n.ShaderMaterial.prototype.copy = function(e) {
  50218. return n.Material.prototype.copy.call(this, e),
  50219. this.fragmentShader = e.fragmentShader,
  50220. this.vertexShader = e.vertexShader,
  50221. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  50222. this.defines = e.defines,
  50223. this.shading = e.shading,
  50224. this.wireframe = e.wireframe,
  50225. this.wireframeLinewidth = e.wireframeLinewidth,
  50226. this.fog = e.fog,
  50227. this.lights = e.lights,
  50228. this.vertexColors = e.vertexColors,
  50229. this.skinning = e.skinning,
  50230. this.morphTargets = e.morphTargets,
  50231. this.morphNormals = e.morphNormals,
  50232. this.extensions = e.extensions,
  50233. this
  50234. }
  50235. ,
  50236. n.ShaderMaterial.prototype.toJSON = function(e) {
  50237. var t = n.Material.prototype.toJSON.call(this, e);
  50238. return t.uniforms = this.uniforms,
  50239. t.vertexShader = this.vertexShader,
  50240. t.fragmentShader = this.fragmentShader,
  50241. t
  50242. }
  50243. ,
  50244. n.RawShaderMaterial = function(e) {
  50245. n.ShaderMaterial.call(this, e),
  50246. this.type = "RawShaderMaterial"
  50247. }
  50248. ,
  50249. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  50250. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  50251. n.SpriteMaterial = function(e) {
  50252. n.Material.call(this),
  50253. this.type = "SpriteMaterial",
  50254. this.color = new n.Color(16777215),
  50255. this.map = null,
  50256. this.rotation = 0,
  50257. this.fog = !1,
  50258. this.setValues(e)
  50259. }
  50260. ,
  50261. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  50262. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  50263. n.SpriteMaterial.prototype.copy = function(e) {
  50264. return n.Material.prototype.copy.call(this, e),
  50265. this.color.copy(e.color),
  50266. this.map = e.map,
  50267. this.rotation = e.rotation,
  50268. this.fog = e.fog,
  50269. this
  50270. }
  50271. ,
  50272. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  50273. Object.defineProperty(this, "id", {
  50274. value: n.TextureIdCount++
  50275. }),
  50276. this.uuid = n.Math.generateUUID(),
  50277. this.name = "",
  50278. this.sourceFile = "",
  50279. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  50280. this.mipmaps = [],
  50281. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  50282. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  50283. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  50284. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  50285. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  50286. this.anisotropy = void 0 !== c ? c : 1,
  50287. this.format = void 0 !== s ? s : n.RGBAFormat,
  50288. this.type = void 0 !== l ? l : n.UnsignedByteType,
  50289. this.offset = new n.Vector2(0,0),
  50290. this.repeat = new n.Vector2(1,1),
  50291. this.generateMipmaps = !0,
  50292. this.premultiplyAlpha = !1,
  50293. this.flipY = !0,
  50294. this.unpackAlignment = 4,
  50295. this.encoding = n.LinearEncoding,
  50296. this.version = 0,
  50297. this.onUpdate = null
  50298. }
  50299. ,
  50300. n.Texture.DEFAULT_IMAGE = void 0,
  50301. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  50302. n.Texture.prototype = {
  50303. constructor: n.Texture,
  50304. set needsUpdate(e) {
  50305. e === !0 && this.version++
  50306. },
  50307. clone: function() {
  50308. return (new this.constructor).copy(this)
  50309. },
  50310. copy: function(e) {
  50311. return this.image = e.image,
  50312. this.mipmaps = e.mipmaps.slice(0),
  50313. this.mapping = e.mapping,
  50314. this.wrapS = e.wrapS,
  50315. this.wrapT = e.wrapT,
  50316. this.magFilter = e.magFilter,
  50317. this.minFilter = e.minFilter,
  50318. this.anisotropy = e.anisotropy,
  50319. this.format = e.format,
  50320. this.type = e.type,
  50321. this.offset.copy(e.offset),
  50322. this.repeat.copy(e.repeat),
  50323. this.generateMipmaps = e.generateMipmaps,
  50324. this.premultiplyAlpha = e.premultiplyAlpha,
  50325. this.flipY = e.flipY,
  50326. this.unpackAlignment = e.unpackAlignment,
  50327. this.encoding = e.encoding,
  50328. this
  50329. },
  50330. toJSON: function(e) {
  50331. function t(e) {
  50332. var t;
  50333. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  50334. t.width = e.width,
  50335. t.height = e.height,
  50336. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  50337. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  50338. }
  50339. if (void 0 !== e.textures[this.uuid])
  50340. return e.textures[this.uuid];
  50341. var i = {
  50342. metadata: {
  50343. version: 4.4,
  50344. type: "Texture",
  50345. generator: "Texture.toJSON"
  50346. },
  50347. uuid: this.uuid,
  50348. name: this.name,
  50349. mapping: this.mapping,
  50350. repeat: [this.repeat.x, this.repeat.y],
  50351. offset: [this.offset.x, this.offset.y],
  50352. wrap: [this.wrapS, this.wrapT],
  50353. minFilter: this.minFilter,
  50354. magFilter: this.magFilter,
  50355. anisotropy: this.anisotropy
  50356. };
  50357. if (void 0 !== this.image) {
  50358. var r = this.image;
  50359. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  50360. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  50361. uuid: r.uuid,
  50362. url: t(r)
  50363. }),
  50364. i.image = r.uuid
  50365. }
  50366. return e.textures[this.uuid] = i,
  50367. i
  50368. },
  50369. dispose: function() {
  50370. this.dispatchEvent({
  50371. type: "dispose"
  50372. })
  50373. },
  50374. transformUv: function(e) {
  50375. if (this.mapping === n.UVMapping) {
  50376. if (e.multiply(this.repeat),
  50377. e.add(this.offset),
  50378. e.x < 0 || e.x > 1)
  50379. switch (this.wrapS) {
  50380. case n.RepeatWrapping:
  50381. e.x = e.x - Math.floor(e.x);
  50382. break;
  50383. case n.ClampToEdgeWrapping:
  50384. e.x = e.x < 0 ? 0 : 1;
  50385. break;
  50386. case n.MirroredRepeatWrapping:
  50387. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  50388. }
  50389. if (e.y < 0 || e.y > 1)
  50390. switch (this.wrapT) {
  50391. case n.RepeatWrapping:
  50392. e.y = e.y - Math.floor(e.y);
  50393. break;
  50394. case n.ClampToEdgeWrapping:
  50395. e.y = e.y < 0 ? 0 : 1;
  50396. break;
  50397. case n.MirroredRepeatWrapping:
  50398. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  50399. }
  50400. this.flipY && (e.y = 1 - e.y)
  50401. }
  50402. }
  50403. },
  50404. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  50405. n.TextureIdCount = 0,
  50406. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  50407. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50408. this.needsUpdate = !0
  50409. }
  50410. ,
  50411. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  50412. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  50413. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  50414. e = void 0 !== e ? e : [],
  50415. t = void 0 !== t ? t : n.CubeReflectionMapping,
  50416. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50417. this.flipY = !1
  50418. }
  50419. ,
  50420. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  50421. n.CubeTexture.prototype.constructor = n.CubeTexture,
  50422. Object.defineProperty(n.CubeTexture.prototype, "images", {
  50423. get: function() {
  50424. return this.image
  50425. },
  50426. set: function(e) {
  50427. this.image = e
  50428. }
  50429. }),
  50430. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50431. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50432. this.image = {
  50433. width: t,
  50434. height: i
  50435. },
  50436. this.mipmaps = e,
  50437. this.flipY = !1,
  50438. this.generateMipmaps = !1
  50439. }
  50440. ,
  50441. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  50442. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  50443. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50444. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50445. this.image = {
  50446. data: e,
  50447. width: t,
  50448. height: i
  50449. },
  50450. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  50451. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  50452. this.flipY = !1,
  50453. this.generateMipmaps = !1
  50454. }
  50455. ,
  50456. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  50457. n.DataTexture.prototype.constructor = n.DataTexture,
  50458. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  50459. function h() {
  50460. requestAnimationFrame(h),
  50461. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  50462. }
  50463. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50464. this.generateMipmaps = !1;
  50465. var u = this;
  50466. h()
  50467. }
  50468. ,
  50469. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  50470. n.VideoTexture.prototype.constructor = n.VideoTexture,
  50471. n.Group = function() {
  50472. n.Object3D.call(this),
  50473. this.type = "Group"
  50474. }
  50475. ,
  50476. n.Group.prototype = Object.create(n.Object3D.prototype),
  50477. n.Group.prototype.constructor = n.Group,
  50478. n.Points = function(e, t) {
  50479. n.Object3D.call(this),
  50480. this.type = "Points",
  50481. this.geometry = void 0 !== e ? e : new n.Geometry,
  50482. this.material = void 0 !== t ? t : new n.PointsMaterial({
  50483. color: 16777215 * Math.random()
  50484. })
  50485. }
  50486. ,
  50487. n.Points.prototype = Object.create(n.Object3D.prototype),
  50488. n.Points.prototype.constructor = n.Points,
  50489. n.Points.prototype.raycast = function() {
  50490. var e = new n.Matrix4
  50491. , t = new n.Ray
  50492. , i = new n.Sphere;
  50493. return function(r, o) {
  50494. function a(e, i) {
  50495. var n = t.distanceSqToPoint(e);
  50496. if (n < d) {
  50497. var a = t.closestPointToPoint(e);
  50498. a.applyMatrix4(c);
  50499. var l = r.ray.origin.distanceTo(a);
  50500. if (l < r.near || l > r.far)
  50501. return;
  50502. o.push({
  50503. distance: l,
  50504. distanceToRay: Math.sqrt(n),
  50505. point: a.clone(),
  50506. index: i,
  50507. face: null,
  50508. object: s
  50509. })
  50510. }
  50511. }
  50512. var s = this
  50513. , l = this.geometry
  50514. , c = this.matrixWorld
  50515. , h = r.params.Points.threshold;
  50516. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50517. i.copy(l.boundingSphere),
  50518. i.applyMatrix4(c),
  50519. r.ray.intersectsSphere(i) !== !1) {
  50520. e.getInverse(c),
  50521. t.copy(r.ray).applyMatrix4(e);
  50522. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  50523. , d = u * u
  50524. , p = new n.Vector3;
  50525. if (l instanceof n.BufferGeometry) {
  50526. var f = l.index
  50527. , g = l.attributes
  50528. , m = g.position.array;
  50529. if (null !== f)
  50530. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  50531. var C = v[A];
  50532. p.fromArray(m, 3 * C),
  50533. a(p, C)
  50534. }
  50535. else
  50536. for (var A = 0, I = m.length / 3; A < I; A++)
  50537. p.fromArray(m, 3 * A),
  50538. a(p, A)
  50539. } else
  50540. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  50541. a(E[A], A)
  50542. }
  50543. }
  50544. }(),
  50545. n.Points.prototype.clone = function() {
  50546. return new this.constructor(this.geometry,this.material).copy(this)
  50547. }
  50548. ,
  50549. n.Line = function(e, t, i) {
  50550. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  50551. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  50552. this.type = "Line",
  50553. this.geometry = void 0 !== e ? e : new n.Geometry,
  50554. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  50555. color: 16777215 * Math.random()
  50556. })))
  50557. }
  50558. ,
  50559. n.Line.prototype = Object.create(n.Object3D.prototype),
  50560. n.Line.prototype.constructor = n.Line,
  50561. n.Line.prototype.raycast = function() {
  50562. var e = new n.Matrix4
  50563. , t = new n.Ray
  50564. , i = new n.Sphere;
  50565. return function(r, o) {
  50566. var a = r.linePrecision
  50567. , s = a * a
  50568. , l = this.geometry
  50569. , c = this.matrixWorld;
  50570. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50571. i.copy(l.boundingSphere),
  50572. i.applyMatrix4(c),
  50573. r.ray.intersectsSphere(i) !== !1) {
  50574. e.getInverse(c),
  50575. t.copy(r.ray).applyMatrix4(e);
  50576. var h = new n.Vector3
  50577. , u = new n.Vector3
  50578. , d = new n.Vector3
  50579. , p = new n.Vector3
  50580. , f = this instanceof n.LineSegments ? 2 : 1;
  50581. if (l instanceof n.BufferGeometry) {
  50582. var g = l.index
  50583. , m = l.attributes
  50584. , v = m.position.array;
  50585. if (null !== g)
  50586. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  50587. var I = A[y]
  50588. , E = A[y + 1];
  50589. h.fromArray(v, 3 * I),
  50590. u.fromArray(v, 3 * E);
  50591. var b = t.distanceSqToSegment(h, u, p, d);
  50592. if (!(b > s)) {
  50593. p.applyMatrix4(this.matrixWorld);
  50594. var w = r.ray.origin.distanceTo(p);
  50595. w < r.near || w > r.far || o.push({
  50596. distance: w,
  50597. point: d.clone().applyMatrix4(this.matrixWorld),
  50598. index: y,
  50599. face: null,
  50600. faceIndex: null,
  50601. object: this
  50602. })
  50603. }
  50604. }
  50605. else
  50606. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  50607. h.fromArray(v, 3 * y),
  50608. u.fromArray(v, 3 * y + 3);
  50609. var b = t.distanceSqToSegment(h, u, p, d);
  50610. if (!(b > s)) {
  50611. p.applyMatrix4(this.matrixWorld);
  50612. var w = r.ray.origin.distanceTo(p);
  50613. w < r.near || w > r.far || o.push({
  50614. distance: w,
  50615. point: d.clone().applyMatrix4(this.matrixWorld),
  50616. index: y,
  50617. face: null,
  50618. faceIndex: null,
  50619. object: this
  50620. })
  50621. }
  50622. }
  50623. } else if (l instanceof n.Geometry)
  50624. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  50625. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  50626. if (!(b > s)) {
  50627. p.applyMatrix4(this.matrixWorld);
  50628. var w = r.ray.origin.distanceTo(p);
  50629. w < r.near || w > r.far || o.push({
  50630. distance: w,
  50631. point: d.clone().applyMatrix4(this.matrixWorld),
  50632. index: y,
  50633. face: null,
  50634. faceIndex: null,
  50635. object: this
  50636. })
  50637. }
  50638. }
  50639. }
  50640. }
  50641. }(),
  50642. n.Line.prototype.clone = function() {
  50643. return new this.constructor(this.geometry,this.material).copy(this)
  50644. }
  50645. ,
  50646. n.LineStrip = 0,
  50647. n.LinePieces = 1,
  50648. n.LineSegments = function(e, t) {
  50649. n.Line.call(this, e, t),
  50650. this.type = "LineSegments"
  50651. }
  50652. ,
  50653. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50654. n.LineSegments.prototype.constructor = n.LineSegments,
  50655. n.Mesh = function(e, t) {
  50656. n.Object3D.call(this),
  50657. this.type = "Mesh",
  50658. this.geometry = void 0 !== e ? e : new n.Geometry,
  50659. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50660. color: 16777215 * Math.random()
  50661. }),
  50662. this.drawMode = n.TrianglesDrawMode,
  50663. this.updateMorphTargets()
  50664. }
  50665. ,
  50666. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50667. n.Mesh.prototype.constructor = n.Mesh,
  50668. n.Mesh.prototype.setDrawMode = function(e) {
  50669. this.drawMode = e
  50670. }
  50671. ,
  50672. n.Mesh.prototype.updateMorphTargets = function() {
  50673. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50674. this.morphTargetBase = -1,
  50675. this.morphTargetInfluences = [],
  50676. this.morphTargetDictionary = {};
  50677. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50678. this.morphTargetInfluences.push(0),
  50679. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50680. }
  50681. }
  50682. ,
  50683. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50684. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50685. 0)
  50686. }
  50687. ,
  50688. n.Mesh.prototype.raycast = function() {
  50689. function e(e, t, i, r, o, a, s) {
  50690. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50691. o.multiplyScalar(m.x),
  50692. a.multiplyScalar(m.y),
  50693. s.multiplyScalar(m.z),
  50694. o.add(a).add(s),
  50695. o.clone()
  50696. }
  50697. function t(e, t, i, r, o, a, s) {
  50698. var l, c = e.material;
  50699. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50700. null === l)
  50701. return null;
  50702. A.copy(s),
  50703. A.applyMatrix4(e.matrixWorld);
  50704. var h = t.ray.origin.distanceTo(A);
  50705. return h < t.near || h > t.far ? null : {
  50706. distance: h,
  50707. point: A.clone(),
  50708. object: e
  50709. }
  50710. }
  50711. function i(i, r, o, a, h, u, d, m) {
  50712. s.fromArray(a, 3 * u),
  50713. l.fromArray(a, 3 * d),
  50714. c.fromArray(a, 3 * m);
  50715. var A = t(i, r, o, s, l, c, v);
  50716. return A && (h && (p.fromArray(h, 2 * u),
  50717. f.fromArray(h, 2 * d),
  50718. g.fromArray(h, 2 * m),
  50719. A.uv = e(v, s, l, c, p, f, g)),
  50720. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50721. A.faceIndex = u),
  50722. A
  50723. }
  50724. var r = new n.Matrix4
  50725. , o = new n.Ray
  50726. , a = new n.Sphere
  50727. , s = new n.Vector3
  50728. , l = new n.Vector3
  50729. , c = new n.Vector3
  50730. , h = new n.Vector3
  50731. , u = new n.Vector3
  50732. , d = new n.Vector3
  50733. , p = new n.Vector2
  50734. , f = new n.Vector2
  50735. , g = new n.Vector2
  50736. , m = new n.Vector3
  50737. , v = new n.Vector3
  50738. , A = new n.Vector3;
  50739. return function(m, A) {
  50740. var y = this.geometry
  50741. , C = this.material
  50742. , I = this.matrixWorld;
  50743. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50744. a.copy(y.boundingSphere),
  50745. a.applyMatrix4(I),
  50746. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50747. o.copy(m.ray).applyMatrix4(r),
  50748. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50749. var E, b;
  50750. if (y instanceof n.BufferGeometry) {
  50751. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50752. if (void 0 !== S.uv && (E = S.uv.array),
  50753. null !== x)
  50754. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50755. w = R[P],
  50756. _ = R[P + 1],
  50757. T = R[P + 2],
  50758. b = i(this, m, o, M, E, w, _, T),
  50759. b && (b.faceIndex = Math.floor(P / 3),
  50760. A.push(b));
  50761. else
  50762. for (var P = 0, O = M.length; P < O; P += 9)
  50763. w = P / 3,
  50764. _ = w + 1,
  50765. T = w + 2,
  50766. b = i(this, m, o, M, E, w, _, T),
  50767. b && (b.index = w,
  50768. A.push(b))
  50769. } else if (y instanceof n.Geometry) {
  50770. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  50771. k.length > 0 && (E = k);
  50772. for (var H = 0, G = U.length; H < G; H++) {
  50773. var z = U[H]
  50774. , W = B === !0 ? F[z.materialIndex] : C;
  50775. if (void 0 !== W) {
  50776. if (L = V[z.a],
  50777. D = V[z.b],
  50778. N = V[z.c],
  50779. W.morphTargets === !0) {
  50780. var j = y.morphTargets
  50781. , Y = this.morphTargetInfluences;
  50782. s.set(0, 0, 0),
  50783. l.set(0, 0, 0),
  50784. c.set(0, 0, 0);
  50785. for (var X = 0, Z = j.length; X < Z; X++) {
  50786. var q = Y[X];
  50787. if (0 !== q) {
  50788. var K = j[X].vertices;
  50789. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50790. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50791. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50792. }
  50793. }
  50794. s.add(L),
  50795. l.add(D),
  50796. c.add(N),
  50797. L = s,
  50798. D = l,
  50799. N = c
  50800. }
  50801. if (b = t(this, m, o, L, D, N, v)) {
  50802. if (E) {
  50803. var Q = E[H];
  50804. p.copy(Q[0]),
  50805. f.copy(Q[1]),
  50806. g.copy(Q[2]),
  50807. b.uv = e(v, L, D, N, p, f, g)
  50808. }
  50809. b.face = z,
  50810. b.faceIndex = H,
  50811. A.push(b)
  50812. }
  50813. }
  50814. }
  50815. }
  50816. }
  50817. }
  50818. }(),
  50819. n.Mesh.prototype.clone = function() {
  50820. return new this.constructor(this.geometry,this.material).copy(this)
  50821. }
  50822. ,
  50823. n.Bone = function(e) {
  50824. n.Object3D.call(this),
  50825. this.type = "Bone",
  50826. this.skin = e
  50827. }
  50828. ,
  50829. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50830. n.Bone.prototype.constructor = n.Bone,
  50831. n.Bone.prototype.copy = function(e) {
  50832. return n.Object3D.prototype.copy.call(this, e),
  50833. this.skin = e.skin,
  50834. this
  50835. }
  50836. ,
  50837. n.Skeleton = function(e, t, i) {
  50838. if (this.useVertexTexture = void 0 === i || i,
  50839. this.identityMatrix = new n.Matrix4,
  50840. e = e || [],
  50841. this.bones = e.slice(0),
  50842. this.useVertexTexture) {
  50843. var r = Math.sqrt(4 * this.bones.length);
  50844. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50845. r = Math.max(r, 4),
  50846. this.boneTextureWidth = r,
  50847. this.boneTextureHeight = r,
  50848. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50849. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50850. } else
  50851. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50852. if (void 0 === t)
  50853. this.calculateInverses();
  50854. else if (this.bones.length === t.length)
  50855. this.boneInverses = t.slice(0);
  50856. else {
  50857. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50858. this.boneInverses = [];
  50859. for (var o = 0, a = this.bones.length; o < a; o++)
  50860. this.boneInverses.push(new n.Matrix4)
  50861. }
  50862. }
  50863. ,
  50864. n.Skeleton.prototype.calculateInverses = function() {
  50865. this.boneInverses = [];
  50866. for (var e = 0, t = this.bones.length; e < t; e++) {
  50867. var i = new n.Matrix4;
  50868. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50869. this.boneInverses.push(i)
  50870. }
  50871. }
  50872. ,
  50873. n.Skeleton.prototype.pose = function() {
  50874. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50875. e = this.bones[t],
  50876. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50877. for (var t = 0, i = this.bones.length; t < i; t++)
  50878. e = this.bones[t],
  50879. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50880. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50881. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50882. }
  50883. ,
  50884. n.Skeleton.prototype.update = function() {
  50885. var e = new n.Matrix4;
  50886. return function() {
  50887. for (var t = 0, i = this.bones.length; t < i; t++) {
  50888. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50889. e.multiplyMatrices(n, this.boneInverses[t]),
  50890. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50891. }
  50892. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50893. }
  50894. }(),
  50895. n.Skeleton.prototype.clone = function() {
  50896. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50897. }
  50898. ,
  50899. n.SkinnedMesh = function(e, t, i) {
  50900. n.Mesh.call(this, e, t),
  50901. this.type = "SkinnedMesh",
  50902. this.bindMode = "attached",
  50903. this.bindMatrix = new n.Matrix4,
  50904. this.bindMatrixInverse = new n.Matrix4;
  50905. var r = [];
  50906. if (this.geometry && void 0 !== this.geometry.bones) {
  50907. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50908. a = this.geometry.bones[s],
  50909. o = new n.Bone(this),
  50910. r.push(o),
  50911. o.name = a.name,
  50912. o.position.fromArray(a.pos),
  50913. o.quaternion.fromArray(a.rotq),
  50914. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50915. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50916. a = this.geometry.bones[s],
  50917. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50918. }
  50919. this.normalizeSkinWeights(),
  50920. this.updateMatrixWorld(!0),
  50921. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50922. }
  50923. ,
  50924. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50925. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50926. n.SkinnedMesh.prototype.bind = function(e, t) {
  50927. this.skeleton = e,
  50928. void 0 === t && (this.updateMatrixWorld(!0),
  50929. this.skeleton.calculateInverses(),
  50930. t = this.matrixWorld),
  50931. this.bindMatrix.copy(t),
  50932. this.bindMatrixInverse.getInverse(t)
  50933. }
  50934. ,
  50935. n.SkinnedMesh.prototype.pose = function() {
  50936. this.skeleton.pose()
  50937. }
  50938. ,
  50939. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50940. if (this.geometry instanceof n.Geometry)
  50941. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50942. var t = this.geometry.skinWeights[e]
  50943. , i = 1 / t.lengthManhattan();
  50944. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50945. }
  50946. else if (this.geometry instanceof n.BufferGeometry)
  50947. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50948. r.x = o.getX(e),
  50949. r.y = o.getY(e),
  50950. r.z = o.getZ(e),
  50951. r.w = o.getW(e);
  50952. var i = 1 / r.lengthManhattan();
  50953. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50954. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50955. }
  50956. }
  50957. ,
  50958. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50959. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50960. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50961. }
  50962. ,
  50963. n.SkinnedMesh.prototype.clone = function() {
  50964. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50965. }
  50966. ,
  50967. n.LOD = function() {
  50968. n.Object3D.call(this),
  50969. this.type = "LOD",
  50970. Object.defineProperties(this, {
  50971. levels: {
  50972. enumerable: !0,
  50973. value: []
  50974. },
  50975. objects: {
  50976. get: function() {
  50977. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50978. this.levels
  50979. }
  50980. }
  50981. })
  50982. }
  50983. ,
  50984. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50985. n.LOD.prototype.constructor = n.LOD,
  50986. n.LOD.prototype.addLevel = function(e, t) {
  50987. void 0 === t && (t = 0),
  50988. t = Math.abs(t);
  50989. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50990. ;
  50991. i.splice(n, 0, {
  50992. distance: t,
  50993. object: e
  50994. }),
  50995. this.add(e)
  50996. }
  50997. ,
  50998. n.LOD.prototype.getObjectForDistance = function(e) {
  50999. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  51000. ;
  51001. return t[i - 1].object
  51002. }
  51003. ,
  51004. n.LOD.prototype.raycast = function() {
  51005. var e = new n.Vector3;
  51006. return function(t, i) {
  51007. e.setFromMatrixPosition(this.matrixWorld);
  51008. var n = t.ray.origin.distanceTo(e);
  51009. this.getObjectForDistance(n).raycast(t, i)
  51010. }
  51011. }(),
  51012. n.LOD.prototype.update = function() {
  51013. var e = new n.Vector3
  51014. , t = new n.Vector3;
  51015. return function(i) {
  51016. var n = this.levels;
  51017. if (n.length > 1) {
  51018. e.setFromMatrixPosition(i.matrixWorld),
  51019. t.setFromMatrixPosition(this.matrixWorld);
  51020. var r = e.distanceTo(t);
  51021. n[0].object.visible = !0;
  51022. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  51023. n[o - 1].object.visible = !1,
  51024. n[o].object.visible = !0;
  51025. for (; o < a; o++)
  51026. n[o].object.visible = !1
  51027. }
  51028. }
  51029. }(),
  51030. n.LOD.prototype.copy = function(e) {
  51031. n.Object3D.prototype.copy.call(this, e, !1);
  51032. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  51033. var o = t[i];
  51034. this.addLevel(o.object.clone(), o.distance)
  51035. }
  51036. return this
  51037. }
  51038. ,
  51039. n.LOD.prototype.toJSON = function(e) {
  51040. var t = n.Object3D.prototype.toJSON.call(this, e);
  51041. t.object.levels = [];
  51042. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  51043. var a = i[r];
  51044. t.object.levels.push({
  51045. object: a.object.uuid,
  51046. distance: a.distance
  51047. })
  51048. }
  51049. return t
  51050. }
  51051. ,
  51052. n.Sprite = function() {
  51053. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  51054. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  51055. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  51056. , r = new n.BufferGeometry;
  51057. return r.setIndex(new n.BufferAttribute(e,1)),
  51058. r.addAttribute("position", new n.BufferAttribute(t,3)),
  51059. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  51060. function(e) {
  51061. n.Object3D.call(this),
  51062. this.type = "Sprite",
  51063. this.geometry = r,
  51064. this.material = void 0 !== e ? e : new n.SpriteMaterial
  51065. }
  51066. }(),
  51067. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  51068. n.Sprite.prototype.constructor = n.Sprite,
  51069. n.Sprite.prototype.raycast = function() {
  51070. var e = new n.Vector3;
  51071. return function(t, i) {
  51072. e.setFromMatrixPosition(this.matrixWorld);
  51073. var n = t.ray.distanceSqToPoint(e)
  51074. , r = this.scale.x * this.scale.y;
  51075. n > r || i.push({
  51076. distance: Math.sqrt(n),
  51077. point: this.position,
  51078. face: null,
  51079. object: this
  51080. })
  51081. }
  51082. }(),
  51083. n.Sprite.prototype.clone = function() {
  51084. return new this.constructor(this.material).copy(this)
  51085. }
  51086. ,
  51087. n.Particle = n.Sprite,
  51088. n.LensFlare = function(e, t, i, r, o) {
  51089. n.Object3D.call(this),
  51090. this.lensFlares = [],
  51091. this.positionScreen = new n.Vector3,
  51092. this.customUpdateCallback = void 0,
  51093. void 0 !== e && this.add(e, t, i, r, o)
  51094. }
  51095. ,
  51096. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  51097. n.LensFlare.prototype.constructor = n.LensFlare,
  51098. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  51099. void 0 === t && (t = -1),
  51100. void 0 === i && (i = 0),
  51101. void 0 === a && (a = 1),
  51102. void 0 === o && (o = new n.Color(16777215)),
  51103. void 0 === r && (r = n.NormalBlending),
  51104. i = Math.min(i, Math.max(0, i)),
  51105. this.lensFlares.push({
  51106. texture: e,
  51107. size: t,
  51108. distance: i,
  51109. x: 0,
  51110. y: 0,
  51111. z: 0,
  51112. scale: 1,
  51113. rotation: 0,
  51114. opacity: a,
  51115. color: o,
  51116. blending: r
  51117. })
  51118. }
  51119. ,
  51120. n.LensFlare.prototype.updateLensFlares = function() {
  51121. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  51122. for (e = 0; e < i; e++)
  51123. t = this.lensFlares[e],
  51124. t.x = this.positionScreen.x + n * t.distance,
  51125. t.y = this.positionScreen.y + r * t.distance,
  51126. t.wantedRotation = t.x * Math.PI * .25,
  51127. t.rotation += .25 * (t.wantedRotation - t.rotation)
  51128. }
  51129. ,
  51130. n.LensFlare.prototype.copy = function(e) {
  51131. n.Object3D.prototype.copy.call(this, e),
  51132. this.positionScreen.copy(e.positionScreen),
  51133. this.customUpdateCallback = e.customUpdateCallback;
  51134. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  51135. this.lensFlares.push(e.lensFlares[t]);
  51136. return this
  51137. }
  51138. ,
  51139. n.Scene = function() {
  51140. n.Object3D.call(this),
  51141. this.type = "Scene",
  51142. this.fog = null,
  51143. this.overrideMaterial = null,
  51144. this.autoUpdate = !0
  51145. }
  51146. ,
  51147. n.Scene.prototype = Object.create(n.Object3D.prototype),
  51148. n.Scene.prototype.constructor = n.Scene,
  51149. n.Scene.prototype.copy = function(e, t) {
  51150. return n.Object3D.prototype.copy.call(this, e, t),
  51151. null !== e.fog && (this.fog = e.fog.clone()),
  51152. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  51153. this.autoUpdate = e.autoUpdate,
  51154. this.matrixAutoUpdate = e.matrixAutoUpdate,
  51155. this
  51156. }
  51157. ,
  51158. n.Fog = function(e, t, i) {
  51159. this.name = "",
  51160. this.color = new n.Color(e),
  51161. this.near = void 0 !== t ? t : 1,
  51162. this.far = void 0 !== i ? i : 1e3
  51163. }
  51164. ,
  51165. n.Fog.prototype.clone = function() {
  51166. return new n.Fog(this.color.getHex(),this.near,this.far)
  51167. }
  51168. ,
  51169. n.FogExp2 = function(e, t) {
  51170. this.name = "",
  51171. this.color = new n.Color(e),
  51172. this.density = void 0 !== t ? t : 25e-5
  51173. }
  51174. ,
  51175. n.FogExp2.prototype.clone = function() {
  51176. return new n.FogExp2(this.color.getHex(),this.density)
  51177. }
  51178. ,
  51179. n.ShaderChunk = {},
  51180. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  51181. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  51182. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  51183. n.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  51184. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  51185. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  51186. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  51187. n.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  51188. n.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  51189. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  51190. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  51191. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  51192. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  51193. n.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  51194. n.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  51195. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  51196. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  51197. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  51198. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  51199. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  51200. n.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  51201. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  51202. n.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  51203. n.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  51204. n.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  51205. n.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  51206. n.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  51207. n.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  51208. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  51209. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  51210. n.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  51211. n.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  51212. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  51213. n.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  51214. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  51215. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  51216. n.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  51217. n.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  51218. n.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  51219. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  51220. n.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  51221. n.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  51222. n.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  51223. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  51224. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  51225. n.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  51226. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  51227. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  51228. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  51229. n.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  51230. n.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif";
  51231. n.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
  51232. n.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  51233. n.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  51234. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  51235. n.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  51236. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  51237. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  51238. n.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  51239. n.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  51240. n.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  51241. n.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  51242. n.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  51243. n.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  51244. n.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  51245. n.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  51246. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  51247. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  51248. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  51249. n.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  51250. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  51251. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  51252. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  51253. n.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  51254. n.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  51255. n.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  51256. n.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  51257. n.UniformsUtils = {
  51258. merge: function(e) {
  51259. for (var t = {}, i = 0; i < e.length; i++) {
  51260. var n = this.clone(e[i]);
  51261. for (var r in n)
  51262. t[r] = n[r]
  51263. }
  51264. return t
  51265. },
  51266. clone: function(e) {
  51267. var t = {};
  51268. for (var i in e) {
  51269. t[i] = {};
  51270. for (var r in e[i]) {
  51271. var o = e[i][r];
  51272. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  51273. }
  51274. }
  51275. return t
  51276. }
  51277. },
  51278. n.UniformsLib = {
  51279. common: {
  51280. diffuse: {
  51281. type: "c",
  51282. value: new n.Color(15658734)
  51283. },
  51284. opacity: {
  51285. type: "f",
  51286. value: 1
  51287. },
  51288. map: {
  51289. type: "t",
  51290. value: null
  51291. },
  51292. offsetRepeat: {
  51293. type: "v4",
  51294. value: new n.Vector4(0,0,1,1)
  51295. },
  51296. specularMap: {
  51297. type: "t",
  51298. value: null
  51299. },
  51300. alphaMap: {
  51301. type: "t",
  51302. value: null
  51303. },
  51304. envMap: {
  51305. type: "t",
  51306. value: null
  51307. },
  51308. flipEnvMap: {
  51309. type: "f",
  51310. value: -1
  51311. },
  51312. reflectivity: {
  51313. type: "f",
  51314. value: 1
  51315. },
  51316. refractionRatio: {
  51317. type: "f",
  51318. value: .98
  51319. }
  51320. },
  51321. aomap: {
  51322. aoMap: {
  51323. type: "t",
  51324. value: null
  51325. },
  51326. aoMapIntensity: {
  51327. type: "f",
  51328. value: 1
  51329. }
  51330. },
  51331. lightmap: {
  51332. lightMap: {
  51333. type: "t",
  51334. value: null
  51335. },
  51336. lightMapIntensity: {
  51337. type: "f",
  51338. value: 1
  51339. }
  51340. },
  51341. emissivemap: {
  51342. emissiveMap: {
  51343. type: "t",
  51344. value: null
  51345. }
  51346. },
  51347. bumpmap: {
  51348. bumpMap: {
  51349. type: "t",
  51350. value: null
  51351. },
  51352. bumpScale: {
  51353. type: "f",
  51354. value: 1
  51355. }
  51356. },
  51357. normalmap: {
  51358. normalMap: {
  51359. type: "t",
  51360. value: null
  51361. },
  51362. normalScale: {
  51363. type: "v2",
  51364. value: new n.Vector2(1,1)
  51365. }
  51366. },
  51367. displacementmap: {
  51368. displacementMap: {
  51369. type: "t",
  51370. value: null
  51371. },
  51372. displacementScale: {
  51373. type: "f",
  51374. value: 1
  51375. },
  51376. displacementBias: {
  51377. type: "f",
  51378. value: 0
  51379. }
  51380. },
  51381. roughnessmap: {
  51382. roughnessMap: {
  51383. type: "t",
  51384. value: null
  51385. }
  51386. },
  51387. metalnessmap: {
  51388. metalnessMap: {
  51389. type: "t",
  51390. value: null
  51391. }
  51392. },
  51393. fog: {
  51394. fogDensity: {
  51395. type: "f",
  51396. value: 25e-5
  51397. },
  51398. fogNear: {
  51399. type: "f",
  51400. value: 1
  51401. },
  51402. fogFar: {
  51403. type: "f",
  51404. value: 2e3
  51405. },
  51406. fogColor: {
  51407. type: "c",
  51408. value: new n.Color(16777215)
  51409. }
  51410. },
  51411. lights: {
  51412. ambientLightColor: {
  51413. type: "fv",
  51414. value: []
  51415. },
  51416. directionalLights: {
  51417. type: "sa",
  51418. value: [],
  51419. properties: {
  51420. direction: {
  51421. type: "v3"
  51422. },
  51423. color: {
  51424. type: "c"
  51425. },
  51426. shadow: {
  51427. type: "i"
  51428. },
  51429. shadowBias: {
  51430. type: "f"
  51431. },
  51432. shadowRadius: {
  51433. type: "f"
  51434. },
  51435. shadowMapSize: {
  51436. type: "v2"
  51437. }
  51438. }
  51439. },
  51440. directionalShadowMap: {
  51441. type: "tv",
  51442. value: []
  51443. },
  51444. directionalShadowMatrix: {
  51445. type: "m4v",
  51446. value: []
  51447. },
  51448. spotLights: {
  51449. type: "sa",
  51450. value: [],
  51451. properties: {
  51452. color: {
  51453. type: "c"
  51454. },
  51455. position: {
  51456. type: "v3"
  51457. },
  51458. direction: {
  51459. type: "v3"
  51460. },
  51461. distance: {
  51462. type: "f"
  51463. },
  51464. coneCos: {
  51465. type: "f"
  51466. },
  51467. penumbraCos: {
  51468. type: "f"
  51469. },
  51470. decay: {
  51471. type: "f"
  51472. },
  51473. shadow: {
  51474. type: "i"
  51475. },
  51476. shadowBias: {
  51477. type: "f"
  51478. },
  51479. shadowRadius: {
  51480. type: "f"
  51481. },
  51482. shadowMapSize: {
  51483. type: "v2"
  51484. }
  51485. }
  51486. },
  51487. spotShadowMap: {
  51488. type: "tv",
  51489. value: []
  51490. },
  51491. spotShadowMatrix: {
  51492. type: "m4v",
  51493. value: []
  51494. },
  51495. pointLights: {
  51496. type: "sa",
  51497. value: [],
  51498. properties: {
  51499. color: {
  51500. type: "c"
  51501. },
  51502. position: {
  51503. type: "v3"
  51504. },
  51505. decay: {
  51506. type: "f"
  51507. },
  51508. distance: {
  51509. type: "f"
  51510. },
  51511. shadow: {
  51512. type: "i"
  51513. },
  51514. shadowBias: {
  51515. type: "f"
  51516. },
  51517. shadowRadius: {
  51518. type: "f"
  51519. },
  51520. shadowMapSize: {
  51521. type: "v2"
  51522. }
  51523. }
  51524. },
  51525. pointShadowMap: {
  51526. type: "tv",
  51527. value: []
  51528. },
  51529. pointShadowMatrix: {
  51530. type: "m4v",
  51531. value: []
  51532. },
  51533. hemisphereLights: {
  51534. type: "sa",
  51535. value: [],
  51536. properties: {
  51537. direction: {
  51538. type: "v3"
  51539. },
  51540. skyColor: {
  51541. type: "c"
  51542. },
  51543. groundColor: {
  51544. type: "c"
  51545. }
  51546. }
  51547. }
  51548. },
  51549. points: {
  51550. diffuse: {
  51551. type: "c",
  51552. value: new n.Color(15658734)
  51553. },
  51554. opacity: {
  51555. type: "f",
  51556. value: 1
  51557. },
  51558. size: {
  51559. type: "f",
  51560. value: 1
  51561. },
  51562. scale: {
  51563. type: "f",
  51564. value: 1
  51565. },
  51566. map: {
  51567. type: "t",
  51568. value: null
  51569. },
  51570. offsetRepeat: {
  51571. type: "v4",
  51572. value: new n.Vector4(0,0,1,1)
  51573. }
  51574. }
  51575. },
  51576. n.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  51577. n.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  51578. n.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  51579. n.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  51580. n.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  51581. n.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  51582. n.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  51583. n.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  51584. n.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  51585. n.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  51586. n.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  51587. n.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  51588. n.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  51589. n.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  51590. n.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  51591. n.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  51592. n.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  51593. n.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  51594. n.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  51595. n.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  51596. n.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  51597. n.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  51598. n.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  51599. n.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  51600. n.ShaderLib = {
  51601. basic: {
  51602. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  51603. vertexShader: n.ShaderChunk.meshbasic_vert,
  51604. fragmentShader: n.ShaderChunk.meshbasic_frag
  51605. },
  51606. lambert: {
  51607. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51608. emissive: {
  51609. type: "c",
  51610. value: new n.Color(0)
  51611. }
  51612. }]),
  51613. vertexShader: n.ShaderChunk.meshlambert_vert,
  51614. fragmentShader: n.ShaderChunk.meshlambert_frag
  51615. },
  51616. phong: {
  51617. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51618. emissive: {
  51619. type: "c",
  51620. value: new n.Color(0)
  51621. },
  51622. specular: {
  51623. type: "c",
  51624. value: new n.Color(1118481)
  51625. },
  51626. shininess: {
  51627. type: "f",
  51628. value: 30
  51629. }
  51630. }]),
  51631. vertexShader: n.ShaderChunk.meshphong_vert,
  51632. fragmentShader: n.ShaderChunk.meshphong_frag
  51633. },
  51634. standard: {
  51635. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51636. emissive: {
  51637. type: "c",
  51638. value: new n.Color(0)
  51639. },
  51640. roughness: {
  51641. type: "f",
  51642. value: .5
  51643. },
  51644. metalness: {
  51645. type: "f",
  51646. value: 0
  51647. },
  51648. envMapIntensity: {
  51649. type: "f",
  51650. value: 1
  51651. }
  51652. }]),
  51653. vertexShader: n.ShaderChunk.meshstandard_vert,
  51654. fragmentShader: n.ShaderChunk.meshstandard_frag
  51655. },
  51656. points: {
  51657. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51658. vertexShader: n.ShaderChunk.points_vert,
  51659. fragmentShader: n.ShaderChunk.points_frag
  51660. },
  51661. dashed: {
  51662. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51663. scale: {
  51664. type: "f",
  51665. value: 1
  51666. },
  51667. dashSize: {
  51668. type: "f",
  51669. value: 1
  51670. },
  51671. totalSize: {
  51672. type: "f",
  51673. value: 2
  51674. }
  51675. }]),
  51676. vertexShader: n.ShaderChunk.linedashed_vert,
  51677. fragmentShader: n.ShaderChunk.linedashed_frag
  51678. },
  51679. depth: {
  51680. uniforms: {
  51681. mNear: {
  51682. type: "f",
  51683. value: 1
  51684. },
  51685. mFar: {
  51686. type: "f",
  51687. value: 2e3
  51688. },
  51689. opacity: {
  51690. type: "f",
  51691. value: 1
  51692. }
  51693. },
  51694. vertexShader: n.ShaderChunk.depth_vert,
  51695. fragmentShader: n.ShaderChunk.depth_frag
  51696. },
  51697. normal: {
  51698. uniforms: {
  51699. opacity: {
  51700. type: "f",
  51701. value: 1
  51702. }
  51703. },
  51704. vertexShader: n.ShaderChunk.normal_vert,
  51705. fragmentShader: n.ShaderChunk.normal_frag
  51706. },
  51707. cube: {
  51708. uniforms: {
  51709. tCube: {
  51710. type: "t",
  51711. value: null
  51712. },
  51713. tFlip: {
  51714. type: "f",
  51715. value: -1
  51716. }
  51717. },
  51718. vertexShader: n.ShaderChunk.cube_vert,
  51719. fragmentShader: n.ShaderChunk.cube_frag
  51720. },
  51721. equirect: {
  51722. uniforms: {
  51723. tEquirect: {
  51724. type: "t",
  51725. value: null
  51726. },
  51727. tFlip: {
  51728. type: "f",
  51729. value: -1
  51730. }
  51731. },
  51732. vertexShader: n.ShaderChunk.equirect_vert,
  51733. fragmentShader: n.ShaderChunk.equirect_frag
  51734. },
  51735. depthRGBA: {
  51736. uniforms: {},
  51737. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51738. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51739. },
  51740. distanceRGBA: {
  51741. uniforms: {
  51742. lightPos: {
  51743. type: "v3",
  51744. value: new n.Vector3(0,0,0)
  51745. }
  51746. },
  51747. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51748. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51749. }
  51750. },
  51751. n.WebGLRenderer = function(e) {
  51752. function t() {
  51753. return null === ye ? Oe : 1
  51754. }
  51755. function i(e, t, i, n) {
  51756. se === !0 && (e *= n,
  51757. t *= n,
  51758. i *= n),
  51759. Ye.clearColor(e, t, i, n)
  51760. }
  51761. function r() {
  51762. Ye.init(),
  51763. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51764. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51765. i(Se.r, Se.g, Se.b, Me)
  51766. }
  51767. function o() {
  51768. Ae = null,
  51769. be = null,
  51770. Ee = "",
  51771. Ie = -1,
  51772. Ye.reset()
  51773. }
  51774. function a(e) {
  51775. e.preventDefault(),
  51776. o(),
  51777. r(),
  51778. Xe.clear()
  51779. }
  51780. function s(e) {
  51781. var t = e.target;
  51782. t.removeEventListener("dispose", s),
  51783. h(t),
  51784. ke.textures--
  51785. }
  51786. function l(e) {
  51787. var t = e.target;
  51788. t.removeEventListener("dispose", l),
  51789. u(t),
  51790. ke.textures--
  51791. }
  51792. function c(e) {
  51793. var t = e.target;
  51794. t.removeEventListener("dispose", c),
  51795. d(t)
  51796. }
  51797. function h(e) {
  51798. var t = Xe.get(e);
  51799. if (e.image && t.__image__webglTextureCube)
  51800. Ge.deleteTexture(t.__image__webglTextureCube);
  51801. else {
  51802. if (void 0 === t.__webglInit)
  51803. return;
  51804. Ge.deleteTexture(t.__webglTexture)
  51805. }
  51806. Xe.delete(e)
  51807. }
  51808. function u(e) {
  51809. var t = Xe.get(e)
  51810. , i = Xe.get(e.texture);
  51811. if (e && void 0 !== i.__webglTexture) {
  51812. if (Ge.deleteTexture(i.__webglTexture),
  51813. e instanceof n.WebGLRenderTargetCube)
  51814. for (var r = 0; r < 6; r++)
  51815. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51816. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51817. else
  51818. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51819. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51820. Xe.delete(e.texture),
  51821. Xe.delete(e)
  51822. }
  51823. }
  51824. function d(e) {
  51825. p(e),
  51826. Xe.delete(e)
  51827. }
  51828. function p(e) {
  51829. var t = Xe.get(e).program;
  51830. e.program = void 0,
  51831. void 0 !== t && qe.releaseProgram(t)
  51832. }
  51833. function f(e, t, i, r) {
  51834. var o;
  51835. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51836. null === o))
  51837. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51838. void 0 === r && (r = 0),
  51839. Ye.initAttributes();
  51840. var a = i.attributes
  51841. , s = t.getAttributes()
  51842. , l = e.defaultAttributeValues;
  51843. for (var c in s) {
  51844. var h = s[c];
  51845. if (h >= 0) {
  51846. var u = a[c];
  51847. if (void 0 !== u) {
  51848. var d = u.itemSize
  51849. , p = Ze.getAttributeBuffer(u);
  51850. if (u instanceof n.InterleavedBufferAttribute) {
  51851. var f = u.data
  51852. , g = f.stride
  51853. , m = u.offset;
  51854. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51855. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51856. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51857. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51858. } else
  51859. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51860. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51861. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51862. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51863. } else if (void 0 !== l) {
  51864. var v = l[c];
  51865. if (void 0 !== v)
  51866. switch (v.length) {
  51867. case 2:
  51868. Ge.vertexAttrib2fv(h, v);
  51869. break;
  51870. case 3:
  51871. Ge.vertexAttrib3fv(h, v);
  51872. break;
  51873. case 4:
  51874. Ge.vertexAttrib4fv(h, v);
  51875. break;
  51876. default:
  51877. Ge.vertexAttrib1fv(h, v)
  51878. }
  51879. }
  51880. }
  51881. }
  51882. Ye.disableUnusedAttributes()
  51883. }
  51884. function g(e, t) {
  51885. return Math.abs(t[0]) - Math.abs(e[0])
  51886. }
  51887. function m(e, t) {
  51888. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
  51889. }
  51890. function v(e, t) {
  51891. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
  51892. }
  51893. function A(e, t, i, n, r) {
  51894. var o, a;
  51895. i.transparent ? (o = de,
  51896. a = ++pe) : (o = he,
  51897. a = ++ue);
  51898. var s = o[a];
  51899. void 0 !== s ? (s.id = e.id,
  51900. s.object = e,
  51901. s.geometry = t,
  51902. s.material = i,
  51903. s.z = Ve.z,
  51904. s.group = r) : (s = {
  51905. id: e.id,
  51906. object: e,
  51907. geometry: t,
  51908. material: i,
  51909. z: Ve.z,
  51910. group: r
  51911. },
  51912. o.push(s))
  51913. }
  51914. function y(e, t) {
  51915. if (e.visible !== !1) {
  51916. if (e.layers.test(t.layers))
  51917. if (e instanceof n.Light)
  51918. ce.push(e);
  51919. else if (e instanceof n.Sprite)
  51920. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51921. else if (e instanceof n.LensFlare)
  51922. me.push(e);
  51923. else if (e instanceof n.ImmediateRenderObject)
  51924. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51925. Ve.applyProjection(Fe)),
  51926. A(e, null, e.material, Ve.z, null);
  51927. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51928. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51929. var i = e.material;
  51930. if (i.visible === !0) {
  51931. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51932. Ve.applyProjection(Fe));
  51933. var r = Ze.update(e);
  51934. if (i instanceof n.MultiMaterial)
  51935. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51936. var c = o[s]
  51937. , h = a[c.materialIndex];
  51938. h.visible === !0 && A(e, r, h, Ve.z, c)
  51939. }
  51940. else
  51941. A(e, r, i, Ve.z, null)
  51942. }
  51943. }
  51944. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51945. y(u[s], t)
  51946. }
  51947. }
  51948. function C(e, t, i, r) {
  51949. for (var o = 0, a = e.length; o < a; o++) {
  51950. var s = e[o]
  51951. , l = s.object
  51952. , c = s.geometry
  51953. , h = void 0 === r ? s.material : r
  51954. , u = s.group;
  51955. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51956. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51957. l instanceof n.ImmediateRenderObject) {
  51958. E(h);
  51959. var d = w(t, i, h, l);
  51960. Ee = "",
  51961. l.render(function(e) {
  51962. ve.renderBufferImmediate(e, d, h)
  51963. })
  51964. } else
  51965. ve.renderBufferDirect(t, i, c, h, l, u)
  51966. }
  51967. }
  51968. function I(e, t, i) {
  51969. var r = Xe.get(e)
  51970. , o = qe.getParameters(e, Ue, t, i)
  51971. , a = qe.getProgramCode(e, o)
  51972. , s = r.program
  51973. , l = !0;
  51974. if (void 0 === s)
  51975. e.addEventListener("dispose", c);
  51976. else if (s.code !== a)
  51977. p(e);
  51978. else {
  51979. if (void 0 !== o.shaderID)
  51980. return;
  51981. l = !1
  51982. }
  51983. if (l) {
  51984. if (o.shaderID) {
  51985. var h = n.ShaderLib[o.shaderID];
  51986. r.__webglShader = {
  51987. name: e.type,
  51988. uniforms: n.UniformsUtils.clone(h.uniforms),
  51989. vertexShader: h.vertexShader,
  51990. fragmentShader: h.fragmentShader
  51991. }
  51992. } else
  51993. r.__webglShader = {
  51994. name: e.type,
  51995. uniforms: e.uniforms,
  51996. vertexShader: e.vertexShader,
  51997. fragmentShader: e.fragmentShader
  51998. };
  51999. e.__webglShader = r.__webglShader,
  52000. s = qe.acquireProgram(e, o, a),
  52001. r.program = s,
  52002. e.program = s
  52003. }
  52004. var u = s.getAttributes();
  52005. if (e.morphTargets) {
  52006. e.numSupportedMorphTargets = 0;
  52007. for (var d = 0; d < ve.maxMorphTargets; d++)
  52008. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  52009. }
  52010. if (e.morphNormals) {
  52011. e.numSupportedMorphNormals = 0;
  52012. for (var d = 0; d < ve.maxMorphNormals; d++)
  52013. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  52014. }
  52015. r.uniformsList = [];
  52016. var f = r.__webglShader.uniforms
  52017. , g = r.program.getUniforms();
  52018. for (var m in f) {
  52019. var v = g[m];
  52020. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  52021. }
  52022. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  52023. f.ambientLightColor.value = Ue.ambient,
  52024. f.directionalLights.value = Ue.directional,
  52025. f.spotLights.value = Ue.spot,
  52026. f.pointLights.value = Ue.point,
  52027. f.hemisphereLights.value = Ue.hemi,
  52028. f.directionalShadowMap.value = Ue.directionalShadowMap,
  52029. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  52030. f.spotShadowMap.value = Ue.spotShadowMap,
  52031. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  52032. f.pointShadowMap.value = Ue.pointShadowMap,
  52033. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  52034. r.hasDynamicUniforms = !1;
  52035. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  52036. var C = r.uniformsList[A][0];
  52037. if (C.dynamic === !0) {
  52038. r.hasDynamicUniforms = !0;
  52039. break
  52040. }
  52041. }
  52042. }
  52043. function E(e) {
  52044. b(e),
  52045. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  52046. Ye.setDepthFunc(e.depthFunc),
  52047. Ye.setDepthTest(e.depthTest),
  52048. Ye.setDepthWrite(e.depthWrite),
  52049. Ye.setColorWrite(e.colorWrite),
  52050. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  52051. }
  52052. function b(e) {
  52053. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  52054. Ye.setFlipSided(e.side === n.BackSide)
  52055. }
  52056. function w(e, t, i, r) {
  52057. xe = 0;
  52058. var o = Xe.get(i);
  52059. void 0 === o.program && (i.needsUpdate = !0),
  52060. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  52061. i.needsUpdate && (I(i, t, r),
  52062. i.needsUpdate = !1);
  52063. var a = !1
  52064. , s = !1
  52065. , l = !1
  52066. , c = o.program
  52067. , h = c.getUniforms()
  52068. , u = o.__webglShader.uniforms;
  52069. if (c.id !== Ae && (Ge.useProgram(c.program),
  52070. Ae = c.id,
  52071. a = !0,
  52072. s = !0,
  52073. l = !0),
  52074. i.id !== Ie && (Ie = i.id,
  52075. s = !0),
  52076. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  52077. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  52078. e !== be && (be = e,
  52079. s = !0,
  52080. l = !0),
  52081. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  52082. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  52083. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  52084. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  52085. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  52086. i.skinning)
  52087. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  52088. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  52089. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  52090. if (void 0 !== h.boneTexture) {
  52091. var d = B();
  52092. Ge.uniform1i(h.boneTexture, d),
  52093. ve.setTexture(r.skeleton.boneTexture, d)
  52094. }
  52095. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  52096. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  52097. } else
  52098. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  52099. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  52100. t && i.fog && R(u, t),
  52101. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  52102. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  52103. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  52104. u.mFar.value = e.far,
  52105. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  52106. V(o.uniformsList)),
  52107. N(h, r),
  52108. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  52109. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  52110. c
  52111. }
  52112. function _(e, t, i) {
  52113. for (var n = [], r = 0, o = e.length; r < o; r++) {
  52114. var a = e[r][0]
  52115. , s = a.onUpdateCallback;
  52116. void 0 !== s && (s.bind(a)(t, i),
  52117. n.push(e[r]))
  52118. }
  52119. V(n)
  52120. }
  52121. function T(e, t) {
  52122. e.opacity.value = t.opacity,
  52123. e.diffuse.value = t.color,
  52124. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  52125. e.map.value = t.map,
  52126. e.specularMap.value = t.specularMap,
  52127. e.alphaMap.value = t.alphaMap,
  52128. t.aoMap && (e.aoMap.value = t.aoMap,
  52129. e.aoMapIntensity.value = t.aoMapIntensity);
  52130. var i;
  52131. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  52132. void 0 !== i) {
  52133. i instanceof n.WebGLRenderTarget && (i = i.texture);
  52134. var r = i.offset
  52135. , o = i.repeat;
  52136. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  52137. }
  52138. e.envMap.value = t.envMap,
  52139. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  52140. e.reflectivity.value = t.reflectivity,
  52141. e.refractionRatio.value = t.refractionRatio
  52142. }
  52143. function x(e, t) {
  52144. e.diffuse.value = t.color,
  52145. e.opacity.value = t.opacity
  52146. }
  52147. function S(e, t) {
  52148. e.dashSize.value = t.dashSize,
  52149. e.totalSize.value = t.dashSize + t.gapSize,
  52150. e.scale.value = t.scale
  52151. }
  52152. function M(e, t) {
  52153. if (e.diffuse.value = t.color,
  52154. e.opacity.value = t.opacity,
  52155. e.size.value = t.size * Oe,
  52156. e.scale.value = te.clientHeight / 2,
  52157. e.map.value = t.map,
  52158. null !== t.map) {
  52159. var i = t.map.offset
  52160. , n = t.map.repeat;
  52161. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  52162. }
  52163. }
  52164. function R(e, t) {
  52165. e.fogColor.value = t.color,
  52166. t instanceof n.Fog ? (e.fogNear.value = t.near,
  52167. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  52168. }
  52169. function P(e, t) {
  52170. t.lightMap && (e.lightMap.value = t.lightMap,
  52171. e.lightMapIntensity.value = t.lightMapIntensity),
  52172. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  52173. }
  52174. function O(e, t) {
  52175. e.specular.value = t.specular,
  52176. e.shininess.value = Math.max(t.shininess, 1e-4),
  52177. t.lightMap && (e.lightMap.value = t.lightMap,
  52178. e.lightMapIntensity.value = t.lightMapIntensity),
  52179. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  52180. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  52181. e.bumpScale.value = t.bumpScale),
  52182. t.normalMap && (e.normalMap.value = t.normalMap,
  52183. e.normalScale.value.copy(t.normalScale)),
  52184. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  52185. e.displacementScale.value = t.displacementScale,
  52186. e.displacementBias.value = t.displacementBias)
  52187. }
  52188. function L(e, t) {
  52189. e.roughness.value = t.roughness,
  52190. e.metalness.value = t.metalness,
  52191. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  52192. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  52193. t.lightMap && (e.lightMap.value = t.lightMap,
  52194. e.lightMapIntensity.value = t.lightMapIntensity),
  52195. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  52196. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  52197. e.bumpScale.value = t.bumpScale),
  52198. t.normalMap && (e.normalMap.value = t.normalMap,
  52199. e.normalScale.value.copy(t.normalScale)),
  52200. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  52201. e.displacementScale.value = t.displacementScale,
  52202. e.displacementBias.value = t.displacementBias),
  52203. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  52204. }
  52205. function D(e, t) {
  52206. e.ambientLightColor.needsUpdate = t,
  52207. e.directionalLights.needsUpdate = t,
  52208. e.pointLights.needsUpdate = t,
  52209. e.spotLights.needsUpdate = t,
  52210. e.hemisphereLights.needsUpdate = t
  52211. }
  52212. function N(e, t) {
  52213. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  52214. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  52215. }
  52216. function B() {
  52217. var e = xe;
  52218. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  52219. xe += 1,
  52220. e
  52221. }
  52222. function F(e, t, i, r) {
  52223. var o, a;
  52224. if ("1i" === t)
  52225. Ge.uniform1i(i, r);
  52226. else if ("1f" === t)
  52227. Ge.uniform1f(i, r);
  52228. else if ("2f" === t)
  52229. Ge.uniform2f(i, r[0], r[1]);
  52230. else if ("3f" === t)
  52231. Ge.uniform3f(i, r[0], r[1], r[2]);
  52232. else if ("4f" === t)
  52233. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  52234. else if ("1iv" === t)
  52235. Ge.uniform1iv(i, r);
  52236. else if ("3iv" === t)
  52237. Ge.uniform3iv(i, r);
  52238. else if ("1fv" === t)
  52239. Ge.uniform1fv(i, r);
  52240. else if ("2fv" === t)
  52241. Ge.uniform2fv(i, r);
  52242. else if ("3fv" === t)
  52243. Ge.uniform3fv(i, r);
  52244. else if ("4fv" === t)
  52245. Ge.uniform4fv(i, r);
  52246. else if ("Matrix2fv" === t)
  52247. Ge.uniformMatrix2fv(i, !1, r);
  52248. else if ("Matrix3fv" === t)
  52249. Ge.uniformMatrix3fv(i, !1, r);
  52250. else if ("Matrix4fv" === t)
  52251. Ge.uniformMatrix4fv(i, !1, r);
  52252. else if ("i" === t)
  52253. Ge.uniform1i(i, r);
  52254. else if ("f" === t)
  52255. Ge.uniform1f(i, r);
  52256. else if ("v2" === t)
  52257. Ge.uniform2f(i, r.x, r.y);
  52258. else if ("v3" === t)
  52259. Ge.uniform3f(i, r.x, r.y, r.z);
  52260. else if ("v4" === t)
  52261. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  52262. else if ("c" === t)
  52263. Ge.uniform3f(i, r.r, r.g, r.b);
  52264. else if ("s" === t) {
  52265. var s = e.properties;
  52266. for (var l in s) {
  52267. var c = s[l]
  52268. , h = i[l]
  52269. , u = r[l];
  52270. F(c, c.type, h, u)
  52271. }
  52272. } else if ("sa" === t)
  52273. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  52274. for (var l in s) {
  52275. var c = s[l]
  52276. , h = i[d][l]
  52277. , u = r[d][l];
  52278. F(c, c.type, h, u)
  52279. }
  52280. else if ("iv1" === t)
  52281. Ge.uniform1iv(i, r);
  52282. else if ("iv" === t)
  52283. Ge.uniform3iv(i, r);
  52284. else if ("fv1" === t)
  52285. Ge.uniform1fv(i, r);
  52286. else if ("fv" === t)
  52287. Ge.uniform3fv(i, r);
  52288. else if ("v2v" === t) {
  52289. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  52290. for (var d = 0, f = 0, g = r.length; d < g; d++,
  52291. f += 2)
  52292. e._array[f + 0] = r[d].x,
  52293. e._array[f + 1] = r[d].y;
  52294. Ge.uniform2fv(i, e._array)
  52295. } else if ("v3v" === t) {
  52296. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  52297. for (var d = 0, m = 0, g = r.length; d < g; d++,
  52298. m += 3)
  52299. e._array[m + 0] = r[d].x,
  52300. e._array[m + 1] = r[d].y,
  52301. e._array[m + 2] = r[d].z;
  52302. Ge.uniform3fv(i, e._array)
  52303. } else if ("v4v" === t) {
  52304. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  52305. for (var d = 0, v = 0, g = r.length; d < g; d++,
  52306. v += 4)
  52307. e._array[v + 0] = r[d].x,
  52308. e._array[v + 1] = r[d].y,
  52309. e._array[v + 2] = r[d].z,
  52310. e._array[v + 3] = r[d].w;
  52311. Ge.uniform4fv(i, e._array)
  52312. } else if ("m2" === t)
  52313. Ge.uniformMatrix2fv(i, !1, r.elements);
  52314. else if ("m3" === t)
  52315. Ge.uniformMatrix3fv(i, !1, r.elements);
  52316. else if ("m3v" === t) {
  52317. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  52318. for (var d = 0, g = r.length; d < g; d++)
  52319. r[d].flattenToArrayOffset(e._array, 9 * d);
  52320. Ge.uniformMatrix3fv(i, !1, e._array)
  52321. } else if ("m4" === t)
  52322. Ge.uniformMatrix4fv(i, !1, r.elements);
  52323. else if ("m4v" === t) {
  52324. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  52325. for (var d = 0, g = r.length; d < g; d++)
  52326. r[d].flattenToArrayOffset(e._array, 16 * d);
  52327. Ge.uniformMatrix4fv(i, !1, e._array)
  52328. } else if ("t" === t) {
  52329. if (o = r,
  52330. a = B(),
  52331. Ge.uniform1i(i, a),
  52332. !o)
  52333. return;
  52334. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  52335. } else if ("tv" === t) {
  52336. void 0 === e._array && (e._array = []);
  52337. for (var d = 0, g = e.value.length; d < g; d++)
  52338. e._array[d] = B();
  52339. Ge.uniform1iv(i, e._array);
  52340. for (var d = 0, g = e.value.length; d < g; d++)
  52341. o = e.value[d],
  52342. a = e._array[d],
  52343. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  52344. } else
  52345. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  52346. }
  52347. function V(e) {
  52348. for (var t = 0, i = e.length; t < i; t++) {
  52349. var n = e[t][0];
  52350. if (n.needsUpdate !== !1) {
  52351. var r = n.type
  52352. , o = e[t][1]
  52353. , a = n.value;
  52354. F(n, r, o, a)
  52355. }
  52356. }
  52357. }
  52358. function U(e, t) {
  52359. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  52360. for (Ue.shadowsPointLight = 0,
  52361. i = 0,
  52362. r = e.length; i < r; i++)
  52363. if (o = e[i],
  52364. a = o.color,
  52365. s = o.intensity,
  52366. l = o.distance,
  52367. o instanceof n.AmbientLight)
  52368. c += a.r * s,
  52369. h += a.g * s,
  52370. u += a.b * s;
  52371. else if (o instanceof n.DirectionalLight) {
  52372. var A = Ke.get(o);
  52373. A.color.copy(o.color).multiplyScalar(o.intensity),
  52374. A.direction.setFromMatrixPosition(o.matrixWorld),
  52375. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52376. A.direction.sub(Ve),
  52377. A.direction.transformDirection(d),
  52378. A.shadow = o.castShadow,
  52379. o.castShadow && (A.shadowBias = o.shadow.bias,
  52380. A.shadowRadius = o.shadow.radius,
  52381. A.shadowMapSize = o.shadow.mapSize,
  52382. Ue.shadows[v++] = o),
  52383. Ue.directionalShadowMap[p] = o.shadow.map,
  52384. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  52385. Ue.directional[p++] = A
  52386. } else if (o instanceof n.SpotLight) {
  52387. var A = Ke.get(o);
  52388. A.position.setFromMatrixPosition(o.matrixWorld),
  52389. A.position.applyMatrix4(d),
  52390. A.color.copy(a).multiplyScalar(s),
  52391. A.distance = l,
  52392. A.direction.setFromMatrixPosition(o.matrixWorld),
  52393. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52394. A.direction.sub(Ve),
  52395. A.direction.transformDirection(d),
  52396. A.coneCos = Math.cos(o.angle),
  52397. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  52398. A.decay = 0 === o.distance ? 0 : o.decay,
  52399. A.shadow = o.castShadow,
  52400. o.castShadow && (A.shadowBias = o.shadow.bias,
  52401. A.shadowRadius = o.shadow.radius,
  52402. A.shadowMapSize = o.shadow.mapSize,
  52403. Ue.shadows[v++] = o),
  52404. Ue.spotShadowMap[g] = o.shadow.map,
  52405. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  52406. Ue.spot[g++] = A
  52407. } else if (o instanceof n.PointLight) {
  52408. var A = Ke.get(o);
  52409. A.position.setFromMatrixPosition(o.matrixWorld),
  52410. A.position.applyMatrix4(d),
  52411. A.color.copy(o.color).multiplyScalar(o.intensity),
  52412. A.distance = o.distance,
  52413. A.decay = 0 === o.distance ? 0 : o.decay,
  52414. A.shadow = o.castShadow,
  52415. o.castShadow && (A.shadowBias = o.shadow.bias,
  52416. A.shadowRadius = o.shadow.radius,
  52417. A.shadowMapSize = o.shadow.mapSize,
  52418. Ue.shadows[v++] = o),
  52419. Ue.pointShadowMap[f] = o.shadow.map,
  52420. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  52421. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  52422. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  52423. Ue.point[f++] = A
  52424. } else if (o instanceof n.HemisphereLight) {
  52425. var A = Ke.get(o);
  52426. A.direction.setFromMatrixPosition(o.matrixWorld),
  52427. A.direction.transformDirection(d),
  52428. A.direction.normalize(),
  52429. A.skyColor.copy(o.color).multiplyScalar(s),
  52430. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  52431. Ue.hemi[m++] = A
  52432. }
  52433. Ue.ambient[0] = c,
  52434. Ue.ambient[1] = h,
  52435. Ue.ambient[2] = u,
  52436. Ue.directional.length = p,
  52437. Ue.spot.length = g,
  52438. Ue.point.length = f,
  52439. Ue.hemi.length = m,
  52440. Ue.shadows.length = v,
  52441. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  52442. }
  52443. function k(e, t, i) {
  52444. var r;
  52445. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  52446. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  52447. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  52448. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  52449. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  52450. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  52451. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  52452. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  52453. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  52454. r = We.get("EXT_texture_filter_anisotropic")) {
  52455. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  52456. return;
  52457. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  52458. return;
  52459. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  52460. Xe.get(t).__currentAnisotropy = t.anisotropy)
  52461. }
  52462. }
  52463. function H(e, t, i) {
  52464. void 0 === e.__webglInit && (e.__webglInit = !0,
  52465. t.addEventListener("dispose", s),
  52466. e.__webglTexture = Ge.createTexture(),
  52467. ke.textures++),
  52468. Ye.activeTexture(Ge.TEXTURE0 + i),
  52469. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  52470. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  52471. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  52472. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  52473. var r = G(t.image, je.maxTextureSize);
  52474. W(t) && z(r) === !1 && (r = j(r));
  52475. var o = z(r)
  52476. , a = ee(t.format)
  52477. , l = ee(t.type);
  52478. k(Ge.TEXTURE_2D, t, o);
  52479. var c, h = t.mipmaps;
  52480. if (t instanceof n.DataTexture)
  52481. if (h.length > 0 && o) {
  52482. for (var u = 0, d = h.length; u < d; u++)
  52483. c = h[u],
  52484. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  52485. t.generateMipmaps = !1
  52486. } else
  52487. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  52488. else if (t instanceof n.CompressedTexture)
  52489. for (var u = 0, d = h.length; u < d; u++)
  52490. c = h[u],
  52491. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  52492. else if (h.length > 0 && o) {
  52493. for (var u = 0, d = h.length; u < d; u++)
  52494. c = h[u],
  52495. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  52496. t.generateMipmaps = !1
  52497. } else
  52498. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  52499. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52500. e.__version = t.version,
  52501. t.onUpdate && t.onUpdate(t)
  52502. }
  52503. function G(e, t) {
  52504. if (e.width > t || e.height > t) {
  52505. var i = t / Math.max(e.width, e.height)
  52506. , n = document.createElement("canvas");
  52507. n.width = Math.floor(e.width * i),
  52508. n.height = Math.floor(e.height * i);
  52509. var r = n.getContext("2d");
  52510. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  52511. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  52512. n
  52513. }
  52514. return e
  52515. }
  52516. function z(e) {
  52517. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  52518. }
  52519. function W(e) {
  52520. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  52521. }
  52522. function j(e) {
  52523. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  52524. var t = document.createElement("canvas");
  52525. t.width = n.Math.nearestPowerOfTwo(e.width),
  52526. t.height = n.Math.nearestPowerOfTwo(e.height);
  52527. var i = t.getContext("2d");
  52528. return i.drawImage(e, 0, 0, t.width, t.height),
  52529. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  52530. t
  52531. }
  52532. return e
  52533. }
  52534. function Y(e, t) {
  52535. var i = Xe.get(e);
  52536. if (6 === e.image.length)
  52537. if (e.version > 0 && i.__version !== e.version) {
  52538. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  52539. i.__image__webglTextureCube = Ge.createTexture(),
  52540. ke.textures++),
  52541. Ye.activeTexture(Ge.TEXTURE0 + t),
  52542. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  52543. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  52544. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  52545. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  52546. var c = a[0]
  52547. , h = z(c)
  52548. , u = ee(e.format)
  52549. , d = ee(e.type);
  52550. k(Ge.TEXTURE_CUBE_MAP, e, h);
  52551. for (var l = 0; l < 6; l++)
  52552. if (r)
  52553. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  52554. p = f[g],
  52555. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  52556. else
  52557. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  52558. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52559. i.__version = e.version,
  52560. e.onUpdate && e.onUpdate(e)
  52561. } else
  52562. Ye.activeTexture(Ge.TEXTURE0 + t),
  52563. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  52564. }
  52565. function X(e, t) {
  52566. Ye.activeTexture(Ge.TEXTURE0 + t),
  52567. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  52568. }
  52569. function Z(e, t, i, n) {
  52570. var r = ee(t.texture.format)
  52571. , o = ee(t.texture.type);
  52572. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  52573. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  52574. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  52575. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52576. }
  52577. function q(e, t) {
  52578. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  52579. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  52580. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  52581. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  52582. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  52583. }
  52584. function K(e) {
  52585. var t = Xe.get(e)
  52586. , i = e instanceof n.WebGLRenderTargetCube;
  52587. if (i) {
  52588. t.__webglDepthbuffer = [];
  52589. for (var r = 0; r < 6; r++)
  52590. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  52591. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  52592. q(t.__webglDepthbuffer[r], e)
  52593. } else
  52594. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  52595. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  52596. q(t.__webglDepthbuffer, e);
  52597. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52598. }
  52599. function Q(e) {
  52600. var t = Xe.get(e)
  52601. , i = Xe.get(e.texture);
  52602. e.addEventListener("dispose", l),
  52603. i.__webglTexture = Ge.createTexture(),
  52604. ke.textures++;
  52605. var r = e instanceof n.WebGLRenderTargetCube
  52606. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  52607. if (r) {
  52608. t.__webglFramebuffer = [];
  52609. for (var a = 0; a < 6; a++)
  52610. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  52611. } else
  52612. t.__webglFramebuffer = Ge.createFramebuffer();
  52613. if (r) {
  52614. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  52615. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  52616. for (var a = 0; a < 6; a++)
  52617. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  52618. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52619. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  52620. } else
  52621. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  52622. k(Ge.TEXTURE_2D, e.texture, o),
  52623. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  52624. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52625. Ye.bindTexture(Ge.TEXTURE_2D, null);
  52626. e.depthBuffer && K(e)
  52627. }
  52628. function J(e) {
  52629. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  52630. , i = Xe.get(e.texture).__webglTexture;
  52631. Ye.bindTexture(t, i),
  52632. Ge.generateMipmap(t),
  52633. Ye.bindTexture(t, null)
  52634. }
  52635. function $(e) {
  52636. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  52637. }
  52638. function ee(e) {
  52639. var t;
  52640. if (e === n.RepeatWrapping)
  52641. return Ge.REPEAT;
  52642. if (e === n.ClampToEdgeWrapping)
  52643. return Ge.CLAMP_TO_EDGE;
  52644. if (e === n.MirroredRepeatWrapping)
  52645. return Ge.MIRRORED_REPEAT;
  52646. if (e === n.NearestFilter)
  52647. return Ge.NEAREST;
  52648. if (e === n.NearestMipMapNearestFilter)
  52649. return Ge.NEAREST_MIPMAP_NEAREST;
  52650. if (e === n.NearestMipMapLinearFilter)
  52651. return Ge.NEAREST_MIPMAP_LINEAR;
  52652. if (e === n.LinearFilter)
  52653. return Ge.LINEAR;
  52654. if (e === n.LinearMipMapNearestFilter)
  52655. return Ge.LINEAR_MIPMAP_NEAREST;
  52656. if (e === n.LinearMipMapLinearFilter)
  52657. return Ge.LINEAR_MIPMAP_LINEAR;
  52658. if (e === n.UnsignedByteType)
  52659. return Ge.UNSIGNED_BYTE;
  52660. if (e === n.UnsignedShort4444Type)
  52661. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52662. if (e === n.UnsignedShort5551Type)
  52663. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52664. if (e === n.UnsignedShort565Type)
  52665. return Ge.UNSIGNED_SHORT_5_6_5;
  52666. if (e === n.ByteType)
  52667. return Ge.BYTE;
  52668. if (e === n.ShortType)
  52669. return Ge.SHORT;
  52670. if (e === n.UnsignedShortType)
  52671. return Ge.UNSIGNED_SHORT;
  52672. if (e === n.IntType)
  52673. return Ge.INT;
  52674. if (e === n.UnsignedIntType)
  52675. return Ge.UNSIGNED_INT;
  52676. if (e === n.FloatType)
  52677. return Ge.FLOAT;
  52678. if (t = We.get("OES_texture_half_float"),
  52679. null !== t && e === n.HalfFloatType)
  52680. return t.HALF_FLOAT_OES;
  52681. if (e === n.AlphaFormat)
  52682. return Ge.ALPHA;
  52683. if (e === n.RGBFormat)
  52684. return Ge.RGB;
  52685. if (e === n.RGBAFormat)
  52686. return Ge.RGBA;
  52687. if (e === n.LuminanceFormat)
  52688. return Ge.LUMINANCE;
  52689. if (e === n.LuminanceAlphaFormat)
  52690. return Ge.LUMINANCE_ALPHA;
  52691. if (e === n.AddEquation)
  52692. return Ge.FUNC_ADD;
  52693. if (e === n.SubtractEquation)
  52694. return Ge.FUNC_SUBTRACT;
  52695. if (e === n.ReverseSubtractEquation)
  52696. return Ge.FUNC_REVERSE_SUBTRACT;
  52697. if (e === n.ZeroFactor)
  52698. return Ge.ZERO;
  52699. if (e === n.OneFactor)
  52700. return Ge.ONE;
  52701. if (e === n.SrcColorFactor)
  52702. return Ge.SRC_COLOR;
  52703. if (e === n.OneMinusSrcColorFactor)
  52704. return Ge.ONE_MINUS_SRC_COLOR;
  52705. if (e === n.SrcAlphaFactor)
  52706. return Ge.SRC_ALPHA;
  52707. if (e === n.OneMinusSrcAlphaFactor)
  52708. return Ge.ONE_MINUS_SRC_ALPHA;
  52709. if (e === n.DstAlphaFactor)
  52710. return Ge.DST_ALPHA;
  52711. if (e === n.OneMinusDstAlphaFactor)
  52712. return Ge.ONE_MINUS_DST_ALPHA;
  52713. if (e === n.DstColorFactor)
  52714. return Ge.DST_COLOR;
  52715. if (e === n.OneMinusDstColorFactor)
  52716. return Ge.ONE_MINUS_DST_COLOR;
  52717. if (e === n.SrcAlphaSaturateFactor)
  52718. return Ge.SRC_ALPHA_SATURATE;
  52719. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52720. null !== t) {
  52721. if (e === n.RGB_S3TC_DXT1_Format)
  52722. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52723. if (e === n.RGBA_S3TC_DXT1_Format)
  52724. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52725. if (e === n.RGBA_S3TC_DXT3_Format)
  52726. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52727. if (e === n.RGBA_S3TC_DXT5_Format)
  52728. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52729. }
  52730. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52731. null !== t) {
  52732. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52733. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52734. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52735. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52736. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52737. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52738. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52739. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52740. }
  52741. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52742. null !== t && e === n.RGB_ETC1_Format)
  52743. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52744. if (t = We.get("EXT_blend_minmax"),
  52745. null !== t) {
  52746. if (e === n.MinEquation)
  52747. return t.MIN_EXT;
  52748. if (e === n.MaxEquation)
  52749. return t.MAX_EXT
  52750. }
  52751. return 0
  52752. }
  52753. console.log("THREE.WebGLRenderer", n.REVISION),
  52754. e = e || {};
  52755. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52756. , ie = void 0 !== e.context ? e.context : null
  52757. , ne = void 0 !== e.alpha && e.alpha
  52758. , re = void 0 === e.depth || e.depth
  52759. , oe = void 0 === e.stencil || e.stencil
  52760. , ae = void 0 !== e.antialias && e.antialias
  52761. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52762. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52763. , ce = []
  52764. , he = []
  52765. , ue = -1
  52766. , de = []
  52767. , pe = -1
  52768. , fe = new Float32Array(8)
  52769. , ge = []
  52770. , me = [];
  52771. this.domElement = te,
  52772. this.context = null,
  52773. this.autoClear = !0,
  52774. this.autoClearColor = !0,
  52775. this.autoClearDepth = !0,
  52776. this.autoClearStencil = !0,
  52777. this.sortObjects = !0,
  52778. this.gammaFactor = 2,
  52779. this.gammaInput = !1,
  52780. this.gammaOutput = !1,
  52781. this.physicallyCorrectLights = !1,
  52782. this.toneMapping = n.LinearToneMapping,
  52783. this.toneMappingExposure = 1,
  52784. this.toneMappingWhitePoint = 1,
  52785. this.maxMorphTargets = 8,
  52786. this.maxMorphNormals = 4,
  52787. this.autoScaleCubemaps = !0;
  52788. var ve = this
  52789. , Ae = null
  52790. , ye = null
  52791. , Ce = null
  52792. , Ie = -1
  52793. , Ee = ""
  52794. , be = null
  52795. , we = new n.Vector4
  52796. , _e = null
  52797. , Te = new n.Vector4
  52798. , xe = 0
  52799. , Se = new n.Color(0)
  52800. , Me = 0
  52801. , Re = te.width
  52802. , Pe = te.height
  52803. , Oe = 1
  52804. , Le = new n.Vector4(0,0,Re,Pe)
  52805. , De = !1
  52806. , Ne = new n.Vector4(0,0,Re,Pe)
  52807. , Be = new n.Frustum
  52808. , Fe = new n.Matrix4
  52809. , Ve = new n.Vector3
  52810. , Ue = {
  52811. hash: "",
  52812. ambient: [0, 0, 0],
  52813. directional: [],
  52814. directionalShadowMap: [],
  52815. directionalShadowMatrix: [],
  52816. spot: [],
  52817. spotShadowMap: [],
  52818. spotShadowMatrix: [],
  52819. point: [],
  52820. pointShadowMap: [],
  52821. pointShadowMatrix: [],
  52822. hemi: [],
  52823. shadows: [],
  52824. shadowsPointLight: 0
  52825. }
  52826. , ke = {
  52827. geometries: 0,
  52828. textures: 0
  52829. }
  52830. , He = {
  52831. calls: 0,
  52832. vertices: 0,
  52833. faces: 0,
  52834. points: 0
  52835. };
  52836. this.info = {
  52837. render: He,
  52838. memory: ke,
  52839. programs: null
  52840. };
  52841. var Ge;
  52842. try {
  52843. var ze = {
  52844. alpha: ne,
  52845. depth: re,
  52846. stencil: oe,
  52847. antialias: ae,
  52848. premultipliedAlpha: se,
  52849. preserveDrawingBuffer: le
  52850. };
  52851. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52852. null === Ge)
  52853. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52854. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52855. return {
  52856. rangeMin: 1,
  52857. rangeMax: 1,
  52858. precision: 1
  52859. }
  52860. }
  52861. ),
  52862. te.addEventListener("webglcontextlost", a, !1)
  52863. } catch (e) {
  52864. console.error("THREE.WebGLRenderer: " + e)
  52865. }
  52866. var We = new n.WebGLExtensions(Ge);
  52867. We.get("OES_texture_float"),
  52868. We.get("OES_texture_float_linear"),
  52869. We.get("OES_texture_half_float"),
  52870. We.get("OES_texture_half_float_linear"),
  52871. We.get("OES_standard_derivatives"),
  52872. We.get("ANGLE_instanced_arrays"),
  52873. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52874. var je = new n.WebGLCapabilities(Ge,We,e)
  52875. , Ye = new n.WebGLState(Ge,We,ee)
  52876. , Xe = new n.WebGLProperties
  52877. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52878. , qe = new n.WebGLPrograms(this,je)
  52879. , Ke = new n.WebGLLights;
  52880. this.info.programs = qe.programs;
  52881. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52882. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52883. r(),
  52884. this.context = Ge,
  52885. this.capabilities = je,
  52886. this.extensions = We,
  52887. this.properties = Xe,
  52888. this.state = Ye;
  52889. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52890. this.shadowMap = $e;
  52891. var et = new n.SpritePlugin(this,ge)
  52892. , tt = new n.LensFlarePlugin(this,me);
  52893. this.getContext = function() {
  52894. return Ge
  52895. }
  52896. ,
  52897. this.getContextAttributes = function() {
  52898. return Ge.getContextAttributes()
  52899. }
  52900. ,
  52901. this.forceContextLoss = function() {
  52902. We.get("WEBGL_lose_context").loseContext()
  52903. }
  52904. ,
  52905. this.getMaxAnisotropy = function() {
  52906. var e;
  52907. return function() {
  52908. if (void 0 !== e)
  52909. return e;
  52910. var t = We.get("EXT_texture_filter_anisotropic");
  52911. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52912. }
  52913. }(),
  52914. this.getPrecision = function() {
  52915. return je.precision
  52916. }
  52917. ,
  52918. this.getPixelRatio = function() {
  52919. return Oe
  52920. }
  52921. ,
  52922. this.setPixelRatio = function(e) {
  52923. void 0 !== e && (Oe = e,
  52924. this.setSize(Ne.z, Ne.w, !1))
  52925. }
  52926. ,
  52927. this.getSize = function() {
  52928. return {
  52929. width: Re,
  52930. height: Pe
  52931. }
  52932. }
  52933. ,
  52934. this.setSize = function(e, t, i, devicePixelRatio) {
  52935. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52936. Re = e,
  52937. Pe = t,
  52938. te.width = e * Oe,
  52939. te.height = t * Oe,
  52940. i !== !1 && (te.style.width = e + "px",
  52941. te.style.height = t + "px"),
  52942. this.setViewport(0, 0, e, t)
  52943. }
  52944. ,
  52945. this.setViewport = function(e, t, i, n) {
  52946. Ye.viewport(Ne.set(e, t, i, n))
  52947. }
  52948. ,
  52949. this.setScissor = function(e, t, i, n) {
  52950. Ye.scissor(Le.set(e, t, i, n))
  52951. }
  52952. ,
  52953. this.setScissorTest = function(e) {
  52954. Ye.setScissorTest(De = e)
  52955. }
  52956. ,
  52957. this.getClearColor = function() {
  52958. return Se
  52959. }
  52960. ,
  52961. this.setClearColor = function(e, t) {
  52962. Se.set(e),
  52963. Me = void 0 !== t ? t : 1,
  52964. i(Se.r, Se.g, Se.b, Me)
  52965. }
  52966. ,
  52967. this.getClearAlpha = function() {
  52968. return Me
  52969. }
  52970. ,
  52971. this.setClearAlpha = function(e) {
  52972. Me = e,
  52973. i(Se.r, Se.g, Se.b, Me)
  52974. }
  52975. ,
  52976. this.clear = function(e, t, i) {
  52977. var n = 0;
  52978. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52979. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52980. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52981. Ge.clear(n)
  52982. }
  52983. ,
  52984. this.clearColor = function() {
  52985. this.clear(!0, !1, !1)
  52986. }
  52987. ,
  52988. this.clearDepth = function() {
  52989. this.clear(!1, !0, !1)
  52990. }
  52991. ,
  52992. this.clearStencil = function() {
  52993. this.clear(!1, !1, !0)
  52994. }
  52995. ,
  52996. this.clearTarget = function(e, t, i, n) {
  52997. this.setRenderTarget(e),
  52998. this.clear(t, i, n)
  52999. }
  53000. ,
  53001. this.resetGLState = o,
  53002. this.dispose = function() {
  53003. te.removeEventListener("webglcontextlost", a, !1)
  53004. }
  53005. ,
  53006. this.renderBufferImmediate = function(e, t, i) {
  53007. Ye.initAttributes();
  53008. var r = Xe.get(e);
  53009. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  53010. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  53011. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  53012. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  53013. var o = t.getAttributes();
  53014. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  53015. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  53016. Ye.enableAttribute(o.position),
  53017. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  53018. e.hasNormals) {
  53019. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  53020. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  53021. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  53022. var l = e.normalArray
  53023. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  53024. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  53025. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  53026. l[a + 0] = c,
  53027. l[a + 1] = h,
  53028. l[a + 2] = u,
  53029. l[a + 3] = c,
  53030. l[a + 4] = h,
  53031. l[a + 5] = u,
  53032. l[a + 6] = c,
  53033. l[a + 7] = h,
  53034. l[a + 8] = u
  53035. }
  53036. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  53037. Ye.enableAttribute(o.normal),
  53038. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  53039. }
  53040. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  53041. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  53042. Ye.enableAttribute(o.uv),
  53043. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  53044. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  53045. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  53046. Ye.enableAttribute(o.color),
  53047. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  53048. Ye.disableUnusedAttributes(),
  53049. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  53050. e.count = 0
  53051. }
  53052. ,
  53053. this.renderBufferDirect = function(e, i, r, o, a, s) {
  53054. E(o);
  53055. var l = w(e, i, o, a)
  53056. , c = !1
  53057. , h = r.id + "_" + l.id + "_" + o.wireframe;
  53058. h !== Ee && (Ee = h,
  53059. c = !0);
  53060. var u = a.morphTargetInfluences;
  53061. if (void 0 !== u) {
  53062. for (var d = [], p = 0, m = u.length; p < m; p++) {
  53063. var v = u[p];
  53064. d.push([v, p])
  53065. }
  53066. d.sort(g),
  53067. d.length > 8 && (d.length = 8);
  53068. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  53069. var v = d[p];
  53070. if (fe[p] = v[0],
  53071. 0 !== v[0]) {
  53072. var y = v[1];
  53073. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  53074. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  53075. } else
  53076. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  53077. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  53078. }
  53079. var C = l.getUniforms();
  53080. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  53081. c = !0
  53082. }
  53083. var y = r.index
  53084. , I = r.attributes.position;
  53085. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  53086. var b;
  53087. null !== y ? (b = Je,
  53088. b.setIndex(y)) : b = Qe,
  53089. c && (f(o, l, r),
  53090. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  53091. var _ = 0
  53092. , T = 1 / 0;
  53093. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  53094. var x = r.drawRange.start
  53095. , S = r.drawRange.count
  53096. , M = null !== s ? s.start : 0
  53097. , R = null !== s ? s.count : 1 / 0
  53098. , P = Math.max(_, x, M)
  53099. , O = Math.min(_ + T, x + S, M + R) - 1
  53100. , L = Math.max(0, O - P + 1);
  53101. if (a instanceof n.Mesh)
  53102. if (o.wireframe === !0)
  53103. Ye.setLineWidth(o.wireframeLinewidth * t()),
  53104. b.setMode(Ge.LINES);
  53105. else
  53106. switch (a.drawMode) {
  53107. case n.TrianglesDrawMode:
  53108. b.setMode(Ge.TRIANGLES);
  53109. break;
  53110. case n.TriangleStripDrawMode:
  53111. b.setMode(Ge.TRIANGLE_STRIP);
  53112. break;
  53113. case n.TriangleFanDrawMode:
  53114. b.setMode(Ge.TRIANGLE_FAN)
  53115. }
  53116. else if (a instanceof n.Line) {
  53117. var D = o.linewidth;
  53118. void 0 === D && (D = 1),
  53119. Ye.setLineWidth(D * t()),
  53120. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  53121. } else
  53122. a instanceof n.Points && b.setMode(Ge.POINTS);
  53123. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  53124. }
  53125. ,
  53126. this.render = function(e, t, i, r) {
  53127. if (t instanceof n.Camera == !1)
  53128. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  53129. var o = e.fog;
  53130. if (Ee = "",
  53131. Ie = -1,
  53132. be = null,
  53133. e.autoUpdate === !0 && e.updateMatrixWorld(),
  53134. null === t.parent && t.updateMatrixWorld(),
  53135. t.matrixWorldInverse.getInverse(t.matrixWorld),
  53136. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  53137. Be.setFromMatrix(Fe),
  53138. ce.length = 0,
  53139. ue = -1,
  53140. pe = -1,
  53141. ge.length = 0,
  53142. me.length = 0,
  53143. y(e, t),
  53144. he.length = ue + 1,
  53145. de.length = pe + 1,
  53146. ve.sortObjects === !0 && (he.sort(m),
  53147. de.sort(v)),
  53148. U(ce, t),
  53149. $e.render(e, t),
  53150. He.calls = 0,
  53151. He.vertices = 0,
  53152. He.faces = 0,
  53153. He.points = 0,
  53154. void 0 === i && (i = null),
  53155. this.setRenderTarget(i),
  53156. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  53157. e.overrideMaterial) {
  53158. var a = e.overrideMaterial;
  53159. C(he, t, o, a),
  53160. C(de, t, o, a)
  53161. } else
  53162. Ye.setBlending(n.NoBlending),
  53163. C(he, t, o),
  53164. C(de, t, o);
  53165. if (et.render(e, t),
  53166. tt.render(e, t, Te),
  53167. i) {
  53168. var s = i.texture;
  53169. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  53170. }
  53171. Ye.setDepthTest(!0),
  53172. Ye.setDepthWrite(!0),
  53173. Ye.setColorWrite(!0)
  53174. }
  53175. ,
  53176. this.setFaceCulling = function(e, t) {
  53177. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  53178. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  53179. Ye.enable(Ge.CULL_FACE))
  53180. }
  53181. ,
  53182. this.setTexture = function(e, t) {
  53183. var i = Xe.get(e);
  53184. if (e.version > 0 && i.__version !== e.version) {
  53185. var n = e.image;
  53186. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  53187. }
  53188. Ye.activeTexture(Ge.TEXTURE0 + t),
  53189. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  53190. }
  53191. ,
  53192. this.getCurrentRenderTarget = function() {
  53193. return ye
  53194. }
  53195. ,
  53196. this.setRenderTarget = function(e) {
  53197. ye = e,
  53198. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  53199. var t, i = e instanceof n.WebGLRenderTargetCube;
  53200. if (e) {
  53201. var r = Xe.get(e);
  53202. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  53203. we.copy(e.scissor),
  53204. _e = e.scissorTest,
  53205. Te.copy(e.viewport)
  53206. } else
  53207. t = null,
  53208. we.copy(Le).multiplyScalar(Oe),
  53209. _e = De,
  53210. Te.copy(Ne).multiplyScalar(Oe);
  53211. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  53212. Ce = t),
  53213. Ye.scissor(we),
  53214. Ye.setScissorTest(_e),
  53215. Ye.viewport(Te),
  53216. i) {
  53217. var o = Xe.get(e.texture);
  53218. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  53219. }
  53220. }
  53221. ,
  53222. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  53223. if (e instanceof n.WebGLRenderTarget == !1)
  53224. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  53225. var s = Xe.get(e).__webglFramebuffer;
  53226. if (s) {
  53227. var l = !1;
  53228. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  53229. l = !0);
  53230. try {
  53231. var c = e.texture;
  53232. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  53233. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  53234. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  53235. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  53236. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  53237. } finally {
  53238. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  53239. }
  53240. }
  53241. }
  53242. }
  53243. ,
  53244. n.WebGLRenderTarget = function(e, t, i) {
  53245. this.uuid = n.Math.generateUUID(),
  53246. this.width = e,
  53247. this.height = t,
  53248. this.scissor = new n.Vector4(0,0,e,t),
  53249. this.scissorTest = !1,
  53250. this.viewport = new n.Vector4(0,0,e,t),
  53251. i = i || {},
  53252. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  53253. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  53254. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  53255. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  53256. }
  53257. ,
  53258. n.WebGLRenderTarget.prototype = {
  53259. constructor: n.WebGLRenderTarget,
  53260. setSize: function(e, t) {
  53261. this.width === e && this.height === t || (this.width = e,
  53262. this.height = t,
  53263. this.dispose()),
  53264. this.viewport.set(0, 0, e, t),
  53265. this.scissor.set(0, 0, e, t)
  53266. },
  53267. clone: function() {
  53268. return (new this.constructor).copy(this)
  53269. },
  53270. copy: function(e) {
  53271. return this.width = e.width,
  53272. this.height = e.height,
  53273. this.viewport.copy(e.viewport),
  53274. this.texture = e.texture.clone(),
  53275. this.depthBuffer = e.depthBuffer,
  53276. this.stencilBuffer = e.stencilBuffer,
  53277. this
  53278. },
  53279. dispose: function() {
  53280. this.dispatchEvent({
  53281. type: "dispose"
  53282. })
  53283. }
  53284. },
  53285. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  53286. n.WebGLRenderTargetCube = function(e, t, i) {
  53287. n.WebGLRenderTarget.call(this, e, t, i),
  53288. this.activeCubeFace = 0,
  53289. this.activeMipMapLevel = 0
  53290. }
  53291. ,
  53292. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  53293. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  53294. n.WebGLBufferRenderer = function(e, t, i) {
  53295. function r(e) {
  53296. s = e
  53297. }
  53298. function o(t, n) {
  53299. e.drawArrays(s, t, n),
  53300. i.calls++,
  53301. i.vertices += n,
  53302. s === e.TRIANGLES && (i.faces += n / 3)
  53303. }
  53304. function a(r) {
  53305. var o = t.get("ANGLE_instanced_arrays");
  53306. if (null === o)
  53307. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  53308. var a = r.attributes.position
  53309. , l = 0;
  53310. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  53311. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  53312. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  53313. i.calls++,
  53314. i.vertices += l * r.maxInstancedCount,
  53315. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  53316. }
  53317. var s;
  53318. this.setMode = r,
  53319. this.render = o,
  53320. this.renderInstances = a
  53321. }
  53322. ,
  53323. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  53324. function n(e) {
  53325. s = e
  53326. }
  53327. function r(i) {
  53328. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  53329. c = 4) : (l = e.UNSIGNED_SHORT,
  53330. c = 2)
  53331. }
  53332. function o(t, n) {
  53333. e.drawElements(s, n, l, t * c),
  53334. i.calls++,
  53335. i.vertices += n,
  53336. s === e.TRIANGLES && (i.faces += n / 3)
  53337. }
  53338. function a(n, r, o) {
  53339. var a = t.get("ANGLE_instanced_arrays");
  53340. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  53341. i.calls++,
  53342. i.vertices += o * n.maxInstancedCount,
  53343. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  53344. }
  53345. var s, l, c;
  53346. this.setMode = n,
  53347. this.setIndex = r,
  53348. this.render = o,
  53349. this.renderInstances = a
  53350. }
  53351. ,
  53352. n.WebGLExtensions = function(e) {
  53353. var t = {};
  53354. this.get = function(i) {
  53355. if (void 0 !== t[i])
  53356. return t[i];
  53357. var n;
  53358. switch (i) {
  53359. case "EXT_texture_filter_anisotropic":
  53360. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  53361. break;
  53362. case "WEBGL_compressed_texture_s3tc":
  53363. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  53364. break;
  53365. case "WEBGL_compressed_texture_pvrtc":
  53366. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  53367. break;
  53368. case "WEBGL_compressed_texture_etc1":
  53369. n = e.getExtension("WEBGL_compressed_texture_etc1");
  53370. break;
  53371. default:
  53372. n = e.getExtension(i)
  53373. }
  53374. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  53375. t[i] = n,
  53376. n
  53377. }
  53378. }
  53379. ,
  53380. n.WebGLCapabilities = function(e, t, i) {
  53381. function n(t) {
  53382. if ("highp" === t) {
  53383. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  53384. return "highp";
  53385. t = "mediump"
  53386. }
  53387. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  53388. }
  53389. this.getMaxPrecision = n,
  53390. this.precision = void 0 !== i.precision ? i.precision : "highp",
  53391. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  53392. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  53393. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  53394. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  53395. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  53396. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  53397. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  53398. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  53399. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  53400. this.vertexTextures = this.maxVertexTextures > 0,
  53401. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  53402. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  53403. var r = n(this.precision);
  53404. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  53405. this.precision = r),
  53406. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  53407. }
  53408. ,
  53409. n.WebGLGeometries = function(e, t, i) {
  53410. function r(e) {
  53411. var t = e.geometry;
  53412. if (void 0 !== h[t.id])
  53413. return h[t.id];
  53414. t.addEventListener("dispose", o);
  53415. var r;
  53416. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  53417. r = t._bufferGeometry),
  53418. h[t.id] = r,
  53419. i.memory.geometries++,
  53420. r
  53421. }
  53422. function o(e) {
  53423. var n = e.target
  53424. , r = h[n.id];
  53425. null !== r.index && s(r.index),
  53426. l(r.attributes),
  53427. n.removeEventListener("dispose", o),
  53428. delete h[n.id];
  53429. var a = t.get(n);
  53430. a.wireframe && s(a.wireframe),
  53431. t.delete(n);
  53432. var c = t.get(r);
  53433. c.wireframe && s(c.wireframe),
  53434. t.delete(r),
  53435. i.memory.geometries--
  53436. }
  53437. function a(e) {
  53438. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53439. }
  53440. function s(t) {
  53441. var i = a(t);
  53442. void 0 !== i && (e.deleteBuffer(i),
  53443. c(t))
  53444. }
  53445. function l(e) {
  53446. for (var t in e)
  53447. s(e[t])
  53448. }
  53449. function c(e) {
  53450. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  53451. }
  53452. var h = {};
  53453. this.get = r
  53454. }
  53455. ,
  53456. n.WebGLLights = function() {
  53457. var e = {};
  53458. this.get = function(t) {
  53459. if (void 0 !== e[t.id])
  53460. return e[t.id];
  53461. var i;
  53462. switch (t.type) {
  53463. case "DirectionalLight":
  53464. i = {
  53465. direction: new n.Vector3,
  53466. color: new n.Color,
  53467. shadow: !1,
  53468. shadowBias: 0,
  53469. shadowRadius: 1,
  53470. shadowMapSize: new n.Vector2
  53471. };
  53472. break;
  53473. case "SpotLight":
  53474. i = {
  53475. position: new n.Vector3,
  53476. direction: new n.Vector3,
  53477. color: new n.Color,
  53478. distance: 0,
  53479. coneCos: 0,
  53480. penumbraCos: 0,
  53481. decay: 0,
  53482. shadow: !1,
  53483. shadowBias: 0,
  53484. shadowRadius: 1,
  53485. shadowMapSize: new n.Vector2
  53486. };
  53487. break;
  53488. case "PointLight":
  53489. i = {
  53490. position: new n.Vector3,
  53491. color: new n.Color,
  53492. distance: 0,
  53493. decay: 0,
  53494. shadow: !1,
  53495. shadowBias: 0,
  53496. shadowRadius: 1,
  53497. shadowMapSize: new n.Vector2
  53498. };
  53499. break;
  53500. case "HemisphereLight":
  53501. i = {
  53502. direction: new n.Vector3,
  53503. skyColor: new n.Color,
  53504. groundColor: new n.Color
  53505. }
  53506. }
  53507. return e[t.id] = i,
  53508. i
  53509. }
  53510. }
  53511. ,
  53512. n.WebGLObjects = function(e, t, i) {
  53513. function r(t) {
  53514. var i = u.get(t);
  53515. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  53516. var r = i.index
  53517. , a = i.attributes;
  53518. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  53519. for (var s in a)
  53520. o(a[s], e.ARRAY_BUFFER);
  53521. var l = i.morphAttributes;
  53522. for (var s in l)
  53523. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  53524. o(c[h], e.ARRAY_BUFFER);
  53525. return i
  53526. }
  53527. function o(e, i) {
  53528. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  53529. , o = t.get(r);
  53530. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  53531. }
  53532. function a(t, i, n) {
  53533. t.__webglBuffer = e.createBuffer(),
  53534. e.bindBuffer(n, t.__webglBuffer);
  53535. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  53536. e.bufferData(n, i.array, r),
  53537. t.version = i.version
  53538. }
  53539. function s(t, i, n) {
  53540. e.bindBuffer(n, t.__webglBuffer),
  53541. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  53542. i.updateRange.count = 0),
  53543. t.version = i.version
  53544. }
  53545. function l(e) {
  53546. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53547. }
  53548. function c(i) {
  53549. var r = t.get(i);
  53550. if (void 0 !== r.wireframe)
  53551. return r.wireframe;
  53552. var a = []
  53553. , s = i.index
  53554. , l = i.attributes
  53555. , c = l.position;
  53556. if (null !== s)
  53557. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  53558. var g = d[p + 0]
  53559. , m = d[p + 1]
  53560. , v = d[p + 2];
  53561. h(u, g, m) && a.push(g, m),
  53562. h(u, m, v) && a.push(m, v),
  53563. h(u, v, g) && a.push(v, g)
  53564. }
  53565. else
  53566. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  53567. var g = p + 0
  53568. , m = p + 1
  53569. , v = p + 2;
  53570. a.push(g, m, m, v, v, g)
  53571. }
  53572. var A = c.count > 65535 ? Uint32Array : Uint16Array
  53573. , y = new n.BufferAttribute(new A(a),1);
  53574. return o(y, e.ELEMENT_ARRAY_BUFFER),
  53575. r.wireframe = y,
  53576. y
  53577. }
  53578. function h(e, t, i) {
  53579. if (t > i) {
  53580. var n = t;
  53581. t = i,
  53582. i = n
  53583. }
  53584. var r = e[t];
  53585. return void 0 === r ? (e[t] = [i],
  53586. !0) : r.indexOf(i) === -1 && (r.push(i),
  53587. !0)
  53588. }
  53589. var u = new n.WebGLGeometries(e,t,i);
  53590. this.getAttributeBuffer = l,
  53591. this.getWireframeAttribute = c,
  53592. this.update = r
  53593. }
  53594. ,
  53595. n.WebGLProgram = function() {
  53596. function e(e) {
  53597. switch (e) {
  53598. case n.LinearEncoding:
  53599. return ["Linear", "( value )"];
  53600. case n.sRGBEncoding:
  53601. return ["sRGB", "( value )"];
  53602. case n.RGBEEncoding:
  53603. return ["RGBE", "( value )"];
  53604. case n.RGBM7Encoding:
  53605. return ["RGBM", "( value, 7.0 )"];
  53606. case n.RGBM16Encoding:
  53607. return ["RGBM", "( value, 16.0 )"];
  53608. case n.RGBDEncoding:
  53609. return ["RGBD", "( value, 256.0 )"];
  53610. case n.GammaEncoding:
  53611. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  53612. default:
  53613. throw new Error("unsupported encoding: " + e)
  53614. }
  53615. }
  53616. function t(t, i) {
  53617. var n = e(i);
  53618. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  53619. }
  53620. function i(t, i) {
  53621. var n = e(i);
  53622. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  53623. }
  53624. function r(e, t) {
  53625. var i;
  53626. switch (t) {
  53627. case n.LinearToneMapping:
  53628. i = "Linear";
  53629. break;
  53630. case n.ReinhardToneMapping:
  53631. i = "Reinhard";
  53632. break;
  53633. case n.Uncharted2ToneMapping:
  53634. i = "Uncharted2";
  53635. break;
  53636. case n.CineonToneMapping:
  53637. i = "OptimizedCineon";
  53638. break;
  53639. default:
  53640. throw new Error("unsupported toneMapping: " + t)
  53641. }
  53642. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  53643. }
  53644. function o(e, t, i) {
  53645. e = e || {};
  53646. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  53647. return n.filter(c).join("\n")
  53648. }
  53649. function a(e) {
  53650. var t = [];
  53651. for (var i in e) {
  53652. var n = e[i];
  53653. n !== !1 && t.push("#define " + i + " " + n)
  53654. }
  53655. return t.join("\n")
  53656. }
  53657. function s(e, t, i) {
  53658. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53659. var a = e.getActiveUniform(t, o)
  53660. , s = a.name
  53661. , l = e.getUniformLocation(t, s)
  53662. , c = f.exec(s);
  53663. if (c) {
  53664. var h = c[1]
  53665. , u = c[2]
  53666. , d = n[h];
  53667. d || (d = n[h] = {}),
  53668. d[u] = l
  53669. } else if (c = g.exec(s)) {
  53670. var p = c[1]
  53671. , v = c[2]
  53672. , A = c[3]
  53673. , y = n[p];
  53674. y || (y = n[p] = []);
  53675. var C = y[v];
  53676. C || (C = y[v] = {}),
  53677. C[A] = l
  53678. } else if (c = m.exec(s)) {
  53679. var p = c[1];
  53680. n[p] = l
  53681. } else
  53682. n[s] = l
  53683. }
  53684. return n
  53685. }
  53686. function l(e, t, i) {
  53687. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53688. var a = e.getActiveAttrib(t, o)
  53689. , s = a.name;
  53690. n[s] = e.getAttribLocation(t, s)
  53691. }
  53692. return n
  53693. }
  53694. function c(e) {
  53695. return "" !== e
  53696. }
  53697. function h(e, t) {
  53698. return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  53699. }
  53700. function u(e) {
  53701. function t(e, t) {
  53702. var i = n.ShaderChunk[t];
  53703. if (void 0 === i)
  53704. throw new Error("Can not resolve #include <" + t + ">");
  53705. return u(i)
  53706. }
  53707. var i = /#include +<([\w\d.]+)>/g;
  53708. return e.replace(i, t)
  53709. }
  53710. function d(e) {
  53711. function t(e, t, i, n) {
  53712. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53713. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53714. return r
  53715. }
  53716. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53717. return e.replace(i, t)
  53718. }
  53719. var p = 0
  53720. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53721. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53722. , m = /^([\w\d_]+)\[0\]$/;
  53723. return function(e, f, g, m) {
  53724. var v = e.context
  53725. , A = g.extensions
  53726. , y = g.defines
  53727. , C = g.__webglShader.vertexShader
  53728. , I = g.__webglShader.fragmentShader
  53729. , E = "SHADOWMAP_TYPE_BASIC";
  53730. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53731. var b = "ENVMAP_TYPE_CUBE"
  53732. , w = "ENVMAP_MODE_REFLECTION"
  53733. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53734. if (m.envMap) {
  53735. switch (g.envMap.mapping) {
  53736. case n.CubeReflectionMapping:
  53737. case n.CubeRefractionMapping:
  53738. b = "ENVMAP_TYPE_CUBE";
  53739. break;
  53740. case n.CubeUVReflectionMapping:
  53741. case n.CubeUVRefractionMapping:
  53742. b = "ENVMAP_TYPE_CUBE_UV";
  53743. break;
  53744. case n.EquirectangularReflectionMapping:
  53745. case n.EquirectangularRefractionMapping:
  53746. b = "ENVMAP_TYPE_EQUIREC";
  53747. break;
  53748. case n.SphericalReflectionMapping:
  53749. b = "ENVMAP_TYPE_SPHERE"
  53750. }
  53751. switch (g.envMap.mapping) {
  53752. case n.CubeRefractionMapping:
  53753. case n.EquirectangularRefractionMapping:
  53754. w = "ENVMAP_MODE_REFRACTION"
  53755. }
  53756. switch (g.combine) {
  53757. case n.MultiplyOperation:
  53758. _ = "ENVMAP_BLENDING_MULTIPLY";
  53759. break;
  53760. case n.MixOperation:
  53761. _ = "ENVMAP_BLENDING_MIX";
  53762. break;
  53763. case n.AddOperation:
  53764. _ = "ENVMAP_BLENDING_ADD"
  53765. }
  53766. }
  53767. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53768. g instanceof n.RawShaderMaterial ? (T = "",
  53769. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  53770. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  53771. C = u(C, m),
  53772. C = h(C, m),
  53773. I = u(I, m),
  53774. I = h(I, m),
  53775. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53776. I = d(I));
  53777. var O = T + C
  53778. , L = x + I
  53779. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53780. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53781. v.attachShader(P, D),
  53782. v.attachShader(P, N),
  53783. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53784. v.linkProgram(P);
  53785. var B = v.getProgramInfoLog(P)
  53786. , F = v.getShaderInfoLog(D)
  53787. , V = v.getShaderInfoLog(N)
  53788. , U = !0
  53789. , k = !0;
  53790. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53791. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  53792. k && (this.diagnostics = {
  53793. runnable: U,
  53794. material: g,
  53795. programLog: B,
  53796. vertexShader: {
  53797. log: F,
  53798. prefix: T
  53799. },
  53800. fragmentShader: {
  53801. log: V,
  53802. prefix: x
  53803. }
  53804. }),
  53805. v.deleteShader(D),
  53806. v.deleteShader(N);
  53807. var H;
  53808. this.getUniforms = function() {
  53809. return void 0 === H && (H = s(v, P)),
  53810. H
  53811. }
  53812. ;
  53813. var G;
  53814. return this.getAttributes = function() {
  53815. return void 0 === G && (G = l(v, P)),
  53816. G
  53817. }
  53818. ,
  53819. this.destroy = function() {
  53820. v.deleteProgram(P),
  53821. this.program = void 0
  53822. }
  53823. ,
  53824. Object.defineProperties(this, {
  53825. uniforms: {
  53826. get: function() {
  53827. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53828. this.getUniforms()
  53829. }
  53830. },
  53831. attributes: {
  53832. get: function() {
  53833. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53834. this.getAttributes()
  53835. }
  53836. }
  53837. }),
  53838. this.id = p++,
  53839. this.code = f,
  53840. this.usedTimes = 1,
  53841. this.program = P,
  53842. this.vertexShader = D,
  53843. this.fragmentShader = N,
  53844. this
  53845. }
  53846. }(),
  53847. n.WebGLPrograms = function(e, t) {
  53848. function i(e) {
  53849. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53850. return 1024;
  53851. var i = t.maxVertexUniforms
  53852. , r = Math.floor((i - 20) / 4)
  53853. , o = r;
  53854. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53855. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  53856. o
  53857. }
  53858. function r(e, t) {
  53859. var i;
  53860. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53861. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53862. i
  53863. }
  53864. var o = []
  53865. , a = {
  53866. MeshDepthMaterial: "depth",
  53867. MeshNormalMaterial: "normal",
  53868. MeshBasicMaterial: "basic",
  53869. MeshLambertMaterial: "lambert",
  53870. MeshPhongMaterial: "phong",
  53871. MeshStandardMaterial: "standard",
  53872. LineBasicMaterial: "basic",
  53873. LineDashedMaterial: "dashed",
  53874. PointsMaterial: "points"
  53875. }
  53876. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  53877. this.getParameters = function(o, s, l, c) {
  53878. var h = a[o.type]
  53879. , u = i(c)
  53880. , d = e.getPrecision();
  53881. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53882. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53883. var p = {
  53884. shaderID: h,
  53885. precision: d,
  53886. supportsVertexTextures: t.vertexTextures,
  53887. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53888. map: !!o.map,
  53889. mapEncoding: r(o.map, e.gammaInput),
  53890. envMap: !!o.envMap,
  53891. envMapMode: o.envMap && o.envMap.mapping,
  53892. envMapEncoding: r(o.envMap, e.gammaInput),
  53893. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53894. lightMap: !!o.lightMap,
  53895. aoMap: !!o.aoMap,
  53896. emissiveMap: !!o.emissiveMap,
  53897. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53898. bumpMap: !!o.bumpMap,
  53899. normalMap: !!o.normalMap,
  53900. displacementMap: !!o.displacementMap,
  53901. roughnessMap: !!o.roughnessMap,
  53902. metalnessMap: !!o.metalnessMap,
  53903. specularMap: !!o.specularMap,
  53904. alphaMap: !!o.alphaMap,
  53905. combine: o.combine,
  53906. vertexColors: o.vertexColors,
  53907. fog: l,
  53908. useFog: o.fog,
  53909. fogExp: l instanceof n.FogExp2,
  53910. flatShading: o.shading === n.FlatShading,
  53911. sizeAttenuation: o.sizeAttenuation,
  53912. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53913. skinning: o.skinning,
  53914. maxBones: u,
  53915. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53916. morphTargets: o.morphTargets,
  53917. morphNormals: o.morphNormals,
  53918. maxMorphTargets: e.maxMorphTargets,
  53919. maxMorphNormals: e.maxMorphNormals,
  53920. numDirLights: s.directional.length,
  53921. numPointLights: s.point.length,
  53922. numSpotLights: s.spot.length,
  53923. numHemiLights: s.hemi.length,
  53924. pointLightShadows: s.shadowsPointLight,
  53925. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53926. shadowMapType: e.shadowMap.type,
  53927. toneMapping: e.toneMapping,
  53928. physicallyCorrectLights: e.physicallyCorrectLights,
  53929. premultipliedAlpha: o.premultipliedAlpha,
  53930. alphaTest: o.alphaTest,
  53931. doubleSided: o.side === n.DoubleSide,
  53932. flipSided: o.side === n.BackSide
  53933. };
  53934. return p
  53935. }
  53936. ,
  53937. this.getProgramCode = function(e, t) {
  53938. var i = [];
  53939. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53940. i.push(e.vertexShader)),
  53941. void 0 !== e.defines)
  53942. for (var n in e.defines)
  53943. i.push(n),
  53944. i.push(e.defines[n]);
  53945. for (var r = 0; r < s.length; r++) {
  53946. var o = s[r];
  53947. i.push(o),
  53948. i.push(t[o])
  53949. }
  53950. return i.join()
  53951. }
  53952. ,
  53953. this.acquireProgram = function(t, i, r) {
  53954. for (var a, s = 0, l = o.length; s < l; s++) {
  53955. var c = o[s];
  53956. if (c.code === r) {
  53957. a = c,
  53958. ++a.usedTimes;
  53959. break
  53960. }
  53961. }
  53962. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53963. o.push(a)),
  53964. a
  53965. }
  53966. ,
  53967. this.releaseProgram = function(e) {
  53968. if (0 === --e.usedTimes) {
  53969. var t = o.indexOf(e);
  53970. o[t] = o[o.length - 1],
  53971. o.pop(),
  53972. e.destroy()
  53973. }
  53974. }
  53975. ,
  53976. this.programs = o
  53977. }
  53978. ,
  53979. n.WebGLProperties = function() {
  53980. var e = {};
  53981. this.get = function(t) {
  53982. var i = t.uuid
  53983. , n = e[i];
  53984. return void 0 === n && (n = {},
  53985. e[i] = n),
  53986. n
  53987. }
  53988. ,
  53989. this.delete = function(t) {
  53990. delete e[t.uuid]
  53991. }
  53992. ,
  53993. this.clear = function() {
  53994. e = {}
  53995. }
  53996. }
  53997. ,
  53998. n.WebGLShader = function() {
  53999. function e(e) {
  54000. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  54001. t[i] = i + 1 + ": " + t[i];
  54002. return t.join("\n")
  54003. }
  54004. return function(t, i, n) {
  54005. var r = t.createShader(i);
  54006. return t.shaderSource(r, n),
  54007. t.compileShader(r),
  54008. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  54009. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  54010. r
  54011. }
  54012. }(),
  54013. n.WebGLShadowMap = function(e, t, i) {
  54014. function r(e, t, i, r) {
  54015. var o = e.geometry
  54016. , a = null
  54017. , s = v
  54018. , l = e.customDepthMaterial;
  54019. if (i && (s = A,
  54020. l = e.customDistanceMaterial),
  54021. l)
  54022. a = l;
  54023. else {
  54024. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  54025. , h = e instanceof n.SkinnedMesh && t.skinning
  54026. , u = 0;
  54027. c && (u |= f),
  54028. h && (u |= g),
  54029. a = s[u]
  54030. }
  54031. return a.visible = t.visible,
  54032. a.wireframe = t.wireframe,
  54033. a.wireframeLinewidth = t.wireframeLinewidth,
  54034. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  54035. a
  54036. }
  54037. function o(e, t, i) {
  54038. if (e.visible !== !1) {
  54039. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  54040. var r = e.material;
  54041. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  54042. p.push(e))
  54043. }
  54044. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  54045. o(a[s], t, i)
  54046. }
  54047. }
  54048. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  54049. var x = 0 !== (T & f)
  54050. , S = 0 !== (T & g)
  54051. , M = new n.ShaderMaterial({
  54052. uniforms: b,
  54053. vertexShader: E.vertexShader,
  54054. fragmentShader: E.fragmentShader,
  54055. morphTargets: x,
  54056. skinning: S
  54057. });
  54058. v[T] = M;
  54059. var R = new n.ShaderMaterial({
  54060. defines: {
  54061. USE_SHADOWMAP: ""
  54062. },
  54063. uniforms: _,
  54064. vertexShader: w.vertexShader,
  54065. fragmentShader: w.fragmentShader,
  54066. morphTargets: x,
  54067. skinning: S
  54068. });
  54069. A[T] = R
  54070. }
  54071. var P = this;
  54072. this.enabled = !1,
  54073. this.autoUpdate = !0,
  54074. this.needsUpdate = !1,
  54075. this.type = n.PCFShadowMap,
  54076. this.cullFace = n.CullFaceFront,
  54077. this.render = function(f, g) {
  54078. var m, v, A = t.shadows;
  54079. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  54080. s.clearColor(1, 1, 1, 1),
  54081. s.disable(a.BLEND),
  54082. s.enable(a.CULL_FACE),
  54083. a.frontFace(a.CCW),
  54084. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  54085. s.setDepthTest(!0),
  54086. s.setScissorTest(!1);
  54087. for (var E = 0, b = A.length; E < b; E++) {
  54088. var w = A[E]
  54089. , _ = w.shadow
  54090. , T = _.camera;
  54091. if (h.copy(_.mapSize),
  54092. w instanceof n.PointLight) {
  54093. m = 6,
  54094. v = !0;
  54095. var x = h.x
  54096. , S = h.y;
  54097. I[0].set(2 * x, S, x, S),
  54098. I[1].set(0, S, x, S),
  54099. I[2].set(3 * x, S, x, S),
  54100. I[3].set(x, S, x, S),
  54101. I[4].set(3 * x, 0, x, S),
  54102. I[5].set(x, 0, x, S),
  54103. h.x *= 4,
  54104. h.y *= 2
  54105. } else
  54106. m = 1,
  54107. v = !1;
  54108. if (null === _.map) {
  54109. var M = {
  54110. minFilter: n.NearestFilter,
  54111. magFilter: n.NearestFilter,
  54112. format: n.RGBAFormat
  54113. };
  54114. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  54115. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  54116. T.updateProjectionMatrix()
  54117. }
  54118. var R = _.map
  54119. , O = _.matrix;
  54120. d.setFromMatrixPosition(w.matrixWorld),
  54121. T.position.copy(d),
  54122. e.setRenderTarget(R),
  54123. e.clear();
  54124. for (var L = 0; L < m; L++) {
  54125. if (v) {
  54126. u.copy(T.position),
  54127. u.add(y[L]),
  54128. T.up.copy(C[L]),
  54129. T.lookAt(u);
  54130. var D = I[L];
  54131. s.viewport(D)
  54132. } else
  54133. u.setFromMatrixPosition(w.target.matrixWorld),
  54134. T.lookAt(u);
  54135. T.updateMatrixWorld(),
  54136. T.matrixWorldInverse.getInverse(T.matrixWorld),
  54137. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  54138. O.multiply(T.projectionMatrix),
  54139. O.multiply(T.matrixWorldInverse),
  54140. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  54141. l.setFromMatrix(c),
  54142. p.length = 0,
  54143. o(f, g, T);
  54144. for (var N = 0, B = p.length; N < B; N++) {
  54145. var F = p[N]
  54146. , V = i.update(F)
  54147. , U = F.material;
  54148. if (U instanceof n.MultiMaterial)
  54149. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  54150. var W = k[G]
  54151. , j = H[W.materialIndex];
  54152. if (j.visible === !0) {
  54153. var Y = r(F, j, v, d);
  54154. e.renderBufferDirect(T, null, V, Y, F, W)
  54155. }
  54156. }
  54157. else {
  54158. var Y = r(F, U, v, d);
  54159. e.renderBufferDirect(T, null, V, Y, F, null)
  54160. }
  54161. }
  54162. }
  54163. }
  54164. var X = e.getClearColor()
  54165. , Z = e.getClearAlpha();
  54166. e.setClearColor(X, Z),
  54167. s.enable(a.BLEND),
  54168. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  54169. P.needsUpdate = !1
  54170. }
  54171. }
  54172. }
  54173. ,
  54174. n.WebGLState = function(e, t, i) {
  54175. var r = this
  54176. , o = new n.Vector4
  54177. , a = new Uint8Array(16)
  54178. , s = new Uint8Array(16)
  54179. , l = new Uint8Array(16)
  54180. , c = {}
  54181. , h = null
  54182. , u = null
  54183. , d = null
  54184. , p = null
  54185. , f = null
  54186. , g = null
  54187. , m = null
  54188. , v = null
  54189. , A = !1
  54190. , y = null
  54191. , C = null
  54192. , I = null
  54193. , E = null
  54194. , b = null
  54195. , w = null
  54196. , _ = null
  54197. , T = null
  54198. , x = null
  54199. , S = null
  54200. , M = null
  54201. , R = null
  54202. , P = null
  54203. , O = null
  54204. , L = null
  54205. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  54206. , N = void 0
  54207. , B = {}
  54208. , F = new n.Vector4
  54209. , V = null
  54210. , U = null
  54211. , k = new n.Vector4
  54212. , H = new n.Vector4
  54213. , G = e.createTexture();
  54214. e.bindTexture(e.TEXTURE_2D, G),
  54215. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  54216. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  54217. this.init = function() {
  54218. this.clearColor(0, 0, 0, 1),
  54219. this.clearDepth(1),
  54220. this.clearStencil(0),
  54221. this.enable(e.DEPTH_TEST),
  54222. e.depthFunc(e.LEQUAL),
  54223. e.frontFace(e.CCW),
  54224. e.cullFace(e.BACK),
  54225. this.enable(e.CULL_FACE),
  54226. this.enable(e.BLEND),
  54227. e.blendEquation(e.FUNC_ADD),
  54228. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  54229. }
  54230. ,
  54231. this.initAttributes = function() {
  54232. for (var e = 0, t = a.length; e < t; e++)
  54233. a[e] = 0
  54234. }
  54235. ,
  54236. this.enableAttribute = function(i) {
  54237. if (a[i] = 1,
  54238. 0 === s[i] && (e.enableVertexAttribArray(i),
  54239. s[i] = 1),
  54240. 0 !== l[i]) {
  54241. var n = t.get("ANGLE_instanced_arrays");
  54242. n.vertexAttribDivisorANGLE(i, 0),
  54243. l[i] = 0
  54244. }
  54245. }
  54246. ,
  54247. this.enableAttributeAndDivisor = function(t, i, n) {
  54248. a[t] = 1,
  54249. 0 === s[t] && (e.enableVertexAttribArray(t),
  54250. s[t] = 1),
  54251. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  54252. l[t] = i)
  54253. }
  54254. ,
  54255. this.disableUnusedAttributes = function() {
  54256. for (var t = 0, i = s.length; t < i; t++)
  54257. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  54258. s[t] = 0)
  54259. }
  54260. ,
  54261. this.enable = function(t) {
  54262. c[t] !== !0 && (e.enable(t),
  54263. c[t] = !0)
  54264. }
  54265. ,
  54266. this.disable = function(t) {
  54267. c[t] !== !1 && (e.disable(t),
  54268. c[t] = !1)
  54269. }
  54270. ,
  54271. this.getCompressedTextureFormats = function() {
  54272. if (null === h && (h = [],
  54273. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  54274. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  54275. h.push(i[n]);
  54276. return h
  54277. }
  54278. ,
  54279. this.setBlending = function(t, r, o, a, s, l, c, h) {
  54280. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  54281. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54282. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  54283. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54284. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  54285. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54286. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  54287. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54288. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  54289. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  54290. u = t,
  54291. A = h),
  54292. t === n.CustomBlending ? (s = s || r,
  54293. l = l || o,
  54294. c = c || a,
  54295. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  54296. d = r,
  54297. g = s),
  54298. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  54299. p = o,
  54300. f = a,
  54301. m = l,
  54302. v = c)) : (d = null,
  54303. p = null,
  54304. f = null,
  54305. g = null,
  54306. m = null,
  54307. v = null)
  54308. }
  54309. ,
  54310. this.setDepthFunc = function(t) {
  54311. if (y !== t) {
  54312. if (t)
  54313. switch (t) {
  54314. case n.NeverDepth:
  54315. e.depthFunc(e.NEVER);
  54316. break;
  54317. case n.AlwaysDepth:
  54318. e.depthFunc(e.ALWAYS);
  54319. break;
  54320. case n.LessDepth:
  54321. e.depthFunc(e.LESS);
  54322. break;
  54323. case n.LessEqualDepth:
  54324. e.depthFunc(e.LEQUAL);
  54325. break;
  54326. case n.EqualDepth:
  54327. e.depthFunc(e.EQUAL);
  54328. break;
  54329. case n.GreaterEqualDepth:
  54330. e.depthFunc(e.GEQUAL);
  54331. break;
  54332. case n.GreaterDepth:
  54333. e.depthFunc(e.GREATER);
  54334. break;
  54335. case n.NotEqualDepth:
  54336. e.depthFunc(e.NOTEQUAL);
  54337. break;
  54338. default:
  54339. e.depthFunc(e.LEQUAL)
  54340. }
  54341. else
  54342. e.depthFunc(e.LEQUAL);
  54343. y = t
  54344. }
  54345. }
  54346. ,
  54347. this.setDepthTest = function(t) {
  54348. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  54349. }
  54350. ,
  54351. this.setDepthWrite = function(t) {
  54352. C !== t && (e.depthMask(t),
  54353. C = t)
  54354. }
  54355. ,
  54356. this.setColorWrite = function(t) {
  54357. I !== t && (e.colorMask(t, t, t, t),
  54358. I = t)
  54359. }
  54360. ,
  54361. this.setStencilFunc = function(t, i, n) {
  54362. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  54363. b = t,
  54364. w = i,
  54365. _ = n)
  54366. }
  54367. ,
  54368. this.setStencilOp = function(t, i, n) {
  54369. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  54370. T = t,
  54371. x = i,
  54372. S = n)
  54373. }
  54374. ,
  54375. this.setStencilTest = function(t) {
  54376. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  54377. }
  54378. ,
  54379. this.setStencilWrite = function(t) {
  54380. E !== t && (e.stencilMask(t),
  54381. E = t)
  54382. }
  54383. ,
  54384. this.setFlipSided = function(t) {
  54385. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  54386. M = t)
  54387. }
  54388. ,
  54389. this.setLineWidth = function(t) {
  54390. t !== R && (e.lineWidth(t),
  54391. R = t)
  54392. }
  54393. ,
  54394. this.setPolygonOffset = function(t, i, n) {
  54395. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  54396. !t || P === i && O === n || (e.polygonOffset(i, n),
  54397. P = i,
  54398. O = n)
  54399. }
  54400. ,
  54401. this.getScissorTest = function() {
  54402. return L
  54403. }
  54404. ,
  54405. this.setScissorTest = function(t) {
  54406. L = t,
  54407. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  54408. }
  54409. ,
  54410. this.activeTexture = function(t) {
  54411. void 0 === t && (t = e.TEXTURE0 + D - 1),
  54412. N !== t && (e.activeTexture(t),
  54413. N = t)
  54414. }
  54415. ,
  54416. this.bindTexture = function(t, i) {
  54417. void 0 === N && r.activeTexture();
  54418. var n = B[N];
  54419. void 0 === n && (n = {
  54420. type: void 0,
  54421. texture: void 0
  54422. },
  54423. B[N] = n),
  54424. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  54425. n.type = t,
  54426. n.texture = i)
  54427. }
  54428. ,
  54429. this.compressedTexImage2D = function() {
  54430. try {
  54431. e.compressedTexImage2D.apply(e, arguments)
  54432. } catch (e) {
  54433. console.error(e)
  54434. }
  54435. }
  54436. ,
  54437. this.texImage2D = function() {
  54438. try {
  54439. e.texImage2D.apply(e, arguments)
  54440. } catch (e) {
  54441. console.error(e)
  54442. }
  54443. }
  54444. ,
  54445. this.clearColor = function(t, i, n, r) {
  54446. o.set(t, i, n, r),
  54447. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  54448. F.copy(o))
  54449. }
  54450. ,
  54451. this.clearDepth = function(t) {
  54452. V !== t && (e.clearDepth(t),
  54453. V = t)
  54454. }
  54455. ,
  54456. this.clearStencil = function(t) {
  54457. U !== t && (e.clearStencil(t),
  54458. U = t)
  54459. }
  54460. ,
  54461. this.scissor = function(t) {
  54462. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  54463. k.copy(t))
  54464. }
  54465. ,
  54466. this.viewport = function(t) {
  54467. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  54468. H.copy(t))
  54469. }
  54470. ,
  54471. this.reset = function() {
  54472. for (var t = 0; t < s.length; t++)
  54473. 1 === s[t] && (e.disableVertexAttribArray(t),
  54474. s[t] = 0);
  54475. c = {},
  54476. h = null,
  54477. N = void 0,
  54478. B = {},
  54479. u = null,
  54480. I = null,
  54481. C = null,
  54482. E = null,
  54483. M = null
  54484. }
  54485. }
  54486. ,
  54487. n.LensFlarePlugin = function(e, t) {
  54488. function i() {
  54489. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  54490. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54491. o = p.createBuffer(),
  54492. a = p.createBuffer(),
  54493. p.bindBuffer(p.ARRAY_BUFFER, o),
  54494. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  54495. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54496. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  54497. u = p.createTexture(),
  54498. d = p.createTexture(),
  54499. f.bindTexture(p.TEXTURE_2D, u),
  54500. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  54501. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54502. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54503. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54504. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54505. f.bindTexture(p.TEXTURE_2D, d),
  54506. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  54507. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54508. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54509. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54510. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54511. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  54512. var i;
  54513. i = h ? {
  54514. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "uniform sampler2D occlusionMap;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", "vVisibility = visibility.r / 9.0;", "vVisibility *= 1.0 - visibility.g / 9.0;", "vVisibility *= visibility.b / 9.0;", "vVisibility *= 1.0 - visibility.a / 9.0;", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  54515. fragmentShader: ["uniform lowp int renderType;", "uniform sampler2D map;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * vVisibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  54516. } : {
  54517. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  54518. fragmentShader: ["precision mediump float;", "uniform lowp int renderType;", "uniform sampler2D map;", "uniform sampler2D occlusionMap;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", "visibility = ( 1.0 - visibility / 4.0 );", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * visibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  54519. },
  54520. s = r(i),
  54521. l = {
  54522. vertex: p.getAttribLocation(s, "position"),
  54523. uv: p.getAttribLocation(s, "uv")
  54524. },
  54525. c = {
  54526. renderType: p.getUniformLocation(s, "renderType"),
  54527. map: p.getUniformLocation(s, "map"),
  54528. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  54529. opacity: p.getUniformLocation(s, "opacity"),
  54530. color: p.getUniformLocation(s, "color"),
  54531. scale: p.getUniformLocation(s, "scale"),
  54532. rotation: p.getUniformLocation(s, "rotation"),
  54533. screenPosition: p.getUniformLocation(s, "screenPosition")
  54534. }
  54535. }
  54536. function r(t) {
  54537. var i = p.createProgram()
  54538. , n = p.createShader(p.FRAGMENT_SHADER)
  54539. , r = p.createShader(p.VERTEX_SHADER)
  54540. , o = "precision " + e.getPrecision() + " float;\n";
  54541. return p.shaderSource(n, o + t.fragmentShader),
  54542. p.shaderSource(r, o + t.vertexShader),
  54543. p.compileShader(n),
  54544. p.compileShader(r),
  54545. p.attachShader(i, n),
  54546. p.attachShader(i, r),
  54547. p.linkProgram(i),
  54548. i
  54549. }
  54550. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  54551. this.render = function(r, g, m) {
  54552. if (0 !== t.length) {
  54553. var v = new n.Vector3
  54554. , A = m.w / m.z
  54555. , y = .5 * m.z
  54556. , C = .5 * m.w
  54557. , I = 16 / m.w
  54558. , E = new n.Vector2(I * A,I)
  54559. , b = new n.Vector3(1,1,0)
  54560. , w = new n.Vector2(1,1);
  54561. void 0 === s && i(),
  54562. p.useProgram(s),
  54563. f.initAttributes(),
  54564. f.enableAttribute(l.vertex),
  54565. f.enableAttribute(l.uv),
  54566. f.disableUnusedAttributes(),
  54567. p.uniform1i(c.occlusionMap, 0),
  54568. p.uniform1i(c.map, 1),
  54569. p.bindBuffer(p.ARRAY_BUFFER, o),
  54570. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  54571. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  54572. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54573. f.disable(p.CULL_FACE),
  54574. f.setDepthWrite(!1);
  54575. for (var _ = 0, T = t.length; _ < T; _++) {
  54576. I = 16 / m.w,
  54577. E.set(I * A, I);
  54578. var x = t[_];
  54579. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  54580. v.applyMatrix4(g.matrixWorldInverse),
  54581. v.applyProjection(g.projectionMatrix),
  54582. b.copy(v),
  54583. w.x = b.x * y + y,
  54584. w.y = b.y * C + C,
  54585. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  54586. f.activeTexture(p.TEXTURE0),
  54587. f.bindTexture(p.TEXTURE_2D, null),
  54588. f.activeTexture(p.TEXTURE1),
  54589. f.bindTexture(p.TEXTURE_2D, u),
  54590. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54591. p.uniform1i(c.renderType, 0),
  54592. p.uniform2f(c.scale, E.x, E.y),
  54593. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54594. f.disable(p.BLEND),
  54595. f.enable(p.DEPTH_TEST),
  54596. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54597. f.activeTexture(p.TEXTURE0),
  54598. f.bindTexture(p.TEXTURE_2D, d),
  54599. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54600. p.uniform1i(c.renderType, 1),
  54601. f.disable(p.DEPTH_TEST),
  54602. f.activeTexture(p.TEXTURE1),
  54603. f.bindTexture(p.TEXTURE_2D, u),
  54604. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54605. x.positionScreen.copy(b),
  54606. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  54607. p.uniform1i(c.renderType, 2),
  54608. f.enable(p.BLEND);
  54609. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  54610. var R = x.lensFlares[S];
  54611. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  54612. b.y = R.y,
  54613. b.z = R.z,
  54614. I = R.size * R.scale / m.w,
  54615. E.x = I * A,
  54616. E.y = I,
  54617. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54618. p.uniform2f(c.scale, E.x, E.y),
  54619. p.uniform1f(c.rotation, R.rotation),
  54620. p.uniform1f(c.opacity, R.opacity),
  54621. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  54622. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  54623. e.setTexture(R.texture, 1),
  54624. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  54625. }
  54626. }
  54627. }
  54628. f.enable(p.CULL_FACE),
  54629. f.enable(p.DEPTH_TEST),
  54630. f.setDepthWrite(!0),
  54631. e.resetGLState()
  54632. }
  54633. }
  54634. }
  54635. ,
  54636. n.SpritePlugin = function(e, t) {
  54637. function i() {
  54638. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  54639. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54640. a = d.createBuffer(),
  54641. s = d.createBuffer(),
  54642. d.bindBuffer(d.ARRAY_BUFFER, a),
  54643. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  54644. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54645. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  54646. l = r(),
  54647. c = {
  54648. position: d.getAttribLocation(l, "position"),
  54649. uv: d.getAttribLocation(l, "uv")
  54650. },
  54651. h = {
  54652. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54653. uvScale: d.getUniformLocation(l, "uvScale"),
  54654. rotation: d.getUniformLocation(l, "rotation"),
  54655. scale: d.getUniformLocation(l, "scale"),
  54656. color: d.getUniformLocation(l, "color"),
  54657. map: d.getUniformLocation(l, "map"),
  54658. opacity: d.getUniformLocation(l, "opacity"),
  54659. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54660. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54661. fogType: d.getUniformLocation(l, "fogType"),
  54662. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54663. fogNear: d.getUniformLocation(l, "fogNear"),
  54664. fogFar: d.getUniformLocation(l, "fogFar"),
  54665. fogColor: d.getUniformLocation(l, "fogColor"),
  54666. alphaTest: d.getUniformLocation(l, "alphaTest")
  54667. };
  54668. var i = document.createElement("canvas");
  54669. i.width = 8,
  54670. i.height = 8;
  54671. var o = i.getContext("2d");
  54672. o.fillStyle = "white",
  54673. o.fillRect(0, 0, 8, 8),
  54674. u = new n.Texture(i),
  54675. u.needsUpdate = !0
  54676. }
  54677. function r() {
  54678. var t = d.createProgram()
  54679. , i = d.createShader(d.VERTEX_SHADER)
  54680. , n = d.createShader(d.FRAGMENT_SHADER);
  54681. return d.shaderSource(i, ["precision " + e.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  54682. d.shaderSource(n, ["precision " + e.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  54683. d.compileShader(i),
  54684. d.compileShader(n),
  54685. d.attachShader(t, i),
  54686. d.attachShader(t, n),
  54687. d.linkProgram(t),
  54688. t
  54689. }
  54690. function o(e, t) {
  54691. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54692. }
  54693. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  54694. this.render = function(r, v) {
  54695. if (0 !== t.length) {
  54696. void 0 === l && i(),
  54697. d.useProgram(l),
  54698. p.initAttributes(),
  54699. p.enableAttribute(c.position),
  54700. p.enableAttribute(c.uv),
  54701. p.disableUnusedAttributes(),
  54702. p.disable(d.CULL_FACE),
  54703. p.enable(d.BLEND),
  54704. d.bindBuffer(d.ARRAY_BUFFER, a),
  54705. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54706. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54707. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54708. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54709. p.activeTexture(d.TEXTURE0),
  54710. d.uniform1i(h.map, 0);
  54711. var A = 0
  54712. , y = 0
  54713. , C = r.fog;
  54714. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54715. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54716. d.uniform1f(h.fogFar, C.far),
  54717. d.uniform1i(h.fogType, 1),
  54718. A = 1,
  54719. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54720. d.uniform1i(h.fogType, 2),
  54721. A = 2,
  54722. y = 2)) : (d.uniform1i(h.fogType, 0),
  54723. A = 0,
  54724. y = 0);
  54725. for (var I = 0, E = t.length; I < E; I++) {
  54726. var b = t[I];
  54727. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54728. b.z = -b.modelViewMatrix.elements[14]
  54729. }
  54730. t.sort(o);
  54731. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54732. var b = t[I]
  54733. , _ = b.material;
  54734. d.uniform1f(h.alphaTest, _.alphaTest),
  54735. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54736. b.matrixWorld.decompose(f, g, m),
  54737. w[0] = m.x,
  54738. w[1] = m.y;
  54739. var T = 0;
  54740. r.fog && _.fog && (T = y),
  54741. A !== T && (d.uniform1i(h.fogType, T),
  54742. A = T),
  54743. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54744. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54745. d.uniform2f(h.uvScale, 1, 1)),
  54746. d.uniform1f(h.opacity, _.opacity),
  54747. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54748. d.uniform1f(h.rotation, _.rotation),
  54749. d.uniform2fv(h.scale, w),
  54750. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54751. p.setDepthTest(_.depthTest),
  54752. p.setDepthWrite(_.depthWrite),
  54753. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54754. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54755. }
  54756. p.enable(d.CULL_FACE),
  54757. e.resetGLState()
  54758. }
  54759. }
  54760. }
  54761. ,
  54762. Object.defineProperties(n.Box2.prototype, {
  54763. empty: {
  54764. value: function() {
  54765. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54766. this.isEmpty()
  54767. }
  54768. },
  54769. isIntersectionBox: {
  54770. value: function(e) {
  54771. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54772. this.intersectsBox(e)
  54773. }
  54774. }
  54775. }),
  54776. Object.defineProperties(n.Box3.prototype, {
  54777. empty: {
  54778. value: function() {
  54779. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54780. this.isEmpty()
  54781. }
  54782. },
  54783. isIntersectionBox: {
  54784. value: function(e) {
  54785. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54786. this.intersectsBox(e)
  54787. }
  54788. },
  54789. isIntersectionSphere: {
  54790. value: function(e) {
  54791. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54792. this.intersectsSphere(e)
  54793. }
  54794. }
  54795. }),
  54796. Object.defineProperties(n.Matrix3.prototype, {
  54797. multiplyVector3: {
  54798. value: function(e) {
  54799. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54800. e.applyMatrix3(this)
  54801. }
  54802. },
  54803. multiplyVector3Array: {
  54804. value: function(e) {
  54805. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54806. this.applyToVector3Array(e)
  54807. }
  54808. }
  54809. }),
  54810. Object.defineProperties(n.Matrix4.prototype, {
  54811. extractPosition: {
  54812. value: function(e) {
  54813. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54814. this.copyPosition(e)
  54815. }
  54816. },
  54817. setRotationFromQuaternion: {
  54818. value: function(e) {
  54819. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54820. this.makeRotationFromQuaternion(e)
  54821. }
  54822. },
  54823. multiplyVector3: {
  54824. value: function(e) {
  54825. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54826. e.applyProjection(this)
  54827. }
  54828. },
  54829. multiplyVector4: {
  54830. value: function(e) {
  54831. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54832. e.applyMatrix4(this)
  54833. }
  54834. },
  54835. multiplyVector3Array: {
  54836. value: function(e) {
  54837. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54838. this.applyToVector3Array(e)
  54839. }
  54840. },
  54841. rotateAxis: {
  54842. value: function(e) {
  54843. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54844. e.transformDirection(this)
  54845. }
  54846. },
  54847. crossVector: {
  54848. value: function(e) {
  54849. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54850. e.applyMatrix4(this)
  54851. }
  54852. },
  54853. translate: {
  54854. value: function(e) {
  54855. console.error("THREE.Matrix4: .translate() has been removed.")
  54856. }
  54857. },
  54858. rotateX: {
  54859. value: function(e) {
  54860. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54861. }
  54862. },
  54863. rotateY: {
  54864. value: function(e) {
  54865. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54866. }
  54867. },
  54868. rotateZ: {
  54869. value: function(e) {
  54870. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54871. }
  54872. },
  54873. rotateByAxis: {
  54874. value: function(e, t) {
  54875. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54876. }
  54877. }
  54878. }),
  54879. Object.defineProperties(n.Plane.prototype, {
  54880. isIntersectionLine: {
  54881. value: function(e) {
  54882. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54883. this.intersectsLine(e)
  54884. }
  54885. }
  54886. }),
  54887. Object.defineProperties(n.Quaternion.prototype, {
  54888. multiplyVector3: {
  54889. value: function(e) {
  54890. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54891. e.applyQuaternion(this)
  54892. }
  54893. }
  54894. }),
  54895. Object.defineProperties(n.Ray.prototype, {
  54896. isIntersectionBox: {
  54897. value: function(e) {
  54898. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54899. this.intersectsBox(e)
  54900. }
  54901. },
  54902. isIntersectionPlane: {
  54903. value: function(e) {
  54904. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54905. this.intersectsPlane(e)
  54906. }
  54907. },
  54908. isIntersectionSphere: {
  54909. value: function(e) {
  54910. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54911. this.intersectsSphere(e)
  54912. }
  54913. }
  54914. }),
  54915. Object.defineProperties(n.Vector3.prototype, {
  54916. setEulerFromRotationMatrix: {
  54917. value: function() {
  54918. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54919. }
  54920. },
  54921. setEulerFromQuaternion: {
  54922. value: function() {
  54923. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54924. }
  54925. },
  54926. getPositionFromMatrix: {
  54927. value: function(e) {
  54928. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54929. this.setFromMatrixPosition(e)
  54930. }
  54931. },
  54932. getScaleFromMatrix: {
  54933. value: function(e) {
  54934. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54935. this.setFromMatrixScale(e)
  54936. }
  54937. },
  54938. getColumnFromMatrix: {
  54939. value: function(e, t) {
  54940. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54941. this.setFromMatrixColumn(e, t)
  54942. }
  54943. }
  54944. }),
  54945. n.Face4 = function(e, t, i, r, o, a, s) {
  54946. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54947. new n.Face3(e,t,i,o,a,s)
  54948. }
  54949. ,
  54950. n.Vertex = function(e, t, i) {
  54951. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54952. new n.Vector3(e,t,i)
  54953. }
  54954. ,
  54955. Object.defineProperties(n.Object3D.prototype, {
  54956. eulerOrder: {
  54957. get: function() {
  54958. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54959. this.rotation.order
  54960. },
  54961. set: function(e) {
  54962. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54963. this.rotation.order = e
  54964. }
  54965. },
  54966. getChildByName: {
  54967. value: function(e) {
  54968. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54969. this.getObjectByName(e)
  54970. }
  54971. },
  54972. renderDepth: {
  54973. set: function(e) {
  54974. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54975. }
  54976. },
  54977. translate: {
  54978. value: function(e, t) {
  54979. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54980. this.translateOnAxis(t, e)
  54981. }
  54982. },
  54983. useQuaternion: {
  54984. get: function() {
  54985. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54986. },
  54987. set: function(e) {
  54988. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54989. }
  54990. }
  54991. }),
  54992. Object.defineProperties(n, {
  54993. PointCloud: {
  54994. value: function(e, t) {
  54995. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54996. new n.Points(e,t)
  54997. }
  54998. },
  54999. ParticleSystem: {
  55000. value: function(e, t) {
  55001. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  55002. new n.Points(e,t)
  55003. }
  55004. }
  55005. }),
  55006. Object.defineProperties(n.Light.prototype, {
  55007. onlyShadow: {
  55008. set: function(e) {
  55009. console.warn("THREE.Light: .onlyShadow has been removed.")
  55010. }
  55011. },
  55012. shadowCameraFov: {
  55013. set: function(e) {
  55014. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  55015. this.shadow.camera.fov = e
  55016. }
  55017. },
  55018. shadowCameraLeft: {
  55019. set: function(e) {
  55020. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  55021. this.shadow.camera.left = e
  55022. }
  55023. },
  55024. shadowCameraRight: {
  55025. set: function(e) {
  55026. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  55027. this.shadow.camera.right = e
  55028. }
  55029. },
  55030. shadowCameraTop: {
  55031. set: function(e) {
  55032. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  55033. this.shadow.camera.top = e
  55034. }
  55035. },
  55036. shadowCameraBottom: {
  55037. set: function(e) {
  55038. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  55039. this.shadow.camera.bottom = e
  55040. }
  55041. },
  55042. shadowCameraNear: {
  55043. set: function(e) {
  55044. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  55045. this.shadow.camera.near = e
  55046. }
  55047. },
  55048. shadowCameraFar: {
  55049. set: function(e) {
  55050. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  55051. this.shadow.camera.far = e
  55052. }
  55053. },
  55054. shadowCameraVisible: {
  55055. set: function(e) {
  55056. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  55057. }
  55058. },
  55059. shadowBias: {
  55060. set: function(e) {
  55061. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  55062. this.shadow.bias = e
  55063. }
  55064. },
  55065. shadowDarkness: {
  55066. set: function(e) {
  55067. console.warn("THREE.Light: .shadowDarkness has been removed.")
  55068. }
  55069. },
  55070. shadowMapWidth: {
  55071. set: function(e) {
  55072. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  55073. this.shadow.mapSize.width = e
  55074. }
  55075. },
  55076. shadowMapHeight: {
  55077. set: function(e) {
  55078. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  55079. this.shadow.mapSize.height = e
  55080. }
  55081. }
  55082. }),
  55083. Object.defineProperties(n.BufferAttribute.prototype, {
  55084. length: {
  55085. get: function() {
  55086. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  55087. this.array.length
  55088. }
  55089. }
  55090. }),
  55091. Object.defineProperties(n.BufferGeometry.prototype, {
  55092. drawcalls: {
  55093. get: function() {
  55094. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  55095. this.groups
  55096. }
  55097. },
  55098. offsets: {
  55099. get: function() {
  55100. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  55101. this.groups
  55102. }
  55103. },
  55104. addIndex: {
  55105. value: function(e) {
  55106. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  55107. this.setIndex(e)
  55108. }
  55109. },
  55110. addDrawCall: {
  55111. value: function(e, t, i) {
  55112. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  55113. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  55114. this.addGroup(e, t)
  55115. }
  55116. },
  55117. clearDrawCalls: {
  55118. value: function() {
  55119. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  55120. this.clearGroups()
  55121. }
  55122. },
  55123. computeTangents: {
  55124. value: function() {
  55125. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  55126. }
  55127. },
  55128. computeOffsets: {
  55129. value: function() {
  55130. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  55131. }
  55132. }
  55133. }),
  55134. Object.defineProperties(n.Material.prototype, {
  55135. wrapAround: {
  55136. get: function() {
  55137. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  55138. },
  55139. set: function(e) {
  55140. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  55141. }
  55142. },
  55143. wrapRGB: {
  55144. get: function() {
  55145. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  55146. new n.Color
  55147. }
  55148. }
  55149. }),
  55150. Object.defineProperties(n, {
  55151. PointCloudMaterial: {
  55152. value: function(e) {
  55153. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  55154. new n.PointsMaterial(e)
  55155. }
  55156. },
  55157. ParticleBasicMaterial: {
  55158. value: function(e) {
  55159. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  55160. new n.PointsMaterial(e)
  55161. }
  55162. },
  55163. ParticleSystemMaterial: {
  55164. value: function(e) {
  55165. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  55166. new n.PointsMaterial(e)
  55167. }
  55168. }
  55169. }),
  55170. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  55171. metal: {
  55172. get: function() {
  55173. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  55174. !1
  55175. },
  55176. set: function(e) {
  55177. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  55178. }
  55179. }
  55180. }),
  55181. Object.defineProperties(n.ShaderMaterial.prototype, {
  55182. derivatives: {
  55183. get: function() {
  55184. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  55185. this.extensions.derivatives
  55186. },
  55187. set: function(e) {
  55188. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  55189. this.extensions.derivatives = e
  55190. }
  55191. }
  55192. }),
  55193. Object.defineProperties(n.WebGLRenderer.prototype, {
  55194. supportsFloatTextures: {
  55195. value: function() {
  55196. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  55197. this.extensions.get("OES_texture_float")
  55198. }
  55199. },
  55200. supportsHalfFloatTextures: {
  55201. value: function() {
  55202. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  55203. this.extensions.get("OES_texture_half_float")
  55204. }
  55205. },
  55206. supportsStandardDerivatives: {
  55207. value: function() {
  55208. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  55209. this.extensions.get("OES_standard_derivatives")
  55210. }
  55211. },
  55212. supportsCompressedTextureS3TC: {
  55213. value: function() {
  55214. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  55215. this.extensions.get("WEBGL_compressed_texture_s3tc")
  55216. }
  55217. },
  55218. supportsCompressedTexturePVRTC: {
  55219. value: function() {
  55220. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  55221. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  55222. }
  55223. },
  55224. supportsBlendMinMax: {
  55225. value: function() {
  55226. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  55227. this.extensions.get("EXT_blend_minmax")
  55228. }
  55229. },
  55230. supportsVertexTextures: {
  55231. value: function() {
  55232. return this.capabilities.vertexTextures
  55233. }
  55234. },
  55235. supportsInstancedArrays: {
  55236. value: function() {
  55237. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  55238. this.extensions.get("ANGLE_instanced_arrays")
  55239. }
  55240. },
  55241. enableScissorTest: {
  55242. value: function(e) {
  55243. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  55244. this.setScissorTest(e)
  55245. }
  55246. },
  55247. initMaterial: {
  55248. value: function() {
  55249. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  55250. }
  55251. },
  55252. addPrePlugin: {
  55253. value: function() {
  55254. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  55255. }
  55256. },
  55257. addPostPlugin: {
  55258. value: function() {
  55259. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  55260. }
  55261. },
  55262. updateShadowMap: {
  55263. value: function() {
  55264. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  55265. }
  55266. },
  55267. shadowMapEnabled: {
  55268. get: function() {
  55269. return this.shadowMap.enabled
  55270. },
  55271. set: function(e) {
  55272. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  55273. this.shadowMap.enabled = e
  55274. }
  55275. },
  55276. shadowMapType: {
  55277. get: function() {
  55278. return this.shadowMap.type
  55279. },
  55280. set: function(e) {
  55281. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  55282. this.shadowMap.type = e
  55283. }
  55284. },
  55285. shadowMapCullFace: {
  55286. get: function() {
  55287. return this.shadowMap.cullFace
  55288. },
  55289. set: function(e) {
  55290. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  55291. this.shadowMap.cullFace = e
  55292. }
  55293. }
  55294. }),
  55295. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  55296. wrapS: {
  55297. get: function() {
  55298. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  55299. this.texture.wrapS
  55300. },
  55301. set: function(e) {
  55302. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  55303. this.texture.wrapS = e
  55304. }
  55305. },
  55306. wrapT: {
  55307. get: function() {
  55308. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  55309. this.texture.wrapT
  55310. },
  55311. set: function(e) {
  55312. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  55313. this.texture.wrapT = e
  55314. }
  55315. },
  55316. magFilter: {
  55317. get: function() {
  55318. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  55319. this.texture.magFilter
  55320. },
  55321. set: function(e) {
  55322. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  55323. this.texture.magFilter = e
  55324. }
  55325. },
  55326. minFilter: {
  55327. get: function() {
  55328. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  55329. this.texture.minFilter
  55330. },
  55331. set: function(e) {
  55332. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  55333. this.texture.minFilter = e
  55334. }
  55335. },
  55336. anisotropy: {
  55337. get: function() {
  55338. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  55339. this.texture.anisotropy
  55340. },
  55341. set: function(e) {
  55342. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  55343. this.texture.anisotropy = e
  55344. }
  55345. },
  55346. offset: {
  55347. get: function() {
  55348. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  55349. this.texture.offset
  55350. },
  55351. set: function(e) {
  55352. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  55353. this.texture.offset = e
  55354. }
  55355. },
  55356. repeat: {
  55357. get: function() {
  55358. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  55359. this.texture.repeat
  55360. },
  55361. set: function(e) {
  55362. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  55363. this.texture.repeat = e
  55364. }
  55365. },
  55366. format: {
  55367. get: function() {
  55368. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55369. this.texture.format
  55370. },
  55371. set: function(e) {
  55372. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55373. this.texture.format = e
  55374. }
  55375. },
  55376. type: {
  55377. get: function() {
  55378. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55379. this.texture.type
  55380. },
  55381. set: function(e) {
  55382. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55383. this.texture.type = e
  55384. }
  55385. },
  55386. generateMipmaps: {
  55387. get: function() {
  55388. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55389. this.texture.generateMipmaps
  55390. },
  55391. set: function(e) {
  55392. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55393. this.texture.generateMipmaps = e
  55394. }
  55395. }
  55396. }),
  55397. n.GeometryUtils = {
  55398. merge: function(e, t, i) {
  55399. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  55400. var r;
  55401. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  55402. r = t.matrix,
  55403. t = t.geometry),
  55404. e.merge(t, r, i)
  55405. },
  55406. center: function(e) {
  55407. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  55408. e.center()
  55409. }
  55410. },
  55411. n.ImageUtils = {
  55412. crossOrigin: void 0,
  55413. loadTexture: function(e, t, i, r) {
  55414. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  55415. var o = new n.TextureLoader;
  55416. o.setCrossOrigin(this.crossOrigin);
  55417. var a = o.load(e, i, void 0, r);
  55418. return t && (a.mapping = t),
  55419. a
  55420. },
  55421. loadTextureCube: function(e, t, i, r) {
  55422. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  55423. var o = new n.CubeTextureLoader;
  55424. o.setCrossOrigin(this.crossOrigin);
  55425. var a = o.load(e, i, void 0, r);
  55426. return t && (a.mapping = t),
  55427. a
  55428. },
  55429. loadCompressedTexture: function() {
  55430. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  55431. },
  55432. loadCompressedTextureCube: function() {
  55433. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  55434. }
  55435. },
  55436. n.Projector = function() {
  55437. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  55438. this.projectVector = function(e, t) {
  55439. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  55440. e.project(t)
  55441. }
  55442. ,
  55443. this.unprojectVector = function(e, t) {
  55444. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  55445. e.unproject(t)
  55446. }
  55447. ,
  55448. this.pickingRay = function(e, t) {
  55449. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  55450. }
  55451. }
  55452. ,
  55453. n.CanvasRenderer = function() {
  55454. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  55455. this.domElement = document.createElement("canvas"),
  55456. this.clear = function() {}
  55457. ,
  55458. this.render = function() {}
  55459. ,
  55460. this.setClearColor = function() {}
  55461. ,
  55462. this.setSize = function() {}
  55463. }
  55464. ,
  55465. n.MeshFaceMaterial = n.MultiMaterial,
  55466. n.CurveUtils = {
  55467. tangentQuadraticBezier: function(e, t, i, n) {
  55468. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  55469. },
  55470. tangentCubicBezier: function(e, t, i, n, r) {
  55471. return -3 * t * (1 - e) * (1 - e) + 3 * i * (1 - e) * (1 - e) - 6 * e * i * (1 - e) + 6 * e * n * (1 - e) - 3 * e * e * n + 3 * e * e * r
  55472. },
  55473. tangentSpline: function(e, t, i, n, r) {
  55474. var o = 6 * e * e - 6 * e
  55475. , a = 3 * e * e - 4 * e + 1
  55476. , s = -6 * e * e + 6 * e
  55477. , l = 3 * e * e - 2 * e;
  55478. return o + a + s + l
  55479. },
  55480. interpolate: function(e, t, i, n, r) {
  55481. var o = .5 * (i - e)
  55482. , a = .5 * (n - t)
  55483. , s = r * r
  55484. , l = r * s;
  55485. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  55486. }
  55487. },
  55488. n.SceneUtils = {
  55489. createMultiMaterialObject: function(e, t) {
  55490. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  55491. i.add(new n.Mesh(e,t[r]));
  55492. return i
  55493. },
  55494. detach: function(e, t, i) {
  55495. e.applyMatrix(t.matrixWorld),
  55496. t.remove(e),
  55497. i.add(e)
  55498. },
  55499. attach: function(e, t, i) {
  55500. var r = new n.Matrix4;
  55501. r.getInverse(i.matrixWorld),
  55502. e.applyMatrix(r),
  55503. t.remove(e),
  55504. i.add(e)
  55505. }
  55506. },
  55507. n.ShapeUtils = {
  55508. area: function(e) {
  55509. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  55510. i += e[n].x * e[r].y - e[r].x * e[n].y;
  55511. return .5 * i
  55512. },
  55513. triangulate: function() {
  55514. function e(e, t, i, n, r, o) {
  55515. var a, s, l, c, h, u, d, p, f;
  55516. if (s = e[o[t]].x,
  55517. l = e[o[t]].y,
  55518. c = e[o[i]].x,
  55519. h = e[o[i]].y,
  55520. u = e[o[n]].x,
  55521. d = e[o[n]].y,
  55522. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  55523. return !1;
  55524. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  55525. for (g = u - c,
  55526. m = d - h,
  55527. v = s - u,
  55528. A = l - d,
  55529. y = c - s,
  55530. C = h - l,
  55531. a = 0; a < r; a++)
  55532. if (p = e[o[a]].x,
  55533. f = e[o[a]].y,
  55534. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  55535. E = f - l,
  55536. b = p - c,
  55537. w = f - h,
  55538. _ = p - u,
  55539. T = f - d,
  55540. M = g * w - m * b,
  55541. x = y * E - C * I,
  55542. S = v * T - A * _,
  55543. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  55544. return !1;
  55545. return !0
  55546. }
  55547. return function(t, i) {
  55548. var r = t.length;
  55549. if (r < 3)
  55550. return null;
  55551. var o, a, s, l = [], c = [], h = [];
  55552. if (n.ShapeUtils.area(t) > 0)
  55553. for (a = 0; a < r; a++)
  55554. c[a] = a;
  55555. else
  55556. for (a = 0; a < r; a++)
  55557. c[a] = r - 1 - a;
  55558. var u = r
  55559. , d = 2 * u;
  55560. for (a = u - 1; u > 2; ) {
  55561. if (d-- <= 0)
  55562. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  55563. i ? h : l;
  55564. if (o = a,
  55565. u <= o && (o = 0),
  55566. a = o + 1,
  55567. u <= a && (a = 0),
  55568. s = a + 1,
  55569. u <= s && (s = 0),
  55570. e(t, o, a, s, u, c)) {
  55571. var p, f, g, m, v;
  55572. for (p = c[o],
  55573. f = c[a],
  55574. g = c[s],
  55575. l.push([t[p], t[f], t[g]]),
  55576. h.push([c[o], c[a], c[s]]),
  55577. m = a,
  55578. v = a + 1; v < u; m++,
  55579. v++)
  55580. c[m] = c[v];
  55581. u--,
  55582. d = 2 * u
  55583. }
  55584. }
  55585. return i ? h : l
  55586. }
  55587. }(),
  55588. triangulateShape: function(e, t) {
  55589. function i(e, t, i) {
  55590. return e.x !== t.x ? e.x < t.x ? e.x <= i.x && i.x <= t.x : t.x <= i.x && i.x <= e.x : e.y < t.y ? e.y <= i.y && i.y <= t.y : t.y <= i.y && i.y <= e.y
  55591. }
  55592. function r(e, t, n, r, o) {
  55593. var a = t.x - e.x
  55594. , s = t.y - e.y
  55595. , l = r.x - n.x
  55596. , c = r.y - n.y
  55597. , h = e.x - n.x
  55598. , u = e.y - n.y
  55599. , d = s * l - a * c
  55600. , p = s * h - a * u;
  55601. if (Math.abs(d) > Number.EPSILON) {
  55602. var f;
  55603. if (d > 0) {
  55604. if (p < 0 || p > d)
  55605. return [];
  55606. if (f = c * h - l * u,
  55607. f < 0 || f > d)
  55608. return []
  55609. } else {
  55610. if (p > 0 || p < d)
  55611. return [];
  55612. if (f = c * h - l * u,
  55613. f > 0 || f < d)
  55614. return []
  55615. }
  55616. if (0 === f)
  55617. return !o || 0 !== p && p !== d ? [e] : [];
  55618. if (f === d)
  55619. return !o || 0 !== p && p !== d ? [t] : [];
  55620. if (0 === p)
  55621. return [n];
  55622. if (p === d)
  55623. return [r];
  55624. var g = f / d;
  55625. return [{
  55626. x: e.x + g * a,
  55627. y: e.y + g * s
  55628. }]
  55629. }
  55630. if (0 !== p || c * h !== l * u)
  55631. return [];
  55632. var m = 0 === a && 0 === s
  55633. , v = 0 === l && 0 === c;
  55634. if (m && v)
  55635. return e.x !== n.x || e.y !== n.y ? [] : [e];
  55636. if (m)
  55637. return i(n, r, e) ? [e] : [];
  55638. if (v)
  55639. return i(e, t, n) ? [n] : [];
  55640. var A, y, C, I, E, b, w, _;
  55641. return 0 !== a ? (e.x < t.x ? (A = e,
  55642. C = e.x,
  55643. y = t,
  55644. I = t.x) : (A = t,
  55645. C = t.x,
  55646. y = e,
  55647. I = e.x),
  55648. n.x < r.x ? (E = n,
  55649. w = n.x,
  55650. b = r,
  55651. _ = r.x) : (E = r,
  55652. w = r.x,
  55653. b = n,
  55654. _ = n.x)) : (e.y < t.y ? (A = e,
  55655. C = e.y,
  55656. y = t,
  55657. I = t.y) : (A = t,
  55658. C = t.y,
  55659. y = e,
  55660. I = e.y),
  55661. n.y < r.y ? (E = n,
  55662. w = n.y,
  55663. b = r,
  55664. _ = r.y) : (E = r,
  55665. w = r.y,
  55666. b = n,
  55667. _ = n.y)),
  55668. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55669. }
  55670. function o(e, t, i, n) {
  55671. var r = t.x - e.x
  55672. , o = t.y - e.y
  55673. , a = i.x - e.x
  55674. , s = i.y - e.y
  55675. , l = n.x - e.x
  55676. , c = n.y - e.y
  55677. , h = r * s - o * a
  55678. , u = r * c - o * l;
  55679. if (Math.abs(h) > Number.EPSILON) {
  55680. var d = l * s - c * a;
  55681. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55682. }
  55683. return u > 0
  55684. }
  55685. function a(e, t) {
  55686. function i(e, t) {
  55687. var i = A.length - 1
  55688. , n = e - 1;
  55689. n < 0 && (n = i);
  55690. var r = e + 1;
  55691. r > i && (r = 0);
  55692. var a = o(A[e], A[n], A[r], s[t]);
  55693. if (!a)
  55694. return !1;
  55695. var l = s.length - 1
  55696. , c = t - 1;
  55697. c < 0 && (c = l);
  55698. var h = t + 1;
  55699. return h > l && (h = 0),
  55700. a = o(s[t], s[c], s[h], A[e]),
  55701. !!a
  55702. }
  55703. function n(e, t) {
  55704. var i, n, o;
  55705. for (i = 0; i < A.length; i++)
  55706. if (n = i + 1,
  55707. n %= A.length,
  55708. o = r(e, t, A[i], A[n], !0),
  55709. o.length > 0)
  55710. return !0;
  55711. return !1
  55712. }
  55713. function a(e, i) {
  55714. var n, o, a, s, l;
  55715. for (n = 0; n < y.length; n++)
  55716. for (o = t[y[n]],
  55717. a = 0; a < o.length; a++)
  55718. if (s = a + 1,
  55719. s %= o.length,
  55720. l = r(e, i, o[a], o[s], !0),
  55721. l.length > 0)
  55722. return !0;
  55723. return !1
  55724. }
  55725. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  55726. y.push(I);
  55727. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55728. if (w--,
  55729. w < 0) {
  55730. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55731. break
  55732. }
  55733. for (c = b; c < A.length; c++) {
  55734. h = A[c],
  55735. l = -1;
  55736. for (var I = 0; I < y.length; I++)
  55737. if (d = y[I],
  55738. p = h.x + ":" + h.y + ":" + d,
  55739. void 0 === C[p]) {
  55740. s = t[d];
  55741. for (var _ = 0; _ < s.length; _++)
  55742. if (u = s[_],
  55743. i(c, _) && !n(h, u) && !a(h, u)) {
  55744. l = _,
  55745. y.splice(I, 1),
  55746. f = A.slice(0, c + 1),
  55747. g = A.slice(c),
  55748. m = s.slice(l),
  55749. v = s.slice(0, l + 1),
  55750. A = f.concat(m).concat(v).concat(g),
  55751. b = c;
  55752. break
  55753. }
  55754. if (l >= 0)
  55755. break;
  55756. C[p] = !0
  55757. }
  55758. if (l >= 0)
  55759. break
  55760. }
  55761. }
  55762. return A
  55763. }
  55764. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55765. Array.prototype.push.apply(f, t[g]);
  55766. for (s = 0,
  55767. l = f.length; s < l; s++)
  55768. u = f[s].x + ":" + f[s].y,
  55769. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55770. p[u] = s;
  55771. var v = a(e, t)
  55772. , A = n.ShapeUtils.triangulate(v, !1);
  55773. for (s = 0,
  55774. l = A.length; s < l; s++)
  55775. for (h = A[s],
  55776. c = 0; c < 3; c++)
  55777. u = h[c].x + ":" + h[c].y,
  55778. d = p[u],
  55779. void 0 !== d && (h[c] = d);
  55780. return A.concat()
  55781. },
  55782. isClockWise: function(e) {
  55783. return n.ShapeUtils.area(e) < 0
  55784. },
  55785. b2: function() {
  55786. function e(e, t) {
  55787. var i = 1 - e;
  55788. return i * i * t
  55789. }
  55790. function t(e, t) {
  55791. return 2 * (1 - e) * e * t
  55792. }
  55793. function i(e, t) {
  55794. return e * e * t
  55795. }
  55796. return function(n, r, o, a) {
  55797. return e(n, r) + t(n, o) + i(n, a)
  55798. }
  55799. }(),
  55800. b3: function() {
  55801. function e(e, t) {
  55802. var i = 1 - e;
  55803. return i * i * i * t
  55804. }
  55805. function t(e, t) {
  55806. var i = 1 - e;
  55807. return 3 * i * i * e * t
  55808. }
  55809. function i(e, t) {
  55810. var i = 1 - e;
  55811. return 3 * i * e * e * t
  55812. }
  55813. function n(e, t) {
  55814. return e * e * e * t
  55815. }
  55816. return function(r, o, a, s, l) {
  55817. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55818. }
  55819. }()
  55820. },
  55821. n.Curve = function() {}
  55822. ,
  55823. n.Curve.prototype = {
  55824. constructor: n.Curve,
  55825. getPoint: function(e) {
  55826. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55827. null
  55828. },
  55829. getPointAt: function(e) {
  55830. var t = this.getUtoTmapping(e);
  55831. return this.getPoint(t)
  55832. },
  55833. getPoints: function(e) {
  55834. e || (e = 5);
  55835. var t, i = [];
  55836. for (t = 0; t <= e; t++)
  55837. i.push(this.getPoint(t / e));
  55838. return i
  55839. },
  55840. getSpacedPoints: function(e) {
  55841. e || (e = 5);
  55842. var t, i = [];
  55843. for (t = 0; t <= e; t++)
  55844. i.push(this.getPointAt(t / e));
  55845. return i
  55846. },
  55847. getLength: function() {
  55848. var e = this.getLengths();
  55849. return e[e.length - 1]
  55850. },
  55851. getLengths: function(e) {
  55852. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55853. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55854. return this.cacheArcLengths;
  55855. this.needsUpdate = !1;
  55856. var t, i, n = [], r = this.getPoint(0), o = 0;
  55857. for (n.push(0),
  55858. i = 1; i <= e; i++)
  55859. t = this.getPoint(i / e),
  55860. o += t.distanceTo(r),
  55861. n.push(o),
  55862. r = t;
  55863. return this.cacheArcLengths = n,
  55864. n
  55865. },
  55866. updateArcLengths: function() {
  55867. this.needsUpdate = !0,
  55868. this.getLengths()
  55869. },
  55870. getUtoTmapping: function(e, t) {
  55871. var i, n = this.getLengths(), r = 0, o = n.length;
  55872. i = t ? t : e * n[o - 1];
  55873. for (var a, s = 0, l = o - 1; s <= l; )
  55874. if (r = Math.floor(s + (l - s) / 2),
  55875. a = n[r] - i,
  55876. a < 0)
  55877. s = r + 1;
  55878. else {
  55879. if (!(a > 0)) {
  55880. l = r;
  55881. break
  55882. }
  55883. l = r - 1
  55884. }
  55885. if (r = l,
  55886. n[r] === i) {
  55887. var c = r / (o - 1);
  55888. return c
  55889. }
  55890. var h = n[r]
  55891. , u = n[r + 1]
  55892. , d = u - h
  55893. , p = (i - h) / d
  55894. , c = (r + p) / (o - 1);
  55895. return c
  55896. },
  55897. getTangent: function(e) {
  55898. var t = 1e-4
  55899. , i = e - t
  55900. , n = e + t;
  55901. i < 0 && (i = 0),
  55902. n > 1 && (n = 1);
  55903. var r = this.getPoint(i)
  55904. , o = this.getPoint(n)
  55905. , a = o.clone().sub(r);
  55906. return a.normalize()
  55907. },
  55908. getTangentAt: function(e) {
  55909. var t = this.getUtoTmapping(e);
  55910. return this.getTangent(t)
  55911. }
  55912. },
  55913. n.Curve.create = function(e, t) {
  55914. return e.prototype = Object.create(n.Curve.prototype),
  55915. e.prototype.constructor = e,
  55916. e.prototype.getPoint = t,
  55917. e
  55918. }
  55919. ,
  55920. n.CurvePath = function() {
  55921. this.curves = [],
  55922. this.autoClose = !1
  55923. }
  55924. ,
  55925. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55926. n.CurvePath.prototype.constructor = n.CurvePath,
  55927. n.CurvePath.prototype.add = function(e) {
  55928. this.curves.push(e)
  55929. }
  55930. ,
  55931. n.CurvePath.prototype.closePath = function() {
  55932. var e = this.curves[0].getPoint(0)
  55933. , t = this.curves[this.curves.length - 1].getPoint(1);
  55934. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55935. }
  55936. ,
  55937. n.CurvePath.prototype.getPoint = function(e) {
  55938. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55939. if (i[n] >= t) {
  55940. var r = i[n] - t
  55941. , o = this.curves[n]
  55942. , a = 1 - r / o.getLength();
  55943. return o.getPointAt(a)
  55944. }
  55945. n++
  55946. }
  55947. return null
  55948. }
  55949. ,
  55950. n.CurvePath.prototype.getLength = function() {
  55951. var e = this.getCurveLengths();
  55952. return e[e.length - 1]
  55953. }
  55954. ,
  55955. n.CurvePath.prototype.getCurveLengths = function() {
  55956. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55957. return this.cacheLengths;
  55958. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55959. t += this.curves[i].getLength(),
  55960. e.push(t);
  55961. return this.cacheLengths = e,
  55962. e
  55963. }
  55964. ,
  55965. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55966. var t = this.getPoints(e);
  55967. return this.createGeometry(t)
  55968. }
  55969. ,
  55970. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55971. var t = this.getSpacedPoints(e);
  55972. return this.createGeometry(t)
  55973. }
  55974. ,
  55975. n.CurvePath.prototype.createGeometry = function(e) {
  55976. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55977. var o = e[i];
  55978. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55979. }
  55980. return t
  55981. }
  55982. ,
  55983. n.Font = function(e) {
  55984. this.data = e
  55985. }
  55986. ,
  55987. n.Font.prototype = {
  55988. constructor: n.Font,
  55989. generateShapes: function(e, t, i) {
  55990. function r(e) {
  55991. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55992. var c = o(i[l], n, r);
  55993. r += c.offset,
  55994. s.push(c.path)
  55995. }
  55996. return s
  55997. }
  55998. function o(e, t, r) {
  55999. var o = a.glyphs[e] || a.glyphs["?"];
  56000. if (o) {
  56001. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  56002. if (o.o)
  56003. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  56004. var _ = E[b++];
  56005. switch (_) {
  56006. case "m":
  56007. s = E[b++] * t + r,
  56008. l = E[b++] * t,
  56009. A.moveTo(s, l);
  56010. break;
  56011. case "l":
  56012. s = E[b++] * t + r,
  56013. l = E[b++] * t,
  56014. A.lineTo(s, l);
  56015. break;
  56016. case "q":
  56017. if (c = E[b++] * t + r,
  56018. h = E[b++] * t,
  56019. p = E[b++] * t + r,
  56020. f = E[b++] * t,
  56021. A.quadraticCurveTo(p, f, c, h),
  56022. v = y[y.length - 1]) {
  56023. u = v.x,
  56024. d = v.y;
  56025. for (var T = 1; T <= i; T++) {
  56026. var x = T / i;
  56027. C(x, u, p, c),
  56028. C(x, d, f, h)
  56029. }
  56030. }
  56031. break;
  56032. case "b":
  56033. if (c = E[b++] * t + r,
  56034. h = E[b++] * t,
  56035. p = E[b++] * t + r,
  56036. f = E[b++] * t,
  56037. g = E[b++] * t + r,
  56038. m = E[b++] * t,
  56039. A.bezierCurveTo(p, f, g, m, c, h),
  56040. v = y[y.length - 1]) {
  56041. u = v.x,
  56042. d = v.y;
  56043. for (var T = 1; T <= i; T++) {
  56044. var x = T / i;
  56045. I(x, u, p, g, c),
  56046. I(x, d, f, m, h)
  56047. }
  56048. }
  56049. }
  56050. }
  56051. return {
  56052. offset: o.ha * t,
  56053. path: A
  56054. }
  56055. }
  56056. }
  56057. void 0 === t && (t = 100),
  56058. void 0 === i && (i = 4);
  56059. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  56060. Array.prototype.push.apply(l, s[c].toShapes());
  56061. return l
  56062. }
  56063. },
  56064. n.Path = function(e) {
  56065. n.CurvePath.call(this),
  56066. this.actions = [],
  56067. e && this.fromPoints(e)
  56068. }
  56069. ,
  56070. n.Path.prototype = Object.create(n.CurvePath.prototype),
  56071. n.Path.prototype.constructor = n.Path,
  56072. n.Path.prototype.fromPoints = function(e) {
  56073. this.moveTo(e[0].x, e[0].y);
  56074. for (var t = 1, i = e.length; t < i; t++)
  56075. this.lineTo(e[t].x, e[t].y)
  56076. }
  56077. ,
  56078. n.Path.prototype.moveTo = function(e, t) {
  56079. this.actions.push({
  56080. action: "moveTo",
  56081. args: [e, t]
  56082. })
  56083. }
  56084. ,
  56085. n.Path.prototype.lineTo = function(e, t) {
  56086. var i = this.actions[this.actions.length - 1].args
  56087. , r = i[i.length - 2]
  56088. , o = i[i.length - 1]
  56089. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  56090. this.curves.push(a),
  56091. this.actions.push({
  56092. action: "lineTo",
  56093. args: [e, t]
  56094. })
  56095. }
  56096. ,
  56097. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  56098. var o = this.actions[this.actions.length - 1].args
  56099. , a = o[o.length - 2]
  56100. , s = o[o.length - 1]
  56101. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  56102. this.curves.push(l),
  56103. this.actions.push({
  56104. action: "quadraticCurveTo",
  56105. args: [e, t, i, r]
  56106. })
  56107. }
  56108. ,
  56109. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  56110. var s = this.actions[this.actions.length - 1].args
  56111. , l = s[s.length - 2]
  56112. , c = s[s.length - 1]
  56113. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  56114. this.curves.push(h),
  56115. this.actions.push({
  56116. action: "bezierCurveTo",
  56117. args: [e, t, i, r, o, a]
  56118. })
  56119. }
  56120. ,
  56121. n.Path.prototype.splineThru = function(e) {
  56122. var t = Array.prototype.slice.call(arguments)
  56123. , i = this.actions[this.actions.length - 1].args
  56124. , r = i[i.length - 2]
  56125. , o = i[i.length - 1]
  56126. , a = [new n.Vector2(r,o)];
  56127. Array.prototype.push.apply(a, e);
  56128. var s = new n.SplineCurve(a);
  56129. this.curves.push(s),
  56130. this.actions.push({
  56131. action: "splineThru",
  56132. args: t
  56133. })
  56134. }
  56135. ,
  56136. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  56137. var a = this.actions[this.actions.length - 1].args
  56138. , s = a[a.length - 2]
  56139. , l = a[a.length - 1];
  56140. this.absarc(e + s, t + l, i, n, r, o)
  56141. }
  56142. ,
  56143. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  56144. this.absellipse(e, t, i, i, n, r, o)
  56145. }
  56146. ,
  56147. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  56148. var l = this.actions[this.actions.length - 1].args
  56149. , c = l[l.length - 2]
  56150. , h = l[l.length - 1];
  56151. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  56152. }
  56153. ,
  56154. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  56155. var c = [e, t, i, r, o, a, s, l || 0]
  56156. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  56157. this.curves.push(h);
  56158. var u = h.getPoint(1);
  56159. c.push(u.x),
  56160. c.push(u.y),
  56161. this.actions.push({
  56162. action: "ellipse",
  56163. args: c
  56164. })
  56165. }
  56166. ,
  56167. n.Path.prototype.getSpacedPoints = function(e) {
  56168. e || (e = 40);
  56169. for (var t = [], i = 0; i < e; i++)
  56170. t.push(this.getPoint(i / e));
  56171. return this.autoClose && t.push(t[0]),
  56172. t
  56173. }
  56174. ,
  56175. n.Path.prototype.getPoints = function(e) {
  56176. e = e || 12;
  56177. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  56178. var A = this.actions[m]
  56179. , y = A.action
  56180. , C = A.args;
  56181. switch (y) {
  56182. case "moveTo":
  56183. g.push(new n.Vector2(C[0],C[1]));
  56184. break;
  56185. case "lineTo":
  56186. g.push(new n.Vector2(C[0],C[1]));
  56187. break;
  56188. case "quadraticCurveTo":
  56189. t = C[2],
  56190. i = C[3],
  56191. a = C[0],
  56192. s = C[1],
  56193. g.length > 0 ? (h = g[g.length - 1],
  56194. l = h.x,
  56195. c = h.y) : (h = this.actions[m - 1].args,
  56196. l = h[h.length - 2],
  56197. c = h[h.length - 1]);
  56198. for (var I = 1; I <= e; I++) {
  56199. var E = I / e;
  56200. u = p(E, l, a, t),
  56201. d = p(E, c, s, i),
  56202. g.push(new n.Vector2(u,d))
  56203. }
  56204. break;
  56205. case "bezierCurveTo":
  56206. t = C[4],
  56207. i = C[5],
  56208. a = C[0],
  56209. s = C[1],
  56210. r = C[2],
  56211. o = C[3],
  56212. g.length > 0 ? (h = g[g.length - 1],
  56213. l = h.x,
  56214. c = h.y) : (h = this.actions[m - 1].args,
  56215. l = h[h.length - 2],
  56216. c = h[h.length - 1]);
  56217. for (var I = 1; I <= e; I++) {
  56218. var E = I / e;
  56219. u = f(E, l, a, r, t),
  56220. d = f(E, c, s, o, i),
  56221. g.push(new n.Vector2(u,d))
  56222. }
  56223. break;
  56224. case "splineThru":
  56225. h = this.actions[m - 1].args;
  56226. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  56227. , w = [b]
  56228. , _ = e * C[0].length;
  56229. w = w.concat(C[0]);
  56230. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  56231. g.push(T.getPointAt(I / _));
  56232. break;
  56233. case "arc":
  56234. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  56235. var E = I / N;
  56236. L || (E = 1 - E),
  56237. x = P + E * D,
  56238. u = S + R * Math.cos(x),
  56239. d = M + R * Math.sin(x),
  56240. g.push(new n.Vector2(u,d))
  56241. }
  56242. break;
  56243. case "ellipse":
  56244. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  56245. 0 !== k && (B = Math.cos(k),
  56246. F = Math.sin(k));
  56247. for (var I = 1; I <= N; I++) {
  56248. var E = I / N;
  56249. if (L || (E = 1 - E),
  56250. x = P + E * D,
  56251. u = S + V * Math.cos(x),
  56252. d = M + U * Math.sin(x),
  56253. 0 !== k) {
  56254. var H = u
  56255. , G = d;
  56256. u = (H - S) * B - (G - M) * F + S,
  56257. d = (H - S) * F + (G - M) * B + M
  56258. }
  56259. g.push(new n.Vector2(u,d))
  56260. }
  56261. }
  56262. }
  56263. var z = g[g.length - 1];
  56264. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  56265. this.autoClose && g.push(g[0]),
  56266. g
  56267. }
  56268. ,
  56269. n.Path.prototype.toShapes = function(e, t) {
  56270. function i(e) {
  56271. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  56272. var a = e[r]
  56273. , s = a.args
  56274. , l = a.action;
  56275. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  56276. i = new n.Path),
  56277. i[l].apply(i, s)
  56278. }
  56279. return 0 !== i.actions.length && t.push(i),
  56280. t
  56281. }
  56282. function r(e) {
  56283. for (var t = [], i = 0, r = e.length; i < r; i++) {
  56284. var o = e[i]
  56285. , a = new n.Shape;
  56286. a.actions = o.actions,
  56287. a.curves = o.curves,
  56288. t.push(a)
  56289. }
  56290. return t
  56291. }
  56292. function o(e, t) {
  56293. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  56294. var a = t[r]
  56295. , s = t[o]
  56296. , l = s.x - a.x
  56297. , c = s.y - a.y;
  56298. if (Math.abs(c) > Number.EPSILON) {
  56299. if (c < 0 && (a = t[o],
  56300. l = -l,
  56301. s = t[r],
  56302. c = -c),
  56303. e.y < a.y || e.y > s.y)
  56304. continue;
  56305. if (e.y === a.y) {
  56306. if (e.x === a.x)
  56307. return !0
  56308. } else {
  56309. var h = c * (e.x - a.x) - l * (e.y - a.y);
  56310. if (0 === h)
  56311. return !0;
  56312. if (h < 0)
  56313. continue;
  56314. n = !n
  56315. }
  56316. } else {
  56317. if (e.y !== a.y)
  56318. continue;
  56319. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  56320. return !0
  56321. }
  56322. }
  56323. return n
  56324. }
  56325. var a = n.ShapeUtils.isClockWise
  56326. , s = i(this.actions);
  56327. if (0 === s.length)
  56328. return [];
  56329. if (t === !0)
  56330. return r(s);
  56331. var l, c, h, u = [];
  56332. if (1 === s.length)
  56333. return c = s[0],
  56334. h = new n.Shape,
  56335. h.actions = c.actions,
  56336. h.curves = c.curves,
  56337. u.push(h),
  56338. u;
  56339. var d = !a(s[0].getPoints());
  56340. d = e ? !d : d;
  56341. var p, f = [], g = [], m = [], v = 0;
  56342. g[v] = void 0,
  56343. m[v] = [];
  56344. for (var A = 0, y = s.length; A < y; A++)
  56345. c = s[A],
  56346. p = c.getPoints(),
  56347. l = a(p),
  56348. l = e ? !l : l,
  56349. l ? (!d && g[v] && v++,
  56350. g[v] = {
  56351. s: new n.Shape,
  56352. p: p
  56353. },
  56354. g[v].s.actions = c.actions,
  56355. g[v].s.curves = c.curves,
  56356. d && v++,
  56357. m[v] = []) : m[v].push({
  56358. h: c,
  56359. p: p[0]
  56360. });
  56361. if (!g[0])
  56362. return r(s);
  56363. if (g.length > 1) {
  56364. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  56365. f[E] = [];
  56366. for (var E = 0, b = g.length; E < b; E++)
  56367. for (var w = m[E], _ = 0; _ < w.length; _++) {
  56368. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  56369. o(T.p, g[S].p) && (E !== S && I.push({
  56370. froms: E,
  56371. tos: S,
  56372. hole: _
  56373. }),
  56374. x ? (x = !1,
  56375. f[S].push(T)) : C = !0);
  56376. x && f[E].push(T)
  56377. }
  56378. I.length > 0 && (C || (m = f))
  56379. }
  56380. for (var M, A = 0, R = g.length; A < R; A++) {
  56381. h = g[A].s,
  56382. u.push(h),
  56383. M = m[A];
  56384. for (var P = 0, O = M.length; P < O; P++)
  56385. h.holes.push(M[P].h)
  56386. }
  56387. return u
  56388. }
  56389. ,
  56390. n.Shape = function() {
  56391. n.Path.apply(this, arguments),
  56392. this.holes = []
  56393. }
  56394. ,
  56395. n.Shape.prototype = Object.create(n.Path.prototype),
  56396. n.Shape.prototype.constructor = n.Shape,
  56397. n.Shape.prototype.extrude = function(e) {
  56398. return new n.ExtrudeGeometry(this,e)
  56399. }
  56400. ,
  56401. n.Shape.prototype.makeGeometry = function(e) {
  56402. return new n.ShapeGeometry(this,e)
  56403. }
  56404. ,
  56405. n.Shape.prototype.getPointsHoles = function(e) {
  56406. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  56407. t[i] = this.holes[i].getPoints(e);
  56408. return t
  56409. }
  56410. ,
  56411. n.Shape.prototype.extractAllPoints = function(e) {
  56412. return {
  56413. shape: this.getPoints(e),
  56414. holes: this.getPointsHoles(e)
  56415. }
  56416. }
  56417. ,
  56418. n.Shape.prototype.extractPoints = function(e) {
  56419. return this.extractAllPoints(e)
  56420. }
  56421. ,
  56422. n.LineCurve = function(e, t) {
  56423. this.v1 = e,
  56424. this.v2 = t
  56425. }
  56426. ,
  56427. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  56428. n.LineCurve.prototype.constructor = n.LineCurve,
  56429. n.LineCurve.prototype.getPoint = function(e) {
  56430. var t = this.v2.clone().sub(this.v1);
  56431. return t.multiplyScalar(e).add(this.v1),
  56432. t
  56433. }
  56434. ,
  56435. n.LineCurve.prototype.getPointAt = function(e) {
  56436. return this.getPoint(e)
  56437. }
  56438. ,
  56439. n.LineCurve.prototype.getTangent = function(e) {
  56440. var t = this.v2.clone().sub(this.v1);
  56441. return t.normalize()
  56442. }
  56443. ,
  56444. n.QuadraticBezierCurve = function(e, t, i) {
  56445. this.v0 = e,
  56446. this.v1 = t,
  56447. this.v2 = i
  56448. }
  56449. ,
  56450. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  56451. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  56452. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  56453. var t = n.ShapeUtils.b2;
  56454. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  56455. }
  56456. ,
  56457. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  56458. var t = n.CurveUtils.tangentQuadraticBezier;
  56459. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  56460. }
  56461. ,
  56462. n.CubicBezierCurve = function(e, t, i, n) {
  56463. this.v0 = e,
  56464. this.v1 = t,
  56465. this.v2 = i,
  56466. this.v3 = n
  56467. }
  56468. ,
  56469. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  56470. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  56471. n.CubicBezierCurve.prototype.getPoint = function(e) {
  56472. var t = n.ShapeUtils.b3;
  56473. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  56474. }
  56475. ,
  56476. n.CubicBezierCurve.prototype.getTangent = function(e) {
  56477. var t = n.CurveUtils.tangentCubicBezier;
  56478. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  56479. }
  56480. ,
  56481. n.SplineCurve = function(e) {
  56482. this.points = void 0 == e ? [] : e
  56483. }
  56484. ,
  56485. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  56486. n.SplineCurve.prototype.constructor = n.SplineCurve,
  56487. n.SplineCurve.prototype.getPoint = function(e) {
  56488. var t = this.points
  56489. , i = (t.length - 1) * e
  56490. , r = Math.floor(i)
  56491. , o = i - r
  56492. , a = t[0 === r ? r : r - 1]
  56493. , s = t[r]
  56494. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56495. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56496. , h = n.CurveUtils.interpolate;
  56497. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  56498. }
  56499. ,
  56500. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  56501. this.aX = e,
  56502. this.aY = t,
  56503. this.xRadius = i,
  56504. this.yRadius = n,
  56505. this.aStartAngle = r,
  56506. this.aEndAngle = o,
  56507. this.aClockwise = a,
  56508. this.aRotation = s || 0
  56509. }
  56510. ,
  56511. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  56512. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  56513. n.EllipseCurve.prototype.getPoint = function(e) {
  56514. var t = this.aEndAngle - this.aStartAngle;
  56515. t < 0 && (t += 2 * Math.PI),
  56516. t > 2 * Math.PI && (t -= 2 * Math.PI);
  56517. var i;
  56518. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  56519. var r = this.aX + this.xRadius * Math.cos(i)
  56520. , o = this.aY + this.yRadius * Math.sin(i);
  56521. if (0 !== this.aRotation) {
  56522. var a = Math.cos(this.aRotation)
  56523. , s = Math.sin(this.aRotation)
  56524. , l = r
  56525. , c = o;
  56526. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  56527. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  56528. }
  56529. return new n.Vector2(r,o)
  56530. }
  56531. ,
  56532. n.ArcCurve = function(e, t, i, r, o, a) {
  56533. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  56534. }
  56535. ,
  56536. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  56537. n.ArcCurve.prototype.constructor = n.ArcCurve,
  56538. n.LineCurve3 = n.Curve.create(function(e, t) {
  56539. this.v1 = e,
  56540. this.v2 = t
  56541. }, function(e) {
  56542. var t = new n.Vector3;
  56543. return t.subVectors(this.v2, this.v1),
  56544. t.multiplyScalar(e),
  56545. t.add(this.v1),
  56546. t
  56547. }),
  56548. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  56549. this.v0 = e,
  56550. this.v1 = t,
  56551. this.v2 = i
  56552. }, function(e) {
  56553. var t = n.ShapeUtils.b2;
  56554. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  56555. }),
  56556. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  56557. this.v0 = e,
  56558. this.v1 = t,
  56559. this.v2 = i,
  56560. this.v3 = n
  56561. }, function(e) {
  56562. var t = n.ShapeUtils.b3;
  56563. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  56564. }),
  56565. n.SplineCurve3 = n.Curve.create(function(e) {
  56566. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  56567. this.points = void 0 == e ? [] : e
  56568. }, function(e) {
  56569. var t = this.points
  56570. , i = (t.length - 1) * e
  56571. , r = Math.floor(i)
  56572. , o = i - r
  56573. , a = t[0 == r ? r : r - 1]
  56574. , s = t[r]
  56575. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56576. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56577. , h = n.CurveUtils.interpolate;
  56578. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  56579. }),
  56580. n.CatmullRomCurve3 = function() {
  56581. function e() {}
  56582. var t = new n.Vector3
  56583. , i = new e
  56584. , r = new e
  56585. , o = new e;
  56586. return e.prototype.init = function(e, t, i, n) {
  56587. this.c0 = e,
  56588. this.c1 = i,
  56589. this.c2 = -3 * e + 3 * t - 2 * i - n,
  56590. this.c3 = 2 * e - 2 * t + i + n
  56591. }
  56592. ,
  56593. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  56594. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  56595. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  56596. s *= o,
  56597. l *= o,
  56598. this.init(t, i, s, l)
  56599. }
  56600. ,
  56601. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  56602. this.init(t, i, r * (i - e), r * (n - t))
  56603. }
  56604. ,
  56605. e.prototype.calc = function(e) {
  56606. var t = e * e
  56607. , i = t * e;
  56608. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  56609. }
  56610. ,
  56611. n.Curve.create(function(e) {
  56612. this.points = e || [],
  56613. this.closed = !1
  56614. }, function(e) {
  56615. var a, s, l, c, h = this.points;
  56616. c = h.length,
  56617. c < 2 && console.log("duh, you need at least 2 points"),
  56618. a = (c - (this.closed ? 0 : 1)) * e,
  56619. s = Math.floor(a),
  56620. l = a - s,
  56621. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  56622. l = 1);
  56623. var u, d, p, f;
  56624. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  56625. u = t),
  56626. d = h[s % c],
  56627. p = h[(s + 1) % c],
  56628. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  56629. f = t),
  56630. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  56631. var g = "chordal" === this.type ? .5 : .25
  56632. , m = Math.pow(u.distanceToSquared(d), g)
  56633. , v = Math.pow(d.distanceToSquared(p), g)
  56634. , A = Math.pow(p.distanceToSquared(f), g);
  56635. v < 1e-4 && (v = 1),
  56636. m < 1e-4 && (m = v),
  56637. A < 1e-4 && (A = v),
  56638. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  56639. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  56640. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  56641. } else if ("catmullrom" === this.type) {
  56642. var y = void 0 !== this.tension ? this.tension : .5;
  56643. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  56644. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  56645. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  56646. }
  56647. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56648. return C
  56649. })
  56650. }(),
  56651. n.ClosedSplineCurve3 = function(e) {
  56652. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56653. n.CatmullRomCurve3.call(this, e),
  56654. this.type = "catmullrom",
  56655. this.closed = !0
  56656. }
  56657. ,
  56658. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56659. n.BoxGeometry = function(e, t, i, r, o, a) {
  56660. n.Geometry.call(this),
  56661. this.type = "BoxGeometry",
  56662. this.parameters = {
  56663. width: e,
  56664. height: t,
  56665. depth: i,
  56666. widthSegments: r,
  56667. heightSegments: o,
  56668. depthSegments: a
  56669. },
  56670. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56671. this.mergeVertices()
  56672. }
  56673. ,
  56674. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56675. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56676. n.CubeGeometry = n.BoxGeometry,
  56677. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56678. function s(e, t, i) {
  56679. var n = 0;
  56680. return n += e * t * 2,
  56681. n += e * i * 2,
  56682. n += i * t * 2,
  56683. 4 * n
  56684. }
  56685. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56686. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  56687. for (var L = O * b - _, D = 0; D < x; D++) {
  56688. var N = D * E - w;
  56689. P[e] = N * r,
  56690. P[t] = L * o,
  56691. P[i] = T,
  56692. p[m] = P.x,
  56693. p[m + 1] = P.y,
  56694. p[m + 2] = P.z,
  56695. P[e] = 0,
  56696. P[t] = 0,
  56697. P[i] = l > 0 ? 1 : -1,
  56698. f[m] = P.x,
  56699. f[m + 1] = P.y,
  56700. f[m + 2] = P.z,
  56701. g[v] = D / h,
  56702. g[v + 1] = 1 - O / u,
  56703. m += 3,
  56704. v += 2,
  56705. M += 1
  56706. }
  56707. for (O = 0; O < u; O++)
  56708. for (D = 0; D < h; D++) {
  56709. var B = y + D + x * O
  56710. , F = y + D + x * (O + 1)
  56711. , V = y + (D + 1) + x * (O + 1)
  56712. , U = y + (D + 1) + x * O;
  56713. d[A] = B,
  56714. d[A + 1] = F,
  56715. d[A + 2] = U,
  56716. d[A + 3] = F,
  56717. d[A + 4] = V,
  56718. d[A + 5] = U,
  56719. A += 6,
  56720. R += 6
  56721. }
  56722. c.addGroup(C, R, I),
  56723. C += R,
  56724. y += M
  56725. }
  56726. n.BufferGeometry.call(this),
  56727. this.type = "BoxBufferGeometry",
  56728. this.parameters = {
  56729. width: e,
  56730. height: t,
  56731. depth: i,
  56732. widthSegments: r,
  56733. heightSegments: o,
  56734. depthSegments: a
  56735. };
  56736. var c = this;
  56737. r = Math.floor(r) || 1,
  56738. o = Math.floor(o) || 1,
  56739. a = Math.floor(a) || 1;
  56740. var h = s(r, o, a)
  56741. , u = h / 4 * 6
  56742. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56743. , p = new Float32Array(3 * h)
  56744. , f = new Float32Array(3 * h)
  56745. , g = new Float32Array(2 * h)
  56746. , m = 0
  56747. , v = 0
  56748. , A = 0
  56749. , y = 0
  56750. , C = 0;
  56751. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56752. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56753. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56754. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56755. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56756. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56757. this.setIndex(new n.BufferAttribute(d,1)),
  56758. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56759. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56760. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56761. }
  56762. ,
  56763. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56764. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56765. n.CircleGeometry = function(e, t, i, r) {
  56766. n.Geometry.call(this),
  56767. this.type = "CircleGeometry",
  56768. this.parameters = {
  56769. radius: e,
  56770. segments: t,
  56771. thetaStart: i,
  56772. thetaLength: r
  56773. },
  56774. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56775. }
  56776. ,
  56777. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56778. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56779. n.CircleBufferGeometry = function(e, t, i, r) {
  56780. n.BufferGeometry.call(this),
  56781. this.type = "CircleBufferGeometry",
  56782. this.parameters = {
  56783. radius: e,
  56784. segments: t,
  56785. thetaStart: i,
  56786. thetaLength: r
  56787. },
  56788. e = e || 50,
  56789. t = void 0 !== t ? Math.max(3, t) : 8,
  56790. i = void 0 !== i ? i : 0,
  56791. r = void 0 !== r ? r : 2 * Math.PI;
  56792. var o = t + 2
  56793. , a = new Float32Array(3 * o)
  56794. , s = new Float32Array(3 * o)
  56795. , l = new Float32Array(2 * o);
  56796. s[2] = 1,
  56797. l[0] = .5,
  56798. l[1] = .5;
  56799. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56800. h += 3,
  56801. u += 2) {
  56802. var d = i + c / t * r;
  56803. a[h] = e * Math.cos(d),
  56804. a[h + 1] = e * Math.sin(d),
  56805. s[h + 2] = 1,
  56806. l[u] = (a[h] / e + 1) / 2,
  56807. l[u + 1] = (a[h + 1] / e + 1) / 2
  56808. }
  56809. for (var p = [], h = 1; h <= t; h++)
  56810. p.push(h, h + 1, 0);
  56811. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56812. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56813. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56814. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56815. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56816. }
  56817. ,
  56818. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56819. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56820. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56821. function c() {
  56822. var e = (r + 1) * (o + 1);
  56823. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56824. e
  56825. }
  56826. function h() {
  56827. var e = r * o * 2 * 3;
  56828. return a === !1 && (e += 2 * r * 3),
  56829. e
  56830. }
  56831. function u() {
  56832. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56833. for (c = 0; c <= o; c++) {
  56834. var p = []
  56835. , f = c / o
  56836. , b = f * (t - e) + e;
  56837. for (a = 0; a <= r; a++) {
  56838. var w = a / r;
  56839. u.x = b * Math.sin(w * l + s),
  56840. u.y = -f * i + E,
  56841. u.z = b * Math.cos(w * l + s),
  56842. m.setXYZ(y, u.x, u.y, u.z),
  56843. h.copy(u),
  56844. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56845. h.z = Math.cos(w * l + s)),
  56846. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56847. v.setXYZ(y, h.x, h.y, h.z),
  56848. A.setXY(y, w, 1 - f),
  56849. p.push(y),
  56850. y++
  56851. }
  56852. I.push(p)
  56853. }
  56854. for (a = 0; a < r; a++)
  56855. for (c = 0; c < o; c++) {
  56856. var _ = I[c][a]
  56857. , T = I[c + 1][a]
  56858. , x = I[c + 1][a + 1]
  56859. , S = I[c][a + 1];
  56860. g.setX(C, _),
  56861. C++,
  56862. g.setX(C, T),
  56863. C++,
  56864. g.setX(C, S),
  56865. C++,
  56866. g.setX(C, T),
  56867. C++,
  56868. g.setX(C, x),
  56869. C++,
  56870. g.setX(C, S),
  56871. C++
  56872. }
  56873. }
  56874. function d(i) {
  56875. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56876. for (a = y,
  56877. o = 1; o <= r; o++)
  56878. m.setXYZ(y, 0, E * p, 0),
  56879. v.setXYZ(y, 0, p, 0),
  56880. i === !0 ? (h.x = o / r,
  56881. h.y = 0) : (h.x = (o - 1) / r,
  56882. h.y = 1),
  56883. A.setXY(y, h.x, h.y),
  56884. y++;
  56885. for (c = y,
  56886. o = 0; o <= r; o++) {
  56887. var f = o / r;
  56888. u.x = d * Math.sin(f * l + s),
  56889. u.y = E * p,
  56890. u.z = d * Math.cos(f * l + s),
  56891. m.setXYZ(y, u.x, u.y, u.z),
  56892. v.setXYZ(y, 0, p, 0),
  56893. A.setXY(y, f, i === !0 ? 1 : 0),
  56894. y++
  56895. }
  56896. for (o = 0; o < r; o++) {
  56897. var I = a + o
  56898. , b = c + o;
  56899. i === !0 ? (g.setX(C, b),
  56900. C++,
  56901. g.setX(C, b + 1),
  56902. C++,
  56903. g.setX(C, I),
  56904. C++) : (g.setX(C, b + 1),
  56905. C++,
  56906. g.setX(C, b),
  56907. C++,
  56908. g.setX(C, I),
  56909. C++)
  56910. }
  56911. }
  56912. n.BufferGeometry.call(this),
  56913. this.type = "CylinderBufferGeometry",
  56914. this.parameters = {
  56915. radiusTop: e,
  56916. radiusBottom: t,
  56917. height: i,
  56918. radialSegments: r,
  56919. heightSegments: o,
  56920. openEnded: a,
  56921. thetaStart: s,
  56922. thetaLength: l
  56923. },
  56924. e = void 0 !== e ? e : 20,
  56925. t = void 0 !== t ? t : 20,
  56926. i = void 0 !== i ? i : 100,
  56927. r = Math.floor(r) || 8,
  56928. o = Math.floor(o) || 1,
  56929. a = void 0 !== a && a,
  56930. s = void 0 !== s ? s : 0,
  56931. l = void 0 !== l ? l : 2 * Math.PI;
  56932. var p = c()
  56933. , f = h()
  56934. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56935. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56936. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56937. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56938. , y = 0
  56939. , C = 0
  56940. , I = []
  56941. , E = i / 2;
  56942. u(),
  56943. a === !1 && (e > 0 && d(!0),
  56944. t > 0 && d(!1)),
  56945. this.setIndex(g),
  56946. this.addAttribute("position", m),
  56947. this.addAttribute("normal", v),
  56948. this.addAttribute("uv", A)
  56949. }
  56950. ,
  56951. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56952. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56953. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56954. n.Geometry.call(this),
  56955. this.type = "CylinderGeometry",
  56956. this.parameters = {
  56957. radiusTop: e,
  56958. radiusBottom: t,
  56959. height: i,
  56960. radialSegments: r,
  56961. heightSegments: o,
  56962. openEnded: a,
  56963. thetaStart: s,
  56964. thetaLength: l
  56965. },
  56966. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56967. this.mergeVertices()
  56968. }
  56969. ,
  56970. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56971. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56972. n.EdgesGeometry = function(e, t) {
  56973. function i(e, t) {
  56974. return e - t
  56975. }
  56976. n.BufferGeometry.call(this),
  56977. t = void 0 !== t ? t : 1;
  56978. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56979. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56980. r.fromBufferGeometry(e)) : r = e.clone(),
  56981. r.mergeVertices(),
  56982. r.computeFaceNormals();
  56983. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56984. for (var p = h[u], f = 0; f < 3; f++) {
  56985. a[0] = p[l[f]],
  56986. a[1] = p[l[(f + 1) % 3]],
  56987. a.sort(i);
  56988. var g = a.toString();
  56989. void 0 === s[g] ? s[g] = {
  56990. vert1: a[0],
  56991. vert2: a[1],
  56992. face1: u,
  56993. face2: void 0
  56994. } : s[g].face2 = u
  56995. }
  56996. var m = [];
  56997. for (var g in s) {
  56998. var v = s[g];
  56999. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  57000. var A = c[v.vert1];
  57001. m.push(A.x),
  57002. m.push(A.y),
  57003. m.push(A.z),
  57004. A = c[v.vert2],
  57005. m.push(A.x),
  57006. m.push(A.y),
  57007. m.push(A.z)
  57008. }
  57009. }
  57010. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  57011. }
  57012. ,
  57013. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57014. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  57015. n.ExtrudeGeometry = function(e, t) {
  57016. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  57017. this.type = "ExtrudeGeometry",
  57018. e = Array.isArray(e) ? e : [e],
  57019. this.addShapeList(e, t),
  57020. void this.computeFaceNormals())
  57021. }
  57022. ;
  57023. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  57024. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  57025. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  57026. for (var i = e.length, n = 0; n < i; n++) {
  57027. var r = e[n];
  57028. this.addShape(r, t)
  57029. }
  57030. }
  57031. ,
  57032. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  57033. function i(e, t, i) {
  57034. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  57035. t.clone().multiplyScalar(i).add(e)
  57036. }
  57037. function r(e, t, i) {
  57038. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  57039. if (Math.abs(d) > Number.EPSILON) {
  57040. var p = Math.sqrt(u)
  57041. , f = Math.sqrt(c * c + h * h)
  57042. , g = t.x - l / p
  57043. , m = t.y + s / p
  57044. , v = i.x - h / f
  57045. , A = i.y + c / f
  57046. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  57047. r = g + s * y - e.x,
  57048. o = m + l * y - e.y;
  57049. var C = r * r + o * o;
  57050. if (C <= 2)
  57051. return new n.Vector2(r,o);
  57052. a = Math.sqrt(C / 2)
  57053. } else {
  57054. var I = !1;
  57055. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  57056. I ? (r = -l,
  57057. o = s,
  57058. a = Math.sqrt(u)) : (r = s,
  57059. o = l,
  57060. a = Math.sqrt(u / 2))
  57061. }
  57062. return new n.Vector2(r / a,o / a)
  57063. }
  57064. function o() {
  57065. if (C) {
  57066. var e = 0
  57067. , t = z * e;
  57068. for (Y = 0; Y < W; Y++)
  57069. G = N[Y],
  57070. c(G[2] + t, G[1] + t, G[0] + t);
  57071. for (e = E + 2 * y,
  57072. t = z * e,
  57073. Y = 0; Y < W; Y++)
  57074. G = N[Y],
  57075. c(G[0] + t, G[1] + t, G[2] + t)
  57076. } else {
  57077. for (Y = 0; Y < W; Y++)
  57078. G = N[Y],
  57079. c(G[2], G[1], G[0]);
  57080. for (Y = 0; Y < W; Y++)
  57081. G = N[Y],
  57082. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  57083. }
  57084. }
  57085. function a() {
  57086. var e = 0;
  57087. for (s(B, e),
  57088. e += B.length,
  57089. x = 0,
  57090. S = L.length; x < S; x++)
  57091. T = L[x],
  57092. s(T, e),
  57093. e += T.length
  57094. }
  57095. function s(e, t) {
  57096. var i, n;
  57097. for (Y = e.length; --Y >= 0; ) {
  57098. i = Y,
  57099. n = Y - 1,
  57100. n < 0 && (n = e.length - 1);
  57101. var r = 0
  57102. , o = E + 2 * y;
  57103. for (r = 0; r < o; r++) {
  57104. var a = z * r
  57105. , s = z * (r + 1)
  57106. , l = t + i + a
  57107. , c = t + n + a
  57108. , u = t + n + s
  57109. , d = t + i + s;
  57110. h(l, c, u, d, e, r, o, i, n)
  57111. }
  57112. }
  57113. }
  57114. function l(e, t, i) {
  57115. M.vertices.push(new n.Vector3(e,t,i))
  57116. }
  57117. function c(e, t, i) {
  57118. e += R,
  57119. t += R,
  57120. i += R,
  57121. M.faces.push(new n.Face3(e,t,i,null,null,0));
  57122. var r = _.generateTopUV(M, e, t, i);
  57123. M.faceVertexUvs[0].push(r)
  57124. }
  57125. function h(e, t, i, r, o, a, s, l, c) {
  57126. e += R,
  57127. t += R,
  57128. i += R,
  57129. r += R,
  57130. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  57131. M.faces.push(new n.Face3(t,i,r,null,null,1));
  57132. var h = _.generateSideWallUV(M, e, t, i, r);
  57133. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  57134. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  57135. }
  57136. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  57137. b && (u = b.getSpacedPoints(E),
  57138. w = !0,
  57139. C = !1,
  57140. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  57141. p = new n.Vector3,
  57142. f = new n.Vector3,
  57143. g = new n.Vector3),
  57144. C || (y = 0,
  57145. v = 0,
  57146. A = 0);
  57147. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  57148. if (D) {
  57149. for (O = O.reverse(),
  57150. x = 0,
  57151. S = L.length; x < S; x++)
  57152. T = L[x],
  57153. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  57154. D = !1
  57155. }
  57156. var N = n.ShapeUtils.triangulateShape(O, L)
  57157. , B = O;
  57158. for (x = 0,
  57159. S = L.length; x < S; x++)
  57160. T = L[x],
  57161. O = O.concat(T);
  57162. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  57163. Z++,
  57164. q++)
  57165. Z === X && (Z = 0),
  57166. q === X && (q = 0),
  57167. j[Y] = r(B[Y], B[Z], B[q]);
  57168. var K, Q = [], J = j.concat();
  57169. for (x = 0,
  57170. S = L.length; x < S; x++) {
  57171. for (T = L[x],
  57172. K = [],
  57173. Y = 0,
  57174. X = T.length,
  57175. Z = X - 1,
  57176. q = Y + 1; Y < X; Y++,
  57177. Z++,
  57178. q++)
  57179. Z === X && (Z = 0),
  57180. q === X && (q = 0),
  57181. K[Y] = r(T[Y], T[Z], T[q]);
  57182. Q.push(K),
  57183. J = J.concat(K)
  57184. }
  57185. for (F = 0; F < y; F++) {
  57186. for (U = F / y,
  57187. k = v * (1 - U),
  57188. V = A * Math.sin(U * Math.PI / 2),
  57189. Y = 0,
  57190. X = B.length; Y < X; Y++)
  57191. H = i(B[Y], j[Y], V),
  57192. l(H.x, H.y, -k);
  57193. for (x = 0,
  57194. S = L.length; x < S; x++)
  57195. for (T = L[x],
  57196. K = Q[x],
  57197. Y = 0,
  57198. X = T.length; Y < X; Y++)
  57199. H = i(T[Y], K[Y], V),
  57200. l(H.x, H.y, -k)
  57201. }
  57202. for (V = A,
  57203. Y = 0; Y < z; Y++)
  57204. H = C ? i(O[Y], J[Y], V) : O[Y],
  57205. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  57206. p.copy(d.binormals[0]).multiplyScalar(H.y),
  57207. g.copy(u[0]).add(f).add(p),
  57208. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  57209. var $;
  57210. for ($ = 1; $ <= E; $++)
  57211. for (Y = 0; Y < z; Y++)
  57212. H = C ? i(O[Y], J[Y], V) : O[Y],
  57213. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  57214. p.copy(d.binormals[$]).multiplyScalar(H.y),
  57215. g.copy(u[$]).add(f).add(p),
  57216. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  57217. for (F = y - 1; F >= 0; F--) {
  57218. for (U = F / y,
  57219. k = v * (1 - U),
  57220. V = A * Math.sin(U * Math.PI / 2),
  57221. Y = 0,
  57222. X = B.length; Y < X; Y++)
  57223. H = i(B[Y], j[Y], V),
  57224. l(H.x, H.y, m + k);
  57225. for (x = 0,
  57226. S = L.length; x < S; x++)
  57227. for (T = L[x],
  57228. K = Q[x],
  57229. Y = 0,
  57230. X = T.length; Y < X; Y++)
  57231. H = i(T[Y], K[Y], V),
  57232. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  57233. }
  57234. o(),
  57235. a()
  57236. }
  57237. ,
  57238. n.ExtrudeGeometry.WorldUVGenerator = {
  57239. generateTopUV: function(e, t, i, r) {
  57240. var o = e.vertices
  57241. , a = o[t]
  57242. , s = o[i]
  57243. , l = o[r];
  57244. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  57245. },
  57246. generateSideWallUV: function(e, t, i, r, o) {
  57247. var a = e.vertices
  57248. , s = a[t]
  57249. , l = a[i]
  57250. , c = a[r]
  57251. , h = a[o];
  57252. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  57253. }
  57254. },
  57255. n.ShapeGeometry = function(e, t) {
  57256. n.Geometry.call(this),
  57257. this.type = "ShapeGeometry",
  57258. Array.isArray(e) === !1 && (e = [e]),
  57259. this.addShapeList(e, t),
  57260. this.computeFaceNormals()
  57261. }
  57262. ,
  57263. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  57264. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  57265. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  57266. for (var i = 0, n = e.length; i < n; i++)
  57267. this.addShape(e[i], t);
  57268. return this
  57269. }
  57270. ,
  57271. n.ShapeGeometry.prototype.addShape = function(e, t) {
  57272. void 0 === t && (t = {});
  57273. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  57274. if (p) {
  57275. for (u = u.reverse(),
  57276. i = 0,
  57277. r = d.length; i < r; i++)
  57278. o = d[i],
  57279. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  57280. p = !1
  57281. }
  57282. var f = n.ShapeUtils.triangulateShape(u, d);
  57283. for (i = 0,
  57284. r = d.length; i < r; i++)
  57285. o = d[i],
  57286. u = u.concat(o);
  57287. var g, m, v = u.length, A = f.length;
  57288. for (i = 0; i < v; i++)
  57289. g = u[i],
  57290. this.vertices.push(new n.Vector3(g.x,g.y,0));
  57291. for (i = 0; i < A; i++) {
  57292. m = f[i];
  57293. var y = m[0] + c
  57294. , C = m[1] + c
  57295. , I = m[2] + c;
  57296. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  57297. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  57298. }
  57299. }
  57300. ,
  57301. n.LatheBufferGeometry = function(e, t, i, r) {
  57302. n.BufferGeometry.call(this),
  57303. this.type = "LatheBufferGeometry",
  57304. this.parameters = {
  57305. points: e,
  57306. segments: t,
  57307. phiStart: i,
  57308. phiLength: r
  57309. },
  57310. t = Math.floor(t) || 12,
  57311. i = i || 0,
  57312. r = r || 2 * Math.PI,
  57313. r = n.Math.clamp(r, 0, 2 * Math.PI);
  57314. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  57315. 1 / t), m = new n.Vector3, v = new n.Vector2;
  57316. for (a = 0; a <= t; a++) {
  57317. var A = i + a * g * r
  57318. , y = Math.sin(A)
  57319. , C = Math.cos(A);
  57320. for (s = 0; s <= e.length - 1; s++)
  57321. m.x = e[s].x * y,
  57322. m.y = e[s].y,
  57323. m.z = e[s].x * C,
  57324. u.setXYZ(p, m.x, m.y, m.z),
  57325. v.x = a / t,
  57326. v.y = s / (e.length - 1),
  57327. d.setXY(p, v.x, v.y),
  57328. p++
  57329. }
  57330. for (a = 0; a < t; a++)
  57331. for (s = 0; s < e.length - 1; s++) {
  57332. o = s + a * e.length;
  57333. var I = o
  57334. , E = o + e.length
  57335. , b = o + e.length + 1
  57336. , w = o + 1;
  57337. h.setX(f, I),
  57338. f++,
  57339. h.setX(f, E),
  57340. f++,
  57341. h.setX(f, w),
  57342. f++,
  57343. h.setX(f, E),
  57344. f++,
  57345. h.setX(f, b),
  57346. f++,
  57347. h.setX(f, w),
  57348. f++
  57349. }
  57350. if (this.setIndex(h),
  57351. this.addAttribute("position", u),
  57352. this.addAttribute("uv", d),
  57353. this.computeVertexNormals(),
  57354. r === 2 * Math.PI) {
  57355. var _ = this.attributes.normal.array
  57356. , T = new n.Vector3
  57357. , x = new n.Vector3
  57358. , S = new n.Vector3;
  57359. for (o = t * e.length * 3,
  57360. a = 0,
  57361. s = 0; a < e.length; a++,
  57362. s += 3)
  57363. T.x = _[s + 0],
  57364. T.y = _[s + 1],
  57365. T.z = _[s + 2],
  57366. x.x = _[o + s + 0],
  57367. x.y = _[o + s + 1],
  57368. x.z = _[o + s + 2],
  57369. S.addVectors(T, x).normalize(),
  57370. _[s + 0] = _[o + s + 0] = S.x,
  57371. _[s + 1] = _[o + s + 1] = S.y,
  57372. _[s + 2] = _[o + s + 2] = S.z
  57373. }
  57374. }
  57375. ,
  57376. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57377. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  57378. n.LatheGeometry = function(e, t, i, r) {
  57379. n.Geometry.call(this),
  57380. this.type = "LatheGeometry",
  57381. this.parameters = {
  57382. points: e,
  57383. segments: t,
  57384. phiStart: i,
  57385. phiLength: r
  57386. },
  57387. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  57388. this.mergeVertices()
  57389. }
  57390. ,
  57391. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  57392. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  57393. n.PlaneGeometry = function(e, t, i, r) {
  57394. n.Geometry.call(this),
  57395. this.type = "PlaneGeometry",
  57396. this.parameters = {
  57397. width: e,
  57398. height: t,
  57399. widthSegments: i,
  57400. heightSegments: r
  57401. },
  57402. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  57403. }
  57404. ,
  57405. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  57406. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  57407. n.PlaneBufferGeometry = function(e, t, i, r) {
  57408. n.BufferGeometry.call(this),
  57409. this.type = "PlaneBufferGeometry",
  57410. this.parameters = {
  57411. width: e,
  57412. height: t,
  57413. widthSegments: i,
  57414. heightSegments: r
  57415. };
  57416. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  57417. for (var y = A * d - a, C = 0; C < c; C++) {
  57418. var I = C * u - o;
  57419. p[m] = I,
  57420. p[m + 1] = -y,
  57421. f[m + 2] = 1,
  57422. g[v] = C / s,
  57423. g[v + 1] = 1 - A / l,
  57424. m += 3,
  57425. v += 2
  57426. }
  57427. m = 0;
  57428. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  57429. for (var C = 0; C < s; C++) {
  57430. var b = C + c * A
  57431. , w = C + c * (A + 1)
  57432. , _ = C + 1 + c * (A + 1)
  57433. , T = C + 1 + c * A;
  57434. E[m] = b,
  57435. E[m + 1] = w,
  57436. E[m + 2] = T,
  57437. E[m + 3] = w,
  57438. E[m + 4] = _,
  57439. E[m + 5] = T,
  57440. m += 6
  57441. }
  57442. this.setIndex(new n.BufferAttribute(E,1)),
  57443. this.addAttribute("position", new n.BufferAttribute(p,3)),
  57444. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  57445. this.addAttribute("uv", new n.BufferAttribute(g,2))
  57446. }
  57447. ,
  57448. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57449. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  57450. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  57451. n.BufferGeometry.call(this),
  57452. this.type = "RingBufferGeometry",
  57453. this.parameters = {
  57454. innerRadius: e,
  57455. outerRadius: t,
  57456. thetaSegments: i,
  57457. phiSegments: r,
  57458. thetaStart: o,
  57459. thetaLength: a
  57460. },
  57461. e = e || 20,
  57462. t = t || 50,
  57463. o = void 0 !== o ? o : 0,
  57464. a = void 0 !== a ? a : 2 * Math.PI,
  57465. i = void 0 !== i ? Math.max(3, i) : 8,
  57466. r = void 0 !== r ? Math.max(1, r) : 1;
  57467. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  57468. for (l = 0; l <= r; l++) {
  57469. for (c = 0; c <= i; c++)
  57470. s = o + c / i * a,
  57471. C.x = A * Math.cos(s),
  57472. C.y = A * Math.sin(s),
  57473. p.setXYZ(m, C.x, C.y, C.z),
  57474. f.setXYZ(m, 0, 0, 1),
  57475. I.x = (C.x / t + 1) / 2,
  57476. I.y = (C.y / t + 1) / 2,
  57477. g.setXY(m, I.x, I.y),
  57478. m++;
  57479. A += y
  57480. }
  57481. for (l = 0; l < r; l++) {
  57482. var E = l * (i + 1);
  57483. for (c = 0; c < i; c++) {
  57484. s = c + E;
  57485. var b = s
  57486. , w = s + i + 1
  57487. , _ = s + i + 2
  57488. , T = s + 1;
  57489. d.setX(v, b),
  57490. v++,
  57491. d.setX(v, w),
  57492. v++,
  57493. d.setX(v, _),
  57494. v++,
  57495. d.setX(v, b),
  57496. v++,
  57497. d.setX(v, _),
  57498. v++,
  57499. d.setX(v, T),
  57500. v++
  57501. }
  57502. }
  57503. this.setIndex(d),
  57504. this.addAttribute("position", p),
  57505. this.addAttribute("normal", f),
  57506. this.addAttribute("uv", g)
  57507. }
  57508. ,
  57509. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57510. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  57511. n.RingGeometry = function(e, t, i, r, o, a) {
  57512. n.Geometry.call(this),
  57513. this.type = "RingGeometry",
  57514. this.parameters = {
  57515. innerRadius: e,
  57516. outerRadius: t,
  57517. thetaSegments: i,
  57518. phiSegments: r,
  57519. thetaStart: o,
  57520. thetaLength: a
  57521. },
  57522. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  57523. }
  57524. ,
  57525. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  57526. n.RingGeometry.prototype.constructor = n.RingGeometry,
  57527. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  57528. n.Geometry.call(this),
  57529. this.type = "SphereGeometry",
  57530. this.parameters = {
  57531. radius: e,
  57532. widthSegments: t,
  57533. heightSegments: i,
  57534. phiStart: r,
  57535. phiLength: o,
  57536. thetaStart: a,
  57537. thetaLength: s
  57538. },
  57539. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  57540. }
  57541. ,
  57542. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  57543. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  57544. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  57545. n.BufferGeometry.call(this),
  57546. this.type = "SphereBufferGeometry",
  57547. this.parameters = {
  57548. radius: e,
  57549. widthSegments: t,
  57550. heightSegments: i,
  57551. phiStart: r,
  57552. phiLength: o,
  57553. thetaStart: a,
  57554. thetaLength: s
  57555. },
  57556. e = e || 50,
  57557. t = Math.max(3, Math.floor(t) || 8),
  57558. i = Math.max(2, Math.floor(i) || 6),
  57559. r = void 0 !== r ? r : 0,
  57560. o = void 0 !== o ? o : 2 * Math.PI,
  57561. a = void 0 !== a ? a : 0,
  57562. s = void 0 !== s ? s : Math.PI;
  57563. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  57564. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  57565. var C = y / t
  57566. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  57567. , E = e * Math.cos(a + A * s)
  57568. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  57569. g.set(I, E, b).normalize(),
  57570. h.setXYZ(p, I, E, b),
  57571. u.setXYZ(p, g.x, g.y, g.z),
  57572. d.setXY(p, C, 1 - A),
  57573. v.push(p),
  57574. p++
  57575. }
  57576. f.push(v)
  57577. }
  57578. for (var w = [], m = 0; m < i; m++)
  57579. for (var y = 0; y < t; y++) {
  57580. var _ = f[m][y + 1]
  57581. , T = f[m][y]
  57582. , x = f[m + 1][y]
  57583. , S = f[m + 1][y + 1];
  57584. (0 !== m || a > 0) && w.push(_, T, S),
  57585. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  57586. }
  57587. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  57588. this.addAttribute("position", h),
  57589. this.addAttribute("normal", u),
  57590. this.addAttribute("uv", d),
  57591. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  57592. }
  57593. ,
  57594. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57595. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  57596. n.TextGeometry = function(e, t) {
  57597. t = t || {};
  57598. var i = t.font;
  57599. if (i instanceof n.Font == !1)
  57600. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  57601. new n.Geometry;
  57602. var r = i.generateShapes(e, t.size, t.curveSegments);
  57603. t.amount = void 0 !== t.height ? t.height : 50,
  57604. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  57605. void 0 === t.bevelSize && (t.bevelSize = 8),
  57606. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  57607. n.ExtrudeGeometry.call(this, r, t),
  57608. this.type = "TextGeometry"
  57609. }
  57610. ,
  57611. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  57612. n.TextGeometry.prototype.constructor = n.TextGeometry,
  57613. n.TorusBufferGeometry = function(e, t, i, r, o) {
  57614. n.BufferGeometry.call(this),
  57615. this.type = "TorusBufferGeometry",
  57616. this.parameters = {
  57617. radius: e,
  57618. tube: t,
  57619. radialSegments: i,
  57620. tubularSegments: r,
  57621. arc: o
  57622. },
  57623. e = e || 100,
  57624. t = t || 40,
  57625. i = Math.floor(i) || 8,
  57626. r = Math.floor(r) || 6,
  57627. o = o || 2 * Math.PI;
  57628. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  57629. for (a = 0; a <= i; a++)
  57630. for (s = 0; s <= r; s++) {
  57631. var C = s / r * o
  57632. , I = a / i * Math.PI * 2;
  57633. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  57634. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  57635. A.z = t * Math.sin(I),
  57636. u[f] = A.x,
  57637. u[f + 1] = A.y,
  57638. u[f + 2] = A.z,
  57639. v.x = e * Math.cos(C),
  57640. v.y = e * Math.sin(C),
  57641. y.subVectors(A, v).normalize(),
  57642. d[f] = y.x,
  57643. d[f + 1] = y.y,
  57644. d[f + 2] = y.z,
  57645. p[g] = s / r,
  57646. p[g + 1] = a / i,
  57647. f += 3,
  57648. g += 2
  57649. }
  57650. for (a = 1; a <= i; a++)
  57651. for (s = 1; s <= r; s++) {
  57652. var E = (r + 1) * a + s - 1
  57653. , b = (r + 1) * (a - 1) + s - 1
  57654. , w = (r + 1) * (a - 1) + s
  57655. , _ = (r + 1) * a + s;
  57656. h[m] = E,
  57657. h[m + 1] = b,
  57658. h[m + 2] = _,
  57659. h[m + 3] = b,
  57660. h[m + 4] = w,
  57661. h[m + 5] = _,
  57662. m += 6
  57663. }
  57664. this.setIndex(new n.BufferAttribute(h,1)),
  57665. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57666. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57667. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57668. }
  57669. ,
  57670. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57671. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57672. n.TorusGeometry = function(e, t, i, r, o) {
  57673. n.Geometry.call(this),
  57674. this.type = "TorusGeometry",
  57675. this.parameters = {
  57676. radius: e,
  57677. tube: t,
  57678. radialSegments: i,
  57679. tubularSegments: r,
  57680. arc: o
  57681. },
  57682. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57683. }
  57684. ,
  57685. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57686. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57687. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57688. function s(e, t, i, n, r) {
  57689. var o = Math.cos(e)
  57690. , a = Math.sin(e)
  57691. , s = i / t * e
  57692. , l = Math.cos(s);
  57693. r.x = n * (2 + l) * .5 * o,
  57694. r.y = n * (2 + l) * a * .5,
  57695. r.z = n * Math.sin(s) * .5
  57696. }
  57697. n.BufferGeometry.call(this),
  57698. this.type = "TorusKnotBufferGeometry",
  57699. this.parameters = {
  57700. radius: e,
  57701. tube: t,
  57702. tubularSegments: i,
  57703. radialSegments: r,
  57704. p: o,
  57705. q: a
  57706. },
  57707. e = e || 100,
  57708. t = t || 40,
  57709. i = Math.floor(i) || 64,
  57710. r = Math.floor(r) || 8,
  57711. o = o || 2,
  57712. a = a || 3;
  57713. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  57714. for (l = 0; l <= i; ++l) {
  57715. var T = l / i * o * Math.PI * 2;
  57716. for (s(T, o, a, e, I),
  57717. s(T + .01, o, a, e, E),
  57718. w.subVectors(E, I),
  57719. _.addVectors(E, I),
  57720. b.crossVectors(w, _),
  57721. _.crossVectors(b, w),
  57722. b.normalize(),
  57723. _.normalize(),
  57724. c = 0; c <= r; ++c) {
  57725. var x = c / r * Math.PI * 2
  57726. , S = -t * Math.cos(x)
  57727. , M = t * Math.sin(x);
  57728. A.x = I.x + (S * _.x + M * b.x),
  57729. A.y = I.y + (S * _.y + M * b.y),
  57730. A.z = I.z + (S * _.z + M * b.z),
  57731. p.setXYZ(m, A.x, A.y, A.z),
  57732. y.subVectors(A, I).normalize(),
  57733. f.setXYZ(m, y.x, y.y, y.z),
  57734. C.x = l / i,
  57735. C.y = c / r,
  57736. g.setXY(m, C.x, C.y),
  57737. m++
  57738. }
  57739. }
  57740. for (c = 1; c <= i; c++)
  57741. for (l = 1; l <= r; l++) {
  57742. var R = (r + 1) * (c - 1) + (l - 1)
  57743. , P = (r + 1) * c + (l - 1)
  57744. , O = (r + 1) * c + l
  57745. , L = (r + 1) * (c - 1) + l;
  57746. d.setX(v, R),
  57747. v++,
  57748. d.setX(v, P),
  57749. v++,
  57750. d.setX(v, L),
  57751. v++,
  57752. d.setX(v, P),
  57753. v++,
  57754. d.setX(v, O),
  57755. v++,
  57756. d.setX(v, L),
  57757. v++
  57758. }
  57759. this.setIndex(d),
  57760. this.addAttribute("position", p),
  57761. this.addAttribute("normal", f),
  57762. this.addAttribute("uv", g)
  57763. }
  57764. ,
  57765. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57766. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57767. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57768. n.Geometry.call(this),
  57769. this.type = "TorusKnotGeometry",
  57770. this.parameters = {
  57771. radius: e,
  57772. tube: t,
  57773. tubularSegments: i,
  57774. radialSegments: r,
  57775. p: o,
  57776. q: a
  57777. },
  57778. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57779. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57780. this.mergeVertices()
  57781. }
  57782. ,
  57783. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57784. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57785. n.TubeGeometry = function(e, t, i, r, o, a) {
  57786. function s(e, t, i) {
  57787. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57788. }
  57789. n.Geometry.call(this),
  57790. this.type = "TubeGeometry",
  57791. this.parameters = {
  57792. path: e,
  57793. segments: t,
  57794. radius: i,
  57795. radialSegments: r,
  57796. closed: o,
  57797. taper: a
  57798. },
  57799. t = t || 64,
  57800. i = i || 1,
  57801. r = r || 8,
  57802. o = o || !1,
  57803. a = a || n.TubeGeometry.NoTaper;
  57804. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  57805. for (this.tangents = D,
  57806. this.normals = N,
  57807. this.binormals = B,
  57808. v = 0; v < P; v++)
  57809. for (M[v] = [],
  57810. u = v / (P - 1),
  57811. m = e.getPointAt(u),
  57812. l = D[v],
  57813. c = N[v],
  57814. h = B[v],
  57815. p = i * a(u),
  57816. A = 0; A < r; A++)
  57817. d = A / r * 2 * Math.PI,
  57818. f = -p * Math.cos(d),
  57819. g = p * Math.sin(d),
  57820. O.copy(m),
  57821. O.x += f * c.x + g * h.x,
  57822. O.y += f * c.y + g * h.y,
  57823. O.z += f * c.z + g * h.z,
  57824. M[v][A] = s(O.x, O.y, O.z);
  57825. for (v = 0; v < t; v++)
  57826. for (A = 0; A < r; A++)
  57827. y = o ? (v + 1) % t : v + 1,
  57828. C = (A + 1) % r,
  57829. I = M[v][A],
  57830. E = M[y][A],
  57831. b = M[y][C],
  57832. w = M[v][C],
  57833. _ = new n.Vector2(v / t,A / r),
  57834. T = new n.Vector2((v + 1) / t,A / r),
  57835. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57836. S = new n.Vector2(v / t,(A + 1) / r),
  57837. this.faces.push(new n.Face3(I,E,w)),
  57838. this.faceVertexUvs[0].push([_, T, S]),
  57839. this.faces.push(new n.Face3(E,b,w)),
  57840. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57841. this.computeFaceNormals(),
  57842. this.computeVertexNormals()
  57843. }
  57844. ,
  57845. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57846. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57847. n.TubeGeometry.NoTaper = function(e) {
  57848. return 1
  57849. }
  57850. ,
  57851. n.TubeGeometry.SinusoidalTaper = function(e) {
  57852. return Math.sin(Math.PI * e)
  57853. }
  57854. ,
  57855. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57856. function r() {
  57857. f[0] = new n.Vector3,
  57858. g[0] = new n.Vector3,
  57859. a = Number.MAX_VALUE,
  57860. s = Math.abs(p[0].x),
  57861. l = Math.abs(p[0].y),
  57862. c = Math.abs(p[0].z),
  57863. s <= a && (a = s,
  57864. d.set(1, 0, 0)),
  57865. l <= a && (a = l,
  57866. d.set(0, 1, 0)),
  57867. c <= a && d.set(0, 0, 1),
  57868. m.crossVectors(p[0], d).normalize(),
  57869. f[0].crossVectors(p[0], m),
  57870. g[0].crossVectors(p[0], f[0])
  57871. }
  57872. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  57873. for (this.tangents = p,
  57874. this.normals = f,
  57875. this.binormals = g,
  57876. h = 0; h < A; h++)
  57877. u = h / (A - 1),
  57878. p[h] = e.getTangentAt(u),
  57879. p[h].normalize();
  57880. for (r(),
  57881. h = 1; h < A; h++)
  57882. f[h] = f[h - 1].clone(),
  57883. g[h] = g[h - 1].clone(),
  57884. m.crossVectors(p[h - 1], p[h]),
  57885. m.length() > Number.EPSILON && (m.normalize(),
  57886. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57887. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57888. g[h].crossVectors(p[h], f[h]);
  57889. if (i)
  57890. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57891. o /= A - 1,
  57892. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57893. h = 1; h < A; h++)
  57894. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57895. g[h].crossVectors(p[h], f[h])
  57896. }
  57897. ,
  57898. n.PolyhedronGeometry = function(e, t, i, r) {
  57899. function o(e) {
  57900. var t = e.normalize().clone();
  57901. t.index = u.vertices.push(t) - 1;
  57902. var i = l(e) / 2 / Math.PI + .5
  57903. , r = c(e) / Math.PI + .5;
  57904. return t.uv = new n.Vector2(i,1 - r),
  57905. t
  57906. }
  57907. function a(e, t, i, r) {
  57908. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57909. u.faces.push(o),
  57910. C.copy(e).add(t).add(i).divideScalar(3);
  57911. var a = l(C);
  57912. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57913. }
  57914. function s(e, t) {
  57915. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  57916. l[h] = [];
  57917. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  57918. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57919. }
  57920. for (var h = 0; h < i; h++)
  57921. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57922. var m = Math.floor(g / 2);
  57923. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  57924. }
  57925. }
  57926. function l(e) {
  57927. return Math.atan2(e.z, -e.x)
  57928. }
  57929. function c(e) {
  57930. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57931. }
  57932. function h(e, t, i) {
  57933. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57934. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57935. e.clone()
  57936. }
  57937. n.Geometry.call(this),
  57938. this.type = "PolyhedronGeometry",
  57939. this.parameters = {
  57940. vertices: e,
  57941. indices: t,
  57942. radius: i,
  57943. detail: r
  57944. },
  57945. i = i || 1,
  57946. r = r || 0;
  57947. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57948. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57949. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57950. m++) {
  57951. var v = f[t[d]]
  57952. , A = f[t[d + 1]]
  57953. , y = f[t[d + 2]];
  57954. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57955. }
  57956. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57957. s(g[d], r);
  57958. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57959. var I = this.faceVertexUvs[0][d]
  57960. , E = I[0].x
  57961. , b = I[1].x
  57962. , w = I[2].x
  57963. , _ = Math.max(E, b, w)
  57964. , T = Math.min(E, b, w);
  57965. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57966. b < .2 && (I[1].x += 1),
  57967. w < .2 && (I[2].x += 1))
  57968. }
  57969. for (var d = 0, p = this.vertices.length; d < p; d++)
  57970. this.vertices[d].multiplyScalar(i);
  57971. this.mergeVertices(),
  57972. this.computeFaceNormals(),
  57973. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57974. }
  57975. ,
  57976. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57977. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57978. n.DodecahedronGeometry = function(e, t) {
  57979. var i = (1 + Math.sqrt(5)) / 2
  57980. , r = 1 / i
  57981. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  57982. , a = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];
  57983. n.PolyhedronGeometry.call(this, o, a, e, t),
  57984. this.type = "DodecahedronGeometry",
  57985. this.parameters = {
  57986. radius: e,
  57987. detail: t
  57988. }
  57989. }
  57990. ,
  57991. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57992. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57993. n.IcosahedronGeometry = function(e, t) {
  57994. var i = (1 + Math.sqrt(5)) / 2
  57995. , r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  57996. , o = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];
  57997. n.PolyhedronGeometry.call(this, r, o, e, t),
  57998. this.type = "IcosahedronGeometry",
  57999. this.parameters = {
  58000. radius: e,
  58001. detail: t
  58002. }
  58003. }
  58004. ,
  58005. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  58006. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  58007. n.OctahedronGeometry = function(e, t) {
  58008. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  58009. , 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];
  58010. n.PolyhedronGeometry.call(this, i, r, e, t),
  58011. this.type = "OctahedronGeometry",
  58012. this.parameters = {
  58013. radius: e,
  58014. detail: t
  58015. }
  58016. }
  58017. ,
  58018. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  58019. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  58020. n.TetrahedronGeometry = function(e, t) {
  58021. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  58022. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  58023. n.PolyhedronGeometry.call(this, i, r, e, t),
  58024. this.type = "TetrahedronGeometry",
  58025. this.parameters = {
  58026. radius: e,
  58027. detail: t
  58028. }
  58029. }
  58030. ,
  58031. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  58032. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  58033. n.ParametricGeometry = function(e, t, i) {
  58034. n.Geometry.call(this),
  58035. this.type = "ParametricGeometry",
  58036. this.parameters = {
  58037. func: e,
  58038. slices: t,
  58039. stacks: i
  58040. };
  58041. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  58042. for (r = 0; r <= i; r++)
  58043. for (l = r / i,
  58044. o = 0; o <= t; o++)
  58045. s = o / t,
  58046. a = e(s, l),
  58047. c.push(a);
  58048. var p, f, g, m, v, A, y, C;
  58049. for (r = 0; r < i; r++)
  58050. for (o = 0; o < t; o++)
  58051. p = r * d + o,
  58052. f = r * d + o + 1,
  58053. g = (r + 1) * d + o + 1,
  58054. m = (r + 1) * d + o,
  58055. v = new n.Vector2(o / t,r / i),
  58056. A = new n.Vector2((o + 1) / t,r / i),
  58057. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  58058. C = new n.Vector2(o / t,(r + 1) / i),
  58059. h.push(new n.Face3(p,f,m)),
  58060. u.push([v, A, C]),
  58061. h.push(new n.Face3(f,g,m)),
  58062. u.push([A.clone(), y, C.clone()]);
  58063. this.computeFaceNormals(),
  58064. this.computeVertexNormals()
  58065. }
  58066. ,
  58067. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  58068. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  58069. n.WireframeGeometry = function(e) {
  58070. function t(e, t) {
  58071. return e - t
  58072. }
  58073. n.BufferGeometry.call(this);
  58074. var i = [0, 0]
  58075. , r = {}
  58076. , o = ["a", "b", "c"];
  58077. if (e instanceof n.Geometry) {
  58078. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  58079. for (var d = s[h], p = 0; p < 3; p++) {
  58080. i[0] = d[o[p]],
  58081. i[1] = d[o[(p + 1) % 3]],
  58082. i.sort(t);
  58083. var f = i.toString();
  58084. void 0 === r[f] && (c[2 * l] = i[0],
  58085. c[2 * l + 1] = i[1],
  58086. r[f] = !0,
  58087. l++)
  58088. }
  58089. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  58090. for (var p = 0; p < 2; p++) {
  58091. var m = a[c[2 * h + p]]
  58092. , v = 6 * h + 3 * p;
  58093. g[v + 0] = m.x,
  58094. g[v + 1] = m.y,
  58095. g[v + 2] = m.z
  58096. }
  58097. this.addAttribute("position", new n.BufferAttribute(g,3))
  58098. } else if (e instanceof n.BufferGeometry)
  58099. if (null !== e.index) {
  58100. var A = e.index.array
  58101. , a = e.attributes.position
  58102. , y = e.groups
  58103. , l = 0;
  58104. 0 === y.length && e.addGroup(0, A.length);
  58105. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  58106. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  58107. for (var p = 0; p < 3; p++) {
  58108. i[0] = A[h + p],
  58109. i[1] = A[h + (p + 1) % 3],
  58110. i.sort(t);
  58111. var f = i.toString();
  58112. void 0 === r[f] && (c[2 * l] = i[0],
  58113. c[2 * l + 1] = i[1],
  58114. r[f] = !0,
  58115. l++)
  58116. }
  58117. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  58118. for (var p = 0; p < 2; p++) {
  58119. var v = 6 * h + 3 * p
  58120. , T = c[2 * h + p];
  58121. g[v + 0] = a.getX(T),
  58122. g[v + 1] = a.getY(T),
  58123. g[v + 2] = a.getZ(T)
  58124. }
  58125. this.addAttribute("position", new n.BufferAttribute(g,3))
  58126. } else {
  58127. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  58128. for (var p = 0; p < 3; p++) {
  58129. var v = 18 * h + 6 * p
  58130. , S = 9 * h + 3 * p;
  58131. g[v + 0] = a[S],
  58132. g[v + 1] = a[S + 1],
  58133. g[v + 2] = a[S + 2];
  58134. var T = 9 * h + 3 * ((p + 1) % 3);
  58135. g[v + 3] = a[T],
  58136. g[v + 4] = a[T + 1],
  58137. g[v + 5] = a[T + 2]
  58138. }
  58139. this.addAttribute("position", new n.BufferAttribute(g,3))
  58140. }
  58141. }
  58142. ,
  58143. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  58144. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  58145. n.AxisHelper = function(e) {
  58146. e = e || 1;
  58147. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  58148. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  58149. , r = new n.BufferGeometry;
  58150. r.addAttribute("position", new n.BufferAttribute(t,3)),
  58151. r.addAttribute("color", new n.BufferAttribute(i,3));
  58152. var o = new n.LineBasicMaterial({
  58153. vertexColors: n.VertexColors
  58154. });
  58155. n.LineSegments.call(this, r, o)
  58156. }
  58157. ,
  58158. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  58159. n.AxisHelper.prototype.constructor = n.AxisHelper,
  58160. n.ArrowHelper = function() {
  58161. var e = new n.Geometry;
  58162. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  58163. var t = new n.CylinderGeometry(0,.5,1,5,1);
  58164. return t.translate(0, -.5, 0),
  58165. function(i, r, o, a, s, l) {
  58166. n.Object3D.call(this),
  58167. void 0 === a && (a = 16776960),
  58168. void 0 === o && (o = 1),
  58169. void 0 === s && (s = .2 * o),
  58170. void 0 === l && (l = .2 * s),
  58171. this.position.copy(r),
  58172. this.line = new n.Line(e,new n.LineBasicMaterial({
  58173. color: a
  58174. })),
  58175. this.line.matrixAutoUpdate = !1,
  58176. this.add(this.line),
  58177. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  58178. color: a
  58179. })),
  58180. this.cone.matrixAutoUpdate = !1,
  58181. this.add(this.cone),
  58182. this.setDirection(i),
  58183. this.setLength(o, s, l)
  58184. }
  58185. }(),
  58186. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  58187. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  58188. n.ArrowHelper.prototype.setDirection = function() {
  58189. var e, t = new n.Vector3;
  58190. return function(i) {
  58191. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  58192. e = Math.acos(i.y),
  58193. this.quaternion.setFromAxisAngle(t, e))
  58194. }
  58195. }(),
  58196. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  58197. void 0 === t && (t = .2 * e),
  58198. void 0 === i && (i = .2 * t),
  58199. this.line.scale.set(1, Math.max(0, e - t), 1),
  58200. this.line.updateMatrix(),
  58201. this.cone.scale.set(i, t, i),
  58202. this.cone.position.y = e,
  58203. this.cone.updateMatrix()
  58204. }
  58205. ,
  58206. n.ArrowHelper.prototype.setColor = function(e) {
  58207. this.line.material.color.set(e),
  58208. this.cone.material.color.set(e)
  58209. }
  58210. ,
  58211. n.BoxHelper = function(e) {
  58212. var t = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7])
  58213. , i = new Float32Array(24)
  58214. , r = new n.BufferGeometry;
  58215. r.setIndex(new n.BufferAttribute(t,1)),
  58216. r.addAttribute("position", new n.BufferAttribute(i,3)),
  58217. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  58218. color: 16776960
  58219. })),
  58220. void 0 !== e && this.update(e)
  58221. }
  58222. ,
  58223. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  58224. n.BoxHelper.prototype.constructor = n.BoxHelper,
  58225. n.BoxHelper.prototype.update = function() {
  58226. var e = new n.Box3;
  58227. return function(t) {
  58228. if (e.setFromObject(t),
  58229. !e.isEmpty()) {
  58230. var i = e.min
  58231. , n = e.max
  58232. , r = this.geometry.attributes.position
  58233. , o = r.array;
  58234. o[0] = n.x,
  58235. o[1] = n.y,
  58236. o[2] = n.z,
  58237. o[3] = i.x,
  58238. o[4] = n.y,
  58239. o[5] = n.z,
  58240. o[6] = i.x,
  58241. o[7] = i.y,
  58242. o[8] = n.z,
  58243. o[9] = n.x,
  58244. o[10] = i.y,
  58245. o[11] = n.z,
  58246. o[12] = n.x,
  58247. o[13] = n.y,
  58248. o[14] = i.z,
  58249. o[15] = i.x,
  58250. o[16] = n.y,
  58251. o[17] = i.z,
  58252. o[18] = i.x,
  58253. o[19] = i.y,
  58254. o[20] = i.z,
  58255. o[21] = n.x,
  58256. o[22] = i.y,
  58257. o[23] = i.z,
  58258. r.needsUpdate = !0,
  58259. this.geometry.computeBoundingSphere()
  58260. }
  58261. }
  58262. }(),
  58263. n.BoundingBoxHelper = function(e, t) {
  58264. var i = void 0 !== t ? t : 8947848;
  58265. this.object = e,
  58266. this.box = new n.Box3,
  58267. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  58268. color: i,
  58269. wireframe: !0
  58270. }))
  58271. }
  58272. ,
  58273. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  58274. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  58275. n.BoundingBoxHelper.prototype.update = function() {
  58276. this.box.setFromObject(this.object),
  58277. this.box.size(this.scale),
  58278. this.box.center(this.position)
  58279. }
  58280. ,
  58281. n.CameraHelper = function(e) {
  58282. function t(e, t, n) {
  58283. i(e, n),
  58284. i(t, n)
  58285. }
  58286. function i(e, t) {
  58287. r.vertices.push(new n.Vector3),
  58288. r.colors.push(new n.Color(t)),
  58289. void 0 === a[e] && (a[e] = []),
  58290. a[e].push(r.vertices.length - 1)
  58291. }
  58292. var r = new n.Geometry
  58293. , o = new n.LineBasicMaterial({
  58294. color: 16777215,
  58295. vertexColors: n.FaceColors
  58296. })
  58297. , a = {}
  58298. , s = 16755200
  58299. , l = 16711680
  58300. , c = 43775
  58301. , h = 16777215
  58302. , u = 3355443;
  58303. t("n1", "n2", s),
  58304. t("n2", "n4", s),
  58305. t("n4", "n3", s),
  58306. t("n3", "n1", s),
  58307. t("f1", "f2", s),
  58308. t("f2", "f4", s),
  58309. t("f4", "f3", s),
  58310. t("f3", "f1", s),
  58311. t("n1", "f1", s),
  58312. t("n2", "f2", s),
  58313. t("n3", "f3", s),
  58314. t("n4", "f4", s),
  58315. t("p", "n1", l),
  58316. t("p", "n2", l),
  58317. t("p", "n3", l),
  58318. t("p", "n4", l),
  58319. t("u1", "u2", c),
  58320. t("u2", "u3", c),
  58321. t("u3", "u1", c),
  58322. t("c", "t", h),
  58323. t("p", "c", u),
  58324. t("cn1", "cn2", u),
  58325. t("cn3", "cn4", u),
  58326. t("cf1", "cf2", u),
  58327. t("cf3", "cf4", u),
  58328. n.LineSegments.call(this, r, o),
  58329. this.camera = e,
  58330. this.camera.updateProjectionMatrix(),
  58331. this.matrix = e.matrixWorld,
  58332. this.matrixAutoUpdate = !1,
  58333. this.pointMap = a,
  58334. this.update()
  58335. }
  58336. ,
  58337. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  58338. n.CameraHelper.prototype.constructor = n.CameraHelper,
  58339. n.CameraHelper.prototype.update = function() {
  58340. function e(e, n, a, s) {
  58341. r.set(n, a, s).unproject(o);
  58342. var l = i[e];
  58343. if (void 0 !== l)
  58344. for (var c = 0, h = l.length; c < h; c++)
  58345. t.vertices[l[c]].copy(r)
  58346. }
  58347. var t, i, r = new n.Vector3, o = new n.Camera;
  58348. return function() {
  58349. t = this.geometry,
  58350. i = this.pointMap;
  58351. var n = 1
  58352. , r = 1;
  58353. o.projectionMatrix.copy(this.camera.projectionMatrix),
  58354. e("c", 0, 0, -1),
  58355. e("t", 0, 0, 1),
  58356. e("n1", -n, -r, -1),
  58357. e("n2", n, -r, -1),
  58358. e("n3", -n, r, -1),
  58359. e("n4", n, r, -1),
  58360. e("f1", -n, -r, 1),
  58361. e("f2", n, -r, 1),
  58362. e("f3", -n, r, 1),
  58363. e("f4", n, r, 1),
  58364. e("u1", .7 * n, 1.1 * r, -1),
  58365. e("u2", .7 * -n, 1.1 * r, -1),
  58366. e("u3", 0, 2 * r, -1),
  58367. e("cf1", -n, 0, 1),
  58368. e("cf2", n, 0, 1),
  58369. e("cf3", 0, -r, 1),
  58370. e("cf4", 0, r, 1),
  58371. e("cn1", -n, 0, -1),
  58372. e("cn2", n, 0, -1),
  58373. e("cn3", 0, -r, -1),
  58374. e("cn4", 0, r, -1),
  58375. t.verticesNeedUpdate = !0
  58376. }
  58377. }(),
  58378. n.DirectionalLightHelper = function(e, t) {
  58379. n.Object3D.call(this),
  58380. this.light = e,
  58381. this.light.updateMatrixWorld(),
  58382. this.matrix = e.matrixWorld,
  58383. this.matrixAutoUpdate = !1,
  58384. t = t || 1;
  58385. var i = new n.Geometry;
  58386. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  58387. var r = new n.LineBasicMaterial({
  58388. fog: !1
  58389. });
  58390. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58391. this.lightPlane = new n.Line(i,r),
  58392. this.add(this.lightPlane),
  58393. i = new n.Geometry,
  58394. i.vertices.push(new n.Vector3, new n.Vector3),
  58395. r = new n.LineBasicMaterial({
  58396. fog: !1
  58397. }),
  58398. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58399. this.targetLine = new n.Line(i,r),
  58400. this.add(this.targetLine),
  58401. this.update()
  58402. }
  58403. ,
  58404. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  58405. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  58406. n.DirectionalLightHelper.prototype.dispose = function() {
  58407. this.lightPlane.geometry.dispose(),
  58408. this.lightPlane.material.dispose(),
  58409. this.targetLine.geometry.dispose(),
  58410. this.targetLine.material.dispose()
  58411. }
  58412. ,
  58413. n.DirectionalLightHelper.prototype.update = function() {
  58414. var e = new n.Vector3
  58415. , t = new n.Vector3
  58416. , i = new n.Vector3;
  58417. return function() {
  58418. e.setFromMatrixPosition(this.light.matrixWorld),
  58419. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58420. i.subVectors(t, e),
  58421. this.lightPlane.lookAt(i),
  58422. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58423. this.targetLine.geometry.vertices[1].copy(i),
  58424. this.targetLine.geometry.verticesNeedUpdate = !0,
  58425. this.targetLine.material.color.copy(this.lightPlane.material.color)
  58426. }
  58427. }(),
  58428. n.EdgesHelper = function(e, t, i) {
  58429. var r = void 0 !== t ? t : 16777215;
  58430. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  58431. color: r
  58432. })),
  58433. this.matrix = e.matrixWorld,
  58434. this.matrixAutoUpdate = !1
  58435. }
  58436. ,
  58437. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  58438. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  58439. n.FaceNormalsHelper = function(e, t, i, r) {
  58440. this.object = e,
  58441. this.size = void 0 !== t ? t : 1;
  58442. var o = void 0 !== i ? i : 16776960
  58443. , a = void 0 !== r ? r : 1
  58444. , s = 0
  58445. , l = this.object.geometry;
  58446. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  58447. var c = new n.BufferGeometry
  58448. , h = new n.Float32Attribute(2 * s * 3,3);
  58449. c.addAttribute("position", h),
  58450. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58451. color: o,
  58452. linewidth: a
  58453. })),
  58454. this.matrixAutoUpdate = !1,
  58455. this.update()
  58456. }
  58457. ,
  58458. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58459. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  58460. n.FaceNormalsHelper.prototype.update = function() {
  58461. var e = new n.Vector3
  58462. , t = new n.Vector3
  58463. , i = new n.Matrix3;
  58464. return function() {
  58465. this.object.updateMatrixWorld(!0),
  58466. i.getNormalMatrix(this.object.matrixWorld);
  58467. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  58468. var u = s[c]
  58469. , d = u.normal;
  58470. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  58471. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58472. r.setXYZ(l, e.x, e.y, e.z),
  58473. l += 1,
  58474. r.setXYZ(l, t.x, t.y, t.z),
  58475. l += 1
  58476. }
  58477. return r.needsUpdate = !0,
  58478. this
  58479. }
  58480. }(),
  58481. n.GridHelper = function(e, t) {
  58482. var i = new n.Geometry
  58483. , r = new n.LineBasicMaterial({
  58484. vertexColors: n.VertexColors
  58485. });
  58486. this.color1 = new n.Color(4473924),
  58487. this.color2 = new n.Color(8947848);
  58488. for (var o = -e; o <= e; o += t) {
  58489. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  58490. var a = 0 === o ? this.color1 : this.color2;
  58491. i.colors.push(a, a, a, a)
  58492. }
  58493. n.LineSegments.call(this, i, r)
  58494. }
  58495. ,
  58496. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  58497. n.GridHelper.prototype.constructor = n.GridHelper,
  58498. n.GridHelper.prototype.setColors = function(e, t) {
  58499. this.color1.set(e),
  58500. this.color2.set(t),
  58501. this.geometry.colorsNeedUpdate = !0
  58502. }
  58503. ,
  58504. n.HemisphereLightHelper = function(e, t) {
  58505. n.Object3D.call(this),
  58506. this.light = e,
  58507. this.light.updateMatrixWorld(),
  58508. this.matrix = e.matrixWorld,
  58509. this.matrixAutoUpdate = !1,
  58510. this.colors = [new n.Color, new n.Color];
  58511. var i = new n.SphereGeometry(t,4,2);
  58512. i.rotateX(-Math.PI / 2);
  58513. for (var r = 0, o = 8; r < o; r++)
  58514. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  58515. var a = new n.MeshBasicMaterial({
  58516. vertexColors: n.FaceColors,
  58517. wireframe: !0
  58518. });
  58519. this.lightSphere = new n.Mesh(i,a),
  58520. this.add(this.lightSphere),
  58521. this.update()
  58522. }
  58523. ,
  58524. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  58525. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  58526. n.HemisphereLightHelper.prototype.dispose = function() {
  58527. this.lightSphere.geometry.dispose(),
  58528. this.lightSphere.material.dispose()
  58529. }
  58530. ,
  58531. n.HemisphereLightHelper.prototype.update = function() {
  58532. var e = new n.Vector3;
  58533. return function() {
  58534. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  58535. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  58536. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  58537. this.lightSphere.geometry.colorsNeedUpdate = !0
  58538. }
  58539. }(),
  58540. n.PointLightHelper = function(e, t) {
  58541. this.light = e,
  58542. this.light.updateMatrixWorld();
  58543. var i = new n.SphereGeometry(t,4,2)
  58544. , r = new n.MeshBasicMaterial({
  58545. wireframe: !0,
  58546. fog: !1
  58547. });
  58548. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58549. n.Mesh.call(this, i, r),
  58550. this.matrix = this.light.matrixWorld,
  58551. this.matrixAutoUpdate = !1
  58552. }
  58553. ,
  58554. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  58555. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  58556. n.PointLightHelper.prototype.dispose = function() {
  58557. this.geometry.dispose(),
  58558. this.material.dispose()
  58559. }
  58560. ,
  58561. n.PointLightHelper.prototype.update = function() {
  58562. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58563. }
  58564. ,
  58565. n.SkeletonHelper = function(e) {
  58566. this.bones = this.getBoneList(e);
  58567. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  58568. var r = this.bones[i];
  58569. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  58570. t.vertices.push(new n.Vector3),
  58571. t.colors.push(new n.Color(0,0,1)),
  58572. t.colors.push(new n.Color(0,1,0)))
  58573. }
  58574. t.dynamic = !0;
  58575. var o = new n.LineBasicMaterial({
  58576. vertexColors: n.VertexColors,
  58577. depthTest: !1,
  58578. depthWrite: !1,
  58579. transparent: !0
  58580. });
  58581. n.LineSegments.call(this, t, o),
  58582. this.root = e,
  58583. this.matrix = e.matrixWorld,
  58584. this.matrixAutoUpdate = !1,
  58585. this.update()
  58586. }
  58587. ,
  58588. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  58589. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  58590. n.SkeletonHelper.prototype.getBoneList = function(e) {
  58591. var t = [];
  58592. e instanceof n.Bone && t.push(e);
  58593. for (var i = 0; i < e.children.length; i++)
  58594. t.push.apply(t, this.getBoneList(e.children[i]));
  58595. return t
  58596. }
  58597. ,
  58598. n.SkeletonHelper.prototype.update = function() {
  58599. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  58600. var a = this.bones[o];
  58601. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  58602. e.vertices[r].setFromMatrixPosition(i),
  58603. i.multiplyMatrices(t, a.parent.matrixWorld),
  58604. e.vertices[r + 1].setFromMatrixPosition(i),
  58605. r += 2)
  58606. }
  58607. e.verticesNeedUpdate = !0,
  58608. e.computeBoundingSphere()
  58609. }
  58610. ,
  58611. n.SpotLightHelper = function(e) {
  58612. n.Object3D.call(this),
  58613. this.light = e,
  58614. this.light.updateMatrixWorld(),
  58615. this.matrix = e.matrixWorld,
  58616. this.matrixAutoUpdate = !1;
  58617. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  58618. t.translate(0, -.5, 0),
  58619. t.rotateX(-Math.PI / 2);
  58620. var i = new n.MeshBasicMaterial({
  58621. wireframe: !0,
  58622. fog: !1
  58623. });
  58624. this.cone = new n.Mesh(t,i),
  58625. this.add(this.cone),
  58626. this.update()
  58627. }
  58628. ,
  58629. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  58630. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  58631. n.SpotLightHelper.prototype.dispose = function() {
  58632. this.cone.geometry.dispose(),
  58633. this.cone.material.dispose()
  58634. }
  58635. ,
  58636. n.SpotLightHelper.prototype.update = function() {
  58637. var e = new n.Vector3
  58638. , t = new n.Vector3;
  58639. return function() {
  58640. var i = this.light.distance ? this.light.distance : 1e4
  58641. , n = i * Math.tan(this.light.angle);
  58642. this.cone.scale.set(n, n, i),
  58643. e.setFromMatrixPosition(this.light.matrixWorld),
  58644. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58645. this.cone.lookAt(t.sub(e)),
  58646. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58647. }
  58648. }(),
  58649. n.VertexNormalsHelper = function(e, t, i, r) {
  58650. this.object = e,
  58651. this.size = void 0 !== t ? t : 1;
  58652. var o = void 0 !== i ? i : 16711680
  58653. , a = void 0 !== r ? r : 1
  58654. , s = 0
  58655. , l = this.object.geometry;
  58656. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58657. var c = new n.BufferGeometry
  58658. , h = new n.Float32Attribute(2 * s * 3,3);
  58659. c.addAttribute("position", h),
  58660. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58661. color: o,
  58662. linewidth: a
  58663. })),
  58664. this.matrixAutoUpdate = !1,
  58665. this.update()
  58666. }
  58667. ,
  58668. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58669. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58670. n.VertexNormalsHelper.prototype.update = function() {
  58671. var e = new n.Vector3
  58672. , t = new n.Vector3
  58673. , i = new n.Matrix3;
  58674. return function() {
  58675. var r = ["a", "b", "c"];
  58676. this.object.updateMatrixWorld(!0),
  58677. i.getNormalMatrix(this.object.matrixWorld);
  58678. var o = this.object.matrixWorld
  58679. , a = this.geometry.attributes.position
  58680. , s = this.object.geometry;
  58681. if (s instanceof n.Geometry)
  58682. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58683. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58684. var m = l[p[r[f]]]
  58685. , v = p.vertexNormals[f];
  58686. e.copy(m).applyMatrix4(o),
  58687. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58688. a.setXYZ(h, e.x, e.y, e.z),
  58689. h += 1,
  58690. a.setXYZ(h, t.x, t.y, t.z),
  58691. h += 1
  58692. }
  58693. else if (s instanceof n.BufferGeometry)
  58694. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58695. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58696. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58697. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58698. a.setXYZ(h, e.x, e.y, e.z),
  58699. h += 1,
  58700. a.setXYZ(h, t.x, t.y, t.z),
  58701. h += 1;
  58702. return a.needsUpdate = !0,
  58703. this
  58704. }
  58705. }(),
  58706. n.WireframeHelper = function(e, t) {
  58707. var i = void 0 !== t ? t : 16777215;
  58708. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58709. color: i
  58710. })),
  58711. this.matrix = e.matrixWorld,
  58712. this.matrixAutoUpdate = !1
  58713. }
  58714. ,
  58715. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58716. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58717. n.ImmediateRenderObject = function(e) {
  58718. n.Object3D.call(this),
  58719. this.material = e,
  58720. this.render = function(e) {}
  58721. }
  58722. ,
  58723. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58724. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58725. n.MorphBlendMesh = function(e, t) {
  58726. n.Mesh.call(this, e, t),
  58727. this.animationsMap = {},
  58728. this.animationsList = [];
  58729. var i = this.geometry.morphTargets.length
  58730. , r = "__default"
  58731. , o = 0
  58732. , a = i - 1
  58733. , s = i / 1;
  58734. this.createAnimation(r, o, a, s),
  58735. this.setAnimationWeight(r, 1)
  58736. }
  58737. ,
  58738. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58739. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58740. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58741. var r = {
  58742. start: t,
  58743. end: i,
  58744. length: i - t + 1,
  58745. fps: n,
  58746. duration: (i - t) / n,
  58747. lastFrame: 0,
  58748. currentFrame: 0,
  58749. active: !1,
  58750. time: 0,
  58751. direction: 1,
  58752. weight: 1,
  58753. directionBackwards: !1,
  58754. mirroredLoop: !1
  58755. };
  58756. this.animationsMap[e] = r,
  58757. this.animationsList.push(r)
  58758. }
  58759. ,
  58760. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58761. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58762. var s = r.morphTargets[o]
  58763. , l = s.name.match(i);
  58764. if (l && l.length > 1) {
  58765. var c = l[1];
  58766. n[c] || (n[c] = {
  58767. start: 1 / 0,
  58768. end: -(1 / 0)
  58769. });
  58770. var h = n[c];
  58771. o < h.start && (h.start = o),
  58772. o > h.end && (h.end = o),
  58773. t || (t = c)
  58774. }
  58775. }
  58776. for (var c in n) {
  58777. var h = n[c];
  58778. this.createAnimation(c, h.start, h.end, e)
  58779. }
  58780. this.firstAnimation = t
  58781. }
  58782. ,
  58783. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58784. var t = this.animationsMap[e];
  58785. t && (t.direction = 1,
  58786. t.directionBackwards = !1)
  58787. }
  58788. ,
  58789. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58790. var t = this.animationsMap[e];
  58791. t && (t.direction = -1,
  58792. t.directionBackwards = !0)
  58793. }
  58794. ,
  58795. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58796. var i = this.animationsMap[e];
  58797. i && (i.fps = t,
  58798. i.duration = (i.end - i.start) / i.fps)
  58799. }
  58800. ,
  58801. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58802. var i = this.animationsMap[e];
  58803. i && (i.duration = t,
  58804. i.fps = (i.end - i.start) / i.duration)
  58805. }
  58806. ,
  58807. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58808. var i = this.animationsMap[e];
  58809. i && (i.weight = t)
  58810. }
  58811. ,
  58812. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58813. var i = this.animationsMap[e];
  58814. i && (i.time = t)
  58815. }
  58816. ,
  58817. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58818. var t = 0
  58819. , i = this.animationsMap[e];
  58820. return i && (t = i.time),
  58821. t
  58822. }
  58823. ,
  58824. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58825. var t = -1
  58826. , i = this.animationsMap[e];
  58827. return i && (t = i.duration),
  58828. t
  58829. }
  58830. ,
  58831. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58832. var t = this.animationsMap[e];
  58833. t ? (t.time = 0,
  58834. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58835. }
  58836. ,
  58837. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58838. var t = this.animationsMap[e];
  58839. t && (t.active = !1)
  58840. }
  58841. ,
  58842. n.MorphBlendMesh.prototype.update = function(e) {
  58843. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58844. var r = this.animationsList[t];
  58845. if (r.active) {
  58846. var o = r.duration / r.length;
  58847. r.time += r.direction * e,
  58848. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58849. r.time > r.duration && (r.time = r.duration,
  58850. r.directionBackwards = !0),
  58851. r.time < 0 && (r.time = 0,
  58852. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58853. r.time < 0 && (r.time += r.duration));
  58854. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58855. , s = r.weight;
  58856. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58857. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58858. this.morphTargetInfluences[a] = 0,
  58859. r.lastFrame = r.currentFrame,
  58860. r.currentFrame = a);
  58861. var l = r.time % o / o;
  58862. r.directionBackwards && (l = 1 - l),
  58863. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58864. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58865. }
  58866. }
  58867. }
  58868. ,
  58869. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58870. i.THREE = n) : this.THREE = n
  58871. }
  58872. , {}]
  58873. }, {}, [116]);