main_2018.js 2.3 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750
  1. var dom = {
  2. getOffset: function (e, t, i) {
  3. for (left = "left" == e ? t.offsetLeft : t.offsetTop, i = i || $("body")[0];
  4. (t = t.offsetParent) && t != i;) left += "left" == e ? t.offsetLeft : t.offsetTop;
  5. return left
  6. }
  7. };
  8. if (function () {
  9. "use strict";
  10. function o(e, t) {
  11. return typeof e === t
  12. }
  13. function a(e, t) {
  14. return e instanceof t
  15. }
  16. function s(e) {
  17. return e && e.nodeType
  18. }
  19. function l(e) {
  20. return s(e) ? e : a(e, y) ? e[0] : void 0
  21. }
  22. function e(e, i, n) {
  23. return y.each(e, function (e, t) {
  24. n = i.call(t, n, e, t)
  25. }), n
  26. }
  27. function t(e, t, i) {
  28. var n, r, o;
  29. if (e === t) return !0;
  30. if (!e || !t || e.constructor !== t.constructor) return !1;
  31. for (n = 0, r = i.length; n < r; n += 1) {
  32. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o])) return !1;
  33. if (e[o] !== t[o]) return !1
  34. }
  35. return !0
  36. }
  37. function c(e, t, i, n) {
  38. this.left = w(e), this.top = w(t), this.width = w(i), this.height = w(n), this.right = this.left + this.width, this.bottom = this.top + this.height
  39. }
  40. function h(e, t, i, n) {
  41. this.visible = e || 0, this.viewport = t || 0, this.possible = i || 0, this.rects = n && I({}, n) || null
  42. }
  43. function r(e, t) {
  44. this.els = e, this.viewport = t
  45. }
  46. function n(e, t) {
  47. return e.val - t.val
  48. }
  49. function u(e, t) {
  50. return t.val - e.val
  51. }
  52. function d(e) {
  53. var t = c.ofContent(e, !0),
  54. i = c.ofViewport(e, !0),
  55. n = t.width - i.width,
  56. r = t.height - i.height;
  57. this.content = t, this.viewport = i, this.width = n <= 0 ? null : i.left / n, this.height = r <= 0 ? null : i.top / r, this.left = i.left, this.top = i.top, this.right = t.right - i.right, this.bottom = t.bottom - i.bottom
  58. }
  59. function p(e) {
  60. this.el = e || window
  61. }
  62. function f(e, t) {
  63. this.context = e, this.viewport = t, this.init()
  64. }
  65. function g(e, t, i, n) {
  66. this.context = new r(e, t), this.property = i, this.descending = n, this.init()
  67. }
  68. function m(e) {
  69. e && e !== window && e !== document ? (this.context = e, this.$autoTarget = y(e)) : this.context = window, this.init()
  70. }
  71. var i, v, y = jQuery,
  72. A = y(window),
  73. C = y(document),
  74. I = y.extend,
  75. E = y.isFunction,
  76. _ = Math.max,
  77. b = Math.min,
  78. w = Math.round,
  79. T = (i = {}, v = 1, function (e) {
  80. return e ? (i[e] || (i[e] = v, v += 1), i[e]) : 0
  81. });
  82. I(c.prototype, {
  83. equals: function (e) {
  84. return t(this, e, ["left", "top", "width", "height"])
  85. },
  86. area: function () {
  87. return this.width * this.height
  88. },
  89. relativeTo: function (e) {
  90. return new c(this.left - e.left, this.top - e.top, this.width, this.height)
  91. },
  92. intersection: function (e) {
  93. if (!a(e, c)) return null;
  94. var t = _(this.left, e.left),
  95. i = b(this.right, e.right),
  96. n = _(this.top, e.top),
  97. r = i - t,
  98. o = b(this.bottom, e.bottom) - n;
  99. return 0 <= r && 0 <= o ? new c(t, n, r, o) : null
  100. },
  101. envelope: function (e) {
  102. if (!a(e, c)) return this;
  103. var t = b(this.left, e.left),
  104. i = _(this.right, e.right),
  105. n = b(this.top, e.top);
  106. return new c(t, n, i - t, _(this.bottom, e.bottom) - n)
  107. }
  108. }), I(c, {
  109. ofContent: function (e, t) {
  110. return e && e !== document && e !== window ? t ? new c(0, 0, e.scrollWidth, e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft, e.offsetTop - e.scrollTop, e.scrollWidth, e.scrollHeight) : new c(0, 0, C.width(), C.height())
  111. },
  112. ofViewport: function (e, t) {
  113. return e && e !== document && e !== window ? t ? new c(e.scrollLeft, e.scrollTop, e.clientWidth, e.clientHeight) : new c(e.offsetLeft, e.offsetTop, e.clientWidth, e.clientHeight) : new c(A.scrollLeft(), A.scrollTop(), A.width(), A.height())
  114. },
  115. ofElement: function (e) {
  116. var t = y(e);
  117. if (!t.is(":visible")) return null;
  118. var i = t.offset();
  119. return new c(i.left, i.top, t.outerWidth(), t.outerHeight())
  120. }
  121. }), I(h.prototype, {
  122. equals: function (e) {
  123. return this.fracsEqual(e) && this.rectsEqual(e)
  124. },
  125. fracsEqual: function (e) {
  126. return t(this, e, ["visible", "viewport", "possible"])
  127. },
  128. rectsEqual: function (e) {
  129. return t(this.rects, e.rects, ["document", "element", "viewport"])
  130. }
  131. }), I(h, {
  132. of: function (e, t) {
  133. var i, n, r;
  134. return e = s(e) && c.ofElement(e) || e, t = s(t) && c.ofViewport(t) || t || c.ofViewport(), e instanceof c && (i = e.intersection(t)) ? (n = i.area(), r = b(e.width, t.width) * b(e.height, t.height), new h(n / e.area(), n / t.area(), n / r, {
  135. document: i,
  136. element: i.relativeTo(e),
  137. viewport: i.relativeTo(t)
  138. })) : new h
  139. }
  140. });
  141. var x = ["width", "height", "left", "right", "top", "bottom"],
  142. S = ["possible", "visible", "viewport"];
  143. I(r.prototype, {
  144. sorted: function (t, e) {
  145. var i = this.viewport;
  146. return y.map(this.els, function (e) {
  147. return {
  148. el: e,
  149. val: function (e, t, i) {
  150. var n;
  151. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)), n ? n[i] : 0
  152. }(e, i, t)
  153. }
  154. }).sort(e ? u : n)
  155. },
  156. best: function (e, t) {
  157. return this.els.length ? this.sorted(e, t)[0] : null
  158. }
  159. }), I(d.prototype, {
  160. equals: function (e) {
  161. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  162. }
  163. }), I(p.prototype, {
  164. equals: function (e) {
  165. return t(this, e, ["el"])
  166. },
  167. scrollState: function () {
  168. return new d(this.el)
  169. },
  170. scrollTo: function (e, t, i) {
  171. var n = y(this.el === window ? "html,body" : this.el);
  172. e = e || 0, t = t || 0, i = isNaN(i) ? 1e3 : i, n.stop(!0).animate({
  173. scrollLeft: e,
  174. scrollTop: t
  175. }, i)
  176. },
  177. scroll: function (e, t, i) {
  178. var n = this.el === window ? A : y(this.el);
  179. e = e || 0, t = t || 0, this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  180. },
  181. scrollToRect: function (e, t, i, n) {
  182. t = t || 0, i = i || 0, this.scrollTo(e.left - t, e.top - i, n)
  183. },
  184. scrollToElement: function (e, t, i, n) {
  185. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  186. this.scrollToRect(r, t, i, n)
  187. }
  188. });
  189. var M = {
  190. init: function () {
  191. this.callbacks = y.Callbacks("memory unique"), this.currVal = null, this.prevVal = null, this.checkProxy = y.proxy(this.check, this), this.autoCheck()
  192. },
  193. bind: function (e) {
  194. this.callbacks.add(e)
  195. },
  196. unbind: function (e) {
  197. e ? this.callbacks.remove(e) : this.callbacks.empty()
  198. },
  199. trigger: function () {
  200. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  201. },
  202. check: function (e) {
  203. var t = this.updatedValue(e);
  204. return void 0 !== t && (this.prevVal = this.currVal, this.currVal = t, this.trigger(), !0)
  205. },
  206. $autoTarget: A,
  207. autoEvents: "load resize scroll",
  208. autoCheck: function (e) {
  209. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  210. }
  211. };
  212. I(f.prototype, M, {
  213. updatedValue: function () {
  214. var e = h.of(this.context, this.viewport);
  215. return this.currVal && this.currVal.equals(e) ? void 0 : e
  216. }
  217. }), I(g.prototype, M, {
  218. updatedValue: function () {
  219. var e = this.context.best(this.property, this.descending);
  220. return e && (e = 0 < e.val ? e.el : null, this.currVal !== e) ? e : void 0
  221. }
  222. }), I(m.prototype, M, {
  223. updatedValue: function () {
  224. var e = new d(this.context);
  225. return this.currVal && this.currVal.equals(e) ? void 0 : e
  226. }
  227. });
  228. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  229. function H(e, t, i, n) {
  230. return i = N(i) ? i.apply(e, t) : i, N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  231. }
  232. R = U, P = {
  233. statics: {
  234. version: "0.15.0",
  235. Rect: c,
  236. Fractions: h,
  237. Group: r,
  238. ScrollState: d,
  239. Viewport: p,
  240. FracsCallbacks: f,
  241. GroupCallbacks: g,
  242. ScrollStateCallbacks: m,
  243. fracs: function (e, t) {
  244. return h.of(e, t)
  245. }
  246. },
  247. methods: {
  248. content: function (e) {
  249. return this.length ? c.ofContent(this[0], e) : null
  250. },
  251. envelope: function () {
  252. return e(this, function (e) {
  253. var t = c.ofElement(this);
  254. return e ? e.envelope(t) : t
  255. })
  256. },
  257. fracs: function (e, i, n) {
  258. o(e, "string") || (n = i, i = e, e = null), E(i) || (n = i, i = null), n = l(n);
  259. var r = U + ".fracs." + T(n);
  260. return "unbind" === e ? this.each(function () {
  261. var e = y(this).data(r);
  262. e && e.unbind(i)
  263. }) : "check" === e ? this.each(function () {
  264. var e = y(this).data(r);
  265. e && e.check()
  266. }) : E(i) ? this.each(function () {
  267. var e = y(this),
  268. t = e.data(r);
  269. t || (t = new f(this, n), e.data(r, t)), t.bind(i)
  270. }) : this.length ? h.of(this[0], n) : null
  271. },
  272. intersection: function () {
  273. return e(this, function (e) {
  274. var t = c.ofElement(this);
  275. return e ? e.intersection(t) : t
  276. })
  277. },
  278. max: function (e, t, i) {
  279. return E(t) || (i = t, t = null), i = l(i), t ? (new g(this, i, e, !0).bind(t), this) : this.pushStack(new r(this, i).best(e, !0).el)
  280. },
  281. min: function (e, t, i) {
  282. return E(t) || (i = t, t = null), i = l(i), t ? (new g(this, i, e).bind(t), this) : this.pushStack(new r(this, i).best(e).el)
  283. },
  284. rect: function () {
  285. return this.length ? c.ofElement(this[0]) : null
  286. },
  287. scrollState: function (e, i) {
  288. var n = U + ".scrollState";
  289. return o(e, "string") || (i = e, e = null), "unbind" === e ? this.each(function () {
  290. var e = y(this).data(n);
  291. e && e.unbind(i)
  292. }) : "check" === e ? this.each(function () {
  293. var e = y(this).data(n);
  294. e && e.check()
  295. }) : E(i) ? this.each(function () {
  296. var e = y(this),
  297. t = e.data(n);
  298. t || (t = new m(this), e.data(n, t)), t.bind(i)
  299. }) : this.length ? new d(this[0]) : null
  300. },
  301. scroll: function (e, t, i) {
  302. return this.each(function () {
  303. new p(this).scroll(e, t, i)
  304. })
  305. },
  306. scrollTo: function (e, t, i, n) {
  307. return y.isNumeric(e) && (n = i, i = t, t = e, e = null), e = l(e), this.each(function () {
  308. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  309. })
  310. },
  311. scrollToThis: function (e, t, i, n) {
  312. return (n = new p(l(n))).scrollToElement(this[0], e, t, i), this
  313. },
  314. softLink: function (t, i, n, r) {
  315. return r = new p(l(r)), this.filter("a[href^=#]").each(function () {
  316. var e = y(this);
  317. e.on("click", function () {
  318. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  319. })
  320. })
  321. },
  322. sort: function (e, t, i) {
  323. return o(t, "boolean") || (i = t, t = null), i = l(i), this.pushStack(y.map(new r(this, i).sorted(e, !t), function (e) {
  324. return e.el
  325. }))
  326. },
  327. viewport: function (e) {
  328. return this.length ? c.ofViewport(this[0], e) : null
  329. }
  330. },
  331. defaultStatic: "fracs",
  332. defaultMethod: "fracs"
  333. }, O = [].slice, L = jQuery, D = L.extend, N = L.isFunction, F = D({}, P), B = function () {
  334. return H(this, O.call(arguments), F.defaultStatic, B)
  335. }, V = function (e) {
  336. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  337. }, (k = function (e) {
  338. e && (D(B, e.statics), D(V, e.methods)), B.modplug = k
  339. }).prev = {
  340. statics: L[R],
  341. methods: L.fn[R]
  342. }, k(P), L[R] = B, L.fn[R] = V
  343. }(), "undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery");
  344. ! function (m) {
  345. "use strict";
  346. function r(e, t) {
  347. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null, this.init("tooltip", e, t)
  348. }
  349. r.VERSION = "3.2.0", r.DEFAULTS = {
  350. animation: !0,
  351. placement: "top",
  352. selector: !1,
  353. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  354. trigger: "hover focus",
  355. title: "",
  356. delay: 0,
  357. html: !1,
  358. container: !1,
  359. viewport: {
  360. selector: "body",
  361. padding: 0
  362. }
  363. }, r.prototype.init = function (e, t, i) {
  364. this.enabled = !0, this.type = e, this.$element = m(t), this.options = this.getOptions(i), this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  365. for (var n = this.options.trigger.split(" "), r = n.length; r--;) {
  366. var o = n[r];
  367. if ("click" == o) this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  368. else if ("manual" != o) {
  369. var a = "hover" == o ? "mouseenter" : "focusin",
  370. s = "hover" == o ? "mouseleave" : "focusout";
  371. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)), this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  372. }
  373. }
  374. this.options.selector ? this._options = m.extend({}, this.options, {
  375. trigger: "manual",
  376. selector: ""
  377. }) : this.fixTitle()
  378. }, r.prototype.getDefaults = function () {
  379. return r.DEFAULTS
  380. }, r.prototype.getOptions = function (e) {
  381. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  382. show: e.delay,
  383. hide: e.delay
  384. }), e
  385. }, r.prototype.getDelegateOptions = function () {
  386. var i = {},
  387. n = this.getDefaults();
  388. return this._options && m.each(this._options, function (e, t) {
  389. n[e] != t && (i[e] = t)
  390. }), i
  391. }, r.prototype.enter = function (e) {
  392. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  393. return t || (t = new this.constructor(e.currentTarget, this.getDelegateOptions()), m(e.currentTarget).data("bs." + this.type, t)), clearTimeout(t.timeout), t.hoverState = "in", t.options.delay && t.options.delay.show ? void(t.timeout = setTimeout(function () {}, t.options.delay.show)) : t.show()
  394. }, r.prototype.leave = function (e) {
  395. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  396. return t || (t = new this.constructor(e.currentTarget, this.getDelegateOptions()), m(e.currentTarget).data("bs." + this.type, t)), clearTimeout(t.timeout), t.hoverState = "out", t.options.delay && t.options.delay.hide ? void(t.timeout = setTimeout(function () {
  397. "out" == t.hoverState && t.hide()
  398. }, t.options.delay.hide)) : t.hide()
  399. }, r.prototype.show = function () {
  400. var e = m.Event("show.bs." + this.type);
  401. if (this.hasContent() && this.enabled) {
  402. this.$element.trigger(e);
  403. var t = m.contains(document.documentElement, this.$element[0]);
  404. if (e.isDefaultPrevented() || !t) return;
  405. var i = this,
  406. n = this.tip(),
  407. r = this.getUID(this.type);
  408. this.setContent(), n.attr("id", r), this.$element.attr("aria-describedby", r), this.options.animation && n.addClass("fade");
  409. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement,
  410. a = /\s?auto?\s?/i,
  411. s = a.test(o);
  412. s && (o = o.replace(a, "") || "top"), n.detach().css({
  413. top: 0,
  414. left: 0,
  415. display: "block"
  416. }).addClass(o).data("bs." + this.type, this), this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  417. var l = this.getPosition(),
  418. c = n[0].offsetWidth,
  419. h = n[0].offsetHeight;
  420. if (s) {
  421. var u = o,
  422. d = this.$element.parent(),
  423. p = this.getPosition(d);
  424. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o, n.removeClass(u).addClass(o)
  425. }
  426. var f = this.getCalculatedOffset(o, l, c, h);
  427. this.applyPlacement(f, o);
  428. var g = function () {
  429. i.$element.trigger("shown.bs." + i.type), i.hoverState = null
  430. };
  431. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  432. }
  433. }, r.prototype.applyPlacement = function (e, t) {
  434. var i = this.tip(),
  435. n = i[0].offsetWidth,
  436. r = i[0].offsetHeight,
  437. o = parseInt(i.css("margin-top"), 10),
  438. a = parseInt(i.css("margin-left"), 10);
  439. isNaN(o) && (o = 0), isNaN(a) && (a = 0), e.top = e.top + o, e.left = e.left + a, m.offset.setOffset(i[0], m.extend({
  440. using: function (e) {
  441. i.css({
  442. top: Math.round(e.top),
  443. left: Math.round(e.left)
  444. })
  445. }
  446. }, e), 0), i.addClass("in");
  447. var s = i[0].offsetWidth,
  448. l = i[0].offsetHeight;
  449. "top" == t && l != r && (e.top = e.top + r - l);
  450. var c = this.getViewportAdjustedDelta(t, e, s, l);
  451. c.left ? e.left += c.left : e.top += c.top;
  452. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l,
  453. u = c.left ? "left" : "top",
  454. d = c.left ? "offsetWidth" : "offsetHeight";
  455. i.offset(e), this.replaceArrow(h, i[0][d], u)
  456. }, r.prototype.replaceArrow = function (e, t, i) {
  457. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  458. }, r.prototype.setContent = function () {
  459. var e = this.tip(),
  460. t = this.getTitle();
  461. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t), e.removeClass("fade in top bottom left right")
  462. }, r.prototype.hide = function () {
  463. function e() {
  464. "in" != t.hoverState && i.detach(), t.$element.trigger("hidden.bs." + t.type)
  465. }
  466. var t = this,
  467. i = this.tip(),
  468. n = m.Event("hide.bs." + this.type);
  469. if (this.$element.removeAttr("aria-describedby"), this.$element.trigger(n), !n.isDefaultPrevented()) return i.removeClass("in"), m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(), this.hoverState = null, this
  470. }, r.prototype.fixTitle = function () {
  471. var e = this.$element;
  472. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  473. }, r.prototype.hasContent = function () {
  474. return this.getTitle()
  475. }, r.prototype.getPosition = function (e) {
  476. var t = (e = e || this.$element)[0],
  477. i = "BODY" == t.tagName;
  478. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  479. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  480. width: i ? m(window).width() : e.outerWidth(),
  481. height: i ? m(window).height() : e.outerHeight()
  482. }, i ? {
  483. top: 0,
  484. left: 0
  485. } : e.offset())
  486. }, r.prototype.getCalculatedOffset = function (e, t, i, n) {
  487. return "bottom" == e ? {
  488. top: t.top + t.height,
  489. left: t.left + t.width / 2 - i / 2
  490. } : "top" == e ? {
  491. top: t.top - n,
  492. left: t.left + t.width / 2 - i / 2
  493. } : "left" == e ? {
  494. top: t.top + t.height / 2 - n / 2,
  495. left: t.left - i
  496. } : {
  497. top: t.top + t.height / 2 - n / 2,
  498. left: t.left + t.width
  499. }
  500. }, r.prototype.getViewportAdjustedDelta = function (e, t, i, n) {
  501. var r = {
  502. top: 0,
  503. left: 0
  504. };
  505. if (!this.$viewport) return r;
  506. var o = this.options.viewport && this.options.viewport.padding || 0,
  507. a = this.getPosition(this.$viewport);
  508. if (/right|left/.test(e)) {
  509. var s = t.top - o - a.scroll,
  510. l = t.top + o - a.scroll + n;
  511. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  512. } else {
  513. var c = t.left - o,
  514. h = t.left + o + i;
  515. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  516. }
  517. return r
  518. }, r.prototype.getTitle = function () {
  519. var e = this.$element,
  520. t = this.options;
  521. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  522. }, r.prototype.getUID = function (e) {
  523. for (; e += ~~(1e6 * Math.random()), document.getElementById(e););
  524. return e
  525. }, r.prototype.tip = function () {
  526. return this.$tip = this.$tip || m(this.options.template)
  527. }, r.prototype.arrow = function () {
  528. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  529. }, r.prototype.validate = function () {
  530. this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
  531. }, r.prototype.enable = function () {
  532. this.enabled = !0
  533. }, r.prototype.disable = function () {
  534. this.enabled = !1
  535. }, r.prototype.toggleEnabled = function () {
  536. this.enabled = !this.enabled
  537. }, r.prototype.toggle = function (e) {
  538. var t = this;
  539. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget, this.getDelegateOptions()), m(e.currentTarget).data("bs." + this.type, t))), t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  540. }, r.prototype.destroy = function () {
  541. clearTimeout(this.timeout), this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  542. };
  543. var e = m.fn.tooltip;
  544. m.fn.tooltip = function (n) {
  545. return this.each(function () {
  546. var e = m(this),
  547. t = e.data("bs.tooltip"),
  548. i = "object" == typeof n && n;
  549. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this, i)), "string" == typeof n && t[n]())
  550. })
  551. }, m.fn.tooltip.Constructor = r, m.fn.tooltip.noConflict = function () {
  552. return m.fn.tooltip = e, this
  553. }
  554. }(jQuery),
  555. function (e, t, i) {
  556. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  557. }(0, this, function () {
  558. "use strict";
  559. function Keen() {
  560. return _init.apply(this, arguments)
  561. }
  562. function _init(e) {
  563. if (_isUndefined(e)) throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  564. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1) throw new Error("Please provide a projectId");
  565. this.configure(e)
  566. }
  567. function _extend(e) {
  568. for (var t = 1; t < arguments.length; t++)
  569. for (var i in arguments[t]) e[i] = arguments[t][i];
  570. return e
  571. }
  572. function _isUndefined(e) {
  573. return void 0 === e
  574. }
  575. function _type(e) {
  576. var t = e && e.constructor ? e.constructor.toString() : void 0;
  577. return t ? t.match(/function (.*)\(/)[1] : "Null"
  578. }
  579. function _each(e, t, i) {
  580. var n;
  581. if (!e) return 0;
  582. if (i = i || e, "array" === _type(e)) {
  583. for (n = 0; n < e.length; n++)
  584. if (!1 === t.call(i, e[n], n, e)) return 0
  585. } else
  586. for (n in e)
  587. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e)) return 0;
  588. return 1
  589. }
  590. function _parse_params(e) {
  591. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function (e) {
  592. return decodeURIComponent(e.replace(n, " "))
  593. }, a = e.split("?")[1]; t = r.exec(a);) i[o(t[1])] = o(t[2]);
  594. return i
  595. }
  596. function _set_protocol(e) {
  597. switch (e) {
  598. case "http":
  599. return "http";
  600. case "auto":
  601. return location.protocol.replace(/:/g, "");
  602. case "https":
  603. case void 0:
  604. default:
  605. return "https"
  606. }
  607. }
  608. function _set_request_type(e) {
  609. var t = e || "jsonp",
  610. i = !1;
  611. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials" in new XMLHttpRequest && (i = !0), null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  612. }
  613. function _build_url(e) {
  614. return this.client.endpoint + "/projects/" + this.client.projectId + e
  615. }
  616. function _uploadEvent(e, t, i, n, r) {
  617. var o = _build_url.apply(this, ["/events/" + e]),
  618. a = {};
  619. for (var s in i = !1 !== i, this.client.globalProperties && (a = this.client.globalProperties(e)), t) t.hasOwnProperty(s) && (a[s] = t[s]);
  620. switch (this.client.requestType) {
  621. case "xhr":
  622. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  623. break;
  624. case "jsonp":
  625. var l = JSON.stringify(a),
  626. c = Keen.Base64.encode(l);
  627. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(), _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  628. break;
  629. case "beacon":
  630. l = JSON.stringify(a), c = Keen.Base64.encode(l);
  631. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()), o += "&c=clv1", _request.beacon.apply(this, [o, null, n, r])
  632. }
  633. }
  634. Keen.prototype.configure = function (e) {
  635. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""), e.protocol = _set_protocol(e.protocol), e.requestType = _set_request_type(e.requestType), this.client = {
  636. projectId: e.projectId,
  637. writeKey: e.writeKey,
  638. readKey: e.readKey,
  639. globalProperties: null,
  640. endpoint: e.protocol + "://" + e.host,
  641. requestType: e.requestType
  642. }, Keen.trigger("client", this, e), this.trigger("ready"), this
  643. };
  644. var _request = {
  645. xhr: function (e, t, i, n, r, o, a, s) {
  646. if (!r) return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  647. var l = new XMLHttpRequest;
  648. if (l.onreadystatechange = function () {
  649. if (4 == l.readyState)
  650. if (200 <= l.status && l.status < 300) {
  651. var e;
  652. try {
  653. e = JSON.parse(l.responseText)
  654. } catch (e) {
  655. Keen.log("Could not JSON parse HTTP response: " + l.responseText), s && s(l, e)
  656. }
  657. a && e && a(e)
  658. } else Keen.log("HTTP request failed."), s && s(l, null)
  659. }, l.open(e, t, o), r && l.setRequestHeader("Authorization", r), n && l.setRequestHeader("Content-Type", "application/json"), i)
  660. for (var c in i) i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  661. var h = n ? JSON.stringify(n) : null;
  662. l.send(h)
  663. },
  664. jsonp: function (e, t, i, n) {
  665. if (!t) return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  666. if (t && e.indexOf("api_key") < 0) {
  667. var r = 0 < e.indexOf("?") ? "&" : "?";
  668. e = e + r + "api_key=" + t
  669. }
  670. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window;) o += "a";
  671. var a = !1;
  672. window[o] = function (e) {
  673. a = !0, i && e && i(e), window[o] = void 0
  674. }, e = e + "&jsonp=" + o;
  675. var s = document.createElement("script");
  676. s.id = "keen-jsonp", s.src = e, document.getElementsByTagName("head")[0].appendChild(s), s.onreadystatechange = function () {
  677. !1 === a && "loaded" === this.readyState && (a = !0, n && n())
  678. }, s.onerror = function () {
  679. !1 === a && (a = !0, n && n())
  680. }
  681. },
  682. beacon: function (e, t, i, n) {
  683. if (t && e.indexOf("api_key") < 0) {
  684. var r = 0 < e.indexOf("?") ? "&" : "?";
  685. e = e + r + "api_key=" + t
  686. }
  687. var o = document.createElement("img");
  688. o.onload = function () {
  689. if (!0, "naturalHeight" in this) {
  690. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror()
  691. } else if (this.width + this.height === 0) return void this.onerror();
  692. i && i({
  693. created: !0
  694. })
  695. }, o.onerror = function () {
  696. !0, n && n()
  697. }, o.src = e
  698. }
  699. },
  700. Events = Keen.Events = {
  701. on: function (e, t) {
  702. return this.listeners || (this.listeners = {}), (this.listeners[e] || (this.listeners[e] = [])).push({
  703. callback: t
  704. }), this
  705. },
  706. off: function (e, t) {
  707. if (!e && !t) return this.listeners = void 0, delete this.listeners, this;
  708. for (var i = this.listeners[e] || [], n = i.length; n--;) t && t == i[n].callback && this.listeners[e].splice(n, 1), t && 0 != i.length || (this.listeners[e] = void 0, delete this.listeners[e]);
  709. return this
  710. },
  711. trigger: function (e) {
  712. if (!this.listeners) return this;
  713. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++) i[n].callback.apply(this, t);
  714. return this
  715. }
  716. };
  717. _extend(Keen.prototype, Events), _extend(Keen, Events), Keen.loaded = !0, Keen.utils = {
  718. each: _each,
  719. extend: _extend,
  720. parseParams: _parse_params
  721. }, Keen.ready = function (e) {
  722. Keen.loaded ? e() : Keen.on("ready", e)
  723. }, Keen.log = function (e) {
  724. "object" == typeof console && console.log("[Keen IO]", e)
  725. };
  726. var Plugins = Keen.Plugins = {},
  727. Hh, Ih;
  728. Keen.prototype.addEvent = function () {
  729. _uploadEvent.apply(this, arguments)
  730. }, Keen.prototype.addEventSync = function (e, t, i, n) {
  731. _uploadEvent.apply(this, [e, t, !1, i, n])
  732. }, Keen.prototype.trackExternalLink = function (e, t, i, n, r) {
  733. var o = e,
  734. a = o.metaKey,
  735. s = o.target,
  736. l = !1,
  737. c = function () {};
  738. return void 0 === n && (n = 500), "A" === s.nodeName ? c = function () {
  739. a || l || (l = !0, window.location = s.href)
  740. } : "FORM" === s.nodeName && (c = function () {
  741. l || (l = !0, s.submit())
  742. }), r && (c = function () {
  743. l || (l = !0, r())
  744. }), _uploadEvent.call(this, t, i, c, c), setTimeout(function () {
  745. c()
  746. }, n), !!a && void 0
  747. }, Keen.prototype.setGlobalProperties = function (e) {
  748. if (!this.client) return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  749. if (!e || "function" != typeof e) throw new Error("Invalid value for global properties: " + e);
  750. this.client.globalProperties = e
  751. }, Keen.Base64 = {
  752. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  753. encode: function (e) {
  754. var t, i, n, r, o, a, s, l = "",
  755. c = 0,
  756. h = this.map;
  757. for (e = this.utf8.encode(e); c < e.length;) t = e.charCodeAt(c++), i = e.charCodeAt(c++), n = e.charCodeAt(c++), r = t >> 2, o = (3 & t) << 4 | i >> 4, a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6, s = isNaN(i) || isNaN(n) ? 64 : 63 & n, l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  758. return l
  759. },
  760. decode: function (e) {
  761. var t, i, n, r, o, a, s = "",
  762. l = 0,
  763. c = this.map,
  764. h = String.fromCharCode;
  765. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length;) t = c.indexOf(e.charAt(l++)), o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2, a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))), s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  766. return this.utf8.decode(s)
  767. },
  768. utf8: {
  769. encode: function (e) {
  770. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length;) i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  771. return i
  772. },
  773. decode: function (e) {
  774. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length;) i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  775. return i
  776. }
  777. }
  778. }, "object" != typeof JSON && (JSON = {}),
  779. function () {
  780. function f(e) {
  781. return e < 10 ? "0" + e : e
  782. }
  783. function quote(e) {
  784. return escapable.lastIndex = 0, escapable.test(e) ? '"' + e.replace(escapable, function (e) {
  785. var t = meta[e];
  786. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  787. }) + '"' : '"' + e + '"'
  788. }
  789. function str(e, t) {
  790. var i, n, r, o, a, s = gap,
  791. l = t[e];
  792. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)), "function" == typeof rep && (l = rep.call(t, e, l)), typeof l) {
  793. case "string":
  794. return quote(l);
  795. case "number":
  796. return isFinite(l) ? String(l) : "null";
  797. case "boolean":
  798. case "null":
  799. return String(l);
  800. case "object":
  801. if (!l) return "null";
  802. if (gap += indent, a = [], "[object Array]" === Object.prototype.toString.apply(l)) {
  803. for (o = l.length, i = 0; i < o; i += 1) a[i] = str(i, l) || "null";
  804. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]", gap = s, r
  805. }
  806. if (rep && "object" == typeof rep)
  807. for (o = rep.length, i = 0; i < o; i += 1) "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  808. else
  809. for (n in l) Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  810. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}", gap = s, r
  811. }
  812. }
  813. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function () {
  814. 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
  815. }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () {
  816. return this.valueOf()
  817. });
  818. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  819. escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  820. gap, indent, meta = {
  821. "\b": "\\b",
  822. "\t": "\\t",
  823. "\n": "\\n",
  824. "\f": "\\f",
  825. "\r": "\\r",
  826. '"': '\\"',
  827. "\\": "\\\\"
  828. },
  829. rep;
  830. "function" != typeof JSON.stringify && (JSON.stringify = function (e, t, i) {
  831. var n;
  832. if (indent = gap = "", "number" == typeof i)
  833. for (n = 0; n < i; n += 1) indent += " ";
  834. else "string" == typeof i && (indent = i);
  835. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length)) throw new Error("JSON.stringify");
  836. return str("", {
  837. "": e
  838. })
  839. }), "function" != typeof JSON.parse && (JSON.parse = function (text, reviver) {
  840. function walk(e, t) {
  841. var i, n, r = e[t];
  842. if (r && "object" == typeof r)
  843. for (i in r) Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  844. return reviver.call(e, t, r)
  845. }
  846. var j;
  847. if (text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function (e) {
  848. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  849. })), /^[\],:{}\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, ""))) return j = eval("(" + text + ")"), "function" == typeof reviver ? walk({
  850. "": j
  851. }, "") : j;
  852. throw new SyntaxError("JSON.parse")
  853. })
  854. }(), Hh = Keen.utils, Ih = function (i) {
  855. function e(e) {
  856. for (u = 1; e = n.shift();) e()
  857. }
  858. var t, n = [],
  859. r = document,
  860. o = r.documentElement,
  861. a = o.doScroll,
  862. s = "DOMContentLoaded",
  863. l = "addEventListener",
  864. c = "onreadystatechange",
  865. h = "readyState",
  866. u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  867. return r[l] && r[l](s, t = function () {
  868. r.removeEventListener(s, t, !1), e()
  869. }, !1), a && r.attachEvent(c, t = function () {
  870. /^c/.test(r[h]) && (r.detachEvent(c, t), e())
  871. }), i = a ? function (t) {
  872. self != top ? u ? t() : n.push(t) : function () {
  873. try {
  874. o.doScroll("left")
  875. } catch (e) {
  876. return setTimeout(function () {
  877. i(t)
  878. }, 50)
  879. }
  880. t()
  881. }()
  882. } : function (e) {
  883. u ? e() : n.push(e)
  884. }
  885. }, "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  886. var loaded = window.Keen,
  887. cached = window._Keen || {},
  888. clients, ready;
  889. if (loaded && cached) {
  890. for (var instance in clients = cached.clients || {}, ready = cached.ready || [], clients)
  891. if (clients.hasOwnProperty(instance)) {
  892. var client = clients[instance];
  893. for (var method in Keen.prototype) Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  894. if (loaded.Query = Keen.Query ? Keen.Query : function () {}, loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}, client._config && (client.configure.call(client, client._config), delete client._config), client._setGlobalProperties) {
  895. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++) client.setGlobalProperties.apply(client, globals[i]);
  896. delete client._setGlobalProperties
  897. }
  898. if (client._addEvent) {
  899. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++) client.addEvent.apply(client, queue[i]);
  900. delete client._addEvent
  901. }
  902. var callback = client._on || [];
  903. if (client._on) {
  904. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i]);
  905. client.trigger("ready"), delete client._on
  906. }
  907. } for (var i = 0; i < ready.length; i++) {
  908. var callback = ready[i];
  909. Keen.on("ready", function () {
  910. callback()
  911. })
  912. }
  913. }
  914. return Keen.loaded && setTimeout(function () {
  915. Keen.utils.domready(function () {
  916. Keen.trigger("ready")
  917. })
  918. }, 0), Keen
  919. }),
  920. function () {
  921. var i = window.analytics = window.analytics || [];
  922. if (!i.initialize) {
  923. if (i.invoked) return window.console && console.error && console.error("Segment snippet included twice.");
  924. i.invoked = !0, i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"], i.factory = function (t) {
  925. return function () {
  926. var e = Array.prototype.slice.call(arguments);
  927. return e.unshift(t), i.push(e), i
  928. }
  929. };
  930. for (var e = 0; e < i.methods.length; e++) {
  931. var t = i.methods[e];
  932. i[t] = i.factory(t)
  933. }
  934. i.load = function (e) {
  935. var t = document.createElement("script");
  936. t.type = "text/javascript", t.async = !0, t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  937. var i = document.getElementsByTagName("script")[0];
  938. i.parentNode.insertBefore(t, i)
  939. }, i.SNIPPET_VERSION = "4.0.0"
  940. }
  941. }(),
  942. function (i, u) {
  943. "use strict";
  944. var d = "function",
  945. p = "undefined",
  946. f = "object",
  947. e = "major",
  948. t = "model",
  949. n = "name",
  950. r = "type",
  951. o = "vendor",
  952. a = "version",
  953. s = "architecture",
  954. l = "console",
  955. c = "mobile",
  956. h = "tablet",
  957. g = {
  958. has: function (e, t) {
  959. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  960. },
  961. lowerize: function (e) {
  962. return e.toLowerCase()
  963. }
  964. },
  965. m = {
  966. rgx: function () {
  967. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  968. var c = l[s],
  969. h = l[s + 1];
  970. if (typeof e == p)
  971. for (n in e = {}, h) typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  972. for (t = i = 0; t < c.length; t++)
  973. if (o = c[t].exec(this.getUA())) {
  974. for (n = 0; n < h.length; n++) a = o[++i], typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  975. break
  976. } if (o) break
  977. }
  978. return e
  979. },
  980. str: function (e, t) {
  981. for (var i in t)
  982. if (typeof t[i] == f && 0 < t[i].length) {
  983. for (var n = 0; n < t[i].length; n++)
  984. if (g.has(t[i][n], e)) return "?" === i ? u : i
  985. } else if (g.has(t[i], e)) return "?" === i ? u : i;
  986. return e
  987. }
  988. },
  989. v = {
  990. browser: {
  991. oldsafari: {
  992. major: {
  993. 1: ["/8", "/1", "/3"],
  994. 2: "/4",
  995. "?": "/"
  996. },
  997. version: {
  998. "1.0": "/8",
  999. 1.2: "/1",
  1000. 1.3: "/3",
  1001. "2.0": "/412",
  1002. "2.0.2": "/416",
  1003. "2.0.3": "/417",
  1004. "2.0.4": "/419",
  1005. "?": "/"
  1006. }
  1007. }
  1008. },
  1009. device: {
  1010. sprint: {
  1011. model: {
  1012. "Evo Shift 4G": "7373KT"
  1013. },
  1014. vendor: {
  1015. HTC: "APA",
  1016. Sprint: "Sprint"
  1017. }
  1018. }
  1019. },
  1020. os: {
  1021. windows: {
  1022. version: {
  1023. ME: "4.90",
  1024. "NT 3.11": "NT3.51",
  1025. "NT 4.0": "NT4.0",
  1026. 2e3: "NT 5.0",
  1027. XP: ["NT 5.1", "NT 5.2"],
  1028. Vista: "NT 6.0",
  1029. 7: "NT 6.1",
  1030. 8: "NT 6.2",
  1031. 8.1: "NT 6.3",
  1032. RT: "ARM"
  1033. }
  1034. }
  1035. }
  1036. },
  1037. y = {
  1038. browser: [
  1039. [/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i],
  1040. [n, a, e],
  1041. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1042. [
  1043. [n, "Opera"], a, e
  1044. ],
  1045. [/(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],
  1046. [n, a, e],
  1047. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1048. [
  1049. [n, "IE"], a, e
  1050. ],
  1051. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1052. [
  1053. [n, "Yandex"], a, e
  1054. ],
  1055. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1056. [
  1057. [n, /_/g, " "], a, e
  1058. ],
  1059. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1060. [n, a, e],
  1061. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1062. [
  1063. [n, "Dolphin"], a, e
  1064. ],
  1065. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1066. [
  1067. [n, "Chrome"], a, e
  1068. ],
  1069. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1070. [a, e, [n, "Mobile Safari"]],
  1071. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1072. [a, e, n],
  1073. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1074. [n, [e, m.str, v.browser.oldsafari.major],
  1075. [a, m.str, v.browser.oldsafari.version]
  1076. ],
  1077. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1078. [n, a, e],
  1079. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1080. [
  1081. [n, "Netscape"], a, e
  1082. ],
  1083. [/(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],
  1084. [n, a, e],
  1085. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1086. [n, a, e],
  1087. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1088. [n, a],
  1089. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1090. [n, a, e],
  1091. [/(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],
  1092. [n, a, e],
  1093. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1094. [n, a, e],
  1095. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1096. [
  1097. [n, "Flip Player"], a, e
  1098. ],
  1099. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1100. [n],
  1101. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1102. [n, a, e],
  1103. [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i],
  1104. [n, a, e],
  1105. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1106. [
  1107. [n, /_/g, " "], a, e
  1108. ],
  1109. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1110. [n, a],
  1111. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1112. [n, a, e],
  1113. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1114. [n],
  1115. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1116. [n, a, e],
  1117. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1118. [n, a, e],
  1119. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1120. [n, a, e],
  1121. [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i],
  1122. [n, a, e],
  1123. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1124. [n],
  1125. [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i],
  1126. [n, a, e],
  1127. [/(smp)((\d+)[\d\.]+)/i],
  1128. [n, a, e],
  1129. [/(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],
  1130. [n, a, e],
  1131. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1132. [
  1133. [n, /-/g, " "], a, e
  1134. ],
  1135. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1136. [a, e, [n, "Windows"]],
  1137. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1138. [n, a, e],
  1139. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1140. [
  1141. [n, "rad.io"], a, e
  1142. ]
  1143. ],
  1144. cpu: [
  1145. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1146. [
  1147. [s, "amd64"]
  1148. ],
  1149. [/(ia32(?=;))/i],
  1150. [
  1151. [s, g.lowerize]
  1152. ],
  1153. [/((?:i[346]|x)86)[;\)]/i],
  1154. [
  1155. [s, "ia32"]
  1156. ],
  1157. [/windows\s(ce|mobile);\sppc;/i],
  1158. [
  1159. [s, "arm"]
  1160. ],
  1161. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1162. [
  1163. [s, /ower/, "", g.lowerize]
  1164. ],
  1165. [/(sun4\w)[;\)]/i],
  1166. [
  1167. [s, "sparc"]
  1168. ],
  1169. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1170. [s, g.lowerize]
  1171. ],
  1172. device: [
  1173. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1174. [t, o, [r, h]],
  1175. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1176. [t, [o, "Apple"],
  1177. [r, h]
  1178. ],
  1179. [/(apple\s{0,1}tv)/i],
  1180. [
  1181. [t, "Apple TV"],
  1182. [o, "Apple"]
  1183. ],
  1184. [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i],
  1185. [o, t, [r, h]],
  1186. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1187. [t, o, [r, c]],
  1188. [/\((ip[honed|\s\w*]+);/i],
  1189. [t, [o, "Apple"],
  1190. [r, c]
  1191. ],
  1192. [/(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],
  1193. [o, t, [r, c]],
  1194. [/\((bb10);\s(\w+)/i],
  1195. [
  1196. [o, "BlackBerry"], t, [r, c]
  1197. ],
  1198. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1199. [
  1200. [o, "Asus"], t, [r, h]
  1201. ],
  1202. [/(sony)\s(tablet\s[ps])/i],
  1203. [o, t, [r, h]],
  1204. [/(nintendo)\s([wids3u]+)/i],
  1205. [o, t, [r, l]],
  1206. [/((playstation)\s[3portablevi]+)/i],
  1207. [
  1208. [o, "Sony"], t, [r, l]
  1209. ],
  1210. [/(sprint\s(\w+))/i],
  1211. [
  1212. [o, m.str, v.device.sprint.vendor],
  1213. [t, m.str, v.device.sprint.model],
  1214. [r, c]
  1215. ],
  1216. [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],
  1217. [o, [t, /_/g, " "],
  1218. [r, c]
  1219. ],
  1220. [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i],
  1221. [
  1222. [o, "Motorola"], t, [r, c]
  1223. ],
  1224. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1225. [
  1226. [o, "Motorola"], t, [r, h]
  1227. ],
  1228. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1229. [
  1230. [o, "Samsung"], t, [r, h]
  1231. ],
  1232. [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i],
  1233. [
  1234. [o, "Samsung"], t, [r, c]
  1235. ],
  1236. [/(sie)-(\w+)*/i],
  1237. [
  1238. [o, "Siemens"], t, [r, c]
  1239. ],
  1240. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1241. [
  1242. [o, "Nokia"], t, [r, c]
  1243. ],
  1244. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1245. [
  1246. [o, "Acer"], t, [r, h]
  1247. ],
  1248. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1249. [
  1250. [o, "LG"], t, [r, h]
  1251. ],
  1252. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1253. [
  1254. [o, "LG"], t, [r, c]
  1255. ],
  1256. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1257. [
  1258. [o, "Lenovo"], t, [r, h]
  1259. ],
  1260. [/(lg) netcast\.tv/i],
  1261. [o, [r, "smarttv"]],
  1262. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1263. [r, o, t]
  1264. ],
  1265. engine: [
  1266. [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i],
  1267. [n, a],
  1268. [/rv\:([\w\.]+).*(gecko)/i],
  1269. [a, n]
  1270. ],
  1271. os: [
  1272. [/microsoft\s(windows)\s(vista|xp)/i],
  1273. [n, a],
  1274. [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],
  1275. [n, [a, m.str, v.os.windows.version]],
  1276. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1277. [
  1278. [n, "Windows"],
  1279. [a, m.str, v.os.windows.version]
  1280. ],
  1281. [/\((bb)(10);/i],
  1282. [
  1283. [n, "BlackBerry"], a
  1284. ],
  1285. [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],
  1286. [n, a],
  1287. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1288. [
  1289. [n, "Symbian"], a
  1290. ],
  1291. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1292. [
  1293. [n, "Firefox OS"], a
  1294. ],
  1295. [/(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],
  1296. [n, a],
  1297. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1298. [
  1299. [n, "Chromium OS"], a
  1300. ],
  1301. [/(sunos)\s?([\w\.]+\d)*/i],
  1302. [
  1303. [n, "Solaris"], a
  1304. ],
  1305. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1306. [n, a],
  1307. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1308. [
  1309. [n, "iOS"],
  1310. [a, /_/g, "."]
  1311. ],
  1312. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1313. [n, [a, /_/g, "."]],
  1314. [/(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],
  1315. [n, a]
  1316. ]
  1317. },
  1318. A = function (e) {
  1319. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1320. return this instanceof A ? (this.getBrowser = function () {
  1321. return m.rgx.apply(this, y.browser)
  1322. }, this.getCPU = function () {
  1323. return m.rgx.apply(this, y.cpu)
  1324. }, this.getDevice = function () {
  1325. return m.rgx.apply(this, y.device)
  1326. }, this.getEngine = function () {
  1327. return m.rgx.apply(this, y.engine)
  1328. }, this.getOS = function () {
  1329. return m.rgx.apply(this, y.os)
  1330. }, this.getResult = function () {
  1331. return {
  1332. ua: this.getUA(),
  1333. browser: this.getBrowser(),
  1334. engine: this.getEngine(),
  1335. os: this.getOS(),
  1336. device: this.getDevice(),
  1337. cpu: this.getCPU()
  1338. }
  1339. }, this.getUA = function () {
  1340. return t
  1341. }, this.setUA = function (e) {
  1342. return t = e, this
  1343. }, void this.setUA(t)) : new A(e).getResult()
  1344. };
  1345. if (typeof exports != p) typeof module != p && module.exports && (exports = module.exports = A), exports.UAParser = A;
  1346. else if (i.UAParser = A, typeof define == d && define.amd && define(function () {
  1347. return A
  1348. }), typeof i.jQuery != p) {
  1349. var C = i.jQuery,
  1350. I = new A;
  1351. C.ua = I.getResult(), C.ua.get = function () {
  1352. return I.getUA()
  1353. }, C.ua.set = function (e) {
  1354. I.setUA(e);
  1355. var t = I.getResult();
  1356. for (var i in t) C.ua[i] = t[i]
  1357. }
  1358. }
  1359. }(this), window.Modernizr = function (e, t) {
  1360. function i(e, t) {
  1361. return typeof e === t
  1362. }
  1363. var n, r, o, a = {},
  1364. s = t.documentElement,
  1365. l = t.createElement("modernizr"),
  1366. c = l.style,
  1367. h = {},
  1368. u = [],
  1369. d = u.slice,
  1370. p = {}.hasOwnProperty;
  1371. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function (e, t) {
  1372. return t in e && i(e.constructor.prototype[t], "undefined")
  1373. } : function (e, t) {
  1374. return p.call(e, t)
  1375. }, Function.prototype.bind || (Function.prototype.bind = function (n) {
  1376. var r = this;
  1377. if ("function" != typeof r) throw new TypeError;
  1378. var o = d.call(arguments, 1),
  1379. a = function () {
  1380. if (this instanceof a) {
  1381. function e() {}
  1382. e.prototype = r.prototype;
  1383. var t = new e,
  1384. i = r.apply(t, o.concat(d.call(arguments)));
  1385. return Object(i) === i ? i : t
  1386. }
  1387. return r.apply(n, o.concat(d.call(arguments)))
  1388. };
  1389. return a
  1390. }), h.webgl = function () {
  1391. return !!e.WebGLRenderingContext
  1392. }, h) r(h, f) && (n = f.toLowerCase(), a[n] = h[f](), u.push((a[n] ? "" : "no-") + n));
  1393. return a.addTest = function (e, t) {
  1394. if ("object" == typeof e)
  1395. for (var i in e) r(e, i) && a.addTest(i, e[i]);
  1396. else {
  1397. if (e = e.toLowerCase(), void 0 !== a[e]) return a;
  1398. t = "function" == typeof t ? t() : t, "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e), a[e] = t
  1399. }
  1400. return a
  1401. }, o = "", c.cssText = o, l = null, a._version = "2.8.2", a
  1402. }(this, this.document),
  1403. function (xe, e, Se) {
  1404. "use strict";
  1405. function Me(s, e, n) {
  1406. function a(e) {
  1407. var t = Q.length;
  1408. if (G.old = xe.extend({}, G), H = V ? 0 : k[F.horizontal ? "width" : "height"](), Y = W[F.horizontal ? "width" : "height"](), z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](), Q.length = 0, G.start = 0, G.end = nt(z - H, 0), le) {
  1409. $.length, J = U.children(F.itemSelector), $.length = 0;
  1410. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"),
  1411. d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"),
  1412. i = "border-box" === xe(J).css("boxSizing"),
  1413. p = "none" !== J.css("float"),
  1414. f = 0,
  1415. g = J.length - 1;
  1416. z = 0, J.each(function (e, t) {
  1417. var i = xe(t),
  1418. n = t.getBoundingClientRect(),
  1419. r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top),
  1420. o = Ne(i, F.horizontal ? "marginLeft" : "marginTop"),
  1421. a = Ne(i, F.horizontal ? "marginRight" : "marginBottom"),
  1422. s = r + o + a,
  1423. l = !o || !a,
  1424. c = {};
  1425. c.el = t, c.size = l ? r : s, c.half = c.size / 2, c.start = z + (l ? o : 0), c.center = c.start - it(H / 2 - c.size / 2), c.end = c.start - H + c.size, e || (z += u), z += s, F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)), e === g && (c.end += d, z += d, f = l ? a : 0), $.push(c), h = c
  1426. }), U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px", z -= f, $.length ? (G.start = $[0][ae ? "center" : "start"], G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1427. }
  1428. if (G.center = it(G.end / 2 + G.start / 2), v(), j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y), j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](), X.end = Y - q, _e || c()), !V && 0 < H) {
  1429. var n = G.start,
  1430. r = "";
  1431. if (le) xe.each($, function (e, t) {
  1432. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start, Q.push(n), (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1433. });
  1434. else
  1435. for (; n - H < G.end;) Q.push(n), n += H;
  1436. if (Z[0] && t !== Q.length) {
  1437. for (var o = 0; o < Q.length; o++) r += F.pageBuilder.call(B, o);
  1438. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1439. }
  1440. }
  1441. if (ee.slideeSize = z, ee.frameSize = H, ee.sbSize = Y, ee.handleSize = q, le) {
  1442. e && null != F.startAt && (m(F.startAt), B[se ? "toCenter" : "toStart"](F.startAt));
  1443. var a = $[ee.activeItem];
  1444. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1445. } else e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1446. L("load")
  1447. }
  1448. function l(e, t, i) {
  1449. if (le && Ie.released && !i) {
  1450. var n = d(e),
  1451. r = e > G.start && e < G.end;
  1452. se ? (r && (e = $[n.centerItem].center), ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1453. }
  1454. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end), Ae.start = +new Date, Ae.time = 0, Ae.from = G.cur, Ae.to = e, Ae.delta = e - G.cur, Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee, Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed), Ie.tweese = 0, e !== G.dest && (G.dest = e, L("change"), _e || o()), g(), v(), p(), K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage, K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass), L("activePage", ye.page))
  1455. }
  1456. function o() {
  1457. if (B.initialized) {
  1458. if (!_e) return _e = Ge(o), void(Ie.released && L("moveStart"));
  1459. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur, $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed), G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)), Ae.to === G.cur ? (G.cur = Ae.to, Ie.tweese = _e = 0) : _e = Ge(o), L("move"), V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"), !_e && Ie.released && L("moveEnd"), c()
  1460. }
  1461. }
  1462. function c() {
  1463. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end, X.cur = Fe(it(X.cur), X.start, X.end), ye.hPos !== X.cur && (ye.hPos = X.cur, Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1464. }
  1465. function t() {
  1466. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(), Te = Ie.init ? Ge(t) : 0, Ce.now = +new Date, Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed, l(Ie.init ? Ce.pos : it(Ce.pos)), Ie.init || G.cur !== G.dest || L("moveEnd"), Ce.lastTime = Ce.now
  1467. }
  1468. function i(e, t, i) {
  1469. if ("boolean" === Re(t) && (i = t, t = Se), t === Se) l(G[e], i);
  1470. else {
  1471. if (se && "center" !== e) return;
  1472. var n = B.getPos(t);
  1473. n && l(n[e], i, !se)
  1474. }
  1475. }
  1476. function h(e) {
  1477. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1478. }
  1479. function u(e) {
  1480. return h(De(e) && e < 0 ? e + $.length : e)
  1481. }
  1482. function m(e, t) {
  1483. var i = h(e);
  1484. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass), J.eq(i).addClass(F.activeClass), ye.active = ee.activeItem = i, p(), L("active", i)), i)
  1485. }
  1486. function d(e) {
  1487. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1488. var t = {},
  1489. i = ae ? 0 : H / 2;
  1490. if (!V)
  1491. for (var n = 0, r = Q.length; n < r; n++) {
  1492. if (e >= G.end || n === Q.length - 1) {
  1493. t.activePage = Q.length - 1;
  1494. break
  1495. }
  1496. if (e <= Q[n] + i) {
  1497. t.activePage = n;
  1498. break
  1499. }
  1500. }
  1501. if (le) {
  1502. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1503. if (!1 === o && e <= $[l].start + $[l].half && (o = l), !1 === s && e <= $[l].center + $[l].half && (s = l), l === c - 1 || e <= $[l].end + $[l].half) {
  1504. a = l;
  1505. break
  1506. } t.firstItem = De(o) ? o : 0, t.centerItem = De(s) ? s : t.firstItem, t.lastItem = De(a) ? a : t.centerItem
  1507. }
  1508. return t
  1509. }
  1510. function v(e) {
  1511. xe.extend(ee, d(e))
  1512. }
  1513. function p() {
  1514. var e = G.dest <= G.start,
  1515. t = G.dest >= G.end,
  1516. i = (e ? 1 : 0) | (t ? 2 : 0);
  1517. if (ye.slideePosState !== i && (ye.slideePosState = i, ge.is("button,input") && ge.prop("disabled", e), me.is("button,input") && me.prop("disabled", t), ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass), me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)), ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i, de.is("button,input") && de.prop("disabled", e), ue.is("button,input") && ue.prop("disabled", t)), le && null != ee.activeItem) {
  1518. var n = 0 === ee.activeItem,
  1519. r = ee.activeItem >= $.length - 1,
  1520. o = (n ? 1 : 0) | (r ? 2 : 0);
  1521. ye.itemsButtonState !== o && (ye.itemsButtonState = o, pe.is("button,input") && pe.prop("disabled", n), fe.is("button,input") && fe.prop("disabled", r), pe[n ? "addClass" : "removeClass"](F.disabledClass), fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1522. }
  1523. }
  1524. function r(e, t, i) {
  1525. if (e = u(e), t = u(t), -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1526. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1527. var n = e < t ? e : i ? t : t - 1,
  1528. r = t < e ? e : i ? t + 1 : t,
  1529. o = t < e;
  1530. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)), a()
  1531. }
  1532. }
  1533. function f(e, t) {
  1534. for (var i = 0, n = ve[e].length; i < n; i++)
  1535. if (ve[e][i] === t) return i;
  1536. return -1
  1537. }
  1538. function g() {
  1539. Ie.released && !B.isPaused && B.resume()
  1540. }
  1541. function y(e) {
  1542. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1543. }
  1544. function A() {
  1545. Ie.history[0] = Ie.history[1], Ie.history[1] = Ie.history[2], Ie.history[2] = Ie.history[3], Ie.history[3] = Ie.delta
  1546. }
  1547. function C(e) {
  1548. Ie.released = 0, Ie.source = e, Ie.slidee = "slidee" === e
  1549. }
  1550. function I(e) {
  1551. var t = "touchstart" === e.type,
  1552. i = e.data.source,
  1553. n = "slidee" === i;
  1554. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e), C(i), Ie.init = 0, Ie.$source = xe(e.target), Ie.touch = t, Ie.pointer = t ? e.originalEvent.touches[0] : e, Ie.initX = Ie.pointer.pageX, Ie.initY = Ie.pointer.pageY, Ie.initPos = n ? G.cur : X.cur, Ie.start = +new Date, Ie.time = 0, Ie.path = 0, Ie.delta = 0, Ie.locked = 0, Ie.history = [0, 0, 0, 0], Ie.pathToLock = n ? t ? 30 : 10 : 0, We.on(t ? qe : Ye, E), B.pause(1), (n ? U : j).addClass(F.draggedClass), L("moveStart"), n && (be = setInterval(A, 10)))
  1555. }
  1556. function E(e) {
  1557. if (Ie.released = "mouseup" === e.type || "touchend" === e.type, Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e, Ie.pathX = Ie.pointer.pageX - Ie.initX, Ie.pathY = Ie.pointer.pageY - Ie.initY, Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)), Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY, Ie.released || !(Ie.path < 1)) {
  1558. if (!Ie.init) {
  1559. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY))) return _();
  1560. Ie.init = 1
  1561. }
  1562. Pe(e), !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1, Ie.$source.on(Ze, Oe)), Ie.released && (_(), F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300, Ie.delta += Ie.swing, Ie.tweese = 10 < $e(Ie.swing))), l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1563. }
  1564. }
  1565. function _() {
  1566. clearInterval(be), Ie.released = !0, We.off(Ie.touch ? qe : Ye, E), (Ie.slidee ? U : j).removeClass(F.draggedClass), setTimeout(function () {
  1567. Ie.$source.off(Ze, Oe)
  1568. }), G.cur === G.dest && Ie.init && L("moveEnd"), B.resume(1), Ie.init = 0
  1569. }
  1570. function b(e) {
  1571. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1572. }
  1573. function w() {
  1574. B.stop(), We.off("mouseup", w)
  1575. }
  1576. function T(e) {
  1577. switch (Pe(e), this) {
  1578. case ue[0]:
  1579. case de[0]:
  1580. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy), We.on("mouseup", w);
  1581. break;
  1582. case pe[0]:
  1583. B.prev();
  1584. break;
  1585. case fe[0]:
  1586. B.next();
  1587. break;
  1588. case ge[0]:
  1589. B.prevPage();
  1590. break;
  1591. case me[0]:
  1592. B.nextPage()
  1593. }
  1594. }
  1595. function x(e) {
  1596. e.originalEvent[He] = B;
  1597. var t = +new Date;
  1598. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window) ot = t;
  1599. else if (F.scrollBy && G.start !== G.end) {
  1600. var i = function (e) {
  1601. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta, Ee.curDelta /= 1 === e.deltaMode ? 3 : 100, le ? (Ue = +new Date, Ee.last < Ue - Ee.resetTime && (Ee.delta = 0), Ee.last = Ue, Ee.delta += Ee.curDelta, $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1), Ee.delta %= 1), Ee.finalDelta) : Ee.curDelta
  1602. }(e.originalEvent);
  1603. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1), B.slideBy(F.scrollBy * i)
  1604. }
  1605. }
  1606. function S(e) {
  1607. F.clickBar && e.target === W[0] && (Pe(e), l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1608. }
  1609. function M(e) {
  1610. if (F.keyboardNavBy) switch (e.which) {
  1611. case F.horizontal ? 37:
  1612. 38: Pe(e), B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1613. break;
  1614. case F.horizontal ? 39:
  1615. 40: Pe(e), B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1616. }
  1617. }
  1618. function R(e) {
  1619. return b(this) ? void(e.originalEvent[He + "ignore"] = !0) : void(this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1620. }
  1621. function P() {
  1622. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1623. }
  1624. function O(e) {
  1625. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1626. }
  1627. function L(e, t) {
  1628. if (ve[e]) {
  1629. for (N = ve[e].length, Je.length = 0, D = 0; D < N; D++) Je.push(ve[e][D]);
  1630. for (D = 0; D < N; D++) Je[D].call(B, e, t)
  1631. }
  1632. }
  1633. var D, N, F = xe.extend({}, Me.defaults, e),
  1634. B = this,
  1635. V = De(s),
  1636. k = xe(s),
  1637. U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0),
  1638. H = 0,
  1639. z = 0,
  1640. G = {
  1641. start: 0,
  1642. center: 0,
  1643. end: 0,
  1644. cur: 0,
  1645. dest: 0
  1646. },
  1647. W = xe(F.scrollBar).eq(0),
  1648. j = W.children().eq(0),
  1649. Y = 0,
  1650. q = 0,
  1651. X = {
  1652. start: 0,
  1653. end: 0,
  1654. cur: 0
  1655. },
  1656. Z = xe(F.pagesBar),
  1657. K = 0,
  1658. Q = [],
  1659. J = 0,
  1660. $ = [],
  1661. ee = {
  1662. firstItem: 0,
  1663. lastItem: 0,
  1664. centerItem: 0,
  1665. activeItem: null,
  1666. activePage: 0
  1667. },
  1668. te = new Be(k[0]),
  1669. ie = new Be(U[0]),
  1670. ne = new Be(W[0]),
  1671. re = new Be(j[0]),
  1672. oe = "basic" === F.itemNav,
  1673. ae = "forceCentered" === F.itemNav,
  1674. se = "centered" === F.itemNav || ae,
  1675. le = !V && (oe || se || ae),
  1676. ce = F.scrollSource ? xe(F.scrollSource) : k,
  1677. he = F.dragSource ? xe(F.dragSource) : k,
  1678. ue = xe(F.forward),
  1679. de = xe(F.backward),
  1680. pe = xe(F.prev),
  1681. fe = xe(F.next),
  1682. ge = xe(F.prevPage),
  1683. me = xe(F.nextPage),
  1684. ve = {},
  1685. ye = {},
  1686. Ae = {},
  1687. Ce = {},
  1688. Ie = {
  1689. released: 1
  1690. },
  1691. Ee = {
  1692. last: 0,
  1693. delta: 0,
  1694. resetTime: 200
  1695. },
  1696. _e = 0,
  1697. be = 0,
  1698. we = 0,
  1699. Te = 0;
  1700. V || (s = k[0]), B.initialized = 0, B.frame = s, B.slidee = U[0], B.pos = G, B.rel = ee, B.items = $, B.pages = Q, B.isPaused = 0, B.options = F, B.dragging = Ie, B.reload = function () {
  1701. a()
  1702. }, B.getPos = function (e) {
  1703. if (le) {
  1704. var t = h(e);
  1705. return -1 !== t && $[t]
  1706. }
  1707. var i = U.find(e).eq(0);
  1708. if (i[0]) {
  1709. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top,
  1710. r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1711. return {
  1712. start: n,
  1713. center: n - H / 2 + r / 2,
  1714. end: n - H + r,
  1715. size: r
  1716. }
  1717. }
  1718. return !1
  1719. }, B.moveBy = function (e) {
  1720. Ce.speed = e, !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date, Ce.startPos = G.cur, C("button"), Ie.init = 1, L("moveStart"), ze(Te), t())
  1721. }, B.stop = function () {
  1722. "button" === Ie.source && (Ie.init = 0, Ie.released = 1)
  1723. }, B.prev = function () {
  1724. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  1725. }, B.next = function () {
  1726. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  1727. }, B.prevPage = function () {
  1728. B.activatePage(ee.activePage - 1)
  1729. }, B.nextPage = function () {
  1730. B.activatePage(ee.activePage + 1)
  1731. }, B.slideBy = function (e, t) {
  1732. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  1733. }, B.slideTo = function (e, t) {
  1734. l(e, t)
  1735. }, B.toStart = function (e, t) {
  1736. i("start", e, t)
  1737. }, B.toEnd = function (e, t) {
  1738. i("end", e, t)
  1739. }, B.toCenter = function (e, t) {
  1740. i("center", e, t)
  1741. }, B.getIndex = h, B.activate = function (e, t) {
  1742. var i = m(e);
  1743. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  1744. }, B.activatePage = function (e, t) {
  1745. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  1746. }, B.resume = function (e) {
  1747. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0, we ? we = clearTimeout(we) : L("resume"), we = setTimeout(function () {
  1748. switch (L("cycle"), F.cycleBy) {
  1749. case "items":
  1750. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  1751. break;
  1752. case "pages":
  1753. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  1754. }
  1755. }, F.cycleInterval))
  1756. }, B.pause = function (e) {
  1757. e < B.isPaused || (B.isPaused = e || 100, we && (we = clearTimeout(we), L("pause")))
  1758. }, B.toggle = function () {
  1759. B[we ? "pause" : "resume"]()
  1760. }, B.set = function (e, t) {
  1761. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  1762. }, B.add = function (e, t) {
  1763. var i = xe(e);
  1764. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el), null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i), a()
  1765. }, B.remove = function (e) {
  1766. if (le) {
  1767. var t = u(e);
  1768. if (-1 < t) {
  1769. J.eq(t).remove();
  1770. var i = t === ee.activeItem;
  1771. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem), a(), i && (ye.active = null, B.activate(ee.activeItem))
  1772. }
  1773. } else xe(e).remove(), a()
  1774. }, B.moveAfter = function (e, t) {
  1775. r(e, t, 1)
  1776. }, B.moveBefore = function (e, t) {
  1777. r(e, t)
  1778. }, B.on = function (e, t) {
  1779. if ("object" === Re(e))
  1780. for (var i in e) e.hasOwnProperty(i) && B.on(i, e[i]);
  1781. else if ("function" === Re(t))
  1782. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++) ve[n[r]] = ve[n[r]] || [], -1 === f(n[r], t) && ve[n[r]].push(t);
  1783. else if ("array" === Re(t))
  1784. for (var a = 0, s = t.length; a < s; a++) B.on(e, t[a])
  1785. }, B.one = function (t, i) {
  1786. B.on(t, function e() {
  1787. i.apply(B, arguments), B.off(t, e)
  1788. })
  1789. }, B.off = function (e, t) {
  1790. if (t instanceof Array)
  1791. for (var i = 0, n = t.length; i < n; i++) B.off(e, t[i]);
  1792. else
  1793. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  1794. if (ve[r[o]] = ve[r[o]] || [], null == t) ve[r[o]].length = 0;
  1795. else {
  1796. var s = f(r[o], t); - 1 !== s && ve[r[o]].splice(s, 1)
  1797. }
  1798. }, B.destroy = function () {
  1799. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He), We.off("keydown", M), pe.add(fe).add(ge).add(me).removeClass(F.disabledClass), J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass), Z.empty(), V || (k.off("." + He), te.restore(), ie.restore(), ne.restore(), re.restore(), xe.removeData(s, He)), $.length = Q.length = 0, ye = {}, B.initialized = 0, B
  1800. }, B.init = function () {
  1801. if (!B.initialized) {
  1802. B.on(n);
  1803. var e = ["overflow", "position"],
  1804. t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  1805. te.save.apply(te, e), ne.save.apply(ne, e), ie.save.apply(ie, t), re.save.apply(re, t);
  1806. var i = j;
  1807. return V || (i = i.add(U), k.css("overflow", "hidden"), Ve || "static" !== k.css("position") || k.css("position", "relative")), Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"), i.css({
  1808. position: "absolute"
  1809. })), F.forward && ue.on(Ke, T), F.backward && de.on(Ke, T), F.prev && pe.on(Ze, T), F.next && fe.on(Ze, T), F.prevPage && ge.on(Ze, T), F.nextPage && me.on(Ze, T), ce.on(Xe, x), W[0] && W.on(Ze, S), le && F.activateOn && k.on(F.activateOn + "." + He, "*", R), Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P), he.on(je, {
  1810. source: "slidee"
  1811. }, I), j && j.on(je, {
  1812. source: "handle"
  1813. }, I), We.on("keydown", M), V || (k.on("mouseenter." + He + " mouseleave." + He, O), k.on("scroll." + He, Le)), B.initialized = 1, a(!0), F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](), B
  1814. }
  1815. }
  1816. }
  1817. function Re(e) {
  1818. 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
  1819. }
  1820. function Pe(e, t) {
  1821. e.preventDefault(), t && e.stopPropagation()
  1822. }
  1823. function Oe(e) {
  1824. Pe(e, 1), xe(this).off(e.type, Oe)
  1825. }
  1826. function Le() {
  1827. this.scrollLeft = 0, this.scrollTop = 0
  1828. }
  1829. function De(e) {
  1830. return !isNaN(parseFloat(e)) && isFinite(e)
  1831. }
  1832. function Ne(e, t) {
  1833. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  1834. }
  1835. function Fe(e, t, i) {
  1836. return e < t ? t : i < e ? i : e
  1837. }
  1838. function Be(t) {
  1839. var i = {
  1840. style: {},
  1841. save: function () {
  1842. if (t && t.nodeType) {
  1843. for (var e = 0; e < arguments.length; e++) i.style[arguments[e]] = t.style[arguments[e]];
  1844. return i
  1845. }
  1846. },
  1847. restore: function () {
  1848. if (t && t.nodeType) {
  1849. for (var e in i.style) i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  1850. return i
  1851. }
  1852. }
  1853. };
  1854. return i
  1855. }
  1856. var Ve, ke, Ue, r, o, He = "sly",
  1857. ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame,
  1858. Ge = e.requestAnimationFrame,
  1859. We = xe(document),
  1860. je = "touchstart." + He + " mousedown." + He,
  1861. Ye = "mousemove." + He + " mouseup." + He,
  1862. qe = "touchmove." + He + " touchend." + He,
  1863. Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He,
  1864. Ze = "click." + He,
  1865. Ke = "mousedown." + He,
  1866. Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"],
  1867. Je = [],
  1868. $e = Math.abs,
  1869. et = Math.sqrt,
  1870. tt = Math.pow,
  1871. it = Math.round,
  1872. nt = Math.max,
  1873. rt = Math.min,
  1874. ot = 0;
  1875. function t(e) {
  1876. for (var t = 0, i = r.length; t < i; t++) {
  1877. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  1878. if (null != o.style[n]) return n
  1879. }
  1880. }
  1881. We.on(Xe, function (e) {
  1882. var t = e.originalEvent[He],
  1883. i = +new Date;
  1884. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  1885. }),
  1886. function (t) {
  1887. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function (e) {
  1888. var t = (new Date).getTime(),
  1889. i = Math.max(0, 16 - (t - r)),
  1890. n = setTimeout(e, i);
  1891. return r = t, n
  1892. };
  1893. var r = (new Date).getTime(),
  1894. i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  1895. ze = function (e) {
  1896. i.call(t, e)
  1897. }
  1898. }(window), r = ["", "webkit", "moz", "ms", "o"], o = document.createElement("div"), Ve = t("transform"), ke = t("perspective") ? "translateZ(0) " : "", e.Sly = Me, xe.fn.sly = function (n, r) {
  1899. var o, a;
  1900. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n, a = Array.prototype.slice.call(arguments, 1)), n = {}), this.each(function (e, t) {
  1901. var i = xe.data(t, He);
  1902. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t, n, r).init())
  1903. })
  1904. }, Me.defaults = {
  1905. slidee: null,
  1906. horizontal: !1,
  1907. itemNav: null,
  1908. itemSelector: null,
  1909. smart: !1,
  1910. activateOn: null,
  1911. activateMiddle: !1,
  1912. scrollSource: null,
  1913. scrollBy: 0,
  1914. scrollHijack: 300,
  1915. scrollTrap: !1,
  1916. dragSource: null,
  1917. mouseDragging: !1,
  1918. touchDragging: !1,
  1919. releaseSwing: !1,
  1920. swingSpeed: .2,
  1921. elasticBounds: !1,
  1922. interactive: null,
  1923. scrollBar: null,
  1924. dragHandle: !1,
  1925. dynamicHandle: !1,
  1926. minHandleSize: 50,
  1927. clickBar: !1,
  1928. syncSpeed: .5,
  1929. pagesBar: null,
  1930. activatePageOn: null,
  1931. pageBuilder: function (e) {
  1932. return "<li>" + (e + 1) + "</li>"
  1933. },
  1934. forward: null,
  1935. backward: null,
  1936. prev: null,
  1937. next: null,
  1938. prevPage: null,
  1939. nextPage: null,
  1940. cycleBy: null,
  1941. cycleInterval: 5e3,
  1942. pauseOnHover: !1,
  1943. startPaused: !1,
  1944. moveBy: 300,
  1945. speed: 0,
  1946. easing: "swing",
  1947. startAt: null,
  1948. keyboardNavBy: null,
  1949. draggedClass: "dragged",
  1950. activeClass: "active",
  1951. disabledClass: "disabled"
  1952. }
  1953. }(jQuery, window),
  1954. function o(a, s, l) {
  1955. function c(i, e) {
  1956. if (!s[i]) {
  1957. if (!a[i]) {
  1958. var t = "function" == typeof require && require;
  1959. if (!e && t) return t(i, !0);
  1960. if (h) return h(i, !0);
  1961. var n = new Error("Cannot find module '" + i + "'");
  1962. throw n.code = "MODULE_NOT_FOUND", n
  1963. }
  1964. var r = s[i] = {
  1965. exports: {}
  1966. };
  1967. a[i][0].call(r.exports, function (e) {
  1968. var t = a[i][1][e];
  1969. return c(t || e)
  1970. }, r, r.exports, o, a, s, l)
  1971. }
  1972. return s[i].exports
  1973. }
  1974. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++) c(l[e]);
  1975. return c
  1976. }({
  1977. 1: [function (p, f, e) {
  1978. (function (e) {
  1979. "use strict";
  1980. function t(e) {
  1981. this.player = null, this.director = null, this.modelManager = null, this.container = null, this.tagManager = null, this.fadeInSpeed = e, null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  1982. }
  1983. var r = p("three"),
  1984. i = p("./util/logger"),
  1985. n = (p("./util/common"), p("./enum/PlayerEvents")),
  1986. o = p("./enum/DirectorEvents"),
  1987. a = p("./settings"),
  1988. s = p("./enum/Viewmode"),
  1989. l = (p("./enum/WarpStyle"), p("./enum/BlackoutStyle"), p("./enum/ModelManagerEvents")),
  1990. c = p("./enum/tagEvents"),
  1991. h = p("./util/transitions"),
  1992. u = p("./util/lerp"),
  1993. d = new i(e);
  1994. window.THREE = r, t.prototype.init = function (e, t, i, n, r) {
  1995. (window.app = this).player = t, this.director = e, this.modelManager = i, this.tagManager = n, this.container = r, this.updateModel(), this.bindEvents()
  1996. }, t.prototype.bindEvents = function () {
  1997. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)), this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)), this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)), this.player.on(n.StartInside, this.handleStartInside.bind(this)), this.player.on(n.StartOutside, this.handleStartOutside.bind(this)), this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)), this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)), this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)), this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  1998. }, t.prototype.updateModel = function () {
  1999. this.model = this.modelManager.getActiveModel()
  2000. }, t.prototype.handleWarpStarted = function () {
  2001. this.hidePlayerReticule()
  2002. }, t.prototype.ontagActivated = function () {
  2003. this.hidePlayerReticule()
  2004. }, t.prototype.onNavigationTotag = function () {
  2005. this.hidePlayerReticule()
  2006. }, t.prototype.handlePlayerModeChanging = function (e, t, i) {
  2007. var n = this.modelManager.getActiveModel(),
  2008. r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2009. n.fadePanoMarkers(r), n.setMode(t)
  2010. }, t.prototype.handlePlayerModeChanged = function (e, t) {
  2011. var i = this.modelManager.getActiveModel(),
  2012. n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2013. i.setSide(n), i.setMode(t)
  2014. }, t.prototype.handleClosestPanoChanging = function (e, t, i) {
  2015. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i), t && !this.director.tourIsPlaying && t.hoverOn(i))
  2016. }, t.prototype.handleActionInterruption = function () {}, t.prototype.handleStartInside = function (e) {
  2017. var t = a[this.player.mode],
  2018. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2019. this.fadeIn(this.fadeInSpeed), this.model.alpha = 0, this.model.skybox.material.uniforms.opacity.value = 1, this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2020. var n = this.player.reticule;
  2021. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2022. }, t.prototype.handleStartOutside = function (e) {
  2023. this.fadeIn(e)
  2024. }, t.prototype.fadeIn = function (e) {
  2025. null != e || (e = 2e3, d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")), $(this.container).fadeIn(e)
  2026. }, t.prototype.hidePlayerReticule = function () {
  2027. this.player.reticule.hide()
  2028. }, f.exports = t
  2029. }).call(this, "/js/DisplayController.js")
  2030. }, {
  2031. "./enum/BlackoutStyle": 18,
  2032. "./enum/DirectorEvents": 23,
  2033. "./enum/tagEvents": 32,
  2034. "./enum/ModelManagerEvents": 33,
  2035. "./enum/PlayerEvents": 40,
  2036. "./enum/Viewmode": 51,
  2037. "./enum/WarpStyle": 52,
  2038. "./settings": 166,
  2039. "./util/common": 185,
  2040. "./util/lerp": 188,
  2041. "./util/logger": 189,
  2042. "./util/transitions": 195,
  2043. three: 217
  2044. }],
  2045. 2: [function (e, t, i) {
  2046. "use strict";
  2047. function n() {
  2048. this.baseStartTime = performance.timing.navigationStart, this.loadingStartTime = null, this.waitingStartTime = null, this.appReadyTime = null
  2049. }
  2050. n.prototype.setBaseStartTime = function (e) {
  2051. this.baseStartTime = e || Date.now()
  2052. }, n.prototype.setWaitingStartTime = function (e) {
  2053. this.waitingStartTime = e || Date.now()
  2054. }, n.prototype.setLoadingStartTime = function (e) {
  2055. this.loadingStartTime = e || Date.now()
  2056. }, n.prototype.setAppReadyTime = function (e) {
  2057. this.appReadyTime = e || Date.now()
  2058. }, n.prototype.calcFullLoadingTime = function () {
  2059. var e = this.appReadyTime - this.baseStartTime;
  2060. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e
  2061. }, t.exports = n
  2062. }, {}],
  2063. 3: [function (i, n, e) {
  2064. (function (e) {
  2065. "use strict";
  2066. function a() {
  2067. return 100 * Math.random()
  2068. }
  2069. var t = i("./util/logger"),
  2070. s = i("./util/browser"),
  2071. l = new t(e),
  2072. c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2073. initialized: !1,
  2074. init: function (e, t) {
  2075. if (t = t || {}, !this.initialized) {
  2076. for (var i in this.initialized = !0, s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)), s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)), e) {
  2077. var n = i.match("^sc_tilegen_([0-9]+)$");
  2078. n && (c.tilegen = a() < parseInt(n[1]));
  2079. var r = i.match("^sc_imgopt_([0-9]+)$");
  2080. r && (c.imgopt = a() < parseInt(r[1]))
  2081. }
  2082. for (var o in t) c[o] = t[o], l.debug("A/B override:", o, c[o])
  2083. }
  2084. },
  2085. changeIfTileGenerating: function (e) {
  2086. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&", e += ""), e
  2087. },
  2088. changeIfImageOptimzing: function (e) {
  2089. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&", e += ""), e
  2090. },
  2091. tilegen: !1,
  2092. imgopt: !1
  2093. };
  2094. n.exports = c
  2095. }).call(this, "/js/ab.js")
  2096. }, {
  2097. "./util/browser": 182,
  2098. "./util/logger": 189
  2099. }],
  2100. 4: [function (u, d, e) {
  2101. (function (e) {
  2102. "use strict";
  2103. function r(n, e, t, i) {
  2104. function r(e) {
  2105. a[e.sid] = !0;
  2106. var t = e.billboard.media && e.billboard.media.type,
  2107. i = {
  2108. tag_id: e.sid,
  2109. tags_visited: Object.keys(a).length,
  2110. tag_count: Object.keys(n.tags).length,
  2111. tag_view_count: ++d,
  2112. has_media: !!t
  2113. };
  2114. t && (i.media_type = t), g("tag_opened", i)
  2115. }
  2116. var o, a = {},
  2117. s = Date.now() - P,
  2118. l = null;
  2119. i && (l = Date.now() - window.navigationStart);
  2120. try {
  2121. o = n.data.player_options.highlight_reel && 1 < n.heroLocations.length
  2122. } catch (n) {
  2123. o = !1
  2124. }
  2125. var c, h = n.supportsVR;
  2126. h || (c = "VR disabled at the model/account level", y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))), g("model_loaded", {
  2127. duration: s,
  2128. duration_from_navigation_start: l,
  2129. has_hlr: o,
  2130. has_vr: h,
  2131. vr_reason: c
  2132. });
  2133. var u = 0;
  2134. n.panos.forEach(function (e) {
  2135. e.on("enter", function () {
  2136. f("pano_viewed", {
  2137. pano_id: e.id,
  2138. pano_view_count: ++u,
  2139. alignment_type: e.alignmentType,
  2140. interaction_source: R,
  2141. navigation_source: v
  2142. })
  2143. })
  2144. });
  2145. var d = 0;
  2146. for (var p in n.tags) n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2147. e.on("tour_auto", function (e) {
  2148. v = "tour_" + e
  2149. }), e.on("tour_manual", function (e) {
  2150. R = "gui-" + e, v = "tour_manual"
  2151. }), t.on(C.InteractionKey, function () {
  2152. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2153. }), t.on(C.InteractionDirect, function () {
  2154. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2155. }),
  2156. function (t) {
  2157. I.on(T.OPENED, function () {
  2158. f("showcase_share_intent", {
  2159. pano_id: t.currentPano && t.currentPano.id
  2160. })
  2161. }), I.on(T.LINK_CLICKED, function (e) {
  2162. f("showcase_share_action", {
  2163. channel: e.channel,
  2164. pano_id: t.currentPano && t.currentPano.id
  2165. })
  2166. }), E.on(x.ORIGIN_LINK_CLICKED, function () {
  2167. f("showcase_share_origin_link_clicked")
  2168. })
  2169. }(e),
  2170. function () {
  2171. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2172. gui_action: "click_vr_button"
  2173. })), _.on(S.LAUNCH, function (e) {
  2174. f("showcase_gui", {
  2175. gui_action: "launch_vr",
  2176. vr_platform: e.vr_platform,
  2177. vr_app: e.vr_app
  2178. })
  2179. }), _.on(S.PREV, f.bind(this, "showcase_gui", {
  2180. gui_action: "vr_modal_prev"
  2181. })), _.on(S.NEXT, function (e) {
  2182. f("showcase_gui", {
  2183. gui_action: e.nextAction
  2184. })
  2185. }), _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2186. gui_action: "vr_modal_close"
  2187. })), _.on(S.falseICECHOSEN, function (e) {
  2188. f("showcase_gui", {
  2189. gui_action: e.name + " "
  2190. })
  2191. }), _.on(S.STORE, function (e) {
  2192. f("showcase_gui", {
  2193. gui_action: "launch_store",
  2194. store: e
  2195. })
  2196. })
  2197. }()
  2198. }
  2199. function f(e, t) {
  2200. if (t = t || {}, i) try {
  2201. window.analytics.track(e, s.extendObject(t, c), {
  2202. context: {
  2203. app: {
  2204. name: "showcase",
  2205. version: "2.25.6-0-gd87e5b1"
  2206. },
  2207. screen: {
  2208. width: window.screen.width,
  2209. height: window.screen.height,
  2210. density: window.devicePixelRatio
  2211. }
  2212. }
  2213. })
  2214. } catch (t) {
  2215. console.warn("Failed to send data to segment for " + e)
  2216. }
  2217. }
  2218. function g(e, t) {
  2219. f(e, t = t || {})
  2220. }
  2221. function m(e, t) {
  2222. R = e === C.InteractionGui ? "gui-" + t : e, v = "self_guided"
  2223. }
  2224. var v, o, a = (u("three"), u("./util/ajax"), u("./ab")),
  2225. y = u("./util/browser"),
  2226. s = u("./util/common"),
  2227. t = u("./settings"),
  2228. A = (u("./localization/localize"), u("./enum/Viewmode")),
  2229. C = u("./enum/ControlEvents"),
  2230. I = u("./gui/sharing/modal"),
  2231. E = u("./gui/title/titleBar"),
  2232. _ = u("./gui/vr/vrModal"),
  2233. b = u("./enum/VRPlatforms"),
  2234. w = u("./enum/VROption"),
  2235. T = u("./gui/sharing/ShareEvents"),
  2236. x = u("./gui/title/TitleEvents"),
  2237. S = u("./gui/vr/vrEvent"),
  2238. M = u("./tag/Billboard/BillboardEvent"),
  2239. l = new(u("./util/logger"))(e),
  2240. R = (u("./enum/PlayerEvents"), "direct"),
  2241. i = null,
  2242. n = !1,
  2243. P = null,
  2244. c = null,
  2245. h = s.uuid4();
  2246. d.exports = {
  2247. report: function (e, t, i, n) {
  2248. ! function (e, t) {
  2249. if (o) try {
  2250. o.addEvent(e, s.extendObject({
  2251. host: window.location.host,
  2252. keen: {
  2253. addons: [{
  2254. name: "keen:ua_parser",
  2255. input: {
  2256. ua_string: "user_agent"
  2257. },
  2258. output: "parsed_user_agent"
  2259. }]
  2260. },
  2261. user_agent: "${keen.user_agent}",
  2262. referrer: {
  2263. url: s.normalizeUrl(document.referrer),
  2264. domain: s.domainFromUrl(document.referrer),
  2265. url_original: document.referrer
  2266. },
  2267. embedded: y.inIframe(),
  2268. is_mobile: y.isMobile(),
  2269. version: "2.25.6-0-gd87e5b1"
  2270. }, t))
  2271. } catch (e) {
  2272. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2273. }
  2274. }("Session starts", {
  2275. model: e,
  2276. status: t,
  2277. loadtime: Date.now() - (P || Date.now()),
  2278. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2279. autoplay: i,
  2280. quickstart: n,
  2281. ab_tilegen: a.tilegen,
  2282. ab_imgopt: a.imgopt
  2283. })
  2284. },
  2285. impression: function (e) {
  2286. g("impression", {
  2287. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2288. url_params: (void 0 !== e.immediate && e.immediate, window.location.search.substr(1).split("&"))
  2289. })
  2290. },
  2291. initKeen: function (e) {
  2292. return e.token && e.appId ? void(o = new Keen({
  2293. projectId: e.appId,
  2294. writeKey: e.token,
  2295. readKey: "",
  2296. requestType: "xhr"
  2297. })) : void l.warn("no keen token/appId")
  2298. },
  2299. initSegment: function (e) {
  2300. return e.token ? (i = e.token, window.analytics.load(e.token), c = {
  2301. model_id: e.model,
  2302. start_source: e.startSource,
  2303. autoplay: e.autoplay,
  2304. quickstart: e.quickstart,
  2305. language_tag: t.languageTag,
  2306. is_mobile: y.isMobile(),
  2307. iframe: y.inIframe(),
  2308. aspect_ratio: y.aspectRatio(),
  2309. session_id: h,
  2310. window: {
  2311. width: $("#player").width(),
  2312. height: $("#player").height()
  2313. },
  2314. platform: {
  2315. browser: {
  2316. name: $.ua.browser.name,
  2317. major: $.ua.browser.major,
  2318. version: $.ua.browser.version
  2319. },
  2320. os: {
  2321. name: $.ua.os.name,
  2322. version: $.ua.os.version
  2323. },
  2324. device: {
  2325. vendor: $.ua.device.vendor,
  2326. model: $.ua.device.model,
  2327. type: $.ua.device.type
  2328. }
  2329. }
  2330. }, n = Math.random() < t.analytics.sessionTrackingRate, l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate), void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2331. },
  2332. sessionStart: function (e) {
  2333. l.debug("analytics user_session_start"), f("session_started"), P = Date.now(), window.addEventListener("unload", function () {
  2334. ! function (e, t) {
  2335. if (t = t || {}, navigator.sendBeacon && i) try {
  2336. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2337. event: e,
  2338. anonymousId: window.analytics.user().anonymousId(),
  2339. properties: s.extendObject(t, c),
  2340. writeKey: i,
  2341. sentAt: Date.now(),
  2342. type: "track",
  2343. context: {
  2344. userAgent: y.userAgent(),
  2345. library: {
  2346. name: "showcase-beacon",
  2347. version: "2.25.6-0-gd87e5b1"
  2348. },
  2349. app: {
  2350. name: "showcase",
  2351. version: "2.25.6-0-gd87e5b1"
  2352. }
  2353. }
  2354. }))
  2355. } catch (e) {
  2356. console.warn("Failed to send async segment request")
  2357. }
  2358. }("session_ended", {
  2359. duration: Date.now() - P
  2360. })
  2361. })
  2362. },
  2363. modelLoaded: function (e, t, i, n) {
  2364. r(e, t, i, n)
  2365. },
  2366. loadComplete: function (e) {
  2367. f("load_times", {
  2368. time_to_app_start: e
  2369. })
  2370. },
  2371. track: function (e, t) {
  2372. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"), f(e, t))
  2373. },
  2374. trackAlways: function (e, t) {
  2375. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"), f(e, t)
  2376. },
  2377. getSessionId: function () {
  2378. return h
  2379. },
  2380. updateInteraction: m
  2381. }
  2382. }).call(this, "/js/analytics.js")
  2383. }, {
  2384. "./ab": 3,
  2385. "./enum/ControlEvents": 21,
  2386. "./enum/PlayerEvents": 40,
  2387. "./enum/VROption": 47,
  2388. "./enum/VRPlatforms": 49,
  2389. "./enum/Viewmode": 51,
  2390. "./gui/sharing/ShareEvents": 76,
  2391. "./gui/sharing/modal": 77,
  2392. "./gui/title/TitleEvents": 80,
  2393. "./gui/title/titleBar": 82,
  2394. "./gui/vr/vrEvent": 85,
  2395. "./gui/vr/vrModal": 87,
  2396. "./localization/localize": 108,
  2397. "./tag/Billboard/BillboardEvent": 120,
  2398. "./settings": 166,
  2399. "./util/ajax": 181,
  2400. "./util/browser": 182,
  2401. "./util/common": 185,
  2402. "./util/logger": 189,
  2403. three: 217
  2404. }],
  2405. 5: [function (e, t, i) {
  2406. "use strict";
  2407. function n() {
  2408. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar), this.controls = null
  2409. }
  2410. var r = e("three"),
  2411. o = e("../constants"),
  2412. a = e("../util/cameraLight");
  2413. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function (e) {
  2414. this.aspect = e, this.updateProjectionMatrix()
  2415. }, t.exports = n
  2416. }, {
  2417. "../constants": 8,
  2418. "../util/cameraLight": 184,
  2419. three: 217
  2420. }],
  2421. 6: [function (e, t, i) {
  2422. "use strict";
  2423. function n() {
  2424. var e = $("#player").width() / $("#player").height();
  2425. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar), this.controls = null, this.updateAspect(e)
  2426. }
  2427. var r = e("three"),
  2428. o = e("../constants");
  2429. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function (e) {
  2430. this.aspect = e, this.top = o.orthoBase / e, this.bottom = -o.orthoBase / e, this.updateProjectionMatrix()
  2431. }, t.exports = n
  2432. }, {
  2433. "../constants": 8,
  2434. three: 217
  2435. }],
  2436. 7: [function (e, t, i) {
  2437. "use strict";
  2438. function n() {
  2439. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar), this.controls = null
  2440. }
  2441. var r = e("three"),
  2442. o = e("../settings"),
  2443. a = e("../util/cameraLight");
  2444. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function (e) {
  2445. this.aspect = e, this.updateProjectionMatrix()
  2446. }, t.exports = n
  2447. }, {
  2448. "../settings": 166,
  2449. "../util/cameraLight": 184,
  2450. three: 217
  2451. }],
  2452. 8: [function (e, t, i) {
  2453. "use strict";
  2454. t.exports = {
  2455. signedUrlDefaultExpireTime: 24e4,
  2456. signedUrlCheckInterval: 1e4,
  2457. signedUrlRefreshBuffer: 15e3,
  2458. dollhouseFOV: 70,
  2459. dollhouseNear: 1,
  2460. dollhouseFar: 5e3,
  2461. insideFOV: 70,
  2462. insideFOVMax: 120,
  2463. insideNear: .1,
  2464. insideFar: 5e3,
  2465. insideLookSpeed: .12,
  2466. insideLookLimitUp: 40,
  2467. insideLookLimitDown: -40,
  2468. orthoNear: 1,
  2469. orthoFar: 5e3,
  2470. orthoBase: 10,
  2471. narrowLandscapeHeight: 290,
  2472. reallyNarrowLandscapeHeight: 250,
  2473. visionTilingStartDate: new Date("8/26/2016"),
  2474. visionTilingStartVersion: "1.1.407.13667",
  2475. windowHeightHighQualityThreshold: 900,
  2476. tourStepDelayDefault: 3500,
  2477. tourStepDelaySlideShow: 5e3,
  2478. workshopApsect: 9 / 16,
  2479. highQualityMaxZoom: 2,
  2480. ultraHighQualityMaxZoom: 3
  2481. }
  2482. }, {}],
  2483. 9: [function (e, t, i) {
  2484. "use strict";
  2485. function n() {
  2486. this.activeControl = null, this.controls = {}, this.cameras = {}
  2487. }
  2488. var a = e("./PanoramaControls"),
  2489. s = e("./DollhouseControls"),
  2490. l = e("./FloorplanControls"),
  2491. c = e("../cameras/PanoramaCamera"),
  2492. h = e("../cameras/DollhouseCamera"),
  2493. u = e("../cameras/FloorplanCamera"),
  2494. r = e("events").EventEmitter,
  2495. d = e("../enum/ControlEvents"),
  2496. o = e("../enum/ModelManagerEvents"),
  2497. p = e("../enum/Viewmode"),
  2498. f = e("../settings");
  2499. (n.prototype = Object.create(r.prototype)).init = function (e, t) {
  2500. this.setUpControls(), this.bindEvents(e, t)
  2501. }, n.prototype.activateControls = function (e) {
  2502. this.activeControl && (this.activeControl.reset(), this.activeControl.enabled = !1), this.controls[e] && (this.controls[e].enabled = !0), this.activeControl = this.controls[e]
  2503. }, n.prototype.setUpControls = function () {
  2504. var i = {},
  2505. n = {},
  2506. e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  2507. r = [c, h, u],
  2508. o = [a, s, l];
  2509. e.forEach(function (e, t) {
  2510. i[e] = new r[t], n[e] = new o[t](i[e]), n[e].on(d.Move, this.emit.bind(this, d.Move)), n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)), n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)), n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)), n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)), n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  2511. }.bind(this)), this.controls = n, this.cameras = i
  2512. }, n.prototype.bindEvents = function (e, t) {
  2513. e.addEventListener("mousemove", this.onMouseMove.bind(this)), e.addEventListener("mousedown", this.onMouseDown.bind(this)), e.addEventListener("mouseup", this.onMouseUp.bind(this)), e.addEventListener("mouseover", this.onMouseOver.bind(this)), f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  2514. passive: !1
  2515. }), e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))), e.addEventListener("touchstart", this.onTouchStart.bind(this)), e.addEventListener("touchmove", this.onTouchMove.bind(this)), e.addEventListener("touchend", this.onTouchEnd.bind(this)), e.addEventListener("contextmenu", function (e) {
  2516. e.preventDefault()
  2517. }), e.addEventListener("pointerdown", this.onPointerDown.bind(this)), e.addEventListener("pointermove", this.onPointerMove.bind(this)), e.addEventListener("pointerup", this.onPointerUp.bind(this)), e.addEventListener("pointerout", this.onPointerCancel.bind(this)), e.addEventListener("pointercancel", this.onPointerCancel.bind(this)), document.addEventListener("keydown", this.onKeyDown.bind(this)), document.addEventListener("keyup", this.onKeyUp.bind(this)), t.on(o.ActiveModelChanged, function (e) {
  2518. this.setModelForControls(e.model)
  2519. }.bind(this))
  2520. }, n.prototype.setModelForControls = function (e) {
  2521. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  2522. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  2523. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function (e) {
  2524. this.controls[e].setBounds(t)
  2525. }.bind(this))
  2526. }, n.prototype.onMouseDown = function (e) {
  2527. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e)
  2528. }, n.prototype.onMouseMove = function (e) {
  2529. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e)
  2530. }, n.prototype.onMouseUp = function (e) {
  2531. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e)
  2532. }, n.prototype.onMouseOver = function (e) {
  2533. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e)
  2534. }, n.prototype.onMouseWheel = function (e) {
  2535. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e)
  2536. }, n.prototype.onTouchStart = function (e) {
  2537. e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e), $("#hotListWrap")[0].classList.remove("hotListActive"), $("#hotListContent ul .active").removeClass("active"), $("#hotList")[0].classList.remove("active")
  2538. }, n.prototype.onTouchMove = function (e) {
  2539. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e)
  2540. }, n.prototype.onTouchEnd = function (e) {
  2541. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e)
  2542. }, n.prototype.onPointerDown = function (e) {
  2543. if (e.preventDefault(), this.activeControl) switch (e.pointerType) {
  2544. case "mouse":
  2545. this.activeControl.onMouseDown(e);
  2546. break;
  2547. default:
  2548. this.activeControl.onPointerDown(e)
  2549. }
  2550. }, n.prototype.onPointerMove = function (e) {
  2551. if (e.preventDefault(), this.activeControl) switch (e.pointerType) {
  2552. case "mouse":
  2553. this.activeControl.onMouseMove(e);
  2554. break;
  2555. default:
  2556. this.activeControl.onPointerMove(e)
  2557. }
  2558. }, n.prototype.onPointerUp = function (e) {
  2559. if (e.preventDefault(), this.activeControl) switch (e.pointerType) {
  2560. case "mouse":
  2561. this.activeControl.onMouseUp(e);
  2562. break;
  2563. default:
  2564. this.activeControl.onPointerUp(e)
  2565. }
  2566. }, n.prototype.onPointerCancel = function (e) {
  2567. e.preventDefault(), this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  2568. }, n.prototype.onKeyDown = function (e) {
  2569. e.metaKey || e.ctrlKey || (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e))
  2570. }, n.prototype.onKeyUp = function (e) {
  2571. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e)
  2572. }, t.exports = n
  2573. }, {
  2574. "../cameras/DollhouseCamera": 5,
  2575. "../cameras/FloorplanCamera": 6,
  2576. "../cameras/PanoramaCamera": 7,
  2577. "../enum/ControlEvents": 21,
  2578. "../enum/ModelManagerEvents": 33,
  2579. "../enum/Viewmode": 51,
  2580. "../settings": 166,
  2581. "./DollhouseControls": 10,
  2582. "./FloorplanControls": 11,
  2583. "./PanoramaControls": 13,
  2584. events: 202
  2585. }],
  2586. 10: [function (e, t, i) {
  2587. "use strict";
  2588. function n(e) {
  2589. a.call(this, e), this.minPolarAngle = o.dollhouseDefault.minPolarAngle, this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle, this.minDistance = o.dollhouseDefault.minDistance, this.maxDistance = o.dollhouseDefault.maxDistance, this.adjustedMinDistance = this.minDistance, this.adjustedMaxDistance = this.maxDistance
  2590. }
  2591. var r = e("three"),
  2592. o = e("../settings"),
  2593. a = e("./OutsideControls");
  2594. (n.prototype = Object.create(a.prototype)).pan = function (e, t) {
  2595. this.camera.updateMatrix();
  2596. var i = this.camera.position.clone().sub(this.target).length();
  2597. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180), this.panLeft(2 * e * i / $("#player").height()), this.panUp(-2 * t * i / $("#player").height())
  2598. }, n.prototype.updateZoom = function () {
  2599. return this.offset.length() * this.scale
  2600. }, n.prototype.setZoomBounds = function (e) {
  2601. var t = e.min.distanceTo(e.max);
  2602. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0), this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius), this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance
  2603. }, n.prototype.resetRanges = function (e, t) {
  2604. e ? (this.minDistance = Math.min(e, this.minDistance), this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance), t ? (this.minPolarAngle = r.Math.degToRad(-15), this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle, this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  2605. }, n.prototype.toJSON = function () {
  2606. return a.prototype.toJSON.call(this)
  2607. }, t.exports = n
  2608. }, {
  2609. "../settings": 166,
  2610. "./OutsideControls": 12,
  2611. three: 217
  2612. }],
  2613. 11: [function (e, t, i) {
  2614. "use strict";
  2615. function n(e) {
  2616. c.call(this, e), this.minDistance = 15, this.maxDistance = 50, this.noRotateUpDown = !0, this.minPolarAngle = 0, this.maxPolarAngle = 0, this.mouseActions[u.LEFT] = h.PAN, this.mouseActions[u.MIDDLE] = h.DOLLY, this.mouseActions[u.RIGHT] = h.ROTATE, this.touchActions[1] = h.PAN, this.touchActions[2] = h.ROTATE_DOLLY, this.absoluteScale = 1, this.currentScale = 1
  2617. }
  2618. var r, o, a, s = e("three"),
  2619. l = e("../settings"),
  2620. c = e("./OutsideControls"),
  2621. h = e("../enum/ControlActions"),
  2622. u = e("../enum/MouseButton"),
  2623. d = e("../util/math"),
  2624. p = e("../util/browser");
  2625. (n.prototype = Object.create(c.prototype)).zoomToContain = function (e) {
  2626. var t = Math.max(e.x, e.z),
  2627. i = Math.min(e.x, e.z),
  2628. n = Math.max(t, i * this.camera.aspect),
  2629. r = Math.max(i, t * this.camera.aspect);
  2630. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2, this.currentScale = this.absoluteScale
  2631. }, n.prototype.rotateToView = function (e, t) {
  2632. var i = 0;
  2633. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2, this.rotateLeft(i), this.update(0)
  2634. }, n.prototype.pan = function (e, t) {
  2635. this.camera.updateMatrix(), this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()), this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  2636. }, n.prototype.updateZoom = function () {
  2637. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed, this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)), this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale, this.camera.left = -l.orthoBase * this.currentScale, this.camera.right = l.orthoBase * this.currentScale, this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect, this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect, this.camera.updateProjectionMatrix(), this.offset.length()
  2638. }, n.prototype.toJSON = (r = new s.Quaternion, o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0, 1, 0), s.Math.degToRad(90)), a = new s.Quaternion, function () {
  2639. var e = c.prototype.toJSON.call(this);
  2640. return r.copy(e.camera_quaternion), a.copy(o), a.multiply(r), e.camera_quaternion.x = d.toPrecision(a.x, 4), e.camera_quaternion.y = d.toPrecision(a.y, 4), e.camera_quaternion.z = d.toPrecision(a.z, 4), e.camera_quaternion.w = d.toPrecision(a.w, 4), e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4), e
  2641. }), t.exports = n
  2642. }, {
  2643. "../enum/ControlActions": 20,
  2644. "../enum/MouseButton": 34,
  2645. "../settings": 166,
  2646. "../util/browser": 182,
  2647. "../util/math": 190,
  2648. "./OutsideControls": 12,
  2649. three: 217
  2650. }],
  2651. 12: [function (e, t, i) {
  2652. "use strict";
  2653. function n(e) {
  2654. this.camera = e, (this.camera.controls = this).enabled = !1, this.target = new a.Vector3, this.targetBounds = new a.Box3, this.zoomSpeed = 1, this.minDistance = 0, this.maxDistance = 1 / 0, this.noRotateUpDown = !1, this.rotateSpeed = 1, this.keyboardZoomSpeed = 0, this.keyPanSpeed = 7, this.autoRotate = !1, this.autoRotateSpeed = 2, this.autoPan = !1, this.autoPanPosition = new a.Vector3, this.minPolarAngle = a.Math.degToRad(25), this.maxPolarAngle = a.Math.degToRad(65), this.rotationAcceleration = new a.Vector2, this.rotationSpeed = new a.Vector2, this.panAcceleration = new a.Vector2, this.panSpeed = new a.Vector2, this.rotateStart = new a.Vector2, this.rotateEnd = new a.Vector2, this.rotateDelta = new a.Vector2, this.panStart = new a.Vector2, this.panEnd = new a.Vector2, this.panDelta = new a.Vector2, this.panOffset = new a.Vector3, this.offset = new a.Vector3, this.dollyStart = new a.Vector2, this.dollyEnd = new a.Vector2, this.dollyDelta = new a.Vector2, this.phiDelta = 0, this.thetaDelta = 0, this.scale = 1, this.panVector = new a.Vector3, this.lastPosition = new a.Vector3, this.state = u.NONE, this.mouseActions = {}, this.mouseActions[d.LEFT] = u.ROTATE, this.mouseActions[d.MIDDLE] = u.DOLLY, this.mouseActions[d.RIGHT] = u.PAN, this.touchActions = {}, this.touchActions[1] = u.ROTATE, this.touchActions[2] = u.PAN_DOLLY, this.lastMoveTime = 0, this.pointersLimit = 2, this.pointers = []
  2655. }
  2656. var r, o, a = e("three"),
  2657. c = e("../settings"),
  2658. h = e("../util/common"),
  2659. s = e("../util/math"),
  2660. l = e("../enum/Vectors"),
  2661. u = e("../enum/ControlActions"),
  2662. d = e("../enum/MouseButton"),
  2663. p = e("../enum/Keys"),
  2664. f = e("../enum/ControlEvents"),
  2665. g = e("events").EventEmitter;
  2666. (n.prototype = Object.create(g.prototype)).setBounds = function (e) {
  2667. this.targetBounds = e
  2668. }, n.prototype.isEngaged = function () {
  2669. return this.state !== u.NONE
  2670. }, n.prototype.rotateLeft = function (e) {
  2671. void 0 === e && (e = this.getAutoRotationAngle()), this.thetaDelta -= e
  2672. }, n.prototype.rotateUp = function (e) {
  2673. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()), this.phiDelta -= e)
  2674. }, n.prototype.panLeft = function (e) {
  2675. var t = this.camera.matrix.elements;
  2676. this.panOffset.set(t[0], 0, t[2]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  2677. }, n.prototype.panUp = function (e) {
  2678. var t = this.camera.matrix.elements;
  2679. this.panOffset.set(t[4], 0, t[6]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  2680. }, n.prototype.startRotating = function (e, t) {
  2681. e && this.navRotationAcc("x", e), t && this.navRotationAcc("y", t)
  2682. }, n.prototype.stopRotating = function (e) {
  2683. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.navRotationAcc("x", 0), this.navRotationAcc("y", 0)
  2684. }, n.prototype.setAutoPanPosition = (r = new a.Vector3, o = new a.Vector3, function (e, t) {
  2685. r.copy(this.camera.position), void 0 === e && null === e || r.setX(e), void 0 === t && null === t || r.setZ(t);
  2686. var i = this.camera.position.distanceTo(this.target),
  2687. n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  2688. this.targetClamped = !1, o.copy(r).addScaledVector(n, i), this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o), r.copy(o).addScaledVector(n, -i), this.targetClamped = !0), this.autoPanPosition.x = r.x, this.autoPanPosition.z = r.z, this.autoPan && this.stopAutoPanning()
  2689. }), n.prototype.stopAutoPanning = function () {
  2690. var e = this.autoPan;
  2691. this.autoPan = !1, this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  2692. }, n.prototype.dollyIn = function (e) {
  2693. void 0 === e && (e = this.getZoomScale()), this.scale /= e
  2694. }, n.prototype.dollyOut = function (e) {
  2695. void 0 === e && (e = this.getZoomScale()), this.scale *= e
  2696. }, n.prototype.updatePan = function (e) {
  2697. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e), this.pan(-this.panSpeed.x, this.panSpeed.y), this.autoPan) {
  2698. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  2699. t.setY(0).clampLength(0, 50 * e), this.target.add(t), this.camera.position.add(t), this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1, this.stopAutoPanning())
  2700. }
  2701. }, n.prototype.update = function (e) {
  2702. e = e || 1 / 60, this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e), this.rotateLeft(-this.rotationSpeed.x), this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y), this.updatePan(e);
  2703. var t = this.camera.position;
  2704. this.offset.copy(t).sub(this.target);
  2705. var i = Math.atan2(this.offset.x, this.offset.z),
  2706. n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  2707. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()), i += this.thetaDelta, n += this.phiDelta, n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)), n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  2708. var r = this.updateZoom();
  2709. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)), this.target.add(this.panVector), this.targetBounds.clampPoint(this.target, this.target), this.offset.x = r * Math.sin(n) * Math.sin(i), this.offset.y = r * Math.cos(n), this.offset.z = r * Math.sin(n) * Math.cos(i), t.copy(this.target).add(this.offset), this.camera.lookAt(this.target), this.thetaDelta = 0, this.phiDelta = 0, this.scale = 1, this.panVector.set(0, 0, 0), 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  2710. }, n.prototype.getAutoRotationAngle = function () {
  2711. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  2712. }, n.prototype.getZoomScale = function () {
  2713. return Math.pow(.95, this.zoomSpeed)
  2714. }, n.prototype.onMouseDown = function (e) {
  2715. if (this.enabled) {
  2716. switch (e.preventDefault(), this.stopAutoPanning(), this.mouseDown = !0, this.state = this.mouseActions[e.button], this.state) {
  2717. case u.ROTATE:
  2718. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY), this.rotationSpeed.set(0, 0);
  2719. break;
  2720. case u.DOLLY:
  2721. this.dollyStart.set(e.clientX, e.clientY);
  2722. break;
  2723. case u.PAN:
  2724. this.panStart.set(e.clientX, e.clientY)
  2725. }
  2726. this.emit(f.InputStart, "mouse")
  2727. }
  2728. }, n.prototype.onMouseMove = function (e) {
  2729. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  2730. switch (e.preventDefault(), this.state) {
  2731. case u.ROTATE:
  2732. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd);
  2733. break;
  2734. case u.DOLLY:
  2735. this.dollyEnd.set(e.clientX, e.clientY), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart), (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this), this.dollyStart.copy(this.dollyEnd);
  2736. break;
  2737. case u.PAN:
  2738. this.panEnd.set(e.clientX, e.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd)
  2739. }
  2740. this.emit(f.Move, "mouse"), this.lastMoveTime = e.timeStamp, this.update()
  2741. }
  2742. }, n.prototype.onMouseUp = function (e) {
  2743. this.enabled && (this.mouseDown = !1, this.state = u.NONE, "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y), this.update(), this.rotationAcceleration.set(0, 0), this.rotateDelta.set(0, 0)))
  2744. }, n.prototype.onMouseOver = function (e) {
  2745. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  2746. }, n.prototype.onMouseWheel = function (e) {
  2747. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"), (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this), this.update())
  2748. }, n.prototype.onKeyDown = function (e) {
  2749. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  2750. }, n.prototype.navRotationAcc = function (e, t) {
  2751. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  2752. }, n.prototype.navPanAcc = function (e, t) {
  2753. this.stopAutoPanning(), this.panAcceleration[e] = t
  2754. }, n.prototype.handleKeyDown = function (e) {
  2755. var t = !0;
  2756. switch (e) {
  2757. case p.UPARROW:
  2758. case p.I:
  2759. this.navRotationAcc("y", 1);
  2760. break;
  2761. case p.DOWNARROW:
  2762. case p.K:
  2763. this.navRotationAcc("y", -1);
  2764. break;
  2765. case p.LEFTARROW:
  2766. case p.J:
  2767. this.navRotationAcc("x", -1);
  2768. break;
  2769. case p.RIGHTARROW:
  2770. case p.L:
  2771. this.navRotationAcc("x", 1);
  2772. break;
  2773. case p.W:
  2774. this.navPanAcc("y", 1);
  2775. break;
  2776. case p.S:
  2777. this.navPanAcc("y", -1);
  2778. break;
  2779. case p.A:
  2780. this.navPanAcc("x", -1);
  2781. break;
  2782. case p.D:
  2783. this.navPanAcc("x", 1);
  2784. break;
  2785. default:
  2786. t = !1
  2787. }
  2788. t && this.emit(f.Move, "key")
  2789. }, n.prototype.onKeyUp = function (e) {
  2790. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  2791. }, n.prototype.handleKeyUp = function (e) {
  2792. switch (e) {
  2793. case p.I:
  2794. case p.K:
  2795. case p.UPARROW:
  2796. case p.DOWNARROW:
  2797. this.keyboardZoomSpeed = 0, this.rotationAcceleration.y = 0;
  2798. break;
  2799. case p.J:
  2800. case p.L:
  2801. case p.LEFTARROW:
  2802. case p.RIGHTARROW:
  2803. this.rotationAcceleration.x = 0;
  2804. break;
  2805. case p.S:
  2806. case p.W:
  2807. this.panAcceleration.y = 0;
  2808. break;
  2809. case p.A:
  2810. case p.D:
  2811. this.panAcceleration.x = 0
  2812. }
  2813. }, n.prototype.onTouchStart = function (i) {
  2814. if (this.enabled || this.state === u.NONE) {
  2815. i.preventDefault(), i.stopPropagation(), this.stopAutoPanning();
  2816. var e = function () {
  2817. if (2 === i.touches.length) {
  2818. var e = i.touches[0].pageX - i.touches[1].pageX,
  2819. t = i.touches[0].pageY - i.touches[1].pageY;
  2820. this.dollyStart.set(e, t)
  2821. }
  2822. }.bind(this),
  2823. t = function () {
  2824. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  2825. }.bind(this),
  2826. n = function () {
  2827. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  2828. }.bind(this);
  2829. switch (this.state = this.touchActions[i.touches.length], this.state) {
  2830. case u.PAN_DOLLY:
  2831. e();
  2832. case u.PAN:
  2833. t();
  2834. break;
  2835. case u.ROTATE_DOLLY:
  2836. e();
  2837. case u.ROTATE:
  2838. n()
  2839. }
  2840. this.rotationSpeed.set(0, 0), this.emit(f.InputStart, "touch")
  2841. }
  2842. }, n.prototype.onTouchMove = function (a) {
  2843. if (this.enabled && this.state !== u.NONE) {
  2844. a.preventDefault(), a.stopPropagation();
  2845. var s = function () {
  2846. var e = a.touches[0].pageX - a.touches[1].pageX,
  2847. t = a.touches[0].pageY - a.touches[1].pageY;
  2848. this.dollyEnd.set(e, t);
  2849. var i = this.dollyStart.length() - this.dollyEnd.length();
  2850. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500), this.dollyStart.copy(this.dollyEnd)
  2851. }.bind(this),
  2852. e = function () {
  2853. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd), this.rotateDelta.set(0, 0)
  2854. }.bind(this),
  2855. l = function () {
  2856. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd)
  2857. }.bind(this),
  2858. t = function () {
  2859. if (2 === a.touches.length) {
  2860. var e = window.devicePixelRatio || 1,
  2861. t = a.touches[1].pageX - a.touches[0].pageX,
  2862. i = a.touches[1].pageY - a.touches[0].pageY,
  2863. n = Math.sqrt(t * t + i * i);
  2864. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e) this.state = u.DOLLY, s();
  2865. else {
  2866. var r = h.average(a.touches, "pageX"),
  2867. o = h.average(a.touches, "pageY");
  2868. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE, this.rotateStart.set(r, o), l())
  2869. }
  2870. }
  2871. }.bind(this);
  2872. switch (this.state) {
  2873. case u.PAN_DOLLY:
  2874. s();
  2875. case u.PAN:
  2876. e();
  2877. break;
  2878. case u.ROTATE_DOLLY:
  2879. t();
  2880. break;
  2881. case u.DOLLY:
  2882. s();
  2883. break;
  2884. case u.ROTATE:
  2885. l();
  2886. break;
  2887. default:
  2888. this.state = u.NONE
  2889. }
  2890. this.lastMoveTime = a.timeStamp, this.emit(f.Move, "touch")
  2891. }
  2892. }, n.prototype.onTouchEnd = function (e) {
  2893. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)), this.state = u.NONE, this.update(), this.rotationAcceleration.set(0, 0), this.rotateDelta.set(0, 0))
  2894. }, n.prototype.onPointerDown = function (e) {
  2895. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  2896. id: e.pointerId,
  2897. pageX: e.pageX,
  2898. pageY: e.pageY
  2899. }), e.touches = this.pointers, this.onTouchStart(e)), this.emit(f.InputStart, "pointer"))
  2900. }, n.prototype.onPointerMove = function (t) {
  2901. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function (e) {
  2902. t.pointerId === e.id && (e.pageX = t.pageX, e.pageY = t.pageY)
  2903. }), t.touches = this.pointers, this.onTouchMove(t))
  2904. }, n.prototype.onPointerUp = function (i) {
  2905. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function (e, t) {
  2906. i.pointerId === e.id && this.pointers.splice(t, 1)
  2907. }.bind(this)), i.touches = this.pointers, this.onTouchEnd(i))
  2908. }, n.prototype.reset = function () {
  2909. this.state = u.NONE, this.stopAutoPanning(), this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0)
  2910. }, n.prototype.toJSON = function () {
  2911. return {
  2912. camera_position: {
  2913. x: s.toPrecision(this.camera.position.x, 4),
  2914. y: s.toPrecision(this.camera.position.y, 4),
  2915. z: s.toPrecision(this.camera.position.z, 4)
  2916. },
  2917. camera_quaternion: {
  2918. x: s.toPrecision(this.camera.quaternion.x, 4),
  2919. y: s.toPrecision(this.camera.quaternion.y, 4),
  2920. z: s.toPrecision(this.camera.quaternion.z, 4),
  2921. w: s.toPrecision(this.camera.quaternion.w, 4)
  2922. }
  2923. }
  2924. }, t.exports = n
  2925. }, {
  2926. "../enum/ControlActions": 20,
  2927. "../enum/ControlEvents": 21,
  2928. "../enum/Keys": 30,
  2929. "../enum/MouseButton": 34,
  2930. "../enum/Vectors": 50,
  2931. "../settings": 166,
  2932. "../util/common": 185,
  2933. "../util/math": 190,
  2934. events: 202,
  2935. three: 217
  2936. }],
  2937. 13: [function (u, d, e) {
  2938. (function (e) {
  2939. "use strict";
  2940. function t(e) {
  2941. this.camera = e, (this.camera.controls = this).target = new s.Vector3(0, 0, 0), this.lookVector = new s.Vector3, this.lookSpeed = .05, this.rotationAcc = new s.Vector2, this.rotationSpeed = new s.Vector2, this.lat = 0, this.lon = 0, this.phi = 0, this.theta = 0, this.enabled = !1, this.locked = !1, this.pointer = new s.Vector2(0, 0), this.rotationHistory = [], this.rotationDifference = new s.Vector2, this.pointerDragOn = !1, this.pointerDragStart = new s.Vector2(0, 0), this.pinchDistance = 0, this.moveStart = new s.Vector2, this.moveTolerance = .01, this.pointersLimit = 2, this.pointers = []
  2942. }
  2943. var s = u("three"),
  2944. i = u("../util/logger"),
  2945. n = u("../settings"),
  2946. r = u("../util/common"),
  2947. o = u("../util/math"),
  2948. a = (u("../enum/Vectors"), u("../enum/MouseButton")),
  2949. l = u("../enum/Keys"),
  2950. c = u("../enum/ControlEvents"),
  2951. h = u("events").EventEmitter;
  2952. new i(e), (t.prototype = Object.create(h.prototype)).usable = function () {
  2953. return this.enabled && !this.locked
  2954. }, t.prototype.lookAt = function (e) {
  2955. var t = this.camera.position.clone().sub(e),
  2956. i = Math.atan(t.z / t.x);
  2957. i += t.x < 0 ? Math.PI : 0, i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0, this.lon = s.Math.radToDeg(i) + 180;
  2958. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  2959. r = Math.atan(t.y / n);
  2960. this.lat = -s.Math.radToDeg(r)
  2961. }, t.prototype.startRotationFrom = function (e, t) {
  2962. o.convertScreenPositionToNDC(e, t, this.pointer), this.pointerDragOn = !0, this.pointerDragStart.copy(this.pointer), this.moveStart.copy(this.pointer), this.rotationHistory = [], this.rotationSpeed.set(0, 0)
  2963. }, t.prototype.onMouseOver = function (e) {
  2964. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  2965. }, t.prototype.onTouchStart = function (e) {
  2966. if (this.usable()) {
  2967. switch (e.preventDefault(), e.stopPropagation(), e.touches.length) {
  2968. case 1:
  2969. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  2970. break;
  2971. case 2:
  2972. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width(),
  2973. i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  2974. this.pinchDistance = Math.sqrt(t * t + i * i)
  2975. }
  2976. this.emit(c.InputStart, "touch")
  2977. }
  2978. }, t.prototype.onPointerDown = function (e) {
  2979. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  2980. id: e.pointerId,
  2981. clientX: e.clientX,
  2982. clientY: e.clientY
  2983. }), e.touches = this.pointers, this.onTouchStart(e), this.emit(c.InputStart, "pointer"))
  2984. }, t.prototype.onMouseDown = function (e) {
  2985. if (this.usable()) {
  2986. switch (e.preventDefault(), e.stopPropagation(), e.button) {
  2987. case a.LEFT:
  2988. this.startRotationFrom(e.clientX, e.clientY)
  2989. }
  2990. this.emit(c.InputStart, "mouse")
  2991. }
  2992. }, t.prototype.updateRotation = function () {
  2993. if (this.usable() && this.pointerDragOn) {
  2994. var e = new s.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1).unproject(this.camera),
  2995. t = new s.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  2996. i = Math.sqrt(e.x * e.x + e.z * e.z),
  2997. n = Math.sqrt(t.x * t.x + t.z * t.z),
  2998. r = Math.atan2(e.y, i),
  2999. o = Math.atan2(t.y, n);
  3000. this.rotationDifference.y = s.Math.radToDeg(r - o), e.y = 0, t.y = 0;
  3001. var a = Math.acos(e.dot(t) / e.length() / t.length());
  3002. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)), this.pointerDragStart.copy(this.pointer)
  3003. }
  3004. }, t.prototype.onMouseMove = function (e) {
  3005. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer), this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  3006. }, t.prototype.onTouchMove = function (e) {
  3007. if (this.usable()) switch (this.emit(c.Move, "touch"), e.touches.length) {
  3008. case 1:
  3009. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  3010. break;
  3011. case 2:
  3012. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width(),
  3013. i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height(),
  3014. n = this.pinchDistance - Math.sqrt(t * t + i * i);
  3015. .01 < Math.abs(n) && (this.emit(c.InteractionDirect), this.emit(c.Pinch, n), this.pinchDistance -= n)
  3016. }
  3017. }, t.prototype.onPointerMove = function (t) {
  3018. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function (e) {
  3019. t.pointerId === e.id && (e.clientX = t.clientX, e.clientY = t.clientY)
  3020. }), t.touches = this.pointers, this.onTouchMove(t))
  3021. }, t.prototype.endRotation = function () {
  3022. this.pointerDragOn = !1;
  3023. var e = r.averageVectors(this.rotationHistory);
  3024. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  3025. }, t.prototype.onTouchEnd = function (e) {
  3026. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  3027. }, t.prototype.onMouseUp = function (e) {
  3028. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  3029. }, t.prototype.onPointerUp = function (i) {
  3030. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function (e, t) {
  3031. i.pointerId === e.id && this.pointers.splice(t, 1)
  3032. }.bind(this)), i.touches = this.pointers, this.onTouchEnd(i))
  3033. }, t.prototype.update = function (e) {
  3034. for (this.lon, this.lat, this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount;) this.rotationHistory.shift();
  3035. this.lon += this.rotationDifference.x, this.lat += this.rotationDifference.y, this.rotationDifference.set(0, 0), this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside, this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside, this.lon += this.rotationSpeed.x * e, this.lat += this.rotationSpeed.y * e, this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)), this.phi = s.Math.degToRad(90 - this.lat), this.theta = s.Math.degToRad(this.lon), this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta), this.lookVector.y = Math.cos(this.phi), this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta), this.target.copy(this.lookVector).add(this.camera.position), this.camera.lookAt(this.target)
  3036. }, t.prototype.onMouseWheel = function (e) {
  3037. if (this.usable()) {
  3038. var t = e.wheelDelta || -e.detail;
  3039. this.emit(c.InteractionDirect), this.emit(c.Scroll, t)
  3040. }
  3041. }, t.prototype.onKeyDown = function (e) {
  3042. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  3043. }, t.prototype.handleKeyDown = function (e) {
  3044. var t = function (e, t) {
  3045. this.rotationAcc[e] = t
  3046. }.bind(this);
  3047. this.emit(c.InteractionKey);
  3048. var i = !0;
  3049. switch (e) {
  3050. case l.LEFTARROW:
  3051. case l.J:
  3052. t("x", -1);
  3053. break;
  3054. case l.RIGHTARROW:
  3055. case l.L:
  3056. t("x", 1);
  3057. break;
  3058. case l.I:
  3059. t("y", 1);
  3060. break;
  3061. case l.K:
  3062. t("y", -1);
  3063. break;
  3064. default:
  3065. i = !1
  3066. }
  3067. i && this.emit(c.Move, "key")
  3068. }, t.prototype.onKeyUp = function (e) {
  3069. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  3070. }, t.prototype.handleKeyUp = function (e) {
  3071. switch (e) {
  3072. case l.LEFTARROW:
  3073. case l.J:
  3074. case l.RIGHTARROW:
  3075. case l.L:
  3076. this.rotationAcc.x = 0;
  3077. break;
  3078. case l.I:
  3079. case l.K:
  3080. this.rotationAcc.y = 0
  3081. }
  3082. }, t.prototype.startRotating = function (e, t) {
  3083. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
  3084. }, t.prototype.stopRotating = function (e) {
  3085. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
  3086. }, t.prototype.reset = function () {
  3087. this.pointerDragOn = !1, this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), this.pointers = []
  3088. }, t.prototype.toJSON = function () {
  3089. return {
  3090. camera_position: {
  3091. x: o.toPrecision(this.camera.position.x, 4),
  3092. y: o.toPrecision(this.camera.position.y, 4),
  3093. z: o.toPrecision(this.camera.position.z, 4)
  3094. },
  3095. camera_quaternion: {
  3096. x: o.toPrecision(this.camera.quaternion.x, 4),
  3097. y: o.toPrecision(this.camera.quaternion.y, 4),
  3098. z: o.toPrecision(this.camera.quaternion.z, 4),
  3099. w: o.toPrecision(this.camera.quaternion.w, 4)
  3100. }
  3101. }
  3102. }, t.prototype.setStateFromJSON = function (e) {
  3103. this.camera.position.copy(e.camera_position), this.camera.quaternion.copy(e.camera_quaternion)
  3104. }, d.exports = t
  3105. }).call(this, "/js/controls/PanoramaControls.js")
  3106. }, {
  3107. "../enum/ControlEvents": 21,
  3108. "../enum/Keys": 30,
  3109. "../enum/MouseButton": 34,
  3110. "../enum/Vectors": 50,
  3111. "../settings": 166,
  3112. "../util/common": 185,
  3113. "../util/logger": 189,
  3114. "../util/math": 190,
  3115. events: 202,
  3116. three: 217
  3117. }],
  3118. 14: [function (t, i, e) {
  3119. (function (e) {
  3120. "use strict";
  3121. var c = t("three"),
  3122. h = t("../enum/Viewmode"),
  3123. u = new(t("../util/logger"))(e);
  3124. i.exports = {
  3125. serialize: function (e) {
  3126. return encodeURI(JSON.stringify(e))
  3127. },
  3128. deserialize: function (e) {
  3129. function t(e) {
  3130. return e.reduce(function (e, t) {
  3131. return e && "number" == typeof t && !isNaN(t)
  3132. }, !0)
  3133. }
  3134. try {
  3135. var i = JSON.parse(decodeURI(e)),
  3136. n = {
  3137. mode: h.fromInt(i.camera_mode),
  3138. panoId: i.scan_id,
  3139. position: (new c.Vector3).copy(i.camera_position),
  3140. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  3141. zoom: i.ortho_zoom,
  3142. floorVisibility: i.floor_visibility
  3143. },
  3144. r = n.position;
  3145. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  3146. var o = n.quaternion;
  3147. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1), n
  3148. } catch (i) {
  3149. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  3150. try {
  3151. var a = e.split(","),
  3152. s = {
  3153. x: parseFloat(a[2]),
  3154. y: parseFloat(a[3]),
  3155. z: parseFloat(a[4])
  3156. },
  3157. l = {
  3158. x: parseFloat(a[5]),
  3159. y: parseFloat(a[6]),
  3160. z: parseFloat(a[7]),
  3161. w: parseFloat(a[8])
  3162. };
  3163. return t([s.x, s.y, s.z]) || (s.x = 0, s.y = 0, s.z = 0), t([l.x, l.y, l.z, l.w]) || (l.x = 0, l.y = 0, l.z = 0, l.w = 1), {
  3164. mode: h.fromInt(a[0]),
  3165. panoId: a[1],
  3166. position: (new c.Vector3).copy(s),
  3167. quaternion: (new c.Quaternion).copy(l)
  3168. }
  3169. } catch (t) {
  3170. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  3171. }
  3172. }
  3173. return null
  3174. }
  3175. }
  3176. }).call(this, "/js/controls/serializer.js")
  3177. }, {
  3178. "../enum/Viewmode": 51,
  3179. "../util/logger": 189,
  3180. three: 217
  3181. }],
  3182. 15: [function (C, I, e) {
  3183. (function (e) {
  3184. "use strict";
  3185. function t() {
  3186. this.endlessLoop = r.warp.loop, this.clock = new i.Clock(!0), this.model = null, this.player = null, this.currentItem = null, this.destinationItem = null, this.tourIsPlaying = !1, this.transitionStage = v.None, this.nextFunc = null, this.onTheBus = !1, this.tourInProgress = !1, this.reachSource = null, this.interrupted = !1, this.nItems = 0, this.walkingSectionPaused = !1
  3187. }
  3188. var i = C("three"),
  3189. n = C("./util/logger"),
  3190. r = C("./settings"),
  3191. o = C("./util/transitions"),
  3192. a = C("events").EventEmitter,
  3193. s = C("./enum/Viewmode"),
  3194. l = C("./analytics"),
  3195. c = C("./enum/WarpStyle"),
  3196. h = (o = C("./util/transitions"), C("./model/ModelManager"), C("./enum/ModelManagerEvents")),
  3197. u = C("./enum/DirectorEvents"),
  3198. d = C("./enum/PlayerEvents"),
  3199. p = (C("./enum/ControlEvents"), C("./enum/BlackoutStyle")),
  3200. f = C("./enum/PathDiscardMode"),
  3201. g = C("./enum/PathDisplayMode"),
  3202. m = (C("./player"), new n(e)),
  3203. v = Object.freeze({
  3204. None: 0,
  3205. Moving: 1,
  3206. Aiming: 2,
  3207. Interlude: 3
  3208. }),
  3209. y = Object.freeze({
  3210. Forward: 1,
  3211. NoChange: 0,
  3212. Backwards: -1
  3213. }),
  3214. A = o.getUniqueId();
  3215. (t.prototype = Object.create(a.prototype)).init = function (e, t) {
  3216. this.player = e, this.modelManager = t, this.updateModel(), this.resetAll(), this.bindEvents()
  3217. }, t.prototype.resetAll = function () {
  3218. if (this.currentItem = null, this.destinationItem = null, this.tourIsPlaying = !1, this.bgmReplay(), this.transitionStage = v.None, this.nextFunc = null, this.onTheBus = !1, this.reachSource = null, this.interrupted = !1, this.model) {
  3219. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  3220. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  3221. } else this.defaultWarpStyle = c.BLACK, m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  3222. this.resetSpecialTransition()
  3223. }, t.prototype.updateModel = function () {
  3224. this.model = this.modelManager.getActiveModel(), this.nItems = this.model.heroLocations.length
  3225. }, t.prototype.bindEvents = function () {
  3226. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)), this.player.on(d.Move, this.handlePlayerMove.bind(this)), this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)), this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)), this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)), this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)), this.player.once(d.Move, function () {
  3227. o.cancelById(A)
  3228. })
  3229. }, t.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  3230. return e === c.WALK && (this.interrupt(p.NONE), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight(), !0)
  3231. }, t.prototype.handlePlayerMove = function (e) {
  3232. this.transitionStage === v.Interlude && this.interrupt(p.NONE), this.emit("update.controls")
  3233. }, t.prototype.handlePlayerPanoChosen = function (e, t) {
  3234. this.intermediateState() || e.id === t.id || (this.onTheBus = !1, this.emit("update.controls"))
  3235. }, t.prototype.handlePlayerModeChanged = function (e, t) {
  3236. this.intermediateState() || e === t || (this.onTheBus = !1, this.emit("update.controls"))
  3237. }, t.prototype.handlePlayerInputStart = function (e) {
  3238. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  3239. }, t.prototype.handlePlayerFlyingStarted = function () {
  3240. this.clearWalkingSectionPaused()
  3241. }, t.prototype.describe = function () {
  3242. return {
  3243. nItems: this.nItems,
  3244. currentItem: this.currentItem,
  3245. destinationItem: this.destinationItem,
  3246. tourIsPlaying: this.tourIsPlaying,
  3247. onTheBus: this.onTheBus,
  3248. endlessLoop: this.endlessLoop,
  3249. viewMode: this.player.mode,
  3250. inTransition: this._inTransition(),
  3251. transitionStage: this.transitionStage,
  3252. tourInProgress: this.tourInProgress
  3253. }
  3254. }, t.prototype._inTransition = function () {
  3255. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  3256. }, t.prototype.bounceable = function () {
  3257. var e = this.clock.getDelta();
  3258. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  3259. }, t.prototype.currentMoveDirection = function () {
  3260. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  3261. }, t.prototype.clearPath = function () {
  3262. this._inTransition() || this.player.path.discardPathObject()
  3263. }, t.prototype.allFloors = function () {
  3264. this.model.toggleAllFloors()
  3265. }, t.prototype.actionComplete = function (e) {
  3266. if (this.interrupted = !1, this.transitionStage = v.None, this.resetSpecialTransition(), null !== this.destinationItem && this.setCurrentItem(this.destinationItem), this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()), this.emit("update.controls"), this.nextFunc) {
  3267. var t = this.nextFunc;
  3268. this.nextFunc = null, t()
  3269. }
  3270. }, t.prototype.awaitCompletion = function (e, t) {
  3271. this.nextFunc = t, e()
  3272. }, t.prototype.updateSuccessFunction = function (e) {
  3273. this.nextFunc = e
  3274. }, t.prototype.interrupt = function (e, t) {
  3275. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled), this.tourIsPlaying = !1, this.bgmReplay(), this.interrupted = !0, this.nextFunc = null, this.emit(u.ActionInterrupted), null != e || (e = p.BEGINNING), this.player.interruptAndFastForward(e, t), !0)
  3276. }, t.prototype.wouldInterrupt = function () {
  3277. return this.transitionStage !== v.None
  3278. }, t.prototype.intermediateState = function () {
  3279. return this.transitionStage !== v.None
  3280. }, t.prototype.isInterrupted = function () {
  3281. return this.interrupted
  3282. }, t.prototype.pauseWalkingSection = function () {
  3283. this.walkingSectionPaused = !0
  3284. }, t.prototype.clearWalkingSectionPaused = function () {
  3285. this.walkingSectionPaused = !1
  3286. }, t.prototype.autoTour = function () {
  3287. var i = Date.now();
  3288. this.model.auxDataPromise.then(function () {
  3289. i = Date.now() - i;
  3290. var e = r.warp.auto,
  3291. t = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  3292. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  3293. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  3294. done: function () {
  3295. this.playTour()
  3296. }.bind(this),
  3297. name: "_atr",
  3298. id: A
  3299. })
  3300. }.bind(this))
  3301. }, t.prototype.atDestinationPano = function () {
  3302. if (!this.player.currentPano || null === this.destinationItem) return !1;
  3303. var e = this.player.currentPano.id;
  3304. if (void 0 === e) return !1;
  3305. var t = this.model.heroLocations;
  3306. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  3307. }, t.prototype.redirectToItem = function (e, t) {
  3308. if (null != e)
  3309. if (this.wouldInterrupt())
  3310. if (this.player.mode !== s.TRANSITIONING) {
  3311. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  3312. var i = function () {
  3313. o.setTimeout(function () {
  3314. this.setDestinationItem(e), this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  3315. }.bind(this), 0)
  3316. }.bind(this);
  3317. this.interrupt(p.END, 0), this.updateSuccessFunction(i)
  3318. } else m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  3319. else m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  3320. else m.warn("Director.redirectToItem() -> Redirecting to null item.")
  3321. }, t.prototype.useSpecialTransition = function (e) {
  3322. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e), this.nextWarpStyle = c.BLACK
  3323. }, t.prototype.resetSpecialTransition = function () {
  3324. this.nextWarpStyle = this.defaultWarpStyle
  3325. }, t.prototype.arrivedAtDestination = function (e) {
  3326. if (this.player.flying || this.player.isWarping()) m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  3327. else {
  3328. this.transitionStage = v.Aiming;
  3329. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  3330. this.player.model.fadePanoMarkers(0), this.awaitCompletion(function () {
  3331. this.resetSpecialTransition(), e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  3332. }.bind(this), t)
  3333. }
  3334. }, t.prototype.goToDestination = function (e, t, i, n) {
  3335. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  3336. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  3337. if (r && 0 < r.music.length) {
  3338. var o = g_Prefix + r.music;
  3339. g_tourAudio.src = o, g_tourAudio.load(), g_tourAudio.crossOrigin = "anonymous", g_tourAudio.oncanplaythrough = function () {
  3340. g_tourAudio.play()
  3341. }
  3342. }
  3343. }
  3344. if (this.onTheBus = !0, this.emit("update.controls"), this.player.updateLastView(), n || !this.atDestinationPano())
  3345. if (this.player.flying || this.player.isWarping()) m.warn("Cannot go to new destination while player is flying or warping.");
  3346. else {
  3347. var a = this.model.getHeroDescriptorByIndex(this.destinationItem),
  3348. s = null,
  3349. l = null;
  3350. if (a.isPano()) {
  3351. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  3352. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)), s = this.arrivedAtDestination.bind(this, !0)
  3353. } else l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)), s = this.arrivedAtDestination.bind(this, !1);
  3354. this.transitionStage = v.Moving, this.model.fadePanoMarkers(0), this.awaitCompletion(function () {
  3355. l()
  3356. }.bind(this), s), this.emit("update.controls")
  3357. }
  3358. else this.arrivedAtDestination(!0)
  3359. }, t.prototype.tourInterlude = function () {
  3360. if (l.trackAlways("reach_highlight", {
  3361. reach_source: this.reachSource
  3362. }), this.model.fadePanoMarkers(0), this.emit("update.controls"), this.tourIsPlaying) return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1, this.stopTour(), this.emit(u.TourEnd), void(this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function () {
  3363. this.transitionStage = v.Interlude, this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  3364. }.bind(this), this.goNext.bind(this))
  3365. }, t.prototype.playTour = function () {
  3366. if (!this.bounceable()) return this.tourIsPlaying ? void m.info("tour is already playing") : void(this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle), this.tourInProgress = !0, this.reachSource = "play", this.tourIsPlaying = !0, this.wasZoomEnabled = this.player.zoomEnabled, this.player.zoomEnabled = !1, this.resetSpecialTransition(), this.emit("update.controls"), this.emit(u.TourStart), this.player.enablePreRendering(), this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : this.goNext()))
  3367. }, t.prototype.bgmReplay = function () {
  3368. g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused && (g_playAudio = g_bgAudio, window.tourAudio && window.tourAudio.pause(), g_bgAudio.play())
  3369. }, t.prototype.stopTour = function () {
  3370. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled), this.tourIsPlaying = !1, this.bgmReplay(), this.interrupt(), this.clearWalkingSectionPaused(), this.resetSpecialTransition(), this.emit("update.controls")), window.tourAudio && window.tourAudio.pause(), g_tourAudio && 0 == g_tourAudio.paused && (g_tourAudio.pause(), g_tourAudio.src = "")
  3371. }, t.prototype.endTourProgress = function () {
  3372. this.tourInProgress = !1, this.emit("update.controls"), this.emit(u.TourEnd)
  3373. }, t.prototype.goToHighlight = function (e) {
  3374. if (this.wouldInterrupt()) e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  3375. else {
  3376. if (m.debug("<tour.goto " + e + ">"), this.isInterrupted()) return;
  3377. this.clearWalkingSectionPaused(), this.setDestinationItem(e), this.useSpecialTransition("Hilight"), this.goToDestination(), l.trackAlways("reach_highlight", {
  3378. reach_source: "thumb"
  3379. })
  3380. }
  3381. }, t.prototype.prevHighlight = function () {
  3382. this.bounceable() || (this.player.emit("tour_manual", "prev"), this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), this.reachSource = "prev", this.goPrev()))
  3383. }, t.prototype.nextHighlight = function () {
  3384. this.bounceable() || (this.player.emit("tour_manual", "next"), this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), this.reachSource = "next", this.goNext()))
  3385. }, t.prototype.changeMode = function (e) {
  3386. var t = $.Deferred(),
  3387. i = t.resolve.bind(t),
  3388. n = t.reject.bind(t);
  3389. if (this.emit(u.StartModeChange), ! function () {
  3390. return this.clearWalkingSectionPaused(), !!this.wouldInterrupt() && (this.interrupt(), !0)
  3391. }.bind(this)()) {
  3392. switch (e) {
  3393. case s.PANORAMA:
  3394. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  3395. break;
  3396. case s.DOLLHOUSE:
  3397. case s.FLOORPLAN:
  3398. this.player.flyToNewMode({
  3399. mode: e
  3400. }).done(i).fail(n);
  3401. break;
  3402. case s.OUTDOOR:
  3403. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  3404. }
  3405. return t.promise()
  3406. }
  3407. }, t.prototype.atEndOfTour = function () {
  3408. return this.currentItem >= this.nItems - 1
  3409. }, t.prototype.firstDestination = function () {
  3410. return 0 < this.nItems ? 0 : null
  3411. }, t.prototype.finalDestination = function () {
  3412. return 0 < this.nItems ? this.nItems - 1 : null
  3413. }, t.prototype.goPrev = function () {
  3414. this.tourAdvance(-1)
  3415. }, t.prototype.goNext = function () {
  3416. this.tourAdvance(1)
  3417. }, t.prototype.setDestinationItem = function (e) {
  3418. this.destinationItem = e, this.emit("update.controls")
  3419. }, t.prototype.setCurrentItem = function (e) {
  3420. this.currentItem = e, this.emit("update.controls")
  3421. }, t.prototype.nextItem = function (e) {
  3422. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  3423. }, t.prototype.prevItem = function (e) {
  3424. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  3425. }, t.prototype.tourAdvance = function (e) {
  3426. if (m.debug("tourAdvance(" + e + ")"), null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e), this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()), this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()), this.useSpecialTransition("looping back to start")), "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  3427. var i = this.player.zoomLevel;
  3428. this.player.zoomEnabled = !0;
  3429. var t = function (e, t) {
  3430. this.player.zoomTo((1 - e) * i, !0)
  3431. }.bind(this);
  3432. o.start(t, 1500, function () {}, 0, h.easeOutQuad, "zoom")
  3433. }
  3434. this.goToDestination()
  3435. }, I.exports = t
  3436. }).call(this, "/js/director.js")
  3437. }, {
  3438. "./analytics": 4,
  3439. "./enum/BlackoutStyle": 18,
  3440. "./enum/ControlEvents": 21,
  3441. "./enum/DirectorEvents": 23,
  3442. "./enum/ModelManagerEvents": 33,
  3443. "./enum/PathDiscardMode": 38,
  3444. "./enum/PathDisplayMode": 39,
  3445. "./enum/PlayerEvents": 40,
  3446. "./enum/Viewmode": 51,
  3447. "./enum/WarpStyle": 52,
  3448. "./model/ModelManager": 140,
  3449. "./player": 155,
  3450. "./settings": 166,
  3451. "./util/logger": 189,
  3452. "./util/transitions": 195,
  3453. events: 202,
  3454. three: 217
  3455. }],
  3456. 16: [function (e, t, i) {
  3457. "use strict";
  3458. var n = e("three"),
  3459. r = e("./enum/Viewmode"),
  3460. o = (e("./settings"), e("./util/transitions")),
  3461. a = e("./enum/PlayerEvents"),
  3462. s = new n.ShaderPass(n.HorizontalBlurShader),
  3463. l = new n.ShaderPass(n.VerticalBlurShader);
  3464. l.renderToScreen = !0;
  3465. var c = $("#player").width() / $("#player").height();
  3466. isNaN(c) && (c = 1);
  3467. var h = {
  3468. currentBlur: 0,
  3469. aspect: c,
  3470. blurStrength: 1,
  3471. hblurPass: s,
  3472. vblurPass: l,
  3473. bindEvents: function (e) {
  3474. e.on(a.ModeChanged, function (e, t) {
  3475. e === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  3476. })
  3477. },
  3478. blur: function (e) {
  3479. var t = (h.currentBlur = e) * h.blurStrength;
  3480. l.uniforms.v.value = t / 512 * h.aspect, s.uniforms.h.value = t / 512
  3481. },
  3482. addBlur: function (e) {
  3483. e = Math.max(e, h.currentBlur), h.blur(e)
  3484. },
  3485. removeBlur: function (e) {
  3486. e = Math.min(1 - e, h.currentBlur), h.blur(e)
  3487. }
  3488. };
  3489. h.blur(0), t.exports = h
  3490. }, {
  3491. "./enum/PlayerEvents": 40,
  3492. "./enum/Viewmode": 51,
  3493. "./settings": 166,
  3494. "./util/transitions": 195,
  3495. three: 217
  3496. }],
  3497. 17: [function (e, t, i) {
  3498. "use strict";
  3499. t.exports = {
  3500. UNKNOWN: 0,
  3501. ALIGNED: 1,
  3502. UNALIGNED: 2,
  3503. PLACED: 3
  3504. }
  3505. }, {}],
  3506. 18: [function (e, t, i) {
  3507. "use strict";
  3508. t.exports = {
  3509. NONE: 0,
  3510. MIDDLE: 1,
  3511. END: 2,
  3512. BEGINNING: 3,
  3513. FADEIN: 4
  3514. }
  3515. }, {}],
  3516. 19: [function (e, t, i) {
  3517. "use strict";
  3518. var r = e("three");
  3519. t.exports = {
  3520. newBlue: new r.Color(4967932),
  3521. altBlue: new r.Color(47355),
  3522. tagDefault: new r.Color(223357),
  3523. classicBlue: new r.Color(53759),
  3524. mpYellow: new r.Color(16502016),
  3525. mpOrange: new r.Color(16428055),
  3526. mpBlue: new r.Color(12096),
  3527. mpLtGrey: new r.Color(13751252),
  3528. mpDkGrey: new r.Color(10000019),
  3529. mpRed: new r.Color(12525854),
  3530. mpOrangeDesat: new r.Color(16764529),
  3531. mpBlueDesat: new r.Color(4034734),
  3532. mpRedDesat: new r.Color(14705505),
  3533. white: new r.Color(16777215),
  3534. black: new r.Color(0),
  3535. _desat: function (e, t) {
  3536. var i = t || .3,
  3537. n = (new r.Color).copy(e).getHSL();
  3538. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  3539. },
  3540. _darken: function (e, t) {
  3541. var i = t || .2,
  3542. n = e.getHSL();
  3543. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  3544. }
  3545. }
  3546. }, {
  3547. three: 217
  3548. }],
  3549. 20: [function (e, t, i) {
  3550. "use strict";
  3551. t.exports = {
  3552. NONE: -1,
  3553. ROTATE: 0,
  3554. DOLLY: 1,
  3555. PAN: 2,
  3556. ROTATE_DOLLY: 3,
  3557. PAN_DOLLY: 4
  3558. }
  3559. }, {}],
  3560. 21: [function (e, t, i) {
  3561. "use strict";
  3562. t.exports = {
  3563. Move: "move",
  3564. InteractionDirect: "interaction.direct",
  3565. InteractionKey: "interaction.key",
  3566. InteractionGui: "interaction.gui",
  3567. FlyInDirection: "fly.direction",
  3568. InputStart: "input.start",
  3569. Pinch: "input.pinch",
  3570. Scroll: "input.scroll",
  3571. AutoPanInterrupt: "autopan.interrupt",
  3572. AutoPanComplete: "autopan.complete",
  3573. AutoPanClamped: "autopan.clamped",
  3574. LongTap: "longtap"
  3575. }
  3576. }, {}],
  3577. 22: [function (e, t, i) {
  3578. "use strict";
  3579. t.exports = Object.freeze({
  3580. FORWARD: "FORWARD",
  3581. LEFT: "LEFT",
  3582. RIGHT: "RIGHT",
  3583. BACK: "BACK",
  3584. UP: "UP",
  3585. DOWN: "DOWN"
  3586. })
  3587. }, {}],
  3588. 23: [function (e, t, i) {
  3589. "use strict";
  3590. t.exports = {
  3591. ActionInterrupted: "action.interrupted",
  3592. TourStart: "tour.start",
  3593. TourEnd: "tour.end",
  3594. StartModeChange: "mode.startChange"
  3595. }
  3596. }, {}],
  3597. 24: [function (e, t, i) {
  3598. "use strict";
  3599. t.exports = Object.freeze({
  3600. None: 0,
  3601. Queued: 1,
  3602. ForceQueued: 2,
  3603. Downloading: 3,
  3604. Downloaded: 4,
  3605. DownloadFailed: 5
  3606. })
  3607. }, {}],
  3608. 25: [function (e, t, i) {
  3609. "use strict";
  3610. t.exports = {
  3611. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  3612. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  3613. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  3614. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  3615. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  3616. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  3617. }
  3618. }, {}],
  3619. 26: [function (e, t, i) {
  3620. "use strict";
  3621. t.exports = {
  3622. Texture2D: 0,
  3623. TextureCube: 1
  3624. }
  3625. }, {}],
  3626. 27: [function (e, t, i) {
  3627. "use strict";
  3628. t.exports = {
  3629. SMALL: "small",
  3630. LARGE: "large"
  3631. }
  3632. }, {}],
  3633. 28: [function (e, t, i) {
  3634. "use strict";
  3635. var n = e("./Viewmode"),
  3636. r = {
  3637. LANDING: {},
  3638. NAVIGATION: "navigation",
  3639. MORE_HELP: "moreHelp",
  3640. TOUR_INTERACTION: {}
  3641. };
  3642. r.LANDING[n.PANORAMA] = "panorama.landing", r.LANDING[n.OUTDOOR] = "outdoor.landing", r.LANDING[n.DOLLHOUSE] = "dollhouse.landing", r.LANDING[n.FLOORPLAN] = "floorplan.landing", r.TOUR_INTERACTION.standard = "standard.tour", r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour", r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour", t.exports = r
  3643. }, {
  3644. "./Viewmode": 51
  3645. }],
  3646. 29: [function (e, t, i) {
  3647. "use strict";
  3648. var n = {
  3649. UP: 1,
  3650. DOWN: -1,
  3651. LEFT: "L",
  3652. RIGHT: "R",
  3653. FORWARD: "F",
  3654. BACK: "B",
  3655. reverse: {},
  3656. opposite: function (e) {
  3657. return this.reverse[e.toString()]
  3658. }
  3659. };
  3660. n.reverse[n.UP] = n.DOWN, n.reverse[n.DOWN] = n.UP, n.reverse[n.LEFT] = n.RIGHT, n.reverse[n.RIGHT] = n.LEFT, n.reverse[n.FORWARD] = n.BACK, n.reverse[n.BACK] = n.FORWARD, t.exports = n
  3661. }, {}],
  3662. 30: [function (e, t, i) {
  3663. "use strict";
  3664. var n = {
  3665. ZERO: 48,
  3666. ONE: 49,
  3667. TWO: 50,
  3668. THREE: 51,
  3669. FOUR: 52,
  3670. FIVE: 53,
  3671. SIX: 54,
  3672. SEVEN: 55,
  3673. EIGHT: 56,
  3674. NINE: 57,
  3675. LEFTARROW: 37,
  3676. UPARROW: 38,
  3677. RIGHTARROW: 39,
  3678. DOWNARROW: 40,
  3679. A: 65,
  3680. B: 66,
  3681. C: 67,
  3682. D: 68,
  3683. E: 69,
  3684. F: 70,
  3685. G: 71,
  3686. H: 72,
  3687. I: 73,
  3688. J: 74,
  3689. K: 75,
  3690. L: 76,
  3691. M: 77,
  3692. N: 78,
  3693. O: 79,
  3694. P: 80,
  3695. Q: 81,
  3696. R: 82,
  3697. S: 83,
  3698. T: 84,
  3699. U: 85,
  3700. V: 86,
  3701. W: 87,
  3702. X: 88,
  3703. Y: 89,
  3704. Z: 90,
  3705. SPACE: 32,
  3706. RETURN: 13,
  3707. SEMICOLON: 186,
  3708. PLUSEQUALS: 187,
  3709. DASHUNDERSCORE: 189,
  3710. OPENBRACKET: 219
  3711. };
  3712. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59, n.PLUSEQUALS = 61, n.DASHUNDERSCORE = 173), t.exports = n
  3713. }, {
  3714. "../util/browser": 182
  3715. }],
  3716. 31: [function (e, t, i) {
  3717. "use strict";
  3718. t.exports = {
  3719. EN_US: "en-US",
  3720. ES_MX: "es-MX",
  3721. FR_FR: "fr-FR",
  3722. DE_DE: "de-DE",
  3723. RU_RU: "ru-RU",
  3724. CN_CN: "cn-CN",
  3725. JP_JP: "jp-JP"
  3726. }
  3727. }, {}],
  3728. 32: [function (e, t, i) {
  3729. "use strict";
  3730. t.exports = {
  3731. TagActivated: "tag.activated",
  3732. TagDismissed: "tag.dismissed",
  3733. TagNavigation: "tag.navigation"
  3734. }
  3735. }, {}],
  3736. 33: [function (e, t, i) {
  3737. "use strict";
  3738. t.exports = {
  3739. ModelAdded: "model-added",
  3740. ActiveModelChanged: "active-model-changed"
  3741. }
  3742. }, {}],
  3743. 34: [function (e, t, i) {
  3744. "use strict";
  3745. t.exports = {
  3746. LEFT: 0,
  3747. MIDDLE: 1,
  3748. RIGHT: 2
  3749. }
  3750. }, {}],
  3751. 35: [function (e, t, i) {
  3752. "use strict";
  3753. t.exports = {
  3754. PanoRenderComplete: "panorama.render.complete",
  3755. TileRenderFailure: "panorama.tile.render.failed",
  3756. TileRenderSuccess: "panorama.tile.render.success",
  3757. TileUploadAttempted: "panorama.tile.upload.attempted",
  3758. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  3759. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  3760. }
  3761. }, {}],
  3762. 36: [function (e, t, i) {
  3763. "use strict";
  3764. t.exports = {
  3765. BASE: 1,
  3766. STANDARD: 2,
  3767. HIGH: 3,
  3768. ULTRAHIGH: 4
  3769. }
  3770. }, {}],
  3771. 37: [function (e, t, i) {
  3772. "use strict";
  3773. t.exports = {
  3774. LoadComplete: "panorama.load.complete",
  3775. LoadFailed: "panorama.load.failed",
  3776. TileLoaded: "panorama.tile.loaded"
  3777. }
  3778. }, {}],
  3779. 38: [function (e, t, i) {
  3780. "use strict";
  3781. t.exports = Object.freeze({
  3782. Standard: 0,
  3783. Slow: 1,
  3784. Retain: 2
  3785. })
  3786. }, {}],
  3787. 39: [function (e, t, i) {
  3788. "use strict";
  3789. t.exports = Object.freeze({
  3790. Show: 0,
  3791. Hide: 1,
  3792. Retain: 2
  3793. })
  3794. }, {}],
  3795. 40: [function (e, t, i) {
  3796. "use strict";
  3797. t.exports = {
  3798. Move: "move",
  3799. MoveComplete: "move.complete",
  3800. ModeChanged: "mode.changed",
  3801. ModeChanging: "mode.changing",
  3802. PanoChosen: "pano.chosen",
  3803. ClosestPanoChanging: "closest.pano.changing",
  3804. WarpStarted: "warp.started",
  3805. WarpInterrupted: "warp.interrupted",
  3806. WarpEnded: "warp.ended",
  3807. FlyinFinished: "flyin.finished",
  3808. FlyingStarted: "flying.started",
  3809. FlyingInterrupted: "flying.interrupted",
  3810. FlyingEnded: "flying.ended",
  3811. Ready: "ready",
  3812. StartInside: "start.inside",
  3813. StartOutside: "start.outside",
  3814. ViewChanged: "view.changed",
  3815. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  3816. InputStart: "input.start"
  3817. }
  3818. }, {}],
  3819. 41: [function (e, t, i) {
  3820. "use strict";
  3821. t.exports = Object.freeze({
  3822. DEFAULT: 0,
  3823. PANOMARKERS: 1,
  3824. RETICULE: 2,
  3825. TAG: 3
  3826. })
  3827. }, {}],
  3828. 42: [function (e, t, i) {
  3829. "use strict";
  3830. t.exports = {
  3831. visibleFloor: 1,
  3832. ghostFloor: 3,
  3833. boundingSkybox: 1,
  3834. panoMarker: 2,
  3835. reticule: 3,
  3836. tagStem: 4,
  3837. tagDisc: 5,
  3838. ribbon: 100
  3839. }
  3840. }, {}],
  3841. 43: [function (e, t, i) {
  3842. "use strict";
  3843. t.exports = {
  3844. ContextCreated: "scene-renderer-context-created",
  3845. AfterRender: "after-render",
  3846. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  3847. }
  3848. }, {}],
  3849. 44: [function (e, t, i) {
  3850. "use strict";
  3851. t.exports = {
  3852. IDLE: "idle",
  3853. BROWSE: "browse",
  3854. EXAMINE: "examine"
  3855. }
  3856. }, {}],
  3857. 45: [function (e, t, i) {
  3858. "use strict";
  3859. t.exports = {
  3860. TileDownloadSuccess: "tiledownloader.download.success",
  3861. TileDownloadFailure: "tiledownloader.download.failure",
  3862. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  3863. }
  3864. }, {}],
  3865. 46: [function (e, t, i) {
  3866. "use strict";
  3867. t.exports = {
  3868. CardboardAndroid: "googlevr",
  3869. GearVR: "gearvr",
  3870. CardboardIOS: "googlevrios",
  3871. Cardboard: "googlevr"
  3872. }
  3873. }, {}],
  3874. 47: [function (e, t, i) {
  3875. "use strict";
  3876. t.exports = {
  3877. NONE: 0,
  3878. CONTEXTUAL: 1,
  3879. ANDROID: 2
  3880. }
  3881. }, {}],
  3882. 48: [function (e, t, i) {
  3883. "use strict";
  3884. var n = {
  3885. Title: 0,
  3886. Cardboard: 1
  3887. },
  3888. r = {
  3889. Title: 0,
  3890. Cardboard: 1,
  3891. Gear: 2
  3892. };
  3893. [n, r].forEach(function (e) {
  3894. e.pageCount = Object.keys(e).length
  3895. }), t.exports.ios = n, t.exports.standard = r
  3896. }, {}],
  3897. 49: [function (e, t, i) {
  3898. "use strict";
  3899. t.exports = {
  3900. Android: "android",
  3901. IOS: "ios",
  3902. Desktop: "desktop",
  3903. UnsupportedAndroid: "android-unsupported"
  3904. }
  3905. }, {}],
  3906. 50: [function (e, t, i) {
  3907. "use strict";
  3908. var n = e("three");
  3909. t.exports = {
  3910. UP: new n.Vector3(0, 1, 0),
  3911. DOWN: new n.Vector3(0, -1, 0),
  3912. LEFT: new n.Vector3(-1, 0, 0),
  3913. RIGHT: new n.Vector3(1, 0, 0),
  3914. FORWARD: new n.Vector3(0, 0, -1),
  3915. BACK: new n.Vector3(0, 0, 1)
  3916. }
  3917. }, {
  3918. three: 217
  3919. }],
  3920. 51: [function (e, t, i) {
  3921. "use strict";
  3922. var n = e("../exception/ViewmodeConvertException"),
  3923. r = e("./coreViewmodes"),
  3924. o = {
  3925. MESH: "mesh",
  3926. OUTDOOR: "outdoor",
  3927. TRANSITIONING: "transitioning",
  3928. toInt: function (e) {
  3929. switch (e) {
  3930. case this.PANORAMA:
  3931. return 1;
  3932. case this.DOLLHOUSE:
  3933. return 2;
  3934. case this.FLOORPLAN:
  3935. return 3;
  3936. case this.OUTDOOR:
  3937. return 4;
  3938. case this.TRANSITIONING:
  3939. return -1
  3940. }
  3941. throw new n("No known conversion for Viewmode to int for mode: " + e)
  3942. },
  3943. fromInt: function (e) {
  3944. switch (e) {
  3945. case "1":
  3946. case 1:
  3947. return this.PANORAMA;
  3948. case "2":
  3949. case 2:
  3950. return this.DOLLHOUSE;
  3951. case "3":
  3952. case 3:
  3953. return this.FLOORPLAN;
  3954. case "4":
  3955. case 4:
  3956. return this.OUTDOOR
  3957. }
  3958. throw new n("No known conversion for int to viewmode for int: " + e)
  3959. },
  3960. convertWorkshopModeInt: function (e) {
  3961. switch (e) {
  3962. case "0":
  3963. case 0:
  3964. case void 0:
  3965. return this.PANORAMA;
  3966. case "1":
  3967. case 1:
  3968. return this.FLOORPLAN;
  3969. case "2":
  3970. case 2:
  3971. return this.DOLLHOUSE;
  3972. case "3":
  3973. case 3:
  3974. return this.MESH
  3975. }
  3976. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  3977. }
  3978. };
  3979. e("../util/common").extendObject(o, r), t.exports = o
  3980. }, {
  3981. "../exception/ViewmodeConvertException": 58,
  3982. "../util/common": 185,
  3983. "./coreViewmodes": 54
  3984. }],
  3985. 52: [function (e, t, i) {
  3986. "use strict";
  3987. t.exports = {
  3988. BLACK: "black",
  3989. STD: "std",
  3990. WALK: "walk"
  3991. }
  3992. }, {}],
  3993. 53: [function (e, t, i) {
  3994. "use strict";
  3995. t.exports = {
  3996. ZoomIn: "zoom.in",
  3997. ZoomOut: "zoom.out",
  3998. ZoomMax: "zoom.max",
  3999. ZoomMin: "zoom.min"
  4000. }
  4001. }, {}],
  4002. 54: [function (e, t, i) {
  4003. "use strict";
  4004. t.exports = {
  4005. PANORAMA: "panorama",
  4006. DOLLHOUSE: "dollhouse",
  4007. FLOORPLAN: "floorplan"
  4008. }
  4009. }, {}],
  4010. 55: [function (e, t, i) {
  4011. "use strict";
  4012. t.exports = function (e) {
  4013. this.message = e
  4014. }
  4015. }, {}],
  4016. 56: [function (e, t, i) {
  4017. "use strict";
  4018. function n(e) {
  4019. r.call(this, e)
  4020. }
  4021. var r = e("./BasicException");
  4022. n.prototype = Object.create(r.prototype), t.exports = n
  4023. }, {
  4024. "./BasicException": 55
  4025. }],
  4026. 57: [function (e, t, i) {
  4027. "use strict";
  4028. function n(e) {
  4029. r.call(this, e)
  4030. }
  4031. var r = e("./BasicException");
  4032. n.prototype = Object.create(r.prototype), t.exports = n
  4033. }, {
  4034. "./BasicException": 55
  4035. }],
  4036. 58: [function (e, t, i) {
  4037. "use strict";
  4038. function n(e) {
  4039. r.call(this, e)
  4040. }
  4041. var r = e("./BasicException");
  4042. n.prototype = Object.create(r.prototype), t.exports = n
  4043. }, {
  4044. "./BasicException": 55
  4045. }],
  4046. 59: [function (a, s, e) {
  4047. (function (e) {
  4048. "use strict";
  4049. var i = a("./util/ajax"),
  4050. n = a("./util/showcase"),
  4051. t = a("./util/logger"),
  4052. r = new t(e),
  4053. o = {};
  4054. s.exports = {
  4055. loadFeatureFlags: function (e) {
  4056. var t = $.Deferred();
  4057. return i.get(e.urlBase + "", {
  4058. responseType: "json",
  4059. prefetchFrom: "user",
  4060. auth: n.getAuthorizationHeader()
  4061. }).done(function (e) {
  4062. (o = function (e) {
  4063. var t = {};
  4064. if (e) {
  4065. var i = e.flags;
  4066. if (i)
  4067. for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0);
  4068. return t
  4069. }
  4070. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."), null
  4071. }(e)) ? t.resolve(o): t.reject("loading-failed")
  4072. }).fail(function () {
  4073. r.debug("Retrieval of feature flags failed."), t.reject("loading-failed")
  4074. }), t.promise()
  4075. },
  4076. getFlags: function () {
  4077. return o
  4078. },
  4079. updateDependentSettings: function (e, t) {
  4080. (e = e || o).labels && (t.labels.enabled = !0), e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0), e.showcase_sdk && (t.sdkInit = !0), e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0), e.showcase_webvr && (t.vr.allowWebVR = !0), e.uhql && (t.tiling.allowUltraHighResolution = !0), e.hide_sc_sharing && (t.share.enabled = !1)
  4081. }
  4082. }
  4083. }).call(this, "/js/featureflags.js")
  4084. }, {
  4085. "./util/ajax": 181,
  4086. "./util/logger": 189,
  4087. "./util/showcase": 193
  4088. }],
  4089. 60: [function (e, t, i) {
  4090. "use strict";
  4091. var n = (e("../util/common"), {
  4092. status: 0,
  4093. set: function (e) {
  4094. if (isNaN(e)) return !1;
  4095. var t = $(".progressbar");
  4096. e < 0 && (e = 0), 100 < e && (e = 100);
  4097. var i = e * (parseInt(t.css("width").replace("px", "")) / 100),
  4098. n = Math.round(e),
  4099. r = parseInt(i) - 15;
  4100. t.find(".bar").css("width", i), t.find(".label").css("left", r), t.find(".perc").text(n + "%"), this.status = e
  4101. },
  4102. done: function (e) {
  4103. return e || this.status ? (this.status = null, this.set(100)) : this
  4104. }
  4105. });
  4106. t.exports.circleLoader = n
  4107. }, {
  4108. "../util/common": 185
  4109. }],
  4110. 61: [function (e, t, i) {
  4111. "use strict";
  4112. t.exports = Object.freeze({
  4113. CLOSE: "modal.closer.close"
  4114. })
  4115. }, {}],
  4116. 62: [function (e, t, i) {
  4117. "use strict";
  4118. function n(t, e) {
  4119. function i() {
  4120. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  4121. e !== p && ((p = e) ? (t.classList.add("closeByFooter"), c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"), c.classList.remove("closeByFooter")))
  4122. }
  4123. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  4124. }
  4125. var r = e("../../settings"),
  4126. o = (e("../../tag/Media/MediaEvent"), e("../../util/browser")),
  4127. a = e("../../util/common"),
  4128. s = e("./ModalCloserEvent"),
  4129. l = e("events").EventEmitter,
  4130. c = document.getElementsByClassName("footer")[0],
  4131. h = c.querySelectorAll(".close")[0],
  4132. u = null,
  4133. d = null,
  4134. p = null,
  4135. f = (o.isMobile(), {
  4136. open: function (e) {
  4137. e && (n(e), u && h.removeEventListener("click", u, !0), u = function (e, t) {
  4138. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(s.CLOSE, e), f.reset()
  4139. }.bind(this, e.id), h.addEventListener("click", u, !0), d && window.removeEventListener("resize", d, !0), d = n.bind(this, e), window.addEventListener("resize", d, !0))
  4140. },
  4141. reset: function () {
  4142. c.classList.remove("closeByFooter"), h.removeEventListener("click", u, !0), window.removeEventListener("resize", d, !0), u = d = p = null
  4143. }
  4144. });
  4145. a.extendObject(f, l.prototype), t.exports = f
  4146. }, {
  4147. "../../tag/Media/MediaEvent": 131,
  4148. "../../settings": 166,
  4149. "../../util/browser": 182,
  4150. "../../util/common": 185,
  4151. "./ModalCloserEvent": 61,
  4152. events: 202
  4153. }],
  4154. 63: [function (e, t, i) {
  4155. "use strict";
  4156. var A = e("../lib/dat.gui"),
  4157. C = e("three"),
  4158. I = e("../util/easing"),
  4159. E = e("../enum/Viewmode"),
  4160. _ = e("../enum/Colors"),
  4161. b = e("../enum/WarpStyle"),
  4162. w = e("../settings");
  4163. e("../tag/tag"), A.GUI.prototype.removeFolder = function (e) {
  4164. var t = this.__folders[e];
  4165. t && (t.close(), this.__ul.removeChild(t.domElement.parentNode), delete this.__folders[e], this.onResize())
  4166. }, t.exports.toggle = function (t, e, i) {
  4167. var n = new A.GUI({
  4168. width: 400
  4169. }),
  4170. r = n.addFolder("Flydown from Dollhouse");
  4171. r.add(w.flydown, "movementEasing", Object.keys(I)), r.add(w.flydown, "movementDelay", 0, 1).step(.01), r.add(w.flydown, "rotationEasing", Object.keys(I)), r.add(w.flydown, "rotationDelay", 0, 1).step(.01), r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01), r.add(w.flydown, "skyboxDelay", 0, 1).step(.01), r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)), r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  4172. var o = n.addFolder("Transition between panos");
  4173. o.add(w.transition, "blur", 0, 10).onFinishChange(function () {}), o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function () {
  4174. w.transition.flyTime = 0, o.__controllers.forEach(function (e) {
  4175. e.updateDisplay()
  4176. })
  4177. }), o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function () {
  4178. w.transition.flySpeed = 0, o.__controllers.forEach(function (e) {
  4179. e.updateDisplay()
  4180. })
  4181. }), o.add(w.transition, "aimTime", 500, 2500).step(50), o.add(w.transition, "aimSlowFactor", 1, 3).step(.1), o.add(w.transition, "movementEasing", Object.keys(I));
  4182. var a = n.addFolder("Path Display");
  4183. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function () {}), a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function () {}), a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function () {}), a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function () {}), a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function () {}), a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function () {}), a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function () {}), a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function () {}), a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function () {}), a.add(w.path, "color", Object.keys(_)).onFinishChange(function () {
  4184. w.path.color = _[w.path.color], w.path.colorUp = _._desat(w.path.color), w.path.colorDown = _.darken(w.path.color)
  4185. }), a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function () {
  4186. w.reticuleColor = _[w.reticuleColor]
  4187. });
  4188. var s = n.addFolder("Warping"),
  4189. l = s.addFolder("Warp/Teleport");
  4190. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function () {}), l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function () {}), l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function () {}), l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function () {}), l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function () {}), l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function () {}), l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function () {}), l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function () {}), l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function () {}), l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function () {}), l.add(w.path, "mapGuides").onFinishChange(function () {}), l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function () {}), l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function () {}), l.add(w.path, "typ", Object.keys(b)).onFinishChange(function () {
  4191. w.path.typ = b[w.path.typ]
  4192. }), l.add(w.warp, "loop").onChange(function () {}).onFinishChange(function () {
  4193. e.endlessLoop = w.warp.loop
  4194. }), l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function () {}), l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function () {}), l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function () {});
  4195. var c = s.addFolder("Long Warp Only");
  4196. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function () {
  4197. w.warp.flySpeed = 0, c.__controllers.forEach(function (e) {
  4198. e.updateDisplay()
  4199. })
  4200. }), c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function () {}), c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function () {}), c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function () {}), c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function () {}), c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function () {}), c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function () {}), c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function () {}), c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function () {}), c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function () {});
  4201. var h = n.addFolder("Warp Esoterica");
  4202. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function () {}), h.add(w.warp, "blur", .01, 1).onFinishChange(function () {}), h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function () {
  4203. w.warp.minWarpTime = 0, h.__controllers.forEach(function (e) {
  4204. e.updateDisplay()
  4205. })
  4206. }), h.add(w.warp, "showBunny").onFinishChange(function () {}), h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function () {}), h.add(w.warp, "movementEasing", Object.keys(I));
  4207. var u = n.addFolder("Misc");
  4208. u.add(w, "dollhouseFOV", 10, 180).onChange(function () {
  4209. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  4210. }), u.add(w, "insideFOV", 10, 180).onChange(function () {
  4211. i.cameras[E.PANORAMA].fov = w.insideFOV
  4212. }), u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function () {}), u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function () {}), u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function () {});
  4213. var d = n.addFolder("Navigation");
  4214. d.add(w.navigation, "panoScores").onFinishChange(function () {
  4215. w.navigation.panoScores || t.panos.forEach(function (e) {
  4216. e.floor.remove(e.text3d), e.text3d = null
  4217. })
  4218. }), d.add(w.navigation, "mouseDirection"), d.add(w.navigation, "filterStrictness", 0, 1), d.add(w.navigation, "angleFactor", -60, 0), d.add(w.navigation, "directionFactor", 1, 20), d.add(w.navigation, "distanceFactor", -5, 5), d.add(w.navigation, "optionalityFactor", .1, 10);
  4219. var p = n.addFolder("tags"),
  4220. f = p.addFolder("Tag Creation");
  4221. f.add(w.tags.pole, "enabled").name("poleEnabled"), f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"), f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"), f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  4222. var g = p.addFolder("Visibility");
  4223. g.add(w.tags.visibility, "anyDistance"), g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1), g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01), g.add(w.tags.visibility, "hideViaFloor"), g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"), g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  4224. var m = p.addFolder("Disc Parameters");
  4225. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1), m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(), m.add(w.tags.disc.scale, "linkFarBound").onChange(function (e) {
  4226. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  4227. }), m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function (e) {
  4228. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  4229. }), m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1), m.add(w.tags.disc.scale, "minSize", 20, 100).step(1), m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  4230. var v = p.addFolder("Navigate");
  4231. v.add(w.tags.navigate, "nearestPano").name("nearestPano"), v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"), v.add(w.tags.navigate, "reactivate").name("reactivate"), v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"), v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1), v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  4232. var y = n.addFolder("Debug");
  4233. y.add(w, "wireframe").onFinishChange(function () {
  4234. t.chunks.forEach(function (e) {
  4235. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e), e.wireframeTwin.material.depthWrite = !1, e.wireframeTwin.material.depthTest = !1, e.wireframeTwin.material.opacity = .5, e.wireframeTwin.material.transparent = !0), w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  4236. })
  4237. }), y.add(w, "skyboxWireframe").onFinishChange(function () {
  4238. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox), t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe), t.skybox.wireframe = null)
  4239. }), y.add(w, "showSweeps").onFinishChange(function () {
  4240. t.setSweepVisibility(w.showSweeps)
  4241. }), y.add(w, "showMesh").onFinishChange(function () {
  4242. t.chunks.forEach(function (e) {
  4243. e.visible = w.showMesh
  4244. })
  4245. }), y.add(w, "showFloors").onFinishChange(function () {
  4246. t.floors.forEach(function (e) {
  4247. e.collider.children.forEach(function (e) {
  4248. e.material.visible = w.showFloors
  4249. })
  4250. })
  4251. }), y.add(w, "showSkyboxes").onFinishChange(function () {
  4252. t.panos.forEach(function (e) {
  4253. e.skyboxMesh.visible = w.showSkyboxes
  4254. })
  4255. }), y.add(w, "showNeighbors").onChange(function () {}), y.add(t, "alpha", 0, 1)
  4256. }
  4257. }, {
  4258. "../enum/Colors": 19,
  4259. "../enum/Viewmode": 51,
  4260. "../enum/WarpStyle": 52,
  4261. "../lib/dat.gui": 93,
  4262. "../tag/tag": 123,
  4263. "../settings": 166,
  4264. "../util/easing": 186,
  4265. three: 217
  4266. }],
  4267. 64: [function (c, h, e) {
  4268. (function (e) {
  4269. "use strict";
  4270. function i(e, t, i, n) {
  4271. $(".gui-error .error-problem-text").text(e), $(".gui-error .error-solution-text").text(t), $(".gui-error .error-explanation").text(i), $(".gui-error .error-actions").html(n), $(window).resize(), $(".gui-error").fadeIn(), $("#bottom-logo").fadeIn()
  4272. }
  4273. function n(e) {
  4274. 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("");
  4275. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t), r.isMobile() || $("[rel=tiletip]").tooltip({
  4276. placement: "bottom",
  4277. delay: {
  4278. show: 50,
  4279. hide: 0
  4280. },
  4281. trigger: "hover",
  4282. viewport: {
  4283. selector: "body",
  4284. padding: 10
  4285. }
  4286. })
  4287. }
  4288. function t() {
  4289. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3,
  4290. t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  4291. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t), r.isMobile() || $(".install-browser").on("click touchstart", function (e) {
  4292. e.preventDefault(), e.stopPropagation(), n(" ")
  4293. })
  4294. }
  4295. var r = c("./../util/browser"),
  4296. o = c("./../analytics"),
  4297. a = c("./../settings"),
  4298. s = c("../localization/localize"),
  4299. l = new(c("./../util/logger"))(e);
  4300. h.exports.error = function (e) {
  4301. if ($("head title").text(a.pageTitle), $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(), $("#gui-loading").fadeOut(250), $("#quick-blackout").hide(), o.track("showcase_error", {
  4302. error_key: e
  4303. }), s.locale || s.init(), "webgl-unsupported" === e) r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  4304. else if ("webgl-ios" === e) i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  4305. else if ("webgl-safari" === e) i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  4306. else if ("webgl-generic" === e) t();
  4307. else if ("missing-urls" === e) i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  4308. else if ("loading-failed" === e) i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  4309. else {
  4310. if ("loading-failed-maintenance" !== e) return void l.error("Unhandled error: " + e);
  4311. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  4312. }
  4313. }
  4314. }).call(this, "/js/gui/error.js")
  4315. }, {
  4316. "../localization/localize": 108,
  4317. "./../analytics": 4,
  4318. "./../settings": 166,
  4319. "./../util/browser": 182,
  4320. "./../util/logger": 189
  4321. }],
  4322. 65: [function (Oe, Le, e) {
  4323. (function (e) {
  4324. "use strict";
  4325. function c() {
  4326. for (var e in Ce)
  4327. if (Ce.hasOwnProperty(e)) {
  4328. var t = Ce[e];
  4329. if (!t.visible)
  4330. for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
  4331. } Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"), !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"), ge = [], Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"), ge.push(".hideTarget", ".pinTop.right")
  4332. }
  4333. function v(e, t) {
  4334. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  4335. $("#gui-zoomin").toggle(i), $("#gui-zoomout").toggle(i)
  4336. }
  4337. function l() {
  4338. n(), $(".pinBottom").toggleClass("open"), $("#drawer").toggleClass("open"), $(".footer").toggleClass("open"), $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS), _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS), O.resetDrawer()), setTimeout(function () {
  4339. $("#pullTab").toggleClass("opened")
  4340. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration), $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  4341. }
  4342. function t(e) {
  4343. var t;
  4344. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"), t = e.position().top + e.outerHeight(), e.attr("style", "display: none")), $("#player").outerHeight() - 130 < t + 25
  4345. }
  4346. function y(e) {
  4347. "touchstart" === e.type && e.preventDefault(), e.stopPropagation()
  4348. }
  4349. function n() {
  4350. w && (w.reload(), w.init())
  4351. }
  4352. function r() {
  4353. $("#gui-spinner").stop(!0, !0), $("#gui-spinner").fadeOut(1e3), !(Ae = !0)
  4354. }
  4355. function A(e, t) {
  4356. var i = e.mode,
  4357. n = t || e.currentPano;
  4358. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE), $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN), $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA), i === ie.PANORAMA ? ($("#view-controllers").slideUp(500), M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"), $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"), $("#gui-modes-outside").removeClass("desktop-only")), $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(), pe = i, $("#gui-modes-outside").addClass("hidden"), e.model.has360Views && $(".gui-floor").removeClass("hidden"), $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  4359. }
  4360. function C(t, i) {
  4361. function e() {
  4362. document.getElementById("vr").classList.remove("hidden"), M.vr.allowWebVR ? S.getVRDisplay().then(function (e) {
  4363. S.supportsFullscreen() ? function (e) {
  4364. ue.info(e.displayName + " detected, VR button activates WebVR experience"), Q.init(t.data, i, e, x), Q.on(J.OPENED, _e.bind(gui, "vr")), Q.on(J.SHOW_TERMS, W.show.bind(W))
  4365. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"), $(".improper-embed").toggleClass("hidden", !1), n())
  4366. }, function (e) {
  4367. n()
  4368. }) : n()
  4369. }
  4370. function n() {
  4371. var e;
  4372. ue.info("WebVR support not found, VR button activates native app VR modal"), X.init(t.data, x), X.on(Z.OPENED, (e = document.getElementById("vr-modal"), function () {
  4373. _e("vr"), V.open(e)
  4374. })), X.on(Z.CLOSED, V.reset)
  4375. }
  4376. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0)) switch (M.vr.option) {
  4377. case le.CONTEXTUAL:
  4378. e();
  4379. break;
  4380. case le.ANDROID:
  4381. S.detectAndroid() && e();
  4382. break;
  4383. case le.NONE:
  4384. }
  4385. }
  4386. function h(e, i) {
  4387. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  4388. if ("372" !== getQueryVariable("m")) {
  4389. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  4390. $(".gui-floor").find(".container").prepend(r)
  4391. } n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"), n.on("click", function (e) {
  4392. y(e), _e("floor"), n.toggleClass("open")
  4393. }), $(".floorChoice").on("click", function (e) {
  4394. y(e);
  4395. var t = $(this).data("index");
  4396. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"), i.player.gotoFloor(t), R.track("showcase_gui", {
  4397. gui_action: "click_floor_select_button",
  4398. interaction_source: "gui"
  4399. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"), _e("move"), i.allFloors(), R.track("showcase_gui", {
  4400. gui_action: "click_toggle_all_floors_button",
  4401. interaction_source: "gui"
  4402. })), n.removeClass("open")
  4403. })
  4404. }
  4405. function I(e, t) {
  4406. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(), $(".gui-floor-icon").hide(), $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(), $(".gui-floor-icon").show(), $(".gui-floor-title").hide()), e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL), $(".gui-floor-number").text(se.FLOOR_ALL), $(".floorChoice").removeClass("active"), $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name), $(".gui-floor-number").text(" " + (e.floorIndex + 1)), $(".floorChoice").removeClass("active"), $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  4407. }
  4408. function E() {
  4409. var e = $("#player").width() - 20,
  4410. t = $("#scroller"),
  4411. i = $("#drawer"),
  4412. n = $(".pinBottom");
  4413. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"), i.addClass("noScroll"), n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"), i.toggleClass("noScroll"), n.toggleClass("noScroll"))
  4414. }
  4415. function _(e) {
  4416. e.waitQueue.length <= 0 ? r() : ye || function (e) {
  4417. e = e || 0, Ae = !1, window.setTimeout(function () {
  4418. Ae || (!0, $("#gui-spinner").stop(!0, !0).show())
  4419. }.bind(this), e)
  4420. }(M.modelComponentLoadSpinnerDelay)
  4421. }
  4422. function b(e, t) {
  4423. for (var i = []; e;) i.push(e), e = e.parentNode;
  4424. for (; t && -1 === i.indexOf(t);) t = t.parentNode;
  4425. return t
  4426. }
  4427. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"), Oe("../util/ajax"), Oe("../util/browser")),
  4428. M = Oe("../settings"),
  4429. R = Oe("../analytics"),
  4430. m = (Oe("../util/transitions"), Oe("../util/camera"), Oe("../util/logger")),
  4431. P = (Oe("../objects/Snapshot"), Oe("./helpManager")),
  4432. O = Oe("./immersiveMode"),
  4433. L = Oe("./loadingScreen"),
  4434. D = Oe("./landingScreen"),
  4435. N = Oe("./playButton"),
  4436. F = Oe("./populateModal"),
  4437. B = Oe("./memoryUsage"),
  4438. V = Oe("./closer/modalCloser"),
  4439. k = Oe("./closer/ModalCloserEvent"),
  4440. U = Oe("./help/help"),
  4441. H = Oe("./help/HelpEvent"),
  4442. z = Oe("./title/titleBar"),
  4443. G = Oe("./title/TitleEvents"),
  4444. W = Oe("./terms/terms"),
  4445. j = Oe("./terms/TermsEvent"),
  4446. Y = Oe("./title/tagToggle"),
  4447. q = Oe("./tourInteraction"),
  4448. X = Oe("./vr/vrModal"),
  4449. Z = Oe("./vr/vrEvent"),
  4450. K = Oe("./sharing/modal"),
  4451. Q = Oe("./webvr/webVRgui"),
  4452. J = Oe("./webvr/WebVrEvent"),
  4453. ee = Oe("../controls/serializer"),
  4454. te = Oe("../enum/Keys"),
  4455. ie = Oe("../enum/Viewmode"),
  4456. ne = (Oe("../enum/BlackoutStyle"), Oe("../tag/Media/MediaEvent")),
  4457. re = (Oe("../enum/PathDiscardMode"), Oe("../enum/PathDisplayMode"), Oe("../enum/DirectorEvents"), Oe("../enum/PlayerEvents")),
  4458. oe = Oe("../enum/ControlEvents"),
  4459. ae = Oe("./sharing/ShareEvents"),
  4460. se = Oe("../localization/localize"),
  4461. le = (Oe("../enum/Vectors"), Oe("../enum/WarpStyle"), Oe("../enum/AlignmentType"), Oe("../enum/VROption")),
  4462. ce = Oe("./konami"),
  4463. he = Oe("../lib/dat.gui"),
  4464. ue = new m(e),
  4465. de = (Oe("../util/showcase"), Oe("../enum/ZoomEvents")),
  4466. pe = ie.DOLLHOUSE,
  4467. fe = 0,
  4468. ge = [".hideTarget"],
  4469. me = null,
  4470. ve = null,
  4471. ye = !1,
  4472. Ae = !1,
  4473. Ce = {
  4474. coBrand: {
  4475. visible: !0,
  4476. elements: [".co-brand", "#loaderCoBrand"]
  4477. },
  4478. help: {
  4479. visible: !0,
  4480. elements: [".nav-help", "#nav-help"]
  4481. },
  4482. tourControls: {
  4483. visible: !0,
  4484. elements: [".next", ".previous", "#play"]
  4485. },
  4486. highlight: {
  4487. visible: !0,
  4488. elements: ["#drawer", "#pullTab"]
  4489. },
  4490. share: {
  4491. visible: !0,
  4492. elements: [".socialButton", "#share"]
  4493. },
  4494. fullScreen: {
  4495. visible: !0,
  4496. elements: ["#gui-fullscreen"]
  4497. },
  4498. floors: {
  4499. visible: !0,
  4500. elements: [".gui-floor"]
  4501. }
  4502. },
  4503. Ie = (g = document.getElementById("drawer"), function () {
  4504. $("#player").height() < 400 && g.classList.contains("open") && l()
  4505. }),
  4506. Ee = (f = document.getElementById("meta-info"), function () {
  4507. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  4508. }),
  4509. _e = (i = document.getElementById("meta-info"), s = document.getElementById("interaction-modal"), u = $("#drawer").eq(0), d = $(".gui-floor").eq(0), p = $(".vr-popup").eq(0), function (e) {
  4510. switch (e) {
  4511. case "info":
  4512. we(), Te(), Ie(), Me(), Re(), xe(), Pe();
  4513. break;
  4514. case "terms":
  4515. be(), Te(), Se(), Me(), Re(), xe(), Pe();
  4516. break;
  4517. case "help":
  4518. be(), we(), Me(), Re(), xe(), Pe();
  4519. break;
  4520. case "vr":
  4521. be(), we(), Me(), Re(), Te(), Pe(), t(p) && Se();
  4522. break;
  4523. case "highlights":
  4524. Ee(), we(), Me(), Re();
  4525. break;
  4526. case "share":
  4527. be(), we(), Te(), Re(), xe(), Pe();
  4528. break;
  4529. case "floor":
  4530. we(), Me(), xe();
  4531. break;
  4532. case "view":
  4533. Re(), Me(), we(), xe();
  4534. break;
  4535. case "tour":
  4536. case "move":
  4537. we(), Me(), Re(), xe();
  4538. break;
  4539. case "resize":
  4540. be(), Ie(), Re();
  4541. break;
  4542. case "tag":
  4543. we(), Te(), Me(), Re(), xe()
  4544. }
  4545. });
  4546. function be() {
  4547. i.classList.contains("expand") && z.toggleMeta(!0)
  4548. }
  4549. function we() {
  4550. W.hide()
  4551. }
  4552. function Te() {
  4553. U.close()
  4554. }
  4555. function xe() {
  4556. X.dismiss()
  4557. }
  4558. function Se() {
  4559. u.hasClass("open") && l()
  4560. }
  4561. function Me() {
  4562. K.hide()
  4563. }
  4564. function Re() {
  4565. d.hasClass("open") && d.removeClass("open")
  4566. }
  4567. function Pe() {
  4568. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  4569. }
  4570. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function (e) {
  4571. $("#gui-fullscreen").toggle(!S.isFullscreen()), $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()), setTimeout(function () {
  4572. $(".icon:visible").hide().show(0)
  4573. }, 100)
  4574. }), $("#gui-fullscreen").find("a").on("click", function (e) {
  4575. y(e), S.requestFullscreen($("body")[0]), R.track("showcase_gui", {
  4576. gui_action: "click_enter_fullscreen",
  4577. interaction_source: "gui"
  4578. })
  4579. }), $("#gui-fullscreen-exit").find("a").on("click", function (e) {
  4580. y(e), S.exitFullscreen(), R.track("showcase_gui", {
  4581. gui_action: "click_exit_fullscreen",
  4582. interaction_source: "gui"
  4583. })
  4584. }), $("#volume").find("a").on("click", function (e) {
  4585. y(e), -1 < $("#volume img")[0].src.indexOf("btn_on.png") ? (g_play = 0, g_playAudio && g_playAudio.pause(), $("#volume img").attr("src", "./images/Volume btn_off.png"), $("#volume").attr("title", "关闭声音")) : -1 < $("#volume img")[0].src.indexOf("btn_off.png") && (g_play = 1, g_playAudio && g_playAudio.play(), $("#volume img").attr("src", "./images/Volume btn_on.png"), $("#volume").attr("title", "打开声音"))
  4586. }), $(window).on("resize", function (e) {
  4587. var t = e.target.innerHeight,
  4588. i = e.target.innerWidth;
  4589. t === o && i === a || (Ce.highlight.visible && E(), _e("resize"), $(".pinTop.right").removeClass("hideUnderMeta"), n(), o = t, a = i)
  4590. }).resize(), S.supportsFullscreen() || $("#gui-fullscreen").hide(), $("#pullTab").on("click", function (e) {
  4591. y(e), $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  4592. gui_action: "hide_highlight_reel"
  4593. }), $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  4594. gui_action: "show_highlight_reel"
  4595. }), $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")), l()
  4596. }), "true" === window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""), $("#hotList").on("click", function (e) {
  4597. y(e);
  4598. var t = $("#hotListWrap")[0];
  4599. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"), this.classList.remove("active")) : (t.classList.add("hotListActive"), this.classList.add("active"))
  4600. }), $("#hotListContent ul").on("mouseover", function (e) {
  4601. y(e);
  4602. var t = e.target,
  4603. i = document.getElementById("hotListWrap");
  4604. if ("SPAN" === t.tagName) {
  4605. var n = t.parentElement.parentElement;
  4606. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  4607. } else if ("LI" === t.tagName) {
  4608. n = t.parentElement;
  4609. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  4610. } else i.style.width = ""
  4611. }), $("#hotListContent ul").on("click", function (e) {
  4612. y(e), this.preElem && this.preElem.classList.remove("active"), "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"), e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0), this.preElem = e.target.parentElement) : (e.target.classList.add("active"), e.target.hot && e.target.hot.examine(window.player, !0), this.preElem = e.target)
  4613. }), $("#hotListClose").on("click", function (e) {
  4614. y(e), $("#hotListWrap")[0].classList.remove("hotListActive"), $("#hotListContent ul .active").removeClass("active"), $("#hotList")[0].classList.remove("active")
  4615. })), "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""), $("#more-menu-button").on("click", function (e) {
  4616. y(e), $("#more-menu").toggleClass("open")
  4617. }), Le.exports.init = function (s, l, c, e, t, i, n) {
  4618. var r;
  4619. x = n, s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"), s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"), F.init(), D.init(s, i), ce.init(s, l, e), $(".icon").on("mouseover", function () {
  4620. l.player && l.player.reticule.hide()
  4621. }),
  4622. function (e, t) {
  4623. var i = t.player;
  4624. $("#gui-modes-inside").on("mousedown touchstart", function (e) {
  4625. y(e), R.updateInteraction(oe.InteractionGui, "inside-button"), R.track("USER", {
  4626. event_type: "showcase_gui",
  4627. gui_action: "click_inside_mode_button"
  4628. }), t.changeMode(ie.PANORAMA)
  4629. }), $("#gui-modes-outside").find("a").on("click", function (e) {
  4630. y(e), R.track("showcase_gui", {
  4631. gui_action: "click_outside_mode_button"
  4632. }), t.changeMode(pe)
  4633. }), $("#gui-modes-floorplan").on("click", function (e) {
  4634. y(e), i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  4635. gui_action: "click_floorplan_mode_button"
  4636. }), t.changeMode(ie.FLOORPLAN))
  4637. }), $("#gui-modes-dollhouse").on("click", function (e) {
  4638. y(e), i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  4639. gui_action: "click_dollhouse_mode_button"
  4640. }), t.changeMode(ie.DOLLHOUSE))
  4641. })
  4642. }(0, l),
  4643. function (e, t) {
  4644. $("#play").find("a").on("mousedown touchstart", function (e) {
  4645. y(e), _e("tour"), q.play(), R.trackAlways("showcase_gui", {
  4646. gui_action: "play_highlights"
  4647. })
  4648. }), window.startAndPlay = function (e) {
  4649. _e("tour"), q.play(), R.trackAlways("showcase_gui", {
  4650. gui_action: "play_highlights"
  4651. })
  4652. }, $("#pause").find("a").on("mousedown touchstart", function (e) {
  4653. y(e), q.pause(), R.trackAlways("showcase_gui", {
  4654. gui_action: "pause_highlights"
  4655. })
  4656. }), $("#gui-zoomin").find("a").on("click", function (e) {
  4657. y(e), t.player.zoomInIncrementally()
  4658. }), $("#gui-zoomout").find("a").on("click", function (e) {
  4659. y(e), t.player.zoomOutIncrementally()
  4660. })
  4661. }(0, l), s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(s.data.name), K.on(ae.OPENED, (r = document.getElementById("share-modal"), function () {
  4662. _e("share"), V.open(r)
  4663. })), K.on(ae.CLOSED, V.reset)), 1 < s.heroLocations.length ? function (e, i, t) {
  4664. var n = 100 / (fe = e.heroLocations.length) + "%",
  4665. r = $("#thumb-container"),
  4666. o = $("#progressBar");
  4667. $("#status").find(".totalSteps").text(fe);
  4668. for (var a = 0; a < fe; a++) {
  4669. var s = e.heroLocations[a],
  4670. l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  4671. if (l.attr("data-index", a), Ce.highlight.visible && l.find("img").attr("src", s.thumbUrl), s.name) {
  4672. var c = $('<div class="overlay"></div>').text(s.name);
  4673. l.prepend(c)
  4674. }
  4675. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  4676. var h = e.panos.get(s.panoId),
  4677. u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  4678. l.prepend(u)
  4679. }
  4680. r.append(l), o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  4681. }
  4682. T = 144 * fe, 111 * fe, $(".thumbImg").on("mouseover", function () {
  4683. ! function (e) {
  4684. return e.describe().inTransition
  4685. }(i) && t.showPathToHeroLocation($(this).data("index"))
  4686. }), $(".thumbImg").on("mouseout", function () {
  4687. i.clearPath()
  4688. }), $(".thumbImg").on("click", function (e) {
  4689. y(e);
  4690. var t = $(this);
  4691. R.updateInteraction(oe.InteractionGui, "thumbnail"), R.trackAlways("showcase_gui", {
  4692. gui_action: "click_highlight"
  4693. }), i.goToHighlight(t.data("index"))
  4694. }), $(".previous").find("a").on("click", function (e) {
  4695. y(e), R.trackAlways("showcase_gui", {
  4696. gui_action: "prev_highlight"
  4697. }), i.prevHighlight()
  4698. }), $(".next").find("a").on("click", function (e) {
  4699. y(e), R.trackAlways("showcase_gui", {
  4700. gui_action: "next_highlight"
  4701. }), i.nextHighlight()
  4702. }), $("#drawer").on("mouseleave", function (t) {
  4703. var i;
  4704. y(t);
  4705. try {
  4706. i = new MouseEvent("mouseup", {
  4707. clientX: t.clientX,
  4708. clientY: t.clientY,
  4709. screenX: t.screenX,
  4710. screenY: t.screenY
  4711. })
  4712. } catch (e) {
  4713. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  4714. }
  4715. document.dispatchEvent(i)
  4716. }), (w = new Sly($("#scrollFrame"), {
  4717. horizontal: !0,
  4718. itemNav: "centered",
  4719. smart: !0,
  4720. scrollTrap: !0,
  4721. scrollBy: 1,
  4722. mouseDragging: !0,
  4723. touchDragging: !0,
  4724. speed: 300,
  4725. dragHandle: !0,
  4726. dynamicHandle: !0,
  4727. clickBar: !0,
  4728. scrollBar: $("#scroller"),
  4729. activateOn: null
  4730. }).init()).on("active", function (e, t) {
  4731. t,
  4732. _e("tour"),
  4733. $(".step").removeClass("active"),
  4734. $("#status").find(".curIdx").text(t + 1);
  4735. for (var i = 0; i <= t; i++) $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  4736. }), E()
  4737. }(s, l, c) : (Ce.highlight.visible = !1, Ce.tourControls.visible = !1), z.on(G.OPEN_INFO, _e.bind(this, "info")),
  4738. function () {
  4739. var n;
  4740. document.body.addEventListener("mousedown", function (e) {
  4741. n = 0 === e.button || 1 === e.which ? e.target : null
  4742. }, !0), document.body.addEventListener("mouseup", function (t) {
  4743. n !== t.target && (n = b(n, t.target));
  4744. var e = document.getElementById("gui-parent");
  4745. if (b(e, n) !== e && (n = null), n) {
  4746. var i;
  4747. try {
  4748. i = new MouseEvent("click", t)
  4749. } catch (e) {
  4750. (i = document.createEvent("MouseEvents")).initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  4751. }
  4752. i.syntheticClick = !0, n.dispatchEvent(i), n = null
  4753. }
  4754. }, !0), document.getElementById("gui-parent").addEventListener("click", function (e) {
  4755. e.syntheticClick || (e.stopPropagation(), "A" === e.target.nodeName && e.preventDefault())
  4756. }, !0)
  4757. }(), A(c), C(s, t), s.on("floor.changed", I), s.on("waiting", function (e) {
  4758. _(e)
  4759. }.bind(this, s)), s.on("waiting-done", function (e) {
  4760. _(e)
  4761. }.bind(this, s)), c.on(re.ModeChanged, function (e, t) {
  4762. A(c), v(l, c), t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR), U.updateMode(t)
  4763. }), e.on(oe.Move, _e.bind(this, "move")), c.on(re.Ready, function () {
  4764. O.init(e, c, c.tagManager, l), c.on(re.ModeChanged, function (e, t) {
  4765. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  4766. })
  4767. }), c.on(re.PanoChosen, function (e, t) {
  4768. A(c, t), U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  4769. }), V.on(k.CLOSE, function (e) {
  4770. switch (e) {
  4771. case "vr-modal":
  4772. X.dismiss();
  4773. break;
  4774. case "share-modal":
  4775. K.hide();
  4776. break;
  4777. case "terms-modal":
  4778. W.hide()
  4779. }
  4780. });
  4781. var o, h = $("#play").eq(0),
  4782. u = $("#pause").eq(0),
  4783. d = $(".pinBottom").toArray(),
  4784. p = $("#drawer").eq(0),
  4785. f = $("#playHead").eq(0),
  4786. a = $("#progressBar").eq(0),
  4787. g = $("#thumb-container").eq(0).children(),
  4788. m = a.children();
  4789. l.on("update.controls", function () {
  4790. var e, t, i, n = l.describe();
  4791. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(), u.show()), n.tourInProgress && (d.forEach(function (e) {
  4792. e.classList.add("playing")
  4793. }), p.addClass("playing"), f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(), u.hide()), n.tourInProgress || (q.stopTour(), d.forEach(function (e) {
  4794. e.classList.remove("playing")
  4795. }), p.removeClass("playing"), f.removeClass("playing"))), null !== n.currentItem) {
  4796. var r, o;
  4797. $("#status").find(".curIdx").text(n.currentItem + 1), n.onTheBus ? (r = "active", o = "recent") : (o = "active", r = "recent");
  4798. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  4799. for (e = 0; e < s.heroLocations.length; e += 1) i = g.eq(e), t = m.eq(e), i.removeClass(o), t.removeClass(o), n.onTheBus && e === n.destinationItem ? (i.addClass(r), t.addClass(r), w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r), t.addClass(r)) : (i.removeClass(r), t.removeClass(r))
  4800. } else
  4801. for (e = 0; e < s.heroLocations.length; e += 1) i = g.eq(e), t = m.eq(e), i.removeClass("active recent"), t.removeClass("active recent");
  4802. v(l, c)
  4803. }), document.addEventListener("keydown", function (e) {
  4804. switch (R.updateInteraction(oe.InteractionKey), e.which) {
  4805. case te.ZERO:
  4806. M.debug && s.toggleAlpha();
  4807. break;
  4808. case te.NINE:
  4809. M.debug && B.toggle();
  4810. break;
  4811. case te.ONE:
  4812. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  4813. break;
  4814. case te.TWO:
  4815. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  4816. break;
  4817. case te.THREE:
  4818. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  4819. break;
  4820. case te.FOUR:
  4821. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  4822. break;
  4823. case te.SPACE:
  4824. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  4825. break;
  4826. case te.RETURN:
  4827. M.debug && s.toggleExplodeUp();
  4828. break;
  4829. case te.P:
  4830. ! function (e) {
  4831. me.gui || (me.gui = function (e) {
  4832. var t = new he.GUI;
  4833. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function () {
  4834. e.setSweepVisibility(M.showSweeps)
  4835. }), t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1), t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function () {
  4836. M.transition.flySpeed = 0, t.__controllers.forEach(function (e) {
  4837. e.updateDisplay()
  4838. })
  4839. }), t.add(M.path, "opacity", 0, 1).name("Path opacity"), $(t.__closeButton).hide(), t
  4840. }(me.model)), (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  4841. }(!me.visible);
  4842. break;
  4843. case te.U:
  4844. ! function (e) {
  4845. ve.gui || (ve.gui = function (t, i) {
  4846. function e() {
  4847. var e = i.toJSON();
  4848. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e), i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  4849. }
  4850. var n = {},
  4851. r = new he.GUI({
  4852. autoPlace: !0,
  4853. width: "60%"
  4854. });
  4855. return e(), i.on(re.ViewChanged, e), r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(), r.domElement.id = "datLinks", [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function (e) {
  4856. if (!S.detectSafari()) {
  4857. var t = document.createElement("button");
  4858. t.classList.add("btn-deep-link"), t.innerText = se.MENU_COPY, e.nextSibling.appendChild(t);
  4859. var n = function () {
  4860. alert(se.LINK_ALERT_COPY), t.hide()
  4861. };
  4862. t.addEventListener("click", function (e) {
  4863. try {
  4864. var t = e.target.parentNode.childNodes[0];
  4865. t.select();
  4866. var i = document.execCommand("copy");
  4867. t.blur(), i || n()
  4868. } catch (e) {
  4869. n()
  4870. }
  4871. })
  4872. }
  4873. }), $(r.__closeButton).hide(), r
  4874. }(ve.model, ve.player)), (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  4875. }(!ve.visible);
  4876. break;
  4877. case te.X:
  4878. M.debug && s.toggleExplode();
  4879. break;
  4880. case te.PLUSEQUALS:
  4881. l.player.activatePersistentZooming(!0), O.hideUi();
  4882. break;
  4883. case te.DASHUNDERSCORE:
  4884. l.player.activatePersistentZooming(!1), O.hideUi();
  4885. break;
  4886. case te.SEVEN:
  4887. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  4888. break;
  4889. case te.EIGHT:
  4890. l.player.decreaseZoomSpeed();
  4891. break;
  4892. case te.NINE:
  4893. l.player.increaseZoomSpeed()
  4894. }
  4895. return c && c.reticule.hide(), !0
  4896. }.bind(this)), document.addEventListener("keyup", function (e) {
  4897. switch (e.which) {
  4898. case te.PLUSEQUALS:
  4899. l.player.deactivatePersistentZooming();
  4900. break;
  4901. case te.DASHUNDERSCORE:
  4902. l.player.deactivatePersistentZooming()
  4903. }
  4904. }.bind(this)),
  4905. function (e) {
  4906. me = {
  4907. gui: null,
  4908. visible: !1,
  4909. model: e
  4910. }
  4911. }(s),
  4912. function (e, t) {
  4913. ve = {
  4914. gui: null,
  4915. visible: !1,
  4916. model: e,
  4917. player: t
  4918. }
  4919. }(s, l.player),
  4920. function (e) {
  4921. function t(e, i) {
  4922. $(e).find("a").each(function (e, t) {
  4923. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"), t.style.pointerEvents = i ? "auto" : "none"
  4924. })
  4925. }
  4926. e.on(de.ZoomMax, function () {
  4927. t("#gui-zoomin", !1), t("#gui-zoomout", !0)
  4928. }), e.on(de.ZoomMin, function () {
  4929. t("#gui-zoomin", !0), t("#gui-zoomout", !1)
  4930. }), e.on(de.ZoomIn, function () {
  4931. t("#gui-zoomout", !0)
  4932. }), e.on(de.ZoomOut, function () {
  4933. t("#gui-zoomin", !0)
  4934. }), e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0), e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  4935. }(c), P.setAutoPlay(s.heroCount()), U.init(c, i.mode), U.on(H.OPENED, _e.bind(this, "help")), W.init(), W.on(j.OPENED, (o = document.getElementById("terms-modal"), function () {
  4936. _e("terms"), V.open(o)
  4937. })), W.on(j.CLOSED, V.reset), M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)), (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l), M.profiling.enabled && B.show(), q.init(l)
  4938. }, Le.exports.startLoading = function (e, t, i, n, r, o) {
  4939. function a() {
  4940. o.setLoadingStartTime(),
  4941. function () {
  4942. function e(e) {
  4943. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  4944. }
  4945. $("body").css("touch-action", "none"), $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function (e) {});
  4946. var t = document.getElementById("terms-text"),
  4947. i = document.getElementById("more-help-wrapper"),
  4948. n = (document.getElementById("navigation-help-wrapper"), document.getElementById("help-dialog"), document.getElementById("tag-billboards"));
  4949. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  4950. passive: !1
  4951. }), document.body.addEventListener("DOMMouseScroll", e)), $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function (e) {
  4952. e.stopPropagation()
  4953. })
  4954. }(), r ? (D.showMessage(t, i, Ce.coBrand.visible), l()) : function (e) {
  4955. L.show(e), c()
  4956. }(l)
  4957. }
  4958. var s = $.Deferred(),
  4959. l = s.resolve.bind(s);
  4960. return ye = !0, _(e), e.data.player_options && function (e) {
  4961. Ce.tourControls.visible = e.tour_buttons && S.valueFromHash("gt", 1), Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1), Ce.highlight.visible = e.highlight_reel && 1 !== M.specialEdition && M.showHighlights
  4962. }(e.data.player_options), 1 === M.specialEdition && $("body").addClass("specialEdition"), se.localizeGUI(),
  4963. function (i) {
  4964. function e(e, t) {
  4965. return !!i.player_options[e] && i[t || e]
  4966. }
  4967. $(".model-title").text(i.name);
  4968. var t = M.pageTitle;
  4969. 2 !== S.valueFromHash("mls", 0) && (t = i.name), document.title = t, S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  4970. delay: {
  4971. show: 50,
  4972. hide: 0
  4973. },
  4974. trigger: "hover",
  4975. html: !1,
  4976. viewport: {
  4977. selector: "body",
  4978. padding: 10
  4979. }
  4980. }), S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")), z.populate({
  4981. name: e("model_name", "name"),
  4982. coBrand: e("presented_by"),
  4983. description: e("model_summary", "summary") || "暂无内容",
  4984. contactName: e("contact_name"),
  4985. address: e("address"),
  4986. phone: e("contact_phone"),
  4987. formattedPhone: i.formatted_contact_phone,
  4988. email: e("contact_email"),
  4989. url: e("external_url"),
  4990. socialSharing: i.enable_social_sharing && i.is_public
  4991. })
  4992. }(e.data), r || $(".quick").addClass("hidden"), e.data.image && !r && function (e) {
  4993. $("<img/>").attr("src", e).on("load", function () {
  4994. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500), $(this).remove()
  4995. })
  4996. }(e.data.image), n ? (R.impression(), a()) : (o.setWaitingStartTime(), N.show(r, a)), s
  4997. }, Le.exports.endLoading = function (e, t, i) {
  4998. var n = t.player;
  4999. function r() {
  5000. i.dismissExaminedTag(), i.disableHovering()
  5001. }
  5002. $("#gui-thumb").fadeOut(2500), L.hide(function () {
  5003. ye = !1
  5004. }), Y.init(e, i), z.finishSetup(Object.keys(e.tags).length), i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")), X.on(Z.OPENED, r), K.on(ae.OPENED, r), U.on(H.OPENED, r), W.on(j.OPENED, r);
  5005. var o = i.enableHovering.bind(i);
  5006. if (X.on(Z.CLOSED, o), K.on(ae.CLOSED, o), U.on(H.CLOSED, o), W.on(j.CLOSED, o), M.labels.enabled && Object.keys(e.labels).length, e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t), I(e.currentFloor, n.mode)), "372" === getQueryVariable("m") && (Ce.floors.visible = 1, h(e, t)), c(), v(t, t.player), $("#gui").fadeIn(1500), Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function () {
  5007. l(), (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  5008. }, 2e3), !S.isMobile())
  5009. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++) $(a[s]).addClass("hasHover");
  5010. _(e), z.setupToggling(), window.editHotPanel && editHotPanel(),
  5011. function () {
  5012. var i = $("#pullTab"),
  5013. e = {
  5014. bottom: {
  5015. "border-bottom-left-radius": "10px",
  5016. "border-bottom-right-radius": "10px"
  5017. },
  5018. top: {
  5019. "border-top-left-radius": "10px",
  5020. "border-top-right-radius": "10px"
  5021. }
  5022. },
  5023. t = {
  5024. bottom: {
  5025. "border-top-right-radius": "10px",
  5026. "border-bottom-right-radius": "10px"
  5027. },
  5028. top: {
  5029. "border-bottom-left-radius": "10px",
  5030. "border-top-left-radius": "10px"
  5031. }
  5032. };
  5033. function n(e, t) {
  5034. $("#gui-modes-map > div:visible:last").css(e), i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  5035. }
  5036. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  5037. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  5038. }(), window.EditTools && new EditTools(n.sceneRenderer)
  5039. }, Le.exports.onProgress = function (e) {
  5040. L.progress(e)
  5041. }
  5042. }).call(this, "/js/gui/gui.js")
  5043. }, {
  5044. "../analytics": 4,
  5045. "../controls/serializer": 14,
  5046. "../enum/AlignmentType": 17,
  5047. "../enum/BlackoutStyle": 18,
  5048. "../enum/ControlEvents": 21,
  5049. "../enum/DirectorEvents": 23,
  5050. "../enum/Keys": 30,
  5051. "../enum/PathDiscardMode": 38,
  5052. "../enum/PathDisplayMode": 39,
  5053. "../enum/PlayerEvents": 40,
  5054. "../enum/VROption": 47,
  5055. "../enum/Vectors": 50,
  5056. "../enum/Viewmode": 51,
  5057. "../enum/WarpStyle": 52,
  5058. "../enum/ZoomEvents": 53,
  5059. "../lib/dat.gui": 93,
  5060. "../localization/localize": 108,
  5061. "../tag/Media/MediaEvent": 131,
  5062. "../objects/Snapshot": 153,
  5063. "../settings": 166,
  5064. "../util/ajax": 181,
  5065. "../util/browser": 182,
  5066. "../util/camera": 183,
  5067. "../util/logger": 189,
  5068. "../util/showcase": 193,
  5069. "../util/transitions": 195,
  5070. "./closer/ModalCloserEvent": 61,
  5071. "./closer/modalCloser": 62,
  5072. "./help/HelpEvent": 66,
  5073. "./help/help": 67,
  5074. "./helpManager": 68,
  5075. "./immersiveMode": 69,
  5076. "./konami": 70,
  5077. "./landingScreen": 71,
  5078. "./loadingScreen": 72,
  5079. "./memoryUsage": 73,
  5080. "./playButton": 74,
  5081. "./populateModal": 75,
  5082. "./sharing/ShareEvents": 76,
  5083. "./sharing/modal": 77,
  5084. "./terms/TermsEvent": 78,
  5085. "./terms/terms": 79,
  5086. "./title/TitleEvents": 80,
  5087. "./title/tagToggle": 81,
  5088. "./title/titleBar": 82,
  5089. "./tourInteraction": 84,
  5090. "./vr/vrEvent": 85,
  5091. "./vr/vrModal": 87,
  5092. "./webvr/WebVrEvent": 88,
  5093. "./webvr/webVRgui": 89,
  5094. three: 217
  5095. }],
  5096. 66: [function (e, t, i) {
  5097. "use strict";
  5098. t.exports = Object.freeze({
  5099. OPENED: "help.opened",
  5100. CLOSED: "help.closed"
  5101. })
  5102. }, {}],
  5103. 67: [function (e, t, i) {
  5104. "use strict";
  5105. function n() {
  5106. p.on("click", function (e) {
  5107. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0, setTimeout(function () {
  5108. x = !1
  5109. }, h.help.modalStayDuration), S.emit(l.OPENED), f.addClass("open " + T), p.addClass("open"), o(), r(), v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"), v.classList.add("fadeIn")))
  5110. }), E.on("click", function (e) {
  5111. S.close()
  5112. }), C.on("click", function (e) {
  5113. T && T !== a.TRANSITIONING && (o(), r())
  5114. }), I.on("click", function (e) {
  5115. o(), I.addClass("underline-tab"), c.fill(b, s.MORE_HELP), f.addClass("more-help")
  5116. })
  5117. }
  5118. function r() {
  5119. C.addClass("underline-tab"), c.fill(_, s.NAVIGATION, T), f.addClass(T)
  5120. }
  5121. function o() {
  5122. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR), A.forEach(function (e) {
  5123. e.classList.remove("underline-tab")
  5124. })
  5125. }
  5126. var a = e("../../enum/Viewmode"),
  5127. s = e("../../enum/HelpModalType"),
  5128. l = e("./HelpEvent"),
  5129. c = (e("../helpManager"), e("./../populateModal")),
  5130. h = e("../../settings"),
  5131. u = e("../../util/common"),
  5132. d = e("events").EventEmitter,
  5133. p = $(".footer-help").eq(0),
  5134. f = $("#help-dialog").eq(0),
  5135. g = document.querySelector("#quick-logo"),
  5136. m = document.querySelector("#loaderCoBrand"),
  5137. v = document.querySelector("#help-dialog"),
  5138. y = document.querySelector(".footer"),
  5139. A = $(".help-tabs").children().toArray(),
  5140. C = $(".navigation-tab").eq(0),
  5141. I = $(".more-help-tab").eq(0),
  5142. E = ($("#interaction-modal").eq(0).find(".interaction").toArray(), f.find(".close").eq(0)),
  5143. _ = f.find(".interactions").toArray(),
  5144. b = f.find(".ui-instructions").toArray(),
  5145. w = a.PANORAMA,
  5146. T = a.PANORAMA,
  5147. x = !1,
  5148. S = {
  5149. init: function (e, t) {
  5150. w = T = t, [v, m, g, y].forEach(function (e) {
  5151. e.classList.add(c.deviceType)
  5152. }), n()
  5153. },
  5154. close: function () {
  5155. if (f.hasClass("open") && (this.emit(l.CLOSED), p.removeClass("open"), f.removeClass("open"), v.classList.contains("fadeIn"))) {
  5156. v.classList.remove("fadeIn");
  5157. var e = T === a.TRANSITIONING ? w : T;
  5158. c.clear(_, s.NAVIGATION, e)
  5159. }
  5160. },
  5161. updateMode: function (e) {
  5162. w = T, T = e
  5163. }
  5164. };
  5165. u.extendObject(S, d.prototype), t.exports = S
  5166. }, {
  5167. "../../enum/HelpModalType": 28,
  5168. "../../enum/Viewmode": 51,
  5169. "../../settings": 166,
  5170. "../../util/common": 185,
  5171. "../helpManager": 68,
  5172. "./../populateModal": 75,
  5173. "./HelpEvent": 66,
  5174. events: 202
  5175. }],
  5176. 68: [function (s, l, e) {
  5177. (function (e) {
  5178. "use strict";
  5179. var t = s("../util/browser"),
  5180. i = s("./../util/logger"),
  5181. n = s("./../settings"),
  5182. r = new i(e),
  5183. o = function () {
  5184. var t;
  5185. try {
  5186. return t = window.localStorage.getItem("visitCount") || "0", t = (parseFloat(t) + 1).toString(), window.localStorage.setItem("visitCount", t), r.debug("visitCount = " + t), t
  5187. } catch (e) {
  5188. t = "1", r.debug("couldn't set local storage")
  5189. }
  5190. }(),
  5191. a = !1;
  5192. l.exports = {
  5193. isHelpDisabled: function () {
  5194. return "0" === t.valueFromHash("help", null) || a
  5195. },
  5196. isLargeHelpEnabled: function () {
  5197. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  5198. },
  5199. isSmallHelpEnabled: function () {
  5200. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  5201. },
  5202. isHelpEnabled: function () {
  5203. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  5204. },
  5205. setAutoPlay: function (e) {
  5206. a = 0 <= n.warp.auto && 1 < e
  5207. }
  5208. }
  5209. }).call(this, "/js/gui/helpManager.js")
  5210. }, {
  5211. "../util/browser": 182,
  5212. "./../settings": 166,
  5213. "./../util/logger": 189
  5214. }],
  5215. 69: [function (e, t, i) {
  5216. "use strict";
  5217. function r(e) {
  5218. M || n(e) && C.hasClass("playing") || (clearTimeout(x), T = !0, h.close(), function (e) {
  5219. !n(e) && S ? v.forEach(function (e) {
  5220. e.classList.remove("drawerOpen"), e.classList.add("duringTour")
  5221. }) : C.hasClass("open") ? v.forEach(function (e) {
  5222. e.classList.remove("duringTour"), e.classList.add("drawerOpen")
  5223. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function (e) {
  5224. e.classList.add("fadeOut")
  5225. })
  5226. }(e), R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1), C.hasClass("playing") || (y.forEach(function (e) {
  5227. e.classList.add("detectHover")
  5228. }), x = setTimeout(a, c.immersive.timeToShowAgain))))
  5229. }
  5230. function o() {
  5231. C.hasClass("playing") || (clearTimeout(x), x = setTimeout(a, c.immersive.timeToShowAgain))
  5232. }
  5233. function a() {
  5234. clearTimeout(x), T = !1, m.forEach(function (e) {
  5235. e.classList.remove("drawerOpen")
  5236. }), S || v.forEach(function (e) {
  5237. e.classList.remove("duringTour")
  5238. }), y.forEach(function (e) {
  5239. e.classList.remove("detectHover")
  5240. })
  5241. }
  5242. function s() {
  5243. T ? a() : r(), M = !0, setTimeout(function () {
  5244. M = !1
  5245. }, c.immersive.uiStayDuration)
  5246. }
  5247. function n(e) {
  5248. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  5249. }
  5250. var l = e("../util/browser"),
  5251. c = e("../settings"),
  5252. h = e("./help/help"),
  5253. u = e("../enum/tagEvents"),
  5254. d = e("../enum/ControlEvents"),
  5255. p = e("../enum/PlayerEvents"),
  5256. f = e("../enum/DirectorEvents"),
  5257. g = (p = e("../enum/PlayerEvents"), e("../enum/Viewmode")),
  5258. m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  5259. v = $(".pinBottom-container, #drawer-container, .footer").toArray(),
  5260. y = $("#hover-bottom, #hover-top").toArray(),
  5261. A = ($("#pullTab").eq(0), $("#playHead").eq(0), $(".pinBottom-container").eq(0)),
  5262. C = $("#drawer").eq(0),
  5263. I = $("#drawer-container").eq(0),
  5264. E = $("#meta-info").eq(0),
  5265. _ = $(".pinTop.left").eq(0),
  5266. b = $("#player").eq(0),
  5267. w = document.getElementById("pullTab"),
  5268. T = !1,
  5269. x = null,
  5270. S = !1,
  5271. M = !1,
  5272. R = null,
  5273. P = !1;
  5274. t.exports.init = function (e, t, i, n) {
  5275. (function (t, i, e, n) {
  5276. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function (e) {
  5277. t.controls[e].on(d.Move, r), t.controls[e].on(d.LongTap, s)
  5278. }), b.on("mousewheel DOMMouseScroll", r), e.on(u.TagActivated, r), e.on(u.TagNavigation, r), i.on(p.FlyingEnded, o), i.on(p.ModeChanging, function (e, t) {
  5279. P = t !== g.PANORAMA && e !== g.PANORAMA
  5280. }), i.on(p.ModeChanged, function (e, t) {
  5281. R = i.mode, t !== g.TRANSITIONING ? a() : r("modeChange")
  5282. }), n.on(f.TourStart, function () {
  5283. S = !0, r()
  5284. }), n.on(f.TourEnd, function () {
  5285. S = !1, a()
  5286. }), n.on(f.ActionInterrupted, function () {
  5287. S = !1
  5288. }), w.addEventListener("touchend", function () {
  5289. $("#pullTab").hasClass("opened") && !S && a()
  5290. }, !0)
  5291. })(e, t, i, n), l.isMobile() ? (y.forEach(function (e) {
  5292. e.classList.add("mobile")
  5293. }), A.click(a)) : (y.forEach(function (e) {
  5294. e.addEventListener("mouseleave", function () {
  5295. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  5296. }, !0)
  5297. }), b.mouseleave(function () {
  5298. y[0].classList.contains("detectHover") && a()
  5299. })), R = t.mode
  5300. }, t.exports.hideUi = r, t.exports.resetDrawer = function () {
  5301. I.hasClass("duringTour") || (S = !1, r("gui"), a())
  5302. }
  5303. }, {
  5304. "../enum/ControlEvents": 21,
  5305. "../enum/DirectorEvents": 23,
  5306. "../enum/tagEvents": 32,
  5307. "../enum/PlayerEvents": 40,
  5308. "../enum/Viewmode": 51,
  5309. "../settings": 166,
  5310. "../util/browser": 182,
  5311. "./help/help": 67
  5312. }],
  5313. 70: [function (i, n, e) {
  5314. (function (e) {
  5315. "use strict";
  5316. var t = i("./../util/logger"),
  5317. o = i("./../settings"),
  5318. a = i("./debug"),
  5319. s = i("./../util/common"),
  5320. l = (i("./gui"), new t(e));
  5321. o.console && $("body").append('<div id="debug-console"></div>'), n.exports.init = function (i, n, r) {
  5322. l.debug("konami has the modelInstance");
  5323. var t = [];
  5324. $(window).on("keydown", function (e) {
  5325. t.push(e.which), t.length > o.secretPanelWord.length && t.shift(), s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."), o.debug = !0)
  5326. }), $(window).on("keydown", function e(t) {
  5327. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r), $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  5328. })
  5329. }
  5330. }).call(this, "/js/gui/konami.js")
  5331. }, {
  5332. "./../settings": 166,
  5333. "./../util/common": 185,
  5334. "./../util/logger": 189,
  5335. "./debug": 63,
  5336. "./gui": 65
  5337. }],
  5338. 71: [function (e, t, i) {
  5339. "use strict";
  5340. function r() {
  5341. s.clear(m, l.LANDING[v]), g.removeClass("fadeIn")
  5342. }
  5343. var o = e("../settings"),
  5344. a = (e("./help/help"), e("./helpManager")),
  5345. s = e("./populateModal"),
  5346. l = e("../enum/HelpModalType"),
  5347. n = e("../enum/Viewmode"),
  5348. c = e("../enum/DirectorEvents"),
  5349. h = e("../enum/PlayerEvents"),
  5350. u = $("#quick-blackout").eq(0),
  5351. d = $("#quick-logo").eq(0),
  5352. p = $(".quick-brand").toArray(),
  5353. f = $("#loaderCoBrand").eq(0),
  5354. g = $("#interaction-modal").eq(0),
  5355. m = g.find(".interaction").toArray(),
  5356. v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(), "");
  5357. t.exports.delayLanding = function (e) {
  5358. var t = $.Deferred();
  5359. e || t.resolve();
  5360. var i = o.startupFlyinDelay;
  5361. return e === n.PANORAMA && (i += o.dollhouse.transitionTime), setTimeout(t.resolve.bind(t), i), t
  5362. }, t.exports.showMessage = function (e, t, i) {
  5363. var n = 0;
  5364. o.quickstart.enabled && (function (e) {
  5365. e && (f.addClass("quick-brand"), d.before(f), p = $(".quick-brand").toArray()), u.addClass("fadeOut"), setTimeout(function () {
  5366. p.forEach(function (e) {
  5367. e.classList.add("fadeIn")
  5368. })
  5369. }, o.quickstart.showTextDelay), setTimeout(function () {
  5370. p.forEach(function (e) {
  5371. e.classList.add("fadeOut")
  5372. })
  5373. }, o.quickstart.fadeOutDelay)
  5374. }(i), n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  5375. function (e, t) {
  5376. setTimeout(function () {
  5377. if (a.isHelpEnabled()) {
  5378. if (t(), s.init(), g.addClass("fadeIn landing " + s.deviceType), a.isSmallHelpEnabled()) return void g.addClass("small");
  5379. s.fill(m, l.LANDING[v]), g.addClass(v)
  5380. }
  5381. }, e);
  5382. var i = {
  5383. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  5384. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  5385. },
  5386. n = $(".nav-icon .icon");
  5387. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  5388. function r(e) {
  5389. e.on("click", function () {
  5390. var e = null;
  5391. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1, i.length < e || e < 1) return !1;
  5392. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  5393. "data-page": e,
  5394. src: i.mobile[e - 1]
  5395. }) : n.attr({
  5396. "data-page": e,
  5397. src: i.pc[e - 1]
  5398. })
  5399. })
  5400. }
  5401. r($(".next-button")), r($(".prev-button"))
  5402. }(n, function () {
  5403. e.once(h.Move, r), t.once(c.TourStart, r)
  5404. })
  5405. }, t.exports.init = function (e, t) {
  5406. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  5407. }, t.exports.dismissModal = r
  5408. }, {
  5409. "../enum/DirectorEvents": 23,
  5410. "../enum/HelpModalType": 28,
  5411. "../enum/PlayerEvents": 40,
  5412. "../enum/Viewmode": 51,
  5413. "../settings": 166,
  5414. "./help/help": 67,
  5415. "./helpManager": 68,
  5416. "./populateModal": 75
  5417. }],
  5418. 72: [function (e, t, i) {
  5419. "use strict";
  5420. var n = e("./circleLoader").circleLoader;
  5421. t.exports = {
  5422. element: $("#gui-loading"),
  5423. hide: function (e) {
  5424. n.done(), this.element.fadeOut(1500, e)
  5425. },
  5426. show: function (e) {
  5427. this.element.fadeIn(500, function () {
  5428. this.element.css("display", "table"), e && e()
  5429. }.bind(this))
  5430. },
  5431. progress: function (e) {
  5432. n.set(e)
  5433. }
  5434. }
  5435. }, {
  5436. "./circleLoader": 60
  5437. }],
  5438. 73: [function (e, t, i) {
  5439. "use strict";
  5440. var n = e("../settings"),
  5441. r = $("#memory-info"),
  5442. o = r.find("#memory-gpu"),
  5443. a = !1;
  5444. t.exports = {
  5445. show: function () {
  5446. n.profiling.enabled && (r.show(), a = !0)
  5447. },
  5448. hide: function () {
  5449. r.hide(), a = !1
  5450. },
  5451. toggle: function () {
  5452. a ? this.hide() : this.show()
  5453. },
  5454. update: function (e) {
  5455. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  5456. }
  5457. }
  5458. }, {
  5459. "../settings": 166
  5460. }],
  5461. 74: [function (e, t, i) {
  5462. "use strict";
  5463. e("../util/browser"), e("../analytics");
  5464. e("../settings"), t.exports = {
  5465. show: function (e, t) {
  5466. $("#gui-message").fadeOut(500, function () {
  5467. t()
  5468. })
  5469. }
  5470. }
  5471. }, {
  5472. "../analytics": 4,
  5473. "../settings": 166,
  5474. "../util/browser": 182
  5475. }],
  5476. 75: [function (e, t, i) {
  5477. "use strict";
  5478. function n(e, t, i, n) {
  5479. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  5480. }
  5481. var r = e("../util/browser"),
  5482. o = e("../localization/localize"),
  5483. a = e("../enum/HelpModalType"),
  5484. s = (e("../enum/HelpModalSize"), e("../enum/Viewmode"));
  5485. t.exports = {
  5486. init: function () {
  5487. if (!this.hasInitialized) {
  5488. this.hasInitialized = !0, this.deviceType = r.isMobile() ? "mobile" : "desktop", this.assets = {}, this.assets[a.LANDING[s.PANORAMA]] = {
  5489. desktop: {
  5490. left: {
  5491. "top-info": o.ROTATE,
  5492. "big-image": "images/nav_help_mouse_drag_left.png",
  5493. keyboard: "images/nav_help_keyboard_left_right.png"
  5494. },
  5495. middle: {
  5496. "top-info": o.MOVE,
  5497. "big-image": "images/nav_help_mouse_click.png",
  5498. keyboard: "images/nav_help_keyboard_up_down.png"
  5499. },
  5500. right: {
  5501. "top-info": o.ZOOM,
  5502. "big-image": "images/nav_help_mouse_zoom.png",
  5503. keyboard: "images/nav_help_zoom_keys.png"
  5504. }
  5505. },
  5506. mobile: {
  5507. left: {
  5508. "top-info": o.ROTATE,
  5509. "big-image": "images/nav_help_gesture_drag.png"
  5510. },
  5511. middle: {
  5512. "top-info": o.MOVE,
  5513. "big-image": "images/nav_help_gesture_tap.png"
  5514. },
  5515. right: {
  5516. "top-info": o.ZOOM,
  5517. "big-image": "images/nav_help_gesture_pinch.png"
  5518. }
  5519. }
  5520. }, this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])), this.assets[a.LANDING[s.DOLLHOUSE]] = {
  5521. desktop: {
  5522. left: {
  5523. "top-info": o.ROTATE,
  5524. "big-image": "images/nav_help_mouse_drag_left.png",
  5525. keyboard: "images/nav_help_keyboard_left_right.png"
  5526. },
  5527. middle: {
  5528. "top-info": o.MOVE,
  5529. "big-image": "images/nav_help_mouse_position_right.png"
  5530. }
  5531. },
  5532. mobile: {
  5533. left: {
  5534. "top-info": o.ROTATE,
  5535. "big-image": "images/nav_help_gesture_drag.png"
  5536. },
  5537. middle: {
  5538. "top-info": o.MOVE,
  5539. "big-image": "images/nav_help_gesture_position_two_finger.png"
  5540. }
  5541. }
  5542. }, this.assets[a.LANDING[s.FLOORPLAN]] = {
  5543. desktop: {
  5544. left: {
  5545. "top-info": o.MOVE,
  5546. "big-image": "images/nav_help_mouse_position_left.png"
  5547. },
  5548. middle: {
  5549. "top-info": o.ROTATE,
  5550. "big-image": "images/nav_help_mouse_drag_right.png",
  5551. keyboard: "images/nav_help_keyboard_left_right.png"
  5552. }
  5553. },
  5554. mobile: {
  5555. left: {
  5556. "top-info": o.MOVE,
  5557. "big-image": "images/nav_help_gesture_position.png"
  5558. },
  5559. middle: {
  5560. "top-info": o.ROTATE,
  5561. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  5562. }
  5563. }
  5564. };
  5565. var e = {
  5566. "top-info": o.INSIDE,
  5567. "big-image": "images/nav_help_click_inside.png",
  5568. keyboard: "images/nav_help_inside_key.png"
  5569. };
  5570. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e, this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e, this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  5571. var t = {
  5572. "top-info": o.INSIDE,
  5573. "big-image": "images/nav_help_tap_inside.png"
  5574. };
  5575. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t, this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t, this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t, this.assets[a.NAVIGATION] = {}, this.assets[a.NAVIGATION][s.PANORAMA] = {
  5576. desktop: {
  5577. left: {
  5578. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  5579. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  5580. "big-image": "images/nav_help_mouse_drag_left.png",
  5581. keyboard: "images/nav_help_keyboard_left_right.png"
  5582. },
  5583. middle: {
  5584. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  5585. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  5586. "big-image": "images/nav_help_mouse_click.png",
  5587. keyboard: "images/nav_help_keyboard_up_down.png"
  5588. },
  5589. right: {
  5590. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  5591. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  5592. "big-image": "images/nav_help_mouse_zoom.png",
  5593. keyboard: "images/nav_help_zoom_keys.png"
  5594. }
  5595. },
  5596. mobile: {
  5597. left: {
  5598. "top-info": o.HELP_MOBILE_PANORAMA_1,
  5599. "big-image": "images/nav_help_gesture_drag.png"
  5600. },
  5601. middle: {
  5602. "top-info": o.HELP_MOBILE_PANORAMA_2,
  5603. "big-image": "images/nav_help_gesture_tap.png"
  5604. },
  5605. right: {
  5606. "top-info": o.HELP_MOBILE_3,
  5607. "big-image": "images/nav_help_gesture_pinch.png"
  5608. }
  5609. }
  5610. }, this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  5611. desktop: {
  5612. left: {
  5613. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  5614. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  5615. "big-image": "images/nav_help_mouse_drag_left.png",
  5616. keyboard: "images/nav_help_keyboard_all.png"
  5617. },
  5618. middle: {
  5619. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  5620. "big-image": "images/nav_help_mouse_position_right.png"
  5621. },
  5622. right: {
  5623. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  5624. "big-image": "images/nav_help_mouse_zoom.png"
  5625. }
  5626. },
  5627. mobile: {
  5628. left: {
  5629. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  5630. "big-image": "images/nav_help_gesture_drag.png"
  5631. },
  5632. middle: {
  5633. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  5634. "big-image": "images/nav_help_gesture_position_two_finger.png"
  5635. },
  5636. right: {
  5637. "top-info": o.HELP_MOBILE_3,
  5638. "big-image": "images/nav_help_gesture_pinch.png"
  5639. }
  5640. }
  5641. }, this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  5642. desktop: {
  5643. left: {
  5644. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  5645. "big-image": "images/nav_help_mouse_position_left.png"
  5646. },
  5647. middle: {
  5648. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  5649. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  5650. "big-image": "images/nav_help_mouse_drag_right.png",
  5651. keyboard: "images/nav_help_keyboard_left_right.png"
  5652. },
  5653. right: {
  5654. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  5655. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  5656. "big-image": "images/nav_help_mouse_zoom.png",
  5657. keyboard: "images/nav_help_keyboard_up_down.png"
  5658. }
  5659. },
  5660. mobile: {
  5661. left: {
  5662. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  5663. "big-image": "images/nav_help_gesture_position.png"
  5664. },
  5665. middle: {
  5666. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  5667. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  5668. },
  5669. right: {
  5670. "top-info": o.HELP_MOBILE_3,
  5671. "big-image": "images/nav_help_gesture_pinch.png"
  5672. }
  5673. }
  5674. }, this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])), this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  5675. "top-info": o.HELP_DESKTOP_360_2A,
  5676. "bottom-info": o.HELP_DESKTOP_360_2B,
  5677. "big-image": "images/nav_help_click_inside.png",
  5678. keyboard: "images/nav_help_inside_key.png"
  5679. }, this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  5680. "top-info": o.HELP_MOBILE_360_2,
  5681. "big-image": "images/nav_help_tap_inside.png"
  5682. }, this.assets[a.MORE_HELP] = {
  5683. desktop: {
  5684. "more-help-hlr": {
  5685. "top-info": o.HELP_MORE_HLR_A,
  5686. "big-image": "images/nav_help_expand.svg",
  5687. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  5688. },
  5689. "more-help-dollhouse": {
  5690. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  5691. "big-image": "images/nav_help_dollhouse.svg",
  5692. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  5693. },
  5694. "more-help-floors": {
  5695. "top-info": o.HELP_MORE_FLOORS_A,
  5696. "big-image": "images/nav_help_floor picker.svg",
  5697. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  5698. },
  5699. "more-help-tag": {
  5700. "top-info": o.HELP_MORE_TAG_A,
  5701. "big-image": "images/nav_help_tag.svg",
  5702. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  5703. },
  5704. "more-help-zoom": {
  5705. "top-info": o.HELP_MORE_ZOOM_A,
  5706. "big-image": "images/nav_help_zoom.svg",
  5707. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  5708. },
  5709. "more-help-tour": {
  5710. "top-info": o.HELP_MORE_TOUR_A,
  5711. "big-image": "images/nav_help_play.png",
  5712. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  5713. },
  5714. "more-help-inside": {
  5715. "top-info": o.HELP_MORE_INSIDE_A,
  5716. "big-image": "images/nav_help_inside.svg",
  5717. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  5718. },
  5719. "more-help-vr": {
  5720. "top-info": o.HELP_MORE_VR_A,
  5721. "big-image": "images/nav_help_vr.svg",
  5722. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  5723. },
  5724. "more-help-360": {
  5725. "top-info": o.HELP_MORE_360_A,
  5726. "big-image": "images/nav_help_360.svg",
  5727. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  5728. },
  5729. "more-help-fullscreen": {
  5730. "top-info": o.HELP_MORE_FULLSCREEN_A,
  5731. "big-image": "images/nav_help_fullscreen.svg",
  5732. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  5733. }
  5734. },
  5735. mobile: {
  5736. "more-help-hlr": {
  5737. "top-info": o.HELP_MORE_HLR_A,
  5738. "big-image": "images/nav_help_expand.svg",
  5739. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  5740. },
  5741. "more-help-dollhouse": {
  5742. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  5743. "big-image": "images/nav_help_dollhouse.svg",
  5744. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  5745. },
  5746. "more-help-floors": {
  5747. "top-info": o.HELP_MORE_FLOORS_A,
  5748. "big-image": "images/nav_help_floor picker.svg",
  5749. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  5750. },
  5751. "more-help-tag": {
  5752. "top-info": o.HELP_MORE_TAG_A,
  5753. "big-image": "images/nav_help_tag.svg",
  5754. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  5755. },
  5756. "more-help-tour": {
  5757. "top-info": o.HELP_MORE_TOUR_A,
  5758. "big-image": "images/nav_help_play.png",
  5759. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  5760. },
  5761. "more-help-inside": {
  5762. "top-info": o.HELP_MORE_INSIDE_A,
  5763. "big-image": "images/nav_help_inside.svg",
  5764. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  5765. },
  5766. "more-help-vr": {
  5767. "top-info": o.HELP_MORE_VR_A,
  5768. "big-image": "images/webvr.svg",
  5769. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  5770. },
  5771. "more-help-360": {
  5772. "top-info": o.HELP_MORE_360_A,
  5773. "big-image": "images/nav_help_360.svg",
  5774. "bottom-info": o.HELP_MOBILE_MORE_360_B
  5775. }
  5776. }
  5777. }, this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  5778. desktop: {
  5779. left: {
  5780. "top-info": o.ROTATE,
  5781. "big-image": "images/nav_help_mouse_drag_left.png",
  5782. keyboard: "images/nav_help_keyboard_left_right.png"
  5783. },
  5784. middle: {
  5785. "top-info": o.MOVE,
  5786. "big-image": "images/nav_help_mouse_click.png",
  5787. keyboard: "images/nav_help_keyboard_up_down.png"
  5788. },
  5789. right: {
  5790. "top-info": o.PLAY,
  5791. "big-image": "images/Desktop-help-play-button.svg",
  5792. keyboard: "images/Desktop-help-spacebar-2.svg"
  5793. }
  5794. },
  5795. mobile: {
  5796. left: {
  5797. "top-info": o.ROTATE,
  5798. "big-image": "images/nav_help_gesture_drag.png"
  5799. },
  5800. middle: {
  5801. "top-info": o.MOVE,
  5802. "big-image": "images/nav_help_gesture_tap.png"
  5803. },
  5804. right: {
  5805. "top-info": o.PLAY,
  5806. "big-image": "images/mobile-help-play-button.svg"
  5807. }
  5808. }
  5809. }, this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])), this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle, this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle, this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])), this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left, this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  5810. }
  5811. },
  5812. fill: function (e, t, i) {
  5813. n.call(this, e, t, i, !0)
  5814. },
  5815. clear: function (e, t, i) {
  5816. n.call(this, e, t, i, !1)
  5817. }
  5818. }
  5819. }, {
  5820. "../enum/HelpModalSize": 27,
  5821. "../enum/HelpModalType": 28,
  5822. "../enum/Viewmode": 51,
  5823. "../localization/localize": 108,
  5824. "../util/browser": 182
  5825. }],
  5826. 76: [function (e, t, i) {
  5827. "use strict";
  5828. t.exports = Object.freeze({
  5829. OPENED: "share.open",
  5830. CLOSED: "share.closed",
  5831. LINK_CLICKED: "share.linked"
  5832. })
  5833. }, {}],
  5834. 77: [function (e, t, i) {
  5835. "use strict";
  5836. function n(n) {
  5837. function e(e, t) {
  5838. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  5839. I.emit(l.LINK_CLICKED, {
  5840. channel: n
  5841. }), window.open(C[n], "shareWindow", i)
  5842. }
  5843. switch (n) {
  5844. case A.FACEBOOK:
  5845. e(580, 420);
  5846. break;
  5847. case A.TWITTER:
  5848. e(550, 440);
  5849. break;
  5850. case A.MAIL:
  5851. I.emit(l.LINK_CLICKED, {
  5852. channel: "email"
  5853. }), window.open(C[n], "_blank");
  5854. break;
  5855. case A.LINKEDIN:
  5856. }
  5857. }
  5858. function r(e) {
  5859. I.emit(l.LINK_CLICKED, {
  5860. channel: "copylink"
  5861. });
  5862. var t = document.createRange();
  5863. t.selectNodeContents(v);
  5864. var i = window.getSelection();
  5865. i.removeAllRanges(), i.addRange(t), document.execCommand("copy"), y.classList.remove("hidden"), v.classList.add("highlighted")
  5866. }
  5867. function o(e) {
  5868. e && (e.stopPropagation(), e.target === v) || (window.getSelection().removeAllRanges(), v.classList.remove("highlighted"), y.classList.add("hidden"))
  5869. }
  5870. var a = e("../../util/browser"),
  5871. s = e("../../localization/localize"),
  5872. l = e("./ShareEvents"),
  5873. c = e("../../util/common"),
  5874. h = e("events").EventEmitter,
  5875. u = document.getElementById("sharing"),
  5876. d = document.getElementById("share-modal"),
  5877. p = document.getElementById("share-close"),
  5878. f = document.getElementById("facebook-share"),
  5879. g = document.getElementById("twitter-share"),
  5880. m = document.getElementById("mail-share"),
  5881. v = document.getElementById("share-url-text"),
  5882. y = document.getElementById("copy-success"),
  5883. A = Object.freeze({
  5884. FACEBOOK: "facebook",
  5885. TWITTER: "twitter",
  5886. MAIL: "mail",
  5887. LINKEDIN: "linkedin"
  5888. }),
  5889. C = {};
  5890. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=", C[A.TWITTER] = "http://twitter.com/intent/tweet?text=", C[A.MAIL] = "mailto:?subject=";
  5891. var I = {
  5892. init: function (e) {
  5893. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  5894. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"), C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"), C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"), u.addEventListener("click", this.toggle.bind(this)), p.addEventListener("click", this.hide.bind(this)), v.addEventListener("click", r), d.addEventListener("click", o), f.addEventListener("click", n.bind(this, A.FACEBOOK)), g.addEventListener("click", n.bind(this, A.TWITTER)), m.addEventListener("click", n.bind(this, A.MAIL)), v.textContent = window.location.href + "&utm_source=4", d.classList.add(a.isMobile() ? "mobile" : "desktop"), u.classList.remove("hidden")
  5895. },
  5896. show: function () {
  5897. this.emit(l.OPENED), d.classList.add("fadeIn")
  5898. },
  5899. hide: function () {
  5900. d.classList.contains("fadeIn") && (this.emit(l.CLOSED), document.selection && document.selection.empty(), window.getSelection().removeAllRanges(), o(), d.classList.remove("fadeIn"))
  5901. },
  5902. toggle: function () {
  5903. d.classList.contains("fadeIn") ? this.hide() : this.show()
  5904. }
  5905. };
  5906. c.extendObject(I, h.prototype), t.exports = I
  5907. }, {
  5908. "../../localization/localize": 108,
  5909. "../../util/browser": 182,
  5910. "../../util/common": 185,
  5911. "./ShareEvents": 76,
  5912. events: 202
  5913. }],
  5914. 78: [function (e, t, i) {
  5915. "use strict";
  5916. t.exports = Object.freeze({
  5917. OPENED: "terms.opened",
  5918. CLOSED: "terms.closed"
  5919. })
  5920. }, {}],
  5921. 79: [function (e, t, i) {
  5922. "use strict";
  5923. var n = e("./TermsEvent"),
  5924. r = e("../../localization/localize"),
  5925. o = e("../../analytics"),
  5926. a = e("../../util/ajax"),
  5927. s = e("../../util/common"),
  5928. l = e("events").EventEmitter,
  5929. c = document.getElementById("terms-modal"),
  5930. h = {
  5931. init: function () {
  5932. $(".footer-terms").on("click", function (e) {
  5933. e.preventDefault(), this.show()
  5934. }.bind(this)), $("#terms-modal .close").on("click", this.hide.bind(this))
  5935. },
  5936. show: function () {
  5937. this.emit(n.OPENED), a.get("static/" + r.TERMS_TEXT_FILE).done(function (e) {
  5938. var t = $("#terms-text").html(e);
  5939. o.track("showcase_gui", {
  5940. gui_action: "click_terms_button",
  5941. interaction_source: "gui"
  5942. }), t.find("a").attr("target", "_blank")
  5943. }).fail(function () {
  5944. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  5945. }), c.classList.add("fadeIn")
  5946. },
  5947. hide: function (e) {
  5948. e && e.preventDefault(), c.classList.contains("fadeIn") && this.emit(n.CLOSED), c.classList.remove("fadeIn")
  5949. }
  5950. };
  5951. s.extendObject(h, l.prototype), t.exports = h
  5952. }, {
  5953. "../../analytics": 4,
  5954. "../../localization/localize": 108,
  5955. "../../util/ajax": 181,
  5956. "../../util/common": 185,
  5957. "./TermsEvent": 78,
  5958. events: 202
  5959. }],
  5960. 80: [function (e, t, i) {
  5961. "use strict";
  5962. t.exports = Object.freeze({
  5963. OPEN_INFO: "title.open.info",
  5964. CLOSE_INFO: "title.close.info",
  5965. SHOW_INFO: "title.show.info",
  5966. HIDE_INFO: "title.hide.info",
  5967. LINK_CLICKED: "title.link.click",
  5968. CONTACT_LINK_CLICKED: "title.contact.click",
  5969. ORIGIN_LINK_CLICKED: "title.origin.click"
  5970. })
  5971. }, {}],
  5972. 81: [function (e, t, i) {
  5973. "use strict";
  5974. var o = e("../../settings");
  5975. t.exports.init = function (e, t) {
  5976. o.tags.enabled && 0 !== Object.keys(e.tags).length && function (t, i) {
  5977. function e(e) {
  5978. t.shouldShowtags = "show" === this.value, t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  5979. }
  5980. document.getElementById("tag-toggles").classList.remove("hidden"), document.getElementById("radio-tag-show").checked = !0;
  5981. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++) n[r].addEventListener("change", e)
  5982. }(e, t)
  5983. }
  5984. }, {
  5985. "../../settings": 166
  5986. }],
  5987. 82: [function (S, M, e) {
  5988. (function (e) {
  5989. "use strict";
  5990. function i(e) {
  5991. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"), _.innerHTML = r.WEBVR_LEARN_MORE + ": ", _.appendChild(function (e) {
  5992. var t = document.createElement("a");
  5993. return t.id = "url", t.target = "_blank", t.href = e, t.innerText = e, t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)), t
  5994. }(e)), b.forEach(function (e) {
  5995. e.classList.add("share-link")
  5996. }), 0))
  5997. }
  5998. function s(e, t) {
  5999. var i = e,
  6000. n = t;
  6001. return function (e, t) {
  6002. i.push(t || n, e)
  6003. }
  6004. }
  6005. var l = S("../../util/browser"),
  6006. t = S("../../util/common"),
  6007. n = S("../../util/logger"),
  6008. r = S("../../localization/localize"),
  6009. o = S("./titleBarSettings"),
  6010. c = S("../../settings"),
  6011. a = S("./TitleEvents"),
  6012. h = S("events").EventEmitter,
  6013. u = new n(e),
  6014. d = document.querySelector(".pinTop.left"),
  6015. p = document.getElementsByClassName("title-container")[0],
  6016. f = document.getElementById("title-toggle").querySelector("i"),
  6017. g = document.getElementById("meta-info-wrapper"),
  6018. m = document.getElementById("meta-info"),
  6019. v = document.getElementById("meta-description"),
  6020. y = document.getElementsByClassName("contact-info")[0],
  6021. A = document.getElementById("contact-data"),
  6022. C = document.getElementById("addressTxt"),
  6023. I = document.getElementById("tag-toggles"),
  6024. E = document.getElementById("share-origin"),
  6025. _ = document.getElementById("share-link-wrapper"),
  6026. b = [m, g, p],
  6027. w = !1,
  6028. T = !1,
  6029. x = {
  6030. populate: function (e) {
  6031. if (function (e, t) {
  6032. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e), t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"), document.getElementById("gui-name").classList.add("noCoBrand"), document.getElementById("cobrandTitle").classList.add("hidden")), !0) : (document.getElementById("model-title").classList.add("hidden"), !1)
  6033. }(e.name, e.coBrand)) {
  6034. if (function (e) {
  6035. e ? (w = !0, v.innerHTML = e) : v.classList.add("hidden")
  6036. }(e.description), function (e, t, i, n) {
  6037. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  6038. w = !0;
  6039. var r = [],
  6040. o = s(r, "<br>");
  6041. if (e && o('<span id="contactName">' + e + "</span>"), t) {
  6042. var a = n || t;
  6043. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  6044. }
  6045. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"), r[0] = "", A.innerHTML = r.join("")
  6046. } else y.classList.add("hidden")
  6047. }(e.contactName, e.phone, e.email, e.formatted_contact_phone), function (e) {
  6048. if ("string" == typeof e) try {
  6049. e = JSON.parse(e)
  6050. } catch (e) {
  6051. return u.warn("Unable to parse address data"), C.parentElement.classList.add("hidden")
  6052. }
  6053. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  6054. w = !0;
  6055. var t = [],
  6056. i = s(t, " ");
  6057. e.address_1 && i(e.address_1), e.address_2 && i(e.address_2), e.city && i(e.city, ", "), e.state && i(e.state, ", "), e.zip && i(e.zip, e.state ? " " : ", "), t[0] = "", C.innerText = t.join("")
  6058. } else C.parentElement.classList.add("hidden")
  6059. }(e.address), w) {
  6060. var t = document.createElement("br");
  6061. I.insertBefore(t, I.firstElementChild)
  6062. }
  6063. e.socialSharing && c.share.enabled && (T = i(e.url))
  6064. }
  6065. },
  6066. finishSetup: function (e) {
  6067. w = w || !!e, document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)), w && p.addEventListener("click", x.toggleMeta.bind(x, !1)), [].slice.call(v.querySelectorAll("a")).forEach(function (e) {
  6068. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  6069. }), [].slice.call(y.querySelectorAll("a")).forEach(function (e) {
  6070. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  6071. contact_type: e.getAttribute("id")
  6072. }))
  6073. }), w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  6074. },
  6075. toggleMeta: function (e, t) {
  6076. var i = document.getElementById("model-title");
  6077. t && t.preventDefault();
  6078. var n = m.classList.contains("expand");
  6079. e && !n || (n ? (b.forEach(function (e) {
  6080. e.classList.remove("expand")
  6081. }), this.emit(a.CLOSE_INFO), i.classList.remove("expand")) : (b.forEach(function (e) {
  6082. e.classList.add("expand")
  6083. }), i.classList.add("expand"), this.emit(a.OPEN_INFO)))
  6084. },
  6085. setupToggling: function () {
  6086. g.style.height = m.offsetHeight + "px", m.addEventListener("transitionend", function () {
  6087. g.style.height = m.offsetHeight + "px"
  6088. })
  6089. },
  6090. toggleTitle: function (e) {
  6091. e && e.preventDefault(), d.classList.contains("closed") ? (d.classList.add("open"), f.classList.remove("icon-dpad-right"), f.classList.add("icon-dpad-left"), this.emit(a.SHOW_INFO), setTimeout(function () {
  6092. d.classList.remove("closed"), d.classList.remove("open")
  6093. }, o.removeAnimationClasses)) : (d.classList.add("closed"), f.classList.remove("icon-dpad-left"), f.classList.add("icon-dpad-right"), this.emit(a.HIDE_INFO))
  6094. }
  6095. };
  6096. t.extendObject(x, h.prototype), M.exports = x
  6097. }).call(this, "/js/gui/title/titleBar.js")
  6098. }, {
  6099. "../../localization/localize": 108,
  6100. "../../settings": 166,
  6101. "../../util/browser": 182,
  6102. "../../util/common": 185,
  6103. "../../util/logger": 189,
  6104. "./TitleEvents": 80,
  6105. "./titleBarSettings": 83,
  6106. events: 202
  6107. }],
  6108. 83: [function (e, t, i) {
  6109. "use strict";
  6110. t.exports = Object.freeze({
  6111. minTooltipCharacters: 19,
  6112. removeAnimationClasses: 500
  6113. })
  6114. }, {}],
  6115. 84: [function (e, t, i) {
  6116. "use strict";
  6117. function n() {
  6118. v.playTour(), y && clearTimeout(y), c(), E.removeClass("fadeIn")
  6119. }
  6120. function r() {
  6121. A.classList.contains("playing") && (v.stopTour(), E.addClass("fadeIn"), setTimeout(function () {
  6122. E.removeClass("fadeIn")
  6123. }, h.tourInteraction.showPauseButton), M || (clearTimeout(y), y = setTimeout(s, h.tourInteraction.showModal)), setTimeout(function () {
  6124. A.classList.remove("playing")
  6125. }, h.tourInteraction.allowNextClick))
  6126. }
  6127. function o() {
  6128. v.tourInProgress && (v.stopTour(), v.endTourProgress(), A.classList.remove("playing"))
  6129. }
  6130. function a() {
  6131. _.is(":visible") ? n() : r()
  6132. }
  6133. function s() {
  6134. if (!h.tourInteraction.disabled) {
  6135. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA), T.addClass("fadeIn tour " + p.deviceType);
  6136. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  6137. if (!h.tourInteraction.smallModal) e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA, p.fill(x, g.TOUR_INTERACTION[e]), T.addClass(e);
  6138. T.addClass(t)
  6139. }
  6140. }
  6141. function l(e, t) {
  6142. if (t) {
  6143. var i = "keydown" === t.type,
  6144. n = t.which === u.SPACE || v.tourIsPlaying;
  6145. i && n || e || (M = !0), v.atEndOfTour() && c(), !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"), c(), t.which !== u.SPACE && o()), i && n && a()
  6146. }
  6147. }
  6148. function c() {
  6149. T.removeClass("fadeIn")
  6150. }
  6151. var h = (e("../util/browser"), e("../settings")),
  6152. u = e("../enum/Keys"),
  6153. d = e("../enum/Viewmode"),
  6154. p = (e("./helpManager"), e("./populateModal")),
  6155. f = e("../enum/DirectorEvents"),
  6156. g = e("../enum/HelpModalType"),
  6157. m = e("../enum/HelpModalSize"),
  6158. v = null,
  6159. y = null,
  6160. A = document.getElementById("pause-overlay"),
  6161. C = document.getElementById("player"),
  6162. I = document.getElementById("gui"),
  6163. E = $("#pause-icon").eq(0),
  6164. _ = $("#play").eq(0),
  6165. b = $("#playHead").eq(0),
  6166. w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray(),
  6167. T = $("#interaction-modal").eq(0),
  6168. x = $("#interaction-modal .interaction").toArray(),
  6169. S = ["touchstart", "mousedown", "pointerdown"],
  6170. M = !1;
  6171. t.exports.init = function (e) {
  6172. v = e, S.forEach(function (t) {
  6173. C.addEventListener(t, l.bind(this, !1), !0), I.addEventListener(t, l.bind(this, !0), !0), A.addEventListener(t, r, !0), w.forEach(function (e) {
  6174. e.addEventListener(t, o, !0)
  6175. }), $("#drawer img").on(t, o)
  6176. }), document.addEventListener("keydown", l.bind(this, !1), !0), v.on(f.TourStart, function () {
  6177. A.classList.add("playing")
  6178. })
  6179. }, t.exports.play = n, t.exports.pause = r, t.exports.pauseWithoutCTA = o, t.exports.togglePlay = a, t.exports.stopTour = function () {
  6180. b.hasClass("playing") && (clearTimeout(y), v.atEndOfTour() ? (A.classList.remove("playing"), s()) : E.removeClass("fadeIn"))
  6181. }, t.exports.dismissModal = c
  6182. }, {
  6183. "../enum/DirectorEvents": 23,
  6184. "../enum/HelpModalSize": 27,
  6185. "../enum/HelpModalType": 28,
  6186. "../enum/Keys": 30,
  6187. "../enum/Viewmode": 51,
  6188. "../settings": 166,
  6189. "../util/browser": 182,
  6190. "./helpManager": 68,
  6191. "./populateModal": 75
  6192. }],
  6193. 85: [function (e, t, i) {
  6194. "use strict";
  6195. t.exports = Object.freeze({
  6196. OPENED: "vr.modal.opened",
  6197. LAUNCH: "vr.modal.launch",
  6198. CLOSED: "vr.modal.closed",
  6199. NEXT: "vr.modal.next",
  6200. PREV: "vr.modal.prev",
  6201. STORE: "vr.modal.store",
  6202. falseICECHOSEN: "vr.modal.device"
  6203. })
  6204. }, {}],
  6205. 86: [function (e, t, i) {
  6206. "use strict";
  6207. var h = e("../../util/browser"),
  6208. u = e("../../enum/VRApps"),
  6209. n = e("../../enum/VRPlatforms"),
  6210. d = e("../../util/ajax"),
  6211. p = e("../../settings"),
  6212. r = {};
  6213. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=", r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=", r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=", u) {
  6214. var a = u[o];
  6215. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  6216. }
  6217. var s, f = {},
  6218. g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"), "https://" + s);
  6219. t.exports.init = function (e, t, o) {
  6220. function a(e, t, i, n) {
  6221. function r() {
  6222. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  6223. }
  6224. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  6225. }
  6226. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href),
  6227. l = g + "/vr/dlist/?ret=" + s,
  6228. c = g + "/vr/show/?ret=" + s;
  6229. switch (e) {
  6230. case n.IOS:
  6231. ! function (t, e, i, n) {
  6232. var r = a(t, e, i, n),
  6233. o = {
  6234. responseType: "json",
  6235. data: {
  6236. branch_key: p.appConfig.branch_key,
  6237. data: {
  6238. m: e,
  6239. full_url: r,
  6240. $desktop_url: "",
  6241. $og_app_id: "331853976762864119",
  6242. $og_title: i,
  6243. $og_description: n,
  6244. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  6245. $canonical_url: window.location.href
  6246. }
  6247. }
  6248. };
  6249. d.post("https://api.branch.io/v1/url", o).done(function (e) {
  6250. f[t] = e.url
  6251. }).fail(function (e) {
  6252. f[t] = e
  6253. }.bind(this, r))
  6254. }(u.CardboardIOS, t.sid, t.name, t.summary);
  6255. break;
  6256. default:
  6257. ! function (e, t, i) {
  6258. for (var n in u) {
  6259. var r = u[n],
  6260. o = a(r, e, t, i);
  6261. f[r] = o
  6262. }
  6263. }(t.sid, t.name, t.summary)
  6264. }
  6265. }, t.exports.launch = function (e) {
  6266. var t = f[e];
  6267. window.open(t, "_blank")
  6268. }, t.exports.launchStore = function (e) {
  6269. var t = r[e];
  6270. window.open(t, "_blank")
  6271. }
  6272. }, {
  6273. "../../enum/VRApps": 46,
  6274. "../../enum/VRPlatforms": 49,
  6275. "../../settings": 166,
  6276. "../../util/ajax": 181,
  6277. "../../util/browser": 182
  6278. }],
  6279. 87: [function (e, t, i) {
  6280. "use strict";
  6281. function c(e) {
  6282. var t;
  6283. switch (e) {
  6284. case y.IOS:
  6285. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  6286. case y.Android:
  6287. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  6288. }
  6289. return !1
  6290. }
  6291. function h(e) {
  6292. switch (e) {
  6293. case y.Android:
  6294. x.filter(".cardboard").off().on("click", q.cardboardAndroid), x.filter(".gearvr").off().on("click", q.gear), n(k, U, "logo-button", "same-line");
  6295. break;
  6296. case y.UnsupportedAndroid:
  6297. n("", H, "", "");
  6298. break;
  6299. case y.IOS:
  6300. x.filter(".cardboard").off().on("click", q.cardboardIOS), n(k, "", "logo-button", "");
  6301. break;
  6302. case y.Desktop:
  6303. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)), x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)), n(k, U, "logo-button", "same-line"), Q.cardboard()
  6304. }
  6305. }
  6306. function u(e) {
  6307. $(".p1, .p2, .p3").hide(), l.insertAfter(T), w.removeClass("front-page"), w.removeClass("details-page"), w.removeClass("lastPage"), x.removeClass("logo-button"), x.removeClass("same-line"), T.removeClass("headsetOptions"), S.attr("src", ""), S.filter(".second").removeClass("gear"), S.css("display", "inline-block"), S.off(), M.filter(".second").css("display", ""), O.css("display", "none"), $(".p" + (e + 1) + _).show(), S.filter(".third").insertBefore(M.filter(".third"))
  6308. }
  6309. function n(e, t, i, n) {
  6310. w.addClass("front-page"), S.filter(".first").attr("src", e), S.filter(".second").attr("src", t), x.filter(".first").addClass(i), x.filter(".second").addClass(i), x.addClass(n), ".show-desktop" === _ && T.insertAfter(l)
  6311. }
  6312. function r(e, t, i) {
  6313. T.addClass("headsetOptions"), x.off(), S.filter(".second").attr("src", t), O.css("display", "block"), M.filter(".second").css("display", "none"), O.on("click", function () {
  6314. u(b.Title), h(y.Desktop)
  6315. }), e && (X.emit(C.falseICECHOSEN, {
  6316. name: v.GearVR
  6317. }), S.filter(".first").attr("src", e), S.filter(".second").addClass("gear"), S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)), Q.gearvr()), i && (X.emit(C.falseICECHOSEN, {
  6318. name: v.Cardboard
  6319. }), S.filter(".third").attr("src", i), S.filter(".third").show(), S.filter(".third").insertAfter(S.filter(".second")), S.filter(".third").addClass("link"), S.filter(".second").addClass("link"), S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)), S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)), Q.cardboard())
  6320. }
  6321. function d(e, t) {
  6322. switch (t) {
  6323. case y.IOS:
  6324. j = W, Y = G;
  6325. break;
  6326. case y.Desktop:
  6327. e === b.Cardboard ? (j = N, Y = B, S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)), S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F, S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)), Y = "");
  6328. break;
  6329. default:
  6330. Y = e === b.Cardboard ? (j = H, G) : (j = V, z)
  6331. }
  6332. }
  6333. function p(e, t, i) {
  6334. w.find(".inner").addClass("details-page"), w.addClass("details-page"), S.filter(".first").attr("src", e), S.filter(".second").attr("src", t), S.filter(".third").attr("src", i)
  6335. }
  6336. function f() {
  6337. var e = 1 < g.aspectRatio() && g.isMobile();
  6338. w.toggleClass("landscape", e).toggleClass("portrait", !e), w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight), w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  6339. }
  6340. var g = e("../../util/browser"),
  6341. m = e("./vrLink"),
  6342. v = e("../../enum/VRApps"),
  6343. y = e("../../enum/VRPlatforms"),
  6344. A = e("../../enum/VRPages"),
  6345. C = e("./vrEvent"),
  6346. o = (e("../../settings"), e("../../constants")),
  6347. I = e("../../localization/localize"),
  6348. a = e("../../util/common"),
  6349. s = e("events").EventEmitter,
  6350. E = 0,
  6351. _ = null,
  6352. b = A.standard,
  6353. w = $(".vr-popup"),
  6354. l = w.find(".vr-popup-body"),
  6355. T = w.find(".vr-images"),
  6356. x = w.find(".img-container"),
  6357. S = w.find(".vr-sm-image"),
  6358. M = x.find(".vr-img-caption"),
  6359. R = $(".vr-buttons").find(".prev-button"),
  6360. P = $(".vr-buttons").find(".next-button"),
  6361. O = T.find(".front-close"),
  6362. L = $(".vr-page"),
  6363. D = w.find("img"),
  6364. N = "images/apple-store.png",
  6365. F = "images/badge-oculus.png",
  6366. B = "images/badge-cardboard.png",
  6367. V = "images/logo-samsung.png",
  6368. k = "images/headset-cardboard.png",
  6369. U = "images/headset-gearvr.png",
  6370. H = "images/ico-android-robot.png",
  6371. z = "images/ico-gearvr.png",
  6372. G = "images/ico-vr.png",
  6373. W = "images/apple-logo-white.svg",
  6374. j = null,
  6375. Y = null,
  6376. q = {},
  6377. X = {
  6378. init: function (e, t) {
  6379. function i(e) {
  6380. X.emit(C.STORE, {
  6381. type: e
  6382. }), m.launchStore(e)
  6383. }
  6384. function n(e) {
  6385. switch (e !== b.pageCount && (u(e), L.text(e + 1 + " / " + b.pageCount)), e) {
  6386. case b.Title:
  6387. R.css("display", "none"), P.text(a[e]), h(r);
  6388. break;
  6389. case b.Cardboard:
  6390. R.css("display", "block"), P.text(a[e]), x.filter(".cardboard").off(), x.filter(".gearvr").off(), d(e, r), p(k, j, Y);
  6391. break;
  6392. case b.Gear:
  6393. P.text(a[e]), d(e, r), w.addClass("lastPage"), p(U, j, Y);
  6394. break;
  6395. case b.pageCount:
  6396. w.removeClass("fadeIn"), X.emit(C.CLOSED)
  6397. }
  6398. D.filter("[src='']").hide()
  6399. }
  6400. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"), _ = ".show-supported", y.Android) : (w.addClass("unsupported"), _ = ".show-unsupported", y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"), _ = ".show-ios", b = A.ios, y.IOS) : (w.addClass("desktop"), _ = ".show-desktop", y.Desktop);
  6401. function o(e) {
  6402. X.emit(C.LAUNCH, {
  6403. vr_platform: r,
  6404. vr_app: e
  6405. }), m.launch(e)
  6406. }
  6407. m.init(r, e, t), r !== y.Desktop && w.addClass("mobile"), q.cardboardAndroid = o.bind(this, v.CardboardAndroid), q.gear = o.bind(this, v.GearVR), q.cardboardIOS = o.bind(this, v.CardboardIOS), f(), $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(), $(_).show();
  6408. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS],
  6409. s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  6410. r === y.IOS && (a.splice(1, 1), s.splice(1, 1)), $("#vr").on("click", function (e) {
  6411. e.preventDefault(), window.vrEnabled || (window.vrEnabled = !0, this.classList.add("active"), $("#gui div").not("#vrOff").addClass("vrHide"), $("#vrOffImg").css({
  6412. display: "inline-block"
  6413. }))
  6414. }), $("#vrOff").on("click", function () {
  6415. window.vrEnabled = !1, $("#gui div").not("#vrOff").removeClass("vrHide"), $("#vrOffImg").css({
  6416. display: "none"
  6417. }), $("#player canvas").css({
  6418. width: "",
  6419. height: ""
  6420. }), $("#vr").removeClass("active")
  6421. });
  6422. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  6423. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)), $(".gearLink").on("click", i.bind(this, v.GearVR)), $("span.modelLink").text(l), R.on("click", function (e) {
  6424. X.emit(C.PREV), n(--E)
  6425. }), P.on("click", function (e) {
  6426. P.text(), X.emit(C.NEXT, {
  6427. nextAction: s[E]
  6428. }), n(++E)
  6429. }), w.find(".close").on("click", X.dismiss)
  6430. },
  6431. dismiss: function () {
  6432. w.hasClass("fadeIn") && (w.removeClass("fadeIn"), X.emit(C.CLOSED))
  6433. },
  6434. isDeviceSupported: c
  6435. };
  6436. a.extendObject(X, s.prototype), $(window).resize(f);
  6437. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"), K = M.filter(".first").find(".gearvr"), {
  6438. cardboard: function () {
  6439. K.addClass("hidden"), Z.removeClass("hidden")
  6440. },
  6441. gearvr: function () {
  6442. Z.addClass("hidden"), K.removeClass("hidden")
  6443. }
  6444. });
  6445. t.exports = X
  6446. }, {
  6447. "../../constants": 8,
  6448. "../../enum/VRApps": 46,
  6449. "../../enum/VRPages": 48,
  6450. "../../enum/VRPlatforms": 49,
  6451. "../../localization/localize": 108,
  6452. "../../settings": 166,
  6453. "../../util/browser": 182,
  6454. "../../util/common": 185,
  6455. "./vrEvent": 85,
  6456. "./vrLink": 86,
  6457. events: 202
  6458. }],
  6459. 88: [function (e, t, i) {
  6460. "use strict";
  6461. t.exports = Object.freeze({
  6462. OPENED: "webvr.modal.opened",
  6463. SHOW_TERMS: "webvr.footer.show.terms"
  6464. })
  6465. }, {}],
  6466. 89: [function (B, V, e) {
  6467. (function (e) {
  6468. "use strict";
  6469. function a() {
  6470. function t() {
  6471. p.isPresenting || (r.info("exiting webVR"), c("webvr_exit_app"), -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location, window.removeEventListener("vrdisplaypresentchange", t))
  6472. }
  6473. r.info("Headset mounted"), u.suspend();
  6474. var e = document.createElement("canvas");
  6475. for (e.getContext("webgl"), e.className = "webvr-canvas", document.bgColor = "#000", document.body.style.backgroundColor = "#000"; document.body.firstChild;) document.body.removeChild(document.body.firstChild);
  6476. document.body.appendChild(e), c("webvr_enter_app"), p.requestPresent([{
  6477. source: e,
  6478. predistorted: !0
  6479. }]).catch(function (e) {
  6480. r.error("Failed to present: " + e), c("webvr_exit_calibrate"), t()
  6481. }), d.then(function () {
  6482. window.dispatchEvent(new Event("vrapp-start"))
  6483. }), window.addEventListener("vrdisplaypresentchange", t)
  6484. }
  6485. function s() {
  6486. c("webvr_modal_close"), _.find(".enter-button").off("click", a), E.fadeOut(g.guiAnimationSpeed, function () {
  6487. _.toggleClass("hidden", !1), b.toggleClass("hidden", !0), f.exitFullscreen()
  6488. }), I.fadeIn(g.guiAnimationSpeed)
  6489. }
  6490. function t() {
  6491. M.toggleClass("hidden", !0), S.toggleClass("hidden", !1)
  6492. }
  6493. function l() {
  6494. _.toggleClass("hidden"), b.toggleClass("hidden")
  6495. }
  6496. function c(e) {
  6497. var t = f.isLandscape() ? "landscape" : "portrait";
  6498. i.trackAlways("showcase_gui", {
  6499. gui_action: e,
  6500. orientation: t
  6501. })
  6502. }
  6503. function h() {
  6504. var e = f.isLandscape();
  6505. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  6506. }
  6507. var u, d, p, f = B("../../util/browser"),
  6508. g = B("../../settings"),
  6509. m = (B("./../gui"), B("../../enum/VRPlatforms")),
  6510. v = B("../../enum/VRApps"),
  6511. y = B("./../vr/vrLink"),
  6512. A = B("./WebVrEvent"),
  6513. i = B("../../analytics"),
  6514. C = (B("../../constants"), B("../../localization/localize")),
  6515. n = B("../../util/common"),
  6516. r = new(B("../../util/logger"))(e),
  6517. o = B("events").EventEmitter,
  6518. I = $("#gui"),
  6519. E = $(".webvr-popup"),
  6520. _ = $(".webvr-popup .page.p1"),
  6521. b = $(".webvr-popup .page.p2"),
  6522. w = E.find(".image"),
  6523. T = $(".webvr-popup .detail.headset"),
  6524. x = $(".webvr-popup .detail.phone"),
  6525. S = $(".webvr-popup .tab-content.webvr"),
  6526. M = $(".webvr-popup .tab-content.native"),
  6527. R = "images/headset-cardboard.png",
  6528. P = "https://madeby.google.com/vr/",
  6529. O = "webvr_daydream_link",
  6530. L = P,
  6531. D = O,
  6532. N = {
  6533. init: function (e, t, i, n) {
  6534. function r(e) {
  6535. e.preventDefault(), o(e.currentTarget.id)
  6536. }
  6537. function o(i) {
  6538. F[i](), Object.keys(F).map(function (e, t) {
  6539. $("#" + e).toggleClass("tabs-underlined", e === i)
  6540. })
  6541. }
  6542. p = i, u = t, y.init(m.Android, e, n), h(), new RegExp("daydream", "i").test(p.displayName) ? (o("tabdaydream"), w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"), _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"), w.filter(".device-headset-side").attr("src", R), _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))), $("#vr").on("click", function (e) {
  6543. e.preventDefault(), c("click_webvr_button"), E.is(":hidden") && (N.emit(A.OPENED), I.fadeOut(g.guiAnimationSpeed), E.fadeIn(g.guiAnimationSpeed), function () {
  6544. if (!d) {
  6545. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  6546. d = new Promise(function (e, t) {
  6547. var i = document.createElement("script");
  6548. i.type = "text/javascript", i.src = n, i.onload = e, document.head.appendChild(i)
  6549. })
  6550. }
  6551. _.find(".enter-button").on("click", a)
  6552. }())
  6553. }), $(".webvr-popup .close").on("click", function (e) {
  6554. e.preventDefault(), _.hasClass("hidden") ? (c("webvr_help_close"), l()) : s()
  6555. }), $("#tabcardboard").on("click", r), $("#tabdaydream").on("click", r), $("#tabnative").on("click", r), $(".webvr-popup .open-with-app").on("click", function (e) {
  6556. e.preventDefault(), c("webvr_learn_more"), o("tabnative"), l()
  6557. }), $(".webvr-popup .help").on("click", function (e) {
  6558. e.preventDefault(), c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"), l()
  6559. }), $(".webvr-popup .terms").on("click", function (e) {
  6560. e.preventDefault(), c("webvr_click_terms"), s(), N.emit(A.SHOW_TERMS)
  6561. }), T.on("click", function (e) {
  6562. e.preventDefault(), c(D), window.open(L, "_blank")
  6563. }), x.on("click", function (e) {
  6564. e.preventDefault(), c("webvr_phone_link"), window.open("https://vr.google.com/daydream/phones/", "_blank")
  6565. }), $(".webvr-popup .badge-cardboard").on("click", function (e) {
  6566. e.preventDefault(), c("webvr_cardboard_link"), y.launch(v.CardboardAndroid)
  6567. }), $(".webvr-popup .badge-oculus").on("click", function (e) {
  6568. e.preventDefault(), c("webvr_oculus_link"), y.launch(v.GearVR)
  6569. })
  6570. }
  6571. },
  6572. F = {
  6573. tabcardboard: function () {
  6574. w.filter(".device-headset").attr("src", R), w.filter(".device-phone").attr("src", "images/ico-android-robot.png"), L = "https://vr.google.com/cardboard/get-cardboard/", D = "webvr_cardboard_link", T.text(C.localizeText("VR_GOOGLE_CARDBOARD")), x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")), $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0), t()
  6575. },
  6576. tabdaydream: function () {
  6577. w.filter(".device-headset").attr("src", "images/device-daydream.png"), w.filter(".device-phone").attr("src", "images/device-pixel.png"), L = P, D = O, T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")), x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")), $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1), t()
  6578. },
  6579. tabnative: function () {
  6580. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"), w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"), M.toggleClass("hidden", !1), S.toggleClass("hidden", !0)
  6581. }
  6582. };
  6583. n.extendObject(N, o.prototype), $(window).resize(h), V.exports = N
  6584. }).call(this, "/js/gui/webvr/webVRgui.js")
  6585. }, {
  6586. "../../analytics": 4,
  6587. "../../constants": 8,
  6588. "../../enum/VRApps": 46,
  6589. "../../enum/VRPlatforms": 49,
  6590. "../../localization/localize": 108,
  6591. "../../settings": 166,
  6592. "../../util/browser": 182,
  6593. "../../util/common": 185,
  6594. "../../util/logger": 189,
  6595. "./../gui": 65,
  6596. "./../vr/vrLink": 86,
  6597. "./WebVrEvent": 88,
  6598. events: 202
  6599. }],
  6600. 90: [function (e, t, i) {
  6601. "use strict";
  6602. function n(e, t, i, n, r) {
  6603. this.floorId = n || 0 === n ? n : -1, this.roomId = r || "", this.labelId = e, this.position = (new o.Vector3).copy(t), this.text = i
  6604. }
  6605. var o = e("three"),
  6606. r = e("../util/browser");
  6607. n.prototype.build = function () {
  6608. var e = window.document.createElement("div");
  6609. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  6610. var t = window.document.createElement("div");
  6611. t.setAttribute("class", "gui-floorplan-label-text");
  6612. var i = window.document.createTextNode(this.text);
  6613. t.appendChild(i), e.appendChild(t), window.document.body.appendChild(e), this.labelGui = e, this.textBlock = t, $(this.labelGui).hide();
  6614. var n = window.getComputedStyle(this.labelGui);
  6615. this.initialTransform = n.transform || n.webkitTransform
  6616. }, t.exports = n
  6617. }, {
  6618. "../util/browser": 182,
  6619. three: 217
  6620. }],
  6621. 91: [function (e, t, i) {
  6622. "use strict";
  6623. function n() {
  6624. this.player = null, this.modelManager = null, this.container = null
  6625. }
  6626. var c, o, r = e("three"),
  6627. a = (e("../util/common"), e("../enum/PlayerEvents")),
  6628. s = (e("../enum/DirectorEvents"), e("../enum/ModelManagerEvents")),
  6629. l = e("../settings"),
  6630. h = e("../enum/Viewmode"),
  6631. u = (e("../enum/WarpStyle"), e("../util/transitions"), e("../util/lerp"), e("../util/browser"));
  6632. n.prototype.init = function (e, t, i) {
  6633. this.player = e, this.modelManager = t, this.container = i, this.updateModel(), this.bindEvents()
  6634. }, n.prototype.bindEvents = function () {
  6635. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)), this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)), this.player.on(a.StartInside, this.handleStartInside.bind(this)), this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  6636. }, n.prototype.updateModel = function () {
  6637. this.model = this.modelManager.getActiveModel()
  6638. }, n.prototype.handlePlayerViewChanged = function () {
  6639. this.updateLabelVisibility(), this.updateLabelDisplay()
  6640. }, n.prototype.getLabelsForFloor = function (t, i) {
  6641. return (i = i || []).length = 0, this.model.labels.forEach(function (e) {
  6642. this.labelVisibleForFloor(e, t) && i.push(e)
  6643. }.bind(this)), i
  6644. }, n.prototype.getLabelsForCurrentFloor = function (e) {
  6645. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  6646. }, n.prototype.labelVisibleForFloor = function (e, t) {
  6647. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  6648. if (!this.model.showingLabels || !e.labelGui || !i) return !1;
  6649. var n = e.floorId === this.model.floors.size() - 1;
  6650. return this.model.allFloorsVisible ? n : e.floorId === t
  6651. }, n.prototype.updateLabelVisibility = function (e) {
  6652. this.model.labels.forEach(function (e) {
  6653. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  6654. }.bind(this))
  6655. }, n.prototype.showAllLabels = function (t, i) {
  6656. this.model.labels.forEach(function (e) {
  6657. this.showLabel(e, t, i)
  6658. }.bind(this))
  6659. }, n.prototype.hideAllLabels = function (t, i) {
  6660. this.model.labels.forEach(function (e) {
  6661. this.hideLabel(e, t, i)
  6662. }.bind(this))
  6663. }, n.prototype.showLabel = function (e, t, i) {
  6664. this.model.showingLabels && (e.visible || (e.visible = !0, e.labelGui.style.display = "block", e.labelGui.style.opacity = 0, $(e.labelGui).delay(t).fadeTo(i, 1)))
  6665. }, n.prototype.hideLabel = function (e, t, i) {
  6666. e.visible && (e.visible = !1, u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  6667. }, n.prototype.supportedMode = function () {
  6668. return this.player.mode === h.FLOORPLAN
  6669. }, n.prototype.updateLabelDisplay = (new r.Vector3, new r.Vector3, o = [], function () {
  6670. var e = this.player.getLabelScaleFactor(),
  6671. t = 1.2 * (1 - e) + .6,
  6672. i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  6673. this.getLabelsForCurrentFloor(o);
  6674. for (var n = 0; n < o.length; n++) {
  6675. var r = o[n];
  6676. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t), i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  6677. }
  6678. }), n.prototype.updateProjectedGuiElement = (c = new r.Vector3, new r.Vector3, function (e, t, i, n, r) {
  6679. t.style.fontSize = 100 * r + "%";
  6680. var o = .5 * $("#player").width(),
  6681. a = .5 * $("#player").height();
  6682. c.copy(i), c.project(this.player.camera);
  6683. var s = c.x * o + o,
  6684. l = -c.y * a + a;
  6685. s -= e.offsetWidth / 2, l -= e.offsetHeight / 2, e.style.left = s + "px", e.style.top = l + "px"
  6686. }), n.prototype.handleStartInside = function (e) {
  6687. this.updateLabelVisibility()
  6688. }, n.prototype.handleStartOutside = function () {
  6689. this.updateLabelVisibility()
  6690. }, t.exports = n
  6691. }, {
  6692. "../enum/DirectorEvents": 23,
  6693. "../enum/ModelManagerEvents": 33,
  6694. "../enum/PlayerEvents": 40,
  6695. "../enum/Viewmode": 51,
  6696. "../enum/WarpStyle": 52,
  6697. "../settings": 166,
  6698. "../util/browser": 182,
  6699. "../util/common": 185,
  6700. "../util/lerp": 188,
  6701. "../util/transitions": 195,
  6702. three: 217
  6703. }],
  6704. 92: [function (e, t, i) {
  6705. "use strict";
  6706. Array.prototype.findIndex || (Array.prototype.findIndex = function (e) {
  6707. if (null == this) throw new TypeError("Array.prototype.findIndex called on null or undefined");
  6708. if ("function" != typeof e) throw new TypeError("predicate must be a function");
  6709. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  6710. if (t = i[o], e.call(r, t, o, i)) return o;
  6711. return -1
  6712. }), Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  6713. value: function (e) {
  6714. if (null == this) throw new TypeError('"this" is null or not defined');
  6715. var t = Object(this),
  6716. i = t.length >>> 0;
  6717. if ("function" != typeof e) throw new TypeError("predicate must be a function");
  6718. for (var n = arguments[1], r = 0; r < i;) {
  6719. var o = t[r];
  6720. if (e.call(n, o, r, t)) return o;
  6721. r++
  6722. }
  6723. }
  6724. })
  6725. }, {}],
  6726. 93: [function (e, t, i) {
  6727. "use strict";
  6728. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  6729. function te() {
  6730. this.backgroundElement = document.createElement("div"), r.extend(this.backgroundElement.style, {
  6731. backgroundColor: "rgba(0,0,0,0.8)",
  6732. top: 0,
  6733. left: 0,
  6734. display: "none",
  6735. zIndex: "1000",
  6736. opacity: 0,
  6737. WebkitTransition: "opacity 0.2s linear"
  6738. }), n.makeFullscreen(this.backgroundElement), this.backgroundElement.style.position = "fixed", this.domElement = document.createElement("div"), r.extend(this.domElement.style, {
  6739. position: "fixed",
  6740. display: "none",
  6741. zIndex: "1001",
  6742. opacity: 0,
  6743. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  6744. }), document.body.appendChild(this.backgroundElement), document.body.appendChild(this.domElement);
  6745. var e = this;
  6746. n.bind(this.backgroundElement, "click", function () {
  6747. e.hide()
  6748. })
  6749. }
  6750. function ie(e, t, i) {
  6751. Object.defineProperty(e, t, {
  6752. get: function () {
  6753. return "RGB" === this.__state.space || re(this, t, i), this.__state[t]
  6754. },
  6755. set: function (e) {
  6756. "RGB" !== this.__state.space && (re(this, t, i), this.__state.space = "RGB"), this.__state[t] = e
  6757. }
  6758. })
  6759. }
  6760. function ne(e, t) {
  6761. Object.defineProperty(e, t, {
  6762. get: function () {
  6763. return "HSV" === this.__state.space || oe(this), this.__state[t]
  6764. },
  6765. set: function (e) {
  6766. "HSV" !== this.__state.space && (oe(this), this.__state.space = "HSV"), this.__state[t] = e
  6767. }
  6768. })
  6769. }
  6770. function re(e, t, i) {
  6771. if ("HEX" === e.__state.space) e.__state[t] = a.component_from_hex(e.__state.hex, i);
  6772. else {
  6773. if ("HSV" !== e.__state.space) throw "Corrupted color state";
  6774. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  6775. }
  6776. }
  6777. function oe(e) {
  6778. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  6779. l.extend(e.__state, {
  6780. s: t.s,
  6781. v: t.v
  6782. }), l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  6783. }
  6784. function ae() {
  6785. if (this.__state = o.apply(this, arguments), !1 === this.__state) throw "Failed to interpret color arguments";
  6786. this.__state.a = this.__state.a || 1
  6787. }
  6788. function se(e) {
  6789. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  6790. }
  6791. function le(e, t) {
  6792. this.initialValue = e[t], this.domElement = document.createElement("div"), this.object = e, this.property = t, this.__onChange = void 0, this.__onFinishChange = void 0
  6793. }(t.exports = ee).gui = ee.gui || {}, ee.utils = ee.utils || {}, ee.controllers = ee.controllers || {}, ee.dom = ee.dom || {}, ee.color = ee.color || {}, ee.utils.css = {
  6794. load: function (e, t) {
  6795. var i = (t = t || document).createElement("link");
  6796. i.type = "text/css", i.rel = "stylesheet", i.href = e, t.getElementsByTagName("head")[0].appendChild(i)
  6797. },
  6798. inject: function (e, t) {
  6799. t = t || document;
  6800. var i = document.createElement("style");
  6801. i.type = "text/css", i.innerHTML = e, t.getElementsByTagName("head")[0].appendChild(i)
  6802. }
  6803. }, ee.utils.common = (Q = Array.prototype.forEach, J = Array.prototype.slice, {
  6804. BREAK: {},
  6805. extend: function (i) {
  6806. return this.each(J.call(arguments, 1), function (e) {
  6807. for (var t in e) this.isUndefined(e[t]) || (i[t] = e[t])
  6808. }, this), i
  6809. },
  6810. defaults: function (i) {
  6811. return this.each(J.call(arguments, 1), function (e) {
  6812. for (var t in e) this.isUndefined(i[t]) && (i[t] = e[t])
  6813. }, this), i
  6814. },
  6815. compose: function () {
  6816. var i = J.call(arguments);
  6817. return function () {
  6818. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--) e = [i[t].apply(this, e)];
  6819. return e[0]
  6820. }
  6821. },
  6822. each: function (e, t, i) {
  6823. if (e)
  6824. if (Q && e.forEach && e.forEach === Q) e.forEach(t, i);
  6825. else if (e.length === e.length + 0) {
  6826. for (var n = 0, r = e.length; n < r; n++)
  6827. if (n in e && t.call(i, e[n], n) === this.BREAK) return
  6828. } else
  6829. for (var n in e)
  6830. if (t.call(i, e[n], n) === this.BREAK) return
  6831. },
  6832. defer: function (e) {
  6833. setTimeout(e, 0)
  6834. },
  6835. toArray: function (e) {
  6836. return e.toArray ? e.toArray() : J.call(e)
  6837. },
  6838. isUndefined: function (e) {
  6839. return void 0 === e
  6840. },
  6841. isNull: function (e) {
  6842. return null === e
  6843. },
  6844. isNaN: function (e) {
  6845. return e != e
  6846. },
  6847. isArray: Array.isArray || function (e) {
  6848. return e.constructor === Array
  6849. },
  6850. isObject: function (e) {
  6851. return e === Object(e)
  6852. },
  6853. isNumber: function (e) {
  6854. return e === e + 0
  6855. },
  6856. isString: function (e) {
  6857. return e === e + ""
  6858. },
  6859. isBoolean: function (e) {
  6860. return !1 === e || !0 === e
  6861. },
  6862. isFunction: function (e) {
  6863. return "[object Function]" === Object.prototype.toString.call(e)
  6864. }
  6865. }), ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  6866. onChange: function (e) {
  6867. return this.__onChange = e, this
  6868. },
  6869. onFinishChange: function (e) {
  6870. return this.__onFinishChange = e, this
  6871. },
  6872. setValue: function (e) {
  6873. return this.object[this.property] = e, this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this
  6874. },
  6875. getValue: function () {
  6876. return this.object[this.property]
  6877. },
  6878. updateDisplay: function () {
  6879. return this
  6880. },
  6881. isModified: function () {
  6882. return this.initialValue !== this.getValue()
  6883. }
  6884. }), le), ee.dom.dom = function (c) {
  6885. function i(e) {
  6886. if ("0" === e || c.isUndefined(e)) return 0;
  6887. var t = e.match(n);
  6888. return c.isNull(t) ? 0 : parseFloat(t[1])
  6889. }
  6890. var h = {};
  6891. c.each({
  6892. HTMLEvents: ["change"],
  6893. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  6894. KeyboardEvents: ["keydown"]
  6895. }, function (e, t) {
  6896. c.each(e, function (e) {
  6897. h[e] = t
  6898. })
  6899. });
  6900. var n = /(\d+(\.\d+)?)px/,
  6901. r = {
  6902. makeSelectable: function (e, t) {
  6903. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function () {
  6904. return !1
  6905. } : function () {}, e.style.MozUserSelect = t ? "auto" : "none", e.style.KhtmlUserSelect = t ? "auto" : "none", e.unselectable = t ? "on" : "off")
  6906. },
  6907. makeFullscreen: function (e, t, i) {
  6908. c.isUndefined(t) && (t = !0), c.isUndefined(i) && (i = !0), e.style.position = "absolute", t && (e.style.left = 0, e.style.right = 0), i && (e.style.top = 0, e.style.bottom = 0)
  6909. },
  6910. fakeEvent: function (e, t, i, n) {
  6911. i = i || {};
  6912. var r = h[t];
  6913. if (!r) throw new Error("Event type " + t + " not supported.");
  6914. var o = document.createEvent(r);
  6915. switch (r) {
  6916. case "MouseEvents":
  6917. var a = i.x || i.clientX || 0,
  6918. s = i.y || i.clientY || 0;
  6919. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  6920. break;
  6921. case "KeyboardEvents":
  6922. var l = o.initKeyboardEvent || o.initKeyEvent;
  6923. c.defaults(i, {
  6924. cancelable: !0,
  6925. ctrlKey: !1,
  6926. altKey: !1,
  6927. shiftKey: !1,
  6928. metaKey: !1,
  6929. keyCode: void 0,
  6930. charCode: void 0
  6931. }), l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  6932. break;
  6933. default:
  6934. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  6935. }
  6936. c.defaults(o, n), e.dispatchEvent(o)
  6937. },
  6938. bind: function (e, t, i, n) {
  6939. return n = n || !1, e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i), r
  6940. },
  6941. unbind: function (e, t, i, n) {
  6942. return n = n || !1, e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i), r
  6943. },
  6944. addClass: function (e, t) {
  6945. if (void 0 === e.className) e.className = t;
  6946. else if (e.className !== t) {
  6947. var i = e.className.split(/ +/); - 1 == i.indexOf(t) && (i.push(t), e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  6948. }
  6949. return r
  6950. },
  6951. removeClass: function (e, t) {
  6952. if (t)
  6953. if (void 0 === e.className);
  6954. else if (e.className === t) e.removeAttribute("class");
  6955. else {
  6956. var i = e.className.split(/ +/),
  6957. n = i.indexOf(t); - 1 != n && (i.splice(n, 1), e.className = i.join(" "))
  6958. } else e.className = void 0;
  6959. return r
  6960. },
  6961. hasClass: function (e, t) {
  6962. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  6963. },
  6964. getWidth: function (e) {
  6965. var t = getComputedStyle(e);
  6966. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  6967. },
  6968. getHeight: function (e) {
  6969. var t = getComputedStyle(e);
  6970. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  6971. },
  6972. getOffset: function (e) {
  6973. var t = {
  6974. left: 0,
  6975. top: 0
  6976. };
  6977. if (e.offsetParent)
  6978. for (; t.left += e.offsetLeft, t.top += e.offsetTop, e = e.offsetParent;);
  6979. return t
  6980. },
  6981. isActive: function (e) {
  6982. return e === document.activeElement && (e.type || e.href)
  6983. }
  6984. };
  6985. return r
  6986. }(ee.utils.common), ee.controllers.OptionController = (q = ee.controllers.Controller, X = ee.dom.dom, Z = ee.utils.common, (K = function (e, t, i) {
  6987. K.superclass.call(this, e, t);
  6988. var n = this;
  6989. if (this.__select = document.createElement("select"), Z.isArray(i)) {
  6990. var r = {};
  6991. Z.each(i, function (e) {
  6992. r[e] = e
  6993. }), i = r
  6994. }
  6995. Z.each(i, function (e, t) {
  6996. var i = document.createElement("option");
  6997. i.innerHTML = t, i.setAttribute("value", e), n.__select.appendChild(i)
  6998. }), this.updateDisplay(), X.bind(this.__select, "change", function () {
  6999. var e = this.options[this.selectedIndex].value;
  7000. n.setValue(e)
  7001. }), this.domElement.appendChild(this.__select)
  7002. }).superclass = q, Z.extend(K.prototype, q.prototype, {
  7003. setValue: function (e) {
  7004. var t = K.superclass.prototype.setValue.call(this, e);
  7005. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  7006. },
  7007. updateDisplay: function () {
  7008. return this.__select.value = this.getValue(), K.superclass.prototype.updateDisplay.call(this)
  7009. }
  7010. }), K), ee.controllers.NumberController = (W = ee.controllers.Controller, j = ee.utils.common, (Y = function (e, t, i) {
  7011. Y.superclass.call(this, e, t), i = i || {}, this.__min = i.min, this.__max = i.max, this.__step = i.step, j.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step, this.__precision = se(this.__impliedStep)
  7012. }).superclass = W, j.extend(Y.prototype, W.prototype, {
  7013. setValue: function (e) {
  7014. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max), void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step), Y.superclass.prototype.setValue.call(this, e)
  7015. },
  7016. min: function (e) {
  7017. return this.__min = e, this
  7018. },
  7019. max: function (e) {
  7020. return this.__max = e, this
  7021. },
  7022. step: function (e) {
  7023. return this.__step = e, this.__impliedStep = e, this.__precision = se(e), this
  7024. }
  7025. }), Y), ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController, H = ee.dom.dom, z = ee.utils.common, (G = function (e, t, i) {
  7026. function n() {
  7027. var e = parseFloat(s.__input.value);
  7028. z.isNaN(e) || s.setValue(e)
  7029. }
  7030. function r(e) {
  7031. var t = a - e.clientY;
  7032. s.setValue(s.getValue() + t * s.__impliedStep), a = e.clientY
  7033. }
  7034. function o() {
  7035. H.unbind(window, "mousemove", r), H.unbind(window, "mouseup", o)
  7036. }
  7037. this.__truncationSuspended = !1, G.superclass.call(this, e, t, i);
  7038. var a, s = this;
  7039. this.__input = document.createElement("input"), this.__input.setAttribute("type", "text"), H.bind(this.__input, "change", n), H.bind(this.__input, "blur", function () {
  7040. n(), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  7041. }), H.bind(this.__input, "mousedown", function (e) {
  7042. H.bind(window, "mousemove", r), H.bind(window, "mouseup", o), a = e.clientY
  7043. }), H.bind(this.__input, "keydown", function (e) {
  7044. 13 === e.keyCode && (s.__truncationSuspended = !0, this.blur(), s.__truncationSuspended = !1)
  7045. }), this.updateDisplay(), this.domElement.appendChild(this.__input)
  7046. }).superclass = U, z.extend(G.prototype, U.prototype, {
  7047. updateDisplay: function () {
  7048. return this.__input.value = this.__truncationSuspended ? this.getValue() : function (e, t) {
  7049. var i = Math.pow(10, t);
  7050. return Math.round(e * i) / i
  7051. }(this.getValue(), this.__precision), G.superclass.prototype.updateDisplay.call(this)
  7052. }
  7053. }), G), ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController, F = ee.dom.dom, B = ee.utils.css, V = ee.utils.common, (k = function (e, t, i, n, r) {
  7054. function o(e) {
  7055. e.preventDefault();
  7056. var t = F.getOffset(s.__background),
  7057. i = F.getWidth(s.__background);
  7058. return s.setValue(function (e, t, i, n, r) {
  7059. return n + (e - t) / (i - t) * (r - n)
  7060. }(e.clientX, t.left, t.left + i, s.__min, s.__max)), !1
  7061. }
  7062. function a() {
  7063. F.unbind(window, "mousemove", o), F.unbind(window, "mouseup", a), s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  7064. }
  7065. k.superclass.call(this, e, t, {
  7066. min: i,
  7067. max: n,
  7068. step: r
  7069. });
  7070. var s = this;
  7071. this.__background = document.createElement("div"), this.__foreground = document.createElement("div"), F.bind(this.__background, "mousedown", function (e) {
  7072. F.bind(window, "mousemove", o), F.bind(window, "mouseup", a), o(e)
  7073. }), F.addClass(this.__background, "slider"), F.addClass(this.__foreground, "slider-fg"), this.updateDisplay(), this.__background.appendChild(this.__foreground), this.domElement.appendChild(this.__background)
  7074. }).superclass = N, k.useDefaultStyles = function () {
  7075. B.inject("/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}")
  7076. }, V.extend(k.prototype, N.prototype, {
  7077. updateDisplay: function () {
  7078. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  7079. return this.__foreground.style.width = 100 * e + "%", k.superclass.prototype.updateDisplay.call(this)
  7080. }
  7081. }), k), ee.controllers.FunctionController = (P = ee.controllers.Controller, O = ee.dom.dom, L = ee.utils.common, (D = function (e, t, i) {
  7082. D.superclass.call(this, e, t);
  7083. var n = this;
  7084. this.__button = document.createElement("div"), this.__button.innerHTML = void 0 === i ? "Fire" : i, O.bind(this.__button, "click", function (e) {
  7085. return e.preventDefault(), n.fire(), !1
  7086. }), O.addClass(this.__button, "button"), this.domElement.appendChild(this.__button)
  7087. }).superclass = P, L.extend(D.prototype, P.prototype, {
  7088. fire: function () {
  7089. this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object)
  7090. }
  7091. }), D), ee.controllers.BooleanController = (x = ee.controllers.Controller, S = ee.dom.dom, M = ee.utils.common, (R = function (e, t) {
  7092. R.superclass.call(this, e, t);
  7093. var i = this;
  7094. this.__prev = this.getValue(), this.__checkbox = document.createElement("input"), this.__checkbox.setAttribute("type", "checkbox"), S.bind(this.__checkbox, "change", function () {
  7095. i.setValue(!i.__prev)
  7096. }, !1), this.domElement.appendChild(this.__checkbox), this.updateDisplay()
  7097. }).superclass = x, M.extend(R.prototype, x.prototype, {
  7098. setValue: function (e) {
  7099. var t = R.superclass.prototype.setValue.call(this, e);
  7100. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), t
  7101. },
  7102. updateDisplay: function () {
  7103. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0) : this.__checkbox.checked = !1, R.superclass.prototype.updateDisplay.call(this)
  7104. }
  7105. }), R), ee.color.toString = (T = ee.utils.common, function (e) {
  7106. if (1 == e.a || T.isUndefined(e.a)) {
  7107. for (var t = e.hex.toString(16); t.length < 6;) t = "0" + t;
  7108. return "#" + t
  7109. }
  7110. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  7111. }), ee.color.interpret = (I = ee.color.toString, E = ee.utils.common, w = [{
  7112. litmus: E.isString,
  7113. conversions: {
  7114. THREE_CHAR_HEX: {
  7115. read: function (e) {
  7116. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  7117. return null !== t && {
  7118. space: "HEX",
  7119. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  7120. }
  7121. },
  7122. write: I
  7123. },
  7124. SIX_CHAR_HEX: {
  7125. read: function (e) {
  7126. var t = e.match(/^#([A-F0-9]{6})$/i);
  7127. return null !== t && {
  7128. space: "HEX",
  7129. hex: parseInt("0x" + t[1].toString())
  7130. }
  7131. },
  7132. write: I
  7133. },
  7134. CSS_RGB: {
  7135. read: function (e) {
  7136. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  7137. return null !== t && {
  7138. space: "RGB",
  7139. r: parseFloat(t[1]),
  7140. g: parseFloat(t[2]),
  7141. b: parseFloat(t[3])
  7142. }
  7143. },
  7144. write: I
  7145. },
  7146. CSS_RGBA: {
  7147. read: function (e) {
  7148. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  7149. return null !== t && {
  7150. space: "RGB",
  7151. r: parseFloat(t[1]),
  7152. g: parseFloat(t[2]),
  7153. b: parseFloat(t[3]),
  7154. a: parseFloat(t[4])
  7155. }
  7156. },
  7157. write: I
  7158. }
  7159. }
  7160. }, {
  7161. litmus: E.isNumber,
  7162. conversions: {
  7163. HEX: {
  7164. read: function (e) {
  7165. return {
  7166. space: "HEX",
  7167. hex: e,
  7168. conversionName: "HEX"
  7169. }
  7170. },
  7171. write: function (e) {
  7172. return e.hex
  7173. }
  7174. }
  7175. }
  7176. }, {
  7177. litmus: E.isArray,
  7178. conversions: {
  7179. RGB_ARRAY: {
  7180. read: function (e) {
  7181. return 3 == e.length && {
  7182. space: "RGB",
  7183. r: e[0],
  7184. g: e[1],
  7185. b: e[2]
  7186. }
  7187. },
  7188. write: function (e) {
  7189. return [e.r, e.g, e.b]
  7190. }
  7191. },
  7192. RGBA_ARRAY: {
  7193. read: function (e) {
  7194. return 4 == e.length && {
  7195. space: "RGB",
  7196. r: e[0],
  7197. g: e[1],
  7198. b: e[2],
  7199. a: e[3]
  7200. }
  7201. },
  7202. write: function (e) {
  7203. return [e.r, e.g, e.b, e.a]
  7204. }
  7205. }
  7206. }
  7207. }, {
  7208. litmus: E.isObject,
  7209. conversions: {
  7210. RGBA_OBJ: {
  7211. read: function (e) {
  7212. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  7213. space: "RGB",
  7214. r: e.r,
  7215. g: e.g,
  7216. b: e.b,
  7217. a: e.a
  7218. }
  7219. },
  7220. write: function (e) {
  7221. return {
  7222. r: e.r,
  7223. g: e.g,
  7224. b: e.b,
  7225. a: e.a
  7226. }
  7227. }
  7228. },
  7229. RGB_OBJ: {
  7230. read: function (e) {
  7231. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  7232. space: "RGB",
  7233. r: e.r,
  7234. g: e.g,
  7235. b: e.b
  7236. }
  7237. },
  7238. write: function (e) {
  7239. return {
  7240. r: e.r,
  7241. g: e.g,
  7242. b: e.b
  7243. }
  7244. }
  7245. },
  7246. HSVA_OBJ: {
  7247. read: function (e) {
  7248. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  7249. space: "HSV",
  7250. h: e.h,
  7251. s: e.s,
  7252. v: e.v,
  7253. a: e.a
  7254. }
  7255. },
  7256. write: function (e) {
  7257. return {
  7258. h: e.h,
  7259. s: e.s,
  7260. v: e.v,
  7261. a: e.a
  7262. }
  7263. }
  7264. },
  7265. HSV_OBJ: {
  7266. read: function (e) {
  7267. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  7268. space: "HSV",
  7269. h: e.h,
  7270. s: e.s,
  7271. v: e.v
  7272. }
  7273. },
  7274. write: function (e) {
  7275. return {
  7276. h: e.h,
  7277. s: e.s,
  7278. v: e.v
  7279. }
  7280. }
  7281. }
  7282. }
  7283. }], function () {
  7284. b = !1;
  7285. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  7286. return E.each(w, function (e) {
  7287. if (e.litmus(i)) return E.each(e.conversions, function (e, t) {
  7288. if (_ = e.read(i), !1 === b && !1 !== _) return (b = _).conversionName = t, _.conversion = e, E.BREAK
  7289. }), E.BREAK
  7290. }), b
  7291. }), ee.GUI = ee.gui.GUI = function (e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  7292. function y(e, t, i, n) {
  7293. if (void 0 === t[i]) throw new Error("Object " + t + ' has no property "' + i + '"');
  7294. var r;
  7295. if (n.color) r = new g(t, i);
  7296. else {
  7297. var o = [t, i].concat(n.factoryArgs);
  7298. r = c.apply(e, o)
  7299. }
  7300. n.before instanceof h && (n.before = n.before.__li), C(e, r), m.addClass(r.domElement, "c");
  7301. var a = document.createElement("span");
  7302. m.addClass(a, "property-name"), a.innerHTML = r.property;
  7303. var s = document.createElement("div");
  7304. s.appendChild(a), s.appendChild(r.domElement);
  7305. var l = A(e, s, n.before);
  7306. return m.addClass(l, R.CLASS_CONTROLLER_ROW), m.addClass(l, typeof r.getValue()),
  7307. function (t, i, n) {
  7308. if (n.__li = i, n.__gui = t, v.extend(n, {
  7309. options: function (e) {
  7310. return 1 < arguments.length ? (n.remove(), y(t, n.object, n.property, {
  7311. before: n.__li.nextElementSibling,
  7312. factoryArgs: [v.toArray(arguments)]
  7313. })) : v.isArray(e) || v.isObject(e) ? (n.remove(), y(t, n.object, n.property, {
  7314. before: n.__li.nextElementSibling,
  7315. factoryArgs: [e]
  7316. })) : void 0
  7317. },
  7318. name: function (e) {
  7319. return n.__li.firstElementChild.firstElementChild.innerHTML = e, n
  7320. },
  7321. listen: function () {
  7322. return n.__gui.listen(n), n
  7323. },
  7324. remove: function () {
  7325. return n.__gui.remove(n), n
  7326. }
  7327. }), n instanceof f) {
  7328. var r = new p(n.object, n.property, {
  7329. min: n.__min,
  7330. max: n.__max,
  7331. step: n.__step
  7332. });
  7333. v.each(["updateDisplay", "onChange", "onFinishChange"], function (e) {
  7334. var t = n[e],
  7335. i = r[e];
  7336. n[e] = r[e] = function () {
  7337. var e = Array.prototype.slice.call(arguments);
  7338. return t.apply(n, e), i.apply(r, e)
  7339. }
  7340. }), m.addClass(i, "has-slider"), n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  7341. } else if (n instanceof p) {
  7342. var e = function (e) {
  7343. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(), y(t, n.object, n.property, {
  7344. before: n.__li.nextElementSibling,
  7345. factoryArgs: [n.__min, n.__max, n.__step]
  7346. })) : e
  7347. };
  7348. n.min = v.compose(e, n.min), n.max = v.compose(e, n.max)
  7349. } else n instanceof u ? (m.bind(i, "click", function () {
  7350. m.fakeEvent(n.__checkbox, "click")
  7351. }), m.bind(n.__checkbox, "click", function (e) {
  7352. e.stopPropagation()
  7353. })) : n instanceof d ? (m.bind(i, "click", function () {
  7354. m.fakeEvent(n.__button, "click")
  7355. }), m.bind(i, "mouseover", function () {
  7356. m.addClass(n.__button, "hover")
  7357. }), m.bind(i, "mouseout", function () {
  7358. m.removeClass(n.__button, "hover")
  7359. })) : n instanceof g && (m.addClass(i, "color"), n.updateDisplay = v.compose(function (e) {
  7360. return i.style.borderLeftColor = n.__color.toString(), e
  7361. }, n.updateDisplay), n.updateDisplay());
  7362. n.setValue = v.compose(function (e) {
  7363. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0), e
  7364. }, n.setValue)
  7365. }(e, l, r), e.__controllers.push(r), r
  7366. }
  7367. function A(e, t, i) {
  7368. var n = document.createElement("li");
  7369. return t && n.appendChild(t), i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n), e.onResize(), n
  7370. }
  7371. function C(e, t) {
  7372. var i = e.getRoot(),
  7373. n = i.__rememberedObjects.indexOf(t.object);
  7374. if (-1 != n) {
  7375. var r = i.__rememberedObjectIndecesToControllers[n];
  7376. if (void 0 === r && (r = {}, i.__rememberedObjectIndecesToControllers[n] = r), r[t.property] = t, i.load && i.load.remembered) {
  7377. var o, a = i.load.remembered;
  7378. if (a[e.preset]) o = a[e.preset];
  7379. else {
  7380. if (!a[T]) return;
  7381. o = a[T]
  7382. }
  7383. if (o[n] && void 0 !== o[n][t.property]) {
  7384. var s = o[n][t.property];
  7385. t.initialValue = s, t.setValue(s)
  7386. }
  7387. }
  7388. }
  7389. }
  7390. function I(e, t) {
  7391. return document.location.href + "." + t
  7392. }
  7393. function l(e, t) {
  7394. e.domElement.style.width = t + "px", e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"), e.__closeButton && (e.__closeButton.style.width = t + "px")
  7395. }
  7396. function a(r, o) {
  7397. var a = {};
  7398. return v.each(r.__rememberedObjects, function (e, t) {
  7399. var i = {},
  7400. n = r.__rememberedObjectIndecesToControllers[t];
  7401. v.each(n, function (e, t) {
  7402. i[t] = o ? e.initialValue : e.getValue()
  7403. }), a[t] = i
  7404. }), a
  7405. }
  7406. function E(e, t, i) {
  7407. var n = document.createElement("option");
  7408. n.innerHTML = t, n.value = t, e.__preset_select.appendChild(n), i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  7409. }
  7410. function _(e, t) {
  7411. var i = e.__preset_select[e.__preset_select.selectedIndex];
  7412. i.innerHTML = t ? i.value + "*" : i.value
  7413. }
  7414. e.inject(".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n");
  7415. var b, w, T = "Default",
  7416. x = function () {
  7417. try {
  7418. return "localStorage" in window && null !== window.localStorage
  7419. } catch (e) {
  7420. return !1
  7421. }
  7422. }(),
  7423. S = !0,
  7424. s = !1,
  7425. M = [],
  7426. R = function (t) {
  7427. var i = this;
  7428. this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), m.addClass(this.domElement, "dg"), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], t = t || {}, t = v.defaults(t, {
  7429. autoPlace: !0,
  7430. width: R.DEFAULT_WIDTH
  7431. }), t = v.defaults(t, {
  7432. resizable: t.autoPlace,
  7433. hideable: t.autoPlace
  7434. }), v.isUndefined(t.load) ? t.load = {
  7435. preset: T
  7436. } : t.preset && (t.load.preset = t.preset), v.isUndefined(t.parent) && t.hideable && M.push(this), t.resizable = v.isUndefined(t.parent) && t.resizable, t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  7437. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  7438. if (Object.defineProperties(this, {
  7439. parent: {
  7440. get: function () {
  7441. return t.parent
  7442. }
  7443. },
  7444. scrollable: {
  7445. get: function () {
  7446. return t.scrollable
  7447. }
  7448. },
  7449. autoPlace: {
  7450. get: function () {
  7451. return t.autoPlace
  7452. }
  7453. },
  7454. preset: {
  7455. get: function () {
  7456. return i.parent ? i.getRoot().preset : t.load.preset
  7457. },
  7458. set: function (e) {
  7459. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  7460. function (e) {
  7461. for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  7462. }(this), i.revert()
  7463. }
  7464. },
  7465. width: {
  7466. get: function () {
  7467. return t.width
  7468. },
  7469. set: function (e) {
  7470. t.width = e, l(i, e)
  7471. }
  7472. },
  7473. name: {
  7474. get: function () {
  7475. return t.name
  7476. },
  7477. set: function (e) {
  7478. t.name = e, a && (a.innerHTML = t.name)
  7479. }
  7480. },
  7481. closed: {
  7482. get: function () {
  7483. return t.closed
  7484. },
  7485. set: function (e) {
  7486. t.closed = e, t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED), this.onResize(), i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  7487. }
  7488. },
  7489. load: {
  7490. get: function () {
  7491. return t.load
  7492. }
  7493. },
  7494. useLocalStorage: {
  7495. get: function () {
  7496. return r
  7497. },
  7498. set: function (e) {
  7499. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n), localStorage.setItem(I(0, "isLocal"), e))
  7500. }
  7501. }
  7502. }), v.isUndefined(t.parent)) {
  7503. if (t.closed = !1, m.addClass(this.domElement, R.CLASS_MAIN), m.makeSelectable(this.domElement, !1), x && r) {
  7504. i.useLocalStorage = !0;
  7505. var o = localStorage.getItem(I(0, "gui"));
  7506. o && (t.load = JSON.parse(o))
  7507. }
  7508. this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = R.TEXT_CLOSED, m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON), this.domElement.appendChild(this.__closeButton), m.bind(this.__closeButton, "click", function () {
  7509. i.closed = !i.closed
  7510. })
  7511. } else {
  7512. void 0 === t.closed && (t.closed = !0);
  7513. var a = document.createTextNode(t.name);
  7514. m.addClass(a, "controller-name");
  7515. var s = A(i, a);
  7516. m.addClass(this.__ul, R.CLASS_CLOSED), m.addClass(s, "title"), m.bind(s, "click", function (e) {
  7517. return e.preventDefault(), i.closed = !i.closed, !1
  7518. }), t.closed || (this.closed = !1)
  7519. }
  7520. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"), m.addClass(w, "dg"), m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(w), S = !1), w.appendChild(this.domElement), m.addClass(this.domElement, R.CLASS_AUTO_PLACE)), this.parent || l(i, t.width)), m.bind(window, "resize", function () {
  7521. i.onResize()
  7522. }), m.bind(this.__ul, "webkitTransitionEnd", function () {
  7523. i.onResize()
  7524. }), m.bind(this.__ul, "transitionend", function () {
  7525. i.onResize()
  7526. }), m.bind(this.__ul, "oTransitionEnd", function () {
  7527. i.onResize()
  7528. }), this.onResize(), t.resizable && function (t) {
  7529. function e(e) {
  7530. return e.preventDefault(), r = e.clientX, m.addClass(t.__closeButton, R.CLASS_DRAG), m.bind(window, "mousemove", i), m.bind(window, "mouseup", n), !1
  7531. }
  7532. function i(e) {
  7533. return e.preventDefault(), t.width += r - e.clientX, t.onResize(), r = e.clientX, !1
  7534. }
  7535. function n() {
  7536. m.removeClass(t.__closeButton, R.CLASS_DRAG), m.unbind(window, "mousemove", i), m.unbind(window, "mouseup", n)
  7537. }
  7538. var r;
  7539. t.__resize_handle = document.createElement("div"), v.extend(t.__resize_handle.style, {
  7540. width: "6px",
  7541. marginLeft: "-3px",
  7542. height: "200px",
  7543. cursor: "ew-resize",
  7544. position: "absolute"
  7545. }), m.bind(t.__resize_handle, "mousedown", e), m.bind(t.__closeButton, "mousedown", e), t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  7546. }(this), n = function () {
  7547. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  7548. }, this.saveToLocalStorageIfPossible = n, i.getRoot(), t.parent || ((e = i.getRoot()).width += 1, v.defer(function () {
  7549. e.width -= 1
  7550. }))
  7551. };
  7552. return R.toggleHide = function () {
  7553. s = !s, v.each(M, function (e) {
  7554. e.domElement.style.zIndex = s ? -999 : 999, e.domElement.style.opacity = s ? 0 : 1
  7555. })
  7556. }, R.CLASS_AUTO_PLACE = "a", R.CLASS_AUTO_PLACE_CONTAINER = "ac", R.CLASS_MAIN = "main", R.CLASS_CONTROLLER_ROW = "cr", R.CLASS_TOO_TALL = "taller-than-window", R.CLASS_CLOSED = "closed", R.CLASS_CLOSE_BUTTON = "close-button", R.CLASS_DRAG = "drag", R.DEFAULT_WIDTH = 245, R.TEXT_CLOSED = "Close Controls", R.TEXT_OPEN = "Open Controls", m.bind(window, "keydown", function (e) {
  7557. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  7558. }, !1), v.extend(R.prototype, {
  7559. add: function (e, t) {
  7560. return y(this, e, t, {
  7561. factoryArgs: Array.prototype.slice.call(arguments, 2)
  7562. })
  7563. },
  7564. addColor: function (e, t) {
  7565. return y(this, e, t, {
  7566. color: !0
  7567. })
  7568. },
  7569. remove: function (e) {
  7570. this.__ul.removeChild(e.__li), this.__controllers.slice(this.__controllers.indexOf(e), 1);
  7571. var t = this;
  7572. v.defer(function () {
  7573. t.onResize()
  7574. })
  7575. },
  7576. destroy: function () {
  7577. this.autoPlace && w.removeChild(this.domElement)
  7578. },
  7579. addFolder: function (e) {
  7580. if (void 0 !== this.__folders[e]) throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  7581. var t = {
  7582. name: e,
  7583. parent: this
  7584. };
  7585. t.autoPlace = this.autoPlace, this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed, t.load = this.load.folders[e]);
  7586. var i = new R(t);
  7587. this.__folders[e] = i;
  7588. var n = A(this, i.domElement);
  7589. return m.addClass(n, "folder"), i
  7590. },
  7591. open: function () {
  7592. this.closed = !1
  7593. },
  7594. close: function () {
  7595. this.closed = !0
  7596. },
  7597. onResize: function () {
  7598. var t = this.getRoot();
  7599. if (t.scrollable) {
  7600. var e = m.getOffset(t.__ul).top,
  7601. i = 0;
  7602. v.each(t.__ul.childNodes, function (e) {
  7603. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  7604. }), $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL), t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL), t.__ul.style.height = "auto")
  7605. }
  7606. t.__resize_handle && v.defer(function () {
  7607. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  7608. }), t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  7609. },
  7610. remember: function () {
  7611. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>'), this.parent) throw new Error("You can only call remember on a top level GUI.");
  7612. var t = this;
  7613. v.each(Array.prototype.slice.call(arguments), function (e) {
  7614. 0 == t.__rememberedObjects.length && function (i) {
  7615. var e = i.__save_row = document.createElement("li");
  7616. m.addClass(i.domElement, "has-save"), i.__ul.insertBefore(e, i.__ul.firstChild), m.addClass(e, "save-row");
  7617. var t = document.createElement("span");
  7618. t.innerHTML = "&nbsp;", m.addClass(t, "button gears");
  7619. var n = document.createElement("span");
  7620. n.innerHTML = "Save", m.addClass(n, "button"), m.addClass(n, "save");
  7621. var r = document.createElement("span");
  7622. r.innerHTML = "New", m.addClass(r, "button"), m.addClass(r, "save-as");
  7623. var o = document.createElement("span");
  7624. o.innerHTML = "Revert", m.addClass(o, "button"), m.addClass(o, "revert");
  7625. var a = i.__preset_select = document.createElement("select");
  7626. if (i.load && i.load.remembered ? v.each(i.load.remembered, function (e, t) {
  7627. E(i, t, t == i.preset)
  7628. }) : E(i, T, !1), m.bind(a, "change", function () {
  7629. for (var e = 0; e < i.__preset_select.length; e++) i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  7630. i.preset = this.value
  7631. }), e.appendChild(a), e.appendChild(t), e.appendChild(n), e.appendChild(r), e.appendChild(o), x) {
  7632. var s = document.getElementById("dg-save-locally"),
  7633. l = document.getElementById("dg-local-explain");
  7634. s.style.display = "block";
  7635. var c = document.getElementById("dg-local-storage");
  7636. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  7637. var h = function () {
  7638. l.style.display = i.useLocalStorage ? "block" : "none"
  7639. };
  7640. h(), m.bind(c, "change", function () {
  7641. i.useLocalStorage = !i.useLocalStorage, h()
  7642. })
  7643. }
  7644. var u = document.getElementById("dg-new-constructor");
  7645. m.bind(u, "keydown", function (e) {
  7646. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  7647. }), m.bind(t, "click", function () {
  7648. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2), b.show(), u.focus(), u.select()
  7649. }), m.bind(n, "click", function () {
  7650. i.save()
  7651. }), m.bind(r, "click", function () {
  7652. var e = prompt("Enter a new preset name.");
  7653. e && i.saveAs(e)
  7654. }), m.bind(o, "click", function () {
  7655. i.revert()
  7656. })
  7657. }(t), -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  7658. }), this.autoPlace && l(this, this.width)
  7659. },
  7660. getRoot: function () {
  7661. for (var e = this; e.parent;) e = e.parent;
  7662. return e
  7663. },
  7664. getSaveObject: function () {
  7665. var i = this.load;
  7666. return i.closed = this.closed, 0 < this.__rememberedObjects.length && (i.preset = this.preset, i.remembered || (i.remembered = {}), i.remembered[this.preset] = a(this)), i.folders = {}, v.each(this.__folders, function (e, t) {
  7667. i.folders[t] = e.getSaveObject()
  7668. }), i
  7669. },
  7670. save: function () {
  7671. this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = a(this), _(this, !1), this.saveToLocalStorageIfPossible()
  7672. },
  7673. saveAs: function (e) {
  7674. this.load.remembered || (this.load.remembered = {}, this.load.remembered[T] = a(this, !0)), this.load.remembered[e] = a(this), this.preset = e, E(this, e, !0), this.saveToLocalStorageIfPossible()
  7675. },
  7676. revert: function (t) {
  7677. v.each(this.__controllers, function (e) {
  7678. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  7679. }, this), v.each(this.__folders, function (e) {
  7680. e.revert(e)
  7681. }), t || _(this.getRoot(), !1)
  7682. },
  7683. listen: function (e) {
  7684. var t = 0 == this.__listening.length;
  7685. this.__listening.push(e), t && function e(t) {
  7686. 0 != t.length && r(function () {
  7687. e(t)
  7688. }), v.each(t, function (e) {
  7689. e.updateDisplay()
  7690. })
  7691. }(this.__listening)
  7692. }
  7693. }), R
  7694. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController, u = ee.controllers.NumberControllerBox, d = ee.controllers.NumberControllerSlider, p = ee.controllers.StringController = (v = ee.controllers.Controller, y = ee.dom.dom, A = ee.utils.common, (C = function (e, t) {
  7695. function i() {
  7696. n.setValue(n.__input.value)
  7697. }
  7698. C.superclass.call(this, e, t);
  7699. var n = this;
  7700. this.__input = document.createElement("input"), this.__input.setAttribute("type", "text"), y.bind(this.__input, "keyup", i), y.bind(this.__input, "change", i), y.bind(this.__input, "blur", function () {
  7701. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  7702. }), y.bind(this.__input, "keydown", function (e) {
  7703. 13 === e.keyCode && this.blur()
  7704. }), this.updateDisplay(), this.domElement.appendChild(this.__input)
  7705. }).superclass = v, A.extend(C.prototype, v.prototype, {
  7706. updateDisplay: function () {
  7707. return y.isActive(this.__input) || (this.__input.value = this.getValue()), C.superclass.prototype.updateDisplay.call(this)
  7708. }
  7709. }), C), f = ee.controllers.FunctionController, g = ee.controllers.BooleanController, m = ee.utils.common, function (e, t) {
  7710. var i = e[t];
  7711. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e, t, arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e, t, arguments[2], arguments[3]) : new u(e, t, {
  7712. min: arguments[2],
  7713. max: arguments[3]
  7714. }) : m.isString(i) ? new p(e, t) : m.isFunction(i) ? new f(e, t, "") : m.isBoolean(i) ? new g(e, t) : void 0
  7715. }), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function (e, h, u, d, p) {
  7716. function f(t, i, n, r) {
  7717. t.style.background = "", p.each(o, function (e) {
  7718. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  7719. })
  7720. }
  7721. var g = function (e, t) {
  7722. function i(e) {
  7723. a(e), h.bind(window, "mousemove", a), h.bind(window, "mouseup", n)
  7724. }
  7725. function n() {
  7726. h.unbind(window, "mousemove", a), h.unbind(window, "mouseup", n)
  7727. }
  7728. function r() {
  7729. var e = d(this.value);
  7730. !1 !== e ? (l.__color.__state = e, l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  7731. }
  7732. function o() {
  7733. h.unbind(window, "mousemove", s), h.unbind(window, "mouseup", o)
  7734. }
  7735. function a(e) {
  7736. e.preventDefault();
  7737. var t = h.getWidth(l.__saturation_field),
  7738. i = h.getOffset(l.__saturation_field),
  7739. n = (e.clientX - i.left + document.body.scrollLeft) / t,
  7740. r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  7741. return 1 < r ? r = 1 : r < 0 && (r = 0), 1 < n ? n = 1 : n < 0 && (n = 0), l.__color.v = r, l.__color.s = n, l.setValue(l.__color.toOriginal()), !1
  7742. }
  7743. function s(e) {
  7744. e.preventDefault();
  7745. var t = h.getHeight(l.__hue_field),
  7746. i = h.getOffset(l.__hue_field),
  7747. n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  7748. return 1 < n ? n = 1 : n < 0 && (n = 0), l.__color.h = 360 * n, l.setValue(l.__color.toOriginal()), !1
  7749. }
  7750. g.superclass.call(this, e, t), this.__color = new u(this.getValue()), this.__temp = new u(0);
  7751. var l = this;
  7752. this.domElement = document.createElement("div"), h.makeSelectable(this.domElement, !1), this.__selector = document.createElement("div"), this.__selector.className = "selector", this.__saturation_field = document.createElement("div"), this.__saturation_field.className = "saturation-field", this.__field_knob = document.createElement("div"), this.__field_knob.className = "field-knob", this.__field_knob_border = "2px solid ", this.__hue_knob = document.createElement("div"), this.__hue_knob.className = "hue-knob", this.__hue_field = document.createElement("div"), this.__hue_field.className = "hue-field", this.__input = document.createElement("input"), this.__input.type = "text", this.__input_textShadow = "0 1px 1px ", h.bind(this.__input, "keydown", function (e) {
  7753. 13 === e.keyCode && r.call(this)
  7754. }), h.bind(this.__input, "blur", r), h.bind(this.__selector, "mousedown", function (e) {
  7755. h.addClass(this, "drag").bind(window, "mouseup", function (e) {
  7756. h.removeClass(l.__selector, "drag")
  7757. })
  7758. });
  7759. var c = document.createElement("div");
  7760. p.extend(this.__selector.style, {
  7761. width: "122px",
  7762. height: "102px",
  7763. padding: "3px",
  7764. backgroundColor: "#222",
  7765. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  7766. }), p.extend(this.__field_knob.style, {
  7767. position: "absolute",
  7768. width: "12px",
  7769. height: "12px",
  7770. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  7771. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  7772. borderRadius: "12px",
  7773. zIndex: 1
  7774. }), p.extend(this.__hue_knob.style, {
  7775. position: "absolute",
  7776. width: "15px",
  7777. height: "2px",
  7778. borderRight: "4px solid #fff",
  7779. zIndex: 1
  7780. }), p.extend(this.__saturation_field.style, {
  7781. width: "100px",
  7782. height: "100px",
  7783. border: "1px solid #555",
  7784. marginRight: "3px",
  7785. display: "inline-block",
  7786. cursor: "pointer"
  7787. }), p.extend(c.style, {
  7788. width: "100%",
  7789. height: "100%",
  7790. background: "none"
  7791. }), f(c, "top", "rgba(0,0,0,0)", "#000"), p.extend(this.__hue_field.style, {
  7792. width: "15px",
  7793. height: "100px",
  7794. display: "inline-block",
  7795. border: "1px solid #555",
  7796. cursor: "ns-resize"
  7797. }),
  7798. function (e) {
  7799. e.style.background = "", e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  7800. }(this.__hue_field), p.extend(this.__input.style, {
  7801. outline: "none",
  7802. textAlign: "center",
  7803. color: "#fff",
  7804. border: 0,
  7805. fontWeight: "bold",
  7806. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  7807. }), h.bind(this.__saturation_field, "mousedown", i), h.bind(this.__field_knob, "mousedown", i), h.bind(this.__hue_field, "mousedown", function (e) {
  7808. s(e), h.bind(window, "mousemove", s), h.bind(window, "mouseup", o)
  7809. }), this.__saturation_field.appendChild(c), this.__selector.appendChild(this.__field_knob), this.__selector.appendChild(this.__saturation_field), this.__selector.appendChild(this.__hue_field), this.__hue_field.appendChild(this.__hue_knob), this.domElement.appendChild(this.__input), this.domElement.appendChild(this.__selector), this.updateDisplay()
  7810. };
  7811. g.superclass = e, p.extend(g.prototype, e.prototype, {
  7812. updateDisplay: function () {
  7813. var t = d(this.getValue());
  7814. if (!1 !== t) {
  7815. var i = !1;
  7816. p.each(u.COMPONENTS, function (e) {
  7817. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e]) return i = !0, {}
  7818. }, this), i && p.extend(this.__color.__state, t)
  7819. }
  7820. p.extend(this.__temp.__state, this.__color.__state), this.__temp.a = 1;
  7821. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0,
  7822. n = 255 - e;
  7823. p.extend(this.__field_knob.style, {
  7824. marginLeft: 100 * this.__color.s - 7 + "px",
  7825. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  7826. backgroundColor: this.__temp.toString(),
  7827. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  7828. }), this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px", this.__temp.s = 1, this.__temp.v = 1, f(this.__saturation_field, "left", "#fff", this.__temp.toString()), p.extend(this.__input.style, {
  7829. backgroundColor: this.__input.value = this.__color.toString(),
  7830. color: "rgb(" + e + "," + e + "," + e + ")",
  7831. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  7832. })
  7833. }
  7834. });
  7835. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  7836. return g
  7837. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret, a = ee.color.math = {
  7838. hsv_to_rgb: function (e, t, i) {
  7839. var n = Math.floor(e / 60) % 6,
  7840. r = e / 60 - Math.floor(e / 60),
  7841. o = i * (1 - t),
  7842. a = i * (1 - r * t),
  7843. s = i * (1 - (1 - r) * t),
  7844. l = [
  7845. [i, s, o],
  7846. [a, i, o],
  7847. [o, i, s],
  7848. [o, a, i],
  7849. [s, o, i],
  7850. [i, o, a]
  7851. ][n];
  7852. return {
  7853. r: 255 * l[0],
  7854. g: 255 * l[1],
  7855. b: 255 * l[2]
  7856. }
  7857. },
  7858. rgb_to_hsv: function (e, t, i) {
  7859. var n, r = Math.min(e, t, i),
  7860. o = Math.max(e, t, i),
  7861. a = o - r;
  7862. return 0 == o ? {
  7863. h: NaN,
  7864. s: 0,
  7865. v: 0
  7866. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a, (n /= 6) < 0 && (n += 1), {
  7867. h: 360 * n,
  7868. s: a / o,
  7869. v: o / 255
  7870. })
  7871. },
  7872. rgb_to_hex: function (e, t, i) {
  7873. var n = this.hex_with_component(0, 2, e);
  7874. return n = this.hex_with_component(n, 1, t), this.hex_with_component(n, 0, i)
  7875. },
  7876. component_from_hex: function (e, t) {
  7877. return e >> 8 * t & 255
  7878. },
  7879. hex_with_component: function (e, t, i) {
  7880. return i << (c = 8 * t) | e & ~(255 << c)
  7881. }
  7882. }, s = ee.color.toString, l = ee.utils.common, ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"], l.extend(ae.prototype, {
  7883. toString: function () {
  7884. return s(this)
  7885. },
  7886. toOriginal: function () {
  7887. return this.__state.conversion.write(this)
  7888. }
  7889. }), ie(ae.prototype, "r", 2), ie(ae.prototype, "g", 1), ie(ae.prototype, "b", 0), ne(ae.prototype, "h"), ne(ae.prototype, "s"), ne(ae.prototype, "v"), Object.defineProperty(ae.prototype, "a", {
  7890. get: function () {
  7891. return this.__state.a
  7892. },
  7893. set: function (e) {
  7894. this.__state.a = e
  7895. }
  7896. }), Object.defineProperty(ae.prototype, "hex", {
  7897. get: function () {
  7898. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
  7899. },
  7900. set: function (e) {
  7901. this.__state.space = "HEX", this.__state.hex = e
  7902. }
  7903. }), ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (e, t) {
  7904. window.setTimeout(e, 1e3 / 60)
  7905. }, ee.dom.CenteredDiv = (n = ee.dom.dom, r = ee.utils.common, te.prototype.show = function () {
  7906. var e = this;
  7907. this.backgroundElement.style.display = "block", this.domElement.style.display = "block", this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)", this.layout(), r.defer(function () {
  7908. e.backgroundElement.style.opacity = 1, e.domElement.style.opacity = 1, e.domElement.style.webkitTransform = "scale(1)"
  7909. })
  7910. }, te.prototype.hide = function () {
  7911. var e = this,
  7912. t = function () {
  7913. e.domElement.style.display = "none", e.backgroundElement.style.display = "none", n.unbind(e.domElement, "webkitTransitionEnd", t), n.unbind(e.domElement, "transitionend", t), n.unbind(e.domElement, "oTransitionEnd", t)
  7914. };
  7915. n.bind(this.domElement, "webkitTransitionEnd", t), n.bind(this.domElement, "transitionend", t), n.bind(this.domElement, "oTransitionEnd", t), this.backgroundElement.style.opacity = 0, this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)"
  7916. }, te.prototype.layout = function () {
  7917. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px", this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  7918. }, te), ee.dom.dom, ee.utils.common)
  7919. }, {}],
  7920. 94: [function (e, t, i) {
  7921. (function (J) {
  7922. "use strict";
  7923. function i(e) {
  7924. function t(e, t) {
  7925. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  7926. for (var a = 1; a <= e[o]; a++) r[t[n]] = [], r[t[n]][0] = i, r[t[n]][1] = o, n++, i++;
  7927. i *= 2
  7928. }
  7929. return r
  7930. }
  7931. function _(e) {
  7932. for (var t = e[0], i = e[1] - 1; 0 <= i;) t & 1 << i && (B |= 1 << V), i--, --V < 0 && (255 == B ? (b(255), b(0)) : b(B), V = 7, B = 0)
  7933. }
  7934. function b(e) {
  7935. F.push(e)
  7936. }
  7937. function w(e) {
  7938. b(e >> 8 & 255), b(255 & e)
  7939. }
  7940. function T(e, t, i, n, r) {
  7941. for (var o, a = r[0], s = r[240], l = function (e, t) {
  7942. var i, n, r, o, a, s, l, c, h, u, d = 0;
  7943. for (h = 0; h < 8; ++h) {
  7944. i = e[d], n = e[d + 1], r = e[d + 2], o = e[d + 3], a = e[d + 4], s = e[d + 5], l = e[d + 6];
  7945. var p = i + (c = e[d + 7]),
  7946. f = i - c,
  7947. g = n + l,
  7948. m = n - l,
  7949. v = r + s,
  7950. y = r - s,
  7951. A = o + a,
  7952. C = o - a,
  7953. I = p + A,
  7954. E = p - A,
  7955. _ = g + v,
  7956. b = g - v;
  7957. e[d] = I + _, e[d + 4] = I - _;
  7958. var w = .707106781 * (b + E);
  7959. e[d + 2] = E + w, e[d + 6] = E - w;
  7960. var T = .382683433 * ((I = C + y) - (b = m + f)),
  7961. x = .5411961 * I + T,
  7962. S = 1.306562965 * b + T,
  7963. M = .707106781 * (_ = y + m),
  7964. R = f + M,
  7965. P = f - M;
  7966. e[d + 5] = P + x, e[d + 3] = P - x, e[d + 1] = R + S, e[d + 7] = R - S, d += 8
  7967. }
  7968. for (h = d = 0; h < 8; ++h) {
  7969. i = e[d], n = e[d + 8], r = e[d + 16], o = e[d + 24], a = e[d + 32], s = e[d + 40], l = e[d + 48];
  7970. var O = i + (c = e[d + 56]),
  7971. L = i - c,
  7972. D = n + l,
  7973. N = n - l,
  7974. F = r + s,
  7975. B = r - s,
  7976. V = o + a,
  7977. k = o - a,
  7978. U = O + V,
  7979. H = O - V,
  7980. z = D + F,
  7981. G = D - F;
  7982. e[d] = U + z, e[d + 32] = U - z;
  7983. var W = .707106781 * (G + H);
  7984. e[d + 16] = H + W, e[d + 48] = H - W;
  7985. var j = .382683433 * ((U = k + B) - (G = N + L)),
  7986. Y = .5411961 * U + j,
  7987. q = 1.306562965 * G + j,
  7988. X = .707106781 * (z = B + N),
  7989. Z = L + X,
  7990. K = L - X;
  7991. e[d + 40] = K + Y, e[d + 24] = K - Y, e[d + 8] = Z + q, e[d + 56] = Z - q, d++
  7992. }
  7993. for (h = 0; h < 64; ++h) u = e[h] * t[h], Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  7994. return Q
  7995. }(e, t), c = 0; c < 64; ++c) A[C[c]] = l[c];
  7996. var h = A[0] - i;
  7997. i = A[0], 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]), _(v[o]));
  7998. for (var u = 63; 0 < u && 0 == A[u]; u--);
  7999. if (0 == u) return _(a), i;
  8000. for (var d, p = 1; p <= u;) {
  8001. for (var f = p; 0 == A[p] && p <= u; ++p);
  8002. var g = p - f;
  8003. if (16 <= g) {
  8004. d = g >> 4;
  8005. for (var m = 1; m <= d; ++m) _(s);
  8006. g &= 15
  8007. }
  8008. o = 32767 + A[p], _(r[(g << 4) + y[o]]), _(v[o]), p++
  8009. }
  8010. return 63 != u && _(a), i
  8011. }
  8012. function x(e) {
  8013. if (e <= 0 && (e = 1), 100 < e && (e = 100), i != e) {
  8014. (function (e) {
  8015. 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++) {
  8016. var n = u((t[i] * e + 50) / 100);
  8017. n < 1 ? n = 1 : 255 < n && (n = 255), O[C[i]] = n
  8018. }
  8019. 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++) {
  8020. var a = u((r[o] * e + 50) / 100);
  8021. a < 1 ? a = 1 : 255 < a && (a = 255), L[C[o]] = a
  8022. }
  8023. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  8024. for (var h = 0; h < 8; h++) D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8), N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8), l++
  8025. })(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)), i = e
  8026. }
  8027. }
  8028. var S, M, R, P, i, u = (Math.round, Math.floor),
  8029. O = new Array(64),
  8030. L = new Array(64),
  8031. D = new Array(64),
  8032. N = new Array(64),
  8033. v = new Array(65535),
  8034. y = new Array(65535),
  8035. Q = new Array(64),
  8036. A = new Array(64),
  8037. F = [],
  8038. B = 0,
  8039. V = 7,
  8040. k = new Array(64),
  8041. U = new Array(64),
  8042. H = new Array(64),
  8043. n = new Array(256),
  8044. z = new Array(2048),
  8045. C = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63],
  8046. G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  8047. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  8048. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  8049. 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],
  8050. q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  8051. X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  8052. Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  8053. 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];
  8054. this.encode = function (e, t) {
  8055. var i = ((new Date).getTime(), t.quality);
  8056. i && x(i), F = new Array, B = 0, V = 7, w(65496), w(65504), w(16), b(74), b(70), b(73), b(70), b(0), b(1), b(1), b(0), w(1), w(1), b(0), b(0),
  8057. function () {
  8058. w(65499), w(132), b(0);
  8059. for (var e = 0; e < 64; e++) b(O[e]);
  8060. b(1);
  8061. for (var t = 0; t < 64; t++) b(L[t])
  8062. }(),
  8063. function (e, t) {
  8064. w(65472), w(17), b(8), w(t), w(e), b(3), b(1), b(17), b(0), b(2), b(17), b(1), b(3), b(17), b(1)
  8065. }(e.width, e.height),
  8066. function () {
  8067. w(65476), w(418), b(0);
  8068. for (var e = 0; e < 16; e++) b(G[e + 1]);
  8069. for (var t = 0; t <= 11; t++) b(W[t]);
  8070. b(16);
  8071. for (var i = 0; i < 16; i++) b(j[i + 1]);
  8072. for (var n = 0; n <= 161; n++) b(Y[n]);
  8073. b(1);
  8074. for (var r = 0; r < 16; r++) b(q[r + 1]);
  8075. for (var o = 0; o <= 11; o++) b(X[o]);
  8076. b(17);
  8077. for (var a = 0; a < 16; a++) b(Z[a + 1]);
  8078. for (var s = 0; s <= 161; s++) b(K[s])
  8079. }(), w(65498), w(12), b(3), b(1), b(0), b(2), b(17), b(3), b(17), b(0), b(63), b(0);
  8080. var n = 0,
  8081. r = 0,
  8082. o = 0;
  8083. B = 0, V = 7, this.encode.displayName = "_encode_";
  8084. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v;) {
  8085. for (a = 0; a < A;) {
  8086. for (u = h = A * C + a, d = -1, f = p = 0; f < 64; f++) u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)), v <= C + p && (u -= A * (C + 1 + p - v)), A <= a + d && (u -= a + d - A + 4), s = g[u++], l = g[u++], c = g[u++], k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128, U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128, H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  8087. n = T(k, D, n, S, R), r = T(U, N, r, M, P), o = T(H, N, o, M, P), a += 32
  8088. }
  8089. C += I
  8090. }
  8091. if (0 <= V) {
  8092. var E = [];
  8093. E[1] = V + 1, E[0] = (1 << V + 1) - 1, _(E)
  8094. }
  8095. return w(65497), new J(F)
  8096. }, (new Date).getTime(), e = e || 50,
  8097. function () {
  8098. for (var e = String.fromCharCode, t = 0; t < 256; t++) n[t] = e(t)
  8099. }(), S = t(G, W), M = t(q, X), R = t(j, Y), P = t(Z, K),
  8100. function () {
  8101. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  8102. for (var n = e; n < t; n++) y[32767 + n] = i, v[32767 + n] = [], v[32767 + n][1] = i, v[32767 + n][0] = n;
  8103. for (var r = -(t - 1); r <= -e; r++) y[32767 + r] = i, v[32767 + r] = [], v[32767 + r][1] = i, v[32767 + r][0] = t - 1 + r;
  8104. e <<= 1, t <<= 1
  8105. }
  8106. }(),
  8107. function () {
  8108. for (var e = 0; e < 256; e++) z[e] = 19595 * e, z[e + 256 >> 0] = 38470 * e, z[e + 512 >> 0] = 7471 * e + 32768, z[e + 768 >> 0] = -11059 * e, z[e + 1024 >> 0] = -21709 * e, z[e + 1280 >> 0] = 32768 * e + 8421375, z[e + 1536 >> 0] = -27439 * e, z[e + 1792 >> 0] = -5329 * e
  8109. }(), x(e), (new Date).getTime()
  8110. }
  8111. t.exports.encode = function (e, t) {
  8112. return (t = t || {}).quality = t.quality || 50, {
  8113. data: new i(t.quality).encode(e, t),
  8114. width: e.width,
  8115. height: e.height
  8116. }
  8117. }
  8118. }).call(this, e("buffer").Buffer)
  8119. }, {
  8120. buffer: 198
  8121. }],
  8122. 95: [function (e, t, i) {
  8123. "use strict";
  8124. ! function () {
  8125. if ("performance" in window == 0 && (window.performance = {}), Date.now = Date.now || function () {
  8126. return (new Date).getTime()
  8127. }, "now" in window.performance == 0) {
  8128. var e = Date.now();
  8129. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart), window.performance.now = function () {
  8130. return Date.now() - e
  8131. }
  8132. }
  8133. }()
  8134. }, {}],
  8135. 96: [function (e, t, i) {
  8136. "use strict";
  8137. var a = e("three");
  8138. a.EffectComposer = function (e, t) {
  8139. if (this.renderer = e, void 0 === t) {
  8140. var i = {
  8141. minFilter: a.LinearFilter,
  8142. magFilter: a.LinearFilter,
  8143. format: a.RGBAFormat,
  8144. stencilBuffer: !1
  8145. },
  8146. n = e.getSize();
  8147. t = new a.WebGLRenderTarget(n.width, n.height, i)
  8148. }
  8149. this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.passes = [], void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"), this.copyPass = new a.ShaderPass(a.CopyShader)
  8150. }, a.EffectComposer.prototype = {
  8151. swapBuffers: function () {
  8152. var e = this.readBuffer;
  8153. this.readBuffer = this.writeBuffer, this.writeBuffer = e
  8154. },
  8155. addPass: function (e) {
  8156. this.passes.push(e)
  8157. },
  8158. insertPass: function (e, t) {
  8159. this.passes.splice(t, 0, e)
  8160. },
  8161. render: function (e) {
  8162. this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2;
  8163. var t, i, n = !1,
  8164. r = this.passes.length;
  8165. for (i = 0; i < r; i++)
  8166. if ((t = this.passes[i]).enabled) {
  8167. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n), t.needsSwap) {
  8168. if (n) {
  8169. var o = this.renderer.context;
  8170. o.stencilFunc(o.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e), o.stencilFunc(o.EQUAL, 1, 4294967295)
  8171. }
  8172. this.swapBuffers()
  8173. }
  8174. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  8175. }
  8176. },
  8177. reset: function (e) {
  8178. if (void 0 === e) {
  8179. var t = this.renderer.getSize();
  8180. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  8181. }
  8182. this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.renderTarget1 = e, this.renderTarget2 = e.clone(), this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2
  8183. },
  8184. setSize: function (e, t) {
  8185. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t)
  8186. }
  8187. }
  8188. }, {
  8189. three: 217
  8190. }],
  8191. 97: [function (e, t, i) {
  8192. "use strict";
  8193. var n = e("three");
  8194. n.MaskPass = function (e, t) {
  8195. this.scene = e, this.camera = t, this.enabled = !0, this.clear = !0, this.needsSwap = !1, this.inverse = !1
  8196. }, n.MaskPass.prototype = {
  8197. render: function (e, t, i, n) {
  8198. var r, o, a = e.context;
  8199. a.colorMask(!1, !1, !1, !1), a.depthMask(!1), o = this.inverse ? (r = 0, 1) : (r = 1, 0), a.enable(a.STENCIL_TEST), a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE), a.stencilFunc(a.ALWAYS, r, 4294967295), a.clearStencil(o), e.render(this.scene, this.camera, i, this.clear), e.render(this.scene, this.camera, t, this.clear), a.colorMask(!0, !0, !0, !0), a.depthMask(!0), a.stencilFunc(a.EQUAL, 1, 4294967295), a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  8200. }
  8201. }, n.ClearMaskPass = function () {
  8202. this.enabled = !0
  8203. }, n.ClearMaskPass.prototype = {
  8204. render: function (e, t, i, n) {
  8205. var r = e.context;
  8206. r.disable(r.STENCIL_TEST)
  8207. }
  8208. }
  8209. }, {
  8210. three: 217
  8211. }],
  8212. 98: [function (e, t, i) {
  8213. "use strict";
  8214. var o = e("three");
  8215. o.RenderPass = function (e, t, i, n, r) {
  8216. this.scene = e, this.camera = t, this.overrideMaterial = i, this.clearColor = n, this.clearAlpha = void 0 !== r ? r : 1, this.oldClearColor = new o.Color, this.oldClearAlpha = 1, this.enabled = !0, this.clear = !0, this.needsSwap = !1
  8217. }, o.RenderPass.prototype = {
  8218. render: function (e, t, i, n) {
  8219. this.scene.overrideMaterial = this.overrideMaterial, this.clearColor && (this.oldClearColor.copy(e.getClearColor()), this.oldClearAlpha = e.getClearAlpha(), e.setClearColor(this.clearColor, this.clearAlpha)), e.render(this.scene, this.camera, i, this.clear), this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha), this.scene.overrideMaterial = null
  8220. }
  8221. }
  8222. }, {
  8223. three: 217
  8224. }],
  8225. 99: [function (e, t, i) {
  8226. "use strict";
  8227. var n = e("three");
  8228. n.ShaderPass = function (e, t) {
  8229. this.textureID = void 0 !== t ? t : "tDiffuse", e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms), this.material = new n.ShaderMaterial({
  8230. defines: e.defines || {},
  8231. uniforms: this.uniforms,
  8232. vertexShader: e.vertexShader,
  8233. fragmentShader: e.fragmentShader
  8234. })), this.renderToScreen = !1, this.enabled = !0, this.needsSwap = !0, this.clear = !1, this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1), this.scene = new n.Scene, this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null), this.scene.add(this.quad)
  8235. }, n.ShaderPass.prototype = {
  8236. render: function (e, t, i, n) {
  8237. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i), this.quad.material = this.material, this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  8238. }
  8239. }
  8240. }, {
  8241. three: 217
  8242. }],
  8243. 100: [function (e, t, i) {
  8244. "use strict";
  8245. e("three").CopyShader = {
  8246. uniforms: {
  8247. tDiffuse: {
  8248. type: "t",
  8249. value: null
  8250. },
  8251. opacity: {
  8252. type: "f",
  8253. value: 1
  8254. }
  8255. },
  8256. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  8257. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  8258. }
  8259. }, {
  8260. three: 217
  8261. }],
  8262. 101: [function (e, t, i) {
  8263. "use strict";
  8264. e("three").HorizontalBlurShader = {
  8265. uniforms: {
  8266. tDiffuse: {
  8267. type: "t",
  8268. value: null
  8269. },
  8270. h: {
  8271. type: "f",
  8272. value: 1 / 512
  8273. }
  8274. },
  8275. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  8276. 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")
  8277. }
  8278. }, {
  8279. three: 217
  8280. }],
  8281. 102: [function (e, t, i) {
  8282. "use strict";
  8283. e("three").VerticalBlurShader = {
  8284. uniforms: {
  8285. tDiffuse: {
  8286. type: "t",
  8287. value: null
  8288. },
  8289. v: {
  8290. type: "f",
  8291. value: 1 / 512
  8292. }
  8293. },
  8294. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  8295. 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")
  8296. }
  8297. }, {
  8298. three: 217
  8299. }],
  8300. 103: [function (e, t, i) {
  8301. "use strict";
  8302. var z = e("three");
  8303. ! function () {
  8304. if ("performance" in window == 0 && (window.performance = {}), "now" in window.performance == 0) {
  8305. var e = Date.now();
  8306. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart), window.performance.now = function () {
  8307. return Date.now() - e
  8308. }
  8309. }
  8310. }(), z.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  8311. var t, i = this.extensions,
  8312. n = this.context;
  8313. if (e === z.RepeatWrapping) return n.REPEAT;
  8314. if (e === z.ClampToEdgeWrapping) return n.CLAMP_TO_EDGE;
  8315. if (e === z.MirroredRepeatWrapping) return n.MIRRORED_REPEAT;
  8316. if (e === z.NearestFilter) return n.NEAREST;
  8317. if (e === z.NearestMipMapNearestFilter) return n.NEAREST_MIPMAP_NEAREST;
  8318. if (e === z.NearestMipMapLinearFilter) return n.NEAREST_MIPMAP_LINEAR;
  8319. if (e === z.LinearFilter) return n.LINEAR;
  8320. if (e === z.LinearMipMapNearestFilter) return n.LINEAR_MIPMAP_NEAREST;
  8321. if (e === z.LinearMipMapLinearFilter) return n.LINEAR_MIPMAP_LINEAR;
  8322. if (e === z.UnsignedByteType) return n.UNSIGNED_BYTE;
  8323. if (e === z.UnsignedShort4444Type) return n.UNSIGNED_SHORT_4_4_4_4;
  8324. if (e === z.UnsignedShort5551Type) return n.UNSIGNED_SHORT_5_5_5_1;
  8325. if (e === z.UnsignedShort565Type) return n.UNSIGNED_SHORT_5_6_5;
  8326. if (e === z.ByteType) return n.BYTE;
  8327. if (e === z.ShortType) return n.SHORT;
  8328. if (e === z.UnsignedShortType) return n.UNSIGNED_SHORT;
  8329. if (e === z.IntType) return n.INT;
  8330. if (e === z.UnsignedIntType) return n.UNSIGNED_INT;
  8331. if (e === z.FloatType) return n.FLOAT;
  8332. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType) return t.HALF_FLOAT_OES;
  8333. if (e === z.AlphaFormat) return n.ALPHA;
  8334. if (e === z.RGBFormat) return n.RGB;
  8335. if (e === z.RGBAFormat) return n.RGBA;
  8336. if (e === z.LuminanceFormat) return n.LUMINANCE;
  8337. if (e === z.LuminanceAlphaFormat) return n.LUMINANCE_ALPHA;
  8338. if (e === z.AddEquation) return n.FUNC_ADD;
  8339. if (e === z.SubtractEquation) return n.FUNC_SUBTRACT;
  8340. if (e === z.ReverseSubtractEquation) return n.FUNC_REVERSE_SUBTRACT;
  8341. if (e === z.ZeroFactor) return n.ZERO;
  8342. if (e === z.OneFactor) return n.ONE;
  8343. if (e === z.SrcColorFactor) return n.SRC_COLOR;
  8344. if (e === z.OneMinusSrcColorFactor) return n.ONE_MINUS_SRC_COLOR;
  8345. if (e === z.SrcAlphaFactor) return n.SRC_ALPHA;
  8346. if (e === z.OneMinusSrcAlphaFactor) return n.ONE_MINUS_SRC_ALPHA;
  8347. if (e === z.DstAlphaFactor) return n.DST_ALPHA;
  8348. if (e === z.OneMinusDstAlphaFactor) return n.ONE_MINUS_DST_ALPHA;
  8349. if (e === z.DstColorFactor) return n.DST_COLOR;
  8350. if (e === z.OneMinusDstColorFactor) return n.ONE_MINUS_DST_COLOR;
  8351. if (e === z.SrcAlphaSaturateFactor) return n.SRC_ALPHA_SATURATE;
  8352. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  8353. if (e === z.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  8354. if (e === z.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  8355. if (e === z.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  8356. if (e === z.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  8357. }
  8358. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  8359. if (e === z.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  8360. if (e === z.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  8361. if (e === z.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  8362. if (e === z.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  8363. }
  8364. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format) return t.COMPRESSED_RGB_ETC1_WEBGL;
  8365. if (null !== (t = i.get("EXT_blend_minmax"))) {
  8366. if (e === z.MinEquation) return t.MIN_EXT;
  8367. if (e === z.MaxEquation) return t.MAX_EXT
  8368. }
  8369. return 0
  8370. }, z.WebGLState = function (l, i, c) {
  8371. var n = this,
  8372. r = new z.Vector4,
  8373. e = l.getParameter(l.MAX_VERTEX_ATTRIBS),
  8374. o = new Uint8Array(e),
  8375. a = new Uint8Array(e),
  8376. s = new Uint8Array(e),
  8377. t = {},
  8378. h = null,
  8379. u = null,
  8380. d = null,
  8381. p = null,
  8382. f = null,
  8383. g = null,
  8384. m = null,
  8385. v = null,
  8386. y = !1,
  8387. A = null,
  8388. C = null,
  8389. I = null,
  8390. E = null,
  8391. _ = null,
  8392. b = null,
  8393. w = null,
  8394. T = null,
  8395. x = null,
  8396. S = null,
  8397. M = null,
  8398. R = null,
  8399. P = null,
  8400. O = null,
  8401. L = null,
  8402. D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
  8403. N = void 0,
  8404. F = {},
  8405. B = new z.Vector4,
  8406. V = null,
  8407. k = null,
  8408. U = new z.Vector4,
  8409. H = new z.Vector4;
  8410. this.init = function () {
  8411. this.clearColor(0, 0, 0, 1), this.clearDepth(1), this.clearStencil(0), this.enable(l.DEPTH_TEST), l.depthFunc(l.LEQUAL), l.frontFace(l.CCW), l.cullFace(l.BACK), this.enable(l.CULL_FACE), this.enable(l.BLEND), l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  8412. }, this.initAttributes = function () {
  8413. for (var e = 0, t = o.length; e < t; e++) o[e] = 0
  8414. }, this.enableAttribute = function (e) {
  8415. o[e] = 1, 0 === a[e] && (l.enableVertexAttribArray(e), a[e] = 1), 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0), s[e] = 0)
  8416. }, this.enableAttributeAndDivisor = function (e, t, i) {
  8417. o[e] = 1, 0 === a[e] && (l.enableVertexAttribArray(e), a[e] = 1), s[e] !== t && (i.vertexAttribDivisorANGLE(e, t), s[e] = t)
  8418. }, this.disableUnusedAttributes = function () {
  8419. for (var e = 0, t = a.length; e < t; e++) a[e] !== o[e] && (l.disableVertexAttribArray(e), a[e] = 0)
  8420. }, this.enable = function (e) {
  8421. !0 !== t[e] && (l.enable(e), t[e] = !0)
  8422. }, this.disable = function (e) {
  8423. !1 !== t[e] && (l.disable(e), t[e] = !1)
  8424. }, this.getCompressedTextureFormats = function () {
  8425. if (null === h && (h = [], i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  8426. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++) h.push(e[t]);
  8427. return h
  8428. }, this.setBlending = function (e, t, i, n, r, o, a, s) {
  8429. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND), e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)), u = e, y = s), e === z.CustomBlending ? (r = r || t, o = o || i, a = a || n, t === d && r === g || (l.blendEquationSeparate(c(t), c(r)), d = t, g = r), i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)), p = i, f = n, m = o, v = a)) : v = m = g = f = p = d = null
  8430. }, this.setDepthFunc = function (e) {
  8431. if (A !== e) {
  8432. if (e) switch (e) {
  8433. case z.NeverDepth:
  8434. l.depthFunc(l.NEVER);
  8435. break;
  8436. case z.AlwaysDepth:
  8437. l.depthFunc(l.ALWAYS);
  8438. break;
  8439. case z.LessDepth:
  8440. l.depthFunc(l.LESS);
  8441. break;
  8442. case z.LessEqualDepth:
  8443. l.depthFunc(l.LEQUAL);
  8444. break;
  8445. case z.EqualDepth:
  8446. l.depthFunc(l.EQUAL);
  8447. break;
  8448. case z.GreaterEqualDepth:
  8449. l.depthFunc(l.GEQUAL);
  8450. break;
  8451. case z.GreaterDepth:
  8452. l.depthFunc(l.GREATER);
  8453. break;
  8454. case z.NotEqualDepth:
  8455. l.depthFunc(l.NOTEQUAL);
  8456. break;
  8457. default:
  8458. l.depthFunc(l.LEQUAL)
  8459. } else l.depthFunc(l.LEQUAL);
  8460. A = e
  8461. }
  8462. }, this.setDepthTest = function (e) {
  8463. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  8464. }, this.setDepthWrite = function (e) {
  8465. C !== e && (l.depthMask(e), C = e)
  8466. }, this.setColorWrite = function (e) {
  8467. I !== e && (l.colorMask(e, e, e, e), I = e)
  8468. }, this.setStencilFunc = function (e, t, i) {
  8469. _ === e && b === t && w === i || (l.stencilFunc(e, t, i), _ = e, b = t, w = i)
  8470. }, this.setStencilOp = function (e, t, i) {
  8471. T === e && x === t && S === i || (l.stencilOp(e, t, i), T = e, x = t, S = i)
  8472. }, this.setStencilTest = function (e) {
  8473. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  8474. }, this.setStencilWrite = function (e) {
  8475. E !== e && (l.stencilMask(e), E = e)
  8476. }, this.setFlipSided = function (e) {
  8477. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW), M = e)
  8478. }, this.setLineWidth = function (e) {
  8479. e !== R && (l.lineWidth(e), R = e)
  8480. }, this.setPolygonOffset = function (e, t, i) {
  8481. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL), !e || P === t && O === i || (l.polygonOffset(t, i), P = t, O = i)
  8482. }, this.getScissorTest = function () {
  8483. return L
  8484. }, this.setScissorTest = function (e) {
  8485. (L = e) ? this.enable(l.SCISSOR_TEST): this.disable(l.SCISSOR_TEST)
  8486. }, this.activeTexture = function (e) {
  8487. void 0 === e && (e = l.TEXTURE0 + D - 1), N !== e && (l.activeTexture(e), N = e)
  8488. }, this.bindTexture = function (e, t) {
  8489. void 0 === N && n.activeTexture();
  8490. var i = F[N];
  8491. void 0 === i && (i = {
  8492. type: void 0,
  8493. texture: void 0
  8494. }, F[N] = i), i.type === e && i.texture === t || (l.bindTexture(e, t), i.type = e, i.texture = t)
  8495. }, this.compressedTexImage2D = function () {
  8496. try {
  8497. l.compressedTexImage2D.apply(l, arguments)
  8498. } catch (e) {
  8499. console.error(e)
  8500. }
  8501. }, this.texImage2D = function () {
  8502. try {
  8503. l.texImage2D.apply(l, arguments)
  8504. } catch (e) {
  8505. console.error(e)
  8506. }
  8507. }, this.clearColor = function (e, t, i, n) {
  8508. r.set(e, t, i, n), !1 === B.equals(r) && (l.clearColor(e, t, i, n), B.copy(r))
  8509. }, this.clearDepth = function (e) {
  8510. V !== e && (l.clearDepth(e), V = e)
  8511. }, this.clearStencil = function (e) {
  8512. k !== e && (l.clearStencil(e), k = e)
  8513. }, this.scissor = function (e) {
  8514. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w), U.copy(e))
  8515. }, this.viewport = function (e) {
  8516. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w), H.copy(e))
  8517. }, this.reset = function () {
  8518. for (var e = 0; e < a.length; e++) 1 === a[e] && (l.disableVertexAttribArray(e), a[e] = 0);
  8519. t = {}, N = void 0, F = {}, M = E = C = I = u = h = null
  8520. }
  8521. }
  8522. }, {
  8523. three: 217
  8524. }],
  8525. 104: [function (a, h, e) {
  8526. (function (i, e) {
  8527. "use strict";
  8528. function t(e) {
  8529. this.urls = e;
  8530. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  8531. this.builder = n.loadProto(t), this.decoder = this.builder.build("binary_mesh")
  8532. }
  8533. var s = a("three"),
  8534. n = a("protobufjs"),
  8535. r = a("../util/logger"),
  8536. o = (a("../util/common"), a("../util/ajax")),
  8537. l = a("../objects/Chunk"),
  8538. c = new r(e);
  8539. t.prototype = {
  8540. constructor: t,
  8541. load: function (t, i, n, r) {
  8542. return c.time("download"), o.get(t, {
  8543. responseType: "arraybuffer"
  8544. }).done(function (e) {
  8545. c.timeEnd("download"), this.parse(e, t, i, n, r)
  8546. }.bind(this)).fail(r)
  8547. },
  8548. parse: function (e, t, i, n, r) {
  8549. var o = this.readProtobuf(e);
  8550. if (!o) return r();
  8551. try {
  8552. c.time("convert to webgl"), this.convertProtobufToSceneObject(o, t, i, n, r), c.timeEnd("convert to webgl")
  8553. } catch (e) {
  8554. return c.error("failed parsing .dam"), c.error(e.message), r()
  8555. }
  8556. },
  8557. readProtobuf: function (e) {
  8558. var t;
  8559. try {
  8560. c.time("parse proto"), t = this.decoder.decode(e), c.timeEnd("parse proto")
  8561. } catch (e) {
  8562. return c.error("failed parsing proto for .dam"), c.error(e.message), null
  8563. }
  8564. return t
  8565. },
  8566. convertProtobufToSceneObject: function (e, i, t, n, r) {
  8567. if (0 === e.chunk.length) return c.warn("No chunks in damfile..."), t([]);
  8568. var o = new s.Matrix4;
  8569. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  8570. var a = e.chunk.map(function (e) {
  8571. var t = new s.BufferGeometry;
  8572. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)), 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)), t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)), t.applyMatrix(o), t.computeBoundingBox(), new l({
  8573. geometry: t,
  8574. textureName: e.material_name,
  8575. name: e.chunk_name,
  8576. meshUrl: i
  8577. })
  8578. });
  8579. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."), r())
  8580. }
  8581. }, h.exports = t
  8582. }).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  8583. }, {
  8584. "../objects/Chunk": 144,
  8585. "../util/ajax": 181,
  8586. "../util/common": 185,
  8587. "../util/logger": 189,
  8588. buffer: 198,
  8589. protobufjs: 214,
  8590. three: 217
  8591. }],
  8592. 105: [function (n, r, e) {
  8593. (function (e) {
  8594. "use strict";
  8595. var t = (n("three"), n("../settings"), n("../util/browser"), n("./DamLoader")),
  8596. i = n("../util/logger"),
  8597. u = (n("../ab"), new i(e));
  8598. r.exports = {
  8599. getLoaders: function () {
  8600. return [
  8601. ["_50k", ".dam", t],
  8602. ["", ".dam", t]
  8603. ]
  8604. },
  8605. load: function (e, t, i, n, r, o) {
  8606. var a = this.getLoaders()[o = o || 0];
  8607. if (a) {
  8608. var s = a[0],
  8609. l = a[1],
  8610. c = new a[2](t),
  8611. h = t.get(e + s + l);
  8612. h ? (u.debug("Trying " + s + l), c.load(h, i, n, function () {
  8613. this.load(e, t, i, n, r, ++o)
  8614. }.bind(this))) : (u.debug("Skipping " + l + ", not available"), this.load(e, t, i, n, r, ++o))
  8615. } else r && r("No suitable model file found...")
  8616. }
  8617. }
  8618. }).call(this, "/js/loaders/ModelLoader.js")
  8619. }, {
  8620. "../ab": 3,
  8621. "../settings": 166,
  8622. "../util/browser": 182,
  8623. "../util/logger": 189,
  8624. "./DamLoader": 104,
  8625. three: 217
  8626. }],
  8627. 106: [function (i, n, e) {
  8628. (function (e) {
  8629. "use strict";
  8630. var l = i("../util/common"),
  8631. c = i("../util/texture"),
  8632. h = i("../util/browser"),
  8633. t = i("../util/logger"),
  8634. u = i("../settings"),
  8635. d = new t(e);
  8636. n.exports = {
  8637. load: function (i, n) {
  8638. if (!i.chunks[0] || !i.chunks[0].meshUrl) return $.when();
  8639. var r = l.countUnique(i.chunks.map(function (e) {
  8640. return e.textureName
  8641. })),
  8642. e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : "",
  8643. t = "_50k" == e ? "high" : "low";
  8644. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."), t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."), t = "low"));
  8645. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/",
  8646. a = $.Deferred(),
  8647. s = 0;
  8648. return i.chunks.forEach(function (e) {
  8649. if (!e.material.map && e.textureName) {
  8650. var t = i.urls.get(o + e.textureName);
  8651. e.setTextureMap(c.load(t, function (e, t) {
  8652. e || (n.push(t), s++, a.notify(s, r), s === r && a.resolve())
  8653. }.bind(this, c.isLoaded(t))))
  8654. }
  8655. }), a.promise()
  8656. }
  8657. }
  8658. }).call(this, "/js/loaders/ModelTextureLoader.js")
  8659. }, {
  8660. "../settings": 166,
  8661. "../util/browser": 182,
  8662. "../util/common": 185,
  8663. "../util/logger": 189,
  8664. "../util/texture": 194
  8665. }],
  8666. 107: [function (s, l, e) {
  8667. (function (n, e) {
  8668. "use strict";
  8669. function t(e) {
  8670. this.model = e, this.modelDataPath = this.model.urls.get("vision.modeldata"), this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  8671. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64"),
  8672. i = r.loadProto(t);
  8673. this.decoder = i.build("VisionModeldata")
  8674. }
  8675. var r = s("protobufjs"),
  8676. i = s("../util/ajax"),
  8677. o = (s("../util/common"), s("../util/math")),
  8678. a = new(s("../util/logger"))(e);
  8679. t.prototype.load = function () {
  8680. return this.modelDataPath ? (a.info("Using vision.modeldata"), this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"), this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"), $.when([]))
  8681. }, t.prototype.loadVisionModelData = function () {
  8682. return i.get(this.modelDataPath, {
  8683. responseType: "arraybuffer"
  8684. }).then(function (e) {
  8685. var t;
  8686. try {
  8687. t = this.decoder.decode(e)
  8688. } catch (e) {
  8689. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"), this.loadSweepLocationsCSV()
  8690. }
  8691. var i = t.sweepLocations.map(function (e) {
  8692. return {
  8693. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  8694. position: {
  8695. x: e.pose.translation.x,
  8696. y: e.pose.translation.y,
  8697. z: e.pose.translation.z
  8698. },
  8699. quaternion: {
  8700. x: e.pose.rotation.x,
  8701. y: e.pose.rotation.y,
  8702. z: e.pose.rotation.z,
  8703. w: e.pose.rotation.w
  8704. },
  8705. puck: {
  8706. x: e.puck.x,
  8707. y: e.puck.y,
  8708. z: e.puck.z
  8709. },
  8710. floor: e.group,
  8711. neighbours: e.visibles,
  8712. alignmentType: e.alignment_type
  8713. }
  8714. }).map(function (e) {
  8715. return e.position = o.convertVisionVector(e.position), e.quaternion = o.convertVisionQuaternion(e.quaternion), e.puck = o.convertVisionVector(e.puck), e
  8716. });
  8717. return i.forEach(function (e) {
  8718. e.neighbours = e.neighbours.map(function (e) {
  8719. return i[e].uuid
  8720. })
  8721. }), i
  8722. }.bind(this), function () {
  8723. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"), this.loadSweepLocationsCSV()
  8724. }.bind(this))
  8725. }, t.prototype.loadSweepLocationsCSV = function () {
  8726. return i.get(this.sweepLocationsPath).then(function (e) {
  8727. return e.split("\n").map(function (e) {
  8728. return e.split(", ")
  8729. }).filter(function (e) {
  8730. return 1 < e.length
  8731. }).map(function (e) {
  8732. return {
  8733. uuid: e[0],
  8734. position: {
  8735. x: parseFloat(e[1]),
  8736. y: parseFloat(e[2]),
  8737. z: parseFloat(e[3])
  8738. },
  8739. quaternion: {
  8740. x: parseFloat(e[4]),
  8741. y: parseFloat(e[5]),
  8742. z: parseFloat(e[6]),
  8743. w: parseFloat(e[7])
  8744. }
  8745. }
  8746. }).map(function (e) {
  8747. return e.position = o.convertVisionVector(e.position), e.quaternion = o.convertVisionQuaternion(e.quaternion), e
  8748. })
  8749. }).fail(function () {
  8750. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  8751. })
  8752. }, l.exports = t
  8753. }).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  8754. }, {
  8755. "../util/ajax": 181,
  8756. "../util/common": 185,
  8757. "../util/logger": 189,
  8758. "../util/math": 190,
  8759. buffer: 198,
  8760. protobufjs: 214
  8761. }],
  8762. 108: [function (s, l, e) {
  8763. (function (e) {
  8764. "use strict";
  8765. function t() {
  8766. this.locale = null
  8767. }
  8768. var i = s("../settings"),
  8769. n = s("../util/common"),
  8770. r = s("../util/logger"),
  8771. o = s("../enum/Locale"),
  8772. a = new r(e);
  8773. t.prototype.init = function () {
  8774. var e;
  8775. switch (i.languageTag) {
  8776. case null:
  8777. case "en":
  8778. case o.EN_US:
  8779. this.locale = o.EN_US, e = s("./strings-en-US");
  8780. break;
  8781. case "es":
  8782. case o.ES_MX:
  8783. this.locale = o.ES_MX, e = s("./strings-es-MX");
  8784. break;
  8785. case "fr":
  8786. case o.FR_FR:
  8787. this.locale = o.FR_FR, e = s("./strings-fr-FR");
  8788. break;
  8789. case "de":
  8790. case o.DE_DE:
  8791. this.locale = o.DE_DE, e = s("./strings-de-DE");
  8792. break;
  8793. case "ru":
  8794. case o.RU_RU:
  8795. this.locale = o.RU_RU, e = s("./strings-ru-RU");
  8796. break;
  8797. case "cn":
  8798. case o.CN_CN:
  8799. this.locale = o.CN_CN, e = s("./strings-cn-CN");
  8800. break;
  8801. case "jp":
  8802. case o.JP_JP:
  8803. this.locale = o.JP_JP, e = s("./strings-jp-JP");
  8804. break;
  8805. default:
  8806. a.info("Unsupported language tag, defaulting to 'en-US'"), this.locale = o.EN_US, e = s("./strings-en-US")
  8807. }
  8808. a.info("Using locale '" + this.locale + "'"), n.extendObject(this, e)
  8809. }, t.prototype.localizeGUI = function () {
  8810. var e = document.querySelector("#gui-parent");
  8811. this.localizeTree(e), this.localizeLoadingText()
  8812. }, t.prototype.localizeLoadingText = function () {
  8813. document.querySelector(".guide").show();
  8814. document.querySelector("#help-dialog").classList.add(this.locale), document.querySelector("#interaction-modal").classList.add(this.locale), document.querySelector("#gui").classList.add(this.locale)
  8815. }, t.prototype.localizeTree = function (e) {
  8816. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  8817. if (e.nodeType === Node.TEXT_NODE)(t = e.data.match(n)) && (i = t[1], e.data = this.localizeText(i) || i);
  8818. else if (e.nodeType === Node.ELEMENT_NODE) {
  8819. var r = e.getAttribute("title");
  8820. r && ((t = r.match(n)) && (i = t[1], e.setAttribute("title", this.localizeText(i) || i)))
  8821. }
  8822. for (e = e.firstChild; e;) this.localizeTree(e), e = e.nextSibling
  8823. }, t.prototype.localizeText = function (e) {
  8824. var t = this[e];
  8825. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."), t = s("./strings-en-US")[e]), t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"), t
  8826. }, l.exports = new t
  8827. }).call(this, "/js/localization/localize.js")
  8828. }, {
  8829. "../enum/Locale": 31,
  8830. "../settings": 166,
  8831. "../util/common": 185,
  8832. "../util/logger": 189,
  8833. "./strings-cn-CN": 109,
  8834. "./strings-de-DE": 110,
  8835. "./strings-en-US": 111,
  8836. "./strings-es-MX": 112,
  8837. "./strings-fr-FR": 113,
  8838. "./strings-jp-JP": 114,
  8839. "./strings-ru-RU": 115
  8840. }],
  8841. 109: [function (e, t, i) {
  8842. "use strict";
  8843. t.exports = {
  8844. PAGE_TITLE: "",
  8845. LOADING: "正在加载",
  8846. PRESENTED_BY_CAPS: "呈现者:",
  8847. POWERED_BY: "技术支持:",
  8848. POWERED_BY_CAPS: "技术支持:",
  8849. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  8850. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  8851. PRESENTED_BY: "呈现者:",
  8852. MORE: "更多 ",
  8853. LESS: "更少 ",
  8854. TAG_CONTENT: "tag™ 内容",
  8855. SHOW: "显示",
  8856. HIDE: "隐藏",
  8857. DOLLHOUSE: "场景屋",
  8858. FLOOR_PLAN: "楼层平面图",
  8859. OPEN_HIGHLIGHTS: "打开精彩片段",
  8860. CLOSE_HIGHLIGHTS: "关闭",
  8861. PREVIOUS: "上一个",
  8862. PLAY: "播放",
  8863. PAUSE: "暂停",
  8864. NEXT: "下一个",
  8865. EXPLORE_3D_SPACE: "探索 3D 空间",
  8866. VIEW_DOLLHOUSE: "观看场景屋",
  8867. SOCIAL_SHARING: "分享这个空间",
  8868. VIEW_IN_VR: "以 VR 观看",
  8869. VIEW_FULLSCREEN: "全屏观看",
  8870. EXIT_FULLSCREEN: " 退出全屏",
  8871. ZOOM_IN: "放大",
  8872. ZOOM_OUT: "缩小",
  8873. FLOOR_NAME: "楼层",
  8874. FLOOR_ALL: "ALL",
  8875. FLOOR_Lang: ["Floor", ""],
  8876. TERMS: "条款",
  8877. PORT_TERMS: "port 条款",
  8878. TERMS_OF_USE: "使用条款",
  8879. CLOSE_TERMS: "关闭",
  8880. TERMS_TEXT_FILE: "terms-cn-CN.html",
  8881. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  8882. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  8883. WEBVR_ENTER_WEBVR: "进入 VR",
  8884. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  8885. WEBVR_LEARN_MORE: "了解更多",
  8886. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  8887. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  8888. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  8889. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  8890. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  8891. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  8892. VR_LEARN_MORE_CAPS: "了解更多",
  8893. VR_PREVIOUS_CAPS: "上一个’,",
  8894. VR_NEXT_CAPS: "下一个",
  8895. VR_GOT_IT_CAPS: "明白了",
  8896. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  8897. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  8898. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  8899. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  8900. VR_WHAT_YOU_NEED: "关于...您需要什么",
  8901. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  8902. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  8903. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  8904. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  8905. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  8906. VR_GOOGLE_DAYDREAM: "Google Daydream",
  8907. VR_APP: "port VR 应用程序",
  8908. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  8909. VR_COMPATIBLE_IPHONES_1: "iPhones",
  8910. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  8911. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  8912. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  8913. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  8914. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  8915. VR_ANDROID_DVICES: "Android 设备",
  8916. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  8917. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  8918. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  8919. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  8920. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  8921. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  8922. VR_DOWNLOAD_HERE: "在此下载",
  8923. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  8924. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  8925. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  8926. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  8927. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  8928. SHARE_TO: "分享到",
  8929. SHARE_LINK: "直接链接",
  8930. SHARE_EXPLORE: "探索",
  8931. SHARE_AT: "在",
  8932. SHARE_WITH: "使用",
  8933. SHARE_3D: "以 3D",
  8934. SHARE_COPIED: "已复制!",
  8935. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  8936. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  8937. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  8938. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  8939. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  8940. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  8941. ERROR_GENERIC_ACTIONS_3: " 或",
  8942. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  8943. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  8944. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  8945. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  8946. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  8947. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  8948. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  8949. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  8950. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  8951. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  8952. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  8953. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  8954. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  8955. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  8956. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  8957. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  8958. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  8959. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  8960. LINK_TO_LOCATION: "地点链接",
  8961. MENU_COPY: "复制",
  8962. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  8963. ROTATE: "旋转",
  8964. MOVE: "移动",
  8965. INSIDE: "内部",
  8966. ZOOM: "缩放",
  8967. HELP: "小帮手",
  8968. HELP_NAVIGATION_TAB: "导航",
  8969. HELP_MORE_HELP_TAB: "更多帮助",
  8970. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  8971. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  8972. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  8973. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  8974. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  8975. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  8976. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  8977. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  8978. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  8979. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  8980. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  8981. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  8982. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  8983. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  8984. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  8985. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  8986. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  8987. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  8988. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  8989. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  8990. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  8991. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  8992. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  8993. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  8994. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  8995. HELP_MORE_HLR_A: "精彩片段集锦",
  8996. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  8997. HELP_MORE_DOLLHOUSE_A: "场景屋",
  8998. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  8999. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  9000. HELP_MORE_FLOORS_A: "楼层选择器",
  9001. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  9002. HELP_MORE_TAG_A: "tag™ 贴文",
  9003. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  9004. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  9005. HELP_MORE_ZOOM_A: "缩放控件",
  9006. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  9007. HELP_MORE_TOUR_A: "导览控件",
  9008. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  9009. HELP_MORE_INSIDE_A: "内部视图",
  9010. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  9011. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  9012. HELP_MORE_VR_A: "VR 模式",
  9013. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  9014. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  9015. HELP_MORE_360_A: "360° 视图",
  9016. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  9017. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  9018. HELP_MORE_FULLSCREEN_A: "全屏",
  9019. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  9020. CLOSE: "关闭"
  9021. }
  9022. }, {}],
  9023. 110: [function (e, t, i) {
  9024. "use strict";
  9025. t.exports = {
  9026. PAGE_TITLE: "",
  9027. LOADING: "Lädt",
  9028. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  9029. POWERED_BY: "Angetrieben von",
  9030. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  9031. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  9032. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  9033. PRESENTED_BY: "Präsentiert von ",
  9034. MORE: "Mehr ",
  9035. LESS: "Weniger ",
  9036. TAG_CONTENT: "tag™ Inhalt",
  9037. SHOW: "Anzeigen",
  9038. HIDE: "Verbergen",
  9039. DOLLHOUSE: "Puppenhaus",
  9040. FLOOR_PLAN: "Grundriss",
  9041. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  9042. CLOSE_HIGHLIGHTS: "Schließen",
  9043. PREVIOUS: "Vorheriges",
  9044. PLAY: "Abspielen",
  9045. PAUSE: "Pausieren",
  9046. NEXT: "Nächstes",
  9047. EXPLORE_3D_SPACE: "Innenraum betreten",
  9048. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  9049. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  9050. VIEW_IN_VR: "In VR ansehen",
  9051. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  9052. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  9053. ZOOM_IN: "Vergrößern",
  9054. ZOOM_OUT: "Verkleinern",
  9055. FLOOR_NAME: "Etage ",
  9056. FLOOR_ALL: "Alle",
  9057. TERMS: "Bedingungen",
  9058. PORT_TERMS: "port Bedingungen",
  9059. TERMS_OF_USE: "Nutzungsbedingungen",
  9060. TERMS_TEXT_FILE: "terms-de-DE.html",
  9061. CLOSE_TERMS: "Schließen",
  9062. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  9063. HELP: "Hilfe",
  9064. HELP_NAVIGATION_TAB: "Navigation",
  9065. HELP_MORE_HELP_TAB: "Hilfe-Details",
  9066. CLOSE: "Schließen",
  9067. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  9068. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  9069. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  9070. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  9071. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  9072. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  9073. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  9074. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  9075. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  9076. 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.",
  9077. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  9078. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  9079. 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.",
  9080. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  9081. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  9082. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  9083. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  9084. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  9085. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  9086. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  9087. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  9088. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  9089. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  9090. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  9091. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  9092. HELP_MORE_HLR_A: "Liste das Highlight",
  9093. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  9094. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  9095. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  9096. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  9097. HELP_MORE_FLOORS_A: "Etage auswählen",
  9098. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  9099. HELP_MORE_TAG_A: "tag™ Posts",
  9100. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  9101. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  9102. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  9103. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  9104. HELP_MORE_TOUR_A: "Tour Steuerung",
  9105. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  9106. HELP_MORE_INSIDE_A: "Innenansicht",
  9107. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  9108. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  9109. HELP_MORE_VR_A: "VR Modus",
  9110. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  9111. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  9112. HELP_MORE_360_A: "360° Views Ansicht ",
  9113. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  9114. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  9115. HELP_MORE_FULLSCREEN_A: "Vollbild",
  9116. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  9117. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  9118. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  9119. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  9120. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  9121. WEBVR_LEARN_MORE: "Mehr Infos",
  9122. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  9123. WEBVR_DAYDREAM_VIEW: "Daydream View",
  9124. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  9125. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  9126. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  9127. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  9128. VR_GOOGLE_DAYDREAM: "Google Daydream",
  9129. VR_APP: "port VR App",
  9130. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  9131. 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",
  9132. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  9133. VR_APP_FOR_ANDROID: "port VR app für Android",
  9134. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  9135. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  9136. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  9137. VR_PREVIOUS_CAPS: "ZURÜCK",
  9138. VR_NEXT_CAPS: "WEITER",
  9139. VR_GOT_IT_CAPS: "VERSTANDEN",
  9140. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  9141. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  9142. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  9143. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  9144. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  9145. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  9146. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  9147. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  9148. VR_COMPATIBLE_IPHONES_1: "iPhones",
  9149. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  9150. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  9151. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  9152. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  9153. VR_ANDROID_DVICES: "Android Geräte",
  9154. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  9155. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  9156. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  9157. VR_DOWNLOAD_HERE: "Hier runterladen",
  9158. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  9159. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  9160. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  9161. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  9162. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  9163. SHARE_TO: "Teilen auf",
  9164. SHARE_LINK: "Direkter Link",
  9165. SHARE_EXPLORE: "Umsehen",
  9166. SHARE_AT: "auf",
  9167. SHARE_WITH: "mit",
  9168. SHARE_3D: "in 3D",
  9169. SHARE_COPIED: "Kopiert!",
  9170. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  9171. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  9172. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  9173. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  9174. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  9175. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  9176. ERROR_GENERIC_ACTIONS_3: " oder ",
  9177. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  9178. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  9179. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  9180. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  9181. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  9182. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  9183. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  9184. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  9185. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  9186. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  9187. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  9188. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  9189. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  9190. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  9191. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  9192. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  9193. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  9194. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  9195. LINK_TO_LOCATION: "Link zu",
  9196. MENU_COPY: "Kopieren",
  9197. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  9198. ROTATE: "Drehen",
  9199. INSIDE: "Drinnen",
  9200. MOVE: "Bewegen",
  9201. ZOOM: "Vergrößern"
  9202. }
  9203. }, {}],
  9204. 111: [function (e, t, i) {
  9205. "use strict";
  9206. t.exports = {
  9207. PAGE_TITLE: "",
  9208. LOADING: "Loading",
  9209. PRESENTED_BY_CAPS: "PRESENTED BY",
  9210. POWERED_BY: "powered by ",
  9211. POWERED_BY_CAPS: "POWERED BY",
  9212. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  9213. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  9214. PRESENTED_BY: "Presented by ",
  9215. MORE: "More ",
  9216. LESS: "Less ",
  9217. TAG_CONTENT: "tag™ Content",
  9218. SHOW: "Show",
  9219. HIDE: "Hide",
  9220. DOLLHOUSE: "Dollhouse",
  9221. FLOOR_PLAN: "Floor plan",
  9222. OPEN_HIGHLIGHTS: "Open Highlights",
  9223. CLOSE_HIGHLIGHTS: "Close",
  9224. PREVIOUS: "Previous",
  9225. PLAY: "Play",
  9226. PAUSE: "Pause",
  9227. NEXT: "Next",
  9228. EXPLORE_3D_SPACE: "Explore 3D Space",
  9229. VIEW_DOLLHOUSE: "View dollhouse",
  9230. SOCIAL_SHARING: "Share this Space",
  9231. VIEW_IN_VR: "View in VR",
  9232. VIEW_FULLSCREEN: "全屏",
  9233. EXIT_FULLSCREEN: "退出全屏",
  9234. ZOOM_IN: "Zoom in",
  9235. ZOOM_OUT: "Zoom out",
  9236. FLOOR_NAME: "Floor ",
  9237. FLOOR_ALL: "全部",
  9238. TERMS: "Terms",
  9239. PORT_TERMS: "port terms",
  9240. TERMS_OF_USE: "Terms of Use",
  9241. TERMS_TEXT_FILE: "terms-en-US.html",
  9242. CLOSE_TERMS: "Close",
  9243. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  9244. HELP: "Help",
  9245. HELP_NAVIGATION_TAB: "Navigation",
  9246. HELP_MORE_HELP_TAB: "More Help",
  9247. CLOSE: "Close",
  9248. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  9249. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  9250. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  9251. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  9252. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  9253. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  9254. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  9255. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  9256. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  9257. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  9258. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  9259. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  9260. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  9261. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  9262. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  9263. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  9264. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  9265. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  9266. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  9267. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  9268. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  9269. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  9270. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  9271. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  9272. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  9273. HELP_MORE_HLR_A: "Highlight Reel",
  9274. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  9275. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  9276. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  9277. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  9278. HELP_MORE_FLOORS_A: "Floor Selector",
  9279. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  9280. HELP_MORE_TAG_A: "tag™ Posts",
  9281. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  9282. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  9283. HELP_MORE_ZOOM_A: "Zoom Controls",
  9284. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  9285. HELP_MORE_TOUR_A: "Tour Controls",
  9286. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  9287. HELP_MORE_INSIDE_A: "Inside View",
  9288. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  9289. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  9290. HELP_MORE_VR_A: "VR Mode",
  9291. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  9292. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  9293. HELP_MORE_360_A: "360° Views",
  9294. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  9295. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  9296. HELP_MORE_FULLSCREEN_A: "Full screen",
  9297. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  9298. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  9299. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  9300. WEBVR_FOR_DAYDREAM: "For Daydream View",
  9301. WEBVR_ENTER_WEBVR: "ENTER VR",
  9302. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  9303. WEBVR_LEARN_MORE: "Learn more",
  9304. WEBVR_VIEW_SPACE: "View Space in VR",
  9305. WEBVR_DAYDREAM_VIEW: "Daydream View",
  9306. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  9307. VR_VIEW_SPACE: "View Space in Virtual Reality",
  9308. VR_LEARN_MORE_CAPS: "LEARN MORE",
  9309. VR_PREVIOUS_CAPS: "PREVIOUS",
  9310. VR_NEXT_CAPS: "NEXT",
  9311. VR_GOT_IT_CAPS: "GOT IT",
  9312. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  9313. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  9314. VR_SHOW_IOS_1: "Tap to view the space in VR",
  9315. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  9316. VR_WHAT_YOU_NEED: "What You'll Need For...",
  9317. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  9318. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  9319. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  9320. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  9321. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  9322. VR_GOOGLE_DAYDREAM: "Google Daydream",
  9323. VR_APP: "port VR App",
  9324. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  9325. VR_COMPATIBLE_IPHONES_1: "iPhones",
  9326. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  9327. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  9328. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  9329. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  9330. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  9331. VR_ANDROID_DVICES: "Android Devices",
  9332. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  9333. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  9334. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  9335. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  9336. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  9337. VR_APP_OPEN: "Open with the port VR app instead",
  9338. VR_DOWNLOAD_HERE: "Download here",
  9339. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  9340. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  9341. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  9342. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  9343. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  9344. SHARE_TO: "Share to",
  9345. SHARE_LINK: "Direct Link",
  9346. SHARE_EXPLORE: "Explore ",
  9347. SHARE_AT: "at",
  9348. SHARE_WITH: "with",
  9349. SHARE_3D: " in 3D",
  9350. SHARE_COPIED: "Copied!",
  9351. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  9352. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  9353. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  9354. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  9355. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  9356. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  9357. ERROR_GENERIC_ACTIONS_3: " or ",
  9358. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  9359. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  9360. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  9361. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  9362. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  9363. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  9364. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  9365. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  9366. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  9367. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  9368. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  9369. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  9370. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  9371. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  9372. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  9373. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  9374. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  9375. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  9376. LINK_TO_LOCATION: "Link to location",
  9377. MENU_COPY: "Copy",
  9378. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  9379. ROTATE: "Rotate",
  9380. INSIDE: "Inside",
  9381. MOVE: "Move",
  9382. ZOOM: "Zoom"
  9383. }
  9384. }, {}],
  9385. 112: [function (e, t, i) {
  9386. "use strict";
  9387. t.exports = {
  9388. PAGE_TITLE: "",
  9389. LOADING: "Cargando",
  9390. PRESENTED_BY_CAPS: "PRESENTADO POR",
  9391. POWERED_BY: "potenciando por ",
  9392. POWERED_BY_CAPS: "POTENCIADO POR ",
  9393. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  9394. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  9395. PRESENTED_BY: "Presentado por ",
  9396. MORE: "Más ",
  9397. LESS: "Menos ",
  9398. TAG_CONTENT: "Contenido de tag™",
  9399. SHOW: "Mostrar",
  9400. HIDE: "Ocultar",
  9401. DOLLHOUSE: "Dollhouse",
  9402. FLOOR_PLAN: "Planos",
  9403. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  9404. CLOSE_HIGHLIGHTS: "Cerrar",
  9405. PREVIOUS: "Anterior",
  9406. PLAY: "Play",
  9407. PAUSE: "Pausa",
  9408. NEXT: "Siguiente",
  9409. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  9410. VIEW_DOLLHOUSE: "Ver dollhouse",
  9411. SOCIAL_SHARING: "Compartir este espacio",
  9412. VIEW_IN_VR: "Ver en realidad virtual",
  9413. VIEW_FULLSCREEN: "Ver en pantalla completa",
  9414. EXIT_FULLSCREEN: "Salir de pantalla completa",
  9415. ZOOM_IN: "Acercar",
  9416. ZOOM_OUT: "Alejar",
  9417. FLOOR_NAME: "Piso ",
  9418. FLOOR_ALL: "Todas",
  9419. TERMS: "Condiciones",
  9420. PORT_TERMS: "port términos de uso",
  9421. TERMS_OF_USE: "Términos de uso",
  9422. TERMS_TEXT_FILE: "terms-es-MX.html",
  9423. CLOSE_TERMS: "Cerrar",
  9424. 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.",
  9425. HELP: "Ayuda",
  9426. HELP_NAVIGATION_TAB: "Navegación",
  9427. HELP_MORE_HELP_TAB: "Más Ayuda",
  9428. CLOSE: "Cerrar",
  9429. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  9430. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  9431. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  9432. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  9433. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  9434. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  9435. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  9436. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  9437. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  9438. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  9439. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  9440. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  9441. 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.",
  9442. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  9443. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  9444. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  9445. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  9446. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  9447. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  9448. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  9449. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  9450. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  9451. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  9452. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  9453. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  9454. HELP_MORE_HLR_A: "Galería destacada",
  9455. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  9456. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  9457. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  9458. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  9459. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  9460. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  9461. HELP_MORE_TAG_A: "tag™ Posts",
  9462. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  9463. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  9464. HELP_MORE_ZOOM_A: "Controles de zoom",
  9465. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  9466. HELP_MORE_TOUR_A: "Controles de recorrido",
  9467. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  9468. HELP_MORE_INSIDE_A: "Vista interior",
  9469. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  9470. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  9471. HELP_MORE_VR_A: "Modo de realidad virtual",
  9472. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  9473. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  9474. HELP_MORE_360_A: "360° Views",
  9475. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  9476. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  9477. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  9478. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  9479. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  9480. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  9481. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  9482. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  9483. WEBVR_LEARN_MORE: "Más información",
  9484. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  9485. WEBVR_DAYDREAM_VIEW: "Daydream View",
  9486. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  9487. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  9488. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  9489. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  9490. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  9491. VR_APP: "port VR App",
  9492. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  9493. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  9494. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  9495. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  9496. VR_LEARN_MORE_CAPS: "SABER MÁS",
  9497. VR_PREVIOUS_CAPS: "ANTERIOR",
  9498. VR_NEXT_CAPS: "SIGUIENTE",
  9499. VR_GOT_IT_CAPS: "COMPRENDIDO",
  9500. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  9501. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  9502. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  9503. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  9504. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  9505. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  9506. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  9507. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  9508. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  9509. VR_COMPATIBLE_IPHONES_1: "iPhones",
  9510. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  9511. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  9512. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  9513. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  9514. VR_ANDROID_DVICES: "Dispositivos Android",
  9515. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  9516. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  9517. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  9518. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  9519. VR_DOWNLOAD_HERE: "Descargar aquí",
  9520. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  9521. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  9522. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  9523. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  9524. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  9525. SHARE_TO: "Compartir en",
  9526. SHARE_LINK: "Enlace directo",
  9527. SHARE_EXPLORE: "Explorar ",
  9528. SHARE_AT: "en",
  9529. SHARE_WITH: "con",
  9530. SHARE_3D: " en 3D",
  9531. SHARE_COPIED: "¡Copiado!",
  9532. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  9533. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  9534. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  9535. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  9536. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  9537. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  9538. ERROR_GENERIC_ACTIONS_3: " o ",
  9539. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  9540. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  9541. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  9542. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  9543. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  9544. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  9545. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  9546. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  9547. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  9548. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  9549. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  9550. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  9551. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  9552. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  9553. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  9554. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  9555. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  9556. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  9557. LINK_TO_LOCATION: "Enlace a la ubicación",
  9558. MENU_COPY: "Copiar",
  9559. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  9560. ROTATE: "Girar",
  9561. INSIDE: "Interior",
  9562. MOVE: "Moverse",
  9563. ZOOM: "Acercar o alejar"
  9564. }
  9565. }, {}],
  9566. 113: [function (e, t, i) {
  9567. "use strict";
  9568. t.exports = {
  9569. PAGE_TITLE: "",
  9570. LOADING: "Chargement",
  9571. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  9572. POWERED_BY: "alimenté par ",
  9573. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  9574. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  9575. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  9576. PRESENTED_BY: "Présenté par ",
  9577. MORE: "Plus ",
  9578. LESS: "Moins ",
  9579. TAG_CONTENT: "Contenu tag™",
  9580. SHOW: "Montrer",
  9581. HIDE: "Cacher",
  9582. DOLLHOUSE: "Dollhouse",
  9583. FLOOR_PLAN: "Plan de sol",
  9584. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  9585. CLOSE_HIGHLIGHTS: "Fermer",
  9586. PREVIOUS: "Précédent",
  9587. PLAY: "Lecture",
  9588. PAUSE: "Pause",
  9589. NEXT: "Suivant",
  9590. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  9591. VIEW_DOLLHOUSE: "Voir dollhouse",
  9592. SOCIAL_SHARING: "Partager cet espace",
  9593. VIEW_IN_VR: "Voir en VR",
  9594. VIEW_FULLSCREEN: "Plein écran",
  9595. EXIT_FULLSCREEN: "Fermer plein écran",
  9596. ZOOM_IN: "Zoom avant",
  9597. ZOOM_OUT: "Zoom arrière",
  9598. FLOOR_NAME: "Étage ",
  9599. FLOOR_ALL: "Tous",
  9600. TERMS: "Mentions légales",
  9601. PORT_TERMS: "port mentions légales",
  9602. TERMS_OF_USE: "Conditions d'utilisation",
  9603. TERMS_TEXT_FILE: "terms-fr-FR.html",
  9604. CLOSE_TERMS: "Fermer",
  9605. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  9606. HELP: "Aide",
  9607. HELP_NAVIGATION_TAB: "Navigation",
  9608. HELP_MORE_HELP_TAB: "Aide",
  9609. CLOSE: "Fermer",
  9610. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  9611. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  9612. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  9613. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  9614. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  9615. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  9616. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  9617. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  9618. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  9619. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  9620. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  9621. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  9622. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  9623. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  9624. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  9625. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  9626. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  9627. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  9628. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  9629. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  9630. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  9631. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  9632. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  9633. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  9634. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  9635. HELP_MORE_HLR_A: "Carrousel",
  9636. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  9637. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  9638. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  9639. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  9640. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  9641. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  9642. HELP_MORE_TAG_A: "tag™ Posts",
  9643. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  9644. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  9645. HELP_MORE_ZOOM_A: "Commandes de zoom",
  9646. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  9647. HELP_MORE_TOUR_A: "Commandes de la visite",
  9648. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  9649. HELP_MORE_INSIDE_A: "Vue intérieure",
  9650. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  9651. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  9652. HELP_MORE_VR_A: "Mode RV",
  9653. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  9654. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  9655. HELP_MORE_360_A: "Vues 360°",
  9656. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  9657. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  9658. HELP_MORE_FULLSCREEN_A: "Plein écran",
  9659. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  9660. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  9661. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  9662. WEBVR_ENTER_WEBVR: "ENTRER VR",
  9663. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  9664. WEBVR_LEARN_MORE: "En savoir plus",
  9665. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  9666. WEBVR_DAYDREAM_VIEW: "Daydream View",
  9667. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  9668. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  9669. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  9670. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  9671. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  9672. VR_NEXT_CAPS: "SUIVANT",
  9673. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  9674. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  9675. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  9676. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  9677. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  9678. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  9679. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  9680. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  9681. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  9682. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  9683. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  9684. VR_GOOGLE_DAYDREAM: "Google Daydream",
  9685. VR_APP: "port VR App",
  9686. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  9687. VR_COMPATIBLE_IPHONES_1: "iPhones",
  9688. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  9689. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  9690. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  9691. 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",
  9692. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  9693. VR_ANDROID_DVICES: "Appareils Android",
  9694. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  9695. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  9696. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  9697. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  9698. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  9699. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  9700. VR_DOWNLOAD_HERE: "Télécharger ici",
  9701. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  9702. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  9703. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  9704. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  9705. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  9706. SHARE_TO: "Partager sur",
  9707. SHARE_LINK: "Lien direct",
  9708. SHARE_EXPLORE: "Explorer ",
  9709. SHARE_AT: "à",
  9710. SHARE_WITH: "avec",
  9711. SHARE_3D: " en 3D",
  9712. SHARE_COPIED: "Copié!",
  9713. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  9714. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  9715. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  9716. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  9717. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  9718. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  9719. ERROR_GENERIC_ACTIONS_3: " ou ",
  9720. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  9721. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  9722. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  9723. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  9724. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  9725. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  9726. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  9727. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  9728. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  9729. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  9730. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  9731. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  9732. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  9733. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  9734. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  9735. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  9736. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  9737. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  9738. LINK_TO_LOCATION: "Lien vers l'emplacement",
  9739. MENU_COPY: "Copie",
  9740. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  9741. ROTATE: "Faire pivoter",
  9742. INSIDE: "Intérieure",
  9743. MOVE: "Se déplacer",
  9744. ZOOM: "Zoom"
  9745. }
  9746. }, {}],
  9747. 114: [function (e, t, i) {
  9748. "use strict";
  9749. t.exports = {
  9750. PAGE_TITLE: "",
  9751. LOADING: "読み込み中",
  9752. PRESENTED_BY_CAPS: "PRESENTED BY",
  9753. POWERED_BY: "powered by",
  9754. POWERED_BY_CAPS: "POWERED BY",
  9755. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  9756. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  9757. PRESENTED_BY: "Presented by ",
  9758. MORE: "全て表示 ",
  9759. LESS: "閉じる ",
  9760. TAG_CONTENT: "tag™コンテンツ ",
  9761. SHOW: "表示",
  9762. HIDE: "非表示",
  9763. DOLLHOUSE: "ドールハウス",
  9764. FLOOR_PLAN: "フロアプラン",
  9765. OPEN_HIGHLIGHTS: "ハイライトを開く",
  9766. CLOSE_HIGHLIGHTS: "閉じる",
  9767. PREVIOUS: "前へ",
  9768. PLAY: "再生",
  9769. PAUSE: "一時停止",
  9770. NEXT: "次へ",
  9771. EXPLORE_3D_SPACE: "3DSpaceの探索",
  9772. VIEW_DOLLHOUSE: "ドールハウスの表示",
  9773. SOCIAL_SHARING: "このSpaceを共有する",
  9774. VIEW_IN_VR: "VRで表示",
  9775. VIEW_FULLSCREEN: "フルスクリーン表示",
  9776. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  9777. ZOOM_IN: "ズームイン",
  9778. ZOOM_OUT: "ズームアウト",
  9779. FLOOR_NAME: "フロア ",
  9780. FLOOR_ALL: "すべて",
  9781. TERMS: "規約",
  9782. PORT_TERMS: "port規約",
  9783. TERMS_OF_USE: "利用規約",
  9784. CLOSE_TERMS: "閉じる",
  9785. TERMS_TEXT_FILE: "terms-jp-JP.html",
  9786. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  9787. WEBVR_FOR_DAYDREAM: "Daydream View用",
  9788. WEBVR_ENTER_WEBVR: "VRに入る",
  9789. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  9790. WEBVR_LEARN_MORE: "もっと詳しく",
  9791. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  9792. WEBVR_DAYDREAM_VIEW: "Daydream View",
  9793. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  9794. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  9795. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  9796. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  9797. VR_LEARN_MORE_CAPS: "もっと詳しく",
  9798. VR_PREVIOUS_CAPS: "前へ",
  9799. VR_NEXT_CAPS: "次へ",
  9800. VR_GOT_IT_CAPS: "了解",
  9801. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  9802. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  9803. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  9804. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  9805. VR_WHAT_YOU_NEED: "必要なもの",
  9806. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  9807. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  9808. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  9809. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  9810. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  9811. VR_GOOGLE_DAYDREAM: "Google Daydream",
  9812. VR_APP: "port VRアプリ",
  9813. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  9814. VR_COMPATIBLE_IPHONES_1: "iPhone",
  9815. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  9816. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  9817. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  9818. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  9819. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  9820. VR_ANDROID_DVICES: "Androidデバイス",
  9821. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  9822. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  9823. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  9824. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  9825. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  9826. VR_APP_OPEN: "port VRアプリで開く",
  9827. VR_DOWNLOAD_HERE: "ここからダウンロード",
  9828. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  9829. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  9830. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  9831. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  9832. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  9833. SHARE_TO: "共有先",
  9834. SHARE_LINK: "ダイレクトリンク",
  9835. SHARE_EXPLORE: "探索",
  9836. SHARE_AT: "場所",
  9837. SHARE_WITH: "使用アプリ",
  9838. SHARE_3D: "3Dで",
  9839. SHARE_COPIED: "コピーされました!",
  9840. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  9841. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  9842. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  9843. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  9844. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  9845. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  9846. ERROR_GENERIC_ACTIONS_3: "または",
  9847. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  9848. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  9849. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  9850. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  9851. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  9852. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  9853. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  9854. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  9855. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  9856. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  9857. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  9858. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  9859. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  9860. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  9861. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  9862. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  9863. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  9864. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  9865. LINK_TO_LOCATION: "ロケーションへのリンク",
  9866. MENU_COPY: "コピー",
  9867. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  9868. ROTATE: "回転",
  9869. MOVE: "移動",
  9870. INSIDE: "内側",
  9871. ZOOM: "ズーム",
  9872. HELP: "ヘルプ",
  9873. HELP_NAVIGATION_TAB: "ナビゲーション",
  9874. HELP_MORE_HELP_TAB: "その他のヘルプ",
  9875. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  9876. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  9877. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  9878. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  9879. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  9880. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  9881. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  9882. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  9883. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  9884. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  9885. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  9886. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  9887. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  9888. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  9889. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  9890. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  9891. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  9892. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  9893. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  9894. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  9895. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  9896. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  9897. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  9898. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  9899. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  9900. HELP_MORE_HLR_A: "ハイライト",
  9901. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  9902. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  9903. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  9904. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  9905. HELP_MORE_FLOORS_A: "フロアセレクター",
  9906. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  9907. HELP_MORE_TAG_A: "tag™ Posts",
  9908. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  9909. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  9910. HELP_MORE_ZOOM_A: "ズームコントロール",
  9911. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  9912. HELP_MORE_TOUR_A: "ツアーコントロール",
  9913. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  9914. HELP_MORE_INSIDE_A: "内側ビュー",
  9915. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  9916. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  9917. HELP_MORE_VR_A: "VRモード",
  9918. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  9919. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  9920. HELP_MORE_360_A: "360° Views",
  9921. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  9922. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  9923. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  9924. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  9925. CLOSE: "閉じる"
  9926. }
  9927. }, {}],
  9928. 115: [function (e, t, i) {
  9929. "use strict";
  9930. t.exports = {
  9931. PAGE_TITLE: "",
  9932. LOADING: "Загрузка",
  9933. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  9934. POWERED_BY: "разработано на платформе ",
  9935. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  9936. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  9937. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  9938. PRESENTED_BY: "Представлено ",
  9939. MORE: "Больше ",
  9940. LESS: "Меньше ",
  9941. TAG_CONTENT: "tag™ Контент",
  9942. SHOW: "Показать",
  9943. HIDE: "Скрыть",
  9944. DOLLHOUSE: "Dollhouse",
  9945. FLOOR_PLAN: "Планировка",
  9946. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  9947. CLOSE_HIGHLIGHTS: "Закрыть",
  9948. PREVIOUS: "Предыдущий",
  9949. PLAY: "Воспроизвести",
  9950. PAUSE: "Пауза",
  9951. NEXT: "Следующий",
  9952. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  9953. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  9954. SOCIAL_SHARING: "Поделиться этой моделью",
  9955. VIEW_IN_VR: "Посмотреть в VR",
  9956. VIEW_FULLSCREEN: "Полный экран",
  9957. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  9958. ZOOM_IN: "Увеличить",
  9959. ZOOM_OUT: "Уменьшить",
  9960. FLOOR_NAME: "Этаж ",
  9961. FLOOR_ALL: "Все",
  9962. TERMS: "Условия",
  9963. PORT_TERMS: "Правила пользования",
  9964. TERMS_OF_USE: "Условия использования",
  9965. TERMS_TEXT_FILE: "terms-ru-RU.html",
  9966. CLOSE_TERMS: "Закрыть",
  9967. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  9968. HELP: "Помощь",
  9969. HELP_NAVIGATION_TAB: "Навигация",
  9970. HELP_MORE_HELP_TAB: "Доп. Помощь",
  9971. CLOSE: "Закрыть",
  9972. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  9973. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  9974. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  9975. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  9976. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  9977. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  9978. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  9979. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  9980. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  9981. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  9982. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  9983. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  9984. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  9985. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  9986. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  9987. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  9988. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  9989. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  9990. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  9991. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  9992. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  9993. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  9994. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  9995. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  9996. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  9997. HELP_MORE_HLR_A: "Фотоколлаж",
  9998. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  9999. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  10000. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  10001. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  10002. HELP_MORE_FLOORS_A: "Выбор Этажа",
  10003. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  10004. HELP_MORE_TAG_A: "tag™ Posts",
  10005. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  10006. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  10007. HELP_MORE_ZOOM_A: "Масштаб",
  10008. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  10009. HELP_MORE_TOUR_A: "Управление Туром",
  10010. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  10011. HELP_MORE_INSIDE_A: "Вид Изнутри",
  10012. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  10013. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  10014. HELP_MORE_VR_A: "Режим VR",
  10015. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  10016. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  10017. HELP_MORE_360_A: "360° Views",
  10018. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  10019. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  10020. HELP_MORE_FULLSCREEN_A: "Полный экран",
  10021. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  10022. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  10023. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  10024. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  10025. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  10026. WEBVR_LEARN_MORE: "Узнать больше",
  10027. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  10028. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  10029. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  10030. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  10031. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  10032. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  10033. VR_GOOGLE_DAYDREAM: "Google Daydream",
  10034. VR_APP: "port VR App",
  10035. VR_APP_OPEN: "Или открыть через приложение port VR",
  10036. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  10037. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  10038. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  10039. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  10040. VR_VIEW_SPACE: "Запустить модель в VR",
  10041. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  10042. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  10043. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  10044. VR_GOT_IT_CAPS: "ЯСНО",
  10045. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  10046. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  10047. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  10048. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  10049. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  10050. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  10051. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  10052. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  10053. VR_COMPATIBLE_IPHONES_1: "iPhones",
  10054. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  10055. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  10056. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  10057. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  10058. VR_ANDROID_DVICES: "Android устройства",
  10059. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  10060. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  10061. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  10062. VR_DOWNLOAD_HERE: "Скачать здесь",
  10063. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  10064. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  10065. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  10066. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  10067. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  10068. SHARE_TO: "Поделиться",
  10069. SHARE_LINK: "Прямая ссылка",
  10070. SHARE_EXPLORE: "просмотреть",
  10071. SHARE_AT: "на",
  10072. SHARE_WITH: "с",
  10073. SHARE_3D: "в 3D",
  10074. SHARE_COPIED: "Скопировано!",
  10075. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  10076. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  10077. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  10078. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  10079. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  10080. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  10081. ERROR_GENERIC_ACTIONS_3: " или ",
  10082. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  10083. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  10084. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  10085. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  10086. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  10087. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  10088. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  10089. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  10090. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  10091. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  10092. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  10093. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  10094. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  10095. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  10096. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  10097. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  10098. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  10099. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  10100. LINK_TO_LOCATION: "Ссылка на местоположение",
  10101. MENU_COPY: "Копировать",
  10102. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  10103. ROTATE: "Вращать",
  10104. MOVE: "Передвигаться",
  10105. INSIDE: "Вид изнутри",
  10106. ZOOM: "Масштаб"
  10107. }
  10108. }, {}],
  10109. 116: [function (r, e, t) {
  10110. (function (i) {
  10111. "use strict";
  10112. function re(e) {
  10113. console.log("e1:" + e), e = Math.round(.4 * e * 100), console.log("e2:" + e);
  10114. var t = $(".progressbar");
  10115. t.find(".bar").css("width", e + "%"), t.find(".label").css("left", t.width() * e / 100 - 15 + "px"), t.find(".perc").text(e + "%")
  10116. }
  10117. $("#gui-loading").fadeIn(200), re(.1);
  10118. var e = g_version ? "modeldata.js" : "someData.json";
  10119. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  10120. dataType: "json"
  10121. }).done(function (e) {
  10122. var t = matcher(e);
  10123. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number), t.user = {
  10124. is_authenticated: !1,
  10125. flags: ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  10126. }, window.MP_PREFETCHED_MODELDATA = t, re(.7),
  10127. function () {
  10128. function y(e) {
  10129. t.update(e)
  10130. }
  10131. function A(e, t) {
  10132. ne.error(t), n.error(t), N.report(e, "error-" + t)
  10133. }
  10134. function C(e, t, i) {
  10135. try {
  10136. e.start(t)
  10137. } catch (e) {
  10138. throw ne.warn(e.message),
  10139. function (e) {
  10140. var t = O.details();
  10141. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"), N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"), N.report(e, "error-webgl-generic"))
  10142. }(i.sid), e
  10143. }
  10144. }
  10145. function I(e) {
  10146. e.stopPropagation(), e.preventDefault()
  10147. }
  10148. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  10149. point: window.MP_PREFETCHED_MODELDATA.hoticon.default,
  10150. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt
  10151. });
  10152. window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic, $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  10153. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  10154. r("./lib/three75-shim"), r("./lib/array-polyfill"), r("./lib/performance-polyfill"), r("./lib/shaders/CopyShader.js"), r("./lib/shaders/HorizontalBlurShader.js"), r("./lib/shaders/VerticalBlurShader.js"), r("./lib/postprocessing/EffectComposer.js"), r("./lib/postprocessing/RenderPass.js"), r("./lib/postprocessing/MaskPass.js"), r("./lib/postprocessing/ShaderPass.js"), window.Promise || (window.Promise = r("promise-polyfill"));
  10155. var E = r("three"),
  10156. _ = r("three"),
  10157. b = (r("./util/sentry"), r("./player")),
  10158. w = r("./director"),
  10159. T = r("./controls/CameraControls"),
  10160. x = r("./model/ModelManager"),
  10161. S = r("./DisplayController"),
  10162. M = r("./label/LabelDisplayController"),
  10163. R = r("./enum/Viewmode"),
  10164. e = r("./util/logger"),
  10165. P = r("./showcase"),
  10166. O = r("./util/browser"),
  10167. L = r("./settings"),
  10168. D = r("./gui/gui"),
  10169. n = r("./gui/error"),
  10170. N = r("./analytics"),
  10171. F = r("./util/transitions"),
  10172. B = r("./effects"),
  10173. V = r("./objects/Skybox"),
  10174. k = (r("./util/common"), r("./util/PanoramaCollection"), r("./util/math"), r("./util/showcase")),
  10175. U = r("./util/camera"),
  10176. H = (r("./objects/Panorama"), r("./cameras/PanoramaCamera"), r("./preloaders")),
  10177. z = r("events").EventEmitter,
  10178. G = r("./featureflags"),
  10179. W = (r("./util/lerp"), r("./util/ajax"), r("./ab")),
  10180. j = r("./sdk/automation.js"),
  10181. Y = r("./scene/SceneRenderer"),
  10182. q = r("./scene/QuickstartManager"),
  10183. X = r("./tile/QualityManager.js"),
  10184. Z = r("./localization/localize"),
  10185. K = r("./tag/tagManager"),
  10186. Q = r("./tile/TileDownloader"),
  10187. J = r("./tile/PanoRenderer"),
  10188. ee = (r("./enum/PanoSizeClass"), r("./enum/PanoramaEvents"), r("./enum/SceneRendererEvents")),
  10189. t = r("./gui/memoryUsage"),
  10190. te = r("./enum/RenderLayers"),
  10191. ie = r("./TimingData"),
  10192. ne = new e(i);
  10193. e.level = L.logLevel, e.consoleEnabled = L.console,
  10194. function () {
  10195. var e = k.getModelIDFromQueryString();
  10196. if (!e) return A(null, "loading-failed");
  10197. var t = k.parseSidUrl(e),
  10198. i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage",
  10199. n = {
  10200. panoElementsToLoad: 6,
  10201. modelElementsToLoad: 0,
  10202. totalElementsLoaded: 0,
  10203. totalElementsToLoad: 0,
  10204. totalPercentageLoaded: 0,
  10205. progressCallback: null
  10206. },
  10207. r = document.getElementById("player"),
  10208. o = L.quickstart.enabled,
  10209. a = null,
  10210. s = null,
  10211. l = null,
  10212. c = null,
  10213. h = null,
  10214. u = null,
  10215. d = null,
  10216. p = null,
  10217. f = null,
  10218. g = null,
  10219. m = null,
  10220. v = new ie;
  10221. ! function (e) {
  10222. ne.info("Version", "2.25.6-0-gd87e5b1"), z.defaultMaxListeners = 1e3,
  10223. function (e) {
  10224. e.addEventListener("dragenter", I, !1), e.addEventListener("dragover", I, !1)
  10225. }(e), O.valueFromHash("title", !0) || $(document).ready(function () {
  10226. $(".model-title").hide()
  10227. })
  10228. }(r),
  10229. function (e) {
  10230. return G.loadFeatureFlags(e).done(function (e) {
  10231. G.updateDependentSettings(e, L)
  10232. })
  10233. }({
  10234. urlBase: t.urlBase
  10235. }).then(function () {
  10236. return Z.init(),
  10237. function (e, t) {
  10238. var i = P.getModel({
  10239. url: t,
  10240. floors: O.valueFromHash("f", !0),
  10241. autoload: !1
  10242. });
  10243. return $.when(i, y).then(null, function (e) {
  10244. return this
  10245. })
  10246. }(0, e)
  10247. }).then(function (e) {
  10248. return re(.9),
  10249. function (e, t, i, n, r) {
  10250. ne.info("Model data loaded"), ne.debug("UUID: " + e.data.job.uuid), W.init(G.getFlags()), i && N.initKeen({
  10251. token: i,
  10252. appId: n
  10253. }), N.initSegment({
  10254. model: e.sid,
  10255. version: "2.25.6-0-gd87e5b1",
  10256. startSource: r.startSource,
  10257. token: t,
  10258. autoplay: r.autoplay,
  10259. quickstart: r.quickstart
  10260. })
  10261. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  10262. startSource: i,
  10263. autoplay: L.autoplay,
  10264. quickstart: o
  10265. }), g.urls.init()
  10266. }).then(function () {
  10267. return g.loadPanos()
  10268. }).then(function () {
  10269. s = U.getStartCameraOptions(g, g.panos), d = function (e) {
  10270. var t = new E.PerspectiveCamera;
  10271. t.layers.enable(te.PANOMARKERS), t.layers.enable(te.RETICULE), t.layers.enable(te.TAG);
  10272. var o = new E.Scene,
  10273. i = new E.AmbientLight(16777215);
  10274. return o.add(i), o.skybox = new V, o.add(o.skybox), o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5, 1e5), new E.RawShaderMaterial({
  10275. side: E.DoubleSide
  10276. })), o.plane.position.y = 0, o.plane.rotateX(-Math.PI / 2), o.plane.material.visible = !1, o.add(o.plane), o.updateMatrixWorld(), L.showScreenshotLocations && e.data.images.forEach(function (e) {
  10277. if (e.metadata && e.metadata.camera_position) {
  10278. var t = e.metadata.camera_position,
  10279. i = new E.Mesh(new E.BoxGeometry(.3, .3, .3));
  10280. i.position = t.clone(), o.add(i);
  10281. var n = e.metadata.camera_quaternion,
  10282. r = new E.Vector3(0, 0, -1).applyQuaternion(n);
  10283. o.add(new E.ArrowHelper(r, t.clone(), 1, 16711680))
  10284. }
  10285. }), L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0, 1, 0), new E.Vector3(0, 0, 0), 1, 255)), o.add(new E.ArrowHelper(new E.Vector3(0, 0, 1), new E.Vector3(0, 0, 0), 1, 16711680)), o.add(new E.ArrowHelper(new E.Vector3(1, 0, 0), new E.Vector3(0, 0, 0), 1, 65280))), new Y(o, t, B)
  10286. }(g), m = function (e, t) {
  10287. var i = e ? 1 : 1e3,
  10288. n = W.tilegen || W.imgopt ? 6 : 2;
  10289. n = O.valueFromHash("tileconc", n);
  10290. var r = new X,
  10291. o = new Q({
  10292. concurrentDownloads: n
  10293. }),
  10294. a = new J,
  10295. s = new x,
  10296. l = new w,
  10297. c = new b(t),
  10298. h = new T,
  10299. u = new S(i),
  10300. d = new M,
  10301. p = new K;
  10302. return {
  10303. qualityManager: r,
  10304. panoRenderer: a,
  10305. tileDownloader: o,
  10306. player: c,
  10307. director: l,
  10308. modelManager: s,
  10309. tagManager: p,
  10310. displayController: u,
  10311. labelDisplayController: d,
  10312. controls: h
  10313. }
  10314. }(o, s.mode), l = m.controls, c = m.player, h = m.director, u = m.tagManager, p = m.tileDownloader, f = m.qualityManager, m.panoRenderer,
  10315. function (e, t, i, n) {
  10316. var r = i.controls,
  10317. o = i.qualityManager,
  10318. a = i.panoRenderer,
  10319. s = i.tileDownloader,
  10320. l = i.modelManager;
  10321. r.init(n, l), j.init(i.director, r, i.player, l, t), o.init(l), s.init(o), a.init(t, s, o), l.init(s, a, o), l.addModel(e), t.addComponent(F)
  10322. }(g, d, m, r), c.director = h, g.supportsTiles && p.start(), !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."), o = !1);
  10323. var e = null;
  10324. if (o) {
  10325. ne.warn("Quickstart engaged. Hold on to your knickers.");
  10326. var t = l.controls[R.PANORAMA];
  10327. a = new q(f, d.scene, d.camera, t, r), C(d, r, g), e = a.load(s).then(function () {
  10328. d.addComponent(a), d.once(ee.AfterRender, function () {
  10329. ne.warn("First render after quickstart load finished.")
  10330. })
  10331. })
  10332. }
  10333. return window.flyToFirst = function () {
  10334. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70"),
  10335. t = new _.Quaternion(.7099827027821568, -.07708150183830938, .6958985789714591, .07555241737970636),
  10336. i = new _.Vector3(0, 0, -1).applyQuaternion(t).add(e.position);
  10337. c.flyToPano({
  10338. pano: e,
  10339. lookAtPoint: i
  10340. })
  10341. }, $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  10342. }).then(function () {
  10343. return function (e, t, i, n, r) {
  10344. return r.progressCallback = t, N.sessionStart(), e.load(n).progress(function (e, t) {
  10345. e.modelElementsToLoad = t[1],
  10346. function (e) {
  10347. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  10348. }(e),
  10349. function (e) {
  10350. e.totalElementsLoaded++, e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad, isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0), e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded, console.log("pro:" + e.totalPercentageLoaded), e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  10351. }(e)
  10352. }.bind(this, r))
  10353. }(g, D.onProgress, 0, !o, n)
  10354. }).then(function () {
  10355. s.quickstart = o,
  10356. function (e, t, i, n) {
  10357. var r = i.qualityManager,
  10358. o = i.panoRenderer,
  10359. a = i.tileDownloader,
  10360. s = i.modelManager,
  10361. l = i.player,
  10362. c = i.director,
  10363. h = i.tagManager,
  10364. u = i.displayController,
  10365. d = i.labelDisplayController,
  10366. p = i.controls;
  10367. t.scene.add(e), t.qualityManager = r;
  10368. var f = {
  10369. camera: t.camera,
  10370. director: c,
  10371. modelManager: s,
  10372. tileDownloader: a,
  10373. panoRenderer: o,
  10374. qualityManager: r,
  10375. tagManager: h,
  10376. container: n,
  10377. controls: p
  10378. };
  10379. l.init(f), l.setScene(t.scene), h.init(s, l), c.init(l, s), u.init(c, l, s, h, n), d.init(l, s, n), B.bindEvents(l), t.addComponent(h), t.addComponent(l), t.addComponent(o), l.sceneRenderer = t
  10380. }(g, d, m, r), d.started || C(d, r, g), N.modelLoaded(g, c, l, L.autoplay),
  10381. function (e, t, i, n) {
  10382. return ne.info("Starting player in " + i.mode), N.report(t.sid, "started-playing", n, i.quickstart), e.start(i)
  10383. }(c, g, s, L.autoplay).done(function () {
  10384. h.autoTour()
  10385. }), g.supportsTiles || new H(g, c).start();
  10386. o && (d.removeComponent(a), a.destroy(), s.pano.enter()), D.init(g, h, c, l, d, s, N.getSessionId()), D.endLoading(g, h, u), d.once(ee.AfterRender, function () {
  10387. v.setAppReadyTime();
  10388. var e = v.calcFullLoadingTime();
  10389. ne.warn("Total load time: " + e / 1e3), N.loadComplete(e), ne.warn("First render after model load finished.")
  10390. }), d.on(ee.MemoryUsageUpdated, y)
  10391. }).fail(A.bind(this, e))
  10392. }()
  10393. }()
  10394. })
  10395. }).call(this, "/js/main.js")
  10396. }, {
  10397. "./DisplayController": 1,
  10398. "./TimingData": 2,
  10399. "./ab": 3,
  10400. "./analytics": 4,
  10401. "./cameras/PanoramaCamera": 7,
  10402. "./controls/CameraControls": 9,
  10403. "./director": 15,
  10404. "./effects": 16,
  10405. "./enum/PanoSizeClass": 36,
  10406. "./enum/PanoramaEvents": 37,
  10407. "./enum/RenderLayers": 41,
  10408. "./enum/SceneRendererEvents": 43,
  10409. "./enum/Viewmode": 51,
  10410. "./featureflags": 59,
  10411. "./gui/error": 64,
  10412. "./gui/gui": 65,
  10413. "./gui/memoryUsage": 73,
  10414. "./label/LabelDisplayController": 91,
  10415. "./lib/array-polyfill": 92,
  10416. "./lib/performance-polyfill": 95,
  10417. "./lib/postprocessing/EffectComposer.js": 96,
  10418. "./lib/postprocessing/MaskPass.js": 97,
  10419. "./lib/postprocessing/RenderPass.js": 98,
  10420. "./lib/postprocessing/ShaderPass.js": 99,
  10421. "./lib/shaders/CopyShader.js": 100,
  10422. "./lib/shaders/HorizontalBlurShader.js": 101,
  10423. "./lib/shaders/VerticalBlurShader.js": 102,
  10424. "./lib/three75-shim": 103,
  10425. "./localization/localize": 108,
  10426. "./tag/tagManager": 124,
  10427. "./model/ModelManager": 140,
  10428. "./objects/Panorama": 148,
  10429. "./objects/Skybox": 152,
  10430. "./player": 155,
  10431. "./preloaders": 156,
  10432. "./scene/QuickstartManager": 157,
  10433. "./scene/SceneRenderer": 158,
  10434. "./sdk/automation.js": 164,
  10435. "./settings": 166,
  10436. "./showcase": 168,
  10437. "./tile/PanoRenderer": 169,
  10438. "./tile/QualityManager.js": 170,
  10439. "./tile/TileDownloader": 171,
  10440. "./util/PanoramaCollection": 178,
  10441. "./util/ajax": 181,
  10442. "./util/browser": 182,
  10443. "./util/camera": 183,
  10444. "./util/common": 185,
  10445. "./util/lerp": 188,
  10446. "./util/logger": 189,
  10447. "./util/math": 190,
  10448. "./util/sentry": 192,
  10449. "./util/showcase": 193,
  10450. "./util/transitions": 195,
  10451. events: 202,
  10452. "promise-polyfill": 213,
  10453. three: 217
  10454. }],
  10455. 117: [function (e, t, i) {
  10456. "use strict";
  10457. function n(e) {
  10458. e = e || {}, r.RawShaderMaterial.call(this, a.extendObject({
  10459. fragmentShader: o.cube.fragmentShader,
  10460. vertexShader: o.cube.vertexShader,
  10461. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  10462. name: "CubemapMaterial"
  10463. }, e))
  10464. }
  10465. var r = e("three"),
  10466. o = e("../shaders"),
  10467. a = e("../util/common");
  10468. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n, t.exports = n
  10469. }, {
  10470. "../shaders": 167,
  10471. "../util/common": 185,
  10472. three: 217
  10473. }],
  10474. 118: [function (e, t, i) {
  10475. "use strict";
  10476. function n(e) {
  10477. e = e || {}, r.RawShaderMaterial.call(this, a.extendObject({
  10478. fragmentShader: o.model.fragmentShader,
  10479. vertexShader: o.model.vertexShader,
  10480. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  10481. name: "ModelTextureMaterial"
  10482. }, e))
  10483. }
  10484. var r = e("three"),
  10485. o = e("../shaders"),
  10486. a = e("../util/common");
  10487. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function (e, t, i) {
  10488. i && (this.uniforms.progress.value = 0), e.ensureSkyboxReadyForRender(), this.uniforms.pano0Map.value = e.getSkyboxTexture(), this.uniforms.pano0Position.value.copy(e.position), this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld), t.ensureSkyboxReadyForRender(), this.uniforms.pano1Map.value = t.getSkyboxTexture(), this.uniforms.pano1Position.value.copy(t.position), this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  10489. }, t.exports = n
  10490. }, {
  10491. "../shaders": 167,
  10492. "../util/common": 185,
  10493. three: 217
  10494. }],
  10495. 119: [function (m, v, e) {
  10496. (function (e) {
  10497. "use strict";
  10498. function t(e, t, i, n) {
  10499. this.div = null, this.body = null, this.label = e, this.description = t, this.parsedDescription = [], this.media = i || {
  10500. type: null
  10501. }, this.loadingSpinner = null, this.parser = new r({
  10502. supportLinks: !c.valueFromHash("mls"),
  10503. keepLinkLabels: !0
  10504. }), this.state = g.CLOSED, this.orientation = "", this.initialTransform = "", this.hovering = !1, this.openTransition = null, this.closeTransition = null, this.openPromise = null, this.closePromise = null, this.animationTransition = null, this.animationScale = 0
  10505. }
  10506. var r = m("../Parser/DescriptionParser"),
  10507. i = m("../Media/Link"),
  10508. n = m("../Media/Image"),
  10509. o = m("../Media/EmbedlyPlayer"),
  10510. a = m("../Media/EmbedlyEmbed"),
  10511. s = m("../../util/transitions"),
  10512. l = m("../../util/lerp"),
  10513. c = m("../../util/browser"),
  10514. b = m("./BillboardEvent"),
  10515. w = m("../Media/MediaEvent"),
  10516. h = m("../Parser/DescriptionChunkType"),
  10517. u = m("events").EventEmitter,
  10518. d = m("./billboardSettings"),
  10519. T = m("./overlaySettings"),
  10520. p = new(m("../../util/logger"))(e),
  10521. f = document.getElementById("tag-billboards");
  10522. f.addEventListener("touchend", function (e) {
  10523. f.style.pointerEvents = "none"
  10524. }), f.addEventListener("touchcancel", function (e) {
  10525. f.style.pointerEvents = "none"
  10526. });
  10527. var g = {
  10528. CLOSED: "closed",
  10529. OPENING: "opening",
  10530. OPEN: "open",
  10531. CLOSING: "closing",
  10532. ACTIVE: "active"
  10533. };
  10534. (t.prototype = Object.create(u.prototype)).build = function (e) {
  10535. this.parsedDescription = this.parser.parse(this.description);
  10536. var t = document.createElement("div");
  10537. t.className = "tag-container has-hotzone", this.div = t, this.body = document.createElement("div"), this.body.className = "tag-body";
  10538. var i = document.createElement("div");
  10539. i.classList.add("tag-content");
  10540. var n = document.createElement("div");
  10541. n.classList.add("tag-text-content");
  10542. var r = document.createElement("div");
  10543. r.className = "tag-label", r.textContent = this.label, n.appendChild(r);
  10544. var o = document.createElement("div");
  10545. o.className = "tag-desc", n.appendChild(o), i.appendChild(n), this.body.appendChild(i), this.appendDescriptionElements(this.parsedDescription, o), this.appendMedia(), t.appendChild(this.body), f.appendChild(t), this.bindEvents(t, this.body)
  10546. }, t.prototype.bindEvents = function (i, e) {
  10547. function t(n) {
  10548. return function (e) {
  10549. if (!this.div.classList.contains("overlay")) {
  10550. var t, i = document.getElementById("player");
  10551. try {
  10552. t = new MouseEvent(n, e)
  10553. } catch (i) {
  10554. (t = document.createEvent("MouseEvents")).initMouseEvent(n, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  10555. }
  10556. i.dispatchEvent(t)
  10557. }
  10558. }
  10559. }
  10560. e.addEventListener("mousedown", function (e) {
  10561. e.stopPropagation()
  10562. }), e.addEventListener("mouseup", function (e) {
  10563. e.stopPropagation()
  10564. }), i.addEventListener("touchstart", function (e) {
  10565. f.style.pointerEvents = "auto"
  10566. }), i.addEventListener("mousedown", t("mousedown").bind(this)), i.addEventListener("mouseup", t("mouseup").bind(this)), e.addEventListener("mouseover", function (e) {
  10567. this.state === g.OPEN && i.classList.remove("has-hotzone")
  10568. }.bind(this)), i.addEventListener("mouseenter", function (e) {
  10569. this.state !== g.CLOSING && (this.hovering = !0, this.emit(b.ENTER))
  10570. }.bind(this)), i.addEventListener("mouseleave", function (e) {
  10571. this.hovering = !1, this.emit(b.LEAVE)
  10572. }.bind(this)), i.addEventListener("gesturestart", function (e) {
  10573. e.preventDefault()
  10574. });
  10575. var n = i.querySelector(".tag-text-content"),
  10576. r = 0;
  10577. n.addEventListener("touchstart", function (e) {
  10578. r = e.changedTouches[0].clientY
  10579. }), n.addEventListener("touchmove", function (t) {
  10580. function e(e) {
  10581. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  10582. }
  10583. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  10584. }), i.addEventListener("touchmove", function (e) {
  10585. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  10586. })
  10587. }, t.prototype.appendDescriptionElements = function (e, i) {
  10588. 0 < e.length && this.div.classList.add("has-text"), e.forEach(function (e, t) {
  10589. switch (e.type) {
  10590. case h.TEXT:
  10591. i.appendChild(this.createTextElement(e.text));
  10592. break;
  10593. case h.LINK:
  10594. i.appendChild(this.createLinkElement(e.link))
  10595. }
  10596. }.bind(this))
  10597. }, t.prototype.appendLoadingSpinner = function () {
  10598. this.loadingSpinner = document.createElement("div"), this.loadingSpinner.classList.add("loading-spinner");
  10599. var e = document.createElement("div");
  10600. e.classList.add("gui-spinner-icon"), this.loadingSpinner.appendChild(e), this.body.appendChild(this.loadingSpinner)
  10601. }, t.prototype.onMediaLoadFinished = function () {
  10602. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner), this.applyOrientation(this.orientation), this.loadingSpinner = null)
  10603. }, t.prototype.appendMedia = function () {
  10604. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  10605. this.appendLoadingSpinner();
  10606. var e = document.createElement("div");
  10607. e.classList.add("tag-media-content");
  10608. var t = document.createElement("i");
  10609. switch (["icon", "icon-close-thin", "close"].forEach(function (e) {
  10610. t.classList.add(e)
  10611. }), this.body.appendChild(t), this.body.appendChild(e), this.media.type) {
  10612. case h.IMAGE:
  10613. e.appendChild(this.createImageElement(this.media, this.body));
  10614. break;
  10615. case h.VIDEO:
  10616. e.appendChild(this.createVideoElement(this.media, this.body));
  10617. break;
  10618. case h.RICH:
  10619. e.appendChild(this.createEmbedElement(this.media, this.body))
  10620. }
  10621. }
  10622. }, t.prototype.createTextElement = function (e) {
  10623. var t = document.createElement("span");
  10624. return t.textContent = e, t
  10625. }, t.prototype.createLinkElement = function (e) {
  10626. var t = new i(e);
  10627. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)), t.createDomElement()
  10628. }, t.prototype.createImageElement = function (t, C) {
  10629. function e() {
  10630. function e() {
  10631. p || (E.classList.remove("view-image"), a.classList.add("overlay"), t(), window.addEventListener("resize", A), a.addEventListener("click", i), c.addEventListener("click", r), o.addEventListener("click", n), p = !0, _.emit(w.IMAGE_OPENED))
  10632. }
  10633. function t() {
  10634. C.classList.add("show-info"), s.classList.remove("collapsible"), s.style.height = "";
  10635. var e = parseFloat(getComputedStyle(v).lineHeight),
  10636. t = g + e,
  10637. i = a.clientWidth - 2 * T.boundaryWidth - m,
  10638. n = a.clientHeight - 2 * T.boundaryHeight - m - t,
  10639. r = n,
  10640. o = r * I.aspect;
  10641. i < o && (r = (o = i) / I.aspect), n < r && (o = (r = n) * I.aspect), o += m, r += m + t, C.style.width = o + "px", C.style.height = r + "px", l.style.paddingTop = e + m + "px", 0 < _.description.length && (s.classList.add("collapsible"), s.style.height = s.clientHeight + 12 + "px", y.style.height = "calc(100% - " + v.clientHeight + "px)")
  10642. }
  10643. function i(e) {
  10644. e.target === a && n()
  10645. }
  10646. function n() {
  10647. p && (p = !1, E.classList.add("view-image"), a.classList.remove("overlay"), s.style.height = "", l.style.paddingTop = "", C.style.width = "", C.style.height = "", window.removeEventListener("resize", A), a.removeEventListener("click", i), c.removeEventListener("click", r), o.removeEventListener("click", n), _.emit(w.IMAGE_CLOSED), _.close(!0))
  10648. }
  10649. function r(e) {
  10650. C.classList.toggle("show-info")
  10651. }
  10652. var a = _.div,
  10653. s = a.getElementsByClassName("tag-content")[0],
  10654. l = a.getElementsByClassName("tag-media-content")[0],
  10655. o = C.getElementsByClassName("close")[0],
  10656. c = s.getElementsByClassName("tag-label")[0];
  10657. a.classList.add("has-image"), E.classList.add("view-image"), a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"), _.applyOrientation(_.orientation);
  10658. var h, u, d, p = !1,
  10659. f = getComputedStyle(s),
  10660. g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom),
  10661. m = 2 * parseFloat(getComputedStyle(l).paddingLeft),
  10662. v = s.querySelector(".tag-label"),
  10663. y = s.querySelector(".tag-desc"),
  10664. A = (d = 0, function () {
  10665. clearInterval(h), clearTimeout(u), h = setInterval(function () {
  10666. var e = a.clientHeight;
  10667. d !== e && (t(), d = e)
  10668. }, 100), u = setTimeout(clearInterval.bind(this, h), 1e3)
  10669. });
  10670. I.on(w.IMAGE_OPENING, e), _.on(b.ACTIVATE, e), _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)), _.on(b.CLOSING, n)
  10671. }
  10672. var I = new n,
  10673. E = I.createDomElement();
  10674. this.once(b.OPENED, function () {
  10675. I.load(t.src).then(e).catch(function (e) {
  10676. p.warn("Failed to load image:", t.src), p.warn("with error:", e)
  10677. }).then(this.onMediaLoadFinished.bind(this))
  10678. });
  10679. var _ = this;
  10680. return E
  10681. }, t.prototype.createVideoElement = function (t, e) {
  10682. var i = new o({
  10683. autoPlay: !0,
  10684. autoResume: !0,
  10685. startMuted: !1,
  10686. loop: !1
  10687. }),
  10688. n = i.createDomElement();
  10689. return this.once(b.OPENED, function () {
  10690. i.load(t.src).then(function () {
  10691. this.div.classList.add("has-video"), this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(), i.play()), this.on(b.OPENING, i.show.bind(i)), this.on(b.OPENED, i.play.bind(i)), this.on(b.CLOSING, i.pause.bind(i)), this.on(b.CLOSED, i.hide.bind(i))
  10692. }.bind(this)).catch(function (e) {
  10693. p.warn("Failed to embed video:", t.src), p.warn("with error:", e)
  10694. }).then(this.onMediaLoadFinished.bind(this))
  10695. }.bind(this)), n
  10696. }, t.prototype.createEmbedElement = function (t, e) {
  10697. var i = new a,
  10698. n = i.createDomElement();
  10699. return this.once(b.OPENED, function () {
  10700. i.load(t.src).then(function () {
  10701. this.div.classList.add("has-embed"), this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(), this.applyOrientation(this.orientation), this.on(b.OPENING, i.show.bind(i)), this.on(b.CLOSED, i.hide.bind(i))
  10702. }.bind(this)).catch(function (e) {
  10703. p.warn("Failed to embed:", t.src), p.warn("with error:", e)
  10704. }).then(this.onMediaLoadFinished.bind(this))
  10705. }.bind(this)), n
  10706. }, t.prototype.open = function (e) {
  10707. return this.openPromise = $.Deferred(), this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"), this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function () {
  10708. this.state !== g.OPEN && (this.emit(b.OPENING), e && this.emit(b.ACTIVATING), this.state = g.OPENING, this.animateOpen(function () {
  10709. e && this.setActiveState(), this.openPromise.resolve()
  10710. }.bind(this)))
  10711. }.bind(this), d.animation.openDelay), s.cancel(this.closeTransition), this.closePromise && this.closePromise.reject(), this.closeTransition = void 0, this.openPromise.promise())
  10712. }, t.prototype.close = function (e) {
  10713. return this.closePromise = $.Deferred(), !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function () {
  10714. this.state !== g.CLOSED && (this.emit(b.CLOSING), this.state = g.CLOSING, this.animateClose())
  10715. }.bind(this), d.animation.closeDelay)), s.cancel(this.openTransition), this.openPromise && this.openPromise.reject(), this.openTransition = void 0, this.closePromise.resolve(), this.closePromise.promise())
  10716. }, t.prototype.setActiveState = function () {
  10717. this.state !== g.CLOSED && (this.state = g.ACTIVE, this.emit(b.ACTIVATE), this.div.classList.remove("has-hotzone"))
  10718. }, t.prototype.animateOpen = function (e) {
  10719. if (this.state === g.OPENING) {
  10720. if (s.cancel(this.animationTransition), c.detectSamsungNative()) return this.boardOrientation = null, this.div.style.visibility = "visible", this.emit(b.OPENED), this.state = g.OPEN, void(e && e());
  10721. this.div.style.webkitTransform = "scale(0)", this.div.style.transform = "scale(0)", this.div.style.visibility = "visible", this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function () {
  10722. this.emit(b.OPENED), this.state = g.OPEN, e && e()
  10723. }.bind(this))
  10724. }
  10725. }, t.prototype.animateClose = function (e) {
  10726. this.state === g.CLOSING && (s.cancel(this.animationTransition), this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function () {
  10727. this.emit(b.CLOSED), this.state = g.CLOSED, this.div.style.visibility = "hidden", this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"), e && e()
  10728. }.bind(this)))
  10729. }, t.prototype.needsUpdate = function () {
  10730. return this.state !== g.CLOSED
  10731. }, t.prototype.update = function (e, t) {
  10732. if (this.needsUpdate()) {
  10733. var i = (this.updateOrientation(e), this.calcScale(t)),
  10734. n = {
  10735. x: (e.x + 1) * $("#player").width() / 2,
  10736. y: (e.y + 1) * $("#player").height() / 2
  10737. };
  10738. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")", this.div.style.webkitTransform = this.div.screenTransform, this.div.style.transform = this.div.screenTransform
  10739. }
  10740. }, t.prototype.getDimensions = function () {
  10741. return this.div.getBoundingClientRect()
  10742. }, t.prototype.calcScale = function (e) {
  10743. return Math.sqrt(e / 40) * d.boardToDiscRatio
  10744. }, t.prototype.updateOrientation = function (e) {
  10745. if (this.state !== g.ACTIVE) {
  10746. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2,
  10747. i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2,
  10748. n = "";
  10749. n += 0 == i ? "right" : 2 == i ? "left" : "", n += 0 == t ? "-down" : 2 == t ? "-up" : "", 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "", 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")), 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  10750. }
  10751. }, t.prototype.applyOrientation = function (e) {
  10752. this.div.style.transform = this.div.style.webkitTransform = "", this.div.classList.remove("tag-container-" + this.orientation), this.div.classList.add("tag-container-" + e);
  10753. var t = window.getComputedStyle(this.div);
  10754. this.initialTransform = t.transform || t.webkitTransform, "none" === this.initialTransform && (this.initialTransform = "");
  10755. var i = t.transform.slice(7, -1).split(","),
  10756. n = -i[4],
  10757. r = -i[5];
  10758. this.div.style.webkitTransformOrigin = n + "px " + r + "px", this.div.style.transformOrigin = n + "px " + r + "px", this.orientation = e
  10759. }, v.exports = t
  10760. }).call(this, "/js/tag/Billboard/Billboard.js")
  10761. }, {
  10762. "../../util/browser": 182,
  10763. "../../util/lerp": 188,
  10764. "../../util/logger": 189,
  10765. "../../util/transitions": 195,
  10766. "../Media/EmbedlyEmbed": 125,
  10767. "../Media/EmbedlyPlayer": 126,
  10768. "../Media/Image": 128,
  10769. "../Media/Link": 129,
  10770. "../Media/MediaEvent": 131,
  10771. "../Parser/DescriptionChunkType": 133,
  10772. "../Parser/DescriptionParser": 134,
  10773. "./BillboardEvent": 120,
  10774. "./billboardSettings": 121,
  10775. "./overlaySettings": 122,
  10776. events: 202
  10777. }],
  10778. 120: [function (e, t, i) {
  10779. "use strict";
  10780. t.exports = Object.freeze({
  10781. ENTER: "billboard.enter",
  10782. LEAVE: "billboard.leave",
  10783. OPENING: "billboard.opening",
  10784. OPENED: "billboard.open",
  10785. CLOSING: "billboard.closing",
  10786. CLOSED: "billboard.closed",
  10787. ACTIVATING: "billboard.activating",
  10788. ACTIVATE: "billboard.activate"
  10789. })
  10790. }, {}],
  10791. 121: [function (e, t, i) {
  10792. "use strict";
  10793. t.exports = Object.freeze({
  10794. animation: Object.freeze({
  10795. hoverOnClosing: !1,
  10796. openDelay: 100,
  10797. closeDelay: 50,
  10798. openDuration: 200,
  10799. closeDuration: 100
  10800. }),
  10801. boardToDiscRatio: 1.2
  10802. })
  10803. }, {}],
  10804. 122: [function (e, t, i) {
  10805. "use strict";
  10806. t.exports = Object.freeze({
  10807. boundaryWidth: 30,
  10808. boundaryHeight: 0
  10809. })
  10810. }, {}],
  10811. hot: [function (e, t, i) {
  10812. "use strict";
  10813. function n(e, t, i) {
  10814. this.sid = e, this.position = this.conversionArray(t.position), this.rotation = this.conversionArray(t.rotation), this.link = t.link, this.model = i, this.size = t.size, this.build()
  10815. }
  10816. var g = e("three"),
  10817. r = e("../shaders"),
  10818. m = e("../settings"),
  10819. v = e("../enum/Viewmode"),
  10820. d = e("../objects/Panorama"),
  10821. o = e("../util/texture"),
  10822. p = new g.Raycaster,
  10823. a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight, 1, 1),
  10824. s = new g.ShaderMaterial({
  10825. uniforms: r.hot.uniforms,
  10826. vertexShader: r.hot.vertexShader,
  10827. fragmentShader: r.hot.fragmentShader
  10828. });
  10829. s.transparent = !0, r.hot.uniforms.texture1.value = o.load(g_HotImage.point), r.hot.uniforms.texture2.value = o.load(g_HotImage.point2), n.prototype.conversionArray = function (e) {
  10830. if ("[object Array]" == Object.prototype.toString.call(e)) return e;
  10831. var t = [];
  10832. for (var i in e) t.push(e[i]);
  10833. return t
  10834. }, n.prototype.build = function () {
  10835. var e = new g.Mesh(a, s),
  10836. t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  10837. e.dynamic = !0, e.position.copy((new g.Vector3).fromArray(this.position)), e.rotation.copy((new g.Euler).fromArray(this.rotation)), t && e.scale.set(t, t, t), e.name = this.sid, e.type = "hotSprite", (e.belongHot = this).link && (e.hotLink = this.link), this.mesh = e, this.model.add(e), g_HotMeshes.push(e)
  10838. }, n.prototype.closestPanoTowardTag = function (e, t) {
  10839. var i = [],
  10840. n = [],
  10841. r = this.mesh.position;
  10842. if (e === v.PANORAMA) {
  10843. var o = t.position.clone().sub(r).normalize();
  10844. n.push(d.scoreFunctions.direction(r, o))
  10845. }
  10846. var a = new g.Vector3;
  10847. i.push(function (e) {
  10848. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  10849. }, function (e) {
  10850. a.copy(r).sub(e.position);
  10851. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z))),
  10852. i = m.tags.navigate.tiltTolerance;
  10853. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  10854. }), n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  10855. var s = t.model.panos.sortByScore(i, n);
  10856. if (s && m.tags.navigate.lineOfSight) {
  10857. for (var l = 0; l < s.length; l++) {
  10858. var c = s[l].pano,
  10859. h = c.position.distanceTo(r);
  10860. p.set(c.position, r.clone().sub(c.position).normalize());
  10861. var u = p.intersectObjects(t.model.colliders);
  10862. if (0 === u.length || u[0].distance > h) return console.log(l), c
  10863. }
  10864. return null
  10865. }
  10866. return s && 0 < s.length && s[0].pano
  10867. }, n.prototype.examine = function (e, t) {
  10868. var i = document.getElementById("popup");
  10869. if (this.link) {
  10870. g_currentHot = this, i.style.display = "block", i.classList.add("wait");
  10871. var n = document.createElement("iframe");
  10872. g_bgAudio && g_bgAudio.pause();
  10873. var r = this.link.substring(this.link.indexOf("html") + 4),
  10874. o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : ""; - 1 == r.indexOf("?") ? n.src = this.link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : n.src = this.link + "&time=" + randomTime().getTime() + "&id=" + window.number + o, n.id = "id1", n.allowTransparency = "true";
  10875. var a = document.getElementById("id1");
  10876. if (void 0 === a || null == a) {
  10877. document.querySelector(".popup-content").appendChild(n);
  10878. var s = !1;
  10879. window.loaddingSuccess = function () {
  10880. s = !0
  10881. }, setTimeout(function e() {
  10882. if (s) {
  10883. var t = document.querySelector("#id1").contentWindow.document;
  10884. t.querySelector("video") && (t.querySelector("video").play(), !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")), t.querySelector("audio") && t.querySelector("audio").play()
  10885. } else setTimeout(e, 300)
  10886. }, 800)
  10887. }
  10888. }
  10889. var l = e.mode,
  10890. c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano,
  10891. h = this.mesh.position;
  10892. e.flyingToTag = !0;
  10893. var u = function () {
  10894. e.flyingToTag = !1, this.link && i.classList.remove("wait")
  10895. }.bind(this);
  10896. if (l === v.PANORAMA) {
  10897. var d = {
  10898. pano: c,
  10899. lookAtPoint: h,
  10900. duration: null,
  10901. maxDistanceOverride: null,
  10902. skipWarpingCheck: !1
  10903. };
  10904. e.flyToPano(d, u)
  10905. } else {
  10906. var p = {
  10907. pano: c
  10908. };
  10909. if (h) {
  10910. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0, 1, 0));
  10911. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  10912. }
  10913. p.callback = u, p.duration = 1500, p.mode = v.PANORAMA, e.flyToNewMode(p)
  10914. }
  10915. }, t.exports = n
  10916. }, {
  10917. three: 217,
  10918. "../shaders": 167,
  10919. "../enum/Viewmode": 51,
  10920. "../objects/Panorama": 148,
  10921. "../util/texture": 194,
  10922. "../settings": 166
  10923. }],
  10924. 123: [function (M, R, e) {
  10925. (function (e) {
  10926. "use strict";
  10927. function d(e, t, i) {
  10928. var n = i.version || "0";
  10929. "0" !== n && w.info("tag defined using version " + n), this.model = e, this.sid = t, this.color = (new f.Color).set(i.color || o.tagDefault), this.hoverColor = o._darken(this.color, .2), this.floor = null, this.floorIndex = i.floor, this.mode = m.PANORAMA, i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode), this.obj3d = null, this.disc = null, this.materials = {
  10930. disc: null,
  10931. pole: null
  10932. }, this.position = (new f.Vector3).copy(i.position), this.discPosition = (new f.Vector3).copy(i.stem.direction), this.discWorldPosition = null, this.discScale = .05, this.poleEnabled = i.stem.enabled, this.billboard = new r(i.label, i.description, i.media, this), this.visibleTransition = null, this.hoveringDisc = !1
  10933. }
  10934. var i, l, c, h, u, p, n, f = M("three"),
  10935. r = M("./Billboard/Billboard"),
  10936. g = M("../settings"),
  10937. m = M("../enum/Viewmode"),
  10938. o = M("../enum/Colors"),
  10939. a = M("../enum/RenderLayers"),
  10940. s = M("../enum/RenderOrder"),
  10941. v = (M("../util/common"), M("../util/math")),
  10942. t = M("../util/texture"),
  10943. y = M("../objects/Panorama"),
  10944. A = M("../shaders"),
  10945. C = M("../util/transitions"),
  10946. I = M("../util/lerp"),
  10947. E = M("../util/easing"),
  10948. _ = M("./Billboard/BillboardEvent"),
  10949. b = M("events").EventEmitter,
  10950. w = new(M("../util/logger"))(e),
  10951. T = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=="),
  10952. x = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC"),
  10953. S = new f.PlaneBufferGeometry(1, 1);
  10954. d.prototype = Object.create(b.prototype), d.raycaster = new f.Raycaster, d.prototype.bindEvents = function () {
  10955. this.billboard.on(_.ENTER, this.setHoverState.bind(this)), this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  10956. }, d.prototype.build = function () {
  10957. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(), this.floor && (this.billboard.build(this.model.sid), this.obj3d = this.buildObject3D(), this.floor.add(this.obj3d)), this
  10958. }, d.prototype.buildObject3D = function () {
  10959. var e = new f.Object3D;
  10960. e.position.copy(this.position);
  10961. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  10962. t.bg.value = x, t.mask.value = T, t.color.value.copy(this.color), this.materials.disc = new f.RawShaderMaterial({
  10963. transparent: !0,
  10964. vertexShader: A.tagDisc.vertexShader,
  10965. fragmentShader: A.tagDisc.fragmentShader,
  10966. uniforms: t
  10967. }), this.disc = new f.Mesh(S, this.materials.disc), this.disc.layers.set(a.TAG), this.disc.position.copy(this.discPosition), this.disc.renderOrder = s.tagDisc;
  10968. var i = (this.disc.tag = this).buildPole();
  10969. return i.layers.set(a.TAG), i.renderOrder = s.tagStem, e.add(i), e.layers.set(a.TAG), e.add(this.disc)
  10970. }, d.prototype.buildPole = function () {
  10971. var e = new f.BufferGeometry,
  10972. t = new Float32Array(6);
  10973. return t[0] = t[1] = t[2] = 0, t[3] = this.discPosition.x, t[4] = this.discPosition.y, t[5] = this.discPosition.z, e.addAttribute("position", new f.BufferAttribute(t, 3)), this.materials.pole = new f.LineBasicMaterial({
  10974. linewidth: g.tags.pole.width,
  10975. color: g.tags.pole.color,
  10976. opacity: 0,
  10977. visible: this.poleEnabled,
  10978. transparent: !0,
  10979. depthWrite: !1
  10980. }), new f.Line(e, this.materials.pole)
  10981. }, d.prototype.setFreeState = function (e) {
  10982. !e && this.hoveringDisc || this.billboard.close(e).then(function () {
  10983. this.materials.disc.uniforms.color.value = this.color
  10984. }.bind(this))
  10985. }, d.prototype.setHoverState = function (e) {
  10986. this.billboard.open(e), this.materials.disc.uniforms.color.value = this.hoverColor
  10987. }, d.prototype.hide = function (e, t) {
  10988. var i = $.Deferred();
  10989. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition)) return i.resolve().promise();
  10990. e = e || 0, t = t || 0, C.cancel(this.visibleTransition);
  10991. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity,
  10992. s = t + e,
  10993. l = t / s;
  10994. return this.visibleTransition = C.start((n = this, r = I.property(n.materials.disc.uniforms.opacity, "value", 0), o = I.property(n.materials.pole, "opacity", 0), function (e) {
  10995. r(e), n.materials.pole && o(e)
  10996. }), s * a, function () {
  10997. i.resolve()
  10998. }, l, E[g.warp.blendEasing]), i.promise()
  10999. }, d.prototype.show = function (e, t) {
  11000. var i = $.Deferred();
  11001. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition)) return i.resolve().promise();
  11002. e = e || 0, t = t || 0, C.cancel(this.visibleTransition);
  11003. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity,
  11004. s = t + e,
  11005. l = t / s;
  11006. return this.visibleTransition = C.start((n = this, r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity), o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity), function (e) {
  11007. r(e), n.materials.pole && o(e)
  11008. }), s * a, function () {
  11009. i.resolve()
  11010. }, l, E[g.warp.blendEasing]), i.promise()
  11011. }, d.prototype.closestPanoTowardTag = function (e, t) {
  11012. var i = [],
  11013. n = [],
  11014. r = this.disc.getWorldPosition();
  11015. if (e === m.PANORAMA) {
  11016. var o = t.position.clone().sub(r).normalize();
  11017. i.push(y.filters.isPanoAligned()), i.push(y.filters.inPanoDirection(r, o, .5)), i.push(y.filters.isNeighbourPanoTo(t)), n.push(y.scoreFunctions.direction(r, o))
  11018. }
  11019. var a = new f.Vector3;
  11020. i.push(function (e) {
  11021. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  11022. }, function (e) {
  11023. a.copy(r).sub(e.position);
  11024. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z))),
  11025. i = g.tags.navigate.tiltTolerance;
  11026. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  11027. }), n.push(y.scoreFunctions.distanceSquared(this, -2));
  11028. var s = this.model.panos.sortByScore(i, n);
  11029. if (g.tags.navigate.lineOfSight) {
  11030. for (var l = 0; l < s.length; l++) {
  11031. var c = s[l].pano,
  11032. h = c.position.distanceTo(r);
  11033. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance) return null;
  11034. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  11035. var u = d.raycaster.intersectObjects(this.model.colliders);
  11036. if (0 === u.length || u[0].distance > h) return c
  11037. }
  11038. return null
  11039. }
  11040. return 0 < s.length && s[0].pano
  11041. }, d.prototype.examine = function (i) {
  11042. var e = i.mode,
  11043. n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano,
  11044. t = this.disc.getWorldPosition();
  11045. this.billboard.setActiveState();
  11046. var r = function () {
  11047. var e = this.billboard.getDimensions(),
  11048. t = new f.Vector3;
  11049. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t), t.unproject(i.camera), i.flyToPano({
  11050. pano: n,
  11051. lookAtPoint: t
  11052. })
  11053. }.bind(this);
  11054. if (e === m.PANORAMA)
  11055. if (n !== i.currentPano) {
  11056. var o = {
  11057. pano: n,
  11058. lookAtPoint: t,
  11059. duration: null,
  11060. maxDistanceOverride: null,
  11061. skipWarpingCheck: !1
  11062. };
  11063. i.flyToPano(o, r)
  11064. } else setTimeout(function () {
  11065. this.billboard.open().then(function () {
  11066. r()
  11067. })
  11068. }.bind(this), 0);
  11069. else {
  11070. var a = {
  11071. pano: n
  11072. };
  11073. if (t) {
  11074. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0, 1, 0));
  11075. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  11076. }
  11077. a.callback = r, a.duration = 1500, a.mode = m.PANORAMA, i.flyToNewMode(a)
  11078. }
  11079. }, d.prototype.update = (n = new f.Vector3, function (e, t) {
  11080. this.discWorldPosition = this.disc.getWorldPosition(), this.updateDisc(e, t), this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t), n.z < 1 && (n.y *= -1, this.billboard.update(n, this.getDiscRadius(n, t))))
  11081. }), d.prototype.updateDisc = (l = new f.Vector3, c = new f.Vector3, h = new f.Vector3, u = new f.Vector3, p = new f.Vector3, function (e, t) {
  11082. var i = g.tags.visibility,
  11083. n = g.tags.disc.scale,
  11084. r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  11085. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)), this.obj3d.visible) {
  11086. this.disc.quaternion.copy(t.quaternion);
  11087. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  11088. l.copy(this.discWorldPosition).project(t), c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l), h.set(o / 2, 0, 0).add(c), u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h), p.copy(u).unproject(t);
  11089. var a = p.distanceTo(this.discWorldPosition),
  11090. s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  11091. this.discScale = a * s, this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  11092. }
  11093. }), d.prototype.getDiscRadius = (i = new f.Vector3, function (e, t) {
  11094. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t), Math.abs(e.x - i.x) * $("#player").width()
  11095. }), d.prototype.tagVisibleOnCurrentFloor = function (e) {
  11096. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  11097. }, d.prototype.offScreen = function (e, t) {
  11098. var i = e.getWorldPosition().project(t);
  11099. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  11100. }, d.viewportScale = function () {
  11101. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(), d.viewportHeight = $("#player").height(), d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)), d.currentViewportScale
  11102. }, R.exports = d
  11103. }).call(this, "/js/tag/tag.js")
  11104. }, {
  11105. "../enum/Colors": 19,
  11106. "../enum/RenderLayers": 41,
  11107. "../enum/RenderOrder": 42,
  11108. "../enum/Viewmode": 51,
  11109. "../objects/Panorama": 148,
  11110. "../settings": 166,
  11111. "../shaders": 167,
  11112. "../util/common": 185,
  11113. "../util/easing": 186,
  11114. "../util/lerp": 188,
  11115. "../util/logger": 189,
  11116. "../util/math": 190,
  11117. "../util/texture": 194,
  11118. "../util/transitions": 195,
  11119. "./Billboard/Billboard": 119,
  11120. "./Billboard/BillboardEvent": 120,
  11121. events: 202,
  11122. three: 217
  11123. }],
  11124. 124: [function (M, R, e) {
  11125. (function (e) {
  11126. "use strict";
  11127. function t() {
  11128. this.tagState = T.IDLE, this.intersectTag = null, this.hoveredTag = null, this.activeTag = null, this.tagDiscs = [], this.raycaster = new i.Raycaster, this.modelManager = null, this.player = null, this.totaltags = 0, this.navigatingViaTag = !1, this.enabled = !1
  11129. }
  11130. var o, h, u, d, p, f, s, l, c, i = M("three"),
  11131. n = M("../util/logger"),
  11132. r = M("../util/common"),
  11133. a = M("../controls/serializer"),
  11134. g = M("../objects/Snapshot"),
  11135. m = M("../settings"),
  11136. v = M("./Billboard/BillboardEvent"),
  11137. y = M("./Media/MediaEvent"),
  11138. A = M("./Media/LinkType"),
  11139. C = M("../enum/Viewmode"),
  11140. I = M("../enum/WarpStyle"),
  11141. E = M("../enum/BlackoutStyle"),
  11142. _ = M("../enum/ModelManagerEvents"),
  11143. b = M("../enum/tagEvents"),
  11144. w = M("../enum/PlayerEvents"),
  11145. T = (M("../util/lerp"), M("../enum/TagStates")),
  11146. x = M("events").EventEmitter,
  11147. S = new n(e);
  11148. r.extend(t, x), t.prototype.init = function (e, t) {
  11149. this.modelManager = e, this.player = t, this.updateModel(), this.bindEvents()
  11150. }, t.prototype.update = function (e) {
  11151. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  11152. }, t.prototype.updateTags = function (e, t, i, n) {
  11153. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n)
  11154. }, t.prototype.updateModel = function () {
  11155. this.model = this.modelManager.getActiveModel(), this.gettagsFromModel(), this.totaltags = Object.keys(this.model.tags).length
  11156. }, t.prototype.gettagsFromModel = function () {
  11157. for (var e in this.tagDiscs = [], this.model.tags) {
  11158. var t = this.model.tags[e].disc;
  11159. t && this.tagDiscs.push(t)
  11160. }
  11161. }, t.prototype.bindEvents = function () {
  11162. function e() {
  11163. Object.keys(this.model.tags).forEach(function (e) {
  11164. var t = this.model.tags[e];
  11165. t.bindEvents(), t.billboard.on(y.LINK_CLICK, function (e) {
  11166. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  11167. }.bind(this)), t.billboard.on(y.IMAGE_OPENED, function () {
  11168. this.tagState = T.EXAMINE, this.emit(y.IMAGE_OPENED)
  11169. }.bind(this)), t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  11170. }.bind(this))
  11171. }
  11172. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)), this.modelManager.on(_.ActiveModelChanged, e.bind(this)), this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)), this.player.on(w.PanoChosen, this.onPanoChange.bind(this)), this.player.on(w.Ready, this.onPlayerReady.bind(this)), this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)), this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)), this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)), e.call(this)
  11173. }, t.prototype.navigateViaLink = function (e) {
  11174. var t = a.deserialize(e);
  11175. if (t)
  11176. if (t.mode === C.PANORAMA) {
  11177. try {
  11178. this.player.model.panos.get(t.panoId)
  11179. } catch (e) {
  11180. return void S.warn("Unable to find panorama location", t.panoId)
  11181. }
  11182. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  11183. } else {
  11184. var i = {
  11185. cameraMode: t.mode,
  11186. position: t.position,
  11187. quaternion: t.quaternion,
  11188. scanId: t.panoId,
  11189. orthoZoom: t.zoom,
  11190. floorVisibility: t.floorVisibility,
  11191. thumbUrl: null,
  11192. name: null
  11193. };
  11194. this.player.flyToNewMode({
  11195. mode: t.mode,
  11196. duration: m.warp.outsideTime,
  11197. warpDest: new g(i),
  11198. force: !0
  11199. })
  11200. }
  11201. }, t.prototype.handleWarpStart = function (e, t, i, n) {
  11202. this.dismissExaminedTag(), t === I.BLACK && (null != n || (n = m.warp.teleportTime), e && (i = E.END), this.hideShowTagsForBlackoutStyle(i, n))
  11203. }, t.prototype.handleWarpInterruption = function (e, t, i) {
  11204. null != i || (i = m.warp.teleportTime), this.hideShowTagsForBlackoutStyle(t, i)
  11205. }, t.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  11206. var i = 0,
  11207. n = 0,
  11208. r = t / 2;
  11209. switch (null != e || (e = E.MIDDLE), e) {
  11210. case E.END:
  11211. this.hideAlltags(r);
  11212. break;
  11213. case E.BEGINNING:
  11214. this.hideAlltags().done(this.showAlltags.bind(this, r));
  11215. break;
  11216. case E.NONE:
  11217. break;
  11218. case E.MIDDLE:
  11219. n = i = r, this.hideAlltags(n), setTimeout(function () {
  11220. this.showAlltags(i)
  11221. }.bind(this), n);
  11222. break;
  11223. case E.FADEIN:
  11224. setTimeout(function () {
  11225. this.showAlltags(r)
  11226. }.bind(this), r)
  11227. }
  11228. }, t.prototype.onPlayerModeChanging = function (e, t) {
  11229. t !== C.PANORAMA && this.dismissExaminedTag(), t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  11230. var i = t !== C.OUTDOOR;
  11231. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  11232. }, t.prototype.onPanoChange = function (e, t) {
  11233. var i = this.navigatingViaTag;
  11234. if (this.navigatingViaTag = !1, !i) {
  11235. this.dismissExaminedTag();
  11236. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA,
  11237. r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  11238. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  11239. }
  11240. }, t.prototype.onPlayerReady = function (e, t, i) {
  11241. this.startAlltags(e, t ? i : null)
  11242. }, t.prototype.onPlayerFlyingEnded = function (e, t) {
  11243. this.updateClosestTags(e)
  11244. }, t.prototype.dismissExaminedTag = function () {
  11245. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(), this.hoveredTag && (this.hoveredTag.setFreeState(!0), this.hoveredTag = null)
  11246. }, t.prototype.startAlltags = function (e, t) {
  11247. this.model.shouldShowtags = m.tags.enabled, this.enabled = !0, e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay), t && setTimeout(function () {
  11248. this.activateTag(this.model.getTagBySid(t))
  11249. }.bind(this), m.tags.startup.fadeInDuration / 2))
  11250. }, t.prototype.showAlltags = function (e, t, i) {
  11251. function n() {
  11252. ++o === this.totaltags && (this.model.tagsShown = !0, r.resolve())
  11253. }
  11254. var r = $.Deferred();
  11255. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags) return r.resolve().promise();
  11256. var o = 0;
  11257. for (var a in this.model.tags) {
  11258. this.model.tags[a].show(e, t).done(n.bind(this))
  11259. }
  11260. return r.promise()
  11261. }, t.prototype.hideAlltags = function (e, t) {
  11262. function i() {
  11263. ++r === this.totaltags && (this.model.tagsShown = !1, n.resolve())
  11264. }
  11265. var n = $.Deferred(),
  11266. r = 0;
  11267. for (var o in this.model.tags) {
  11268. var a = this.model.tags[o];
  11269. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag()
  11270. }
  11271. return n.promise()
  11272. }, t.prototype.enableHovering = function () {
  11273. this.enabled = !0
  11274. }, t.prototype.disableHovering = function () {
  11275. this.enabled = !1
  11276. }, t.prototype.activateTag = function (e, t) {
  11277. t = t || T.EXAMINE, this.activeTag = e, this.activeTag.hoveringDisc = !0, this.activeTag.setHoverState(t === T.EXAMINE), this.tagState = t, this.emit(b.TagActivated, e)
  11278. }, t.prototype.dismissActiveTag = function () {
  11279. this.activeTag.hoveringDisc = !1, this.activeTag.setFreeState(!0);
  11280. var e = this.activeTag;
  11281. this.activeTag = null, this.tagState = T.IDLE, this.emit(b.TagDismissed, e)
  11282. }, t.prototype.clickedOnTag = function (e) {
  11283. var t = function () {
  11284. this.navigatingViaTag = !0, this.activeTag.examine(this.player), this.emit(b.TagNavigation, this.activeTag)
  11285. }.bind(this);
  11286. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE), this.activeTag = this.intersectTag, t(), !0) : (this.dismissActiveTag(), !1)
  11287. }, t.prototype.intersecttag = (s = new i.Vector3, l = new i.Vector3, c = new i.Vector3, function (e, t, i) {
  11288. if (!this.enabled) return null;
  11289. var n = null,
  11290. r = this.tagDiscs.filter(function (e) {
  11291. return e.parent.visible
  11292. });
  11293. if (0 < r.length) {
  11294. var o = this.model.floors.reduce(function (e, t) {
  11295. return t.hidden ? e : e.concat(t.collider.children)
  11296. }, r);
  11297. s.set(e.x, e.y, -1).unproject(i), l.set(e.x, e.y, 1).unproject(i), c.copy(l).sub(s).normalize(), this.raycaster.set(s, c);
  11298. var a = this.raycaster.intersectObjects(o);
  11299. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  11300. }
  11301. return this.intersectTag = n, t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(), n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function () {
  11302. this.hoveredTag = n
  11303. }.bind(this)), n.billboard.on(v.LEAVE, function () {
  11304. this.hoveredTag = null
  11305. }.bind(this))), this.activateTag(n, T.BROWSE))), n
  11306. }), t.prototype.rankedtagInDirection = (h = [], u = [], d = new i.Vector3, p = new i.Vector3, f = new i.Vector3, function (e, t, i, n) {
  11307. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  11308. var a = this.closesttags[o];
  11309. p.copy(a.position), p.add(a.discPosition), d.copy(t), d.sub(p).negate(), d.normalize();
  11310. var s = d.dot(n);
  11311. if (0 <= s && (f.copy(p), f.project(i), this.intersecttag(f, !1, i))) {
  11312. if (r >= h.length)
  11313. for (var l = 0; l < 64; l++) h.push({
  11314. tag: a,
  11315. dot: s
  11316. });
  11317. var c = h[r];
  11318. c.tag = a, c.dot = s, c.position = math.projectPositionToCanvas(p, i), u.push(c), r++
  11319. }
  11320. }
  11321. return u.sort(function (e, t) {
  11322. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  11323. }), e < u.length ? u[e].tag : null
  11324. }), t.prototype.updateClosestTags = (o = new i.Vector3, function (e) {
  11325. this.closesttags || (this.closesttags = []), this.closesttags.length = 0;
  11326. var t = this.model.tags;
  11327. if (t)
  11328. for (var i in t)
  11329. if (t.hasOwnProperty(i)) {
  11330. var n = t[i],
  11331. r = n.position;
  11332. o.copy(e), o.sub(r).negate(), o.lengthSq() < 30 && this.closesttags.push(n)
  11333. }
  11334. }), R.exports = t
  11335. }).call(this, "/js/tag/tagManager.js")
  11336. }, {
  11337. "../controls/serializer": 14,
  11338. "../enum/BlackoutStyle": 18,
  11339. "../enum/tagEvents": 32,
  11340. "../enum/ModelManagerEvents": 33,
  11341. "../enum/PlayerEvents": 40,
  11342. "../enum/TagStates": 44,
  11343. "../enum/Viewmode": 51,
  11344. "../enum/WarpStyle": 52,
  11345. "../objects/Snapshot": 153,
  11346. "../settings": 166,
  11347. "../util/common": 185,
  11348. "../util/lerp": 188,
  11349. "../util/logger": 189,
  11350. "./Billboard/BillboardEvent": 120,
  11351. "./Media/LinkType": 130,
  11352. "./Media/MediaEvent": 131,
  11353. events: 202,
  11354. three: 217
  11355. }],
  11356. 125: [function (r, o, e) {
  11357. (function (e) {
  11358. "use strict";
  11359. function t() {
  11360. this.embedWrapper = null, this.embedElement = null
  11361. }
  11362. var i = r("../../util/ajax"),
  11363. a = r("./mediaSettings"),
  11364. n = r("../../settings"),
  11365. s = new(r("../../util/logger"))(e);
  11366. t.prototype.createDomElement = function () {
  11367. return this.embedWrapper = document.createElement("div"), this.embedWrapper.classList.add("tag-embed"), this.embedWrapper.classList.add("hidden"), this.embedWrapper
  11368. }, t.prototype.load = function (e) {
  11369. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  11370. return new Promise(function (r, o) {
  11371. i.get(t).then(function (e) {
  11372. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  11373. this.embedWrapper.innerHTML = e.html;
  11374. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  11375. if (this.embedWrapper.style.width = t + "px", e.height) {
  11376. var i = e.height / e.width;
  11377. this.embedWrapper.style.height = t * i + "px"
  11378. }
  11379. this.embedElement = this.embedWrapper.firstChild;
  11380. var n = [];
  11381. try {
  11382. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  11383. } catch (e) {
  11384. s.debug("Error getting `a` elements for embed; was it an iframe?")
  11385. }
  11386. n.forEach(function (e) {
  11387. e.setAttribute("target", "_blank")
  11388. }), this.embedElement.classList.add("hidden"), this.embedWrapper.classList.remove("hidden"), r()
  11389. } else o("Not a valid embed")
  11390. }.bind(this), function (e) {
  11391. o(e.response)
  11392. })
  11393. }.bind(this))
  11394. }, t.prototype.show = function () {
  11395. this.embedElement && this.embedElement.classList.remove("hidden")
  11396. }, t.prototype.hide = function () {
  11397. this.embedElement && this.embedElement.classList.add("hidden")
  11398. }, o.exports = t
  11399. }).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  11400. }, {
  11401. "../../settings": 166,
  11402. "../../util/ajax": 181,
  11403. "../../util/logger": 189,
  11404. "./mediaSettings": 132
  11405. }],
  11406. 126: [function (a, s, e) {
  11407. (function (e) {
  11408. "use strict";
  11409. function t(e) {
  11410. r.call(this), this.options = e, this.playerControls = null, this.state = o.NOT_READY
  11411. }
  11412. var i, n = a("../../util/browser"),
  11413. r = a("./EmbedlyEmbed"),
  11414. o = (new(a("../../util/logger"))(e), Object.freeze({
  11415. NOT_READY: "player.not.ready",
  11416. CUED: "player.cued",
  11417. PLAYING: "player.playing",
  11418. PAUSED: "player.paused"
  11419. }));
  11420. (t.prototype = Object.create(r.prototype)).createDomElement = function () {
  11421. return this.embedWrapper = document.createElement("div"), this.embedWrapper.classList.add("tag-video"), this.embedWrapper.classList.add("hidden"), this.embedWrapper
  11422. }, t.prototype.load = function (e) {
  11423. var t = function () {
  11424. function e(e) {
  11425. this.playerState = e
  11426. }
  11427. this.playerControls = new playerjs.Player(this.embedElement), this.playerControls.on("ready", function (e) {
  11428. this.playerState = o.CUED, this.options.startMuted && this.playerControls.mute()
  11429. }.bind(this)), this.playerControls.on("play", e.bind(this, o.PLAYING)), this.playerControls.on("pause", e.bind(this, o.PAUSED)), this.playerControls.on("ended", function (e) {
  11430. this.playerControls.setCurrentTime(0), this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  11431. }.bind(this))
  11432. }.bind(this);
  11433. return r.prototype.load.call(this, e).then(t.bind(this))
  11434. }, t.prototype.play = (i = n.isMobile(), function () {
  11435. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  11436. }), t.prototype.pause = function () {
  11437. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  11438. }, s.exports = t
  11439. }).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  11440. }, {
  11441. "../../util/browser": 182,
  11442. "../../util/logger": 189,
  11443. "./EmbedlyEmbed": 125
  11444. }],
  11445. 127: [function (t, i, e) {
  11446. (function (e) {
  11447. "use strict";
  11448. var r = t("../../util/ajax"),
  11449. o = new(t("./mediaSettings"), t("../../util/logger"))(e),
  11450. a = Promise.resolve();
  11451. i.exports.enqueue = function (i) {
  11452. function n() {}
  11453. return a = new Promise(function (e, t) {
  11454. a.catch(n).then(function () {
  11455. (o.debug("requesting file from embedly:", i.href), r.get(i.href, {
  11456. responseType: i.responseType
  11457. }).then(function (e) {
  11458. return o.debug("requesting file finished:", i.href), e
  11459. })).then(e, t)
  11460. })
  11461. })
  11462. }
  11463. }).call(this, "/js/tag/Media/EmbedlyQueue.js")
  11464. }, {
  11465. "../../util/ajax": 181,
  11466. "../../util/logger": 189,
  11467. "./mediaSettings": 132
  11468. }],
  11469. 128: [function (s, l, e) {
  11470. (function (e) {
  11471. "use strict";
  11472. function t() {
  11473. this.imageWrapper = null, this.width = 0, this.height = 0, this.aspect = 1
  11474. }
  11475. var i = s("./MediaEvent"),
  11476. n = s("./EmbedlyQueue"),
  11477. r = s("events").EventEmitter,
  11478. o = s("../../util/logger"),
  11479. a = s("../../settings");
  11480. new o(e), (t.prototype = Object.create(r.prototype)).createDomElement = function () {
  11481. return this.imageWrapper = document.createElement("div"), this.imageWrapper.classList.add("tag-image"), this.imageWrapper.classList.add("hidden"), this.imageWrapper.addEventListener("click", function (e) {
  11482. e.stopPropagation(), this.emit(i.IMAGE_OPENING), this.imageWrapper.style.pointerEvents = "none"
  11483. }.bind(this)), this.imageWrapper
  11484. }, t.prototype.onClosed = function () {
  11485. this.imageWrapper.style.pointerEvents = "auto"
  11486. }, t.prototype.load = function (e) {
  11487. var t = Math.max(window.screen.height, window.screen.width),
  11488. i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  11489. return new Promise(function (o, e) {
  11490. n.enqueue({
  11491. href: i,
  11492. responseType: "arraybuffer"
  11493. }).then(function (e) {
  11494. var t = new Uint8Array(e),
  11495. i = new Blob([t]),
  11496. n = new window.Image;
  11497. n.addEventListener("load", function (e) {
  11498. var t = e.target;
  11499. this.width = t.naturalWidth, this.height = t.naturalHeight, this.aspect = this.width / this.height;
  11500. var i = e.target.src;
  11501. this.imageWrapper.style.backgroundImage = 'url("' + i + '")', this.imageWrapper.style.width = this.width + "px", this.imageWrapper.style.height = this.height + "px", this.imageWrapper.classList.remove("hidden"), o()
  11502. }.bind(this));
  11503. var r = URL.createObjectURL(i);
  11504. n.src = r
  11505. }.bind(this), e)
  11506. }.bind(this))
  11507. }, l.exports = t
  11508. }).call(this, "/js/tag/Media/Image.js")
  11509. }, {
  11510. "../../settings": 166,
  11511. "../../util/logger": 189,
  11512. "./EmbedlyQueue": 127,
  11513. "./MediaEvent": 131,
  11514. events: 202
  11515. }],
  11516. 129: [function (e, t, i) {
  11517. "use strict";
  11518. function n(e) {
  11519. this.label = e.label, this.href = e.url, this.type = this.updateLinkForType(), this.domElement = null, this.id = c++
  11520. }
  11521. var r = e("./LinkType"),
  11522. o = e("./MediaEvent"),
  11523. a = e("../../util/browser"),
  11524. s = e("../../analytics"),
  11525. l = e("events").EventEmitter,
  11526. c = 0;
  11527. (n.prototype = Object.create(l.prototype)).updateLinkForType = function () {
  11528. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  11529. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href, new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]), r.NAVIGATION) : (this.href = this.href + "&play=1", r.MODEL) : r.EXT_LINK
  11530. };
  11531. var h = {};
  11532. n.prototype.createDomElement = function () {
  11533. if (this.domElement = document.createElement("a"), this.domElement.classList.add("tag-link"), this.domElement.textContent = this.label, this.type === r.EXT_LINK) {
  11534. this.domElement.textContent += " ";
  11535. var e = document.createElement("i");
  11536. e.classList.add("icon-ext-link"), e.title = "Link to external web site", this.domElement.appendChild(e)
  11537. }
  11538. return this.domElement.addEventListener("click", function (e) {
  11539. switch (e.stopPropagation(), h[this.id] = !0, s.trackAlways("click_tag_link", {
  11540. link_type: this.type,
  11541. link_count: c,
  11542. links_clicked: Object.keys(h).length
  11543. }), this.type) {
  11544. case r.MODEL:
  11545. window.location.replace(this.href);
  11546. break;
  11547. case r.EXT_LINK:
  11548. window.open(this.href, "_blank")
  11549. }
  11550. this.emit(o.LINK_CLICK, {
  11551. type: this.type,
  11552. url: this.href
  11553. })
  11554. }.bind(this)), this.domElement
  11555. }, t.exports = n
  11556. }, {
  11557. "../../analytics": 4,
  11558. "../../util/browser": 182,
  11559. "./LinkType": 130,
  11560. "./MediaEvent": 131,
  11561. events: 202
  11562. }],
  11563. 130: [function (e, t, i) {
  11564. "use strict";
  11565. t.exports = {
  11566. NAVIGATION: "navigation",
  11567. MODEL: "model",
  11568. EXT_LINK: "ext-link"
  11569. }
  11570. }, {}],
  11571. 131: [function (e, t, i) {
  11572. "use strict";
  11573. t.exports = Object.freeze({
  11574. LINK_CLICK: "mtmedia.link",
  11575. IMAGE_LOADED: "mtmedia.image.loaded",
  11576. IMAGE_OPENING: "mtmedia.image.opening",
  11577. IMAGE_OPENED: "mtmedia.image.opened",
  11578. IMAGE_CLOSING: "mtmedia.image.closing",
  11579. IMAGE_CLOSED: "mtmedia.image.closed",
  11580. VIDEO_START: "mtmedia.video.start",
  11581. VIDEO_PAUSE: "mtmedia.video.pause",
  11582. VIDEO_ENDED: "mtmedia.video.end"
  11583. })
  11584. }, {}],
  11585. 132: [function (e, t, i) {
  11586. "use strict";
  11587. t.exports = Object.freeze({
  11588. maxEmbedWidth: 350,
  11589. defaultAspectRatio: .75
  11590. })
  11591. }, {}],
  11592. 133: [function (e, t, i) {
  11593. "use strict";
  11594. t.exports = Object.freeze({
  11595. TEXT: "text",
  11596. LINK: "link",
  11597. IMAGE: "photo",
  11598. VIDEO: "video",
  11599. RICH: "rich"
  11600. })
  11601. }, {}],
  11602. 134: [function (e, t, i) {
  11603. "use strict";
  11604. function n(e) {
  11605. this.capabilities = {
  11606. links: {
  11607. enable: e.supportLinks,
  11608. keepLabels: e.keepLinkLabels
  11609. }
  11610. }
  11611. }
  11612. var r = e("./DescriptionChunkType");
  11613. n.prototype.parse = function (e, i) {
  11614. var n = [];
  11615. return e.split("[").map(function (e, t) {
  11616. return 0 === t ? e : "[" + e
  11617. }).forEach(function (e) {
  11618. var t = this.findMarkdown(e);
  11619. if (t) {
  11620. if (-1 !== t.url.indexOf("javascript:")) return;
  11621. this.addLinkChunk(n, t, i), this.addTextChunk(n, e.slice(t.markdown.length))
  11622. } else this.addTextChunk(n, e)
  11623. }.bind(this)), n
  11624. }, n.prototype.findMarkdown = function (e) {
  11625. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  11626. if (t) {
  11627. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--, 0 !== n);) r++;
  11628. var o = i.length - r;
  11629. return {
  11630. markdown: t[0].substring(0, t[0].length - o),
  11631. label: t[1],
  11632. url: t[2].substring(0, r)
  11633. }
  11634. }
  11635. }, n.prototype.addTextChunk = function (e, t) {
  11636. 0 !== t.length && e.push({
  11637. type: r.TEXT,
  11638. text: t
  11639. })
  11640. }, n.prototype.addLinkChunk = function (e, t) {
  11641. if (this.capabilities.links.enable) {
  11642. var i = {
  11643. label: t.label,
  11644. url: t.url
  11645. }; - 1 === i.url.indexOf("://") && (i.url = "http://" + i.url), e.push({
  11646. type: r.LINK,
  11647. link: i
  11648. })
  11649. } else this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  11650. }, t.exports = n
  11651. }, {
  11652. "./DescriptionChunkType": 133
  11653. }],
  11654. 135: [function (t, r, e) {
  11655. (function (e) {
  11656. "use strict";
  11657. var i = new(t("../util/logger"))(e),
  11658. n = {
  11659. parseIdsFromChunkName: function (e, t) {
  11660. t.floorId = n.parseFloor(e), t.roomId = n.parseRoom(e)
  11661. },
  11662. parseFloor: function (e) {
  11663. var t = e.match(/_group([0-9]+)/);
  11664. if (!t) return 0;
  11665. try {
  11666. return parseInt(t[1], 10)
  11667. } catch (e) {
  11668. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  11669. }
  11670. },
  11671. parseRoom: function (e) {
  11672. var t = e.match(/_sub([0-9]+)/);
  11673. if (!t) return -1;
  11674. try {
  11675. return parseInt(t[1], 10)
  11676. } catch (e) {
  11677. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'), 0
  11678. }
  11679. }
  11680. };
  11681. r.exports = n
  11682. }).call(this, "/js/model/Chunks.js")
  11683. }, {
  11684. "../util/logger": 189
  11685. }],
  11686. 136: [function (a, c, e) {
  11687. (function (e) {
  11688. "use strict";
  11689. function t(e) {
  11690. r.call(this), this.model = e, this.exploded = !1
  11691. }
  11692. var i = a("../objects/Floor"),
  11693. n = (a("../settings"), a("../util/logger")),
  11694. s = a("../util/transitions"),
  11695. r = a("../util/IndexedCollection"),
  11696. o = a("../util/common"),
  11697. l = a("../util/easing");
  11698. new n(e), o.inherit(t, r), t.prototype.add = function (e) {
  11699. r.prototype.add.call(this, e), this.model.add(e)
  11700. }, t.prototype.getIndex = function (e) {
  11701. return e.floorIndex
  11702. }, t.prototype.build = function () {
  11703. this.list.forEach(function (e) {
  11704. e.build()
  11705. })
  11706. }, t.prototype.size = function () {
  11707. return this.length
  11708. }, t.prototype.sort = function () {
  11709. r.prototype.sort.call(this, function (e, t) {
  11710. return e.floorIndex - t.floorIndex
  11711. })
  11712. }, t.prototype.nextFloor = function (e, t) {
  11713. return this.index[e.floorIndex + t] || null
  11714. }, t.prototype.getFloorAtPoint = function (e) {
  11715. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  11716. var r = this.list[n],
  11717. o = r.distanceToPoint(e);
  11718. (!t || o < i) && (i = o, t = r)
  11719. }
  11720. return t
  11721. }, t.prototype.getOrMakeFloor = function (e) {
  11722. var t = this.index[e];
  11723. return t || (t = new i(this.model, e), this.add(t)), t
  11724. }, t.prototype.hide = function () {
  11725. this.list.forEach(function (e) {
  11726. e.hide()
  11727. })
  11728. }, t.prototype.show = function () {
  11729. this.list.forEach(function (e) {
  11730. e.show()
  11731. })
  11732. }, t.prototype.names = function () {
  11733. return this.list.reduce(function (e, t) {
  11734. return e.concat(t.name)
  11735. }, [])
  11736. }, t.prototype.toggleExplodeHorizontal = function () {
  11737. function i(e, t) {
  11738. a.copy(e.position), e.position.x = r[e.floorIndex] * t, e.position.y = 1 * e.floorIndex * t, a.sub(e.position).multiplyScalar(-1), e.panos.forEach(function (e) {
  11739. e.translate(a)
  11740. })
  11741. }
  11742. var n, r = [],
  11743. o = 0;
  11744. this.list.forEach(function (e, t, i) {
  11745. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0, o += n, r[t] = o
  11746. }), r = r.map(function (e) {
  11747. return e - o / 2
  11748. });
  11749. var a = this.list[0].position.clone();
  11750. this.exploded ? this.list.forEach(function (t) {
  11751. s.start(function (e) {
  11752. i(t, 1 - e)
  11753. }, 1500, null, 0, l.easeOutExpo)
  11754. }) : this.list.forEach(function (t) {
  11755. s.start(function (e) {
  11756. i(t, e)
  11757. }, 1500, null, 0, l.easeOutExpo)
  11758. }), this.exploded = !this.exploded
  11759. }, t.prototype.toggleExplodeVertical = function () {
  11760. function i(e, t) {
  11761. var i = i.copy(e.position);
  11762. e.position.y = (5 * e.floorIndex - n.y / 2) * t, i.sub(e.position).multiplyScalar(-1), e.panos.forEach(function (e) {
  11763. e.translate(i)
  11764. })
  11765. }
  11766. var n = this.model.size;
  11767. this.list[0].position.clone(), this.exploded ? this.list.forEach(function (t) {
  11768. s.start(function (e) {
  11769. i(t, 1 - e)
  11770. }, 1500, null, 0, l.easeOutExpo)
  11771. }) : this.list.forEach(function (t) {
  11772. s.start(function (e) {
  11773. i(t, e)
  11774. }, 1500, null, 0, l.easeOutExpo)
  11775. }), this.exploded = !this.exploded
  11776. }, c.exports = t
  11777. }).call(this, "/js/model/FloorCollection.js")
  11778. }, {
  11779. "../objects/Floor": 146,
  11780. "../settings": 166,
  11781. "../util/IndexedCollection": 175,
  11782. "../util/common": 185,
  11783. "../util/easing": 186,
  11784. "../util/logger": 189,
  11785. "../util/transitions": 195
  11786. }],
  11787. 137: [function (r, o, e) {
  11788. (function (e) {
  11789. "use strict";
  11790. function h() {
  11791. n.call(this)
  11792. }
  11793. var u = r("../settings"),
  11794. t = r("../util/logger"),
  11795. d = r("../enum/Viewmode"),
  11796. p = r("../objects/Snapshot"),
  11797. i = (r("../util/math"), r("../util/common")),
  11798. n = r("../util/IndexedCollection"),
  11799. l = new t(e);
  11800. i.inherit(h, n), h.prototype.getImage = function (e) {
  11801. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  11802. }, h.prototype.filterByModesAndReel = function (e, t) {
  11803. for (var i = [], n = 0; n < t.length; n += 1) {
  11804. var r = t[n],
  11805. o = this.index[r.sid];
  11806. o && i.push(o)
  11807. }
  11808. var a = e[d.DOLLHOUSE],
  11809. s = e[d.FLOORPLAN];
  11810. (i = i.filter(function (e) {
  11811. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0;
  11812. var t;
  11813. try {
  11814. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  11815. } catch (e) {
  11816. return l.debug(e.message), !1
  11817. }
  11818. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  11819. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"), this.list = i, this.reIndex()
  11820. }, h.prototype.getHeroLocations = function (e) {
  11821. if (0 === this.list.length) return [];
  11822. for (var t = [], i = 1; i < this.list.length; ++i) {
  11823. var n = this.list[i],
  11824. r = n.thumbnail_signed_src,
  11825. o = n.name || "";
  11826. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  11827. if (!u.show360Views.enabled && n.metadata.scan_id) {
  11828. var a = e.get(n.metadata.scan_id);
  11829. if (a && !a.isAligned()) continue
  11830. }
  11831. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  11832. if (s === d.MESH) continue;
  11833. var l = {
  11834. cameraMode: s,
  11835. position: n.metadata.camera_position,
  11836. quaternion: n.metadata.camera_quaternion,
  11837. zoom: n.metadata.zoom,
  11838. panoId: n.metadata.scan_id,
  11839. orthoZoom: n.metadata.ortho_zoom,
  11840. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  11841. thumbUrl: "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : "//" + r + "?" + randomTime().getTime(),
  11842. name: h.filterImageName(o),
  11843. sid: n.sid
  11844. },
  11845. c = new p(l);
  11846. t.push(c)
  11847. }
  11848. }
  11849. return t
  11850. }, h.prototype.getIndex = function (e) {
  11851. return e.sid
  11852. }, h.filterImageName = function (e) {
  11853. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  11854. }, o.exports = h
  11855. }).call(this, "/js/model/ImageCollection.js")
  11856. }, {
  11857. "../enum/Viewmode": 51,
  11858. "../objects/Snapshot": 153,
  11859. "../settings": 166,
  11860. "../util/IndexedCollection": 175,
  11861. "../util/common": 185,
  11862. "../util/logger": 189,
  11863. "../util/math": 190
  11864. }],
  11865. 138: [function (h, u, e) {
  11866. (function (e) {
  11867. "use strict";
  11868. function n() {
  11869. c.call(this)
  11870. }
  11871. var r = h("../label/Label"),
  11872. i = h("../settings"),
  11873. t = h("../util/logger"),
  11874. o = h("../util/math"),
  11875. a = h("../util/ajax"),
  11876. s = h("./RoomCollection"),
  11877. l = h("../util/common"),
  11878. c = h("../util/IndexedCollection");
  11879. new t(e), l.inherit(n, c), n.prototype.getIndex = function (e) {
  11880. return e.labelId
  11881. }, n.prototype.associateWithRooms = function (e) {
  11882. this.forEach(function (t) {
  11883. e.forEach(function (e) {
  11884. e.roomId === t.roomId && (t.room = e)
  11885. })
  11886. })
  11887. }, n.prototype.createFromLabelData = function (e) {
  11888. e.forEach(function (e) {
  11889. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  11890. t = s.generateRoomId(e.floorId, t);
  11891. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t);
  11892. i.position = o.convertWorkshopVector(i.position), this.add(i), i.build()
  11893. }.bind(this))
  11894. }, n.prototype.load = function (e, t) {
  11895. return a.get(e, {
  11896. responseType: "json",
  11897. auth: t ? i.authorizationHeader : null
  11898. }).done(function (e) {
  11899. var t = [];
  11900. for (var i in e) {
  11901. var n = e[i];
  11902. t.push(n)
  11903. }
  11904. this.createFromLabelData(t)
  11905. }.bind(this))
  11906. }, n.parseRoomIndexFromWorkshopRoomId = function (e) {
  11907. var t = -1;
  11908. if (e) {
  11909. var i = e.split("_");
  11910. t = parseInt(i[0])
  11911. }
  11912. return t
  11913. }, u.exports = n
  11914. }).call(this, "/js/model/LabelCollection.js")
  11915. }, {
  11916. "../label/Label": 90,
  11917. "../settings": 166,
  11918. "../util/IndexedCollection": 175,
  11919. "../util/ajax": 181,
  11920. "../util/common": 185,
  11921. "../util/logger": 189,
  11922. "../util/math": 190,
  11923. "./RoomCollection": 141
  11924. }],
  11925. 139: [function (P, O, e) {
  11926. (function (e) {
  11927. "use strict";
  11928. function t(e, t) {
  11929. o.Object3D.call(this), this.sid = t.sid, this.data = t, this.options = e, this.urls = new i(e.urlFiles), this.isPublic = void 0 !== t.is_public && t.is_public, this.images = new E(this), this.images.extend(t.images), this.heroImage = this.images.getImage(t.icon), this.heroLocations = [], this.outdoorPanoLocations = [], this.floors = new c(this), this.floorsEnabled = void 0 === e.floors || e.floors, this.changingFloor = !1, this.chunks = [], this.panos = new g, this.colliders = [], this.loadPanosPromise = null, this.loadMeshTexturesPromise = null, this.auxDataPromise = null, this.meshTexturesLoaded = !1, this.meshTextures = [], this.tags = {}, this.tagsShown = !1, this.shouldShowtags = !1, this.has360Views = !1, this.showingLabels = u.labels.enabled && t.player_options.labels, this.supportedModes = {}, this.supportedModes[s.PANORAMA] = !0, this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1), this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1), this.supportedModes[s.TRANSITIONING] = !0, this.supportsTiles = this.configureTiling(), this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || !0, this.mode = s.DOLLHOUSE, this.size = null, this.center = null, this.boundingBox = new o.Box3, this.currentFloor = null, this.allFloorsVisible = !0, this.projectedPano0 = null, this.projectedPano1 = null, this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function (e, t) {
  11930. this.addFloor(new r(this, t, e.trim()))
  11931. }.bind(this)), this.waitQueue = [], this.on("load", function (e) {
  11932. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function (e) {
  11933. return !e.isLoadedCallback()
  11934. }), 0 === this.waitQueue.length && this.emit("waiting-done"))
  11935. }.bind(this)), this.setupCustomProperties(), this.hots = {}
  11936. }
  11937. var o = P("three"),
  11938. a = P("../util/ajax"),
  11939. i = P("../util/ModelUrls"),
  11940. n = P("../objects/BoundingTextureSkybox"),
  11941. s = P("../enum/Viewmode"),
  11942. l = P("../enum/RenderOrder"),
  11943. r = (P("../enum/AlignmentType"), P("../objects/Floor")),
  11944. c = P("./FloorCollection"),
  11945. h = P("../objects/Chunk"),
  11946. u = (P("../objects/Room"), P("../objects/Snapshot"), P("../label/Label"), P("../util/math"), P("../settings")),
  11947. d = P("../shaders"),
  11948. p = P("../util/logger"),
  11949. f = (P("../tag/tag"), P("../tag/tagManager"), P("../objects/Panorama")),
  11950. g = P("../util/PanoramaCollection"),
  11951. m = P("../loaders/ModelLoader"),
  11952. v = P("../loaders/ModelTextureLoader"),
  11953. y = P("../loaders/SweepDataLoader"),
  11954. A = P("../util/transitions"),
  11955. C = (P("../util/easing"), P("../util/lerp"), P("../util/common")),
  11956. I = (P("../util/texture"), P("./../util/browser")),
  11957. E = P("./ImageCollection"),
  11958. _ = P("./RoomCollection"),
  11959. b = P("./LabelCollection"),
  11960. w = P("./Chunks"),
  11961. T = P("./../util/showcase"),
  11962. x = P("../exception/BasicException"),
  11963. S = (P("../constants"), P("events").EventEmitter),
  11964. M = P("hot"),
  11965. R = new p(e);
  11966. t.prototype = Object.create(o.Object3D.prototype), C.extend(t, S), t.prototype.setupCustomProperties = function () {
  11967. var t = u.modelAlpha;
  11968. Object.defineProperty(this, "alpha", {
  11969. get: function () {
  11970. return t
  11971. },
  11972. set: function (e) {
  11973. t = e, this.chunks.forEach(function (e) {
  11974. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  11975. })
  11976. }
  11977. })
  11978. }, t.prototype.configureTiling = function () {
  11979. var e = function () {
  11980. try {
  11981. var e = document.createElement("canvas"),
  11982. t = e.getContext("webgl");
  11983. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  11984. } catch (e) {
  11985. return 0
  11986. }
  11987. }();
  11988. if (e < 2048) return !1;
  11989. R.warn("Max cube texture size: " + e);
  11990. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  11991. var i = u.tiling.tilingFlagNames[t];
  11992. if ("1" === I.valueFromHash(i, null)) return !0;
  11993. if ("0" === I.valueFromHash(i, null)) return !1
  11994. }
  11995. return !!T.modelDataPromisesTiles(this.data)
  11996. }, t.prototype.toggleAlpha = function () {
  11997. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  11998. }, t.prototype.load = function (e) {
  11999. var t = this.urls.init().then(function () {
  12000. return $.when(this.loadPanos(), this.loadMesh())
  12001. }.bind(this));
  12002. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)), this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()), $.when(t, this.auxDataPromise).done(this.build.bind(this))
  12003. }, t.prototype.loadMesh = function () {
  12004. var n = $.Deferred(),
  12005. r = this;
  12006. return m.load(r.data.job.uuid, r.urls, function (e, t) {
  12007. if (0 === e.length) {
  12008. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"), r.supportedModes[s.DOLLHOUSE] = !1, r.supportedModes[s.FLOORPLAN] = !1;
  12009. var i = new h({
  12010. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1)
  12011. });
  12012. i.material.visible = !1, i.rotateX(-Math.PI / 2), i.geometry.computeBoundingBox(), e = [i]
  12013. }
  12014. e.forEach(function (e) {
  12015. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  12016. r.addChunk(t, e)
  12017. }), r.floors.sort(), n.resolve(r)
  12018. }, function (e, t) {
  12019. n.notify(e, t)
  12020. }, function (e) {
  12021. R.error(e), n.reject("loading-failed")
  12022. }), n.promise()
  12023. }, t.prototype.loadMeshTextures = function () {
  12024. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function () {
  12025. this.meshTexturesLoaded = !0
  12026. }.bind(this))), this.loadTexturesPromise
  12027. }, t.prototype.shineHots = function () {
  12028. A.trigger({
  12029. func: function (e) {
  12030. d.hot.uniforms.opac.value = e <= .5 ? 2 * e : -2 * e + 2
  12031. }.bind(this),
  12032. cycling: !0,
  12033. duration: 3e3,
  12034. name: "hotShine"
  12035. })
  12036. }, t.prototype.createHotItem = function (e, t) {
  12037. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  12038. var o = document.createElement("li"),
  12039. a = document.createElement("span");
  12040. a.innerHTML = e[n[r]].title || "热点", o.hot = t[n[r]], o.appendChild(a), i.appendChild(o)
  12041. }
  12042. document.querySelector("#hotListContent ul").appendChild(i), console.log(i)
  12043. }, t.prototype.loadhots = function () {
  12044. var r = $.Deferred(),
  12045. e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  12046. return a.get(e, {
  12047. responseType: "json",
  12048. auth: this.isPublic ? null : u.authorizationHeader
  12049. }).done(function (e) {
  12050. for (var t in g_data2 = hotMatcher(e), this.hotsCount = 0, e.hots) this.hotsCount++, this.hots[t] = new M(t, e.hots[t], this);
  12051. g_index = I.valueFromHash("m"), e.tourAudio && (g_tourAudio = new Audio, g_tourAudio.loop = !1, g_tourAudio.addEventListener("ended", function () {
  12052. var e = document.createEvent("MouseEvent");
  12053. e.initEvent("tourAudioEnded", !0, !0), window.dispatchEvent(e)
  12054. }));
  12055. var i = $.Deferred(),
  12056. n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  12057. a.get(n, {
  12058. responseType: "json",
  12059. auth: this.isPublic ? null : u.authorizationHeader
  12060. }).done(function (e) {
  12061. window.hotData = e, this.createHotItem(e, this.hots), i.resolve()
  12062. }.bind(this)).fail(function () {
  12063. console.log("Data.js is empty"), i.resolve()
  12064. }), e.weixinDesc && (g_weixinObj.desc = e.weixinDesc), window.wx && manage.weixinShare(), r.resolve()
  12065. }.bind(this)).fail(function () {
  12066. console.log("没有热点"), window.wx && manage.weixinShare(), r.resolve()
  12067. }), r
  12068. }, t.prototype.loadPanos = function () {
  12069. if (this.loadPanosPromise) return this.loadPanosPromise;
  12070. var e = new y(this);
  12071. return this.loadPanosPromise = e.load().then(function (e) {
  12072. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function (e) {
  12073. return this.data.sweeps[e.uuid].enabled
  12074. }.bind(this))), this.panos.extend(e.map(function (e) {
  12075. return new f(this, e.uuid, e, this.supportsTiles)
  12076. }.bind(this))), this.panos.forEach(function (i) {
  12077. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function (e) {
  12078. var t = this.panos.get(e);
  12079. t && this.panos.setNeighbour(i, t, !0)
  12080. }.bind(this)), i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  12081. }.bind(this)), 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"), this.supportedModes[s.PANORAMA] = !1), $.when(this)
  12082. }.bind(this)), this.loadPanosPromise
  12083. }, t.prototype.loadHighlightReel = function () {
  12084. var t = $.Deferred(),
  12085. e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  12086. return a.get(e, {
  12087. responseType: "json",
  12088. auth: this.isPublic ? null : u.authorizationHeader
  12089. }).done(function (e) {
  12090. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"), this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"), t.resolve()
  12091. }.bind(this)).fail(function () {
  12092. R.warn("Getting highlight reel failed, no highlights available"), t.resolve()
  12093. }), t
  12094. }, t.prototype.waitForLoad = function (e, t) {
  12095. t() || (this.waitQueue.push({
  12096. object: e,
  12097. isLoadedCallback: t
  12098. }), 1 === this.waitQueue.length && this.emit("waiting"))
  12099. }, t.prototype.hide = function () {
  12100. this.floors.hide()
  12101. }, t.prototype.show = function () {
  12102. this.floors.show()
  12103. }, t.prototype.floorNames = function () {
  12104. return this.floors.names()
  12105. }, t.prototype.warpDestFloors = function (e, t) {
  12106. if (e && this.floors.length === e.length) {
  12107. var i = e.findIndex(function (e) {
  12108. return e
  12109. }.bind(this)); - 1 !== i && this.setFloor(this.floors.list[i], null, t)
  12110. } else this.toggleAllFloors(!0)
  12111. }, t.prototype.setFloor = function (e, t, i) {
  12112. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor), this.allFloorsVisible = !1, this._setFloor(e, t, i)
  12113. }, t.prototype.toggleAllFloors = function (e) {
  12114. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible, this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor), this._setFloor(this.currentFloor)
  12115. }, t.prototype._setFloor = function (e, t, i) {
  12116. var n;
  12117. if (t = t || this.mode, this.emit("floor.changed", e, t, this.currentFloor), this.currentFloor = e, t === s.PANORAMA) {
  12118. if (this.show(), this.shouldShowtags && this.tagsShown)
  12119. for (n in this.tags) this.tags[n].show(u.showFloorDuration)
  12120. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function (e, t) {
  12121. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  12122. }.bind(this)), this.shouldShowtags && this.tagsShown))
  12123. for (n in this.tags) {
  12124. var r = this.tags[n];
  12125. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  12126. }
  12127. var o = this,
  12128. a = e;
  12129. A.start(function () {}, u.showFloorDelay, function () {
  12130. o.floors.forEach(function (t) {
  12131. t.chunks.forEach(function (e) {
  12132. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  12133. })
  12134. })
  12135. }.bind(this))
  12136. }, t.prototype.toggleExplode = function () {
  12137. this.floors.toggleExplodeHorizontal()
  12138. }, t.prototype.toggleExplodeUp = function () {
  12139. this.floors.toggleExplodeVertical()
  12140. }, t.prototype.nextFloor = function (e) {
  12141. return this.floors.nextFloor(this.currentFloor, e)
  12142. }, t.prototype.addFloor = function (e) {
  12143. this.floors.add(e)
  12144. }, t.prototype.getFloorAtPoint = function (e) {
  12145. return this.floors.getFloorAtPoint(e)
  12146. }, t.prototype.getTagBySid = function (e) {
  12147. return this.tags[e]
  12148. }, t.prototype.addChunk = function (e, t) {
  12149. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t)
  12150. }, t.prototype.setMode = function (t) {
  12151. if (!this.supportedModes[t]) throw new x("Mode not supported for this model: " + t);
  12152. this.mode = t, this.chunks.forEach(function (e) {
  12153. e.setMode(t)
  12154. })
  12155. }, t.prototype.build = function () {
  12156. this.heroLocations = this.images.getHeroLocations(this.panos);
  12157. var e = function () {
  12158. 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()
  12159. }.bind(this)();
  12160. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function (e) {
  12161. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  12162. }.bind(this)) || e, null === this.heroImage && R.warn("No hero image defined."), this.currentFloor = this.floors.last(), this.floors.build(), this.colliders = this.floors.reduce(function (e, t) {
  12163. return e.concat(t.collider.children)
  12164. }, []), this.panos.forEach(function (e) {
  12165. e.build1(), e.on("enter", function () {
  12166. e.floor !== this.currentFloor && this.setFloor(e.floor)
  12167. }.bind(this))
  12168. }.bind(this)), this.panos.forEach(function (e) {
  12169. e.build2()
  12170. }), this.floors.forEach(function (e) {
  12171. this.boundingBox.union(e.boundingBox)
  12172. }.bind(this)), this.size = this.boundingBox.size(), this.center = this.boundingBox.center(), this.floors.forEach(function (e) {
  12173. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  12174. }.bind(this)), this.panos.populate_path_graph(), this.skybox = new n(this.boundingBox), this.skybox.matrixWorldNeedsUpdate = !0, this.add(this.skybox), setTimeout(function () {
  12175. this.hotsCount && this.shineHots()
  12176. }.bind(this), 1300), this.tags) this.tags[t].build();
  12177. return R.debug("Done building model"), 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone), R.warn("raycasts skipped: " + f.raycastsSkipped)), this.buildRooms(), this.labels.associateWithRooms(this.rooms), $.when(this)
  12178. }, t.prototype.loadLabels = function () {
  12179. this.labels = new b(this);
  12180. var e = $.Deferred();
  12181. if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0), !this.showingLabels) return e.resolve();
  12182. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  12183. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function () {
  12184. R.warn("Getting labels failed, not displaying labels."), e.resolve()
  12185. }), e
  12186. }, t.prototype.buildRooms = function () {
  12187. this.rooms = new _(this), this.rooms.createFromChunks(this.chunks), this.rooms.calcRoomBoundaries()
  12188. }, t.prototype.updateProjectedPanos = function () {
  12189. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  12190. }, t.prototype.setProjectedPanos = function (t, i, n) {
  12191. null != n || (n = !0), n = !!n, this.projectedPano0 = t, this.projectedPano1 = i, this.skybox.material.setProjectedPanos(t, i, n), this.chunks.forEach(function (e) {
  12192. e.materialInside.setProjectedPanos(t, i, n)
  12193. })
  12194. }, t.prototype.setSide = function (t) {
  12195. this.floors.forEach(function (e) {
  12196. e.collider.material.side = t
  12197. })
  12198. }, t.prototype.heroCount = function () {
  12199. return this.heroLocations ? this.heroLocations.length : 0
  12200. }, t.prototype.getHeroDescriptorByIndex = function (e) {
  12201. if (e < 0) return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."), null;
  12202. if (this.heroCount() < 1) return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"), null;
  12203. var t = this.heroLocations[e];
  12204. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"), null) : t
  12205. }, t.prototype.findPanoramicHero = function () {
  12206. for (var e in this.heroLocations)
  12207. if (this.heroLocations[e].cameraMode === s.PANORAMA) return this.heroLocations[e];
  12208. return null
  12209. }, t.prototype.listImagePanos = function () {
  12210. var i = [],
  12211. n = this;
  12212. return this.images.forEach(function (e) {
  12213. if (e.metadata && e.metadata.scan_id) {
  12214. var t = n.panos.get(e.metadata.scan_id);
  12215. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  12216. }
  12217. }), i
  12218. }, t.prototype.fadePanoMarkers = function (e, t) {
  12219. this.panos.fadeMarkerOpacity(e, t)
  12220. }, t.prototype.setSweepVisibility = function (t) {
  12221. this.panos.forEach(function (e) {
  12222. e.marker && (e.marker.visible = t)
  12223. })
  12224. }, t.prototype.outsideAllowed = function () {
  12225. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  12226. }, O.exports = t
  12227. }).call(this, "/js/model/Model.js")
  12228. }, {
  12229. "../constants": 8,
  12230. "../enum/AlignmentType": 17,
  12231. "../enum/RenderOrder": 42,
  12232. "../enum/Viewmode": 51,
  12233. "../exception/BasicException": 55,
  12234. "../label/Label": 90,
  12235. "../loaders/ModelLoader": 105,
  12236. "../loaders/ModelTextureLoader": 106,
  12237. "../loaders/SweepDataLoader": 107,
  12238. "../tag/tag": 123,
  12239. "../tag/tagManager": 124,
  12240. "../objects/BoundingTextureSkybox": 143,
  12241. "../objects/Chunk": 144,
  12242. "../objects/Floor": 146,
  12243. "../objects/Panorama": 148,
  12244. "../objects/Room": 150,
  12245. "../objects/Snapshot": 153,
  12246. "../settings": 166,
  12247. "../shaders": 167,
  12248. "../util/ModelUrls": 177,
  12249. "../util/PanoramaCollection": 178,
  12250. "../util/ajax": 181,
  12251. "../util/common": 185,
  12252. "../util/easing": 186,
  12253. "../util/lerp": 188,
  12254. "../util/logger": 189,
  12255. "../util/math": 190,
  12256. "../util/texture": 194,
  12257. "../util/transitions": 195,
  12258. "./../util/browser": 182,
  12259. "./../util/showcase": 193,
  12260. "./Chunks": 135,
  12261. "./FloorCollection": 136,
  12262. "./ImageCollection": 137,
  12263. "./LabelCollection": 138,
  12264. "./RoomCollection": 141,
  12265. events: 202,
  12266. three: 217,
  12267. hot: "hot"
  12268. }],
  12269. 140: [function (e, t, i) {
  12270. "use strict";
  12271. function n() {
  12272. this.modelMap = {}, this.activeModel = null, this.modelCount = 0, this.tileDownloader = null, this.panoRenderer = null
  12273. }
  12274. var r = (e("three"), e("../util/common")),
  12275. o = e("../exception/BasicException"),
  12276. a = e("../enum/ModelManagerEvents"),
  12277. s = e("../enum/PanoRendererEvents"),
  12278. l = e("events").EventEmitter;
  12279. n.prototype.init = function (e, t, i) {
  12280. this.tileDownloader = e, this.panoRenderer = t, this.qualityManager = i, this.bindEvents()
  12281. }, n.prototype.bindEvents = function () {
  12282. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  12283. }, n.prototype.onTileRendered = function (e, t, i, n) {}, n.prototype.addModel = function (e) {
  12284. this.modelMap[e.sid] = e, 0 === this.modelCount && this.activateModel(e.sid), this.modelCount++, this.emit(a.ModelAdded)
  12285. }, n.prototype.getModel = function (e) {
  12286. return this.modelMap[e]
  12287. }, n.prototype.activateModel = function (e) {
  12288. var t = this.modelMap[e];
  12289. if (!t) throw new o("Tried to activate invalid model!");
  12290. var i = this.activeModel;
  12291. this.activeModel = t, this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid), this.tileDownloader.setUrls(t.urls), t.panos.forEach(function (e) {
  12292. e.attachToPanoRenderer(this.panoRenderer), e.tileDownloader = this.tileDownloader, e.qualityManager = this.qualityManager
  12293. }.bind(this)), this.emit(a.ActiveModelChanged, {
  12294. oldModel: i,
  12295. model: t
  12296. })
  12297. }, n.prototype.getActiveModel = function () {
  12298. return this.activeModel
  12299. }, r.extend(n, l), t.exports = n
  12300. }, {
  12301. "../enum/ModelManagerEvents": 33,
  12302. "../enum/PanoRendererEvents": 35,
  12303. "../exception/BasicException": 55,
  12304. "../util/common": 185,
  12305. events: 202,
  12306. three: 217
  12307. }],
  12308. 141: [function (r, l, e) {
  12309. (function (e) {
  12310. "use strict";
  12311. function o() {
  12312. n.call(this)
  12313. }
  12314. var a = r("../objects/Room"),
  12315. t = (r("../settings"), r("../util/logger")),
  12316. i = (r("../util/transitions"), r("../util/easing"), r("../util/common")),
  12317. n = r("../util/IndexedCollection"),
  12318. s = r("./Chunks");
  12319. new t(e), i.inherit(o, n), o.prototype.getIndex = function (e) {
  12320. return e.roomId
  12321. }, o.prototype.calcRoomBoundaries = function () {
  12322. this.forEach(function (e) {
  12323. e.calcBoundaries()
  12324. })
  12325. }, o.prototype.createFromChunks = function (e) {
  12326. var n = {
  12327. floorId: -1,
  12328. roomId: -1
  12329. },
  12330. r = {};
  12331. e.forEach(function (e) {
  12332. s.parseIdsFromChunkName(e.name, n);
  12333. var t = r[n.roomId];
  12334. if (!t) {
  12335. var i = o.generateRoomId(n.floorId, n.roomId);
  12336. t = new a(n.floorId, i), this.add(t), r[n.roomId] = t
  12337. }
  12338. t.addChunk(e)
  12339. }.bind(this)), this.calcRoomBoundaries()
  12340. }, o.generateRoomId = function (e, t) {
  12341. return e + "_" + t
  12342. }, l.exports = o
  12343. }).call(this, "/js/model/RoomCollection.js")
  12344. }, {
  12345. "../objects/Room": 150,
  12346. "../settings": 166,
  12347. "../util/IndexedCollection": 175,
  12348. "../util/common": 185,
  12349. "../util/easing": 186,
  12350. "../util/logger": 189,
  12351. "../util/transitions": 195,
  12352. "./Chunks": 135
  12353. }],
  12354. 142: [function (e, t, i) {
  12355. "use strict";
  12356. function n(e, t, i) {
  12357. var n = (e = e.clone()).size(),
  12358. r = new o.BoxGeometry(n.x, n.y, n.z);
  12359. r.boundingBox = e, o.Mesh.call(this, r, t), this.position.copy(e.center()), this.frustumCulled = !1, i && this.add(new o.WireframeHelper(this))
  12360. }
  12361. var o = e("three");
  12362. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n, t.exports = n
  12363. }, {
  12364. three: 217
  12365. }],
  12366. 143: [function (l, c, e) {
  12367. (function (e) {
  12368. "use strict";
  12369. function t(e) {
  12370. s.time("Computing a nice bounding cubemap");
  12371. var t = new r({
  12372. side: i.BackSide,
  12373. transparent: !0
  12374. });
  12375. t.uniforms.modelAlpha.value = 0, t.uniforms.opacity.value = 1 - o.modelAlpha, this.renderOrder = a.boundingSkybox, n.call(this, e, t), s.timeEnd("Computing a nice bounding cubemap")
  12376. }
  12377. var i = l("three"),
  12378. n = (l("../enum/Viewmode"), l("../shaders"), l("./BoundingMesh")),
  12379. r = l("../materials/ModelTextureMaterial"),
  12380. o = l("../settings"),
  12381. a = l("../enum/RenderOrder"),
  12382. s = new(l("../util/logger"))(e);
  12383. (t.prototype = Object.create(n.prototype)).constructor = t, c.exports = t
  12384. }).call(this, "/js/objects/BoundingTextureSkybox.js")
  12385. }, {
  12386. "../enum/RenderOrder": 42,
  12387. "../enum/Viewmode": 51,
  12388. "../materials/ModelTextureMaterial": 118,
  12389. "../settings": 166,
  12390. "../shaders": 167,
  12391. "../util/logger": 189,
  12392. "./BoundingMesh": 142,
  12393. three: 217
  12394. }],
  12395. 144: [function (e, t, i) {
  12396. "use strict";
  12397. function n(e) {
  12398. this.materialInside = new s({
  12399. side: r.DoubleSide
  12400. });
  12401. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  12402. this.materialOutside = new r.RawShaderMaterial({
  12403. fragmentShader: o.modelOutside.fragmentShader,
  12404. vertexShader: o.modelOutside.vertexShader,
  12405. uniforms: t,
  12406. side: r.FrontSide,
  12407. name: "chunkOut"
  12408. }), r.Mesh.call(this, e.geometry, this.materialInside), this.name = e.name || "", this.textureName = e.textureName, this.meshUrl = e.meshUrl
  12409. }
  12410. var r = e("three"),
  12411. o = e("../shaders"),
  12412. a = e("../enum/Viewmode"),
  12413. s = e("../materials/ModelTextureMaterial");
  12414. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function (e) {
  12415. this.materialInside.uniforms.map.value = e, this.materialOutside.uniforms.map.value = e
  12416. }, n.prototype.setMode = function (e) {
  12417. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  12418. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide, t.transparent = this.material.transparent, t.uniforms.opacity.value = this.material.uniforms.opacity.value, this.material = t
  12419. }, t.exports = n
  12420. }, {
  12421. "../enum/Viewmode": 51,
  12422. "../materials/ModelTextureMaterial": 118,
  12423. "../shaders": 167,
  12424. three: 217
  12425. }],
  12426. 145: [function (e, t, i) {
  12427. "use strict";
  12428. function n(e) {
  12429. this.chunksize = e || 10, this.chunks = {}, this.boundingBoxes = {}, this.children = [], this.offset = new m.Vector3(0, .5, 0), this.material = new m.MeshBasicMaterial({
  12430. color: 16777215 * Math.random(),
  12431. side: m.DoubleSide
  12432. })
  12433. }
  12434. var m = e("three");
  12435. e("../enum/Viewmode"), n.prototype.add = function (e) {
  12436. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  12437. u ? (t = u.position.array, i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices, e.faces);
  12438. var d = new m.Vector3;
  12439. if (i)
  12440. for (n = 0, r = i.length; n < r; n += 3) {
  12441. var p = 3 * i[n],
  12442. f = 3 * i[n + 1],
  12443. g = 3 * i[n + 2];
  12444. o = (t[p] + t[f] + t[g]) / 3, a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3, s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3, c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize)) in this.chunks ? (h = this.chunks[l], this.boundingBoxes[l]) : (h = this.chunks[l] = [], this.boundingBoxes[l] = new m.Box3), h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]), c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])), c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])), c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  12445. } else
  12446. for (n = 0, r = t.length; n < r; n += 9) o = (t[n] + t[n + 3] + t[n + 6]) / 3, a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3, s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3, c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize)) in this.chunks ? (h = this.chunks[l], this.boundingBoxes[l]) : (h = this.chunks[l] = [], this.boundingBoxes[l] = new m.Box3), h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]), c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])), c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])), c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  12447. }, n.prototype.build = function () {
  12448. var e = new m.Object3D;
  12449. for (var t in e.material = this.material, this.chunks) {
  12450. var i = this.chunks[t],
  12451. n = new m.BufferGeometry;
  12452. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i), 3)), n.boundingBox = this.boundingBoxes[t];
  12453. var r = new m.Mesh(n, this.material);
  12454. r.material.visible = !1, e.add(r), this.chunks[t] = []
  12455. }
  12456. return e
  12457. }, t.exports = n
  12458. }, {
  12459. "../enum/Viewmode": 51,
  12460. three: 217
  12461. }],
  12462. 146: [function (e, t, i) {
  12463. "use strict";
  12464. var n = e("three"),
  12465. r = e("../settings"),
  12466. o = e("../util/common"),
  12467. a = e("../util/lerp"),
  12468. s = e("./ChunkedCollider"),
  12469. l = e("../util/transitions"),
  12470. c = e("../util/easing"),
  12471. h = (e("../objects/Panorama"), e("../enum/RenderOrder"));
  12472. e("../localization/localize");
  12473. function u(e, t, i) {
  12474. n.Object3D.call(this), this.model = e, this.floorIndex = t, this.lang = r.languageTag, this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层", this.panos = [], this.chunks = [], this.colliderBuilder = new s(3), this.collider = null, this.center = null, this.boundingBox = new n.Box3, this.size = null, this.hidden = !1, this.conservativeBoundingBox = new n.Box3, this.debugColor = 16777215 * Math.random(), this.transition = null
  12475. }(u.prototype = Object.create(n.Object3D.prototype)).enter = function (e) {
  12476. this.model.setFloor(this, e)
  12477. }, u.prototype.hide = function (e) {
  12478. if (!this.hidden || this.transition) {
  12479. this.chunks.forEach(function (e) {
  12480. e.material.transparent = !0
  12481. }), l.cancel(this.transition);
  12482. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay,
  12483. i = e ? 0 : r.hideFloorDelay / t;
  12484. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function () {
  12485. this.hidden = !0
  12486. }.bind(this), i, c.easeInOutQuad)
  12487. }
  12488. }, u.prototype.show = function (e) {
  12489. if (this.hidden || this.transition) {
  12490. this.hidden = !1, l.cancel(this.transition);
  12491. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay,
  12492. i = e ? 0 : r.showFloorDelay / t;
  12493. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function () {
  12494. this.hidden || this.chunks.forEach(function (e) {
  12495. e.material.transparent = !1
  12496. })
  12497. }.bind(this), i, c.easeInOutQuad)
  12498. }
  12499. }, u.prototype.toggle = function (e, t) {
  12500. (e = void 0 === e ? this.hidden : e) ? this.show(t): this.hide(t)
  12501. }, u.prototype.containsPoint = function (t) {
  12502. return this.collider.children.some(function (e) {
  12503. return e.geometry.boundingBox || e.geometry.computeBoundingBox(), e.geometry.boundingBox.containsPoint(t)
  12504. })
  12505. }, u.prototype.distanceToPoint = function (i) {
  12506. var n = null,
  12507. r = 1 / 0;
  12508. return this.collider.children.forEach(function (e) {
  12509. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  12510. var t = e.geometry.boundingBox.distanceToPoint(i);
  12511. (!n || t < r) && (r = t, n = e)
  12512. }), r
  12513. }, u.prototype.addChunk = function (e) {
  12514. e.renderOrder = h.ghostFloor, this.add(e), this.chunks.push(e), this.boundingBox.union(e.geometry.boundingBox), this.size = this.boundingBox.size(), this.colliderBuilder.add(e.geometry)
  12515. }, u.prototype.addPano = function (e) {
  12516. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker);
  12517. var t = new n.Vector3(1, 1, 1),
  12518. i = (new n.Box3).setFromCenterAndSize(e.position, t);
  12519. this.boundingBox.union(i)
  12520. }, u.prototype.build = function () {
  12521. this.collider = this.colliderBuilder.build(!0), this.add(this.collider), this.center = this.boundingBox.center(), this.conservativeBoundingBox.copy(this.boundingBox), this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function (e) {
  12522. return e.geometry.boundingBox.min.y
  12523. }), 5), this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function (e) {
  12524. return e.geometry.boundingBox.max.y
  12525. }), 5), this.colliderBuilder = null
  12526. }, u.prototype.toShortString = function () {
  12527. return o.nth(this.floorIndex + 1)
  12528. }, u.prototype.toString = function () {
  12529. return this.name
  12530. }, t.exports = u
  12531. }, {
  12532. "../enum/RenderOrder": 42,
  12533. "../localization/localize": 108,
  12534. "./strings-cn-CN": 109,
  12535. "../objects/Panorama": 148,
  12536. "../settings": 166,
  12537. "../util/common": 185,
  12538. "../util/easing": 186,
  12539. "../util/lerp": 188,
  12540. "../util/transitions": 195,
  12541. "./ChunkedCollider": 145,
  12542. three: 217
  12543. }],
  12544. 147: [function (e, t, i) {
  12545. "use strict";
  12546. function n(e) {
  12547. this.player = e, this.obj3d = null, this.UP = new u.Vector3(0, 1, 0)
  12548. }
  12549. var u = e("three"),
  12550. d = e("../settings");
  12551. n.prototype.prefs = {
  12552. linewidth: 3,
  12553. height: .07,
  12554. opacity: .45,
  12555. endScale: .05
  12556. }, n.prototype.discard = function () {
  12557. if (this.obj3d) {
  12558. var e = this.obj3d.parent;
  12559. e && e.remove(this.obj3d)
  12560. }
  12561. this.obj3d = null
  12562. }, n.prototype.draw = function () {
  12563. if (this.discard(), d.showNeighbors) {
  12564. var e = this.player.currentPano.floor;
  12565. this.obj3d = new u.Object3D;
  12566. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  12567. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  12568. i.y += this.prefs.height;
  12569. var n = .1525,
  12570. r = new u.Matrix4;
  12571. for (var o in t)
  12572. if (t[o]) {
  12573. var a = this.player.model.panos.get(o),
  12574. s = (a.position.clone().sub(this.player.model.position), a.position.clone().sub(a.floorPosition)),
  12575. l = a.floorPosition.clone().sub(this.player.model.position);
  12576. l.y += this.prefs.height;
  12577. var c = new u.Geometry;
  12578. c.vertices.push(new u.Vector3(0, -.0127, 0), new u.Vector3(-.0127, 0, 0), new u.Vector3(0, .0127, 0), new u.Vector3(.0127, 0, 0), new u.Vector3(0, -.0127, 0)), c.vertices.push(new u.Vector3(0, -.255, 0), new u.Vector3(.255, -.255, 0), new u.Vector3(.255, n, 0), new u.Vector3(-n, n, 0), new u.Vector3(-n, .127, 0), new u.Vector3(-.19, .1, 0), new u.Vector3(-.19, -.2032, 0), new u.Vector3(-n, -.2286, 0), new u.Vector3(-n, -.255, 0), new u.Vector3(0, -.255, 0)), r.identity().setPosition(s), c.applyMatrix(r), c.vertices.push(new u.Vector3(0, -this.prefs.endScale, 0)), c.vertices.push(new u.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0), new u.Vector3(-this.prefs.endScale, this.prefs.endScale, 0), new u.Vector3(this.prefs.endScale, this.prefs.endScale, 0), new u.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)), r.lookAt(l, i, this.UP).setPosition(l), c.applyMatrix(r), c.vertices.push(l, i);
  12579. var h = new u.Line(c, new u.LineBasicMaterial({
  12580. color: a.debugColor.getHex(),
  12581. transparent: !0,
  12582. opacity: this.prefs.opacity,
  12583. depthWrite: !1,
  12584. name: "sLine" + o,
  12585. linewidth: this.prefs.linewidth
  12586. }));
  12587. this.obj3d.add(h)
  12588. } e.add(this.obj3d)
  12589. }
  12590. }, n.prototype.update = function () {
  12591. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  12592. }, t.exports = n
  12593. }, {
  12594. "../settings": 166,
  12595. three: 217
  12596. }],
  12597. 148: [function (S, M, e) {
  12598. (function (e) {
  12599. "use strict";
  12600. function r(e, t, i, n) {
  12601. this.model = e, this.id = t, this.alignmentType = i.alignmentType || c.ALIGNED, this.neighbourUUIDs = i.neighbours || null, this.neighbourPanos = null, this.floor = null, this.floorIndex = i.floor, this.failedLoadingAt = 0, this.maxLoadRetries = 4, this.origin = i.position.clone(), this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0, -5, 0) : i.position.clone(), this.quaternion = i.quaternion.clone(), this.skyboxMesh = new s.Mesh(E), this.skyboxMesh.position.copy(this.position), this.skyboxMesh.quaternion.copy(this.quaternion), this.skyboxMesh.name = "skybox", this.skyboxMesh.visible = !1, this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.marker = null, this.showFloorMarker = this.showFloorMarker = void 0 === window.MP_PREFETCHED_MODELDATA.hideFloorMarker || "false" === window.MP_PREFETCHED_MODELDATA.hideFloorMarker, this.isAligned() && (this.marker = new s.Mesh(_, new s.MeshBasicMaterial({
  12602. map: b,
  12603. side: s.DoubleSide,
  12604. opacity: 0,
  12605. transparent: !0,
  12606. depthWrite: !1,
  12607. visible: this.showFloorMarker
  12608. })), this.marker.renderOrder = l.panoMarker, this.marker.name = "marker", (this.marker.pano = this).marker.layers.set(v.PANOMARKERS), this.marker.updateMatrixWorld(), a.colorMarkerOnLoad && this.on("load", function () {
  12609. this.marker.material.color.set(65280)
  12610. })), this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()), this.floorPosition = i.puck ? i.puck.clone() : null, this.tiled = n, this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]), this.solidSkybox.flipY = !1, a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter, this.solidSkybox.magFilter = s.LinearFilter, this.solidSkybox.generateMipmaps = !1)), this.zoomed = !1, this.panoRenderer = null, this.qualityManager = null, this.tileDownloader = null, this.tiledPanoRenderTarget = null, this.minimumTiledPanoLoaded = !1, this.highestPartialTileRenderOpCompleted = 0, this.highestFullTileRenderOpCompleted = 0, this.shouldRedrawOnBaseLoaded = !1, this.lockUntilRenderingComplete = !1, a.colorMarkerOnLoad && this.on("load", function () {
  12611. this.marker.material.color.set(65280)
  12612. }), (e = new s.TextureLoader).setCrossOrigin(!0);
  12613. var r = e.load("images/texture.jpg");
  12614. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1, 0), new s.MeshLambertMaterial({
  12615. color: 16777215,
  12616. transparent: !0,
  12617. opacity: .75,
  12618. map: r
  12619. })), this.vrMarker.boluoType = "vr", this.vrMarker.position.z = 1, this.vrMarker.enabled = !0, this.vrMarker.visible = !1, window.vrMarkers = window.vrMarkers || [], window.vrMarkers.push(this.vrMarker), this.marker && this.marker.add(this.vrMarker), a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0, 1, 0), new s.Vector3(0, 0, 0), 1, 255)), this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0, 0, 1), new s.Vector3(0, 0, 0), 1, 16711680)), this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1, 0, 0), new s.Vector3(0, 0, 0), 1, 65280))), this.adjustAngleEnable) {
  12620. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(i);
  12621. var o = new s.Quaternion;
  12622. o.setFromAxisAngle(new s.Vector3(0, 1, 0), this.adjustAngleY), this.skyboxMesh.quaternion.multiply(o), (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0, 0, 1), this.adjustAngleZ), this.skyboxMesh.quaternion.multiply(n), this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos()
  12623. }
  12624. }
  12625. var i, t, s = S("three"),
  12626. n = S("../util/logger"),
  12627. a = S("../settings"),
  12628. l = (S("../enum/Viewmode"), S("../enum/RenderOrder")),
  12629. c = S("../enum/AlignmentType"),
  12630. o = (S("../util/common"), S("../util/transitions")),
  12631. h = S("../util/lerp"),
  12632. u = S("../util/ajax"),
  12633. d = S("../util/texture"),
  12634. p = S("../util/panorama"),
  12635. f = (S("../enum/TileDownloaderEvents"), S("../enum/PanoramaEvents")),
  12636. g = S("../enum/PanoRendererEvents"),
  12637. m = S("../enum/PanoSizeClass"),
  12638. v = S("../enum/RenderLayers"),
  12639. y = (S("../scene/SceneRenderer"), S("../enum/GLCubeFaces"), S("../exception/BasicException")),
  12640. A = S("../tile/TileUtils"),
  12641. C = S("events").EventEmitter,
  12642. I = new n(e),
  12643. E = new s.SphereBufferGeometry(.1),
  12644. _ = new s.PlaneBufferGeometry(.4, .4, 1, 1),
  12645. b = d.load("images/marker-256x256.png");
  12646. (r.prototype = Object.create(C.prototype)).enter = (t = null, function () {
  12647. this.setZoomed(!1), this.emit("enter", {
  12648. oldPano: t,
  12649. newPano: this
  12650. }), t = this
  12651. }), r.prototype.exit = function () {
  12652. this.tiled ? (this.clearWaitDeferreds(), this.minimumTiledPanoLoaded = !1, this.tiledPanoRenderTarget = null, this.setZoomed(!1), this.panoRenderer.deactivateTiledPano(this), this.highestPartialTileRenderOpCompleted = 0, this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(), this.solidSkybox.loaded = !1, this.solidSkybox.version = 0), this.emit("exit")
  12653. }, r.prototype.hoverOn = function (e) {
  12654. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250), a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  12655. }, r.prototype.hoverOff = function (e) {
  12656. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  12657. }, r.prototype.build1 = function () {
  12658. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position), this.floor.addPano(this), this.floorPosition = this.floorPosition || this.raycastFloorPosition(), this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(), a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  12659. }, r.prototype.build2 = function () {
  12660. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(), this.height = this.position.distanceTo(this.floorPosition), this.placeMarker()
  12661. }, r.prototype.interpolateFloorPosition = function () {
  12662. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function (e) {
  12663. return !!e.floorPosition
  12664. }).sort(function (e, t) {
  12665. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  12666. }.bind(this)),
  12667. t = this.position.clone();
  12668. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset), t
  12669. }, r.prototype.raycastFloorPosition = function () {
  12670. I.warn("Performance warning: Raycasting to find floor position");
  12671. var e = new s.Raycaster(this.position, new s.Vector3(0, -1, 0)).intersectObjects(this.model.colliders);
  12672. return e.length ? e[0].point : null
  12673. }, r.prototype.raycastToFindFloor = (i = [new s.Vector3(0, -1, 0), new s.Vector3(1, -1, 0), new s.Vector3(0, -1, 1), new s.Vector3(-1, -1, 0), new s.Vector3(0, -1, -1), new s.Vector3(1, 0, 0), new s.Vector3(0, 0, 1), new s.Vector3(-1, 0, 0), new s.Vector3(0, 0, -1)], function () {
  12674. I.warn("Performance warning: Raycasting to find floor index");
  12675. for (var e = 0; e < i.length; e++) {
  12676. var t = new s.Raycaster(this.position.clone(), i[e].clone()).intersectObjects(this.model.colliders);
  12677. if (t.length) return t[0].object.parent.parent
  12678. }
  12679. return null
  12680. }), r.prototype.placeMarker = function () {
  12681. this.marker && (this.marker.position.copy(this.floorPosition), this.marker.position.y += .05, this.marker.lookAt(new s.Vector3(0, 1, 0).add(this.marker.position)))
  12682. }, r.prototype.translate = function (e) {
  12683. this.position.add(e), this.floorPosition.add(e)
  12684. }, r.prototype.findClosestMidtpointPanoTo = function (e) {
  12685. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2), this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  12686. }, r.prototype.attachToPanoRenderer = function (e) {
  12687. this.panoRenderer = e, this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)), this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)), this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)), this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  12688. };
  12689. var w, T, x = {};
  12690. r.prototype.getWaitDeferred = function (e) {
  12691. var t = x[this.id];
  12692. t || (t = {}, x[this.id] = t);
  12693. var i = t[e];
  12694. return i || (i = {
  12695. deferred: $.Deferred(),
  12696. active: !1
  12697. }, t[e] = i), i
  12698. }, r.prototype.resetWaitDeferred = function (e) {
  12699. var t = this.getWaitDeferred(e);
  12700. t.active = !1, t.deferred = $.Deferred()
  12701. }, r.prototype.clearWaitDeferreds = function () {
  12702. var e = x[this.id];
  12703. for (var t in e || (e = {}, x[this.id] = e), e)
  12704. if (e.hasOwnProperty(t)) {
  12705. var i = e[t];
  12706. i.active = !1, i.deferred = $.Deferred()
  12707. }
  12708. }, r.prototype.loadTiledPano = (new s.Vector3, w = [], T = [], function (e, t, i, n, r, o) {
  12709. null != n || (n = !0), null != r || (r = !0);
  12710. var a = this.getWaitDeferred(e),
  12711. s = a.deferred,
  12712. l = null,
  12713. c = null;
  12714. if (i && ("number" == typeof i ? l = i : (l = i.hFov, c = i.vFov)), !this.isLoaded(e)) {
  12715. if (!a.active) {
  12716. if (a.active = !0, i) {
  12717. var h = A.matchingTilesInDirection(this, e, t, l, c);
  12718. w[this.id + ":" + e] = {
  12719. tileCount: 0,
  12720. targetTileCount: h
  12721. }, I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  12722. }
  12723. T[this.id] || (T[this.id] = !0, this.on(f.LoadComplete, function (e, t) {
  12724. var i = this.getWaitDeferred(e).deferred;
  12725. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t), this.resetWaitDeferred(e))
  12726. }.bind(this)), this.on(f.LoadFailed, function (e) {
  12727. var t = this.getWaitDeferred(e).deferred;
  12728. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e), this.resetWaitDeferred(e))
  12729. }.bind(this)), this.on(f.TileLoaded, function (e, t, i) {
  12730. var n = this.getWaitDeferred(e).deferred;
  12731. if (n && "pending" === n.state()) {
  12732. n.notify(e, t, i);
  12733. var r = w[this.id + ":" + e];
  12734. r && (r.tileCount++, r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0), n.resolve(e, i), this.resetWaitDeferred(e)))
  12735. }
  12736. }.bind(this)))
  12737. }
  12738. this.tileDownloader.clearForceQueue(), this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o), this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n), this.panoRenderer.renderPanoTiles(this.id, t, r)
  12739. }
  12740. return s.promise()
  12741. }), r.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  12742. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1, this.panoRenderer.resetRenderStatus(this.id, !0, !1), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  12743. }, r.prototype.onTileRendered = function (e, t, i, n) {
  12744. e === this.id && this.emit(f.TileLoaded, t, i, n)
  12745. }, r.prototype.onPanoRendered = function (e, t, i, n) {
  12746. e === this.id && (this.minimumTiledPanoLoaded = !0, this.updateSkyboxForZoomLevel(), t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t), !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t), this.emit("load", t), this.model.emit("load", this), this.emit(f.LoadComplete, t, i))
  12747. }, r.prototype.setZoomed = function (e) {
  12748. this.zoomed = e, this.updateSkyboxForZoomLevel()
  12749. }, r.prototype.ensureSkyboxReadyForRender = function () {
  12750. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), this.solidSkybox.loaded = !0)
  12751. }, r.prototype.updateSkyboxForZoomLevel = function () {
  12752. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  12753. }, r.prototype.getSkyboxTexture = function () {
  12754. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  12755. }, r.prototype.onTileRenderFail = function (e, t, i) {
  12756. e === this.id && this.emit(f.LoadFailed, t)
  12757. }, r.prototype.isLoaded = function (e) {
  12758. if (this.tiled) {
  12759. if (e && "string" == typeof e) throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  12760. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  12761. }
  12762. if (e && "number" == typeof e) throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  12763. return !!this.solidSkybox.high || e in this.solidSkybox
  12764. }, r.prototype.loadCube = function (a) {
  12765. if (this.isLoaded(a)) return I.info("Skipping load of pano, already loaded"), $.when();
  12766. this.emit("loading", a), this.model.emit("loading", this);
  12767. var n = p.getCubemapUrls(this.model.urls, this.id, a),
  12768. e = n.filter(function (e) {
  12769. return !e
  12770. });
  12771. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"), a = "high", n = p.getCubemapUrls(this.model.urls, this.id, a));
  12772. var t = 0,
  12773. i = [0, 1, 2, 3, 4, 5].map(function (e, t, i) {
  12774. return u.getImage(n[t])
  12775. }.bind(this));
  12776. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function (e, t, i, n, r, o) {
  12777. return this.solidSkybox[a] = [e, t, i, n, r, o], "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a], this.solidSkybox.low = null), this.solidSkybox.needsUpdate = !0, this.emit("load", a), this.model.emit("load", this), this
  12778. }.bind(this), function () {
  12779. I.error("Downloading cubemap for pano", this.id, "failed"), this.failedLoadingAt = Date.now()
  12780. }.bind(this), function () {
  12781. return $.when(++t, 6)
  12782. })
  12783. }, r.raycastsSkipped = 0, r.raycastsDone = 0, r.prototype.findNeighourPanos = function () {
  12784. return this.model.panos.setNeighbour(this.id, this.id, !1), this.model.panos.forEach(function (e) {
  12785. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  12786. var t = this.position.distanceTo(e.position);
  12787. if (t > a.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, e, !1), void r.raycastsSkipped++;
  12788. var i = e.position.clone().sub(this.position).normalize(),
  12789. n = new s.Raycaster(this.position, i.clone(), 0, t).intersectObjects(this.model.colliders);
  12790. r.raycastsDone++, this.model.panos.setNeighbour(this, e, 0 === n.length), a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i, this.position, n[0].distance, 16711680)) : this.floor.model.add(new s.ArrowHelper(i, this.position, t, 16777215, 0, 0)))
  12791. }
  12792. }.bind(this)), this.model.panos.neighbourMap[this.id]
  12793. }, r.prototype.worldPosition = function () {
  12794. return this.position
  12795. }, r.prototype.addTextSprite = function (e, t) {
  12796. this.removeTextSprite();
  12797. var i = document.createElement("canvas"),
  12798. n = i.getContext("2d");
  12799. i.width = 256, i.height = 256;
  12800. n.font = "bold 60px Arial", n.fillStyle = "white";
  12801. var r = n.measureText(e).width;
  12802. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  12803. var o = new s.Texture(i);
  12804. o.needsUpdate = !0;
  12805. var a = new s.SpriteMaterial({
  12806. map: o,
  12807. color: t || 16428055
  12808. });
  12809. this.text3d = new s.Sprite(a), this.text3d.position.copy(this.skyboxMesh.position), this.floor.add(this.text3d)
  12810. }, r.prototype.removeTextSprite = function () {
  12811. this.text3d && (this.floor.remove(this.text3d), this.text3d = null)
  12812. }, r.prototype.isAligned = function () {
  12813. return this.alignmentType === c.ALIGNED
  12814. }, r.filters = {
  12815. inDirection: function (t, i, n) {
  12816. return function (e) {
  12817. return e.position.clone().sub(t).normalize().dot(i) > n
  12818. }
  12819. },
  12820. inFloorDirection: function (t, i, n) {
  12821. return function (e) {
  12822. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  12823. }
  12824. },
  12825. inPanoDirection: function (n, r, o) {
  12826. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  12827. function (e) {
  12828. var t = e.floorPosition.clone().sub(n).normalize(),
  12829. i = e.position.clone().sub(n).normalize();
  12830. return t.dot(r) > o || i.dot(r) > o
  12831. }
  12832. },
  12833. atFloor: function (t) {
  12834. return function (e) {
  12835. return !t || e.floor === t
  12836. }
  12837. },
  12838. not: function (t) {
  12839. return function (e) {
  12840. return e !== t
  12841. }
  12842. },
  12843. notIn: function (t) {
  12844. return function (e) {
  12845. return -1 === t.indexOf(e)
  12846. }
  12847. },
  12848. isLoaded: function () {
  12849. return function (e) {
  12850. return e.isLoaded()
  12851. }
  12852. },
  12853. isNotLoaded: function () {
  12854. return function (e) {
  12855. return !e.isLoaded()
  12856. }
  12857. },
  12858. isCloseEnoughTo: function (t, i) {
  12859. return function (e) {
  12860. return t.distanceTo(e.floorPosition) < i
  12861. }
  12862. },
  12863. hasMinimumHeightDifferenceTo: function (t, i) {
  12864. return function (e) {
  12865. return Math.abs(e.position.y - t.y) > i
  12866. }
  12867. },
  12868. isNotBehindNormal: function (t, i) {
  12869. var n = new s.Vector3;
  12870. return i = i.clone(),
  12871. function (e) {
  12872. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  12873. }
  12874. },
  12875. isNeighbourPanoTo: function (t) {
  12876. return function (e) {
  12877. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  12878. }
  12879. },
  12880. isNeighbourOfNeighbourTo: function (n) {
  12881. return function (i) {
  12882. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function (e) {
  12883. var t = n.model.panos.get(e);
  12884. return !!t && t.neighbourPanos[i.id]
  12885. })
  12886. }
  12887. },
  12888. isNotRecentlyFailed: function (t) {
  12889. return function (e) {
  12890. return Date.now() - e.failedLoadingAt > t
  12891. }
  12892. },
  12893. isOnVisibleFloor: function () {
  12894. return function (e) {
  12895. return !e.floor.hidden
  12896. }
  12897. },
  12898. isPanoAligned: function () {
  12899. return function (e) {
  12900. return e.isAligned()
  12901. }
  12902. }
  12903. }, r.sortFunctions = {
  12904. distanceToPoint: function (i) {
  12905. return function (e, t) {
  12906. return e.position.distanceTo(i) - t.position.distanceTo(i)
  12907. }
  12908. },
  12909. floorDistanceToPoint: function (i) {
  12910. return function (e, t) {
  12911. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  12912. }
  12913. },
  12914. choose: function (i) {
  12915. return function (e, t) {
  12916. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  12917. }
  12918. }
  12919. }, r.scoreFunctions = {
  12920. distance: function (t, i) {
  12921. return i = i || a.navigation.distanceFactor,
  12922. function (e) {
  12923. return t ? t.position.distanceTo(e.position) * i : 0
  12924. }
  12925. },
  12926. distanceSquared: function (t, i) {
  12927. return i = i || a.navigation.distanceFactor,
  12928. function (e) {
  12929. return t ? t.position.distanceToSquared(e.position) * i : 0
  12930. }
  12931. },
  12932. direction: function (t, i) {
  12933. return function (e) {
  12934. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  12935. }
  12936. },
  12937. angle: function (t, i) {
  12938. return function (e) {
  12939. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  12940. }
  12941. },
  12942. inFieldOfView: function (t, i) {
  12943. return function (e) {
  12944. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  12945. }
  12946. },
  12947. optionality: function (t) {
  12948. return function (e) {
  12949. return e.neighbourUUIDs.filter(function (e) {
  12950. return !(e in t.neighbourUUIDs) && e !== t.id
  12951. }).length * a.navigation.optionalityFactor
  12952. }
  12953. },
  12954. penalizeHeightDifferenceUnder: function (t, i) {
  12955. return function (e) {
  12956. return t.y - e.position.y < i ? -20 : 0
  12957. }
  12958. }
  12959. }, M.exports = r
  12960. }).call(this, "/js/objects/Panorama.js")
  12961. }, {
  12962. "../enum/AlignmentType": 17,
  12963. "../enum/GLCubeFaces": 25,
  12964. "../enum/PanoRendererEvents": 35,
  12965. "../enum/PanoSizeClass": 36,
  12966. "../enum/PanoramaEvents": 37,
  12967. "../enum/RenderLayers": 41,
  12968. "../enum/RenderOrder": 42,
  12969. "../enum/TileDownloaderEvents": 45,
  12970. "../enum/Viewmode": 51,
  12971. "../exception/BasicException": 55,
  12972. "../scene/SceneRenderer": 158,
  12973. "../settings": 166,
  12974. "../tile/TileUtils": 174,
  12975. "../util/ajax": 181,
  12976. "../util/common": 185,
  12977. "../util/lerp": 188,
  12978. "../util/logger": 189,
  12979. "../util/panorama": 191,
  12980. "../util/texture": 194,
  12981. "../util/transitions": 195,
  12982. events: 202,
  12983. three: 217
  12984. }],
  12985. 149: [function (e, t, i) {
  12986. "use strict";
  12987. function n(e) {
  12988. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  12989. t.map.value = d, t.opacity.value = 0, t.color.value.set(o.reticuleColor), t.showMouseMarker = void 0 === window.MP_PREFETCHED_MODELDATA.hideMouseMarker || "false" === window.MP_PREFETCHED_MODELDATA.hideMouseMarker, r.Mesh.call(this, new r.PlaneBufferGeometry(.4, .4, 1, 1), new r.RawShaderMaterial({
  12990. side: r.DoubleSide,
  12991. depthWrite: !1,
  12992. depthTest: !1,
  12993. transparent: !0,
  12994. vertexShader: c.waypoint.vertexShader,
  12995. fragmentShader: c.waypoint.fragmentShader,
  12996. uniforms: t,
  12997. name: "waypoint",
  12998. opacity: 0,
  12999. visible: t.showMouseMarker
  13000. })), this.layers.set(h.RETICULE), this.renderOrder = u.reticule, this.player = e, this.direction = new r.Vector3, this.hidden = !0, this.mouseLastMoveTime = Date.now()
  13001. }
  13002. var r = e("three"),
  13003. o = e("../settings"),
  13004. a = e("../util/transitions"),
  13005. s = e("../util/texture"),
  13006. l = e("../util/lerp"),
  13007. c = e("../shaders"),
  13008. h = e("../enum/RenderLayers"),
  13009. u = e("../enum/RenderOrder"),
  13010. d = s.load("images/reticule-256x256.png");
  13011. (n.prototype = Object.create(r.Mesh.prototype)).move = function (e, t, i) {
  13012. this.hidden = i, this.mouseLastMoveTime = Date.now()
  13013. }, n.prototype.hide = function () {
  13014. this.hidden || (this.hidden = !0, a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  13015. }, n.prototype.show = function () {
  13016. this.hidden = !1, this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  13017. }, n.prototype.update = function () {
  13018. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  13019. }, n.prototype.updatePosition = function (e, t) {
  13020. if (!this.hidden) {
  13021. if (!t) return this.hide();
  13022. var i = t.point,
  13023. n = e.distanceTo(i),
  13024. r = 1 + .01 * n;
  13025. n < 1 && (r -= 1 - n), this.show(), this.scale.set(r, r, r), this.direction = this.direction.multiplyScalar(.8), this.direction.add(t.face.normal.clone().multiplyScalar(.2)), this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)), this.lookAt(this.position.clone().add(this.direction))
  13026. }
  13027. }, n.prototype.writeAstag = function () {
  13028. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16),
  13029. t = new Date;
  13030. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  13031. var i = {
  13032. enabled: !0,
  13033. version: "0",
  13034. created: t.toISOString(),
  13035. created_by: "APITest",
  13036. position: this.position.clone(),
  13037. stem: {
  13038. enabled: o.tags.pole.enabled,
  13039. direction: this.direction.multiplyScalar(o.tags.pole.height)
  13040. },
  13041. label: "tag " + this.tagCount,
  13042. description: "Description " + e,
  13043. floor: function (e) {
  13044. if (e.currentFloor) {
  13045. var t = e.floors.indexOf(e.currentFloor);
  13046. return -1 < t ? t : void 0
  13047. }
  13048. }(this.player.model),
  13049. type: "info",
  13050. metadata: {
  13051. preferred_camera: {
  13052. mode: this.player.mode
  13053. }
  13054. }
  13055. };
  13056. console.log("--------------------------"), console.log(JSON.stringify(i));
  13057. var n = this.player.model.addtag(e, i).build();
  13058. n && (n.disc && this.player.tagDiscs.push(n.disc), n.visible || n.show(o.tags.startup.fadeInDuration))
  13059. }, t.exports = n
  13060. }, {
  13061. "../enum/RenderLayers": 41,
  13062. "../enum/RenderOrder": 42,
  13063. "../settings": 166,
  13064. "../shaders": 167,
  13065. "../util/lerp": 188,
  13066. "../util/texture": 194,
  13067. "../util/transitions": 195,
  13068. three: 217
  13069. }],
  13070. 150: [function (e, t, i) {
  13071. "use strict";
  13072. function n(e, t) {
  13073. this.chunks = [], this.floorId = e, this.roomId = t, this.position = new l.Vector3
  13074. }
  13075. var l = e("three");
  13076. n.prototype.addChunk = function (e) {
  13077. this.chunks.push(e)
  13078. }, n.prototype.calcBoundaries = function () {
  13079. for (var e = new l.Vector3, t = new l.Vector3(0, 0, 0), i = new l.Vector3(0, 0, 0), n = new l.Vector3(0, 0, 0), r = 0, o = 0; o < this.chunks.length; o++) {
  13080. var a = this.chunks[o].geometry.attributes.position;
  13081. if (a)
  13082. for (var s = 0; s < a.array.length; s += 3) e.set(a.array[s], a.array[s + 1], a.array[s + 2]), t.add(e), 0 === s ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)), r++
  13083. }
  13084. 0 < r ? (t.multiplyScalar(1 / r), this.average = t) : this.average = null, this.boundsMax = i, this.boundsMin = n, this.center = new l.Vector3, this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  13085. }, t.exports = n
  13086. }, {
  13087. three: 217
  13088. }],
  13089. 151: [function (o, v, e) {
  13090. (function (e) {
  13091. "use strict";
  13092. function t(e, t, i) {
  13093. this.obj3d = null, this.nodes = [], this.colorHull = [], this.shortPaths = {}, this.floorHull = null, this.cameraHull = null, this.floorPathDistance = 0, this.floorCurvePoints = null, this.floorCurveColors = null, this.camCurvePoints = null, this.warpDestHeroLoc = null, this.warpDestPano = null, this.warpPathPoints = null, this.warpPathLengths = [0], this.warpLength = 0, this.closeWarpDistance = 4, this.UP = U.UP.clone(), this.longestStep = 0, this.upcomingTransType = null, this.burnsDir = 1, this.prevNextDist = 0, this.nextI = 0, this.activeTransType = null, this.lastTransType = null, this.bunnyObj = null, this.director = e, this.player = t, this.playerControls = i, this.modelManager = t.modelManager, this.updateModel(), this.updateDefaultsFromModelData(), this.bindEvents(), this.warping = !1, this.waitingToWarp = !1, this.warpInterrupted = !1, this.warpInterruptionBlackoutStyle = null, this.warpInterruptionTravelTime = null
  13094. }
  13095. var c, h, u, d, p, f, a, s, P = o("three"),
  13096. i = o("../util/logger"),
  13097. O = o("../enum/Viewmode"),
  13098. A = o("../enum/RenderOrder"),
  13099. L = o("../enum/WarpStyle"),
  13100. D = o("../settings"),
  13101. N = o("../util/math"),
  13102. F = o("../util/lerp"),
  13103. B = o("../util/easing"),
  13104. V = o("../util/transitions"),
  13105. l = o("../objects/Snapshot"),
  13106. k = o("../effects"),
  13107. C = o("../shaders"),
  13108. n = (o("../gui/gui"), o("../util/texture")),
  13109. U = o("../enum/Vectors"),
  13110. H = (o("../model/ModelManager"), new i(e)),
  13111. g = o("../enum/PlayerEvents"),
  13112. z = o("../enum/BlackoutStyle"),
  13113. r = o("../enum/ModelManagerEvents"),
  13114. m = o("../constants"),
  13115. I = {
  13116. path: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  13117. pathEnd: n.load("images/End.png"),
  13118. pathStart: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  13119. };
  13120. t.prototype.setScene = function (e) {
  13121. this.createCpm(e), this.createBunnyObj(e)
  13122. }, t.prototype.updateModel = function () {
  13123. this.model = this.modelManager.getActiveModel()
  13124. }, t.prototype.bindEvents = function () {
  13125. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  13126. }, t.prototype.updateDefaultsFromModelData = function () {
  13127. this.model.data
  13128. }, t.prototype.pointPathDistance = function (e) {
  13129. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i]);
  13130. return t
  13131. }, t.prototype.pointPathLengths = function (e) {
  13132. for (var t = [0], i = 1; i < e.length; i += 1) t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  13133. return t
  13134. }, t.prototype.interpAlongPath = function (e, t, i) {
  13135. var n, r = new P.Vector3,
  13136. o = t[t.length - 1];
  13137. if (i < 1) {
  13138. n = i * o;
  13139. for (var a = 1; a < t.length; a += 1)
  13140. if (t[a] > n) {
  13141. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  13142. return r.copy(e[a]), r.sub(e[a - 1]), r.multiplyScalar(s), r.add(e[a - 1]), r
  13143. }
  13144. } else r.copy(e[e.length - 1]);
  13145. return r
  13146. }, t.prototype.pathHeight = function () {
  13147. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  13148. }, t.prototype.createBunnyObj = function (e) {
  13149. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1), this.bunnyObj.visible = D.warp.showBunny), this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj), e.add(this.bunnyObj)
  13150. }, t.prototype.createCpm = function (e) {
  13151. if (!this.currentPanoMarker) {
  13152. var t = this.makeWaypointObj(I.pathEnd, "Current");
  13153. t.material.uniforms.opacity.value = 0, this.currentPanoMarker = {
  13154. mesh: t,
  13155. placed: !1
  13156. }
  13157. }
  13158. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), this.placeCpm(), this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  13159. }, t.prototype.placeCpm = function () {
  13160. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  13161. var e = this.player.currentPano.floor;
  13162. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), e.add(this.currentPanoMarker.mesh)), this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position), this.currentPanoMarker.mesh.position.y += this.pathHeight(), this.currentPanoMarker.placed = !0
  13163. } else this.popOutCpm()
  13164. }, t.prototype.fadeInCpm = function (e) {
  13165. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  13166. }, t.prototype.fadeOutCpm = function (e) {
  13167. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  13168. }, t.prototype.popInCpm = function () {
  13169. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  13170. }, t.prototype.popOutCpm = function () {
  13171. this.fadeOutCpm(2)
  13172. }, t.prototype.brushPrefs = {
  13173. linewidth: 7,
  13174. strokeWidth: 15,
  13175. cvSegments: 48,
  13176. paveStep: .1,
  13177. paveWidth: .2,
  13178. lookBlendDist: 3,
  13179. maxTurn: P.Math.degToRad(2)
  13180. }, t.prototype.panoPathDistance = function (e) {
  13181. var t = this.model.panos;
  13182. if (!e || e.length < 2) return 0;
  13183. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition);
  13184. return this.pointPathDistance(i)
  13185. }, t.prototype.loadTileTexture = function (t) {
  13186. var e = n.load(t, function (e) {
  13187. e.wrapS = P.RepeatWrapping, e.wrapT = P.RepeatWrapping, e.needsUpdate = !0, H.debug('path texture "' + t + '" is ready')
  13188. }, function () {
  13189. H.error('path texture "' + t + '" failed')
  13190. });
  13191. return e.mapping = P.UVMapping, e
  13192. }, t.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  13193. return new l({
  13194. cameraMode: n,
  13195. position: e,
  13196. quaternion: t,
  13197. panoId: i,
  13198. orthoZoom: o,
  13199. floorVisibility: r,
  13200. thumbUrl: null,
  13201. name: null
  13202. })
  13203. }, t.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  13204. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  13205. }, t.prototype.setWarpDestination = function (e) {
  13206. this.warpDestHeroLoc = e
  13207. }, t.prototype.setWarpDestinationByHeroIndex = function (e) {
  13208. var t = this.getHeroDescriptorByHeroIndex(e);
  13209. return null !== t && (this.setWarpDestination(t), !0)
  13210. }, t.prototype.setWarpDestinationByPano = function (e, t) {
  13211. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  13212. }, t.prototype.setWarpDestinationByPanoId = function (e, t) {
  13213. var i = this.model.panos.get(e);
  13214. if (i) {
  13215. t = t || new P.Quaternion;
  13216. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  13217. return this.setWarpDestination(n), !0
  13218. }
  13219. return !1
  13220. }, t.prototype.getHeroDescriptorByHeroIndex = function (e) {
  13221. var t = this.model.heroCount();
  13222. if (null !== this.warpDestHeroLoc && t < 2) return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."), this.model.getHeroDescriptorByIndex(0);
  13223. var i = this.model.getHeroDescriptorByIndex(e);
  13224. if (i) {
  13225. var n = i.isPano() ? i.panoId : i.cameraMode;
  13226. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  13227. }
  13228. return i
  13229. }, t.prototype.getHeroDescriptorByPano = function (e) {
  13230. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  13231. }, t.prototype.getHeroDescriptorByPanoId = function (e) {
  13232. var t = this.getHeroIndexFromPanoId(e);
  13233. return this.getHeroDescriptorByHeroIndex(t)
  13234. }, t.prototype.getHeroIndexFromPanoId = function (e) {
  13235. for (var t = 0; t < this.model.heroLocations.length; t++) {
  13236. var i = this.model.heroLocations[t],
  13237. n = this.getHeroId(i);
  13238. if (n && n === e) return t
  13239. }
  13240. return -1
  13241. }, t.prototype.getHeroPano = function (e) {
  13242. if (null === e) return H.warn("getHeroPano(): no destination"), null;
  13243. var t = this.getHeroId(e),
  13244. i = this.model.panos.get(t);
  13245. return void 0 === i && (i = null, "" !== t && H.debug('unable to find pano "' + t + '"')), i
  13246. }, t.prototype.getHeroId = function (e) {
  13247. return e.panoId
  13248. }, t.prototype.setWarpDestPano = function () {
  13249. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc), this.warpDestPano
  13250. }, t.prototype.brushToWarpPano = function (e, t) {
  13251. if (this.discardPathObject(), !this.setWarpDestPano()) return !1;
  13252. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"), !this.warpDestPano) return H.info("No brush"), !1;
  13253. if (!this.player.currentPano) return H.debug("No current pano, visibility undefined"), !1;
  13254. if (!this.warpDestPano) return H.info("No wPano, visibility undefined"), !1;
  13255. if (!this.warpDestPano.isAligned()) return H.debug("Cannot brush to unaligned pano"), !1;
  13256. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides,
  13257. n = !0;
  13258. if (this.player.currentPano.id === this.warpDestPano.id) H.debug("Already at destination pano");
  13259. else {
  13260. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano), n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1, this.obj3d = new P.Object3D, H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"), n ? (H.info('No "walkable" route, using fall-back warp style transition'), e = t) : (this.setPathHulls(this.nodes), this.setFloorCurves(), i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))), this.player.currentPano.floor.add(this.obj3d);
  13261. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN,
  13262. o = e === L.STD;
  13263. if (!n && (i || o)) {
  13264. if (r) {
  13265. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  13266. this.obj3d.add(a)
  13267. }
  13268. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  13269. this.obj3d.add(s)
  13270. }
  13271. this.appearSlow()
  13272. }
  13273. return this.upcomingTransType = e, !n
  13274. }, t.prototype.findShortestPath = function (e, t) {
  13275. if (!e || !t) return null;
  13276. var i = D.warp.walkExtraPanosDistance,
  13277. n = e.id + ":" + t.id + ":" + i;
  13278. if (this.shortPaths.hasOwnProperty(n)) return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  13279. var r = t.id + ":" + e.id + ":" + i;
  13280. if (this.shortPaths.hasOwnProperty(r)) return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  13281. var o = this.model.panos.aStarSearch(e, t);
  13282. return this.model.panos.includeNodesNearPath(o, i), this.shortPaths[n] = o ? o.slice() : null, o
  13283. }, t.prototype.makePathHulls = function (e) {
  13284. var t, i, n, r, o, a = 0,
  13285. s = [],
  13286. l = [],
  13287. c = [],
  13288. h = this.model.panos;
  13289. r = (t = h.get(e[0])).floor.floorIndex;
  13290. for (var u = 0; u < e.length; u += 1)(i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(), s.push(i), l.push(t.position.clone()), n = t.floor.floorIndex, c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color), 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  13291. return a > this.longestStep && (this.longestStep = a, H.debug("path contains " + a + " meter segment")), {
  13292. floor: s,
  13293. camera: l,
  13294. color: c
  13295. }
  13296. }, t.prototype.makeFloorCurves = function (e, t, i) {
  13297. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius,
  13298. r = this.pointPathDistance(e) - 2 * n,
  13299. o = e.slice(0),
  13300. a = o[1].clone().sub(o[0]);
  13301. a.y = 0, a.normalize().multiplyScalar(n), o[0] = (new P.Vector3).copy(o[0]).add(a), (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0, a.normalize().multiplyScalar(n), o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  13302. var s = new P.CatmullRomCurve3(o),
  13303. l = Math.floor(r / i);
  13304. l = 4 * Math.floor(l / 4), l = Math.max(4, l);
  13305. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  13306. h = 0, c = u[f].distanceTo(e[0]);
  13307. for (var g = 1; g < e.length; g += 1) p.copy(u[f]).sub(e[g]), p.y *= 4, p.length() < c && (h = g);
  13308. d.push(t[h])
  13309. }
  13310. return {
  13311. distance: r,
  13312. points: u,
  13313. colors: d
  13314. }
  13315. }, t.prototype.makeCameraCurvePoints = function (e, t) {
  13316. var i = this.pointPathDistance(e);
  13317. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  13318. }, t.prototype.makeCameraCurveTangents = function (e, t) {
  13319. var i = this.pointPathDistance(e),
  13320. n = new P.CatmullRomCurve3(e),
  13321. r = Math.max(2, Math.floor(i / t));
  13322. r = r || 5;
  13323. for (var o = [], a = 0; a <= r; a++) o.push(n.getTangentAt(a / r));
  13324. return o
  13325. }, t.prototype.setPathHulls = function (e) {
  13326. var t = this.makePathHulls(e);
  13327. this.floorHull = t.floor, this.cameraHull = t.camera, this.colorHull = t.color
  13328. }, t.prototype.setFloorCurves = function () {
  13329. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  13330. this.floorPathDistance = e.distance, this.floorCurvePoints = e.points, this.floorCurveColors = e.colors
  13331. }, t.prototype.setCameraCurvePoints = function () {
  13332. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  13333. }, t.prototype.chooseWarpPath = function (e) {
  13334. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  13335. if (this.player.currentPano === this.warpDestPano || !e) return this.warpPathPoints = null, this.warpLength = 0, !1;
  13336. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano), void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"), i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(), t.multiplyScalar(.15).add(r.position), i.multiplyScalar(.15).add(this.warpDestPano.position), t.y = r.position.y, i.y = this.warpDestPano.position.y, n = new P.CubicBezierCurve3(r.position.clone(), t, i, this.warpDestPano.position.clone()), this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"), this.setCameraCurvePoints(), this.warpPathPoints = this.camCurvePoints.slice(0)), this.warpLength = 0, this.warpPathLengths = [0];
  13337. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  13338. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  13339. var h = o.length();
  13340. o.y *= D.warp.climbEffort;
  13341. var u = o.length() / h;
  13342. if (1 < c) {
  13343. o.setY(0).normalize(), a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  13344. var d = Math.min(1, o.dot(a)),
  13345. p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  13346. u = Math.max(p, u)
  13347. }
  13348. this.warpLength += h * u, this.warpPathLengths[c] = this.warpLength
  13349. }
  13350. return !0
  13351. }, t.prototype.drawPathRibbon = function (e, t) {
  13352. this.bunnyObj.visible = D.warp.showBunny;
  13353. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0, this.pathHeight(), 0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  13354. a.copy(e[s]), 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(), a.normalize(), n.crossVectors(a, U.UP), n.multiplyScalar(i);
  13355. var l = (new P.Vector3).copy(e[s]).add(r);
  13356. l.sub(n), o.vertices.push(l), (l = (new P.Vector3).copy(e[s]).add(r)).add(n), o.vertices.push(l)
  13357. }
  13358. var c, h, u, d = 0;
  13359. for (s = 0; s < e.length - 1; s += 1) {
  13360. var p = 2 * s,
  13361. f = d,
  13362. g = d += e[s + 1].distanceTo(e[s]),
  13363. m = t[s],
  13364. v = t[s + 1];
  13365. (c = new P.Face3(p, 1 + p, 2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)], o.faces.push(c), o.faceVertexUvs[0].push([new P.Vector2(0, f), new P.Vector2(1, f), new P.Vector2(0, g)]), (c = new P.Face3(2 + p, 1 + p, 3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)], o.faces.push(c), o.faceVertexUvs[0].push([new P.Vector2(0, g), new P.Vector2(1, f), new P.Vector2(1, g)])
  13366. }
  13367. o.computeFaceNormals(), o.computeVertexNormals(), h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path, u.opacity.value = 0, u.color.value.set(D.path.color), new P.RawShaderMaterial({
  13368. side: P.DoubleSide,
  13369. depthWrite: !1,
  13370. transparent: !0,
  13371. vertexShader: C.ribbon.vertexShader,
  13372. fragmentShader: C.ribbon.fragmentShader,
  13373. uniforms: u,
  13374. name: "ribbonT",
  13375. opacity: 0
  13376. })) : new P.MeshBasicMaterial({
  13377. color: 16777215,
  13378. side: P.DoubleSide,
  13379. name: "ribbonOut",
  13380. vertexColors: P.VertexColors
  13381. });
  13382. var y = new P.Mesh(o, h);
  13383. return y.name = "ribbon", this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon), y
  13384. }, t.prototype.drawPathPavement = function (e) {
  13385. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1) r.copy(e[o]), 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]), r.normalize(), i.crossVectors(r, U.UP), i.multiplyScalar(this.brushPrefs.paveWidth), (t = (new P.Vector3).copy(e[o])).sub(i), n.vertices.push(t), n.vertices.push((new P.Vector3).copy(e[o])), (t = (new P.Vector3).copy(e[o])).add(i), n.vertices.push(t);
  13386. var a, s, l;
  13387. for (o = 0; o < e.length - 1; o += 1) a = 3 * o + 1, l = .25 + (s = .25 * o), n.faces.push(new P.Face3(a - 1, a, 3 + a)), n.faceVertexUvs[0].push([new P.Vector2(0, s), new P.Vector2(.5, s), new P.Vector2(.5, l)]), n.faces.push(new P.Face3(3 + a, 2 + a, a - 1)), n.faceVertexUvs[0].push([new P.Vector2(.5, l), new P.Vector2(0, l), new P.Vector2(0, s)]), n.faces.push(new P.Face3(3 + a, a, 1 + a)), n.faceVertexUvs[0].push([new P.Vector2(.5, l), new P.Vector2(.5, s), new P.Vector2(1, s)]), n.faces.push(new P.Face3(3 + a, 1 + a, 4 + a)), n.faceVertexUvs[0].push([new P.Vector2(.5, l), new P.Vector2(1, s), new P.Vector2(1, l)]);
  13388. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  13389. color: D.path.color,
  13390. side: P.DoubleSide,
  13391. transparent: !0,
  13392. depthWrite: !1,
  13393. opacity: 0,
  13394. name: "paveT",
  13395. map: I.path
  13396. }) : new P.MeshBasicMaterial({
  13397. color: D.path.color,
  13398. side: P.DoubleSide,
  13399. transparent: !0,
  13400. depthWrite: !1,
  13401. opacity: 1,
  13402. name: "paveO",
  13403. map: I.path
  13404. });
  13405. return new P.Mesh(n, c)
  13406. }, t.prototype.hintPrefs = {
  13407. rad: .18,
  13408. width: .0125,
  13409. depth: .0625,
  13410. setBack: -.04,
  13411. markRad: .25,
  13412. markInnerRad: .16
  13413. }, t.prototype.makeWaypointObj = function (e, t) {
  13414. var i = new P.Geometry,
  13415. n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius,
  13416. r = this.pathHeight();
  13417. i.vertices.push(new P.Vector3(-n, r, n), new P.Vector3(-n, r, -n), new P.Vector3(n, r, -n), new P.Vector3(n, r, n)), i.faces.push(new P.Face3(0, 1, 2), new P.Face3(2, 3, 0)), i.faceVertexUvs[0].push([new P.Vector2(0, 0), new P.Vector2(1, 0), new P.Vector2(1, 1)]), i.faceVertexUvs[0].push([new P.Vector2(1, 1), new P.Vector2(0, 1), new P.Vector2(0, 0)]);
  13418. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  13419. o.map.value = e, o.opacity.value = 0, o.color.value.set(D.path.color);
  13420. var a = {
  13421. side: P.DoubleSide,
  13422. depthWrite: !1,
  13423. transparent: !0,
  13424. vertexShader: C.waypoint.vertexShader,
  13425. fragmentShader: C.waypoint.fragmentShader,
  13426. uniforms: o,
  13427. name: "waypoint",
  13428. opacity: 0
  13429. };
  13430. this.player.mode !== O.PANORAMA && (a.depthTest = !1, a.name = "wayPtOut");
  13431. var s = new P.RawShaderMaterial(a),
  13432. l = new P.Mesh(i, s);
  13433. return l.name = t, l
  13434. }, t.prototype.makeStartMarker = function (e, t) {
  13435. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  13436. i.y = 0, i.normalize();
  13437. var n = Math.acos(i.x),
  13438. r = this.makeWaypointObj(I.pathStart, "Start");
  13439. return r.rotateOnAxis(new P.Vector3(0, 1, 0), n), r.position.copy(e), r
  13440. }, t.prototype.makeEndMarker = function (e) {
  13441. var t = this.makeWaypointObj(I.pathEnd, "End"),
  13442. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  13443. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  13444. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown), t.position.copy(e), t
  13445. }, t.prototype.pathClean = function (e) {
  13446. if (e) {
  13447. for (var t in e.children) this.pathClean(e.children[t]);
  13448. e.geometry && e.geometry.dispose(), e.material && e.material.dispose()
  13449. }
  13450. }, t.prototype.discardPathObject = function () {
  13451. if (this.obj3d) {
  13452. var e = this.obj3d.parent;
  13453. e && e.remove(this.obj3d), this.pathClean(this.obj3d)
  13454. }
  13455. this.obj3d = null, this.popInCpm()
  13456. }, t.prototype.discardSlow = function () {
  13457. if (this.obj3d) {
  13458. if (this.player.mode !== O.PANORAMA) return void this.discardPathObject();
  13459. for (var e, t = 0, i = function () {
  13460. this.discardPathObject()
  13461. }.bind(this), n = 0; n < this.obj3d.children.length; n += 1) void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]), t += 1, i = null);
  13462. 0 === t && this.discardPathObject(), this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  13463. }
  13464. }, t.prototype.appearSlow = function () {
  13465. var e;
  13466. this.fadeOutCpm(D.path.fadeInTime);
  13467. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1) void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  13468. }, t.prototype.update = function () {
  13469. this.obj3d && this.obj3d.updateMatrixWorld()
  13470. }, t.prototype.calcBurnsAmount = function (e) {
  13471. var n = P.Math.degToRad(D.warp.burnsAngle);
  13472. if (this.player.mode !== O.PANORAMA) return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  13473. var t = this.burnsDir * n;
  13474. if (this.upcomingTransType === L.BLACK) return t;
  13475. var i = e;
  13476. if (null === i) return H.warn("Transition request for non-highlight"), t;
  13477. var r = this.getHeroDescriptorByHeroIndex(i);
  13478. if (null === r) return t;
  13479. if (!r.isPano()) return t;
  13480. function o(e) {
  13481. var t = Math.acos(Math.min(1, e.dot(l))),
  13482. i = (new P.Vector3).crossVectors(l, e);
  13483. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  13484. }
  13485. var a = this.getHeroPano(r),
  13486. s = this.playerControls.cameras[O.PANORAMA],
  13487. l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize(),
  13488. c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  13489. if (a === this.player.currentPano) return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  13490. var h = this.findShortestPath(this.player.currentPano, a);
  13491. if (null == h || h.length < 1) return H.debug("Empty path ahead..."), t;
  13492. var u = this.makePathHulls(h),
  13493. d = new P.CatmullRomCurve3(u.camera),
  13494. p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  13495. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  13496. }, t.prototype.waitNextStep = function (e, t, i) {
  13497. var o = null == i ? D.warp.tourStepDelay : i;
  13498. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  13499. var a = new P.Euler,
  13500. s = new P.Vector3;
  13501. H.debug("Starting wait: " + (void 0 !== t));
  13502. var l = this.calcBurnsAmount(e),
  13503. c = function () {
  13504. this.endWarpState(), this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0), t && t()
  13505. }.bind(this),
  13506. n = function (e, t) {
  13507. if (this.warpInterrupted) return c(), !0;
  13508. var i = t || 1e3 / 60;
  13509. if (D.warp.doBurns)
  13510. if (this.player.mode === O.PANORAMA) {
  13511. var n = this.playerControls.cameras[O.PANORAMA];
  13512. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  13513. var r = i * l / o;
  13514. a.y += r, s.set(0, 0, -1), s.applyEuler(a), s.add(n.position), n.controls.lookAt(s), n.controls.lookVector.copy(s), n.lookAt(s)
  13515. } else this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  13516. }.bind(this);
  13517. this.startWarpState(), V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  13518. var r = player.model.heroLocations[app.director.currentItem];
  13519. this.player.zoomEnabled = !0;
  13520. var h = function (e, t) {
  13521. console.log(e), this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  13522. }.bind(this);
  13523. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom")
  13524. }, t.prototype.warpToNonPano = function (e) {
  13525. if (this.discardPathObject(), this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  13526. var t = function () {
  13527. e && e()
  13528. }.bind(this);
  13529. this.player.flyToNewMode({
  13530. mode: this.warpDestHeroLoc.cameraMode,
  13531. duration: D.warp.outsideTime,
  13532. warpDest: this.warpDestHeroLoc,
  13533. callback: t,
  13534. force: !0
  13535. })
  13536. } else H.warn("no warp destination!!!"), e && e()
  13537. }, t.prototype._resetWarpShaderParams = function (e) {
  13538. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0), void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  13539. }, t.prototype._clearWarpShading = function () {
  13540. for (var e = this.model.chunks, t = 0; t < e.length; t += 1) this._resetWarpShaderParams(e[t]), e[t].visible = !0;
  13541. this._resetWarpShaderParams(this.model.skybox)
  13542. }, t.prototype._warpStopFlying = function () {
  13543. this.activeTransType = null, this.placeCpm()
  13544. }, t.prototype._wrapupTravelOnlyBits = function () {
  13545. this._warpStopFlying(), this.warpPathPoints && (this.player.currentPano.exit(), this.warpDestPano.enter(), this.player.currentPano = this.warpDestPano), this.player.spider.draw(), this.placeCpm()
  13546. }, t.prototype._wrapupTravel = function (e) {
  13547. this._wrapupTravelOnlyBits(), this.warpCameraAim(e)
  13548. }, t.prototype._wrapupWarpShading = function (e) {
  13549. this._clearWarpShading(), this._wrapupTravel(e)
  13550. }, t.prototype.wrapupWarpShadingOnly = function (e, t) {
  13551. t !== z.END && this._clearWarpShading(), this._wrapupTravelOnlyBits(), this.upcomingTransType = null, e && e()
  13552. }, t.prototype._warpCameraAim = function (e, t) {
  13553. var i = this.warpDestHeroLoc.quaternion,
  13554. n = this.playerControls.cameras[O.PANORAMA],
  13555. r = new P.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  13556. o = new P.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize().dot(r),
  13557. a = P.Math.radToDeg(Math.acos(o)),
  13558. s = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder),
  13559. l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder),
  13560. c = new P.Euler(s.x - l.x, s.y - l.y, s.z - l.z, D.warp.eOrder);
  13561. c.y = N.constrainedTurn(c.y), this.burnsDir = Math.sign(c.y);
  13562. var h = new P.Euler(0, 0, 0, D.warp.eOrder),
  13563. u = new P.Vector3,
  13564. d = function (e, t) {
  13565. return !!this.warpInterrupted || (h.x = l.x + e * c.x, h.y = l.y + e * c.y, h.z = l.z + e * c.z, u.set(0, 0, -1), u.applyEuler(h), u.add(n.position), n.controls.lookAt(u), n.controls.lookVector.copy(u), void n.lookAt(u))
  13566. }.bind(this);
  13567. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"), void(t && t()))
  13568. }, t.prototype._warpBendAim = function (e, t, i, n) {
  13569. var r = n || 0,
  13570. o = this.playerControls.cameras[O.PANORAMA],
  13571. a = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  13572. s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder),
  13573. l = new P.Euler(a.x - s.x, a.y - s.y, a.z - s.z, D.warp.eOrder);
  13574. l.y = N.constrainedTurn(l.y);
  13575. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  13576. l.x = c * Math.sign(l.x), c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c), this.burnsDir = Math.sign(l.y), c *= Math.sign(l.y), l.y = c;
  13577. var h = new P.Euler(0, 0, 0, D.warp.eOrder),
  13578. u = new P.Vector3,
  13579. d = function (e, t) {
  13580. if (e < .5) h.x = s.x + e * l.x, h.y = s.y + e * l.y, h.z = s.z + e * l.z;
  13581. else {
  13582. var i = (1 - e) * D.warp.softBendEnd;
  13583. h.x = a.x - i * l.x, h.y = a.y - i * l.y, h.z = a.z - i * l.z
  13584. }
  13585. u.set(0, 0, -1), u.applyEuler(h), u.add(o.position), o.controls.lookAt(u), o.controls.lookVector.copy(u), o.lookAt(u)
  13586. }.bind(this);
  13587. return V.start(d, t, i, r, B[D.warp.movementEasing])
  13588. }, t.prototype._warpStepCameraAim = function (e, t, i) {
  13589. var n = this.playerControls.cameras[O.PANORAMA],
  13590. r = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  13591. o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder),
  13592. a = new P.Euler(r.x - o.x, r.y - o.y, r.z - o.z, D.warp.eOrder);
  13593. a.y = N.constrainedTurn(a.y), this.burnsDir = Math.sign(a.y);
  13594. var s = new P.Euler(0, 0, 0, D.warp.eOrder),
  13595. l = new P.Vector3,
  13596. c = function (e, t) {
  13597. e < .5 ? s.copy(o) : s.copy(r), l.set(0, 0, -1), l.applyEuler(s), l.add(n.position), n.controls.lookAt(l), n.controls.lookVector.copy(l), n.lookAt(l)
  13598. }.bind(this);
  13599. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  13600. }, t.prototype.setBurnsDir = function () {
  13601. var e = this.playerControls.cameras[O.PANORAMA],
  13602. t = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  13603. i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder),
  13604. n = new P.Euler(t.x - i.x, t.y - i.y, t.z - i.z, D.warp.eOrder);
  13605. n.y = N.constrainedTurn(n.y), this.burnsDir = Math.sign(n.y)
  13606. }, t.prototype.stepWarpPath = function (e, t) {
  13607. var i = this.playerControls.cameras[O.PANORAMA];
  13608. if (!this.warpPathPoints) return i.position.copy(this.warpDestPano.position), !0;
  13609. var n = this.warpPathPoints[0],
  13610. r = this.warpDestPano.position;
  13611. if (null !== this.nodes && 1 < this.cameraHull.length) {
  13612. var o = new P.Vector3;
  13613. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r), i.position.copy(o)
  13614. } else e < .5 ? i.position.copy(n) : i.position.copy(r)
  13615. }, t.prototype.interruptAndFastForward = function (e, t) {
  13616. this.warping && (this.warpInterrupted = !0, this.warpInterruptionBlackoutStyle = e, this.warpInterruptionTravelTime = t, null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE), null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  13617. }, t.prototype.warpCameraAim = function (e) {
  13618. var t = D.warp.minWarpTime;
  13619. if (this.upcomingTransType === L.BLACK) t = D.warp.teleportTime;
  13620. else {
  13621. var i = this.playerControls.cameras[O.PANORAMA],
  13622. n = new P.Euler(0, 0, 0, D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder),
  13623. r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder),
  13624. o = new P.Euler(n.x - r.x, n.y - r.y, n.z - r.z, D.warp.eOrder);
  13625. o.y = N.constrainedTurn(o.y);
  13626. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  13627. t = Math.max(t, a)
  13628. }
  13629. var s = function () {
  13630. this._warpStopFlying(), this.discardSlow(), e && e()
  13631. }.bind(this);
  13632. this._warpCameraAim(t, s)
  13633. }, t.prototype.warpCommonParameters = function (e, t, i, n) {
  13634. this.model.skybox.material.uniforms.blackout.value = n;
  13635. var r = F.uniform(this.model.skybox, "progress", 1),
  13636. o = F.allUniforms(this.model.chunks, "progress", 1),
  13637. a = !1,
  13638. s = function () {
  13639. if (this.warpInterrupted) return a = !0
  13640. }.bind(this),
  13641. l = function (e, t) {
  13642. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  13643. }.bind(this),
  13644. c = function (e, t) {
  13645. return i && a ? (o(0), !0) : void o(e, t)
  13646. }.bind(this);
  13647. V.start(s, e, null, t, null, "safeHaltWatch"), V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"), V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  13648. }, t.prototype.warpTravel_STD = function (e) {
  13649. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength),
  13650. h = this.playerControls.cameras[O.PANORAMA],
  13651. i = (Math.min(.25, 3 / this.warpLength), Math.min(.35, 7 / this.warpLength)),
  13652. u = new P.Euler(0, 0, 0, D.warp.eOrder),
  13653. d = new P.Vector3,
  13654. p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder),
  13655. f = (new P.Euler).copy(p),
  13656. g = h.position.clone(),
  13657. m = new P.Matrix4,
  13658. v = new P.Euler,
  13659. t = D.warp.minWarpTime;
  13660. t += this.warpLength * D.warp.timePerMeter, .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  13661. function n(e) {
  13662. var t = i;
  13663. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  13664. }
  13665. var y = !1,
  13666. r = this.warpDestHeroLoc.quaternion,
  13667. o = new P.Vector3(0, 0, -1).applyQuaternion(r).normalize(),
  13668. A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize(),
  13669. a = A.dot(o),
  13670. C = P.Math.radToDeg(Math.acos(a)),
  13671. s = function () {
  13672. return m.lookAt(g, l, U.UP), u.setFromRotationMatrix(m, D.warp.eOrder), p.setFromQuaternion(h.quaternion, D.warp.eOrder), v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder), N.constrainedTurn(v.y)
  13673. }.bind(this),
  13674. I = function (e, t) {
  13675. if (this.warpInterrupted) return y = !0
  13676. }.bind(this),
  13677. E = function (e, t) {
  13678. return y || !this.warpPathPoints ? (k.blur(0), !0) : void k.blur(e)
  13679. }.bind(this),
  13680. _ = F.allUniforms(this.model.chunks, "modelAlpha", 1),
  13681. b = function (e, t) {
  13682. return y || !this.warpPathPoints ? (_(0), !0) : void _(e, t)
  13683. }.bind(this),
  13684. w = function (e, t) {
  13685. if (!this.warpPathPoints) return h.position.copy(this.warpDestPano.position), !0;
  13686. if (y) return !0;
  13687. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  13688. h.position.copy(i), g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  13689. }.bind(this),
  13690. T = function (e, t) {
  13691. return this.warpPathPoints ? !!y || void(l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."), !0)
  13692. }.bind(this),
  13693. x = function (e, t) {
  13694. if (y) return H.debug(">>>> Walkthrough interupted at t=" + e), !0;
  13695. if (!this.warpPathPoints) return !0;
  13696. var i = this.warpLength * e,
  13697. n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist),
  13698. r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  13699. D.warp.matchCam && (n *= 1 - r), m.lookAt(g, l, U.UP), u.setFromRotationMatrix(m, D.warp.eOrder), p.setFromQuaternion(h.quaternion, D.warp.eOrder), v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder), v.y = N.constrainedTurn(v.y), u.x = p.x + n * v.x, u.y = p.y + n * v.y, u.z = p.z + n * v.z, v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder), v.y = N.constrainedTurn(v.y);
  13700. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  13701. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)), f.x = f.x + v.x * D.warp.turnFriction, f.y = f.y + v.y * D.warp.turnFriction, f.z = f.z + v.z * D.warp.turnFriction, f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  13702. var a = l.clone().sub(g).normalize();
  13703. if (C < D.warp.maxAimRotation && 0 < r) {
  13704. var s = 1 - r;
  13705. a.x = a.x * s + r * A.x, a.y = a.y * s + r * A.y, a.z = a.z * s + r * A.z, a.normalize()
  13706. }
  13707. this.bunnyObj.position.copy(h.position).add(a), d.set(0, 0, -1).applyEuler(f).normalize(), d.multiplyScalar(8), d.add(h.position), 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d), h.controls.lookVector.copy(d), h.lookAt(d))
  13708. }.bind(this),
  13709. S = function () {
  13710. y ? (this.discardSlow(), this.upcomingTransType = L.BLACK, this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  13711. }.bind(this);
  13712. T(0);
  13713. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec),
  13714. R = M / (t += M);
  13715. this.warpCommonParameters(t, R, !0, z.NONE), V.start(I, t, null, 0, null, "_haltWatcher"), 0 < D.warp.blur && (k.blurStrength = D.warp.blur, V.start(E, t, null, R, n, "blurring")), V.start(b, t, null, R, n, "modelAlpha"), V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"), V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"), V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  13716. }, t.prototype.warpTravel_BLACK = function (e, t, i, n) {
  13717. var r = e || 0;
  13718. null != t || (t = D.warp.teleportTime), this.warpCommonParameters(t, r, !1, i), this.model.chunks.forEach(function (e) {
  13719. e.material.uniforms.blackout.value = i
  13720. }), this._warpBendAim(null, t, null, r);
  13721. var o = function () {
  13722. this.wrapupWarpShadingOnly(n, i)
  13723. }.bind(this);
  13724. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  13725. }, t.prototype.flightStepWalk = (a = new P.Vector3, s = new P.Vector3, function (e, t, i) {
  13726. if (this.warpInterrupted) i && i();
  13727. else if (this.activeTransType !== L.WALK) this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), i && i();
  13728. else if (this.player.currentPano !== e) {
  13729. var n = {
  13730. pano: e,
  13731. lookAtPoint: t,
  13732. duration: null,
  13733. maxDistanceOverride: D.warp.walkMaxDist,
  13734. skipWarpingCheck: !1,
  13735. constantMoveSpeed: !0
  13736. };
  13737. n.duration = function (e, t) {
  13738. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  13739. s.copy(U.FORWARD), this.player.getDirection(s), a.copy(t).sub(e.position).normalize();
  13740. var n = a.dot(s),
  13741. r = Math.acos(n),
  13742. o = r / i;
  13743. return .001 < o && (i *= o / .001, r < 1 && (i *= 1.2)), i
  13744. }.call(this, e, t), this.player.nonInterruptingFlyToPano(n, i)
  13745. } else i && i()
  13746. }), t.prototype.makeWalkFlightFunc = function (e, t, i) {
  13747. return this.flightStepWalk.bind(this, e, t, i)
  13748. }, t.prototype.warpTravel_WALK = (f = [], function (e) {
  13749. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  13750. var o = this.nodes[r],
  13751. a = t.get(o);
  13752. this.nodes.length, n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist, i && n || (f.push(o), i = a)
  13753. }
  13754. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  13755. var s = f.length,
  13756. l = t.get(f[s - 1]),
  13757. c = new Array(s + 1);
  13758. c[c.length - 1] = function () {
  13759. e && e()
  13760. }.bind(this);
  13761. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  13762. var d = f[h];
  13763. l = t.get(d);
  13764. var p = new P.Vector3;
  13765. this.getLookAtForWalkingTourNode(f, h, p), c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]), h--
  13766. }
  13767. c[0]()
  13768. }), t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3, h = new P.Vector3, u = new P.Vector3, d = new P.Vector3, p = new P.Vector3, function (e, t, i) {
  13769. var n = e.length;
  13770. if (n <= t) return !1;
  13771. var r = 1,
  13772. o = 1;
  13773. h.set(0, 0, 0), p.set(0, 0, 0);
  13774. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  13775. if (a = this.player.model.panos.get(e[s]), this.getOrientationForWalkingTourNode(e, s, u), s === t && c.copy(u), d.copy(u), t < s) {
  13776. var l = d.dot(c) < .65;
  13777. r *= l ? .2 : .75, o *= l ? .2 : .4
  13778. }
  13779. u.multiplyScalar(r), h.add(u), p.lerp(a.position, o)
  13780. }
  13781. return h.normalize(), i.copy(p), i.add(h), !0
  13782. }), t.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  13783. var n = e.length;
  13784. if (n <= t) return !1;
  13785. if (t === n - 1) i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  13786. else {
  13787. var r = this.player.model.panos.get(e[t]),
  13788. o = this.player.model.panos.get(e[t + 1]);
  13789. i.copy(o.position).sub(r.position)
  13790. }
  13791. return i.normalize(), !0
  13792. }, t.prototype.warpCameraTravel = function (e, t, i, n) {
  13793. if (this.activeTransType = this.upcomingTransType, this.lastTransType = this.activeTransType, this.upcomingTransType = null, e) this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function () {
  13794. this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), n && n()
  13795. }.bind(this)) : this.warpTravel_STD(n);
  13796. else {
  13797. var r = function () {
  13798. this._wrapupTravel(n)
  13799. }.bind(this),
  13800. o = {
  13801. pano: this.warpDestPano,
  13802. lookAtPoint: null,
  13803. duration: null,
  13804. maxDistanceOverride: null,
  13805. skipWarpingCheck: !1
  13806. };
  13807. this.player.flyToPano(o, r)
  13808. }
  13809. }, t.prototype.startWarpState = function () {
  13810. this.warping = !0, this.warpInterrupted = !1, this.warpInterruptionBlackoutStyle = null, this.warpInterruptionTravelTime = null
  13811. }, t.prototype.endWarpState = function () {
  13812. this.warping = !1
  13813. }, t.prototype.warpToPano = function (e, t, i, n) {
  13814. if (this.warping) H.warn("Cannot warp when already warping");
  13815. else {
  13816. if (this.upcomingTransType = e, this.activeTransType = null, !this.setWarpDestPano()) return this.upcomingTransType = null, void this.warpToNonPano(n);
  13817. if (this.player.mode !== O.PANORAMA) return this.upcomingTransType = null, this.discardSlow(), void this.player.flyToNewMode({
  13818. mode: O.PANORAMA,
  13819. pano: this.warpDestPano,
  13820. duration: D.warp.outsideTime,
  13821. warpDest: this.warpDestHeroLoc,
  13822. callback: n,
  13823. force: !0
  13824. });
  13825. if (!this.warpDestPano) return H.warn("no warp destination, callback dropped"), void(this.upcomingTransType = null);
  13826. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist),
  13827. o = this.chooseWarpPath(r);
  13828. if (o && this.upcomingTransType !== L.WALK) {
  13829. var a = function () {
  13830. this.waitingToWarp = !1, this.warpToPano(e, t, i, n)
  13831. }.bind(this);
  13832. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a)) return void(this.waitingToWarp = !0)
  13833. }
  13834. this.player.currentPano || (H.warn("Arrived at a very strange spot!"), this.player.currentPano = this.warpDestPano, this.placeCpm(), this.fadeOutCpm(D.path.fadeOutTime), this.player.spider.draw()), H.debug("Warping to pano ", this.warpDestPano.position), this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano), this.startWarpState();
  13835. var s = function () {
  13836. this.endWarpState(), n && n()
  13837. }.bind(this);
  13838. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  13839. }
  13840. }, v.exports = t
  13841. }).call(this, "/js/objects/ShowPath.js")
  13842. }, {
  13843. "../constants": 8,
  13844. "../effects": 16,
  13845. "../enum/BlackoutStyle": 18,
  13846. "../enum/ModelManagerEvents": 33,
  13847. "../enum/PlayerEvents": 40,
  13848. "../enum/RenderOrder": 42,
  13849. "../enum/Vectors": 50,
  13850. "../enum/Viewmode": 51,
  13851. "../enum/WarpStyle": 52,
  13852. "../gui/gui": 65,
  13853. "../model/ModelManager": 140,
  13854. "../objects/Snapshot": 153,
  13855. "../settings": 166,
  13856. "../shaders": 167,
  13857. "../util/easing": 186,
  13858. "../util/lerp": 188,
  13859. "../util/logger": 189,
  13860. "../util/math": 190,
  13861. "../util/texture": 194,
  13862. "../util/transitions": 195,
  13863. three: 217
  13864. }],
  13865. 152: [function (e, t, i) {
  13866. "use strict";
  13867. function n() {
  13868. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  13869. t = new r.RawShaderMaterial({
  13870. fragmentShader: o.skysphere.fragmentShader,
  13871. vertexShader: o.skysphere.vertexShader,
  13872. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  13873. side: r.BackSide,
  13874. name: "skysphere"
  13875. });
  13876. t.uniforms.radius.value = e.parameters.radius, r.Mesh.call(this, e, t)
  13877. }
  13878. var r = e("three"),
  13879. o = e("../shaders"),
  13880. a = e("../settings");
  13881. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n, t.exports = n
  13882. }, {
  13883. "../settings": 166,
  13884. "../shaders": 167,
  13885. three: 217
  13886. }],
  13887. 153: [function (r, o, e) {
  13888. (function (e) {
  13889. "use strict";
  13890. function t(e) {
  13891. n.call(this, e), this.sid = e.sid, this.panoId = e.panoId, this.orthoZoom = e.orthoZoom, this.floorVisibility = e.floorVisibility, this.thumbUrl = e.thumbUrl, this.name = e.name, this.zoom = e.zoom
  13892. }
  13893. var i = (r("three"), r("../util/logger")),
  13894. n = (r("../settings"), r("../enum/Viewmode"), r("../util/common"), r("../util/transitions"), r("../util/lerp"), r("../util/ajax"), r("../util/texture"), r("./View"));
  13895. r("events").EventEmitter, new i(e), (t.prototype = Object.create(n.prototype)).isPano = function () {
  13896. return this.panoId && "" !== this.panoId
  13897. }, o.exports = t
  13898. }).call(this, "/js/objects/Snapshot.js")
  13899. }, {
  13900. "../enum/Viewmode": 51,
  13901. "../settings": 166,
  13902. "../util/ajax": 181,
  13903. "../util/common": 185,
  13904. "../util/lerp": 188,
  13905. "../util/logger": 189,
  13906. "../util/texture": 194,
  13907. "../util/transitions": 195,
  13908. "./View": 154,
  13909. events: 202,
  13910. three: 217
  13911. }],
  13912. 154: [function (o, a, e) {
  13913. (function (e) {
  13914. "use strict";
  13915. function t(e) {
  13916. e = e || {}, this.position = new i.Vector3, this.quaternion = new i.Quaternion, this.update(e)
  13917. }
  13918. var i = o("three"),
  13919. n = o("../util/logger"),
  13920. r = (o("../settings"), o("../enum/Viewmode"), o("../util/common"), o("../util/transitions"), o("../util/lerp"), o("../util/ajax"), o("../util/texture"), o("events").EventEmitter);
  13921. new n(e), (t.prototype = Object.create(r.prototype)).isValid = function () {
  13922. return !!this.cameraMode
  13923. }, t.prototype.update = function (e) {
  13924. return this.cameraMode = e.cameraMode || this.cameraMode, this.pano = e.pano || this.pano, e.position && this.position.copy(e.position), e.quaternion && this.quaternion.copy(e.quaternion), this
  13925. }, a.exports = t
  13926. }).call(this, "/js/objects/View.js")
  13927. }, {
  13928. "../enum/Viewmode": 51,
  13929. "../settings": 166,
  13930. "../util/ajax": 181,
  13931. "../util/common": 185,
  13932. "../util/lerp": 188,
  13933. "../util/logger": 189,
  13934. "../util/texture": 194,
  13935. "../util/transitions": 195,
  13936. events: 202,
  13937. three: 217
  13938. }],
  13939. 155: [function (J, ee, e) {
  13940. (function (e) {
  13941. "use strict";
  13942. function t(e) {
  13943. this.currentPano = null, this.nextPano = null, this.camera = null, this.paused = !1, this.flying = !1, this.sceneIntersectionPlane = null, this.target = new B.Vector3, this.mouse = new B.Vector3(1.1, 1.1, .5), this.mouseAtMouseDown = new B.Vector2, this.mouseCouldBeClickToMove = !1, this.mouseLastMoveTime = Date.now(), this.mouseDown = !1, this.mouseDownTimer = null, this.couldBeLongTap = !1, this.containsMouse = !0, this.isTouchEvent = !1, this.isPanoHover = !1, this.reticule = new n(this), this.panoMarkers = [], this.spider = new s(this), this.quaternion = new B.Quaternion, this.position = new B.Vector3(15, 10, 15), this.previousState = null, this.lastInsideView = new o, this.last360View = new o, this.raycaster = new B.Raycaster, this.intersect = null, this.lastChangeTime = Date.now(), this.history = new h, this.cameraControls = null, this.path = null, this.model = null, this.domElement = null, this.cachedPanoCandidates = null, this.basePanoSize = 0, this.standardPanoSize = 0, this.highPanoSize = 0, this.ultraHighPanoSize = 0, this.zoomLevel = 1, this.zooming = 0, this.zoomSpeed = .5, this.scrollZoomSpeed = .06, this.zoomSpeedAdjust = .05, this.defaultZoomIncrement = .2, this.baseFov = k.insideFOV, this.zoomFov = this.baseFov, this.zoomEnabled = !0, this.preRenderingEnabled = !1, this.setupCustomProperties(e), this.zoomStats = new v
  13944. }
  13945. var B = J("three"),
  13946. i = J("./util/logger"),
  13947. n = J("./objects/Reticule"),
  13948. a = J("./objects/Panorama"),
  13949. r = J("./objects/ShowPath"),
  13950. o = J("./objects/View"),
  13951. s = (J("./objects/Snapshot"), J("./objects/NSpider")),
  13952. V = J("./enum/Viewmode"),
  13953. T = (J("./enum/TagStates"), J("./enum/Vectors")),
  13954. l = J("./enum/Keys"),
  13955. k = (J("./enum/AlignmentType"), J("./settings")),
  13956. x = J("./util/common"),
  13957. U = (J("./util/browser"), J("./util/math")),
  13958. H = J("./util/lerp"),
  13959. z = J("./util/easing"),
  13960. G = J("./util/transitions"),
  13961. c = J("events").EventEmitter,
  13962. h = (J("./shaders"), J("./util/history")),
  13963. S = (J("./util/camera"), J("./model/ModelManager"), J("./enum/PathDiscardMode")),
  13964. M = J("./enum/PathDisplayMode"),
  13965. W = J("./enum/PlayerEvents"),
  13966. u = J("./enum/ControlEvents"),
  13967. d = J("./enum/ModelManagerEvents"),
  13968. R = J("./enum/WarpStyle"),
  13969. P = J("./enum/BlackoutStyle"),
  13970. p = J("./exception/BasicException"),
  13971. f = J("./enum/PanoSizeClass"),
  13972. g = (J("./tile/TileDownloader"), J("./tile/TilePrioritizer")),
  13973. m = (J("./enum/PanoramaEvents"), J("./enum/ZoomEvents")),
  13974. v = J("./util/ZoomStats"),
  13975. y = J("./constants"),
  13976. j = J("./util/common"),
  13977. A = J("./util/cameraLight"),
  13978. C = J("hot"),
  13979. Y = new i(e),
  13980. q = Object.freeze({
  13981. FlyToPano: G.getUniqueId(),
  13982. FlyToNewMode: G.getUniqueId(),
  13983. FlyToSameMode: G.getUniqueId(),
  13984. FlyToViewFloor: G.getUniqueId(),
  13985. LookTransition: G.getUniqueId(),
  13986. ZoomTransition: G.getUniqueId()
  13987. });
  13988. function I(e) {
  13989. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--;) o[r] = n.charCodeAt(r);
  13990. return new Blob([o], {
  13991. type: i
  13992. })
  13993. }(t.prototype = Object.create(c.prototype)).init = function (e) {
  13994. (window.player = this).modelManager = e.modelManager, this.tileDownloader = e.tileDownloader, this.panoRenderer = e.panoRenderer, this.qualityManager = e.qualityManager, this.domElement = e.container, this.camera = e.camera, this.tagManager = e.tagManager, this.cameraControls = e.controls, this.path = new r(e.director, this, e.controls), this.basePanoSize = this.qualityManager.getPanoSize(f.BASE), this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD), this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH), this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH), this.tileDownloader.processPriorityQueue = !1, this.tileDownloader.tilePrioritizer = new g(this.qualityManager, this.basePanoSize, this.standardPanoSize, this.highPanoSize, this.ultraHighPanoSize), this.bindEvents(e.container), this.updateModel()
  13995. }, t.prototype.screenShot = function (i) {
  13996. if (!this.flying && !this.flyingToTag) {
  13997. var n = this.sceneRenderer;
  13998. for (var e in n.updateScreenSize(i), this.model.panos.index) this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible, this.model.panos.index[e].marker.visible = !1);
  13999. for (var e in this.model.hots) this.model.hots[e].mesh.visible = !1;
  14000. this.reticule.visible = !1, this.reticule.forceUnvisible = !0, this.path.currentPanoMarker.mesh.visible = !1, setTimeout(function () {
  14001. n.renderer.clear(!0, !0, !0), n.renderer.render(n.scene, n.camera);
  14002. var e = n.renderer.domElement.toDataURL(i.type, .9);
  14003. for (var t in i.f && i.f(e), n.updateScreenSize({
  14004. resize: !0
  14005. }), this.reticule.visible = !0, this.model.hots) this.model.hots[t].mesh.visible = !0;
  14006. for (var t in this.model.panos.index) this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  14007. this.path.currentPanoMarker.mesh.visible = !0, n.renderer.render(n.scene, n.camera)
  14008. }.bind(this), 30)
  14009. }
  14010. };
  14011. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  14012. t.prototype.getWrapShot = function () {
  14013. var i = this.getSnapAngleInfo(),
  14014. n = ",{\r\t" + i,
  14015. r = arguments[0];
  14016. this.screenShot({
  14017. width: 4 * g_snapShotWidth,
  14018. height: 4 * g_snapShotHeight,
  14019. type: "image/jpeg",
  14020. f: function (e) {
  14021. if (r && r.__callback) return r.__callback(e, i);
  14022. var t = new Image;
  14023. t.src = e, t.onload = function () {
  14024. var e = function (r, i) {
  14025. function n(e, t) {
  14026. var i = o || r,
  14027. n = document.createElement("canvas");
  14028. n.width = i.width, n.height = i.height, n.getContext("2d").drawImage(i, 0, 0, i.width, i.height), o = Q(e, n, t)
  14029. }
  14030. function e() {
  14031. var e = o || r,
  14032. t = I(e.src);
  14033. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"), t = I(e.src)), (o = o || new Image).base64Src = e.src, o.src = window.URL.createObjectURL(t)
  14034. }
  14035. var o, t = Math.max(r.width, r.height);
  14036. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"), e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"), e())), o || r
  14037. }(this, {
  14038. maxSize: g_snapShotWidth,
  14039. oldType: "jpeg"
  14040. });
  14041. e.src.replace(function (e) {
  14042. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  14043. }("image/jpeg"), "image/octet-stream");
  14044. var t = "snap" + (new Date).getTime();
  14045. ! function (e, t) {
  14046. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  14047. i.href = e, i.download = t;
  14048. var n = document.createEvent("MouseEvents");
  14049. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), i.dispatchEvent(n)
  14050. }(e.src, t + ".jpg"), n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",', n += '\r\t"sid":"' + t + '",', n += '\r\t"name":"' + t + '"\r}', logData(n)
  14051. }
  14052. }
  14053. })
  14054. }, t.prototype.getSnapAngleInfo = function () {
  14055. var e = {},
  14056. t = '"metadata":{',
  14057. i = this.camera.quaternion.clone();
  14058. switch (this.mode) {
  14059. case "panorama":
  14060. e.scan_id = this.currentPano.id, t += '"scan_id":"' + this.currentPano.id + '",';
  14061. break;
  14062. case "floorplan":
  14063. e.camera_mode = 1, (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0, 1, 0), B.Math.degToRad(90))).multiply(this.camera.quaternion), t += '"camera_mode":1,', t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  14064. break;
  14065. case "dollhouse":
  14066. e.camera_mode = 2, t += '"camera_mode":2,'
  14067. }
  14068. var n = new B.Quaternion(i.x, i.y, i.z, i.w);
  14069. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate()), n.x *= -1, n.w *= -1, e.camera_position = U.toPrecision(this.camera.position.toArray(), 4), e.camera_quaternion = U.toPrecision(n.toArray(), 4), e.zoom = this.zoomLevel, t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  14070. }, t.prototype.closePopup = function () {
  14071. if (g_currentHot) {
  14072. g_currentHot = null, document.getElementById("popup").style.display = "none", document.querySelector(".popup-content").removeChild(document.getElementById("id1")), $("#popup iframe:last").remove();
  14073. document.getElementById("bgaudio");
  14074. return g_bgAudio && g_bgAudio.paused && 0 != g_bgAudio.readyState && 1 === g_play && g_bgAudio.play(), !1
  14075. }
  14076. }, t.prototype.setupCustomProperties = function (e) {
  14077. var i = e || V.PANORAMA;
  14078. Object.defineProperty(this, "mode", {
  14079. get: function () {
  14080. return i
  14081. },
  14082. set: function (e) {
  14083. var t = i;
  14084. i = e, this.onModeUpdated(t, i)
  14085. }
  14086. })
  14087. }, t.prototype.isInMode = function () {
  14088. for (var e = 0; e < arguments.length; e++)
  14089. if (this.mode === arguments[e]) return !0;
  14090. return !1
  14091. }, t.prototype.isOutsideMode = function (e) {
  14092. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  14093. }, t.prototype.is360View = function (e, t) {
  14094. return e === V.PANORAMA && t && !t.isAligned()
  14095. }, t.prototype.setScene = function (e) {
  14096. this.sceneIntersectionPlane = e.plane, this.path.setScene(e), this.moveReticuleToScene(e)
  14097. }, t.prototype.moveReticuleToScene = function (e) {
  14098. this.reticule.parent && this.reticule.parent.remove(this.reticule), e.add(this.reticule)
  14099. }, t.prototype.updateModel = function () {
  14100. function n(e) {
  14101. var t = this.cameraControls.cameras[V.DOLLHOUSE],
  14102. i = this.cameraControls.controls[V.DOLLHOUSE],
  14103. n = t.position.y + (e - i.target.y),
  14104. r = k.showFloorDuration + k.showFloorDelay;
  14105. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor), G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  14106. }
  14107. this.model = this.modelManager.getActiveModel(), this.model.on("floor.changed", function (e, t, i) {
  14108. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  14109. }.bind(this)), this.model.on("allfloors.toggled", function (e, t) {
  14110. if (this.mode === V.DOLLHOUSE) {
  14111. var i = e ? this.model.center.y : i = t.center.y;
  14112. n.call(this, i)
  14113. }
  14114. }.bind(this)), this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  14115. var t = this;
  14116. this.model.panos.list.forEach(function (e) {
  14117. e.vrMarker.addEventListener("click", function () {
  14118. t.flyToPano({
  14119. pano: e
  14120. })
  14121. })
  14122. })
  14123. }, t.prototype.updateModelDependentData = function () {
  14124. this.cameraControls.setModelForControls(this.model), this.getPanoMarkersFromModel(this.model)
  14125. }, t.prototype.onModelChanged = function () {
  14126. this.updateModel(), this.updateModelDependentData()
  14127. }, t.prototype.getPanoMarkersFromModel = function (e) {
  14128. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  14129. return t.marker ? e.concat(t.marker) : e
  14130. }, [])
  14131. }, t.prototype.handleControlMove = function (e) {
  14132. this.emit(W.Move, e)
  14133. }, t.prototype.handleControlInputStart = function (e) {
  14134. this.emit(W.InputStart, e)
  14135. }, t.prototype.onModeUpdated = function (e, t) {
  14136. this.cameraControls.activateControls(t), this.emit(W.ModeChanged, e, t)
  14137. }, t.prototype.isWarping = function () {
  14138. return this.path.warping
  14139. }, t.prototype.isWaitingToWarp = function () {
  14140. return this.path.waitingToWarp
  14141. }, t.prototype.getLabelScaleFactor = function () {
  14142. if (this.isOutsideMode()) {
  14143. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  14144. }
  14145. return .5
  14146. }, t.prototype.changeMusic = function () {
  14147. !this.director.tourIsPlaying && g_play && g_bgAudio ? (g_playAudio = g_bgAudio, g_bgAudio.play()) : g_play ? g_playAudio = null : g_playAudio = g_bgAudio
  14148. }, t.prototype.bindEvents = function (e) {
  14149. e !== document && e.setAttribute("tabindex", -1), e.addEventListener("mousedown", this.onMouseDown.bind(this)), e.addEventListener("mousemove", this.onMouseMove.bind(this)), e.addEventListener("mouseover", this.onMouseOver.bind(this)), e.addEventListener("mouseout", this.onMouseOut.bind(this)), e.addEventListener("mouseup", this.onMouseUp.bind(this)), this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)), e.addEventListener("touchstart", this.onTouchStart.bind(this)), e.addEventListener("touchmove", this.onTouchMove.bind(this)), e.addEventListener("touchend", this.onTouchEnd.bind(this)), e.addEventListener("pointerdown", this.onPointerDown.bind(this)), e.addEventListener("pointermove", this.onPointerMove.bind(this)), e.addEventListener("pointerup", this.onPointerUp.bind(this)), e.addEventListener("pointerout", this.onPointerOut.bind(this)), e.addEventListener("pointercancel", this.onPointerCancel.bind(this)), document.addEventListener("keydown", this.onKeyDown.bind(this)), this.cameraControls.on(u.Move, this.handleControlMove.bind(this)), this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)), this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)), this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)), window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)), window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)), window.getSeft && getSeft(this), /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  14150. }, t.prototype.onMouseDown = function (e) {
  14151. e.currentTarget !== document && e.currentTarget.focus(), 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1), this.updateIntersect())
  14152. }, t.prototype.onMouseMove = function (e) {
  14153. this.isTouchEvent = !1, this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  14154. }, t.prototype.onMouseOver = function (e) {
  14155. this.containsMouse = !0, !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  14156. }, t.prototype.onMouseOut = function (e) {
  14157. this.containsMouse = !1
  14158. }, t.prototype.onMouseUp = function (e) {
  14159. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  14160. }, t.prototype.onTouchStart = function (e) {
  14161. if (e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown) {
  14162. this.couldBeLongTap = !0;
  14163. var t = x.average(e.changedTouches, "clientX"),
  14164. i = x.average(e.changedTouches, "clientY");
  14165. this.handleInputStart.call(this, t, i, !0), this.mouseDownTimer = setTimeout(function () {
  14166. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0)
  14167. }.bind(this), k.input.longTapThreshold)
  14168. }
  14169. }, t.prototype.onTouchMove = function (e) {
  14170. var t = x.average(e.changedTouches, "clientX"),
  14171. i = x.average(e.changedTouches, "clientY");
  14172. this.handleInputMove.call(this, t, i, !0)
  14173. }, t.prototype.onTouchEnd = function (e) {
  14174. if (clearTimeout(this.mouseDownTimer), this.mouseDown) {
  14175. this.couldBeLongTap = !1, this.updateIntersect();
  14176. var t = x.average(e.changedTouches, "clientX"),
  14177. i = x.average(e.changedTouches, "clientY");
  14178. this.handleInputEnd.call(this, t, i, !0)
  14179. }
  14180. }, t.prototype.onPointerDown = function (e) {
  14181. return e.currentTarget !== document && e.currentTarget.focus(), this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0, this.handleInputStart.call(this, e.clientX, e.clientY, !0), void(this.mouseDownTimer = setTimeout(function () {
  14182. this.updateIntersect(), this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  14183. }.bind(this), k.input.longTapThreshold)))
  14184. }, t.prototype.onPointerMove = function (e) {
  14185. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  14186. }, t.prototype.onPointerUp = function (e) {
  14187. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer), this.couldBeLongTap = !1, this.updateIntersect(), void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  14188. }, t.prototype.onPointerOut = function (e) {
  14189. this.mouseDown = !1
  14190. }, t.prototype.onPointerCancel = function (e) {
  14191. this.mouseDown = !1
  14192. }, t.prototype.onKeyDown = function (e) {
  14193. var t = function () {
  14194. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  14195. }.bind(this),
  14196. i = e.which;
  14197. switch (i) {
  14198. case l.F:
  14199. t(), this.changeFloor(-1);
  14200. break;
  14201. case l.R:
  14202. t(), this.changeFloor(1)
  14203. }
  14204. if (this.mode === V.PANORAMA) switch (i) {
  14205. case l.UPARROW:
  14206. case l.W:
  14207. this.flyLocalDirection(T.FORWARD.clone());
  14208. break;
  14209. case l.DOWNARROW:
  14210. case l.S:
  14211. this.flyLocalDirection(T.BACK.clone());
  14212. break;
  14213. case l.A:
  14214. this.flyLocalDirection(T.LEFT.clone());
  14215. break;
  14216. case l.D:
  14217. this.flyLocalDirection(T.RIGHT.clone())
  14218. }
  14219. }, t.prototype.handleScrollPinchZoom = function (e) {
  14220. var t = e,
  14221. i = this.zoomLevel;
  14222. this.zoomBy(t), this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  14223. }, t.prototype.handleControlPinch = function (e) {
  14224. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0, 0, e).normalize())
  14225. }, t.prototype.handleControlScroll = function (e) {
  14226. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed), 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0, 0, -e).normalize())
  14227. }, t.prototype.handleInputStart = function (e, t, i) {
  14228. var n = this.handelPadding(e, t);
  14229. e = n.x, t = n.y, this.isTouchEvent = i, U.convertScreenPositionToNDC(e, t, this.mouse), U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown), this.mouseCouldBeClickToMove = !0, this.mouseDown = !0, this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  14230. }, t.prototype.handelPadding = function (e, t) {
  14231. return this.pad || (this.pad = {
  14232. x: dom.getOffset("left", $("#player")[0]),
  14233. y: dom.getOffset("top", $("#player")[0])
  14234. }), {
  14235. x: e - this.pad.x,
  14236. y: t - this.pad.y
  14237. }
  14238. }, t.prototype.handleInputMove = function (e, t, i) {
  14239. var n = this.handelPadding(e, t);
  14240. e = n.x, t = n.y, this.isTouchEvent = i, U.convertScreenPositionToNDC(e, t, this.mouse), this.mouseAtMouseDown.distanceTo(this.mouse) > k.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1, this.couldBeLongTap = !1, clearTimeout(this.mouseDownTimer)), this.mouseLastMoveTime = Date.now(), this.reticule.move(e, t, i)
  14241. }, t.prototype.handleInputEnd = function (e, t, i) {
  14242. if (this.isTouchEvent = i, this.mouseDown = !1, this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"), !i && this.couldBeLongTap) return !0;
  14243. if (this.handleLongTap()) return !0;
  14244. if (this.mouseCouldBeClickToMove) {
  14245. if (this.flying) return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType), !0;
  14246. if (this.checkHotClick()) return !0;
  14247. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"), this.history.invalidate(), this.intersect) return this.flyToPanoClosestToMouse();
  14248. if (this.mode === V.PANORAMA) {
  14249. var n = this.closestPanoInDirection(this.getMouseDirection());
  14250. return n ? this.flyToPano({
  14251. pano: n
  14252. }) : this.bump(this.getMouseDirection())
  14253. }
  14254. }
  14255. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  14256. }, t.prototype.handleLongTap = function () {
  14257. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA)) return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"), !0
  14258. }, t.prototype.checktagClick = function () {
  14259. if (this.tagManager.intersectTag) {
  14260. var e = this.isTouchEvent,
  14261. t = this.tagManager.clickedOnTag(e, this);
  14262. return e || t || G.cancelById(q.LookTransition), !0
  14263. }
  14264. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1
  14265. }, t.prototype.rankedtagInDirection = function (e, t) {
  14266. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  14267. }, t.prototype.start = function (e) {
  14268. var t = e.mode,
  14269. i = e.pano,
  14270. n = e.position,
  14271. r = e.quaternion,
  14272. o = e.tag,
  14273. a = e.quickstart,
  14274. s = $.Deferred();
  14275. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews();
  14276. var l = this.is360View(t, i);
  14277. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s), s.done(function (e) {
  14278. this.emit(W.Ready, l, e, o)
  14279. }.bind(this)), s.promise()
  14280. }, t.prototype.startOutside = function (e, t) {
  14281. var i = e.mode,
  14282. n = e.pano,
  14283. r = e.position,
  14284. o = e.quaternion,
  14285. a = e.zoom,
  14286. s = e.floorVisibility,
  14287. l = e.tag;
  14288. this.emit(W.StartOutside, k[i].transitionTime), this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0), G.cancelById(q.FlyToViewFloor), i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o), t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  14289. }, t.prototype.startInside = function (e, t, i, n, r) {
  14290. r = r || $.Deferred();
  14291. var o = (this.currentPano = e) && !e.isAligned();
  14292. if (t = o ? e.position : t || e.position, i = i || e.quaternion, e) {
  14293. var a = this.startInside.bind(this, e, t, i, n, r);
  14294. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a)) return
  14295. }
  14296. return this.mode = V.PANORAMA, e.floor.enter(this.mode), this.emit(W.PanoChosen, this.currentPano, this.currentPano), this.switchCameraMode(this.mode, i), this.emit(W.StartInside, o), r.resolve(!0), r
  14297. }, t.prototype.startInsideWithFlyin = function (i, e, n, t, r) {
  14298. if (r = r || $.Deferred(), this.dollhouseMode(), !i) return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."), r.resolve(!1), r;
  14299. e = e || i.position;
  14300. var o = n || this.cameraControls.activeControl.camera.quaternion,
  14301. a = i.position;
  14302. return this.fitDollhouse(a, e, o), setTimeout(function (e) {
  14303. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  14304. var t = {
  14305. mode: V.PANORAMA,
  14306. pano: i,
  14307. quaternion: n,
  14308. callback: function () {
  14309. this.emit(W.FlyinFinished), r.resolve(!0)
  14310. }.bind(this)
  14311. };
  14312. this.flyToNewMode(t)
  14313. }.bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay), r
  14314. }, t.prototype.checkAndWaitForPanoLoad = (Z = {}, K = {}, function (t, e, i, n, r, o, a, s, l, c) {
  14315. if (function () {
  14316. for (var e in Z)
  14317. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3) return !0;
  14318. return !1
  14319. }()) return !0;
  14320. var h = function (e, t, i) {
  14321. j.delayOneFrame(function () {
  14322. Z[e] = !1, r && r(t, i)
  14323. }.bind(this))
  14324. }.bind(this, t.id),
  14325. u = function (e, t) {
  14326. j.delayOneFrame(function () {
  14327. Z[e] = !1, o && o(t)
  14328. }.bind(this))
  14329. }.bind(this, t.id);
  14330. try {
  14331. return null != s || (s = !0), this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s), Z[t.id] && (K[t.id] = performance.now()), Z[t.id]
  14332. } catch (e) {
  14333. throw Z[t.id] = !1, K[t.id] = performance.now() - 5e3, e
  14334. }
  14335. }), t.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  14336. if (!e) throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  14337. return r && this.model.waitForLoad(e, function () {
  14338. return e.isLoaded(i)
  14339. }), !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  14340. }, t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3, function (e, t, i, n, r, o, a, s) {
  14341. if (!e) throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  14342. return X.copy(T.FORWARD), this.getDirection(X), !e.isLoaded(t) && (o && this.model.waitForLoad(e, function () {
  14343. return e.isLoaded(t)
  14344. }), e.loadTiledPano(t, X, null, a, s).done(function (e, t) {
  14345. i && i(e, t)
  14346. }.bind(this)).fail(function (e) {
  14347. n && n(e)
  14348. }.bind(this)).progress(function (e, t, i) {
  14349. r && r(e, t, i)
  14350. }.bind(this)), !0)
  14351. }), t.prototype.switchCameraMode = function (e, t) {
  14352. var i = this.cameraControls.controls[e],
  14353. n = i.camera;
  14354. switch (e) {
  14355. case V.PANORAMA:
  14356. n.position.copy(this.currentPano.position);
  14357. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  14358. i.lookAt(r.add(n.position));
  14359. break;
  14360. case V.DOLLHOUSE:
  14361. var o = this.position.clone();
  14362. this.mode === V.PANORAMA ? o.add(new B.Vector3(0, 6, 0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6), n.position.copy(o), i.target.copy(this.target.clone().setY(this.model.center.y));
  14363. break;
  14364. case V.FLOORPLAN:
  14365. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight), i.target.copy(this.model.center).setY(0), i.zoomToContain(this.model.size), i.rotateToView(this.model.size, this.getDirection())
  14366. }
  14367. i.update(0)
  14368. }, t.prototype.update = (new B.Vector3, N = {}, F = [], function (e) {
  14369. this.updatePersistentZooming(e), this.updateFromControls(e), this.getCurrentNodePanos(F), this.hasChanged(N) && (this.lastChangeTime = Date.now(), !this.mouseDown && this.containsMouse && this.updateIntersect(), this.emit(W.ViewChanged)), this.model.supportsTiles && (this.updateTileDownloader(F), this.updatePanoRenderer(F)), this.updatePreRendering(F), this.reticule.update(), this.path.update(), this.spider.update(), this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates), this.updateControlLocks(), this.model.supportsTiles && this.updateZoomPano()
  14370. }), t.prototype.updatePersistentZooming = function (e) {
  14371. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  14372. }, t.prototype.updateControlLocks = function () {
  14373. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  14374. }, t.prototype.updatePanoRenderer = (D = new B.Vector3, function (e) {
  14375. var t = this.nextPano || this.currentPano;
  14376. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD), this.getDirection(D), this.panoRenderer.updateDirection(D))
  14377. }), t.prototype.cleanupInactivePanos = (O = [], L = [], function () {
  14378. O.length = 0, O.push(this.currentPano), this.nextPano && O.push(this.nextPano);
  14379. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++) L.push(this.panoRenderer.activePanos[e]);
  14380. for (var t = 0; t < L.length; t++) {
  14381. for (var i = L[t], n = !0, r = 0; r < O.length; r++) i.id === O[r].id && (n = !1);
  14382. n && i.exit()
  14383. }
  14384. }), t.prototype.updatePreRendering = (w = {}, function (e) {
  14385. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  14386. var t = this.nextPano || this.currentPano;
  14387. if (t && e && 1 < e.length) {
  14388. var i = e.findIndex(function (e) {
  14389. if (e.id === t.id) return !0
  14390. });
  14391. if (0 <= i && i + 1 < e.length) {
  14392. var n = e[i + 1];
  14393. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function (e) {
  14394. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1), window.setTimeout(function (e) {
  14395. w[e.id] = !1
  14396. }.bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  14397. }.bind(this, n), k.tiling.panoPreRenderDelay), w[n.id] = !0)
  14398. }
  14399. }
  14400. }
  14401. }), t.prototype.enablePreRendering = function () {
  14402. this.preRenderingEnabled = !0
  14403. }, t.prototype.disablePreRendering = function () {
  14404. this.preRenderingEnabled = !1, this.cleanupInactivePanos()
  14405. }, t.prototype.updateTileDownloader = (b = new B.Vector3, function (e) {
  14406. var t = this.nextPano || this.currentPano;
  14407. t && (b.copy(T.FORWARD), this.getDirection(b), this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null), this.tileDownloader.processPriorityQueue = !0)
  14408. }), t.prototype.updateFromControls = function (e) {
  14409. null != e || (e = 0), this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e), this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion), this.position.copy(this.cameraControls.activeControl.camera.position), this.target.copy(this.cameraControls.activeControl.target), this.cameraControls.activeControl.camera.updateProjectionMatrix(), this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)), this.camera.position.copy(this.position), this.camera.quaternion.copy(this.quaternion), this.camera.updateMatrix(), this.camera.updateMatrixWorld()
  14410. }, t.prototype.hasChanged = function (e) {
  14411. if (!this.previousState) return this.previousState = {
  14412. allFloorsVisible: this.model.allFloorsVisible,
  14413. position: this.position.clone(),
  14414. quaternion: this.quaternion.clone(),
  14415. mouse: this.mouse.clone(),
  14416. labelScaleFactor: this.getLabelScaleFactor(),
  14417. currentFloor: this.model.currentFloor,
  14418. projectionMatrix: this.camera.projectionMatrix.clone(),
  14419. worldMatrix: this.camera.matrixWorld.clone(),
  14420. mode: this.mode,
  14421. modelPosition: this.model.position.clone(),
  14422. modelCenter: this.model.center.clone(),
  14423. zoomLevel: this.zoomLevel
  14424. }, !0;
  14425. 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;
  14426. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible, e.moved = !this.position.equals(this.previousState.position), e.rotated = !this.quaternion.equals(this.previousState.quaternion), e.mouseMoved = !this.mouse.equals(this.previousState.mouse), e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor, e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor, e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix), e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix), e.modeChanged = this.mode !== this.previousState.mode, e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition), e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter), e.nextPanoActive = null !== this.nextPano, e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel, this.previousState.allFloorsVisible = this.model.allFloorsVisible, this.previousState.position.copy(this.position), this.previousState.quaternion.copy(this.quaternion), this.previousState.mouse.copy(this.mouse), this.previousState.labelScaleFactor = this.getLabelScaleFactor(), this.previousState.currentFloor = this.model.currentFloor, this.previousState.projectionMatrix.copy(this.camera.projectionMatrix), this.previousState.worldMatrix.copy(this.camera.matrixWorld), this.previousState.mode = this.mode, this.previousState.modelPosition.copy(this.model.position), this.previousState.modelCenter.copy(this.model.center), this.previousState.zoomLevel = this.zoomLevel, !t
  14427. }, t.prototype.updateIntersect = function () {
  14428. var e = this.flying || this.isWarping(),
  14429. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  14430. i = G.getById(q.LookTransition);
  14431. e || t || this.isTouchEvent || i.length && i[0].running;
  14432. this.intersect = this.getMouseIntersect(), this.intersect && this.updateClosestPano(this.intersect), this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect), k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  14433. }, t.prototype.checkHotClick = function () {
  14434. if (this.intersectHot) return this.intersectHot.examine(this), !0
  14435. }, t.prototype.getMouseDirection = function (e) {
  14436. e = e || this.mouse;
  14437. var t = new B.Vector3(e.x, e.y, -1).unproject(this.camera);
  14438. return new B.Vector3(e.x, e.y, 1).unproject(this.camera).sub(t).normalize()
  14439. }, t.prototype.getMouseIntersect = function (e, t) {
  14440. for (var i in e = e || this.mouse.clone(), t = t || this.model.floors.reduce(function (e, t) {
  14441. return t.hidden ? e : e.concat(t.collider.children)
  14442. }, this.mode === V.PANORAMA ? this.panoMarkers : []), this.model.hots) t.push(this.model.hots[i].mesh);
  14443. i = new B.Vector3(e.x, e.y, -1).unproject(this.camera);
  14444. this.raycaster.set(i, this.getMouseDirection(e));
  14445. var n = this.raycaster.intersectObjects(t);
  14446. if ("add" == g_HotStatus) {
  14447. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  14448. console.log(r[0]), 1 <= r.length ? ($("#player").css("cursor", "cell"), window.hotPointPos = r[0].point) : ($("#player").css("cursor", "not-allowed"), window.hotPointsPos = !1)
  14449. }
  14450. if (0 === n.length) return this.intersectHot = null, "add" != g_HotStatus && $("#player").css("cursor", ""), null;
  14451. var o = n[0];
  14452. if ("hotSprite" == o.object.type) return this.intersectHot = o.object.belongHot, void $("#player").css("cursor", "pointer");
  14453. this.intersectHot = null, "add" != g_HotStatus && $("#player").css("cursor", ""), o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion), this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(), this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5, o.horizontal = .8 < o.normal.y);
  14454. return o
  14455. }, t.prototype.updateClosestPano = function (e) {
  14456. var t = [a.filters.isPanoAligned()];
  14457. if (this.mode === V.PANORAMA) {
  14458. if (!this.currentPano) return;
  14459. t.push(a.filters.not(this.currentPano)), t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)), t.push(a.filters.isNeighbourPanoTo(this.currentPano)), t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)), t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  14460. } else t.push(a.filters.isOnVisibleFloor()), this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  14461. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  14462. i !== this.closestPano ? (i && (this.isPanoHover = !0), this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode), this.closestPano = i) : this.isPanoHover = !1
  14463. }, t.prototype.dollhouseMode = function (e, t) {
  14464. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE), this.mode = V.DOLLHOUSE, this.cameraControls.controls[V.DOLLHOUSE].reset();
  14465. var i = new B.Vector3(this.model.center.x, 0, this.model.center.z),
  14466. n = new B.Vector3(15, 10, 15);
  14467. if (e && t) {
  14468. var r = T.FORWARD.clone().applyQuaternion(t),
  14469. o = this.model.center.clone().sub(e).dot(r);
  14470. 0 < o ? (i = r.clone().multiplyScalar(o).add(e), n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  14471. }
  14472. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0), this.cameraControls.controls[V.DOLLHOUSE].target.copy(i), this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n), this.updateFromControls(), this.model.alpha = 1, this.model.skybox.material.uniforms.opacity.value = 0
  14473. }, t.prototype.insideMode = function (e, t) {
  14474. var i = $.Deferred(),
  14475. n = t || null;
  14476. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  14477. var r = [a.filters.isPanoAligned()];
  14478. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)), e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]), this.flyToNewMode({
  14479. mode: V.PANORAMA,
  14480. pano: e,
  14481. callback: n
  14482. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  14483. } else {
  14484. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  14485. i.reject(o)
  14486. }
  14487. return i.promise()
  14488. }, t.prototype.fitDollhouse = function (e, t, i) {
  14489. var n = T.FORWARD.clone().applyQuaternion(i);
  14490. i = n.clone().add(e);
  14491. this.cameraControls.activeControl.target.copy(i), this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  14492. }, t.prototype.floorplanMode = function (e, t, i) {
  14493. this.mode = V.FLOORPLAN;
  14494. var n = this.cameraControls.controls[V.FLOORPLAN];
  14495. n.reset();
  14496. var r = e || this.model.center;
  14497. if (n.target.copy(r).setY(0), n.camera.position.copy(r).setY(k.floorplan.cameraHeight), i ? (n.currentScale = i / ($("#player").width() / $("#player").height()), n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size), t) {
  14498. var o = T.LEFT.clone().applyQuaternion(t);
  14499. n.rotateLeft(-Math.atan2(o.x, o.z))
  14500. } else n.rotateToView(this.model.size, this.getDirection());
  14501. n.update(0)
  14502. }, t.prototype.nonInterruptingFlyToPano = function (e, t) {
  14503. return e.skipWarpingCheck = !0, this.flyToPano(e, t)
  14504. }, t.prototype.flyToPano = function (e, t) {
  14505. var i, n = e.pano,
  14506. r = e.lookAtPoint,
  14507. o = e.duration,
  14508. a = e.aimDuration,
  14509. s = e.maxDistanceOverride,
  14510. l = e.skipWarpingCheck,
  14511. c = e.constantMoveSpeed,
  14512. h = null,
  14513. u = null;
  14514. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n), this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD)) return Y.warn("Player.flyToPano() -> Cannot fly when warping"), t && t(), !1;
  14515. if (this.updateLastView(), this.mode !== V.PANORAMA) return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())), void this.flyToNewMode({
  14516. mode: V.PANORAMA,
  14517. pano: n,
  14518. duration: o,
  14519. quaternion: i,
  14520. callback: t
  14521. });
  14522. if (!n || (h = x.deepExtend(e), u = function () {
  14523. j.delayOneFrame(function () {
  14524. this.flyToPano(h, t)
  14525. }.bind(this))
  14526. }.bind(this), !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  14527. var d = function (e) {
  14528. t && t(e)
  14529. }.bind(this);
  14530. this.currentPano || (this.currentPano = n, this.path.placeCpm(), this.path.fadeOutCpm(k.path.fadeOutTime), this.spider.draw());
  14531. var p = o;
  14532. if ("number" != typeof o) {
  14533. var f = s || k.transition.flytimeMaxDistanceThreshold;
  14534. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  14535. }
  14536. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed), 1 !== this.zoomLevel) switch (k.zoom.transitionStyle) {
  14537. case 1:
  14538. this.smoothZoomToDefault(p / 2);
  14539. break;
  14540. case 2:
  14541. return h = x.deepExtend(e), u = this.flyToPano.bind(this, h, t), void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  14542. }
  14543. if (r) {
  14544. G.cancelById(q.LookTransition), p *= k.transition.aimSlowFactor;
  14545. var g = this.cameraControls.activeControl.camera.quaternion.clone(),
  14546. m = (new B.Matrix4).lookAt(n.position, r, T.UP),
  14547. v = (new B.Quaternion).setFromRotationMatrix(m),
  14548. y = g.clone(),
  14549. A = new B.Vector3;
  14550. if (n === this.currentPano) {
  14551. var C = T.FORWARD.clone().applyQuaternion(g),
  14552. I = T.FORWARD.clone().applyQuaternion(v),
  14553. E = C.angleTo(I);
  14554. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3), void G.start(function (e) {
  14555. y.copy(g), H.quaternion(y, v)(e), A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position), this.cameraControls.activeControl.lookAt(A)
  14556. }.bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  14557. }
  14558. }
  14559. if (n === this.currentPano || this.flying) return void d();
  14560. this.flying = !0;
  14561. var _ = this.position.clone(),
  14562. b = this.currentPano;
  14563. Y.debug("Flying to pano ", n.position), this.emit(W.PanoChosen, this.currentPano, n), this.emit(W.FlyingStarted, n.position, _, n, b), r && G.start(function (e) {
  14564. y.copy(g), H.quaternion(y, v)(e), A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position), this.cameraControls.activeControl.lookAt(A)
  14565. }.bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  14566. var w = c ? null : z[k.transition.movementEasing];
  14567. this.nextPano = n, G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano), G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano), G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function (e) {
  14568. this.flying = !1, this.currentPano !== n && this.currentPano.exit(), n.enter(), this.currentPano = n, this.nextPano = null, this.path.placeCpm(), this.path.fadeOutCpm(k.path.fadeOutTime), this.spider.draw(), this.emit(W.FlyingEnded, n.position, _, n, b), d(e)
  14569. }.bind(this), 0, w, "camFly", q.FlyToPano)
  14570. }
  14571. }, t.prototype.fastForwardActivePanoFlight = function (e) {
  14572. e = e || k.transition.fastForwardFactor / 10 * 4 + 1, G.adjustSpeed(q.FlyToPano, e), G.adjustSpeed(q.LookTransition, e)
  14573. }, t.prototype.flyToPanoClosestToMouse = function () {
  14574. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(), this.intersect && this.updateClosestPano(this.intersect)), this.closestPano) return this.flyToPano({
  14575. pano: this.closestPano
  14576. });
  14577. var e = this.getMouseDirection();
  14578. this.flyDirection(e) || this.flyToPano({
  14579. pano: this.currentPano
  14580. })
  14581. }, t.prototype.flyLocalDirection = function (e) {
  14582. var t = this.getDirection(e),
  14583. i = 1 === e.z ? .4 : .75,
  14584. n = 1 === Math.abs(e.x);
  14585. return this.flyDirection(t, i, n)
  14586. }, t.prototype.flyDirection = function (e, t, i) {
  14587. this.closePopup();
  14588. var n = $.Deferred();
  14589. this.history.invalidate();
  14590. var r = this.closestPanoInDirection(e, t, i);
  14591. return r ? this.flyToPano({
  14592. pano: r
  14593. }, n.resolve.bind(n, !0)) : (this.bump(e), n.resolve(!1)), n.promise()
  14594. }, t.prototype.closestPanoInDirection = function (e, t, i) {
  14595. return this.rankedPanoInDirection(0, e, t, i)
  14596. }, t.prototype.rankedPanoInDirection = (_ = {
  14597. pano: null,
  14598. candidates: []
  14599. }, function (e, t, i, n) {
  14600. e = e || 0, i = void 0 !== i ? i : .75;
  14601. var r = n ? "angle" : "direction";
  14602. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _), this.cachedPanoCandidates = _.candidates, _.pano
  14603. }), t.prototype.bump = function (e) {
  14604. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  14605. var t, i, n, r = k.transition,
  14606. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  14607. a = this.camera.getWorldDirection().dot(e);
  14608. if (.5 < Math.abs(a)) t = function () {
  14609. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  14610. }.bind(this), i = function () {
  14611. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  14612. }.bind(this);
  14613. else {
  14614. var s = this.camera.position.clone(),
  14615. l = e.clone();
  14616. this.raycaster.set(s, l);
  14617. var c = this.model.floors.reduce(function (e, t) {
  14618. return e.concat(t.collider.children)
  14619. }, []),
  14620. h = this.raycaster.intersectObjects(c),
  14621. u = 0 < h.length ? h[0].distance / 25 : .04,
  14622. d = s.clone().add(l.multiplyScalar(u));
  14623. t = function () {
  14624. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  14625. }.bind(this), i = function () {
  14626. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  14627. }.bind(this)
  14628. }
  14629. n = function () {
  14630. this.flying = !1
  14631. }.bind(this), this.flying = !0, t()
  14632. }
  14633. }, t.prototype.changeFloor = function (e) {
  14634. if (!this.is360View(this.mode, this.currentPano))
  14635. if (this.mode === V.PANORAMA) {
  14636. var t = this.history.reversePano(e);
  14637. t && t.isAligned() ? this.flyToPano({
  14638. pano: t
  14639. }) : this.changeFloorByScore(e)
  14640. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  14641. }, t.prototype.changeFloorByScore = (E = {
  14642. pano: null,
  14643. candidates: []
  14644. }, function (e) {
  14645. var t = this.model.nextFloor(e);
  14646. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0, e, 0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E), void(E.pano ? (this.cachedPanoCandidates = E.candidates, this.history.push(e, this.currentPano), this.flyToPano({
  14647. pano: E.pano
  14648. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  14649. }), t.prototype.gotoFloor = function (e) {
  14650. var t = e - this.model.currentFloor.floorIndex;
  14651. this.changeFloor(t)
  14652. }, t.prototype.getDirection = function (e) {
  14653. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  14654. }, t.prototype.flyToSameMode = function (e, t, i, n, r) {
  14655. if (r = r || $.Deferred(), this.mode === V.TRANSITIONING) return Y.warn("should not be transitioning here"), n && n(!1), r.reject().promise();
  14656. var o = i || !1,
  14657. a = i ? i.position : this.position,
  14658. s = this.position.clone(),
  14659. l = this.currentPano;
  14660. if (Y.debug("New pose in mode " + this.mode), !e || (retryCallback = function () {
  14661. j.delayOneFrame(function () {
  14662. this.flyToSameMode(e, t, i, n, r)
  14663. }.bind(this))
  14664. }.bind(this), !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  14665. var c = function () {
  14666. this.emit(W.FlyingEnded, a, s, e, l), n && n(!0)
  14667. }.bind(this),
  14668. h = k[this.mode],
  14669. u = void 0 !== t ? t : h.transitionTime,
  14670. d = new B.Vector3,
  14671. p = new B.Vector3;
  14672. if (this.emit(W.FlyingStarted, a, s, e, l), this.mode === V.PANORAMA) Y.warn("we should not be here for panorama views");
  14673. else if (this.mode === V.DOLLHOUSE)
  14674. if (o) {
  14675. var f = new B.Vector3(0, 1, 0);
  14676. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(i.floorVisibility), p.copy(i.position);
  14677. var g = new B.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  14678. m = new B.Raycaster(p.clone(), g.clone(), 0, 1 / 0).intersectObjects(this.model.colliders),
  14679. v = 3;
  14680. m.length ? (d.copy(m[0].point), v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p), Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  14681. var y = (new B.Matrix4).lookAt(p, d, f),
  14682. A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder),
  14683. C = d.distanceTo(p),
  14684. I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f),
  14685. E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder),
  14686. _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  14687. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  14688. var b = new B.Euler(A.x - E.x, A.y - E.y, A.z - E.z, k.warp.eOrder);
  14689. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y, this.path.burnsDir = Math.sign(b.y);
  14690. var w = new B.Euler(0, 0, 0, k.warp.eOrder),
  14691. T = new B.Vector3;
  14692. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode), G.start(function (e, t) {
  14693. w.x = E.x + e * b.x, w.y = E.y + e * b.y, w.z = E.z + e * b.z;
  14694. var i = _ + e * (C - _);
  14695. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target), this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  14696. }.bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode), G.start(function (e, t) {
  14697. this.cameraControls.controls[V.DOLLHOUSE].update(), this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion), this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  14698. }.bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  14699. } else Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  14700. else if (this.path.placeCpm(), this.path.fadeInCpm(k.path.fadeInTime), i) {
  14701. this.model.warpDestFloors(i.floorVisibility);
  14702. var x = this.cameraControls.cameras[V.FLOORPLAN],
  14703. S = this.cameraControls.controls[V.FLOORPLAN],
  14704. M = S.target.clone(),
  14705. R = i.position.clone().sub(M),
  14706. P = x.position.clone().sub(S.target).length(),
  14707. O = new B.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  14708. L = Math.atan2(S.offset.x, S.offset.z),
  14709. D = Math.atan2(O.x, O.z),
  14710. N = S.absoluteScale,
  14711. F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  14712. G.start(function (e, t) {
  14713. S.target.copy(R).multiplyScalar(e).add(M);
  14714. var i = L + (D - L) * e;
  14715. S.offset.x = P * Math.sin(i), S.offset.z = P * Math.cos(i), x.position.copy(S.target).add(S.offset), S.absoluteScale = N + e * (F - N), S.update(), this.quaternion.copy(x.quaternion), this.position.copy(x.position), this.target.copy(S.target), this.camera.projectionMatrix.copy(x.projectionMatrix)
  14716. }.bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  14717. } else Y.info("flyToSameMode() funny floorplan view? skipping");
  14718. return G.setTimeout(function (e) {
  14719. this.mode = e, c(), r.resolve(!0)
  14720. }.bind(this, this.mode), u, q.FlyToSameMode), this.mode = V.TRANSITIONING, r.promise()
  14721. }
  14722. }, t.prototype.flyToNewMode = function (e, t) {
  14723. var i = (e = e || {}).mode,
  14724. n = e.pano,
  14725. r = e.duration,
  14726. o = e.warpDest,
  14727. a = e.callback,
  14728. s = e.force,
  14729. l = e.quaternion;
  14730. if (t = t || $.Deferred(), this.isWarping()) return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"), a && a(!1), t.reject("Cannot change mode during tour transition").promise();
  14731. if (this.mode === V.TRANSITIONING) return a && a(!1), t.reject("Cannot change mode during mode transition").promise();
  14732. if (i === this.mode) return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)), t.promise()) : (a && a(!1), t.reject("Already in " + i + " mode").promise());
  14733. var c = o || !1;
  14734. Y.debug("Switching mode to " + i);
  14735. var h = function () {
  14736. j.delayOneFrame(function () {
  14737. this.flyToNewMode(e, t)
  14738. }.bind(this))
  14739. }.bind(this);
  14740. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h)) return t.promise();
  14741. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)) return Y.info("Waiting for model textures to be loaded before going out to dollhouse"), this.model.waitForLoad(this.model, function () {
  14742. return this.model.meshTexturesLoaded
  14743. }.bind(this)), this.model.loadMeshTextures().done(h), t.promise();
  14744. this.history.invalidate(), this.updateLastView();
  14745. var u = this.mode,
  14746. d = this.cameraControls.cameras[i];
  14747. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  14748. var p = void 0 !== r ? r : e.transitionTime;
  14749. this.emit(W.ModeChanging, u, i, n), n && (this.currentPano = n), this.switchCameraMode(i, l), G.cancelById(q.LookTransition);
  14750. var f = (new B.Vector3).copy(this.position);
  14751. if (i === V.PANORAMA) this.emit(W.PanoChosen, n, n), setTimeout(function () {
  14752. n.floor.enter(i)
  14753. }.bind(this), p / 2), this.path.fadeOutCpm(k.path.fadeOutTime);
  14754. else if (i === V.DOLLHOUSE) {
  14755. if (c && (this.model.stayPut = !0), o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0), this.path.placeCpm(), this.path.fadeInCpm(k.path.fadeInTime), c) {
  14756. var g = new B.Vector3(this.model.center.x, 0, this.model.center.z);
  14757. f.set(15, 10, 15);
  14758. var m = new B.Vector3(0, 0, -1).applyQuaternion(o.quaternion),
  14759. v = new B.Raycaster(o.position.clone(), m.clone(), 0, 1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  14760. v.length ? (g.copy(v[0].point), f.copy(o.position), this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion), this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)), this.cameraControls.controls[V.DOLLHOUSE].target.copy(g), f.add(this.model.position), d.position.copy(f), this.cameraControls.controls[V.DOLLHOUSE].update()
  14761. }
  14762. } else if (this.path.placeCpm(), this.path.fadeInCpm(k.path.fadeInTime), o) {
  14763. this.model.warpDestFloors(o.floorVisibility);
  14764. var y = this.cameraControls.cameras[V.FLOORPLAN],
  14765. A = this.cameraControls.controls[V.FLOORPLAN],
  14766. C = y.position.clone().sub(A.target),
  14767. I = new B.Vector3(-1, 0, 0).applyQuaternion(o.quaternion).normalize(),
  14768. E = Math.atan2(I.x, I.z);
  14769. A.target.copy(o.position);
  14770. var _ = C.length();
  14771. A.offset.x = _ * Math.sin(E), A.offset.y = 0, A.offset.z = _ * Math.cos(E), y.position.copy(A.target).add(A.offset), A.target.clone().sub(d.position), d.quaternion.copy(o.quaternion), A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom), A.absoluteScale = A.currentScale, A.update()
  14772. } else this.model.currentFloor.enter(i);
  14773. var b = this.currentPano,
  14774. w = this.position.clone();
  14775. return this.emit(W.FlyingStarted, f, w, n, this.currentPano), this.flying = !0, this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15), d.controls.target.set(this.model.center.x, 0, this.model.center.z), d.controls.update()), e.blackoutStyle = P.FADEIN, p = k.show360Views.transitionTime, this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion), this.mode = i, this.path && this.path.popOutCpm(), e.blackoutStyle = P.END, p = k.show360Views.transitionTime, this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode), G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode), G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode), G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode), G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode), G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)), G.setTimeout(function () {
  14776. this.flying = !1, u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(), this.currentPano.enter(), this.path.placeCpm(), this.path.fadeOutCpm(k.path.fadeOutTime), this.spider.draw()), u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(), this.mode = i, this.emit(W.FlyingEnded, f, w, this.currentPano, b), c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(), t.resolve())
  14777. }.bind(this), p, q.FlyToNewMode), this.mode = V.TRANSITIONING, t.promise()
  14778. }, t.prototype.fade360View = function (e, t, i) {
  14779. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e), $(this.domElement).fadeOut(.5 * e, function () {
  14780. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity, this.model.alpha = i.modelAlpha, this.position.copy(t.position), this.quaternion.copy(t.quaternion), this.camera.projectionMatrix.copy(t.projectionMatrix), $(this.domElement).fadeIn(.5 * e)
  14781. }.bind(this))
  14782. }, t.prototype.findDefaultViews = function () {
  14783. this.findDefaultView(this.lastInsideView, !0), this.findDefaultView(this.last360View, !1)
  14784. }, t.prototype.findDefaultView = function (e, i) {
  14785. var t, n = this.model.heroLocations,
  14786. r = this.model.panos,
  14787. o = n.findIndex(function (e) {
  14788. if (e.cameraMode !== V.PANORAMA) return !1;
  14789. var t = r.get(e.panoId);
  14790. return t && t.isAligned() === i
  14791. });
  14792. 0 <= o ? (t = r.get(n[o].panoId), e.update({
  14793. cameraMode: V.PANORAMA,
  14794. pano: t,
  14795. position: n[o].position,
  14796. quaternion: n[o].quaternion
  14797. })) : 0 <= (o = r.list.findIndex(function (e) {
  14798. return e.isAligned() === i
  14799. })) ? (t = r.list[o], e.update({
  14800. cameraMode: V.PANORAMA,
  14801. pano: t,
  14802. position: t.position
  14803. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  14804. }, t.prototype.updateLastView = function () {
  14805. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  14806. pano: this.currentPano,
  14807. position: this.position,
  14808. quaternion: this.quaternion
  14809. })
  14810. }, t.prototype.goToLastView = function (e, t) {
  14811. var i = $.Deferred(),
  14812. n = i.resolve.bind(i),
  14813. r = i.reject.bind(i),
  14814. o = e ? this.lastInsideView : this.last360View;
  14815. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(), this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(), this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  14816. mode: o.cameraMode,
  14817. pano: o.pano,
  14818. quaternion: o.quaternion,
  14819. callback: t
  14820. }).done(n).fail(r), i.promise()
  14821. }, t.prototype.fadeToView = function (e, t, i, n) {
  14822. var r = $.Deferred(),
  14823. o = r.resolve.bind(r),
  14824. a = r.reject.bind(r);
  14825. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano) return Y.warn("Tried to fade to an illegal view", t.cameraMode), a("Cannot go to illegal view"), r.promise();
  14826. var s = (k[t.cameraMode], function () {
  14827. $(this.domElement).fadeIn(.5 * i), n && n(), o()
  14828. }.bind(this)),
  14829. l = e ? P.FADEIN : P.END;
  14830. return this.tagManager.hideShowTagsForBlackoutStyle(l, i), $(this.domElement).fadeOut(.5 * i, function () {
  14831. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0), t.cameraMode === V.PANORAMA ? this.flyToPano({
  14832. pano: t.pano,
  14833. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  14834. duration: 0
  14835. }, s) : this.flyToNewMode({
  14836. mode: t.cameraMode,
  14837. quaternion: t.quaternion,
  14838. duration: 0,
  14839. callback: s
  14840. })
  14841. }.bind(this)), r.promise()
  14842. }, t.prototype.startWarp = function (e, t, i, n, r, o) {
  14843. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1), this.flying) return Y.warn("Player.startWarp() -> Cannot warp when flying"), o && o(), !1;
  14844. null != e || (e = M.Show), this.history.invalidate(), e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  14845. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  14846. return this.emit(W.WarpStarted, a, i, n, r), n = n || P.MIDDLE, this.path.warpToPano(i, n, r, function () {
  14847. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(), this.emit(W.WarpEnded, i), this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0), o && o()
  14848. }.bind(this)), e === M.Hide && this.path.discardPathObject(), !0
  14849. }, t.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  14850. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"), s && s(), !1)
  14851. }, t.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  14852. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"), a && a(), !1)
  14853. }, t.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  14854. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  14855. }, t.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  14856. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t), !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"), t && t(), !1)
  14857. }, t.prototype.aimTourCamera = function (e, t, i, n) {
  14858. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"), this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  14859. }, t.prototype.showPathToHeroLocation = function (e) {
  14860. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  14861. }, t.prototype.tourInterlude = function (e, t) {
  14862. this.history.invalidate(), this.path.discardSlow();
  14863. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid],
  14864. n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0,
  14865. r = i && i.music ? i.time - n : 2e3;
  14866. this.path.waitNextStep(e, function () {
  14867. t && t()
  14868. }.bind(this), r)
  14869. }, t.prototype.stopInterlude = function () {
  14870. this.interruptAndFastForward(null, 0)
  14871. }, t.prototype.interruptAndFastForward = function (e, t) {
  14872. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t), this.flying && this.emit(W.FlyingInterrupted), this.path.interruptAndFastForward(e, t)
  14873. }, t.prototype.setSize = function (e, t) {
  14874. var i = e / t;
  14875. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  14876. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  14877. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV, this.cameraControls.cameras) {
  14878. var o = this.cameraControls.cameras[r];
  14879. o.fov = this.baseFov * (1 / this.zoomLevel), o.updateAspect(i)
  14880. }
  14881. }, t.prototype.toJSON = function () {
  14882. var e = {};
  14883. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode), this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function (e) {
  14884. return e.hidden ? 0 : 1
  14885. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)), e
  14886. }, t.prototype.getCurrentNodePanos = function (e) {
  14887. if (this.model.panos.map, e.length = 0, this.path.nodes)
  14888. for (var t = 0; t < this.path.nodes.length; t++) {
  14889. var i = this.path.nodes[t];
  14890. e.push(this.model.panos.get(i))
  14891. }
  14892. }, t.prototype.zoomIncrementally = function (e) {
  14893. var t = this.zoomLevel;
  14894. this.zoomTo(this.zoomLevel + e), t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  14895. }, t.prototype.zoomInIncrementally = function (e) {
  14896. e = e || this.defaultZoomIncrement, this.zoomIncrementally(e)
  14897. }, t.prototype.zoomOutIncrementally = function (e) {
  14898. e = e || -this.defaultZoomIncrement, this.zoomIncrementally(e)
  14899. }, t.prototype.zoomBy = function (e) {
  14900. this.zoomTo(this.zoomLevel * e)
  14901. }, t.prototype.zoomIn = function () {
  14902. this.zoomBy(1 + this.zoomSpeed)
  14903. }, t.prototype.zoomOut = function () {
  14904. this.zoomBy(1 - this.zoomSpeed)
  14905. }, t.prototype.zoomTo = function (e, t) {
  14906. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min), e > k.zoom.max && (e = k.zoom.max), e > this.zoomLevel ? (this.emit(m.ZoomIn), e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut), e === k.zoom.min && this.emit(m.ZoomMin)), this.cameraControls.activeControl)) {
  14907. var i = this.cameraControls.activeControl.camera;
  14908. this.zoomLevel = e, i.fov = this.baseFov * (1 / this.zoomLevel), i.updateProjectionMatrix(), this.zoomFov = i.fov
  14909. }
  14910. }, t.prototype.increaseZoomSpeed = function () {
  14911. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  14912. }, t.prototype.decreaseZoomSpeed = function () {
  14913. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  14914. }, t.prototype.clampZoomSpeed = function (e) {
  14915. return e < 0 ? 0 : e
  14916. }, t.prototype.activatePersistentZooming = function (e) {
  14917. this.zooming = e ? 1 : -1
  14918. }, t.prototype.deactivatePersistentZooming = function () {
  14919. this.zooming = 0
  14920. }, t.prototype.zoomDefault = function () {
  14921. this.zoomTo(1, !0)
  14922. }, t.prototype.smoothZoomToDefault = function (e, t) {
  14923. var i, n = this.zoomLevel,
  14924. r = function (e) {
  14925. 1 < e && (e = 1), i = n * (1 - e) + e, this.zoomTo(i, !0)
  14926. }.bind(this),
  14927. o = function () {
  14928. this.zoomDefault(), t && window.setTimeout(t, 50)
  14929. }.bind(this);
  14930. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  14931. }, t.prototype.updateZoomPano = function () {
  14932. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  14933. var e = this.currentPano;
  14934. if (e) {
  14935. var t = this.zoomLevel > k.zoom.activationThreshold,
  14936. i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(), t);
  14937. this.tileDownloader.tilePrioritizer.setZoomingActive(i), this.panoRenderer.setZoomingActive(i, e, !0);
  14938. var n = function (e, t) {
  14939. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()), this.panoRenderer.clearAllQueuedUploadsForPano(e.id), this.panoRenderer.renderPanoTiles(e.id, null, !1, !1), e.setZoomed(t)
  14940. }.bind(this);
  14941. i && !e.zoomed ? (n(e, !0), this.panoRenderer.enableUltraHighQualityMode(function () {
  14942. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom), i && n(e, !0)
  14943. }.bind(this))) : !t && e.zoomed && n(e, !1)
  14944. }
  14945. }
  14946. }, ee.exports = t
  14947. }).call(this, "/js/player.js")
  14948. }, {
  14949. "./constants": 8,
  14950. "./enum/AlignmentType": 17,
  14951. "./enum/BlackoutStyle": 18,
  14952. "./enum/ControlEvents": 21,
  14953. "./enum/Keys": 30,
  14954. "./enum/ModelManagerEvents": 33,
  14955. "./enum/PanoSizeClass": 36,
  14956. "./enum/PanoramaEvents": 37,
  14957. "./enum/PathDiscardMode": 38,
  14958. "./enum/PathDisplayMode": 39,
  14959. "./enum/PlayerEvents": 40,
  14960. "./enum/TagStates": 44,
  14961. "./enum/Vectors": 50,
  14962. "./enum/Viewmode": 51,
  14963. "./enum/WarpStyle": 52,
  14964. "./enum/ZoomEvents": 53,
  14965. "./exception/BasicException": 55,
  14966. "./model/ModelManager": 140,
  14967. "./objects/NSpider": 147,
  14968. "./objects/Panorama": 148,
  14969. "./objects/Reticule": 149,
  14970. "./objects/ShowPath": 151,
  14971. "./objects/Snapshot": 153,
  14972. "./objects/View": 154,
  14973. "./settings": 166,
  14974. "./shaders": 167,
  14975. "./tile/TileDownloader": 171,
  14976. "./tile/TilePrioritizer": 172,
  14977. "./util/ZoomStats": 179,
  14978. "./util/browser": 182,
  14979. "./util/camera": 183,
  14980. "./util/cameraLight": 184,
  14981. "./util/common": 185,
  14982. "./util/easing": 186,
  14983. "./util/history": 187,
  14984. "./util/lerp": 188,
  14985. "./util/logger": 189,
  14986. "./util/math": 190,
  14987. "./util/transitions": 195,
  14988. hot: "hot",
  14989. scaleImg: "scaleImg",
  14990. events: 202,
  14991. three: 217
  14992. }],
  14993. scaleImg: [function (e, t) {
  14994. var i = t;
  14995. (function () {
  14996. function e(e, t, i, n) {
  14997. function r() {
  14998. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d, U.height = p, H = U.getContext("2d")
  14999. }
  15000. function o(e) {
  15001. if (e) {
  15002. var t, i = H.getImageData(0, 0, d, p),
  15003. n = i.data;
  15004. for (t = 0; t < ie; t += 4) n[t] = e[t] * ne | 0, n[t + 1] = e[t + 1] * ne | 0, n[t + 2] = e[t + 2] * ne | 0, n[t + 3] = e[t + 3] * ne | 0;
  15005. return delete e, i
  15006. }
  15007. return H.getImageData(0, 0, d, p)
  15008. }
  15009. function a(e, t, i, n, r) {
  15010. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  15011. }
  15012. var s, l;
  15013. if (t || (t = e.input, i = e.output, n = e.inputRemovable, e.scale && (e = e.scale)), t.src)
  15014. if (s = document.createElement("canvas"), null != t.naturalWidth) s.width = t.naturalWidth, s.height = t.naturalHeight;
  15015. else if (null != t.runtimeStyle) {
  15016. var c = t.runtimeStyle,
  15017. h = c.width,
  15018. u = c.height;
  15019. c.width = "auto", c.height = "auto", s.width = t.width, s.height = t.height, c.width = h, c.height = u
  15020. } else {
  15021. h = t.width, u = t.height;
  15022. t.removeAttribute && (t.removeAttribute("width"), t.removeAttribute("height")), s.width = t.width, s.height = t.height, t.width = h, t.height = u
  15023. } else s = t;
  15024. l = s.getContext("2d"), t.src && l.drawImage(t, 0, 0);
  15025. var d, p, f = s.width,
  15026. g = s.height,
  15027. m = l.getImageData(0, 0, f, g).data;
  15028. if (!f || !g) return !1;
  15029. (t.src || n) && s.clearRect(0, 0, f, g), p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0, e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0, g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0, e * g + .5 | 0);
  15030. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2,
  15031. $ = f << 2,
  15032. ee = 0,
  15033. te = 0,
  15034. ie = J * p,
  15035. ne = 255.99 / 255,
  15036. re = d / f,
  15037. oe = p / g,
  15038. ae = re * oe;
  15039. if (1 < re || 1 < oe)
  15040. for (r(), G = (z = o()).data, C = 0; C < p; C++)
  15041. for (V = (y = C / oe) - (w = 0 | y), j = w * $, W = w < 1 ? j : j - $, w < g - 2 ? (Y = j + $, q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $, A = 0; A < d; A++, te += 4) Z = (b = 0 | (v = A / re)) << 2, b < f - 2 ? (K = Z + 4, Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4, D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0, ++Z, ++K, ++Q, F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0, ++Z, ++K, ++Q, B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0, ++Z, ++K, ++Q, N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0, G[te] = 0 <= D ? D < 256 ? D : 255 : 0, G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0, G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0, G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  15042. else {
  15043. if (le.Float32Array) L = new Float32Array(ie);
  15044. else
  15045. for (L = [], te = 0; te < ie; ++te) L[te] = 0;
  15046. for (y = 0; y < g; y++)
  15047. for (I = (_ = 0 | (C = y * oe)) * J, (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C, R = C + oe - _ - 1), v = 0; v < f; v++, ee += 4) switch (A = v * re, E = 0 | A, te = I + (E << 2), P = !!((E - (A + re | 0)) * (f - 1 - v)), P && (x = 1 + E - A, S = A + re - E - 1), D = m[ee], F = m[ee + 1], B = m[ee + 2], N = m[ee + 3], P + O) {
  15048. case 0:
  15049. L[te] += D * ae, L[te + 1] += F * ae, L[te + 2] += B * ae, L[te + 3] += N * ae;
  15050. break;
  15051. case 1:
  15052. T = x * oe, L[te] += D * T, L[te + 1] += F * T, L[te + 2] += B * T, L[te + 3] += N * T, T = S * oe, L[te + 4] += D * T, L[te + 5] += F * T, L[te + 6] += B * T, L[te + 7] += N * T;
  15053. break;
  15054. case 2:
  15055. T = re * M, L[te] += D * T, L[te + 1] += F * T, L[te + 2] += B * T, L[te + 3] += N * T, T = re * R, L[te += J] += D * T, L[te + 1] += F * T, L[te + 2] += B * T, L[te + 3] += N * T;
  15056. break;
  15057. default:
  15058. T = x * M, L[te] += D * T, L[te + 1] += F * T, L[te + 2] += B * T, L[te + 3] += N * T, T = S * M, L[te + 4] += D * T, L[te + 5] += F * T, L[te + 6] += B * T, L[te + 7] += N * T, T = x * R, L[te += J] += D * T, L[te + 1] += F * T, L[te + 2] += B * T, L[te + 3] += N * T, T = S * R, L[te + 4] += D * T, L[te + 5] += F * T, L[te + 6] += B * T, L[te + 7] += N * T
  15059. }
  15060. delete m, r(), z = o(L)
  15061. }
  15062. if (H.putImageData(z, 0, 0), "string" == typeof i) {
  15063. var se;
  15064. if ("png" === i || "jpeg" === i) return (se = n && t.src ? t : new Image).width = d, se.height = p, se.src = U.toDataURL("image/" + i, .85), se;
  15065. if ("png-src" === i || "jpeg-src" === i) return U.toDataURL("image/" + i.split("-")[0], .85)
  15066. }
  15067. return U
  15068. }
  15069. var le = this;
  15070. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e), exports.scale = e) : c = e
  15071. }).call(this), i.exports = c
  15072. }, {}],
  15073. 156: [function (i, n, e) {
  15074. (function (e) {
  15075. "use strict";
  15076. function t(e, t) {
  15077. this.model = e, this.panos = e.panos, this.player = t, this.imagePanos = this.listImagePanos(), this.retryMinimumTime = 1e4
  15078. }
  15079. var r = (i("three"), i("./enum/Viewmode")),
  15080. o = (i("./settings"), i("./objects/Panorama")),
  15081. a = new(i("./util/logger"))(e);
  15082. t.prototype.start = function () {
  15083. this.loadNextPano(function (e) {
  15084. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"), setTimeout(function () {
  15085. this.start()
  15086. }.bind(this), 1e3))
  15087. }.bind(this))
  15088. }, t.prototype.validLoadTarget = function (e) {
  15089. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  15090. }, t.prototype.listImagePanos = function () {
  15091. var i = [],
  15092. n = this;
  15093. return this.model.images.forEach(function (e) {
  15094. if (e.metadata && e.metadata.scan_id) {
  15095. var t = n.model.panos.get(e.metadata.scan_id);
  15096. t && !t.isLoaded("high") && i.push(t)
  15097. }
  15098. }), i
  15099. }, t.prototype.nextNotLoadedImage = function () {
  15100. for (; 0 < this.imagePanos.length;) {
  15101. var e = this.imagePanos[0];
  15102. if (!e.isLoaded("high")) return e;
  15103. this.imagePanos.shift()
  15104. }
  15105. return null
  15106. }, t.prototype.loadNextPano = function (e) {
  15107. var t, i, n = this.model.waitQueue.filter(function (e) {
  15108. return e.object instanceof o
  15109. });
  15110. 0 < n.length ? (t = n[0].object, a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano, a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano, a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high", t = this.imagePanos[0], a.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode !== r.PANORAMA || (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())])) && a.debug("Normal pano selection: neighbor " + t.id), t ? (i = i || t.isLoaded("low") ? "high" : "low", a.debug("Preloading " + i + "-res pano " + t.id), t.loadCube(i).done(e).fail(function () {
  15111. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"), e()
  15112. })) : e && e(null)
  15113. }, n.exports = t
  15114. }).call(this, "/js/preloaders.js")
  15115. }, {
  15116. "./enum/Viewmode": 51,
  15117. "./objects/Panorama": 148,
  15118. "./settings": 166,
  15119. "./util/logger": 189,
  15120. three: 217
  15121. }],
  15122. 157: [function (a, s, e) {
  15123. (function (e) {
  15124. "use strict";
  15125. function t(e, t, i, n, r) {
  15126. this.qualityManager = e, this.scene = t, this.camera = i, this.container = r, this.controls = n, this.controls.enabled = !0, this.controls.locked = !0, this.quickstartCamera = n.camera, this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()), this.skybox = null
  15127. }
  15128. var i = a("three"),
  15129. n = a("../util/logger"),
  15130. o = a("../constants"),
  15131. h = (a("../util/transitions"), a("../util/lerp"), a("../util/easing"), a("../enum/Vectors")),
  15132. u = a("../enum/PanoSizeClass"),
  15133. r = (a("../materials/ModelTextureMaterial"), a("../materials/CubemapMaterial")),
  15134. d = (a("../cameras/PanoramaCamera"), a("../controls/PanoramaControls"), a("../tile/TileUtils"), a("../util/camera"), a("../util/cameraLight")),
  15135. p = (a("../util/browser"), a("../settings"), a("../gui/helpManager"), new n(e));
  15136. t.prototype.load = function (e) {
  15137. e.pano.shouldRedrawOnBaseLoaded = !0;
  15138. var t, i, n = this,
  15139. r = h.FORWARD.clone().applyQuaternion(e.quaternion),
  15140. o = r.clone().negate();
  15141. this.controls.lookAt(r.add(this.quickstartCamera.position));
  15142. var a = this.qualityManager.getPanoSize(u.BASE),
  15143. s = this.qualityManager.getPanoSize(u.STANDARD);
  15144. if (e.pano.tiled) {
  15145. p.warn("Loading startPano, TILED", e.pano.id);
  15146. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height()),
  15147. c = this.quickstartCamera.fov;
  15148. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"), t = e.pano.loadTiledPano(s, r, {
  15149. hFov: l,
  15150. vFov: c
  15151. }, !1, !1, !0), i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  15152. } else p.warn("Loading startPano", e.pano.id), t = e.pano.loadCube("high");
  15153. return $.when(t).then(function () {
  15154. n.init(e.pano, e.quaternion), e.pano.tiled ? i.done(function () {
  15155. e.pano.lockUntilRenderingComplete = !1, this.controls.locked = !1
  15156. }.bind(this)) : this.controls.locked = !1
  15157. }.bind(this))
  15158. }, t.prototype.init = function (e, t) {
  15159. p.info("Quickstart done loading, adding scene objects"), e.lockUntilRenderingComplete = !0, this.skybox = new i.Mesh(new i.CubeGeometry(1, 1, 1), new r({
  15160. side: i.BackSide
  15161. })), this.skybox.material.uniforms.map.value = e.getSkyboxTexture(), this.skybox.quaternion.copy(e.quaternion), this.scene.add(this.skybox), $(this.container).show()
  15162. }, t.prototype.update = function (e) {
  15163. this.controls.update(e), this.camera.copy(this.quickstartCamera)
  15164. }, t.prototype.setSize = function (e, t) {
  15165. this.quickstartCamera.updateAspect(e / t)
  15166. }, t.prototype.destroy = function () {
  15167. this.scene.remove(this.skybox)
  15168. }, s.exports = t
  15169. }).call(this, "/js/scene/QuickstartManager.js")
  15170. }, {
  15171. "../cameras/PanoramaCamera": 7,
  15172. "../constants": 8,
  15173. "../controls/PanoramaControls": 13,
  15174. "../enum/PanoSizeClass": 36,
  15175. "../enum/Vectors": 50,
  15176. "../gui/helpManager": 68,
  15177. "../materials/CubemapMaterial": 117,
  15178. "../materials/ModelTextureMaterial": 118,
  15179. "../settings": 166,
  15180. "../tile/TileUtils": 174,
  15181. "../util/browser": 182,
  15182. "../util/camera": 183,
  15183. "../util/cameraLight": 184,
  15184. "../util/easing": 186,
  15185. "../util/lerp": 188,
  15186. "../util/logger": 189,
  15187. "../util/transitions": 195,
  15188. three: 217
  15189. }],
  15190. 158: [function (e, t, i) {
  15191. "use strict";
  15192. function h(e, t, i) {
  15193. this.scene = e, this.camera = t, this.renderer = null, this.effects = i, this.animateCallback = null, this.composer = null, this.qualityManager = null, e.renderWidth = 0, e.renderHeight = 0, this.updateClock = new M.Clock, this.components = [], this.updateListeners = [], this.resizeListeners = [], this.forceUpdateSize = !1, this.started = !1, this.textures = {}, this.suspendedObjects = []
  15194. }
  15195. var o, a, n, M = e("three"),
  15196. R = e("../shaders"),
  15197. r = e("../enum/SceneRendererEvents"),
  15198. f = e("../enum/GLTextureType"),
  15199. s = e("../enum/GLCubeFaces"),
  15200. l = e("../exception/BasicException"),
  15201. c = e("../exception/RendererCreationException"),
  15202. u = e("../util/browser"),
  15203. d = e("../settings"),
  15204. p = e("events").EventEmitter;
  15205. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame, (h.prototype = Object.create(p.prototype)).addComponent = function (e) {
  15206. this.components.push(e), e.update && this.updateListeners.push(e), e.setSize && (this.resizeListeners.push(e), this.forceUpdateSize = !0)
  15207. }, h.prototype.removeComponent = function (t) {
  15208. function e(e) {
  15209. return e !== t
  15210. }
  15211. this.components = this.components.filter(e), this.updateListeners = this.updateListeners.filter(e), this.resizeListeners = this.resizeListeners.filter(e)
  15212. }, h.prototype.start = function (e) {
  15213. if (this.started) throw new l("Can't start SceneRenderer, already started");
  15214. this.createContext(e), this.boluoVrInit(), this.initComposer(), this.started = !0, (b = b.bind(this))()
  15215. }, h.prototype.createContext = function (e) {
  15216. try {
  15217. this.renderer = new M.WebGLRenderer, this.renderer.autoClear = !0, this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1), this.renderer.setSize($("#player").width(), $("#player").height(), !1), this.emit(r.ContextCreated)
  15218. } catch (e) {
  15219. throw new c("Unable to create a WebGL rendering context")
  15220. }
  15221. d.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement)
  15222. }, h.prototype.overrideTextures = function () {
  15223. var d = this.renderer.context,
  15224. t = 0,
  15225. i = d.createTexture;
  15226. d.createTexture = function () {
  15227. var e = i.call(d);
  15228. return e.id = t++, this.textures[e.id] = e
  15229. }.bind(this);
  15230. var p = d.texImage2D;
  15231. d.texImage2D = function (e, t, i, n, r, o, a, s, l) {
  15232. var c, h = this.getTextureTypeFromTarget(d, e);
  15233. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D), void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n, s = r, n = (l = o).naturalWidth, r = l.naturalHeight, p.call(d, e, t, i, a, s, l));
  15234. var u = this.textures[c.id];
  15235. u.width = h === f.TextureCube ? 6 * n : n, u.height = r
  15236. }.bind(this);
  15237. var n = d.deleteTexture;
  15238. d.deleteTexture = function (e) {
  15239. delete this.textures[e.id], n.call(d, e)
  15240. }.bind(this)
  15241. }, h.prototype.updateTextureMemory = (n = null, function () {
  15242. var e = 0;
  15243. for (var t in this.textures) {
  15244. var i = this.textures[t];
  15245. i.width && i.height && (e += i.width * i.height * 4)
  15246. }
  15247. e !== n && this.emit(r.MemoryUsageUpdated, e), n = e
  15248. }), h.prototype.getTextureTypeFromTarget = function (e, t) {
  15249. switch (t) {
  15250. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  15251. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  15252. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  15253. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  15254. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  15255. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  15256. return f.TextureCube;
  15257. case e.TEXTURE_2D:
  15258. return f.Texture2D;
  15259. default:
  15260. return null
  15261. }
  15262. }, h.prototype.initComposer = function () {
  15263. this.composer = new M.EffectComposer(this.renderer), this.composer.addPass(new M.RenderPass(this.scene, this.camera)), this.composer.addPass(this.effects.hblurPass), this.composer.addPass(this.effects.vblurPass)
  15264. }, h.prototype.setSize = function (e, t, i) {
  15265. this.renderWidth = e, this.renderHeight = t, this.effects.aspect = e / t, this.renderer.setSize(e, t, !1, i), this.composer.setSize(e, t);
  15266. for (var n = 0; n < this.resizeListeners.length; n++) this.resizeListeners[n].setSize(e, t)
  15267. }, h.prototype.render = function () {
  15268. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  15269. }, h.prototype.boluoVrInit = function () {
  15270. console.log("boluoVrInit"), this.isHuawei5X = u.detectHUAWEI5X(), this.oldRenderer = this.renderer, this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera), window.panoCamera = this.camera;
  15271. var i = this;
  15272. window._vrEnabled = !1, Object.defineProperty(window, "vrEnabled", {
  15273. get: function () {
  15274. return window._vrEnabled
  15275. },
  15276. set: function (e) {
  15277. (e = !!e) ? (i.renderer = i.newRenderer, window.vrMarkers.forEach(function (e) {
  15278. e.visible = !0
  15279. })) : (i.renderer = i.oldRenderer, window.vrMarkers.forEach(function (e) {
  15280. e.visible = !1
  15281. })), i.cursor.visible = e, i.setSize(window.innerWidth, window.innerHeight), window._vrEnabled = e, setTimeout(function () {
  15282. console.log(player.cameraControls.activeControl.camera.fov)
  15283. }, 500)
  15284. }
  15285. }), this.createCursor(.5, !1, 1, 16777215, 0);
  15286. var e = {
  15287. setSize: function (e, t) {
  15288. i.camera.aspect = e / t
  15289. }
  15290. };
  15291. this.resizeListeners.push(e), this.vrLoadingInit()
  15292. }, h.prototype.vrLoadingInit = function () {
  15293. var e = new(e = function () {
  15294. var t = this,
  15295. e = new M.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  15296. i = new M.MeshBasicMaterial({
  15297. color: 4967932,
  15298. side: M.DoubleSide
  15299. }),
  15300. n = new M.Mesh(e, i);
  15301. (this.mesh = n).position.z = -2, n.scale.set(.08, .08, .08), n.visible = !1, window.player.camera.add(n), t.enabled = !1, this.update = function (e) {
  15302. 1 == t.enabled && (n.rotation.z += 15 * e)
  15303. }
  15304. })(this.camera);
  15305. window.Loading = e, this.updateListeners.push(e)
  15306. }, h.prototype.createCursor = function (e, t, i, n, r) {
  15307. var o, a = new M.SpriteMaterial({
  15308. opacity: i,
  15309. color: n,
  15310. transparent: t,
  15311. map: this.boluoGetTexture("images/cursor.png"),
  15312. needsUpdate: !0,
  15313. side: M.DoubleSide
  15314. });
  15315. a.map.offset = new M.Vector2(1 / 17 * r, 0), a.map.repeat = new M.Vector2(1 / 17, 1), a.depthTest = !1, a.blending = M.AdditiveBlending, (o = new M.Sprite(a)).scale.set(.3, .3, .3), o.position.z = -2, o.visible = !1, o.name = "cursor", this.camera.add(o), this.scene.add(this.camera), this.cursor = o;
  15316. var s = new this.CursorAnimation(this.scene, o, this.camera);
  15317. this.cursor.triggerTargetEvent = s.triggerTargetEvent, this.updateListeners.push(s)
  15318. }, h.prototype.CursorAnimation = function (e, t, o) {
  15319. this.cursor = t, this.raycaster = new M.Raycaster, this.targetEventObj = {}, this.type = 1, this.tweenFlag = !0;
  15320. var s = this;
  15321. this.target = o, console.log(o.uuid), this.euler = new M.Euler, this.q0 = new M.Quaternion, this.q1 = new M.Quaternion(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this.zee = new M.Vector3(0, 0, 1), this.alpha = -1e3, this.beta = -1e3, this.gamma = -1e3, this.orient = M.Math.degToRad(window.orientation || 0), window.addEventListener("orientationchange", function () {
  15322. s.orient = M.Math.degToRad(window.orientation || 0)
  15323. }), window.addEventListener("deviceorientation", function (e) {
  15324. var t = M.Math.degToRad(e.alpha),
  15325. i = M.Math.degToRad(e.beta),
  15326. n = M.Math.degToRad(e.gamma);
  15327. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t), -1e3 === s.beta && (s.beta = i), -1e3 === s.gamma && (s.gamma = n), .06 < Math.abs(t - s.alpha) && (s.alpha = t), .006 < Math.abs(i - s.beta) && (s.beta = i), .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t, s.beta = i, s.gamma = n), h.vrDebug) {
  15328. $("#info-device-orientation").css("display", "block");
  15329. var r = "";
  15330. r += "alpha=(" + s.alpha + ")<BR/>", r += "beta=(" + s.beta + ")<BR/>", r += "gamma=" + s.gamma + "<BR/>", document.getElementById("info-device-orientation").innerHTML = r
  15331. }
  15332. }), this.setObjectQuaternion = function (e, t, i, n, r) {
  15333. s.euler.set(i, t, -n, "YXZ"), e.setFromEuler(s.euler), e.multiply(s.q1), e.multiply(s.q0.setFromAxisAngle(s.zee, -r)), o.updateMatrixWorld()
  15334. }, parent !== window && window.addEventListener("message", function (e) {
  15335. var t, i, n, r, o = JSON.parse(e.data),
  15336. a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  15337. o && o.alpha && o.beta && o.gamma && (t = a, i = M.Math.degToRad(o.alpha), n = M.Math.degToRad(o.beta), r = M.Math.degToRad(o.gamma), t ? (-1e3 === s.alpha && (s.alpha = i), -1e3 === s.beta && (s.beta = n), -1e3 === s.gamma && (s.gamma = r), .06 < Math.abs(i - s.alpha) && (s.alpha = i), .006 < Math.abs(n - s.beta) && (s.beta = n), .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i, s.beta = n, s.gamma = r))
  15338. }), this.update = function (e) {
  15339. TWEEN.update(), window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient), this.triggerTargetEvent())
  15340. }, this.triggerTargetEvent = function () {
  15341. var e = this.choseObj(),
  15342. t = e ? e.object : void 0;
  15343. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e), 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(), t && t.enabled && this.startAnimate(function () {
  15344. this.clickCallback(t)
  15345. }.bind(this))) : this.type, this.targetEventObj.lastObj = t)
  15346. }, this.choseObj = function () {
  15347. this.raycaster.setFromCamera({
  15348. x: 0,
  15349. y: 0
  15350. }, o);
  15351. var e = (this.raycaster.ray, window.vrMarkers),
  15352. t = this.raycaster.intersectObjects(e);
  15353. if (0 < t.length) return t[0]
  15354. }, this.clickCallback = function (e) {
  15355. this.runTHREEAction(e, "onclick")
  15356. }, this.runTHREEAction = function (e, t) {
  15357. switch (t) {
  15358. case "onclick":
  15359. e._listeners && e._listeners.click && e._listeners.click.forEach(function (e) {
  15360. e()
  15361. });
  15362. break;
  15363. case "onhover":
  15364. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function (e) {
  15365. e()
  15366. });
  15367. break;
  15368. case "onout":
  15369. e._listeners && e._listeners.out && e._listeners.out.forEach(function (e) {
  15370. e()
  15371. })
  15372. }
  15373. }, this.startAnimate = function (e) {
  15374. this.tweenFlag && this.initAnimation(e)
  15375. }, this.initAnimation = function (e) {
  15376. var t = this,
  15377. i = this.cursor.material.map.offset;
  15378. t.tweenFlag = !1, this.cursorAnimate = new TWEEN.Tween(i).to({
  15379. x: 1
  15380. }, 1e3).onStart(function () {
  15381. t.tweenFlag = !1
  15382. }).onStop(function () {
  15383. t.tweenFlag = !0, this.x = 0, i.x = 0
  15384. }).onUpdate(function () {}).onComplete(function () {
  15385. e(), i.x = 0, setTimeout(function () {
  15386. t.tweenFlag = !0
  15387. }, 1500)
  15388. }), this.cursorAnimate.easing(function (e) {
  15389. return Math.floor(17 * e) / 17
  15390. }), this.cursorAnimate.start()
  15391. }, this.autoCursorPosition = function (e) {
  15392. this.cursor.scale.set(.3, .3, .3)
  15393. }
  15394. }, h.prototype.vrRenderer = function (a, i, e) {
  15395. var s = new i.vrCamera(e);
  15396. s.bananaAspect = .8, this.width, this.height;
  15397. i = this;
  15398. this.setSize = function (e, t) {
  15399. a.setSize.call(this, e, t), i.width = e, i.height = t
  15400. }, this.render = function (e, t, i, n) {
  15401. var r, o;
  15402. if (window.cameraQua = t.quaternion.clone(), t.__RESS__SKIP__STEREO__) return a.render(e, t, i, n);
  15403. if ("PerspectiveCamera" === t.type) r = s.cameraL, o = s.cameraR, e.updateMatrixWorld(), null === t.parent && t.updateMatrixWorld(), s.vrCameraUpdate(t);
  15404. else {
  15405. if ("OrthographicCamera" !== t.type) return DEBUG && console.error("Unsupported renderer: ", t.type);
  15406. r = o = t
  15407. }
  15408. a.setScissorTest(!0), a.setScissor(0, 0, this.width / 2, this.height), a.setViewport(0, 0, this.width / 2, this.height), a.render.call(this, e, r, i, n), a.setScissor(this.width / 2, 0, this.width / 2, this.height), a.setViewport(this.width / 2, 0, this.width / 2, this.height), a.render.call(this, e, o, i, n), a.setScissorTest(!1)
  15409. }, this.__proto__ = {
  15410. __proto__: a
  15411. }
  15412. }, h.prototype.vrCamera = function (e) {
  15413. this.type = "StereoCamera", this._aspect = 1, this._overlap = .064, this.cameraL = new M.PerspectiveCamera, this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new M.PerspectiveCamera, this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1, this.eyeRight = new M.Matrix4, this.eyeLeft = new M.Matrix4, this.vrCameraNeedsUpdate = !0, window.vrCameraL = this.cameraL, Object.defineProperty(this, "bananaAspect", {
  15414. get: function () {
  15415. return this._aspect
  15416. },
  15417. set: function (e) {
  15418. this._aspect !== e && (this.vrCameraNeedsUpdate = !0), this._aspect = e
  15419. }
  15420. }), Object.defineProperty(this, "overlap", {
  15421. get: function () {
  15422. return this._overlap
  15423. },
  15424. set: function (e) {
  15425. this._overlap !== e && (this.vrCameraNeedsUpdate = !0), this._overlap = e
  15426. }
  15427. }), this.vrCameraUpdate = function (e) {
  15428. if (this.vrCameraNeedsUpdate = !0, this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far, this.vrCameraNeedsUpdate) {
  15429. this.vrCameraNeedsUpdate = !1, console.debug("vrCameraUpdate"), this.bananaFocus = e.focus, this.bananaFov = e.fov, this.bananaReal_aspect = e.aspect * this.bananaAspect, this.bananaNear = e.near, this.bananaFar = e.far, console.debug(e.aspect), this.bananaFocus = 10;
  15430. var t, i, n = e.projectionMatrix.clone(),
  15431. r = this.overlap / 2,
  15432. o = r * this.bananaNear / this.bananaFocus,
  15433. a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  15434. this.eyeLeft.elements[12] = -r, this.eyeRight.elements[12] = r, t = -a * this.bananaReal_aspect + o, i = a * this.bananaReal_aspect + o, n.elements[0] = 2 * this.bananaNear / (i - t), n.elements[8] = (i + t) / (i - t), this.cameraL.projectionMatrix.copy(n), t = -a * this.bananaReal_aspect - o, i = a * this.bananaReal_aspect - o, n.elements[0] = 2 * this.bananaNear / (i - t), n.elements[8] = (i + t) / (i - t), this.cameraR.projectionMatrix.copy(n)
  15435. }
  15436. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  15437. }
  15438. }, h.prototype.boluoGetTexture = function (e) {
  15439. var t = new M.TextureLoader;
  15440. return t.crossOrigin = "anonymous", t.load(e)
  15441. }, h.prototype.updateScreenSize = function (e) {
  15442. var t, i, n, r = !1;
  15443. e && !e.resize && null != e.width && null != e.height ? (i = e.width, n = e.height, r = !0, t = 1) : (i = $("#player").width(), n = $("#player").height(), e && e.resize && (o = this.renderWidth, a = this.renderHeight), i === o && n === a && !this.forceUpdateSize || (o = i, a = n, r = !0, t = window.devicePixelRatio)), r && (this.setSize(i, n, t), this.forceUpdateSize = !1)
  15444. }, h.prototype.updateComponents = function () {
  15445. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++) this.updateListeners[t].update(e)
  15446. }, h.prototype.suspend = function () {
  15447. this.started = !1, this.suspendedObjects = this.scene.children.map(function (e) {
  15448. return this.scene.remove(e), e
  15449. }.bind(this)), this.render()
  15450. }, h.prototype.resume = function () {
  15451. this.suspendedObjects.forEach(function (e) {
  15452. this.scene.add(e)
  15453. }.bind(this)), this.suspendedObjects = [], this.started = !0, b()
  15454. };
  15455. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function () {
  15456. this.started && (window.requestAnimationFrame(b), this.updateScreenSize(), this.updateComponents(), this.updateTextureMemory(), this.render(), this.emit(r.AfterRender))
  15457. };
  15458. h.prototype.getImageData = (E = document.createElement("canvas"), _ = E.getContext("2d"), function (e, t, i) {
  15459. return E.width === t && E.height === i || (E.width = t, E.height = i), _.drawImage(e, 0, 0, t, i), _.getImageData(0, 0, t, i)
  15460. }), h.prototype.initSizedTexture2D = function (e, t, i) {
  15461. var n = this.renderer,
  15462. r = n.context,
  15463. o = n.state,
  15464. a = new M.Texture(null);
  15465. !(a.flipY = !1) !== i && (i = !1), a.generateMipmaps = i;
  15466. var s = n.paramThreeToGL(a.format),
  15467. l = n.paramThreeToGL(a.type),
  15468. c = n.properties.get(a),
  15469. h = r.createTexture();
  15470. o.bindTexture(r.TEXTURE_2D, h), r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY), r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null), a.wrapS = t, a.wrapT = t;
  15471. var u = n.paramThreeToGL(t);
  15472. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u), i ? (a.magFilter = M.LinearFilter, a.minFilter = M.LinearMipMapLinearFilter, r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST), r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter, a.minFilter = M.LinearFilter, r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)), o.bindTexture(r.TEXTURE_2D, null), c.__webglTexture = h, a
  15473. }, h.prototype.initSizedCubeMap = function (e, t) {
  15474. var i = this.renderer,
  15475. n = i.context,
  15476. r = i.state,
  15477. o = new M.CubeTexture([null, null, null, null, null, null]);
  15478. o.flipY = !1, o.generateMipmaps = t;
  15479. var a = i.paramThreeToGL(o.format),
  15480. s = i.paramThreeToGL(o.type),
  15481. l = i.properties.get(o),
  15482. c = n.createTexture();
  15483. r.bindTexture(n.TEXTURE_CUBE_MAP, c), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  15484. for (var h = 0; h < 6; h++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  15485. return t ? (o.magFilter = M.LinearFilter, o.minFilter = M.LinearMipMapLinearFilter, n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR), n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE), n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter, o.minFilter = M.LinearFilter, n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)), r.bindTexture(n.TEXTURE_CUBE_MAP, null), l.__image__webglTextureCube = c, o
  15486. }, h.prototype.deallocateCubeTexture = function (e) {
  15487. var t = this.renderer,
  15488. i = t.context,
  15489. n = t.properties.get(e);
  15490. i.deleteTexture(n.__image__webglTextureCube)
  15491. }, h.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  15492. var a = this.renderer,
  15493. s = a.context,
  15494. l = a.state,
  15495. c = a.properties.get(t);
  15496. l.bindTexture(s.TEXTURE_2D, c.__webglTexture), s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)), s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e), t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D), l.bindTexture(s.TEXTURE_2D, null)
  15497. }, h.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  15498. var s = this.renderer,
  15499. l = s.context,
  15500. c = s.state,
  15501. h = s.properties.get(t);
  15502. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube), l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY), l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e), t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP), c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  15503. }, h.prototype.rebuildMipMaps2D = function (e) {
  15504. var t = this.renderer,
  15505. i = t.context,
  15506. n = t.state;
  15507. t.properties.get(e), i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  15508. }, h.prototype.rebuildMipMaps3D = function (e) {
  15509. var t = this.renderer,
  15510. i = t.context,
  15511. n = t.state,
  15512. r = t.properties.get(e);
  15513. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube), i.generateMipmap(i.TEXTURE_CUBE_MAP), n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  15514. }, h.prototype.renderToCubeMap = (P = !1, F = N = D = L = O = null, function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  15515. this.renderer.context, P || ((L = new M.OrthographicCamera(-.5, .5, .5, -.5, -200, 200)).position.z = 150, (O = new M.Scene).add(L), D = new M.ShaderMaterial({
  15516. uniforms: {
  15517. tDiffuse: {
  15518. type: "t",
  15519. value: null
  15520. },
  15521. alpha: {
  15522. type: "f",
  15523. value: 1
  15524. }
  15525. },
  15526. vertexShader: R.basicTextured.vertexShader,
  15527. fragmentShader: R.basicTextured.fragmentShader,
  15528. depthWrite: !1,
  15529. depthTest: !1,
  15530. side: M.DoubleSide
  15531. }), N = new M.PlaneBufferGeometry(1, 1), (F = new M.Mesh(N, D)).position.z = 0, O.add(F), P = !0);
  15532. var m = N.getAttribute("uv");
  15533. m.setDynamic(!0), m.needsUpdate = !0;
  15534. var v = m.array,
  15535. y = r / i,
  15536. A = o / n,
  15537. C = a / i,
  15538. I = s / n;
  15539. v[0] = y, v[1] = A + I, v[2] = y + C, v[3] = A + I, v[4] = y, v[5] = A, v[6] = y + C, v[7] = A;
  15540. var E = N.getAttribute("position");
  15541. E.setDynamic(!0), E.needsUpdate = !0;
  15542. var _ = E.array,
  15543. b = l / t.width - .5,
  15544. w = c / t.height - .5,
  15545. T = h / t.width,
  15546. x = u / t.height;
  15547. _[0] = b, _[1] = w + x, _[3] = b + T, _[4] = w + x, _[6] = b, _[7] = w, _[9] = b + T, _[10] = w, this.renderer.properties.get(e), D.uniforms.tDiffuse.value = e, D.blending = p || M.NoBlending, D.transparent = !!f, null != g || (g = 1), D.uniforms.alpha.value = g, D.needUpdate = !0, t.activeCubeFace = d, t.viewport.set(0, 0, t.width, t.height);
  15548. var S = this.renderer.autoClear;
  15549. this.renderer.autoClear = !1, this.renderer.render(O, L, t, !1), this.renderer.autoClear = S
  15550. }), h.prototype.copyCubeMap = (g = !1, C = A = y = v = m = null, I = new M.Euler, new M.Vector3, function (e, t, i, n, r, o, a, s, l) {
  15551. this.renderer, g || ((v = new M.OrthographicCamera(-1, 1, 1, -1, 0, 200)).position.set(0, 0, 0), (m = new M.Scene).add(v), y = new M.ShaderMaterial({
  15552. uniforms: {
  15553. tDiffuse: {
  15554. type: "t",
  15555. value: null
  15556. },
  15557. alpha: {
  15558. type: "f",
  15559. value: 1
  15560. }
  15561. },
  15562. vertexShader: R.copyCubeMap.vertexShader,
  15563. fragmentShader: R.copyCubeMap.fragmentShader,
  15564. depthWrite: !1,
  15565. depthTest: !1,
  15566. side: M.DoubleSide
  15567. }), A = new M.BoxGeometry(2, 2, 2), C = new M.Mesh(A, y), m.add(C), g = !0);
  15568. for (var c = 0; c < 6; c++) h.getCubeOrientationForCubeFace(c, I), C.rotation.copy(I), C.matrixWorldNeedsUpdate = !0, C.updateMatrixWorld(), y.uniforms.tDiffuse.value = e, y.blending = a || M.NoBlending, y.transparent = !!s, null != l || (l = 1), y.uniforms.alpha.value = l, y.needUpdate = !0, t.activeCubeFace = c, t.viewport.set(0, 0, r, o), this.renderer.render(m, v, t, !1)
  15569. }), h.getLookAtForCubeFace = function (e, t) {
  15570. switch (e) {
  15571. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  15572. t.set(1, 0, 0);
  15573. break;
  15574. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  15575. t.set(-1, 0, 0);
  15576. break;
  15577. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  15578. t.set(0, 1, 0);
  15579. break;
  15580. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  15581. t.set(0, -1, 0);
  15582. break;
  15583. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  15584. t.set(0, 0, 1);
  15585. break;
  15586. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  15587. t.set(0, 0, -1)
  15588. }
  15589. }, h.getCubeOrientationForCubeFace = function (e, t) {
  15590. switch (e) {
  15591. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  15592. t.set(0, -Math.PI / 2, 0);
  15593. break;
  15594. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  15595. t.set(0, Math.PI / 2, 0);
  15596. break;
  15597. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  15598. t.set(Math.PI / 2, Math.PI, 0);
  15599. break;
  15600. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  15601. t.set(-Math.PI / 2, Math.PI, 0);
  15602. break;
  15603. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  15604. t.set(0, -Math.PI, 0);
  15605. break;
  15606. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  15607. t.set(0, 0, 0)
  15608. }
  15609. }, t.exports = h
  15610. }, {
  15611. "../enum/GLCubeFaces": 25,
  15612. "../enum/GLTextureType": 26,
  15613. "../enum/SceneRendererEvents": 43,
  15614. "../exception/BasicException": 55,
  15615. "../exception/RendererCreationException": 57,
  15616. "../settings": 166,
  15617. "../shaders": 167,
  15618. "../util/browser": 182,
  15619. events: 202,
  15620. three: 217
  15621. }],
  15622. 159: [function (e, t, i) {
  15623. "use strict";
  15624. function n(e) {
  15625. this.messenger = new a(e), this.clientKey = null
  15626. }
  15627. var o = e("../util/ajax"),
  15628. r = e("./PostMessageType"),
  15629. a = e("./postmessage"),
  15630. s = e("./VersionInfo"),
  15631. l = e("events").EventEmitter,
  15632. c = window.location.origin + "/api/v1/user/";
  15633. (n.prototype = Object.create(l.prototype)).bindEvents = function () {
  15634. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  15635. }, n.prototype.waitForConnection = function () {
  15636. return new Promise(function (t, i) {
  15637. this.messenger.on(r.CONNECT, function (e) {
  15638. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  15639. }.bind(this))
  15640. }.bind(this))
  15641. }, n.prototype.onConnectionReceived = function (i) {
  15642. return this.messenger.setTarget(i.source, i.origin), this.verifyConnection(i).then(function (e, t) {
  15643. this.messenger.send({
  15644. type: r.ACCEPT,
  15645. toId: i.fromId,
  15646. warning: t
  15647. }), this.clientKey = e, this.messenger.removeAllListeners(r.CONNECT), this.bindEvents()
  15648. }.bind(this), function (e) {
  15649. this.messenger.send({
  15650. type: r.REJECT,
  15651. toId: i.fromId,
  15652. reason: e
  15653. }), this.messenger.setTarget()
  15654. }.bind(this))
  15655. }, n.prototype.verifyConnection = function (r) {
  15656. return new Promise(function (e, t) {
  15657. var i;
  15658. if (s.isDeprecated(r.sdkVersion)) i = "这个版本正在被弃用";
  15659. else if (!s.isSupported(r.sdkVersion)) return t("不支持此版本的SDK");
  15660. var n = {
  15661. cache: !1,
  15662. headers: {
  15663. "X-port-Application-Key": r.applicationKey,
  15664. "X-port-Referrer": r.origin
  15665. }
  15666. };
  15667. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  15668. })
  15669. }, n.prototype.onMessageReceived = function (t) {
  15670. if (this.validateClientApplicationKey(t.applicationKey)) {
  15671. var i = this;
  15672. t.onDone = function (e) {
  15673. e.toId = t.fromId, e.uid = t.uid, e.type = r.RESPONSE, i.messenger.send(e)
  15674. }, this.emit(r.ACTION, t)
  15675. }
  15676. }, n.prototype.validateClientApplicationKey = function (e) {
  15677. return this.clientKey === e
  15678. }, n.prototype.sendEvent = function (e, t) {
  15679. this.messenger.send({
  15680. type: r.EVENT,
  15681. eventType: e,
  15682. eventData: t
  15683. })
  15684. }, t.exports = n
  15685. }, {
  15686. "../util/ajax": 181,
  15687. "./PostMessageType": 160,
  15688. "./VersionInfo": 163,
  15689. "./postmessage": 165,
  15690. events: 202
  15691. }],
  15692. 160: [function (e, t, i) {
  15693. "use strict";
  15694. t.exports = Object.freeze({
  15695. CONNECT: "postmessage.connect",
  15696. ACCEPT: "postmessage.accept",
  15697. REJECT: "postmessage.reject",
  15698. ACTION: "postmessage.action",
  15699. RESPONSE: "postmessage.response",
  15700. EVENT: "postmessage.event"
  15701. })
  15702. }, {}],
  15703. 161: [function (e, t, i) {
  15704. "use strict";
  15705. t.exports = Object.freeze({
  15706. MOVE: "sdk.move",
  15707. ENTER_PANO: "sdk.enterpano",
  15708. MODEL_LOADED: "sdk.modelloaded"
  15709. })
  15710. }, {}],
  15711. 162: [function (e, t, i) {
  15712. "use strict";
  15713. t.exports = Object.freeze({
  15714. FLY: "transition.fly",
  15715. FADEOUT: "transition.fade",
  15716. INSTANT: "transition.instant"
  15717. })
  15718. }, {}],
  15719. 163: [function (e, t, i) {
  15720. "use strict";
  15721. t.exports = {
  15722. current: "1.0",
  15723. supported: ["1.0"],
  15724. deprecated: [],
  15725. isSupported: function (e) {
  15726. return -1 !== this.supported.indexOf(e)
  15727. },
  15728. isDeprecated: function (e) {
  15729. return -1 !== this.deprecated.indexOf(e)
  15730. },
  15731. isValid: function (e) {
  15732. return this.isSupported(e) || this.isDeprecated(e)
  15733. }
  15734. }
  15735. }, {}],
  15736. 164: [function (q, X, e) {
  15737. (function (e) {
  15738. "use strict";
  15739. function r(e, t, i) {
  15740. e = e && e.toLowerCase().trim();
  15741. var n = new C.UP.clone,
  15742. r = Math.PI / 3,
  15743. o = Math.PI / 2;
  15744. switch (e) {
  15745. case "left":
  15746. i.copy(t), i.applyAxisAngle(n, o);
  15747. break;
  15748. case "right":
  15749. i.copy(t), i.applyAxisAngle(n, -o);
  15750. break;
  15751. case "forwardleft":
  15752. i.copy(t), i.applyAxisAngle(n, r);
  15753. break;
  15754. case "forwardright":
  15755. i.copy(t), i.applyAxisAngle(n, -r);
  15756. break;
  15757. case "forward":
  15758. default:
  15759. i.copy(t)
  15760. }
  15761. return i
  15762. }
  15763. function o(e, t) {
  15764. if (e) {
  15765. var i = {
  15766. pano: e,
  15767. lookAtPoint: null,
  15768. duration: null,
  15769. maxDistanceOverride: null,
  15770. skipWarpingCheck: !1
  15771. };
  15772. this.player.flyToPano(i, function () {
  15773. t && t({
  15774. success: !0,
  15775. message: "Transition complete."
  15776. })
  15777. })
  15778. } else M.warn("Showcase -> clickPanoObject: Unable to find pano."), t && t({
  15779. success: !1,
  15780. error: "Unable to find pano."
  15781. })
  15782. }
  15783. function a(e, t) {
  15784. t.copy(C.FORWARD), e.getDirection(t)
  15785. }
  15786. function c(i) {
  15787. return {
  15788. panos: i.panos.list.map(function (e) {
  15789. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  15790. return {
  15791. uuid: e.id,
  15792. aligned: e.alignmentType === g.ALIGNED,
  15793. neighbourUUIDs: e.neighbourUUIDs.slice(),
  15794. position: function (e) {
  15795. return e.alignmentType !== g.ALIGNED ? null : {
  15796. x: e.position.x,
  15797. y: e.position.y,
  15798. z: e.position.z
  15799. }
  15800. }(e),
  15801. rotation: function (e) {
  15802. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  15803. return {
  15804. x: h.Math.radToDeg(t._x),
  15805. y: h.Math.radToDeg(t._y),
  15806. z: h.Math.radToDeg(t._z)
  15807. }
  15808. }(e),
  15809. thumbnail: t
  15810. }
  15811. })
  15812. }
  15813. }
  15814. var t, l, i, h = q("three"),
  15815. u = q("./ApiHost"),
  15816. n = q("../util/logger"),
  15817. d = q("../util/common"),
  15818. s = q("../util/math"),
  15819. p = q("../enum/ModelManagerEvents"),
  15820. f = q("./PostMessageType"),
  15821. g = q("../enum/AlignmentType"),
  15822. m = q("../enum/Direction"),
  15823. v = q("./TransitionStyles"),
  15824. y = q("../util/panorama"),
  15825. A = q("../enum/GLCubeFaces"),
  15826. C = q("../enum/Vectors"),
  15827. I = q("../enum/Viewmode"),
  15828. E = q("../enum/WarpStyle"),
  15829. _ = (q("../enum/Keys"), q("../enum/PlayerEvents")),
  15830. b = q("../sdk/SdkEvents"),
  15831. w = (C = q("../enum/Vectors"), q("../enum/ControlEvents")),
  15832. T = q("../enum/RenderLayers"),
  15833. x = (q("../constants"), q("../settings")),
  15834. S = q("../lib/jpeg_encoder"),
  15835. M = new n(e),
  15836. R = (N.active = !1, N.angle = 0, N.angleTravelled = 0, N.playerDirection = new h.Vector3, N.lastFacingDirection = new h.Vector3, N.onDone = null, N.player = null, N.start = function (e, t, i, n) {
  15837. N.active = !0, e && t && (t = 0), N.angle = e || t, N.xAngle = e, N.yAngle = t, N.angleTravelled = 0, N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD), i.getDirection(N.playerDirection), N.lastFacingDirection.copy(N.playerDirection), N.projectVectors(), N.onDone = n, N.player = i, N()
  15838. }, N.projectVectors = function () {
  15839. N.xAngle && (N.playerDirection.projectOnPlane(C.UP), N.lastFacingDirection.projectOnPlane(C.UP))
  15840. }, N),
  15841. P = (i = new h.Vector3, function (e) {
  15842. e ? (i.copy(e.position), i.add(e.discPosition), s.projectPositionToCanvas(i, this.player.camera, i), this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  15843. }),
  15844. O = (l = new h.Vector3, function (e) {
  15845. var t = this.player.getDirection();
  15846. l.copy(t);
  15847. var i = l.y;
  15848. l.y = 0, l.normalize();
  15849. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  15850. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA) return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"), 0;
  15851. this.player.mode === I.DOLLHOUSE && (n = -n);
  15852. var r = function () {
  15853. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  15854. }.call(this) - .1,
  15855. o = function () {
  15856. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  15857. }.call(this) + .1,
  15858. a = n + e;
  15859. r < a ? a = r : a < o && (a = o);
  15860. var s = a - n;
  15861. return 0 < e && s < .01 && (s = 0), e < 0 && -.01 < s && (s = 0), s
  15862. }),
  15863. L = (t = new h.Euler, function (e) {
  15864. return t.setFromQuaternion(e.quaternion, "YXZ"), {
  15865. position: {
  15866. x: e.position.x,
  15867. y: e.position.y,
  15868. z: e.position.z
  15869. },
  15870. rotation: {
  15871. x: h.Math.radToDeg(t.x),
  15872. y: h.Math.radToDeg(t.y),
  15873. z: 0
  15874. },
  15875. pano: e.currentPano ? e.currentPano.id : null,
  15876. mode: e.mode
  15877. }
  15878. }),
  15879. D = null;
  15880. function N() {
  15881. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD), N.player.getDirection(N.playerDirection), N.projectVectors();
  15882. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  15883. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1, N.onDone && (0, N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection), window.setTimeout(N, 4))
  15884. }
  15885. X.exports = {
  15886. init: function (e, t, i, n, r) {
  15887. Y.init(e, t, i, r), D = new Promise(function (e, t) {
  15888. i.on(_.Ready, function () {
  15889. e()
  15890. })
  15891. }.bind(this));
  15892. var o = new u(window),
  15893. a = o.waitForConnection();
  15894. a.then(function (e) {
  15895. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  15896. });
  15897. var s, l = (s = Date.now(), function () {
  15898. if (!(Date.now() - s < 100)) {
  15899. var e = L(i);
  15900. o.sendEvent(b.MOVE, {
  15901. state: e
  15902. }), s = Date.now()
  15903. }
  15904. });
  15905. i.on(_.Move, l), i.on(_.ViewChanged, l), n.on(p.ActiveModelChanged, function (e) {
  15906. function t(e) {
  15907. var t, i = e.newPano.id;
  15908. e.oldPano && (t = e.oldPano.id), i !== t && o.sendEvent(b.ENTER_PANO, {
  15909. oldPano: t,
  15910. newPano: i
  15911. })
  15912. }
  15913. var i = e.model,
  15914. n = e.oldModel;
  15915. Y.model = i, a.then(function () {
  15916. o.sendEvent(b.MODEL_LOADED, {
  15917. metadata: c(i)
  15918. })
  15919. }), n && n.panos.forEach(function (e) {
  15920. e.removeEventListener("enter", t)
  15921. }), i.panos.forEach(function (e) {
  15922. e.on("enter", t)
  15923. })
  15924. })
  15925. }
  15926. };
  15927. var F, B, V, k, U, H, z, G, W, j, Y = {
  15928. director: null,
  15929. player: null,
  15930. controls: null,
  15931. sceneRenderer: null,
  15932. model: null,
  15933. init: function (e, t, i, n) {
  15934. this.director = e, this.player = i, this.controls = t, this.sceneRenderer = n
  15935. },
  15936. handleToObject: {},
  15937. objectToHandle: {},
  15938. handleCount: 0,
  15939. onMessageReceive: function (e) {
  15940. if (e) {
  15941. var t = e.targetFunction,
  15942. i = e.params,
  15943. n = e.onDone;
  15944. t && this[t] && this[t](i, n)
  15945. }
  15946. },
  15947. waitForInit: function (e, t) {
  15948. D.then(t.bind({
  15949. success: !0,
  15950. message: "Init complete."
  15951. }))
  15952. },
  15953. moveToPano: (W = new h.Euler(0, 0, 0, "YXZ"), j = new h.Quaternion, function (e, t) {
  15954. var i = e.pano,
  15955. n = e.rotation,
  15956. r = e.transition;
  15957. if (!this.model) return t({
  15958. success: !1,
  15959. error: "The model has not been loaded yet"
  15960. });
  15961. var o = this.model.panos.get(i);
  15962. if (!o) return t({
  15963. success: !1,
  15964. error: i + " does not exist in this model"
  15965. });
  15966. if (!n) return t({
  15967. sucess: !1,
  15968. erorr: n + " is not a valid rotation"
  15969. });
  15970. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"), console.log(n.z);
  15971. var a = {
  15972. success: !0,
  15973. message: i
  15974. };
  15975. if (r === v.FADEOUT) j.setFromEuler(W), this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  15976. else {
  15977. var s, l;
  15978. r === v.INSTANT && (l = s = 0);
  15979. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  15980. this.player.flyToPano({
  15981. pano: o,
  15982. lookAtPoint: c,
  15983. duration: s,
  15984. aimDuration: l
  15985. }, t.bind(this, a))
  15986. }
  15987. }),
  15988. moveInDirection: function (e, t) {
  15989. var i = e.direction;
  15990. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."), void(t && t({
  15991. success: !1,
  15992. error: "Invalid direction."
  15993. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function (e) {
  15994. t(e ? {
  15995. success: !0,
  15996. message: "moved " + i
  15997. } : {
  15998. success: !1,
  15999. error: "Cannot move in direction: " + i
  16000. })
  16001. })
  16002. },
  16003. getPose: function (e, t) {
  16004. return this.player.camera.position, (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"), t({
  16005. success: !0,
  16006. message: L(this.player)
  16007. })
  16008. },
  16009. takeScreenShot: (z = new h.PerspectiveCamera, G = new h.WebGLRenderTarget, function (e, t) {
  16010. if (!e.resolution) return t({
  16011. success: !1,
  16012. error: "An invalid resolution was specified"
  16013. });
  16014. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  16015. var i = this.sceneRenderer.renderer.getSize();
  16016. e.resolution.width = i.width, e.resolution.height = i.height
  16017. }
  16018. z.layers.set(T.DEFAULT), e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG), e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS), e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  16019. var n = e.resolution.width,
  16020. r = e.resolution.height,
  16021. o = n / r;
  16022. z.position.copy(this.sceneRenderer.camera.position), z.quaternion.copy(this.sceneRenderer.camera.quaternion), z.projectionMatrix.copy(this.player.camera.projectionMatrix), z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o, G.setSize(n, r), this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  16023. var a = new Uint8Array(n * r * 4);
  16024. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  16025. var s = S.encode({
  16026. data: a,
  16027. width: n,
  16028. height: r,
  16029. heading: 180,
  16030. pitch: 0
  16031. }, {
  16032. quality: 75,
  16033. flipY: !0
  16034. });
  16035. t({
  16036. success: !0,
  16037. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  16038. })
  16039. }),
  16040. findRankedPano: (U = new h.Vector3, H = new h.Vector3, function (e, t) {
  16041. a(this.player, H), r(t, H, U);
  16042. var i = this.player.rankedPanoInDirection(e, U);
  16043. if (i) {
  16044. var n = this.objectToHandle[i.id];
  16045. return n || (this.objectToHandle[i.id] = n = this.handleCount++, this.handleToObject[n] = i), n
  16046. }
  16047. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."), -1
  16048. }),
  16049. findRankedtag: (V = new h.Vector3, k = new h.Vector3, function (e, t) {
  16050. a(this.player, k), r(t, k, V);
  16051. var i = this.player.rankedtagInDirection(e, V);
  16052. if (i) {
  16053. var n = this.objectToHandle[i.sid];
  16054. return n || (this.objectToHandle[i.sid] = n = this.handleCount++, this.handleToObject[n] = i), n
  16055. }
  16056. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."), -1
  16057. }),
  16058. clickNearesttag: function (e) {
  16059. this.clickRankedtag(0, e)
  16060. },
  16061. clickRankedtag: function (e, t) {
  16062. var i = function (e, t) {
  16063. var i = this.findRankedtag(e, t);
  16064. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."), null)
  16065. }.call(this, e, t);
  16066. i && P.call(this, i)
  16067. },
  16068. clickNearestPano: function (e, t) {
  16069. this.clickRankedPano(0, e, t)
  16070. },
  16071. clickRankedPano: function (e, t, i) {
  16072. var n = function (e, t) {
  16073. var i = this.findRankedPano(e, t);
  16074. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."), null)
  16075. }.call(this, e, t);
  16076. n ? o.call(this, n, i) : i(null)
  16077. },
  16078. clickPano: function (e, t) {
  16079. var i = this.handleTable[e];
  16080. i ? o.call(this, i, t) : t(null)
  16081. },
  16082. rotateDirection: function (e, t) {
  16083. var i = e.direction,
  16084. n = e.angle;
  16085. if (!R.active) {
  16086. var r = 0,
  16087. o = 0,
  16088. a = 0,
  16089. s = 0;
  16090. if (!n || isNaN(n)) return M.warn("Showcase -> rotateDirection: Invalid rotation angle."), void(t && t({
  16091. success: !1,
  16092. error: "Invalid rotation angle."
  16093. }));
  16094. if (this.player.mode === I.TRANSITIONING) return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"), void(t && t({
  16095. success: !1,
  16096. error: "Cannot rotate while transitioning"
  16097. }));
  16098. if (i === m.RIGHT || i === m.LEFT) i === m.RIGHT && (n = -n), r = 0 < n ? -1 : 1, a = n;
  16099. else {
  16100. if (i !== m.UP && i !== m.DOWN) return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i), void(t && t({
  16101. success: !1,
  16102. error: "Invalid direction for rotation."
  16103. }));
  16104. if (this.player.mode === I.FLOORPLAN) return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"), void(t && t({
  16105. success: !1,
  16106. error: "Cannot rotate " + i + " in floorplan mode"
  16107. }));
  16108. if (i === m.DOWN && (n = -n), 0 === (n = O.call(this, n))) return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i), void(t && t({
  16109. success: !1,
  16110. error: "Already at maximum rotation in direction: " + i
  16111. }));
  16112. o = 0 < n ? 1 : -1, s = n
  16113. }
  16114. var l = n;
  16115. n = h.Math.degToRad(n), a = h.Math.degToRad(a), s = h.Math.degToRad(s);
  16116. var c = this.controls.activeControl;
  16117. c.startRotating(r, o), R.start(a, s, this.player, function () {
  16118. c.stopRotating(!0), t && t({
  16119. success: !0,
  16120. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  16121. })
  16122. })
  16123. }
  16124. },
  16125. rotate: (F = new h.Vector3, B = new h.Vector3, function (e, t) {
  16126. var i = e.xAngle,
  16127. n = e.yAngle;
  16128. if (!R.active) {
  16129. if (i = i || 0, n = n || 0, isNaN(i) || isNaN(n)) return M.warn("Showcase -> rotate: Invalid rotation angle."), void(t && t({
  16130. success: !1,
  16131. error: "Invalid rotation angle."
  16132. }));
  16133. if (this.player.mode === I.TRANSITIONING) return M.warn("Automation -> rotate: Cannot rotate while transitioning"), void(t && t({
  16134. success: !1,
  16135. error: "Cannot rotate while transitioning"
  16136. }));
  16137. Math.abs(i) < .01 && (i = 0), Math.abs(n) < .01 && (n = 0);
  16138. var r = n;
  16139. n = O.call(this, n);
  16140. var o = 0 < r ? "UP" : "DOWN";
  16141. if (!(i = -i) && r && !n) return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o), void(t && t({
  16142. success: !1,
  16143. error: "Already at maximum rotation in direction: " + o
  16144. }));
  16145. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  16146. var a = n;
  16147. n = h.Math.degToRad(n), i = h.Math.degToRad(i), F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD), this.player.getDirection(F), B.copy(F).applyAxisAngle(C.UP, i), B.applyAxisAngle(C.RIGHT, n);
  16148. var s = (F.angleTo(B), 0 < i ? -1 : i < 0 ? 1 : 0),
  16149. l = 0 < n ? 1 : n < 0 ? -1 : 0;
  16150. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  16151. var c = this.controls.activeControl;
  16152. c.startRotating(s, l), R.start(i, n, this.player, function () {
  16153. c.stopRotating(!0), t && t({
  16154. success: !0,
  16155. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  16156. })
  16157. })
  16158. }
  16159. }),
  16160. panCamera: function (e, i) {
  16161. function t(e) {
  16162. switch (r.removeAllListeners(w.AutoPanComplete), r.removeAllListeners(w.AutoPanInterrupt), r.removeAllListeners(w.AutoPanClamped), e) {
  16163. case w.AutoPanInterrupt:
  16164. i({
  16165. success: !0,
  16166. message: "Camera panning interrupted."
  16167. });
  16168. break;
  16169. case w.AutoPanClamped:
  16170. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  16171. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01) return void i({
  16172. success: !1,
  16173. error: "Already at edge of current model bounds."
  16174. });
  16175. var t = "The view point is outside the bounds for the current model. ";
  16176. t += "The view point was clamped to " + o(r.target.x, r.target.z), console.warn(t)
  16177. }
  16178. case w.AutoPanComplete:
  16179. i({
  16180. success: !0,
  16181. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  16182. })
  16183. }
  16184. }
  16185. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN) return i({
  16186. success: !1,
  16187. error: "Camera panning is not available in the current mode: " + this.player.mode
  16188. });
  16189. var n = e.position,
  16190. r = this.player.control;
  16191. r.setAutoPanPosition(n.x, n.z), r.autoPan = !0;
  16192. var o = function (e, t) {
  16193. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  16194. };
  16195. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)), r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)), r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  16196. },
  16197. click: function (e, t) {
  16198. var i = e.x,
  16199. n = e.y;
  16200. !0 === e.percentage && (i = i / 100 * $("#player").width(), n = n / 100 * $("#player").height()), this.player.handleInputStart(i, n), this.player.updateIntersect(), this.player.handleInputEnd(i, n)
  16201. },
  16202. mouseOver: function (e, t) {
  16203. var i = e.x,
  16204. n = e.y;
  16205. !0 === e.percentage && (i = i / 100 * $("#player").width(), n = n / 100 * $("#player").height()), this.player.handleInputMove(i, n), this.player.updateIntersect()
  16206. },
  16207. moveToMode: function (e, t) {
  16208. function i(e) {
  16209. t(e ? {
  16210. success: !1,
  16211. error: "Failed to load new mode: " + e
  16212. } : {
  16213. success: !0,
  16214. message: "Moved to new mode: " + n
  16215. })
  16216. }
  16217. var n = e.mode;
  16218. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function () {
  16219. i()
  16220. }, function (e) {
  16221. i(e)
  16222. }) : t({
  16223. success: !1,
  16224. error: "Invalid mode selection"
  16225. })
  16226. }
  16227. }
  16228. }).call(this, "/js/sdk/automation.js")
  16229. }, {
  16230. "../constants": 8,
  16231. "../enum/AlignmentType": 17,
  16232. "../enum/ControlEvents": 21,
  16233. "../enum/Direction": 22,
  16234. "../enum/GLCubeFaces": 25,
  16235. "../enum/Keys": 30,
  16236. "../enum/ModelManagerEvents": 33,
  16237. "../enum/PlayerEvents": 40,
  16238. "../enum/RenderLayers": 41,
  16239. "../enum/Vectors": 50,
  16240. "../enum/Viewmode": 51,
  16241. "../enum/WarpStyle": 52,
  16242. "../lib/jpeg_encoder": 94,
  16243. "../sdk/SdkEvents": 161,
  16244. "../settings": 166,
  16245. "../util/common": 185,
  16246. "../util/logger": 189,
  16247. "../util/math": 190,
  16248. "../util/panorama": 191,
  16249. "./ApiHost": 159,
  16250. "./PostMessageType": 160,
  16251. "./TransitionStyles": 162,
  16252. three: 217
  16253. }],
  16254. 165: [function (e, t, i) {
  16255. "use strict";
  16256. function n(e) {
  16257. this.sourceWindow = e, this.targetWindow = null, this.targetOrigin = null, this.id = Math.floor(1e5 * Math.random()), this.bindEvents()
  16258. }
  16259. var r = e("./PostMessageType"),
  16260. o = e("events").EventEmitter;
  16261. (n.prototype = Object.create(o.prototype)).bindEvents = function () {
  16262. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  16263. }, n.prototype.setTarget = function (e, t) {
  16264. this.targetWindow = e, this.targetOrigin = t
  16265. }, n.prototype.onPostmessageReceived = function (e) {
  16266. var t = e.origin || e.originalEvent.origin,
  16267. i = e.source;
  16268. switch (e.data.type) {
  16269. case r.CONNECT:
  16270. break;
  16271. case r.RESPONSE:
  16272. if (this.id !== e.data.toId) return;
  16273. default:
  16274. if (!this.validateMessageOrigin(t)) return
  16275. }
  16276. var n = e.data;
  16277. n.source = i, n.origin = t, n.timestamp = Date.now(), this.emit(e.data.type, n)
  16278. }, n.prototype.validateMessageOrigin = function (e) {
  16279. return "*" === this.targetOrigin || e === this.targetOrigin
  16280. }, n.prototype.send = function (e) {
  16281. this.targetWindow && this.targetOrigin && (e.fromId = this.id, this.targetWindow.postMessage(e, this.targetOrigin))
  16282. }, t.exports = n
  16283. }, {
  16284. "./PostMessageType": 160,
  16285. events: 202
  16286. }],
  16287. 166: [function (e, t, i) {
  16288. "use strict";
  16289. var n = e("three"),
  16290. r = e("./util/browser"),
  16291. o = e("./enum/Viewmode"),
  16292. a = e("./enum/VROption"),
  16293. s = e("./enum/Colors"),
  16294. l = e("./enum/WarpStyle"),
  16295. c = e("./util/easing"),
  16296. h = e("./util/common"),
  16297. u = e("./util/showcase"),
  16298. d = e("./constants"),
  16299. p = {
  16300. debug: !1,
  16301. version: "2.25.6-0-gd87e5b1",
  16302. languageTag: r.valueFromHash("lang", null),
  16303. pageTitle: "四维虚拟漫游",
  16304. authorizationHeader: u.getAuthorizationHeader(),
  16305. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  16306. logLevel: r.valueFromHash("log", 2),
  16307. skyboxRadius: 2500,
  16308. modelBoundsPadding: 5,
  16309. showNeighbors: !1,
  16310. brand: r.valueFromHash("brand", !0),
  16311. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  16312. startHighlights: r.valueFromHash("hl", -1),
  16313. specialEdition: r.valueFromHash("bn", 0),
  16314. useWheel: r.valueFromHash("wh", !0),
  16315. crossOrigin: "anonymous",
  16316. fancierTransition: !1,
  16317. wireframe: !1,
  16318. skyboxWireframe: !1,
  16319. modelAlpha: 1,
  16320. highlightPanoSelection: !1,
  16321. showSweeps: !0,
  16322. showSkyboxes: !1,
  16323. showMesh: !0,
  16324. showFloors: !1,
  16325. showFloorDuration: 300,
  16326. showFloorDelay: 300,
  16327. hideFloorDuration: 300,
  16328. hideFloorDelay: 0,
  16329. reticuleOpacityTransitionTime: 250,
  16330. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  16331. markerOpacityTransitionTime: 500,
  16332. guiAnimationSpeed: 250,
  16333. highlightAnimationDuration: 500,
  16334. modelComponentLoadSpinnerDelay: 150,
  16335. captureErrors: !1,
  16336. maxMobileTextures: 6,
  16337. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  16338. startupFlyinDelay: 3e3,
  16339. dollhouseDefault: {
  16340. minDistance: 15,
  16341. maxDistance: 50,
  16342. minPolarAngle: n.Math.degToRad(10),
  16343. maxPolarAngle: n.Math.degToRad(90)
  16344. },
  16345. hideReticuleTimeout: 1e3,
  16346. analytics: {
  16347. inactivityThreshold: 30,
  16348. sessionTrackingRate: .15,
  16349. maxTrackedErrors: 20,
  16350. sessionDurationPingFrequency: 10,
  16351. sessionDurationTimeout: 15
  16352. },
  16353. flydown: {
  16354. movementEasing: "easeInOutQuad",
  16355. movementDelay: .001,
  16356. rotationEasing: "easeInOutQuad",
  16357. rotationDelay: .5,
  16358. modelTextureDelay: .75,
  16359. skyboxDelay: .75
  16360. },
  16361. transition: {
  16362. flySpeed: .001,
  16363. flyTime: 750,
  16364. flytimeMaxDistanceThreshold: 5,
  16365. flytimeDistanceMultiplier: 150,
  16366. aimTime: 1500,
  16367. aimSlowFactor: 1.5,
  16368. blur: .8,
  16369. movementEasing: "easeInOutQuad",
  16370. blendEasing: "easeInOutQuad",
  16371. fastForwardFactor: 3
  16372. },
  16373. show360Views: {
  16374. enabled: !0,
  16375. transitionTime: 1e3
  16376. },
  16377. quickstart: {
  16378. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  16379. animation: 1400,
  16380. showTextDelay: 500,
  16381. fadeOutDelay: 3e3,
  16382. fovChange: 10
  16383. },
  16384. appConfig: {
  16385. webvr_version: null,
  16386. segment_key: null,
  16387. embedly_key: null,
  16388. branch_key: null,
  16389. keen_write_key: null,
  16390. keen_project_id: null
  16391. },
  16392. vr: {
  16393. enabled: !0,
  16394. allowWebVR: !1,
  16395. option: r.valueFromHash("vr", a.CONTEXTUAL)
  16396. },
  16397. share: {
  16398. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  16399. },
  16400. input: {
  16401. longTapThreshold: 200,
  16402. moveToleranceNDC: .08,
  16403. touchMoveThreshold: 25
  16404. },
  16405. help: {
  16406. modalStayDuration: 600
  16407. },
  16408. immersive: {
  16409. timeToShowAgain: 1250,
  16410. uiStayDuration: 600
  16411. },
  16412. tourInteraction: {
  16413. disabled: "0" === r.valueFromHash("tourcta", null),
  16414. showPauseButton: 1e3,
  16415. showModal: 1500,
  16416. allowNextClick: 200,
  16417. largeModal: "1" === r.valueFromHash("tourcta", null),
  16418. smallModal: "2" === r.valueFromHash("tourcta", null)
  16419. },
  16420. labels: {
  16421. enabled: !1,
  16422. hideUntilStart: !0,
  16423. fadeInDuration: 250,
  16424. fadeInDelay: 250,
  16425. fadeOutDuration: 250,
  16426. fadeOutDelay: 0,
  16427. zoomHideThreshhold: {
  16428. mobile: r.isSmallScreen() ? .45 : .6,
  16429. desktop: 2
  16430. },
  16431. zoomTruncateThreshhold: {
  16432. mobile: r.isSmallScreen() ? .35 : .45,
  16433. desktop: .85
  16434. },
  16435. minLengthForTruncate: 16,
  16436. truncateLength: 12,
  16437. truncateSuffix: "..."
  16438. },
  16439. tags: {
  16440. enabled: r.valueFromHash("mt", 1),
  16441. startup: {
  16442. hideUntilStart: !0,
  16443. fadeInDuration: 500,
  16444. fadeInDelay: 100
  16445. },
  16446. visibility: {
  16447. anyDistance: !0,
  16448. visibleDistance: 8,
  16449. cameraClearance: .1,
  16450. alphaTestLevel: .05,
  16451. hideViaFloor: !0,
  16452. hideOffScreenDisc: !1,
  16453. hideOffScreenObject: !1
  16454. },
  16455. disc: {
  16456. opacity: 1,
  16457. disabledOpacity: .5,
  16458. scale: {
  16459. nearBound: 1.5,
  16460. farBound: 4.8,
  16461. linkFarBound: !1,
  16462. linkPercent: 40,
  16463. maxSize: 80,
  16464. minSize: 40,
  16465. baseViewportSize: 800,
  16466. responsiveness: 100
  16467. }
  16468. },
  16469. pole: {
  16470. enabled: !0,
  16471. height: .5,
  16472. width: 2,
  16473. opacity: .5,
  16474. color: "white"
  16475. },
  16476. navigate: {
  16477. nearestPano: !0,
  16478. lineOfSight: !0,
  16479. reactivate: !0,
  16480. aimAt: "disc",
  16481. tiltTolerance: 25,
  16482. rotateSpeedFactor: .6
  16483. }
  16484. },
  16485. path: {
  16486. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  16487. colorUp: s._desat(s.newBlue, .5),
  16488. colorDown: s._darken(s.newBlue, .35),
  16489. opacity: .5,
  16490. style: "ribbon",
  16491. height: .025,
  16492. ribbonWidth: .24,
  16493. outsideHeight: .5,
  16494. waypointRadius: .5,
  16495. waypointIndoorRadius: .24,
  16496. waypointPulse: 1e3,
  16497. typ: l.BLACK,
  16498. meshFree: r.valueFromHash("mf", 1),
  16499. mapGuides: r.valueFromHash("guides", !0),
  16500. fadeInTime: 400,
  16501. fadeOutTime: 300
  16502. },
  16503. warp: {
  16504. nearPanoDist: .1,
  16505. matchCam: !1,
  16506. blur: .33,
  16507. fastTime: 1500,
  16508. teleportTime: 1500,
  16509. outsideTime: 2e3,
  16510. lookAheadMax: .3,
  16511. lookAheadDist: 2.5,
  16512. softPushDist: .37,
  16513. softPushEnd: .3,
  16514. softBendAngle: 8,
  16515. softBendTilt: 4,
  16516. softBendEnd: .3,
  16517. doBurns: !0,
  16518. burnsAngle: 8,
  16519. minBurnsAngle: 35,
  16520. minDownAngle: -35,
  16521. maxTurnPerSec: 280,
  16522. maxAimPerSec: 35,
  16523. minRotation: 12,
  16524. maxAimRotation: 33.2,
  16525. turnFriction: .2,
  16526. flySpeed: .01,
  16527. minWarpTime: 1200,
  16528. warpInterruptionRedirectTime: 500,
  16529. tourStepDelay: r.valueFromHash("st", 0),
  16530. walkDelay: 0,
  16531. walkMaxDist: 50,
  16532. walkMinDist: .8,
  16533. walkSlideShowThreshhold: 3e3,
  16534. walkExtraPanosDistance: .4,
  16535. timePerMeter: 1200,
  16536. motionLeadTime: 5e3,
  16537. movementEasing: "easeInOutQuad",
  16538. blendEasing: "easeInOutQuad",
  16539. showBunny: !1,
  16540. loop: r.valueFromHash("lp", !1),
  16541. auto: r.valueFromHash("ts", -1),
  16542. eOrder: "YXZ",
  16543. stepFactor: .25,
  16544. brakeStrength: 2,
  16545. minBrakeAngle: .1,
  16546. maxBrakeAngle: 1.8,
  16547. climbEffort: 4
  16548. },
  16549. rotationFriction: .05,
  16550. rotationAccelerationInside: 4.5,
  16551. rotationAccelerationOutside: .15,
  16552. rotationAfterMoveMultiplier: 40,
  16553. rotationAfterMoveHistoryCount: 5,
  16554. panFriction: .09,
  16555. panAccelerationOutside: 60,
  16556. onload: r.valueFromHash("onload", o.PANORAMA),
  16557. zoomNearLimit: .1,
  16558. zoomFarLimit: 10,
  16559. navigation: {
  16560. panoScores: !1,
  16561. mouseDirection: !0,
  16562. filterStrictness: .75,
  16563. angleFactor: -30,
  16564. directionFactor: 10,
  16565. distanceFactor: -1,
  16566. optionalityFactor: 3
  16567. },
  16568. sdkInit: !1,
  16569. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  16570. console: r.valueFromHash("console", !1),
  16571. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  16572. panoramaNeighbourMaxDistance: 5,
  16573. panoFloorClickRadius: .35,
  16574. showScreenshotLocations: !1,
  16575. showAxis: !1,
  16576. showNeighbourRaycasts: !1,
  16577. colorMarkerOnLoad: !1,
  16578. colorMarkerByFloor: !1,
  16579. tiling: {
  16580. panoPreRenderRepeatDelay: 2500,
  16581. panoPreRenderDelay: 500,
  16582. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  16583. tilingFlagNames: ["usetiles", "tiles"],
  16584. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  16585. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  16586. overlayStyle: r.valueFromHash("tileoverlay", 0),
  16587. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  16588. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  16589. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  16590. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  16591. customCompression: r.valueFromHash("tilecustcomp", 0),
  16592. mobileHighQualityOverride: 1,
  16593. allowUltraHighResolution: !0
  16594. },
  16595. zoom: {
  16596. enabled: !0,
  16597. forceOff: r.valueFromHash("nozoom", 0),
  16598. overridemax: r.valueFromHash("maxzoom", null),
  16599. overridemin: r.valueFromHash("minzoom", null),
  16600. max: d.highQualityMaxZoom,
  16601. min: 1,
  16602. transitionStyle: r.valueFromHash("zoomtrans", 1),
  16603. activationThreshold: 1.1,
  16604. restoreTime: 500
  16605. },
  16606. profiling: {
  16607. enabled: r.valueFromHash("mem", !1)
  16608. }
  16609. };
  16610. (p = h.deepExtend(p, d, {
  16611. insideFOV: r.valueFromHash("fov", d.insideFOV),
  16612. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  16613. panorama: {
  16614. transitionTime: 1e3,
  16615. modelAlpha: 0,
  16616. modelAlphaDelay: p.flydown.modelTextureDelay,
  16617. modelAlphaLength: 1,
  16618. skyboxOpacity: 1,
  16619. skyboxOpacityDelay: p.flydown.skyboxDelay,
  16620. skyboxOpacityLength: .9,
  16621. fovLength: 1,
  16622. fovDelay: 0,
  16623. cameraMatrixDuration: .8,
  16624. cameraMatrixDelay: 0,
  16625. cameraMatrixEase: c.easeInCubic,
  16626. reticuleOpacity: 1,
  16627. markerOpacity: .3,
  16628. markerOpacityOnHover: 1
  16629. },
  16630. dollhouse: {
  16631. transitionTime: 1e3,
  16632. modelAlpha: 1,
  16633. modelAlphaDelay: 0,
  16634. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  16635. skyboxOpacity: 0,
  16636. skyboxOpacityDelay: 0,
  16637. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  16638. fovLength: 1,
  16639. fovDelay: 0,
  16640. cameraMatrixDuration: .8,
  16641. cameraMatrixDelay: .3,
  16642. cameraMatrixEase: c.easeInCubic,
  16643. reticuleOpacity: 1,
  16644. markerOpacity: 0,
  16645. markerOpacityOnHover: 0
  16646. },
  16647. floorplan: {
  16648. transitionTime: 1e3,
  16649. modelAlpha: 1,
  16650. modelAlphaDelay: 0,
  16651. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  16652. skyboxOpacity: 0,
  16653. skyboxOpacityDelay: 0,
  16654. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  16655. fovLength: 1,
  16656. fovDelay: 0,
  16657. cameraMatrixDuration: .5,
  16658. cameraMatrixDelay: 0,
  16659. cameraMatrixEase: c.easeOutCubic,
  16660. reticuleOpacity: 1,
  16661. markerOpacity: 0,
  16662. markerOpacityOnHover: 0,
  16663. cameraHeight: 50
  16664. },
  16665. transitioning: {
  16666. reticuleOpacity: 0,
  16667. markerOpacity: .3,
  16668. markerOpacityOnHover: 1
  16669. },
  16670. "floorplan-dollhouse": {
  16671. rotationDelay: 0,
  16672. rotationDuration: 1
  16673. },
  16674. "floorplan-panorama": {
  16675. rotationDelay: .5,
  16676. rotationDuration: 1
  16677. },
  16678. "dollhouse-panorama": {
  16679. rotationDelay: .5,
  16680. rotationDuration: 1
  16681. },
  16682. "dollhouse-floorplan": {
  16683. rotationDelay: 0,
  16684. rotationDuration: 1,
  16685. cameraMatrixDuration: 1.05,
  16686. cameraMatrixDelay: .5
  16687. },
  16688. "panorama-dollhouse": {
  16689. rotationDelay: 0,
  16690. rotationDuration: .5
  16691. },
  16692. "panorama-floorplan": {
  16693. transitionTime: 1500,
  16694. rotationDelay: 0,
  16695. rotationDuration: .5
  16696. }
  16697. })).path.meshFree && (p.path.typ = l.WALK), p.zoom.max = p.zoom.overridemax || p.zoom.max, p.zoom.min = p.zoom.overridemin || p.zoom.min, t.exports = p
  16698. }, {
  16699. "./constants": 8,
  16700. "./enum/Colors": 19,
  16701. "./enum/VROption": 47,
  16702. "./enum/Viewmode": 51,
  16703. "./enum/WarpStyle": 52,
  16704. "./util/browser": 182,
  16705. "./util/common": 185,
  16706. "./util/easing": 186,
  16707. "./util/showcase": 193,
  16708. three: 217
  16709. }],
  16710. 167: [function (e, t, i) {
  16711. "use strict";
  16712. var n = e("three"),
  16713. r = e("./settings"),
  16714. 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",
  16715. a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  16716. t.exports = {
  16717. basicTextured: {
  16718. uniforms: {
  16719. tDiffuse: {
  16720. type: "t",
  16721. value: null
  16722. },
  16723. alpha: {
  16724. type: "f",
  16725. value: 1
  16726. }
  16727. },
  16728. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  16729. 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}"
  16730. },
  16731. copyCubeMap: {
  16732. uniforms: {
  16733. tDiffuse: {
  16734. type: "t",
  16735. value: null
  16736. },
  16737. alpha: {
  16738. type: "f",
  16739. value: 1
  16740. }
  16741. },
  16742. 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}",
  16743. 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}"
  16744. },
  16745. cube: {
  16746. uniforms: {
  16747. map: {
  16748. type: "t",
  16749. value: null
  16750. },
  16751. opacity: {
  16752. type: "f",
  16753. value: 1
  16754. }
  16755. },
  16756. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  16757. 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"
  16758. },
  16759. model: {
  16760. uniforms: {
  16761. map: {
  16762. type: "t",
  16763. value: null
  16764. },
  16765. modelAlpha: {
  16766. type: "f",
  16767. value: r.modelAlpha
  16768. },
  16769. opacity: {
  16770. type: "f",
  16771. value: 1
  16772. },
  16773. progress: {
  16774. type: "f",
  16775. value: 0
  16776. },
  16777. blackout: {
  16778. type: "i",
  16779. value: 0
  16780. },
  16781. pano0Map: {
  16782. type: "t",
  16783. value: null
  16784. },
  16785. pano0Position: {
  16786. type: "v3",
  16787. value: new n.Vector3
  16788. },
  16789. pano0Matrix: {
  16790. type: "m4",
  16791. value: new n.Matrix4
  16792. },
  16793. pano1Map: {
  16794. type: "t",
  16795. value: null
  16796. },
  16797. pano1Position: {
  16798. type: "v3",
  16799. value: new n.Vector3
  16800. },
  16801. pano1Matrix: {
  16802. type: "m4",
  16803. value: new n.Matrix4
  16804. }
  16805. },
  16806. 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",
  16807. 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"
  16808. },
  16809. hot: {
  16810. uniforms: {
  16811. color: {
  16812. type: "c",
  16813. value: new n.Color(16720384)
  16814. },
  16815. opac: {
  16816. type: "f",
  16817. value: 0
  16818. },
  16819. texture1: {
  16820. type: "t",
  16821. value: null
  16822. },
  16823. texture2: {
  16824. type: "t",
  16825. value: null
  16826. }
  16827. },
  16828. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  16829. fragmentShader: "varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n"
  16830. },
  16831. modelOutside: {
  16832. uniforms: {
  16833. map: {
  16834. type: "t",
  16835. value: null
  16836. },
  16837. opacity: {
  16838. type: "f",
  16839. value: 1
  16840. }
  16841. },
  16842. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  16843. 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"
  16844. },
  16845. ribbon: {
  16846. uniforms: {
  16847. map: {
  16848. type: "t",
  16849. value: null
  16850. },
  16851. opacity: {
  16852. type: "f",
  16853. value: 1
  16854. },
  16855. color: {
  16856. type: "c",
  16857. value: new n.Color(r.path.color)
  16858. }
  16859. },
  16860. 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",
  16861. 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"
  16862. },
  16863. waypoint: {
  16864. uniforms: {
  16865. map: {
  16866. type: "t",
  16867. value: null
  16868. },
  16869. opacity: {
  16870. type: "f",
  16871. value: 1
  16872. },
  16873. pulse: {
  16874. type: "f",
  16875. value: 1
  16876. },
  16877. nearFade: {
  16878. type: "v2",
  16879. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  16880. },
  16881. color: {
  16882. type: "c",
  16883. value: new n.Color(r.reticuleColor)
  16884. }
  16885. },
  16886. 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",
  16887. 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"
  16888. },
  16889. modelDebug: {
  16890. uniforms: {
  16891. map: {
  16892. type: "t",
  16893. value: null
  16894. },
  16895. modelAlpha: {
  16896. type: "f",
  16897. value: r.modelAlpha
  16898. },
  16899. depthmapRatio: {
  16900. type: "f",
  16901. value: 0
  16902. },
  16903. opacity: {
  16904. type: "f",
  16905. value: 1
  16906. },
  16907. progress: {
  16908. type: "f",
  16909. value: 0
  16910. },
  16911. considerOcclusion: {
  16912. type: "i",
  16913. value: r.fancierTransition
  16914. },
  16915. highlightPanoSelection: {
  16916. type: "i",
  16917. value: 0
  16918. },
  16919. useThirdPano: {
  16920. type: "i",
  16921. value: r.useThirdPano
  16922. },
  16923. pano0Map: {
  16924. type: "t",
  16925. value: null
  16926. },
  16927. pano0Depth: {
  16928. type: "t",
  16929. value: null
  16930. },
  16931. pano0Position: {
  16932. type: "v3",
  16933. value: new n.Vector3
  16934. },
  16935. pano0Matrix: {
  16936. type: "m4",
  16937. value: new n.Matrix4
  16938. },
  16939. pano0Weight: {
  16940. type: "f",
  16941. value: r.transition.pano0Weight
  16942. },
  16943. pano1Map: {
  16944. type: "t",
  16945. value: null
  16946. },
  16947. pano1Depth: {
  16948. type: "t",
  16949. value: null
  16950. },
  16951. pano1Position: {
  16952. type: "v3",
  16953. value: new n.Vector3
  16954. },
  16955. pano1Matrix: {
  16956. type: "m4",
  16957. value: new n.Matrix4
  16958. },
  16959. pano1Weight: {
  16960. type: "f",
  16961. value: r.transition.pano1Weight
  16962. },
  16963. pano2Map: {
  16964. type: "t",
  16965. value: null
  16966. },
  16967. pano2Depth: {
  16968. type: "t",
  16969. value: null
  16970. },
  16971. pano2Position: {
  16972. type: "v3",
  16973. value: new n.Vector3
  16974. },
  16975. pano2Matrix: {
  16976. type: "m4",
  16977. value: new n.Matrix4
  16978. },
  16979. pano2Weight: {
  16980. type: "f",
  16981. value: r.transition.pano2Weight
  16982. }
  16983. },
  16984. 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",
  16985. 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"
  16986. },
  16987. customDepth: {
  16988. uniforms: {
  16989. panoPosition: {
  16990. type: "v3",
  16991. value: new n.Vector3
  16992. }
  16993. },
  16994. 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",
  16995. 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"
  16996. },
  16997. skysphere: {
  16998. uniforms: {
  16999. radius: {
  17000. type: "f",
  17001. value: 0
  17002. }
  17003. },
  17004. 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",
  17005. 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"
  17006. },
  17007. tagDisc: {
  17008. uniforms: {
  17009. opacity: {
  17010. type: "f",
  17011. value: 0
  17012. },
  17013. color: {
  17014. type: "c",
  17015. value: new n.Color
  17016. },
  17017. bg: {
  17018. type: "t",
  17019. value: null
  17020. },
  17021. mask: {
  17022. type: "t",
  17023. value: null
  17024. }
  17025. },
  17026. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  17027. 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"
  17028. }
  17029. }
  17030. }, {
  17031. "./settings": 166,
  17032. three: 217
  17033. }],
  17034. 168: [function (E, _, e) {
  17035. (function (e) {
  17036. "use strict";
  17037. var t = E("three"),
  17038. i = (E("url"), E("./util/ajax")),
  17039. n = E("./settings"),
  17040. r = E("./util/logger"),
  17041. o = E("./util/math"),
  17042. a = E("./util/showcase"),
  17043. s = E("./objects/Panorama"),
  17044. l = new r(e),
  17045. c = E("./model/Model"),
  17046. h = E("./shaders"),
  17047. u = E("./util/transitions"),
  17048. d = E("./objects/Chunk"),
  17049. p = E("./objects/Reticule"),
  17050. f = E("./objects/Skybox"),
  17051. g = E("./objects/Floor"),
  17052. m = E("./cameras/DollhouseCamera"),
  17053. v = E("./cameras/FloorplanCamera"),
  17054. y = E("./cameras/PanoramaCamera"),
  17055. A = E("./controls/DollhouseControls"),
  17056. C = E("./controls/FloorplanControls"),
  17057. I = E("./controls/PanoramaControls");
  17058. t.ImageUtils.crossOrigin = n.crossOrigin, _.exports = {
  17059. shaders: h,
  17060. transitions: u,
  17061. Model: c,
  17062. Chunk: d,
  17063. Floor: g,
  17064. Skybox: f,
  17065. Reticule: p,
  17066. Panorama: s,
  17067. DollhouseCamera: m,
  17068. FloorplanCamera: v,
  17069. PanoramaCamera: y,
  17070. DollhouseControls: A,
  17071. FloorplanControls: C,
  17072. PanoramaControls: I,
  17073. getModel: function (e) {
  17074. if (!e.url) throw 'getModel(): missing parameter "url"';
  17075. e.autoload = void 0 === e.autoload || e.autoload;
  17076. var t = a.parseSidUrl(e.url);
  17077. e.urlBase = t.urlBase, e.urlModel = t.urlModel, e.urlFiles = t.urlFiles;
  17078. var i = this._getPlatformError();
  17079. return i ? $.Deferred().reject(i).promise() : (this.options = e, this._loadModel().then(this._buildModel.bind(this)))
  17080. },
  17081. _getPlatformError: function () {
  17082. 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"
  17083. },
  17084. _loadModel: function () {
  17085. return i.get(this.options.urlModel, {
  17086. responseType: "json",
  17087. prefetchFrom: "model",
  17088. auth: a.getAuthorizationHeader()
  17089. }).then(null, function () {
  17090. return l.warn("Model loading failed at initial metadata load"), "loading-failed"
  17091. })
  17092. },
  17093. _buildModel: function (e) {
  17094. e = a.normalizeModeldata(e, o);
  17095. var t = new c(this.options, e);
  17096. return this.options.autoload ? t.load(!0) : $.when(t)
  17097. }
  17098. }
  17099. }).call(this, "/js/showcase.js")
  17100. }, {
  17101. "./cameras/DollhouseCamera": 5,
  17102. "./cameras/FloorplanCamera": 6,
  17103. "./cameras/PanoramaCamera": 7,
  17104. "./controls/DollhouseControls": 10,
  17105. "./controls/FloorplanControls": 11,
  17106. "./controls/PanoramaControls": 13,
  17107. "./model/Model": 139,
  17108. "./objects/Chunk": 144,
  17109. "./objects/Floor": 146,
  17110. "./objects/Panorama": 148,
  17111. "./objects/Reticule": 149,
  17112. "./objects/Skybox": 152,
  17113. "./settings": 166,
  17114. "./shaders": 167,
  17115. "./util/ajax": 181,
  17116. "./util/logger": 189,
  17117. "./util/math": 190,
  17118. "./util/showcase": 193,
  17119. "./util/transitions": 195,
  17120. three: 217,
  17121. url: 208
  17122. }],
  17123. 169: [function (e, t, i) {
  17124. "use strict";
  17125. function l(e) {
  17126. var t = {
  17127. renderTarget: null,
  17128. inUse: !1,
  17129. size: -1,
  17130. pano: null
  17131. };
  17132. return t.inUse = !0, t.size = e,
  17133. function (e) {
  17134. O.push(e)
  17135. }(t), t
  17136. }
  17137. function c(e) {
  17138. for (var t = 0; t < O.length; t++) {
  17139. var i = O[t];
  17140. if (i.renderTarget === e) return !(i.inUse = !1)
  17141. }
  17142. return !1
  17143. }
  17144. function n() {
  17145. this.tileDirectory = {}, this.activeRenderTargetDescriptors = {}, this.activePanos = [], this.panoLODDescriptors = {}, this.panoDescriptors = {}, this.tileTrees = {}, this.sceneRenderer = null, this.tileDownloader = null, this.forceQueue = [], this.uploadQueues = {}, this.uploadInterval = null, this.uploadIntervalCancelled = !1, this.usingTileOverlay = !1, this.overlayTilesLoaded = !1, this.overlayTileBase = null, this.overlayTilesBasic = {}, this.overlayTilesEnhanced = {}, this.zoomRenderTarget = null, this.zoomPano = null, this.zoomingActive = !1, this.zoomPanoId = null, this.zoomPanoRenderingDisabled = !1, this.direction = new _.Vector3, this.initTime = -1, this.maxBaseUploadsPerFrame = R, this.maxNonBaseUploadsPerFrame = M
  17146. }
  17147. var I, E, r, o, a, h, s, _ = e("three"),
  17148. u = e("../exception/BasicException"),
  17149. d = e("../settings"),
  17150. p = e("../enum/PanoSizeClass"),
  17151. b = (e("../objects/Panorama"), e("../enum/PanoRendererEvents")),
  17152. f = e("../enum/SceneRendererEvents"),
  17153. g = e("../enum/TileDownloaderEvents"),
  17154. m = e("../enum/Vectors"),
  17155. v = (e("../enum/GLCubeFaces"), e("../objects/Panorama"), e("./TileTree")),
  17156. y = (e("./TileDownloader"), e("./TilePrioritizer")),
  17157. A = e("./TileUtils"),
  17158. C = (p = e("../enum/PanoSizeClass"), e("../util/browser"), e("../util/panorama")),
  17159. w = e("events").EventEmitter,
  17160. T = !1,
  17161. x = d.tiling.uploadIntervalDelay,
  17162. S = d.tiling.initialIntervalDelay,
  17163. M = d.tiling.maxNonBaseUploadsPerFrame,
  17164. R = d.tiling.maxBaseUploadsPerFrame,
  17165. P = {
  17166. Base: 0,
  17167. Remaining: 1
  17168. },
  17169. O = [];
  17170. function L(e) {
  17171. var t = e.shift();
  17172. return t.uploadQueued = !1, t
  17173. }(n.prototype = Object.create(w.prototype)).init = function (e, t, i) {
  17174. this.sceneRenderer = e, this.tileDownloader = t, this.qualityManager = i, this.bindEvents(), this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)), this.initTime = performance.now()
  17175. }, n.prototype.getActivePanoTextures = function (e) {
  17176. e = e || [];
  17177. for (var t = 0; t < O.length; t++) {
  17178. var i = O[t];
  17179. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  17180. }
  17181. }, n.prototype.hasQueuedTiles = function () {
  17182. var e = this.peekNextFromUploadQueue();
  17183. return null != e
  17184. }, n.prototype.getActiveRenderTargetDescriptor = function (e) {
  17185. return this.activeRenderTargetDescriptors[e]
  17186. }, n.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  17187. this.activeRenderTargetDescriptors[e] = t
  17188. }, n.prototype.loadOverlayTiles = function () {
  17189. if (0 !== d.tiling.overlayStyle) {
  17190. var n = 0,
  17191. e = function (e, t, i) {
  17192. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping), this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE), ++n === r.length && (this.overlayTilesLoaded = !0)
  17193. }.bind(this),
  17194. r = [
  17195. ["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)],
  17196. ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)],
  17197. ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)],
  17198. ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)],
  17199. ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)],
  17200. ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)],
  17201. ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)],
  17202. ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)],
  17203. ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)],
  17204. ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)],
  17205. ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]
  17206. ];
  17207. r.forEach(function (e) {
  17208. this.tileDownloader.loadImage(e[0], 0, e[1])
  17209. }.bind(this)), this.usingTileOverlay = !0
  17210. } else this.usingTileOverlay = !1
  17211. }, n.prototype.bindEvents = function () {
  17212. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  17213. }, n.prototype.setupZoomRenderTarget = function () {
  17214. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  17215. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) return;
  17216. var e = this.zoomRenderTarget;
  17217. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1), e) {
  17218. var t = e.width,
  17219. i = this.zoomRenderTarget.width;
  17220. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i), e.texture.dispose(), e.texture.loaded = !1, e.texture.version = 0, this.sceneRenderer.deallocateCubeTexture(e.texture), e.texture = null
  17221. }
  17222. this.zoomPanoRenderingDisabled = !1
  17223. } else this.zoomPanoRenderingDisabled = !0
  17224. }, n.prototype.enableUltraHighQualityMode = function (t) {
  17225. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  17226. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  17227. this.tileDownloader.testDownload(e, A.TILE_SIZE, function (e) {
  17228. e && (this.qualityManager.enableUltraHighQualityMode(), this.setupZoomRenderTarget(), t())
  17229. }.bind(this))
  17230. }
  17231. }, n.prototype.activateTiledPano = function (e, t, i) {
  17232. i && this.clearAllQueuedUploads();
  17233. for (var n = 0; n < A.FACES_PER_PANO; n++) this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  17234. this.linkAllTilesAndNodes(e);
  17235. var r = this.getActiveRenderTargetDescriptor(e.id),
  17236. o = t;
  17237. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()), !r || o !== r.size) {
  17238. if (r && c(r.renderTarget), !(r = function (e) {
  17239. for (var t = 0; t < O.length; t++) {
  17240. var i = O[t];
  17241. if (!i.inUse && i.size === e) return i.inUse = !0, i
  17242. }
  17243. return null
  17244. }(o))) {
  17245. var a = this.initTiledPano(o, !1);
  17246. (r = l(a.width)).renderTarget = a
  17247. }
  17248. r.pano = e, this.resetPanoDescriptor(e.id), this.resetPanoLODDescriptors(e.id), this.resetRenderStatus(e.id, !0, !0)
  17249. }
  17250. this.setActiveRenderTargetDescriptor(e.id, r);
  17251. var s = i ? 0 : 1;
  17252. return this.updateActivePanos(e, s), r.renderTarget
  17253. }, n.prototype.deactivateTiledPano = function (e) {
  17254. var t = this.getActiveRenderTargetDescriptor(e.id);
  17255. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget), this.setActiveRenderTargetDescriptor(e.id, null);
  17256. var i = this.getUploadQueueForPano(e.id);
  17257. this.clearUploadQueue(i), this.updateActivePanos()
  17258. }, n.prototype.updateActivePanos = (s = [], function (e, t) {
  17259. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  17260. e && s.length === t && s.push(e);
  17261. var n = this.activePanos[i],
  17262. r = this.getActiveRenderTargetDescriptor(n.id);
  17263. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  17264. }
  17265. e && t >= s.length && s.push(e), this.activePanos.length = 0, this.activePanos.push.apply(this.activePanos, s)
  17266. }), n.prototype.getActivePanoCount = function () {
  17267. return this.activePanos.length
  17268. }, n.prototype.resetRenderStatus = function (e, r, o, t) {
  17269. var i = null;
  17270. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  17271. for (var n = function (e, t, i, n) {
  17272. o && (t.tile.zoomUploaded = !1), r && (t.tile.uploaded = !1)
  17273. }, a = 0; a < A.FACES_PER_PANO; a++) {
  17274. this.getTileTree(e, a).breadthFirst({
  17275. callback: n.bind(this, a),
  17276. minLevel: i
  17277. })
  17278. }
  17279. }, n.prototype.copyBaseRenderStatusToZoomed = function (e) {
  17280. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function (e, t, i, n) {
  17281. t.tile.zoomUploaded = t.tile.uploaded, t.zoomCovered = t.covered
  17282. }, n = 0; n < A.FACES_PER_PANO; n++) {
  17283. this.getTileTree(e, n).breadthFirst({
  17284. callback: i.bind(this, n),
  17285. maxLevel: t
  17286. })
  17287. }
  17288. }, n.prototype.renderPanoTiles = (h = [], function (e, t, i, n) {
  17289. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(), t = t || this.direction || m.FORWARD;
  17290. var r = this.getActiveRenderTargetDescriptor(e);
  17291. if (!this.isRenderTargetDescriptorValid(r)) throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  17292. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  17293. var a = this.getTileTree(e, o);
  17294. h.length = 0, a.breadthFirst({
  17295. saveVisited: h
  17296. });
  17297. for (var s = 0; s < h.length; s++) {
  17298. var l = h[s];
  17299. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  17300. }
  17301. }
  17302. this.updateDirection(t)
  17303. }), n.prototype.isRenderTargetDescriptorValid = function (e) {
  17304. return e && e.renderTarget
  17305. }, n.prototype.isPanoActive = function (e) {
  17306. var t = this.getActiveRenderTargetDescriptor(e);
  17307. return this.isRenderTargetDescriptorValid(t)
  17308. }, n.prototype.isPanoZoomed = function (e) {
  17309. return this.zoomingActive && this.zoomPanoId === e
  17310. }, n.prototype.initTileTree = function (e, t, i) {
  17311. var n = this.tileTrees[e];
  17312. n || (n = [], this.tileTrees[e] = n);
  17313. var r = n[t];
  17314. if (!r) {
  17315. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  17316. r = new v(A.TILE_SIZE, o), n[t] = r
  17317. }
  17318. }, n.prototype.getTileTree = function (e, t) {
  17319. var i = this.tileTrees[e];
  17320. if (!i) throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  17321. var n = i[t];
  17322. if (!n) throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  17323. return n
  17324. }, n.prototype.initTiledPano = function (e, t) {
  17325. var i = this.sceneRenderer.renderer,
  17326. n = (i.context, new _.WebGLRenderTargetCube(e, e, {
  17327. stencilBuffer: !1
  17328. })),
  17329. r = new _.CubeTexture([]);
  17330. (n.texture = r).image = [null, null, null, null, null, null], r.flipY = !0, t ? (r.generateMipmaps = !0, r.magFilter = _.LinearFilter, r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1, r.magFilter = _.LinearFilter, r.minFilter = _.LinearFilter), r.format = _.RGBAFormat, i.setRenderTarget(n), i.setRenderTarget(null);
  17331. var o = i.properties.get(r);
  17332. return o.__image__webglTextureCube = o.__webglTexture, n
  17333. }, n.prototype.getUploadQueueForPano = function (e) {
  17334. var t = this.uploadQueues[e];
  17335. return t || (t = [], this.uploadQueues[e] = t), t
  17336. }, n.prototype.isTileUploaded = function (e) {
  17337. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  17338. }, n.prototype.setUploaded = function (e, t) {
  17339. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  17340. }, n.prototype.queueTileUpload = function (e, t, i) {
  17341. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  17342. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  17343. var r = this.getUploadQueueForPano(e.panoId);
  17344. 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), e.uploadQueued = !0, this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  17345. }
  17346. }, n.prototype.shoulPushToFrontOfQueue = function (e) {
  17347. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  17348. }, n.prototype.getTopUploadQueue = function () {
  17349. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  17350. for (var n = 0; n < this.activePanos.length; n++)
  17351. if (e = this.activePanos[n], 0 < (t = this.getUploadQueueForPano(e.id)).length) switch (i) {
  17352. case P.Base:
  17353. if (0 === t[0].level) return t;
  17354. break;
  17355. case P.Remaining:
  17356. return t
  17357. }
  17358. return null
  17359. }, n.prototype.getNextFromUploadQueue = function () {
  17360. if (0 < this.forceQueue.length) return L(this.forceQueue);
  17361. var e = this.getTopUploadQueue();
  17362. return e && 0 < e.length ? L(e) : null
  17363. }, n.prototype.peekNextFromUploadQueue = function () {
  17364. if (0 < this.forceQueue.length) return this.forceQueue[0];
  17365. var e = this.getTopUploadQueue();
  17366. return e && 0 < e.length ? e[0] : null
  17367. }, n.prototype.clearAllQueuedUploads = function () {
  17368. this.clearAllUploadQueues(null, 0)
  17369. }, n.prototype.clearAllQueuedUploadsForPano = function (e) {
  17370. this.clearAllUploadQueues(e, 0)
  17371. }, n.prototype.clearAllUploadQueues = function (e, t) {
  17372. if (e) this.clearUploadQueue(this.getUploadQueueForPano(e), t), this.clearUploadQueue(this.forceQueue, t, e);
  17373. else {
  17374. for (var i = 0; i < this.activePanos.length; i++) {
  17375. var n = this.activePanos[i];
  17376. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  17377. }
  17378. this.clearUploadQueue(this.forceQueue, t)
  17379. }
  17380. }, n.prototype.clearUploadQueue = function (e, t, i) {
  17381. null != t || (t = 0);
  17382. for (var n = 0; n < e.length;) {
  17383. var r = e[n];
  17384. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1, e.splice(n, 1)) : n++
  17385. }
  17386. }, n.prototype.refreshUploadInterval = (a = null, function (e) {
  17387. this.uploadIntervalCancelled || (a = a || function () {
  17388. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0, this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  17389. }.bind(this), null != e || (e = x), T || (e = S), this.uploadInterval = window.setTimeout(a, e), this.uploadIntervalDelay = e)
  17390. }), n.prototype.update = (r = performance.now(), o = 0, function () {
  17391. this.uploadIntervalCancelled = !0, window.clearTimeout(this.uploadInterval), this.uploadInterval = null;
  17392. var e = performance.now() - r;
  17393. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), r = performance.now()), o++
  17394. }), n.prototype.updateUploadQueue = function (e, t) {
  17395. e = e || 1;
  17396. for (var i = 0, n = 0; !(t <= n || e <= i);) {
  17397. var r = this.getNextFromUploadQueue();
  17398. if (!r) break;
  17399. if (0 !== r.level ? i++ : n++, !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  17400. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  17401. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  17402. }
  17403. }
  17404. }, n.prototype.updateDirection = function (e) {
  17405. if (e = e || this.direction) {
  17406. this.direction = e;
  17407. for (var t = 0; t < this.activePanos.length; t++) {
  17408. var i = this.activePanos[t],
  17409. n = this.getUploadQueueForPano(i.id);
  17410. y.sortPanoTiles(n, i, this.direction)
  17411. }
  17412. }
  17413. }, n.prototype.uploadTile = (I = {}, new _.Vector4, E = d.tiling.overlayStyle, function (e, t) {
  17414. var i = e.panoId,
  17415. n = e.image,
  17416. r = e.tileSize,
  17417. o = e.panoSize,
  17418. a = e.tileIndex,
  17419. s = (e.faceTileIndex, e.totalTiles),
  17420. l = (e.face, e.tileX),
  17421. c = e.tileY,
  17422. h = !0,
  17423. u = !1,
  17424. d = (this.getPanoDescriptor(i), this.getPanoLODDescriptor(i, o)),
  17425. p = this.getActiveRenderTargetDescriptor(i),
  17426. f = p.renderTarget,
  17427. g = p.size;
  17428. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget, g = this.qualityManager.getMaxZoomPanoSize()), this.isRenderTargetDescriptorValid(p) || (u = h = !1), t || (this.anyUploaded(e.node) && (u = !(h = !1)), this.isTileUploaded(e) && (u = h = !1)), h) {
  17429. var m = r / o * g,
  17430. v = l * r / o * g,
  17431. y = c * r / o * g;
  17432. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  17433. var A = I[r];
  17434. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r), 1 === E || 2 === E) {
  17435. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  17436. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace), this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  17437. } else this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  17438. d.uploadCount++, this.emit(b.TileRenderSuccess, i, o, a, s), d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s), this.setUploaded(e, !0), this.addCoverageForNode(e.node)
  17439. } else this.setUploaded(e, !1);
  17440. return e.uploadAttempted || (d.uploadAttempts++, this.emit(b.TileUploadAttempted, i, o, a, s)), e.uploadAttempted = !0, d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s), u
  17441. }), n.prototype.linkTileAndNode = function (e, t) {
  17442. (t.tile = e).node = t
  17443. }, n.prototype.linkAllTilesAndNodes = function (a) {
  17444. for (var e = function (e, t, i, n, r) {
  17445. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  17446. this.linkTileAndNode(o, i)
  17447. }, t = 0; t < A.FACES_PER_PANO; t++) {
  17448. var i = this.getTileTree(a.id, t);
  17449. i.breadthFirst({
  17450. callback: e.bind(this, i, t)
  17451. })
  17452. }
  17453. }, n.prototype.anyUploaded = function (e) {
  17454. if (!e) return !1;
  17455. if (e.tile && this.isTileUploaded(e.tile)) return !0;
  17456. if (e.children)
  17457. for (var t = 0; t < e.children.length; t++) {
  17458. var i = e.children[t];
  17459. if (this.anyUploaded(i)) return !0
  17460. }
  17461. return !1
  17462. }, n.prototype.setNodeCovered = function (e, t) {
  17463. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  17464. }, n.prototype.isNodeCovered = function (e) {
  17465. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  17466. }, n.prototype.addCoverageForNode = function (e) {
  17467. if (this.setNodeCovered(e, !0), e.parent && e.covered) {
  17468. var t = e.parent;
  17469. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  17470. }
  17471. }, n.prototype.calcFullCoverage = function (e) {
  17472. var t = !1;
  17473. if (e.children)
  17474. for (var i = 0; i < e.children.length; i++) {
  17475. var n = e.children[i];
  17476. t = t || this.calcFullCoverage(n)
  17477. }
  17478. e.covered = e.tile.uploaded || t
  17479. }, n.prototype.nodeSubcovered = function (e) {
  17480. if (!e.children) return !1;
  17481. for (var t = 0; t < e.children.length; t++)
  17482. if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1;
  17483. return !0
  17484. }, n.prototype.resetPanoDescriptor = function (e) {
  17485. this.getPanoDescriptor(e)
  17486. }, n.prototype.getPanoDescriptor = function (e) {
  17487. var t = this.panoDescriptors[e];
  17488. return t || (t = {}, this.panoDescriptors[e] = t), t
  17489. }, n.prototype.resetPanoLODDescriptors = function (e) {
  17490. var t = this.getPanoLODDescriptors(e);
  17491. for (var i in t)
  17492. if (t.hasOwnProperty(i)) {
  17493. var n = t[i];
  17494. n.uploadCount = 0, n.uploadAttempts = 0
  17495. }
  17496. }, n.prototype.getPanoLODDescriptor = function (e, t) {
  17497. var i = this.getPanoLODDescriptors(e),
  17498. n = i[t];
  17499. return n || (n = {
  17500. uploadCount: 0,
  17501. uploadAttempts: 0
  17502. }, i[t] = n), n
  17503. }, n.prototype.getPanoLODDescriptors = function (e) {
  17504. var t = this.panoLODDescriptors[e];
  17505. return t || (t = {}, this.panoLODDescriptors[e] = t), t
  17506. }, n.prototype.onTileDownloaded = function (e) {
  17507. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize),
  17508. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  17509. if (i.downloaded = !0, i.image = e.image, i.panoSize = e.panoSize, i.tileX = e.tileX, i.tileY = e.tileY, i.totalTiles = e.totalTiles, i.tileIndex = e.tileIndex, i.faceTileIndex = e.faceTileIndex, i.face = e.face, i.cubeFace = C.mapFaceToCubemapFace(e.face), i.panoId = e.panoId, i.tileSize = e.tileSize, i.direction = (new _.Vector3).copy(e.direction), i.node = null, i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize), this.isPanoActive(i.panoId)) {
  17510. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  17511. this.linkTileAndNode(i, n), this.queueTileUpload(i, !0)
  17512. }
  17513. }, n.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  17514. var r = this.tileDirectory[e];
  17515. r || (r = {}, this.tileDirectory[e] = r);
  17516. var o = 16384 * t + 1024 * i + n,
  17517. a = r[o];
  17518. return a || (a = {
  17519. downloaded: !1,
  17520. uploaded: !1,
  17521. zoomUploaded: !1
  17522. }, r[o] = a), a._key = e + ":" + t + ":" + i + ":" + n, a._tileKey = o, a
  17523. }, n.prototype.setZoomingActive = function (e, t, i) {
  17524. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e, this.zoomPanoId = t.id, this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  17525. }, n.prototype.updateZoomedPanoFromBase = function (e) {
  17526. if (!this.zoomPanoRenderingDisabled) {
  17527. var t = this.getActiveRenderTargetDescriptor(e.id);
  17528. if (t && t.renderTarget) {
  17529. var i = this.qualityManager.getMaxZoomPanoSize(),
  17530. n = t.renderTarget,
  17531. r = t.size;
  17532. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i), this.copyBaseRenderStatusToZoomed(e.id)
  17533. }
  17534. }
  17535. }, t.exports = n
  17536. }, {
  17537. "../enum/GLCubeFaces": 25,
  17538. "../enum/PanoRendererEvents": 35,
  17539. "../enum/PanoSizeClass": 36,
  17540. "../enum/SceneRendererEvents": 43,
  17541. "../enum/TileDownloaderEvents": 45,
  17542. "../enum/Vectors": 50,
  17543. "../exception/BasicException": 55,
  17544. "../objects/Panorama": 148,
  17545. "../settings": 166,
  17546. "../util/browser": 182,
  17547. "../util/panorama": 191,
  17548. "./TileDownloader": 171,
  17549. "./TilePrioritizer": 172,
  17550. "./TileTree": 173,
  17551. "./TileUtils": 174,
  17552. events: 202,
  17553. three: 217
  17554. }],
  17555. 170: [function (e, t, i) {
  17556. "use strict";
  17557. function n(e, t, i) {
  17558. this.maxNavPanoSize = -1, this.maxZoomPanoSize = -1, this.devicePixelDensity = e, this.deviceScreenSize = t, this.clientBandwidth = i, this.panoSizeClassMap = {}, this.useHighResolutionPanos = !0, this.useUltraHighResolutionPanos = !1, this.modelHasUltraHighPanos = !1
  17559. }
  17560. var r = e("../enum/PanoSizeClass"),
  17561. o = e("../settings"),
  17562. a = e("../util/browser"),
  17563. s = e("../constants"),
  17564. l = e("../util/showcase"),
  17565. c = e("../enum/ModelManagerEvents");
  17566. n.prototype.init = function (e) {
  17567. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth), this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH), this.highSize = this.getPanoSize(r.HIGH), this.standardSize = this.getPanoSize(r.STANDARD), this.baseSize = this.getPanoSize(r.BASE), o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0), this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold), this.updateMaximums(), e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  17568. }, n.prototype.updateFromModel = function (e) {
  17569. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e)
  17570. }, n.prototype.updateHighResolutionSettings = function (e) {
  17571. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1, this.updateMaximums()
  17572. }, n.prototype.updateUltraHighResolutionSettings = function (e) {
  17573. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1, this.updateMaximums()
  17574. }, n.prototype.enableUltraHighQualityMode = function () {
  17575. this.modelHasUltraHighPanos = !0, this.updateUltraHighResolutionSettings(null)
  17576. }, n.prototype.ultraHighQualityModeEnabled = function () {
  17577. return this.modelHasUltraHighPanos
  17578. }, n.prototype.onModelChanged = function (e) {
  17579. this.updateFromModel(e.model), this.updateMaximums()
  17580. }, n.prototype.updateMaximums = function () {
  17581. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(), this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(), this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  17582. }, n.prototype.buildPanoSizeClassMap = function () {
  17583. this.panoSizeClassMap[r.BASE] = 512, this.panoSizeClassMap[r.STANDARD] = 1024, this.panoSizeClassMap[r.HIGH] = 2048, this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  17584. }, n.prototype.getPanoSize = function (e) {
  17585. return this.panoSizeClassMap[e]
  17586. }, n.prototype.getMaxPossiblePanoSize = function () {
  17587. return this.getPanoSize(r.ULTRAHIGH)
  17588. }, n.prototype.getMaxPanoSize = function () {
  17589. return this.maxZoomPanoSize
  17590. }, n.prototype.getMaxNavPanoSize = function () {
  17591. return this.maxNavPanoSize
  17592. }, n.prototype.getMaxZoomPanoSize = function () {
  17593. return this.maxZoomPanoSize
  17594. }, n.prototype.detectMaxNavPanoSizeClass = function () {
  17595. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  17596. }, n.prototype.detectMaxNavPanoSize = function () {
  17597. var e = this.detectMaxNavPanoSizeClass();
  17598. return this.getPanoSize(e)
  17599. }, n.prototype.detectMaxZoomPanoSize = function () {
  17600. 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)
  17601. }, t.exports = n
  17602. }, {
  17603. "../constants": 8,
  17604. "../enum/ModelManagerEvents": 33,
  17605. "../enum/PanoSizeClass": 36,
  17606. "../settings": 166,
  17607. "../util/browser": 182,
  17608. "../util/showcase": 193
  17609. }],
  17610. 171: [function (A, C, e) {
  17611. (function (e) {
  17612. "use strict";
  17613. function i(e) {
  17614. this.panos = null, this.retryMinimumTime = 1e4, this.urls = null, this.panoLoadCallbacks = {}, this.downloadDescriptors = {}, this.priorityQueue = [], this.forceQueue = [], this.activeDownloads = [], this.qualityManager = null, this.tilePrioritizer = null, this.refreshInterval = null, this.processPriorityQueue = !1, this.concurrentDownloads = e.concurrentDownloads || 1, this.downloadTestResults = {}
  17615. }
  17616. var c, h, n, p, f, t = A("three"),
  17617. u = (A("../enum/Viewmode"), A("../settings")),
  17618. r = (A("../objects/Panorama"), A("../util/logger")),
  17619. o = (A("../enum/Vectors"), A("../enum/PanoSizeClass"), A("../enum/TileDownloaderEvents")),
  17620. g = A("./TilePrioritizer"),
  17621. m = A("./TileUtils"),
  17622. v = (A("../enum/GLCubeFaces"), A("../enum/DownloadStatus")),
  17623. a = A("../util/panorama"),
  17624. s = A("../util/ajax"),
  17625. d = A("../ab"),
  17626. l = A("events").EventEmitter,
  17627. y = (new r(e), Object.freeze({
  17628. Testing: 1,
  17629. Success: 2,
  17630. Fail: 3
  17631. }));
  17632. i.prototype = Object.create(l.prototype), i.IDLE_REFRESH_DELAY = 500, i.ACTIVE_REFRESH_DELAY = 16, i.DOWNLOAD_RETRIES = 4, i.prototype.init = function (e) {
  17633. this.qualityManager = e
  17634. }, i.prototype.setUrls = function (e) {
  17635. this.urls = e
  17636. }, i.prototype.setPanoData = function (e, t, i) {
  17637. this.panos = e, this.imagePanos = t, this.panoGroupId = i
  17638. }, i.prototype.start = function () {
  17639. this.refreshUpdateInterval(0)
  17640. }, i.prototype.stop = function () {
  17641. window.cancel(this.refreshInterval)
  17642. }, i.prototype.refreshUpdateInterval = function (e) {
  17643. e = e || 0, this.refreshInterval = window.setTimeout(function () {
  17644. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  17645. }.bind(this), e)
  17646. }, i.prototype.update = function () {
  17647. var e = 0 < this.forceQueue.length;
  17648. return this.processQueueForDownloading(this.forceQueue), this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos), 0 < this.priorityQueue.length && (e = !0), this.processQueueForDownloading(this.priorityQueue)), e
  17649. }, i.prototype.forceQueueTilesForPano = (p = [], f = [], function (e, t, i, n, r, o) {
  17650. p.length = 0;
  17651. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  17652. var l = a[s];
  17653. l.status !== v.None && l.status !== v.Queued || p.push(l)
  17654. }
  17655. if (i && 0 < p.length) {
  17656. g.sortPanoTiles(p, e, i), f.length = 0, m.matchingTilesInDirection(e, t, i, n, r, f);
  17657. for (var c = 0, h = function (e) {
  17658. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  17659. }; c < p.length;) {
  17660. var u = p[c];
  17661. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  17662. }
  17663. }
  17664. for (var d = 0; d < p.length; d++) this.forceQueue.push(p[d]);
  17665. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued), this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1), o && this.processQueueForDownloading(this.forceQueue, !0)
  17666. }), i.prototype.clearForceQueue = function () {
  17667. this.clearQueue(this.forceQueue)
  17668. }, i.prototype.queuePrioritizedTilesForPanos = function (e) {
  17669. this.tilePrioritizer && (this.clearQueue(this.priorityQueue), this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this), this.clearFromQueue(this.priorityQueue, v.None, !0), this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  17670. }, i.prototype.clearQueue = function (e) {
  17671. this.setStatusForAllDescriptors(e, v.None), e.length = 0
  17672. }, i.prototype.clearFromQueue = function (e, t, i) {
  17673. for (var n = 0; n < e.length; n++) {
  17674. var r = e[n];
  17675. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  17676. }
  17677. }, i.prototype.setStatusForAllDescriptors = function (e, t) {
  17678. for (var i = 0; i < e.length; i++) {
  17679. var n = e[i];
  17680. n && (n.status = t)
  17681. }
  17682. }, i.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  17683. for (var i = 0; i < e.length; i++) {
  17684. var n = e[i];
  17685. n && (n.status !== t ? n.status = t : e[i] = null)
  17686. }
  17687. }, i.prototype.getTileDownloadDescriptors = function (e, t) {
  17688. var i = this.getAllTileDownloadDescriptorsForPano(e),
  17689. n = i[t];
  17690. return n || (n = this.buildDownloadDescriptorArray(t), i[t] = n, this.initTileDownloadDescriptors(n, e, t)), n
  17691. }, i.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  17692. var t = this.downloadDescriptors[e.id];
  17693. return t || (t = {}, this.downloadDescriptors[e.id] = t), t
  17694. }, i.prototype.processQueueForDownloading = function (e, t) {
  17695. if (this.cleanupActiveDownloads(), this.activeDownloads.length < this.concurrentDownloads || t)
  17696. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  17697. var r = e.shift();
  17698. r && (this.startDownload(r), n++)
  17699. }
  17700. }, i.prototype.testDownload = function (t, e, i) {
  17701. var n = this.downloadTestResults[t];
  17702. if (n) n === y.Success ? i(!0) : n === y.Fail && i(!1);
  17703. else {
  17704. this.downloadTestResults[t] = y.Testing;
  17705. var r = this.panos.list[0],
  17706. o = this.getTileUrl(r.id, t, e, 0),
  17707. a = function (e) {
  17708. this.downloadTestResults[t] = y.Success, i(!0)
  17709. }.bind(this),
  17710. s = function () {
  17711. this.downloadTestResults[t] = y.Fail, i(!1)
  17712. }.bind(this);
  17713. this.loadImage(o, 0, a, s)
  17714. }
  17715. }, i.prototype.startDownload = function (e) {
  17716. e.status = v.Downloading;
  17717. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  17718. this.activeDownloads.push(e), this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  17719. }, i.prototype.downloadFailed = function (e, t) {}, i.prototype.downloadComplete = function (e, t) {
  17720. if (e.panoGroupId === this.panoGroupId) {
  17721. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  17722. e.status = v.Downloaded, i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  17723. var n = {
  17724. panoId: e.pano.id,
  17725. image: t,
  17726. tileSize: e.tileSize,
  17727. panoSize: e.panoSize,
  17728. tileIndex: e.tileIndex,
  17729. faceTileIndex: e.faceTileIndex,
  17730. totalTiles: e.totalTiles,
  17731. face: e.face,
  17732. tileX: e.tileX,
  17733. tileY: e.tileY,
  17734. direction: e.direction
  17735. };
  17736. e.image = t, this.emit(o.TileDownloadSuccess, n), this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  17737. panoId: e.pano.id,
  17738. tileSize: e.tileSize,
  17739. panoSize: e.panoSize
  17740. }, this.emit(o.PanoDownloadComplete, n), i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  17741. }
  17742. }, i.prototype.cleanupActiveDownloads = (n = [], function () {
  17743. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  17744. var t = this.activeDownloads[e];
  17745. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  17746. }
  17747. this.activeDownloads.length = 0, this.activeDownloads.push.apply(this.activeDownloads, n)
  17748. }), i.prototype.isPanoDownloaded = function (e, t) {
  17749. var i = this.getTileDownloadDescriptors(e, t);
  17750. if (i.length <= 0) return !1;
  17751. for (var n = 0; n < i.length; n++) {
  17752. if (i[n].status !== v.Downloaded) return !1
  17753. }
  17754. return !0
  17755. }, i.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  17756. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  17757. this.panoLoadCallbacks[o] = {
  17758. onLoad: i,
  17759. onFail: n,
  17760. onProgress: r
  17761. }
  17762. }, i.prototype.getPanoLoadCallbacks = function (e, t) {
  17763. var i = e.id + ":" + t;
  17764. return this.panoLoadCallbacks[i]
  17765. }, i.prototype.buildDownloadDescriptorArray = function (e) {
  17766. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  17767. var r = this.buildDownloadDescriptor();
  17768. i.push(r)
  17769. }
  17770. return i
  17771. }, i.prototype.buildDownloadDescriptor = function () {
  17772. return {
  17773. panoGroupId: null,
  17774. pano: null,
  17775. panoSize: -1,
  17776. tileSize: -1,
  17777. tileIndex: -1,
  17778. totalTiles: -1,
  17779. faceTileIndex: -1,
  17780. status: v.None,
  17781. url: null,
  17782. image: null,
  17783. direction: new t.Vector3,
  17784. face: -1,
  17785. cubeFace: -1,
  17786. tileX: -1,
  17787. tileY: -1
  17788. }
  17789. }, i.prototype.initTileDownloadDescriptors = function (e, t, i) {
  17790. for (var n = 0; n < e.length; n++) {
  17791. var r = e[n];
  17792. this.initTileDownloadDescriptor(r, t, i, n)
  17793. }
  17794. }, i.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  17795. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  17796. e.face = m.getFaceForTile(i, n), e.cubeFace = a.mapFaceToCubemapFace(e.face), e.panoGroupId = this.panoGroupId, e.pano = t, e.panoSize = i, e.tileSize = r, e.tileIndex = n, e.totalTiles = m.getTileCountForSize(i), e.status = v.None, e.image = null, m.getTileLocation(e.panoSize, e.tileIndex, e), m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  17797. }, i.prototype.getTileUrl = (c = {
  17798. 256: "256",
  17799. 512: "512",
  17800. 1024: "1k",
  17801. 2048: "2k",
  17802. 4096: "4k"
  17803. }, h = {
  17804. face: -1,
  17805. faceTileIndex: -1,
  17806. tileX: -1,
  17807. tileY: -1
  17808. }, function (e, t, i, n) {
  17809. m.getTileLocation(t, n, h);
  17810. var r = Math.floor(t / i),
  17811. o = r * r,
  17812. a = Math.floor(n / o),
  17813. s = "";
  17814. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  17815. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  17816. return d.changeIfTileGenerating(l)
  17817. }), i.prototype.loadImage = function (e, t, i, n) {
  17818. s.getImage(e, t).then(function (e) {
  17819. i(e)
  17820. }).fail(n)
  17821. }, C.exports = i
  17822. }).call(this, "/js/tile/TileDownloader.js")
  17823. }, {
  17824. "../ab": 3,
  17825. "../enum/DownloadStatus": 24,
  17826. "../enum/GLCubeFaces": 25,
  17827. "../enum/PanoSizeClass": 36,
  17828. "../enum/TileDownloaderEvents": 45,
  17829. "../enum/Vectors": 50,
  17830. "../enum/Viewmode": 51,
  17831. "../objects/Panorama": 148,
  17832. "../settings": 166,
  17833. "../util/ajax": 181,
  17834. "../util/logger": 189,
  17835. "../util/panorama": 191,
  17836. "./TilePrioritizer": 172,
  17837. "./TileUtils": 174,
  17838. events: 202,
  17839. three: 217
  17840. }],
  17841. 172: [function (n, C, e) {
  17842. (function (e) {
  17843. "use strict";
  17844. function h(e, t, i, n, r) {
  17845. this.qualityManager = e, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(), this.baseSize = t, this.standardSize = i, this.highSize = n, this.ultraHighSize = r, this.priorityCriteria = new h.PriorityCriteria(null, new o.Vector3(0, 0, 0), new o.Vector3(0, 0, -1), new o.Vector3(0, 0, -1))
  17846. }
  17847. var c, s, l, d, r, u, p, f, o = n("three"),
  17848. g = (n("../enum/Viewmode"), n("../settings"), n("../settings"), n("../objects/Panorama")),
  17849. t = n("../util/logger"),
  17850. i = (n("../enum/Vectors"), n("../enum/PanoSizeClass"), n("../enum/ModelManagerEvents"), n("../enum/GLCubeFaces"), n("../enum/DownloadStatus")),
  17851. m = (n("../util/browser"), n("./TileUtils")),
  17852. v = n("../util/math"),
  17853. a = (n("events").EventEmitter, new t(e), Object.freeze({
  17854. None: 0,
  17855. DirectionalFOV: 1
  17856. }));
  17857. h.PriorityCriteria = function (e, t, i, n, r) {
  17858. this.pano = e, this.cameraPosition = (new o.Vector3).copy(t), this.cameraDir = (new o.Vector3).copy(i), this.panoSpaceDir = (new o.Vector3).copy(n), this.upcomingPanos = r, this.copy = function (e) {
  17859. this.pano = e.pano, this.cameraPosition.copy(e.cameraPosition), this.cameraDir.copy(e.cameraDir), this.panoSpaceDir.copy(e.panoSpaceDir), this.upcomingPanos = r
  17860. }, this.zoomingActive = !1
  17861. }, h.DIRECTIONAL_FOV = 180, h.DIRECTIONAL_FOV_NARROW = 120, h.MAX_SCORED_PANOS_TOCONSIDER = 6, h.MAX_SCORED_PANOS_TOADD = 2, h.MAX_UPCOMING_PANOS_TOADD = 3, h.DIRECTION_SCORE_STRICTNESS = .75, h.appendQueue = function (e, t) {
  17862. if (e && t)
  17863. for (var i = 0; i < t.length; i++) e.push(t[i])
  17864. }, h.prototype.updateCriteria = function (e, t, i, n) {
  17865. this.priorityCriteria.pano = e, this.priorityCriteria.cameraPosition.copy(t), this.priorityCriteria.cameraDir.copy(i), this.priorityCriteria.upcomingPanos = n, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  17866. }, h.prototype.filterAndPrioritize = (u = [], p = [], f = [], function (e, t, i) {
  17867. this.populateNeighborPanos(this.priorityCriteria.pano, t, u), this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  17868. var n = this.baseSize,
  17869. r = this.standardSize,
  17870. o = this.highSize,
  17871. a = this.ultraHighSize;
  17872. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n), this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD), f.length = 0, this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW), h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), h.appendQueue(e, f), this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD), f.length = 0, this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW), this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW), h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), h.appendQueue(e, f), f.length = 0, this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV), this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV), this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV), h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), h.appendQueue(e, f), this.queueTilesForPanos(e, u, i, n)
  17873. }), h.prototype.canDownloadSize = function (e) {
  17874. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  17875. }, h.prototype.populateNeighborPanos = function (e, t, i) {
  17876. (i = i || []).length = 0;
  17877. var n = t.getNeighbours(e);
  17878. for (var r in n)
  17879. if (n.hasOwnProperty(r)) {
  17880. var o = t.get(r);
  17881. i.push(o)
  17882. } return i
  17883. }, h.prototype.populateScoredPanos = function (e, t, i, n, r) {
  17884. (i = i || []).length = 0;
  17885. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)],
  17886. a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)],
  17887. s = t.sortByScore(o, a);
  17888. if (s)
  17889. for (var l = 0; l < s.length && l < r; l++) {
  17890. var c = s[l].pano;
  17891. i.push(c)
  17892. }
  17893. return i
  17894. }, h.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  17895. for (var o = 0, a = 0; a < t.length; a++) {
  17896. var s = t[a];
  17897. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0, r && r <= o) break
  17898. }
  17899. return o
  17900. }, h.prototype.queueTilesForPano = (r = {
  17901. filter: a.None
  17902. }, function (e, t, i, n) {
  17903. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  17904. }), h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3, function (e, t, i, n, r, o, a, s) {
  17905. for (var l = 0, c = 0; c < i.length; c++) {
  17906. var h = i[c];
  17907. d.copy(h.position), d.sub(r), d.normalize();
  17908. var u = Math.max(Math.min(o.dot(d), 1), -1);
  17909. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0, s && s <= l)) break
  17910. }
  17911. return l
  17912. }), h.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  17913. for (var l = 0, c = 0; c < i.length; c++) {
  17914. var h = i[c];
  17915. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0, s && s <= l) break
  17916. }
  17917. return l
  17918. }, h.prototype.queueTilesInDirectionForPano = (s = {
  17919. filter: a.DirectionalFOV,
  17920. direction: new o.Vector3,
  17921. fov: 60
  17922. }, l = new o.Vector3, function (e, t, i, n, r, o, a) {
  17923. return l.copy(o), m.getRelativeDirection(i.quaternion, l), s.direction.copy(l), s.fov = a, this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  17924. }), h.prototype.filterAndQueueTileDownloadDescriptors = (c = [], function (e, t, i, n, r) {
  17925. var o = t.getTileDownloadDescriptors(i, n);
  17926. c.length = 0, this.filterTileDownloadDescriptors(i, o, c, r);
  17927. for (var a = 0, s = 0; s < c.length; s++) {
  17928. var l = c[s];
  17929. l && (e.push(l), a++)
  17930. }
  17931. return a
  17932. }), h.prototype.filterTileDownloadDescriptors = (new o.Vector3, function (e, t, i, n) {
  17933. var r, o;
  17934. switch (n.filter) {
  17935. case a.DirectionalFOV:
  17936. for (r = 0; r < t.length; r++) o = t[r], m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  17937. break;
  17938. default:
  17939. for (r = 0; r < t.length; r++) o = t[r], i.push(o)
  17940. }
  17941. for (r = 0; r < i.length; r++) o = i[r], this.canIncludeDescriptor(o) || (i[r] = null)
  17942. }), h.prototype.canIncludeDescriptor = function (e) {
  17943. return e.status !== i.Downloading && e.status !== i.Downloaded
  17944. }, h.prototype.canIncludePano = function (e, t) {
  17945. return !e.isLoaded(t)
  17946. }, h.getFOVDotThreshold = function (e) {
  17947. return Math.cos(o.Math.degToRad(e / 2))
  17948. };
  17949. var y = (A._panoSpaceDir = new o.Vector3, A._fovThreshold = -1, A._fovThresholdNarrow = -1, A);
  17950. function A(e, t) {
  17951. var i = A._panoSpaceDir,
  17952. n = A._fovThreshold,
  17953. r = A._fovThresholdNarrow,
  17954. o = Math.max(Math.min(i.dot(e.direction), 1), -1),
  17955. a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  17956. return e._dot = o, t._dot = a, n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  17957. }
  17958. h.sortPanoTiles = function (e, t, i) {
  17959. y._panoSpaceDir.copy(i), m.getRelativeDirection(t.quaternion, y._panoSpaceDir), y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW), y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV), e.sort(y)
  17960. }, h.insertSortedPanoTile = function (e, t, i, n) {
  17961. y._panoSpaceDir.copy(n), m.getRelativeDirection(i.quaternion, y._panoSpaceDir), y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW), y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  17962. for (var r = -1, o = 0; o < e.length; o++) {
  17963. if (y(t, e[o]) <= 0) {
  17964. r = o;
  17965. break
  17966. }
  17967. }
  17968. if (-1 === r) e[e.length] = t;
  17969. else {
  17970. for (var a = e.length; r < a; a--) e[a] = e[a - 1];
  17971. e[r] = t
  17972. }
  17973. }, h.prototype.setZoomingActive = function (e) {
  17974. e !== this.zoomingActive && (this.zoomingActive = e)
  17975. }, C.exports = h
  17976. }).call(this, "/js/tile/TilePrioritizer.js")
  17977. }, {
  17978. "../enum/DownloadStatus": 24,
  17979. "../enum/GLCubeFaces": 25,
  17980. "../enum/ModelManagerEvents": 33,
  17981. "../enum/PanoSizeClass": 36,
  17982. "../enum/Vectors": 50,
  17983. "../enum/Viewmode": 51,
  17984. "../objects/Panorama": 148,
  17985. "../settings": 166,
  17986. "../util/browser": 182,
  17987. "../util/logger": 189,
  17988. "../util/math": 190,
  17989. "./TileUtils": 174,
  17990. events: 202,
  17991. three: 217
  17992. }],
  17993. 173: [function (e, t, i) {
  17994. "use strict";
  17995. function f(e, t) {
  17996. this.levels = t, this.tileSize = e, this.root = null, this.allNodes = [],
  17997. function (e) {
  17998. e.root = function e(t, i, n) {
  17999. if (n > t.levels) return null;
  18000. var r = new a(t, i);
  18001. t.allNodes.push(r);
  18002. for (var o = 0; o < s; o++) r.children[o] = e(t, r, n + 1);
  18003. return r
  18004. }(e, null, 0)
  18005. }(this)
  18006. }
  18007. function a(e, t) {
  18008. this.tree = e, this.parent = t, this.children = [], this.id = ++n
  18009. }
  18010. var g = (e("three"), e("./TileUtils"), e("../objects/Panorama"), e("../util/panorama"), e("events").EventEmitter, 2),
  18011. s = g * g;
  18012. f.TraversalType = Object.freeze({
  18013. PreOrder: 0,
  18014. PostOrder: 1
  18015. });
  18016. var n = 0;
  18017. f.getLevelCountForSize = function (e, t) {
  18018. var i = 0;
  18019. for (t < e && (t = e); !((t /= g) < e);) i++;
  18020. return i
  18021. }, f.getSizeForLevel = function (e, t) {
  18022. return Math.pow(g, t) * e
  18023. }, f.prototype.getSubNode = function (e, t, i) {
  18024. (!t || e < this.tileSize) && (t = 0), (!i || e < this.tileSize) && (i = 0), e < this.tileSize && (e = this.tileSize);
  18025. var n = f.getLevelCountForSize(this.tileSize, e);
  18026. return function e(t, i, n, r, o) {
  18027. if (!t) return null;
  18028. if (0 === n) return t;
  18029. if (!t.children || 0 === t.children.length) return null;
  18030. var a = Math.pow(g, n) / g,
  18031. s = r % a,
  18032. l = o % a,
  18033. c = Math.floor(o / a),
  18034. h = Math.floor(r / a),
  18035. u = c * g + h;
  18036. return e(t.children[u], i + 1, n - 1, s, l)
  18037. }(this.root, 0, n, t, i)
  18038. }, f.prototype.breadthFirst = function (e) {
  18039. var t = !!(e = e || {}).nullLevelEnd,
  18040. i = e.maxLevel,
  18041. n = e.minLevel,
  18042. r = e.callback,
  18043. o = e.saveVisited,
  18044. a = [],
  18045. s = {},
  18046. l = 0;
  18047. for (a.push(this.root), a.push(s); 0 < a.length && !(i && i < l);) {
  18048. var c = a.shift();
  18049. if (c === s)(!n || n <= l) && (r && t && r(null), o && t && o.push(null)), 0 < a.length && a.push(s), l++, 0;
  18050. else {
  18051. if (c.children)
  18052. for (var h = 0; h < c.children.length; h++) {
  18053. c.children[h] && a.push(c.children[h])
  18054. }
  18055. var u = this.getFaceIndexFromNode(c);
  18056. (!n || n <= l) && (r && r(c, l, u), o && o.push(c)), 0
  18057. }
  18058. }
  18059. }, f.prototype.getFaceIndexFromNode = function (e) {
  18060. if (!e) return -1;
  18061. for (var t = 1, i = e, n = 0, r = 0;;) {
  18062. var o = i.parent;
  18063. if (!o) break;
  18064. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s);
  18065. n = a % g * t + n, r = Math.floor(a / g) * t + r, t *= g, i = o
  18066. }
  18067. return r * t + n
  18068. }, f.prototype.depthFirst = function (e, t, i) {
  18069. ! function e(t, i, n, r, o, a, s, l) {
  18070. if (t) {
  18071. s = s || f.TraversalType.PreOrder;
  18072. var c = r * g + n;
  18073. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r), a && a.push(t)), t.children && 0 !== t.children.length) {
  18074. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  18075. for (var p = 0; p < g; p++) e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  18076. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r), a && a.push(t))
  18077. }
  18078. }
  18079. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  18080. }, t.exports = f
  18081. }, {
  18082. "../objects/Panorama": 148,
  18083. "../util/panorama": 191,
  18084. "./TileUtils": 174,
  18085. events: 202,
  18086. three: 217
  18087. }],
  18088. 174: [function (e, t, i) {
  18089. "use strict";
  18090. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"),
  18091. _ = e("../util/MathLight"),
  18092. b = {};
  18093. b.TILE_SIZE = 512, b.FACES_PER_PANO = 6, b.LocationOnTile = {
  18094. Center: 0,
  18095. UpperLeft: 1,
  18096. UpperRight: 2,
  18097. LowerRight: 3,
  18098. LowerLeft: 4
  18099. }, b.getTileVector = function (e, t, i, n, r, o, a, s) {
  18100. var l = e / t,
  18101. c = t / e * 2,
  18102. h = c / 2,
  18103. u = n / l * 2 - 1 + h,
  18104. d = (r = l - 1 - r) / l * 2 - 1 + h;
  18105. switch (o = o || b.LocationOnTile.Center) {
  18106. case b.LocationOnTile.UpperLeft:
  18107. u -= h, d += h, u += a * c;
  18108. break;
  18109. case b.LocationOnTile.UpperRight:
  18110. u += h, d += h, d -= a * c;
  18111. break;
  18112. case b.LocationOnTile.LowerRight:
  18113. u += h, d -= h, u -= a * c;
  18114. break;
  18115. case b.LocationOnTile.LowerLeft:
  18116. u -= h, d -= h, d += a * c;
  18117. break;
  18118. case b.LocationOnTile.Center:
  18119. }
  18120. switch (i) {
  18121. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18122. _.setVector(s, -1, d, -u);
  18123. break;
  18124. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18125. _.setVector(s, 1, d, u);
  18126. break;
  18127. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18128. _.setVector(s, -u, 1, -d);
  18129. break;
  18130. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18131. _.setVector(s, -u, -1, d);
  18132. break;
  18133. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18134. _.setVector(s, -u, d, 1);
  18135. break;
  18136. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18137. _.setVector(s, u, d, -1)
  18138. }
  18139. _.normalize(s)
  18140. }, b.getFaceForTile = function (e, t) {
  18141. var i = b.TILE_SIZE;
  18142. e < b.TILE_SIZE && (i = e);
  18143. var n = Math.floor(e / i),
  18144. r = n * n;
  18145. return Math.floor(t / r)
  18146. }, b.getTileLocation = function (e, t, i) {
  18147. var n = b.TILE_SIZE;
  18148. e < b.TILE_SIZE && (n = e);
  18149. var r = b.getFaceForTile(e, t),
  18150. o = Math.floor(e / n),
  18151. a = t - r * (o * o);
  18152. i.tileX = a % o, i.tileY = Math.floor(a / o), i.face = r, i.faceTileIndex = a
  18153. }, b.getTileCountForSize = function (e) {
  18154. if (e <= b.TILE_SIZE) return b.FACES_PER_PANO;
  18155. var t = Math.floor(e / b.TILE_SIZE);
  18156. return t * t * b.FACES_PER_PANO
  18157. }, b.getRelativeDirection = (r = new _.Matrix4, o = new _.Quaternion, function (e, t) {
  18158. o.copy(e), o.inverse(), r.makeRotationFromQuaternion(o), r.applyToVector3(t), _.normalize(t)
  18159. }), b.matchingTilesInDirection = (c = new _.Vector3, h = new _.Vector3(0, 0, -1), u = new _.Quaternion, l = {
  18160. face: -1,
  18161. faceTileIndex: -1,
  18162. tileX: -1,
  18163. tileY: -1
  18164. }, d = function (e, t, i) {
  18165. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++) b.getTileLocation(e, o, l), t && !t(l) || (r++, i && (a = l, i.push({
  18166. face: a.face,
  18167. faceTileIndex: a.faceTileIndex,
  18168. tileX: a.tileX,
  18169. tileY: a.tileY
  18170. })));
  18171. var a;
  18172. return r
  18173. }, function (e, t, i, n, r, o) {
  18174. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  18175. if (b.getTileCountForSize(t), !n && !r) return d(t, null, o);
  18176. var s = !!r;
  18177. return r = r || n, r = Math.max(0, Math.min(r, 360)), n = Math.max(0, Math.min(n, 360)), _.copyVector(i, c), b.getRelativeDirection(e.quaternion, c), s ? (u.setFromUnitVectors(c, h), d(t, function (e) {
  18178. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  18179. }, o)) : d(t, function (e) {
  18180. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  18181. }, o)
  18182. }), b.isTileWithinFrustum = (E = new _.Vector3, function (e, t, i, n, r, o, a, s) {
  18183. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  18184. if (b.getTileVector(e, t, d, n, r, y, 0, E), _.applyQuaternionToVector(o, E), -1e-5 <= E.z);
  18185. else {
  18186. var A = -1 / E.z,
  18187. C = E.x * A,
  18188. I = E.y * A;
  18189. l < I ? p++ : I < c && f++, h < C ? g++ : C < u && m++, v++
  18190. } return f !== v && p !== v && g !== v && m !== v
  18191. }), b.isTileWithinFOV = (p = new _.Vector3, f = new _.Vector3(0, 1, 0), g = new _.Vector3(1, 0, 0), function (e, t, i, n, r, o, a) {
  18192. var s = b.mapFaceToCubemapFace(i);
  18193. if (_.cross(o, f, g), b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p), b.isWithinFOV(p, o, a, null)) return !0;
  18194. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  18195. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  18196. if (b.getTileVector(e, t, s, n, r, d, h, p), b.isWithinFOV(p, o, a, null)) return !0;
  18197. h += l
  18198. }
  18199. return !1
  18200. }), b.isWithinFOV = (a = new _.Vector3, s = new _.Vector3, function (e, t, i, n) {
  18201. if (_.copyVector(e, s), n) {
  18202. _.copyVector(n, a), _.normalize(a);
  18203. var r = _.dot(a, e);
  18204. a.x *= r, a.y *= r, a.z *= r, _.subVector(s, a)
  18205. }
  18206. var o = i / 2 * _.RADIANS_PER_DEGREE;
  18207. return Math.cos(o) <= _.dot(s, t)
  18208. }), b.mapFaceToCubemapFace = (n = {
  18209. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  18210. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  18211. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  18212. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  18213. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  18214. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  18215. }, function (e) {
  18216. return n[e]
  18217. }), t.exports = b
  18218. }, {
  18219. "../enum/GLCubeFaces": 25,
  18220. "../util/MathLight": 176
  18221. }],
  18222. 175: [function (i, n, e) {
  18223. (function (e) {
  18224. "use strict";
  18225. function t() {
  18226. this.list = [], this.index = {}, Object.defineProperty(this, "length", {
  18227. get: function () {
  18228. return this.list.length
  18229. }
  18230. })
  18231. }
  18232. new(i("./common"), i("./logger"))(e), t.prototype.forEach = function (e) {
  18233. this.list.forEach(e)
  18234. }, t.prototype.add = function (e) {
  18235. this.list.push(e), this.index[this.getIndex(e)] = e
  18236. }, t.prototype.getIndex = function (e) {
  18237. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  18238. }, t.prototype.extend = function (e) {
  18239. for (var t = 0; t < e.length; t++) this.add(e[t])
  18240. }, t.prototype.get = function (e) {
  18241. return this.index[e]
  18242. }, t.prototype.first = function () {
  18243. return this.list[0]
  18244. }, t.prototype.last = function () {
  18245. return this.list[this.list.length - 1]
  18246. }, t.prototype.reIndex = function () {
  18247. this.index = {};
  18248. var t = this;
  18249. this.forEach(function (e) {
  18250. t.index[t.getIndex(e)] = e
  18251. })
  18252. }, t.prototype.filter = function (e) {
  18253. var t = this.list.filter(e);
  18254. return this.reIndex(), t
  18255. }, t.prototype.reduce = function (e, t) {
  18256. return this.list.reduce(e, t)
  18257. }, t.prototype.sort = function (e) {
  18258. return this.list.sort(e)
  18259. }, t.prototype.indexOf = function (e) {
  18260. for (var t = 0; t < this.list.length; ++t)
  18261. if (this.list[t] === e) return t;
  18262. return -1
  18263. }, n.exports = t
  18264. }).call(this, "/js/util/IndexedCollection.js")
  18265. }, {
  18266. "./common": 185,
  18267. "./logger": 189
  18268. }],
  18269. 176: [function (e, t, i) {
  18270. "use strict";
  18271. e("../constants");
  18272. var n, r, o = {};
  18273. o.RADIANS_PER_DEGREE = Math.PI / 180, o.DEGREES_PER_RADIAN = 180 / Math.PI, o.Vector3 = function (e, t, i) {
  18274. this.x = e || 0, this.y = t || 0, this.z = i || 0
  18275. }, o.Matrix4 = function () {
  18276. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  18277. }, o.Matrix4.prototype = {
  18278. identity: function () {
  18279. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  18280. },
  18281. copy: function (e) {
  18282. return this.elements.set(e.elements), this
  18283. },
  18284. applyToVector3: function (e) {
  18285. var t = e.x,
  18286. i = e.y,
  18287. n = e.z,
  18288. r = this.elements;
  18289. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12], e.y = r[1] * t + r[5] * i + r[9] * n + r[13], e.z = r[2] * t + r[6] * i + r[10] * n + r[14], this
  18290. },
  18291. getInverse: function (e, t) {
  18292. var i = this.elements,
  18293. n = e.elements,
  18294. r = n[0],
  18295. o = n[1],
  18296. a = n[2],
  18297. s = n[3],
  18298. l = n[4],
  18299. c = n[5],
  18300. h = n[6],
  18301. u = n[7],
  18302. d = n[8],
  18303. p = n[9],
  18304. f = n[10],
  18305. g = n[11],
  18306. m = n[12],
  18307. v = n[13],
  18308. y = n[14],
  18309. A = n[15],
  18310. C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A,
  18311. I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A,
  18312. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A,
  18313. _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y,
  18314. b = r * C + o * I + a * E + s * _;
  18315. if (0 == b) {
  18316. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  18317. if (t) throw new Error(w);
  18318. return console.warn(w), this.identity()
  18319. }
  18320. var T = 1 / b;
  18321. return i[0] = C * T, i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T, i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T, i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T, i[4] = I * T, i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T, i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T, i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T, i[8] = E * T, i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T, i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T, i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T, i[12] = _ * T, i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T, i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T, i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T, this
  18322. },
  18323. makeRotationFromQuaternion: function (e) {
  18324. var t = this.elements,
  18325. i = e.x,
  18326. n = e.y,
  18327. r = e.z,
  18328. o = e.w,
  18329. a = i + i,
  18330. s = n + n,
  18331. l = r + r,
  18332. c = i * a,
  18333. h = i * s,
  18334. u = i * l,
  18335. d = n * s,
  18336. p = n * l,
  18337. f = r * l,
  18338. g = o * a,
  18339. m = o * s,
  18340. v = o * l;
  18341. return t[0] = 1 - (d + f), t[4] = h - v, t[8] = u + m, t[1] = h + v, t[5] = 1 - (c + f), t[9] = p - g, t[2] = u - m, t[6] = p + g, t[10] = 1 - (c + d), t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this
  18342. }
  18343. }, o.Quaternion = function (e, t, i, n) {
  18344. this._x = e || 0, this._y = t || 0, this._z = i || 0, this._w = void 0 !== n ? n : 1
  18345. }, o.Quaternion.prototype = {
  18346. get x() {
  18347. return this._x
  18348. },
  18349. set x(e) {
  18350. this._x = e
  18351. },
  18352. get y() {
  18353. return this._y
  18354. },
  18355. set y(e) {
  18356. this._y = e
  18357. },
  18358. get z() {
  18359. return this._z
  18360. },
  18361. set z(e) {
  18362. this._z = e
  18363. },
  18364. get w() {
  18365. return this._w
  18366. },
  18367. set w(e) {
  18368. this._w = e
  18369. },
  18370. copy: function (e) {
  18371. this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w
  18372. },
  18373. inverse: function () {
  18374. return this.conjugate().normalize()
  18375. },
  18376. conjugate: function () {
  18377. return this._x *= -1, this._y *= -1, this._z *= -1, this
  18378. },
  18379. length: function () {
  18380. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  18381. },
  18382. normalize: function () {
  18383. var e = this.length();
  18384. return 0 === e ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this
  18385. },
  18386. setFromAxisAngle: function (e, t) {
  18387. var i = t / 2,
  18388. n = Math.sin(i);
  18389. return this._x = e.x * n, this._y = e.y * n, this._z = e.z * n, this._w = Math.cos(i), this
  18390. },
  18391. setFromUnitVectors: function (e, t) {
  18392. return void 0 === n && (n = new o.Vector3), (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0, Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n), this._x = n.x, this._y = n.y, this._z = n.z, this._w = r, this.normalize()
  18393. },
  18394. multiply: function (e) {
  18395. return this.multiplyQuaternions(this, e)
  18396. },
  18397. premultiply: function (e) {
  18398. return this.multiplyQuaternions(e, this)
  18399. },
  18400. multiplyQuaternions: function (e, t) {
  18401. var i = e._x,
  18402. n = e._y,
  18403. r = e._z,
  18404. o = e._w,
  18405. a = t._x,
  18406. s = t._y,
  18407. l = t._z,
  18408. c = t._w;
  18409. return this._x = i * c + o * a + n * l - r * s, this._y = n * c + o * s + r * a - i * l, this._z = r * c + o * l + i * s - n * a, this._w = o * c - i * a - n * s - r * l, this
  18410. }
  18411. }, o.convertWorkshopVector = function (e) {
  18412. return new o.Vector3(-e.x, e.y, e.z)
  18413. }, o.convertWorkshopQuaternion = function (e) {
  18414. return new o.Quaternion(-e.x, e.y, e.z, -e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  18415. }, o.convertWorkshopOrthoZoom = function (e) {
  18416. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  18417. }, o.convertWorkshopPanoramaQuaternion = function (e) {
  18418. return new o.Quaternion(e.x, -e.y, -e.z, e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0, 1, 0), 270 * o.RADIANS_PER_DEGREE))
  18419. }, o.normalize = function (e) {
  18420. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  18421. i = Math.sqrt(t);
  18422. e.x /= i, e.y /= i, e.z /= i
  18423. }, o.dot = function (e, t) {
  18424. return e.x * t.x + e.y * t.y + e.z * t.z
  18425. }, o.cross = function (e, t, i) {
  18426. var n = e.x,
  18427. r = e.y,
  18428. o = e.z;
  18429. i.x = r * t.z - o * t.y, i.y = o * t.x - n * t.z, i.z = n * t.y - r * t.x
  18430. }, o.setVector = function (e, t, i, n) {
  18431. e.x = t, e.y = i, e.z = n
  18432. }, o.copyVector = function (e, t) {
  18433. t.x = e.x, t.y = e.y, t.z = e.z
  18434. }, o.addVector = function (e, t) {
  18435. e.x += t.x, e.y += t.y, e.z += t.z
  18436. }, o.subVector = function (e, t) {
  18437. e.x -= t.x, e.y -= t.y, e.z -= t.z
  18438. }, o.applyQuaternionToVector = function (e, t) {
  18439. var i = t.x,
  18440. n = t.y,
  18441. r = t.z,
  18442. o = e.x,
  18443. a = e.y,
  18444. s = e.z,
  18445. l = e.w,
  18446. c = l * i + a * r - s * n,
  18447. h = l * n + s * i - o * r,
  18448. u = l * r + o * n - a * i,
  18449. d = -o * i - a * n - s * r;
  18450. t.x = c * l + d * -o + h * -s - u * -a, t.y = h * l + d * -a + u * -o - c * -s, t.z = u * l + d * -s + c * -a - h * -o
  18451. }, o.angleBetweenVectors = function (e, t) {
  18452. return Math.acos(o.dot(e, t))
  18453. }, t.exports = o
  18454. }, {
  18455. "../constants": 8
  18456. }],
  18457. 177: [function (c, h, e) {
  18458. (function (e) {
  18459. "use strict";
  18460. function t(e) {
  18461. this.cache = null, this.expires = 0
  18462. }
  18463. function i() {
  18464. this.baseUrl = null, this.cache = null, this.expires = 0
  18465. }
  18466. function n() {
  18467. this.baseUrl = null, this.expires = 0
  18468. }
  18469. function r(e) {
  18470. this.initialLoadingPromise = null, this.endpoint = e + "?type=3", this.urlContainer = null, this.authorizationHeader = s.getAuthorizationHeader(), this.containerClasses = [n, i, t]
  18471. }
  18472. c("./ajax");
  18473. var o = c("./logger"),
  18474. a = c("../constants"),
  18475. s = c("./showcase"),
  18476. l = (c("../ab"), new o(e));
  18477. t.prototype = {
  18478. version: 1,
  18479. validate: function (e) {
  18480. return "catalog.json" in e && 0 < Object.keys(e).length
  18481. },
  18482. update: function (e) {
  18483. return this.cache = e, this.expires = Date.now() + a.signedUrlDefaultExpireTime, $.when()
  18484. },
  18485. get: function (e) {
  18486. return this.cache[e]
  18487. }
  18488. }, i.prototype = {
  18489. version: 2,
  18490. validate: function (e) {
  18491. return "catalog.json" in e && "base.url" in e && 1 < Object.keys(e).length
  18492. },
  18493. update: function (e) {
  18494. return this.baseUrl = e["base.url"], this.cache = e, this.expires = Date.now() + a.signedUrlDefaultExpireTime, $.when()
  18495. },
  18496. get: function (e) {
  18497. var t = this.cache[e];
  18498. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  18499. }
  18500. }, n.prototype = {
  18501. version: 3,
  18502. validate: function (e) {
  18503. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  18504. },
  18505. update: function (e) {
  18506. return this.baseUrl = e.templates[0], e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime, $.when()
  18507. },
  18508. get: function (e) {
  18509. return this.baseUrl.replace("{{filename}}", e)
  18510. }
  18511. }, r.prototype = {
  18512. init: function () {
  18513. return this.initialLoadingPromise || (setInterval(function () {
  18514. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  18515. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."), this.refresh().done(function () {
  18516. l.debug("Refreshed")
  18517. }).fail(function () {
  18518. l.error("Failed url refresh, urls might go stale soon")
  18519. }))
  18520. }.bind(this), a.signedUrlCheckInterval), this.initialLoadingPromise = this.refresh()), this.initialLoadingPromise
  18521. },
  18522. refresh: function (e) {
  18523. return {}, $.Deferred().resolve()
  18524. },
  18525. get: function (e) {
  18526. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  18527. }
  18528. }, h.exports = r
  18529. }).call(this, "/js/util/ModelUrls.js")
  18530. }, {
  18531. "../ab": 3,
  18532. "../constants": 8,
  18533. "./ajax": 181,
  18534. "./logger": 189,
  18535. "./showcase": 193
  18536. }],
  18537. 178: [function (l, c, e) {
  18538. (function (e) {
  18539. "use strict";
  18540. function t() {
  18541. i.call(this), this.neighbourMap = {}, this.map = null
  18542. }
  18543. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"),
  18544. n = l("./common"),
  18545. a = l("../settings"),
  18546. r = l("../objects/Panorama"),
  18547. o = (a = l("../settings"), l("./aStar")),
  18548. T = new(l("./logger"))(e),
  18549. i = l("./IndexedCollection"),
  18550. s = l("./transitions");
  18551. n.inherit(t, i), t.prototype.getIndex = function (e) {
  18552. return e.id
  18553. }, t.prototype.find = function (e, t) {
  18554. var i = n.filterAll(this.list, e);
  18555. return 0 === i.length ? null : (t && t.forEach(function (e) {
  18556. i = n.stableSort(i, e)
  18557. }), i[0])
  18558. }, t.prototype.sortByScore = function (e, t) {
  18559. var i = n.filterAll(this.list, e);
  18560. return 0 === i.length ? null : i = i.map(function (i) {
  18561. return {
  18562. pano: i,
  18563. score: t.reduce(function (e, t) {
  18564. return e + t(i)
  18565. }, 0)
  18566. }
  18567. }).sort(function (e, t) {
  18568. return t.score - e.score
  18569. })
  18570. }, t.prototype.lowestByScore = function (e, t, i) {
  18571. return this.findRankedByScore(0, e, t, i)
  18572. }, t.prototype.findRankedByScore = function (e, t, i, n) {
  18573. n && (n.candidates = null, n.pano = null), e = e || 0;
  18574. var r = this.sortByScore(t, i);
  18575. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r, n.pano = r[e].pano), r[e].pano)
  18576. }, t.prototype.showPanoScores = function (e) {
  18577. this.list.forEach(function (e) {
  18578. e.removeTextSprite()
  18579. });
  18580. var t = 6344768;
  18581. e.forEach(function (e) {
  18582. e.pano.addTextSprite(e.score.toFixed(2), t), t = 16428055
  18583. })
  18584. }, t.prototype.isNeighbour = function (e, t) {
  18585. return this.neighbourMap[e.id][t.id]
  18586. }, t.prototype.getNeighbours = function (e) {
  18587. return this.neighbourMap[e.id]
  18588. }, t.prototype.setNeighbour = function (e, t, i) {
  18589. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}), this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}), this.neighbourMap[e.id][e.id] = !0, this.neighbourMap[t.id][t.id] = !0, this.neighbourMap[e.id][t.id] = i, this.neighbourMap[t.id][e.id] = i, this.neighbourMap[e.id]
  18590. }, t.prototype.findClosest = function (e, t) {
  18591. var i = [r.filters.isPanoAligned()];
  18592. return t && i.push(r.filters.inDirection(e, t, .75)), this.find(i, [r.sortFunctions.distanceToPoint(e)])
  18593. }, t.prototype.dualNeighbors = function (e, t) {
  18594. var i, n = [];
  18595. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i);
  18596. return n
  18597. }, t.prototype.populate_path_graph = function () {
  18598. var e, t, i, n, r, o, a, s, l = Date.now(),
  18599. c = {},
  18600. h = 0,
  18601. u = new w.Vector3(0, 0, 0);
  18602. for (e = 0; e < this.list.length; e += 1) {
  18603. for (t in s = !(a = {}), i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  18604. if (i[t]) {
  18605. o = this.index[t], u.copy(r.floorPosition), u.sub(o.floorPosition);
  18606. var d = Math.sqrt(u.x * u.x + u.z * u.z),
  18607. p = (Math.abs(u.y), Math.max(d, .01), Math.max(0, Math.abs(u.y) - .2));
  18608. n = 0 < p ? (1, p = Math.pow(4 * p, 2), d = Math.pow(d, 2), Math.sqrt(p * p + d * d)) : (1, u.length()), a[o.id] = n, s = !0
  18609. } s ? c[r.id] = a : h += 1
  18610. }
  18611. this.map = c, T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  18612. }, t.prototype.aStarSearch = function (e, t) {
  18613. var i = Date.now(),
  18614. n = new o({
  18615. start: e,
  18616. isEnd: function (e) {
  18617. return e === t
  18618. },
  18619. neighbor: function (e) {
  18620. var t = e.neighbourPanos || e.findNeighourPanos(),
  18621. i = [];
  18622. for (var n in t) i.push(this.index[n]);
  18623. return i
  18624. }.bind(this),
  18625. distance: function (e, t) {
  18626. return this.map[e.id][t.id]
  18627. }.bind(this),
  18628. heuristic: function (e, t) {
  18629. return 1
  18630. }.bind(this),
  18631. hash: function (e) {
  18632. return e.id
  18633. },
  18634. timeout: 5e3
  18635. });
  18636. if (T.debug("A* search in " + (Date.now() - i) + "ms"), "success" !== n.status) return T.debug("Did not find A* path from " + e + " to " + t), null;
  18637. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  18638. var r = [];
  18639. return n.path.forEach(function (e) {
  18640. r.push(e.id)
  18641. }), r
  18642. }, t.prototype.includeNodesNearPath = (f = new w.Vector3, g = new w.Vector3, m = new w.Vector3, v = new w.Vector3, y = new w.Vector3, A = new w.Vector3, C = new w.Vector3, I = new w.Vector3, E = [], _ = new w.Vector3, b = new w.Vector3, function (e, t) {
  18643. if (e)
  18644. for (var i = function (e, t, i) {
  18645. return y.copy(t).sub(e), y.dot(i)
  18646. }, n = function (e, t) {
  18647. return i(_, e.position, m) - i(_, t.position, m)
  18648. }, r = 0; r < e.length - 1;) {
  18649. var o = e[r],
  18650. a = e[r + 1],
  18651. s = this.index[o],
  18652. l = this.index[a];
  18653. _.copy(s.position), b.copy(l.position), E.length = 0, f.copy(b).sub(_), m.copy(f).normalize();
  18654. for (var c = 0; c < this.list.length; c++) {
  18655. var h = this.list[c];
  18656. y.copy(h.position).sub(_);
  18657. var u = y.dot(m);
  18658. 0 < u && (C.copy(m), C.multiplyScalar(u), A.copy(y), A.sub(C), A.length() < t && (g.copy(f).negate(), v.copy(g).normalize(), I.copy(h.position).sub(b), 0 < I.dot(v) && E.push(h)))
  18659. }
  18660. if (0 < E.length) {
  18661. E.sort(n);
  18662. for (var d = e.length + E.length - 1; d >= r + E.length; d--) e[d] = e[d - E.length];
  18663. for (var p = 0; p < E.length; p++) e[p + r + 1] = E[p].id
  18664. }
  18665. r += E.length + 1
  18666. }
  18667. }), t.prototype.fadeMarkerOpacity = function (e, t) {
  18668. var i = void 0 === e ? a.panorama.markerOpacity : e,
  18669. n = this.list.findIndex(function (e) {
  18670. return e.marker
  18671. });
  18672. if (!(n < 0)) {
  18673. var r = this.list[n].marker.material.opacity;
  18674. if (r !== e) {
  18675. var o = i - r;
  18676. s.trigger({
  18677. func: function (e, t) {
  18678. var i = r + e * o;
  18679. this.forEach(function (e) {
  18680. e.marker && (e.marker.material.opacity = i)
  18681. })
  18682. }.bind(this),
  18683. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  18684. name: "_fpm"
  18685. })
  18686. }
  18687. }
  18688. }, c.exports = t
  18689. }).call(this, "/js/util/PanoramaCollection.js")
  18690. }, {
  18691. "../objects/Panorama": 148,
  18692. "../settings": 166,
  18693. "./IndexedCollection": 175,
  18694. "./aStar": 180,
  18695. "./common": 185,
  18696. "./logger": 189,
  18697. "./transitions": 195,
  18698. three: 217
  18699. }],
  18700. 179: [function (e, t, i) {
  18701. "use strict";
  18702. function n() {
  18703. this.actionSequence = [], this.actionSequenceInProgress = !1
  18704. }
  18705. function r(e, t, i, n) {
  18706. c.trackAlways("zoom_" + e, {
  18707. from: t,
  18708. to: i,
  18709. pano: n
  18710. })
  18711. }
  18712. var o, a, s, l, c = e("../analytics");
  18713. n.prototype.reset = function (e) {
  18714. this.actionSequenceInProgress = !1, this.actionSequence.length = 0
  18715. }, n.prototype.addZoomAction = (a = o = null, s = !1, l = function () {
  18716. if (o = null, 0 < this.actionSequence.length) {
  18717. var e = this.actionSequence[0].start,
  18718. t = this.actionSequence[this.actionSequence.length - 1].end;
  18719. 1 === e ? function (e, t) {
  18720. r("initial", 1, e, t)
  18721. }(t, a) : function (e, t, i) {
  18722. r("followup", e, t, i)
  18723. }(e, t, a)
  18724. }
  18725. this.reset()
  18726. }, function (e, t, i) {
  18727. if (e !== t) {
  18728. s || (l = l.bind(this), s = !0), o && (window.clearTimeout(o), o = null), i === a && this.actionSequenceInProgress || (this.reset(), a = i), this.actionSequenceInProgress = !0;
  18729. var n = {
  18730. start: e,
  18731. end: t
  18732. };
  18733. this.actionSequence.push(n), o = window.setTimeout(l, 150)
  18734. }
  18735. }), t.exports = n
  18736. }, {
  18737. "../analytics": 4
  18738. }],
  18739. 180: [function (e, t, i) {
  18740. "use strict";
  18741. function g(e) {
  18742. if (void 0 === e.parent) return [e.data];
  18743. var t = g(e.parent);
  18744. return t.push(e.data), t
  18745. }
  18746. function m(e) {
  18747. return e.toString()
  18748. }
  18749. function v(e, t) {
  18750. return e.f - t.f
  18751. }
  18752. var y = e("Set"),
  18753. A = e("heap"),
  18754. C = e("dict");
  18755. t.exports = function (e) {
  18756. void 0 === e.timeout && (e.timeout = 1 / 0);
  18757. var t = e.hash || m,
  18758. i = {
  18759. data: e.start,
  18760. g: 0,
  18761. h: e.heuristic(e.start)
  18762. },
  18763. n = i;
  18764. i.f = i.h;
  18765. var r = new y,
  18766. o = new A(v),
  18767. a = C();
  18768. o.push(i), a.set(t(i.data), i);
  18769. for (var s = new Date; o.size();) {
  18770. if (new Date - s > e.timeout) return {
  18771. status: "timeout",
  18772. cost: n.g,
  18773. path: g(n)
  18774. };
  18775. var l = o.pop();
  18776. if (a.delete(t(l.data)), e.isEnd(l.data)) return {
  18777. status: "success",
  18778. cost: l.g,
  18779. path: g(l)
  18780. };
  18781. r.add(t(l.data));
  18782. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  18783. var u = c[h];
  18784. if (!r.contains(t(u))) {
  18785. var d = l.g + e.distance(l.data, u),
  18786. p = a.get(t(u)),
  18787. f = !1;
  18788. if (void 0 === p) p = {
  18789. data: u
  18790. }, a.set(t(u), p);
  18791. else {
  18792. if (p.g < d) continue;
  18793. f = !0
  18794. }
  18795. p.parent = l, p.g = d, p.h = e.heuristic(u), p.f = d + p.h, p.h < n.h && (n = p), f ? o.heapify() : o.push(p)
  18796. }
  18797. }
  18798. }
  18799. return {
  18800. status: "noPath",
  18801. cost: n.g,
  18802. path: g(n)
  18803. }
  18804. }
  18805. }, {
  18806. Set: 196,
  18807. dict: 210,
  18808. heap: 211
  18809. }],
  18810. 181: [function (i, n, e) {
  18811. (function (e) {
  18812. "use strict";
  18813. function s(e, t, i) {
  18814. function n() {
  18815. l.warn("Retrying ", t), s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  18816. }
  18817. var r = function (e, t, i) {
  18818. var n = new XMLHttpRequest;
  18819. if (i && "withCredentials" in n) n.open(e, t, i);
  18820. else if ("undefined" != typeof XDomainRequest)(n = new XDomainRequest).open(e, t);
  18821. else {
  18822. if (i) throw "Browser does not support CORS!";
  18823. n.open(e, t)
  18824. }
  18825. return n
  18826. }(e, t, !1);
  18827. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0, i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(), i.responseType)
  18828. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType)) r.responseType = i.responseType;
  18829. else {
  18830. if ("image/jpeg" !== i.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  18831. r.responseType = "arraybuffer"
  18832. } if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"), i.auth && r.setRequestHeader("Authorization", i.auth), "object" == typeof i.data && (i.data = JSON.stringify(i.data), r.setRequestHeader("Content-Type", "application/json")), "object" == typeof i.headers)
  18833. for (var o in i.headers) r.setRequestHeader(o, i.headers[o]);
  18834. var a = $.Deferred();
  18835. return r.onreadystatechange = function (e) {
  18836. if (4 === this.readyState)
  18837. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3) i.retries++, setTimeout(n, 1e3);
  18838. else if (200 === this.status) {
  18839. var t = function (e, t) {
  18840. var i = e.response;
  18841. if ("json" === t && "object" != typeof i) try {
  18842. i = JSON.parse(e.responseText)
  18843. } catch (e) {
  18844. return void a.reject({
  18845. error: "Failed parsing JSON"
  18846. })
  18847. } else if ("image/jpeg" === t) {
  18848. var n = new Uint8Array(e.response),
  18849. r = new Blob([n], {
  18850. type: "image/jpeg"
  18851. }),
  18852. o = URL.createObjectURL(r);
  18853. (i = new Image).src = o, i.crossOrigin = "Anonymous", i.onload = function () {
  18854. URL.revokeObjectURL(o)
  18855. }
  18856. } return i
  18857. }(this, i.responseType);
  18858. a.resolve(t)
  18859. } else a.reject(this)
  18860. }, r.onprogress = function (e) {
  18861. a.notify(e)
  18862. }, r.send(i.data), a.promise()
  18863. }
  18864. function o(e, t) {
  18865. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  18866. return t.headers && function (t) {
  18867. return Object.keys(t).sort().map(function (e) {
  18868. return {
  18869. key: e,
  18870. value: t[e]
  18871. }
  18872. })
  18873. }(t.headers).forEach(function (e) {
  18874. i += "__" + e.key + ":" + e.value
  18875. }), i
  18876. }
  18877. var t = i("./logger"),
  18878. a = i("../ab"),
  18879. l = new t(e);
  18880. window.URL = window.URL || window.webkitURL, window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}, window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}, n.exports = {
  18881. get: function (e, t) {
  18882. var i, n = void 0 === (t = t || {}).cache || t.cache;
  18883. if (n) {
  18884. var r = function (e, t) {
  18885. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  18886. }(e, t);
  18887. if (r) return r
  18888. }
  18889. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t), n && function (e, t, i) {
  18890. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  18891. }(e, t, i), i
  18892. },
  18893. post: function (e, t) {
  18894. return s("POST", e, t)
  18895. },
  18896. patch: function (e, t) {
  18897. return s("PATCH", e, t)
  18898. },
  18899. getImage: function (e, t) {
  18900. function i() {
  18901. l.warn("Retrying ", e), o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  18902. }
  18903. var n = $.Deferred(),
  18904. r = new Image,
  18905. o = this;
  18906. return e = a.changeIfImageOptimzing(e), null != t || (t = 3), r.onerror = function () {
  18907. 0 < t ? setTimeout(i, 1e3) : n.reject()
  18908. }, r.onload = function () {
  18909. n.resolve(r)
  18910. }, r.crossOrigin = "anonymous", r.src = e, n
  18911. }
  18912. }
  18913. }).call(this, "/js/util/ajax.js")
  18914. }, {
  18915. "../ab": 3,
  18916. "./logger": 189
  18917. }],
  18918. 182: [function (e, t, i) {
  18919. "use strict";
  18920. function n(e, t) {
  18921. var i = window.navigator.userAgent.match(e);
  18922. return i = i ? i[1].split(t) : [], {
  18923. major: parseInt(i[0]) || 0,
  18924. minor: parseInt(i[1]) || 0,
  18925. patch: parseInt(i[2]) || 0
  18926. }
  18927. }
  18928. var r = e("../exception/DeviceMismatchException");
  18929. t.exports = {
  18930. isFullscreen: function () {
  18931. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  18932. },
  18933. supportsFullscreen: function () {
  18934. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  18935. },
  18936. isPointerLocked: function () {
  18937. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  18938. },
  18939. requestFullscreen: function (e, t) {
  18940. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(), t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  18941. },
  18942. requestPointerLock: function () {
  18943. var e;
  18944. if (document.fullscreenElement) e = document.fullscreenElement();
  18945. else if (document.mozFullscreenElement) e = document.mozFullscreenElement();
  18946. else if (document.mozFullScreenElement) e = document.mozFullScreenElement();
  18947. else {
  18948. if (!document.webkitFullscreenElement) return;
  18949. e = document.webkitFullscreenElement()
  18950. }
  18951. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock, e.requestPointerLock(), $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  18952. },
  18953. exitPointerLock: function () {
  18954. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock, document.exitPointerLock()
  18955. },
  18956. exitFullscreen: function () {
  18957. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  18958. },
  18959. details: function () {
  18960. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  18961. return e ? {
  18962. name: e[1],
  18963. version: parseInt(e[2]),
  18964. platform: navigator.platform
  18965. } : {}
  18966. },
  18967. is: function (e) {
  18968. return this.details() && this.details().name === e
  18969. },
  18970. inIframe: function () {
  18971. return window.parent !== window
  18972. },
  18973. aspectRatio: function () {
  18974. var e = $("#player").width() / $("#player").height();
  18975. return isFinite(e) ? e : 0
  18976. },
  18977. userAgent: function () {
  18978. return window.navigator.userAgent
  18979. },
  18980. isMobile: function () {
  18981. var e = navigator.userAgent || navigator.vendor || window.opera;
  18982. 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))
  18983. },
  18984. isLandscape: function () {
  18985. return this.isMobile && 1 < this.aspectRatio()
  18986. },
  18987. isSmallScreen: function () {
  18988. return screen.width / window.devicePixelRatio < 240
  18989. },
  18990. detectIE: function () {
  18991. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  18992. },
  18993. detectSafari: function () {
  18994. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  18995. },
  18996. detectFirefox: function () {
  18997. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  18998. },
  18999. detectChrome: function () {
  19000. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  19001. },
  19002. detectOpera: function () {
  19003. return -1 !== window.navigator.userAgent.indexOf("OPR")
  19004. },
  19005. detectIOS: function () {
  19006. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  19007. },
  19008. detectIPad: function () {
  19009. var e = window.navigator.userAgent;
  19010. return /iPad/.test(e)
  19011. },
  19012. detectIPod: function () {
  19013. var e = window.navigator.userAgent;
  19014. return /iPod/.test(e)
  19015. },
  19016. detectIPhone: function () {
  19017. var e = window.navigator.userAgent;
  19018. return /iPhone/.test(e)
  19019. },
  19020. detectAndroid: function () {
  19021. return -1 !== window.navigator.userAgent.indexOf("Android")
  19022. },
  19023. detectAndroidMobile: function () {
  19024. var e = window.navigator.userAgent;
  19025. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  19026. },
  19027. detectSamsungNative: function () {
  19028. var e = window.navigator.userAgent;
  19029. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  19030. },
  19031. detectSamsungS6: function () {
  19032. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  19033. },
  19034. detectHUAWEI5X: function () {
  19035. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  19036. },
  19037. detectWebVR: function () {
  19038. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  19039. },
  19040. getVRDisplay: function () {
  19041. var t = $.Deferred();
  19042. return this.detectWebVR() ? (navigator.getVRDisplays().then(function (e) {
  19043. 1 <= e.length && t.resolve(e[0]), t.reject(null)
  19044. }), t) : t.reject(null)
  19045. },
  19046. iosVersion: function () {
  19047. if (!this.detectIOS()) throw new r("Did not detect an iDevice");
  19048. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  19049. },
  19050. androidVersion: function () {
  19051. if (!this.detectAndroid()) throw new r("Did not detect an Android based device");
  19052. return n(/Android ((?:\d+\.?){1,3})/, ".")
  19053. },
  19054. valueFromCookie: function (e, t) {
  19055. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  19056. if (!i) return t;
  19057. var n = i[1];
  19058. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  19059. },
  19060. valueFromHash: function (e, t) {
  19061. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  19062. if (!i) return t;
  19063. var n = i[1];
  19064. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  19065. }
  19066. }
  19067. }, {
  19068. "../exception/DeviceMismatchException": 56
  19069. }],
  19070. 183: [function (i, n, e) {
  19071. (function (e) {
  19072. "use strict";
  19073. var o = i("../controls/serializer"),
  19074. a = i("../util/math"),
  19075. s = i("./browser"),
  19076. l = i("../enum/Viewmode"),
  19077. t = i("../util/logger"),
  19078. c = i("three"),
  19079. h = new t(e);
  19080. n.exports = {
  19081. getStartCameraOptions: function (e, t) {
  19082. var i = function (e) {
  19083. var t = s.valueFromHash("start", ""),
  19084. i = {};
  19085. if ("" !== t) {
  19086. h.debug("Start override found in parameters, trying to parse..."), i = function (e) {
  19087. return o.deserialize(e)
  19088. }(t) || {};
  19089. var n = s.valueFromHash("tag", null);
  19090. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId))
  19091. }
  19092. return i
  19093. }(t);
  19094. if (0 < Object.keys(i).length) return i;
  19095. if (e.heroImage) i = function (e, t) {
  19096. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {};
  19097. var i = {},
  19098. n = e.heroImage.metadata;
  19099. h.debug("Using start position from thumbnail image"), i.position = n.camera_position, i.quaternion = n.camera_quaternion;
  19100. try {
  19101. i.mode = l.convertWorkshopModeInt(n.camera_mode), i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  19102. } catch (e) {
  19103. h.debug(e.message)
  19104. }
  19105. return i
  19106. }(e, t);
  19107. else if (e.data.camera_start) {
  19108. var n = e.data.camera_start;
  19109. try {
  19110. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode), i.position = n.camera.position, i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion), i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom), n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position), h.debug("Using camera_start"), h.debug("Modeldata pano: ", i.pano.quaternion), h.debug("Camera start pano: ", n.pano.quaternion)), i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  19111. } catch (e) {
  19112. h.warn(e.message)
  19113. }
  19114. }
  19115. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}), i.mode === l.MESH && i.position && (i.mode = l.PANORAMA, i.pano = t.findClosest(i.position), i.quaternion = i.pano.quaternion), 0 === Object.keys(i).length) {
  19116. var r = t.list[0];
  19117. r && (i.mode = l.PANORAMA, i.pano = r, i.position = r.position, i.quaternion = r.quaternion, h.info("Starting at 1st pano " + r.id))
  19118. }
  19119. return i.mode = i.mode || l.DOLLHOUSE, i
  19120. }
  19121. }
  19122. }).call(this, "/js/util/camera.js")
  19123. }, {
  19124. "../controls/serializer": 14,
  19125. "../enum/Viewmode": 51,
  19126. "../util/logger": 189,
  19127. "../util/math": 190,
  19128. "./browser": 182,
  19129. three: 217
  19130. }],
  19131. 184: [function (e, t, i) {
  19132. "use strict";
  19133. function r(e, t, i) {
  19134. var n = t,
  19135. r = i;
  19136. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  19137. }
  19138. function o(e, t, i) {
  19139. var n = t,
  19140. r = i;
  19141. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  19142. }
  19143. var a = e("./MathLight");
  19144. t.exports = {
  19145. clampVFOV: function (e, t, i, n) {
  19146. return t < r(e, i, n) ? o(t, i, n) : e
  19147. },
  19148. getHFOVForCamera: function (e, t, i) {
  19149. return r(e.fov, t, i)
  19150. },
  19151. getHFOVFromVFOV: r,
  19152. getVFOVFromHFOV: o
  19153. }
  19154. }, {
  19155. "./MathLight": 176
  19156. }],
  19157. 185: [function (e, t, i) {
  19158. "use strict";
  19159. var a = e("three");
  19160. t.exports = {
  19161. delayOneFrame: function (e) {
  19162. window.setTimeout(e, 1)
  19163. },
  19164. normalizeUrl: function (e) {
  19165. return e.replace("https://", "http://")
  19166. },
  19167. domainFromUrl: function (e) {
  19168. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  19169. return t ? t[3] : e
  19170. },
  19171. average: function (e, t) {
  19172. if (0 === e.length) return null;
  19173. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  19174. i += t ? e[r][t] : e[r], n++
  19175. }
  19176. return i / n
  19177. },
  19178. countUnique: function (e) {
  19179. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0);
  19180. return Object.keys(t).length
  19181. },
  19182. averageVectors: function (e, t) {
  19183. var i = new a.Vector3;
  19184. if (0 === e.length) return i;
  19185. for (var n = 0, r = 0; r < e.length; r++) {
  19186. var o = t ? e[r][t] : e[r];
  19187. i.add(o), n++
  19188. }
  19189. return i.divideScalar(n)
  19190. },
  19191. equalLists: function (e, t) {
  19192. if (e.length !== t.length) return !1;
  19193. for (var i = 0; i < e.length; i++)
  19194. if (e[i] !== t[i]) return !1;
  19195. return !0
  19196. },
  19197. lowerMedian: function (e, t) {
  19198. return 0 === e.length ? null : (t = t || 2, e.sort(function (e, t) {
  19199. return e - t
  19200. }), e[Math.floor(e.length / t)])
  19201. },
  19202. stableSort: function (e, n) {
  19203. return e.map(function (e, t) {
  19204. return {
  19205. value: e,
  19206. index: t
  19207. }
  19208. }).sort(function (e, t) {
  19209. var i = n(e.value, t.value);
  19210. return 0 !== i ? i : e.index - t.index
  19211. }).map(function (e) {
  19212. return e.value
  19213. })
  19214. },
  19215. filterAll: function (e, i) {
  19216. return e.filter(function (t) {
  19217. return i.every(function (e) {
  19218. return e(t)
  19219. })
  19220. })
  19221. },
  19222. formatDate: function (e) {
  19223. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  19224. },
  19225. formatDatetime: function (e) {
  19226. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  19227. },
  19228. randomString: function (e) {
  19229. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++) t += i.charAt(Math.floor(Math.random() * i.length));
  19230. return t
  19231. },
  19232. uint8ToBase64: function (e, t) {
  19233. t && "number" == typeof t || (t = 8192);
  19234. for (var i = [], n = 0; n < e.length; n += t) i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  19235. return btoa(i.join(""))
  19236. },
  19237. uuid4: function e(t) {
  19238. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  19239. },
  19240. nth: function (e) {
  19241. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  19242. },
  19243. extendObject: function (t, i) {
  19244. return Object.keys(i).forEach(function (e) {
  19245. t[e] = i[e]
  19246. }), t
  19247. },
  19248. deepExtend: function e(t) {
  19249. t = t || {};
  19250. for (var i = 1; i < arguments.length; i++) {
  19251. var n = arguments[i];
  19252. if (n)
  19253. for (var r in n) n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  19254. }
  19255. return t
  19256. },
  19257. inherit: function (e, t) {
  19258. e.prototype = Object.create(t.prototype), e.prototype.constructor = e
  19259. },
  19260. extend: function (e, t) {
  19261. for (var i in t.prototype) e.prototype[i] = t.prototype[i]
  19262. }
  19263. }, Math.sign = function (e) {
  19264. return e < 0 ? -1 : 1
  19265. }
  19266. }, {
  19267. three: 217
  19268. }],
  19269. 186: [function (e, t, i) {
  19270. "use strict";
  19271. var r = {
  19272. linearTween: function (e, t, i, n) {
  19273. return i * e / n + t
  19274. },
  19275. easeInQuad: function (e, t, i, n) {
  19276. return i * (e /= n) * e + t
  19277. },
  19278. easeOutQuad: function (e, t, i, n) {
  19279. return -i * (e /= n) * (e - 2) + t
  19280. },
  19281. easeInOutQuad: function (e, t, i, n) {
  19282. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  19283. },
  19284. easeInCubic: function (e, t, i, n) {
  19285. return i * (e /= n) * e * e + t
  19286. },
  19287. easeOutCubic: function (e, t, i, n) {
  19288. return e /= n, i * (--e * e * e + 1) + t
  19289. },
  19290. easeInOutCubic: function (e, t, i, n) {
  19291. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  19292. },
  19293. easeInQuart: function (e, t, i, n) {
  19294. return i * (e /= n) * e * e * e + t
  19295. },
  19296. easeOutQuart: function (e, t, i, n) {
  19297. return e /= n, -i * (--e * e * e * e - 1) + t
  19298. },
  19299. easeInOutQuart: function (e, t, i, n) {
  19300. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  19301. },
  19302. easeInQuint: function (e, t, i, n) {
  19303. return i * (e /= n) * e * e * e * e + t
  19304. },
  19305. easeOutQuint: function (e, t, i, n) {
  19306. return e /= n, i * (--e * e * e * e * e + 1) + t
  19307. },
  19308. easeInOutQuint: function (e, t, i, n) {
  19309. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  19310. },
  19311. easeInSine: function (e, t, i, n) {
  19312. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  19313. },
  19314. easeOutSine: function (e, t, i, n) {
  19315. return i * Math.sin(e / n * (Math.PI / 2)) + t
  19316. },
  19317. easeInOutSine: function (e, t, i, n) {
  19318. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  19319. },
  19320. easeInExpo: function (e, t, i, n) {
  19321. return i * Math.pow(2, 10 * (e / n - 1)) + t
  19322. },
  19323. easeOutExpo: function (e, t, i, n) {
  19324. return i * (1 - Math.pow(2, -10 * e / n)) + t
  19325. },
  19326. easeInOutExpo: function (e, t, i, n) {
  19327. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--, i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  19328. },
  19329. easeInCirc: function (e, t, i, n) {
  19330. return e /= n, -i * (Math.sqrt(1 - e * e) - 1) + t
  19331. },
  19332. easeOutCirc: function (e, t, i, n) {
  19333. return e /= n, e--, i * Math.sqrt(1 - e * e) + t
  19334. },
  19335. easeInOutCirc: function (e, t, i, n) {
  19336. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2, i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  19337. },
  19338. easeInElastic: function (e, t, i, n) {
  19339. var r = 1.70158,
  19340. o = 0,
  19341. a = i;
  19342. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n, r = a < Math.abs(i) ? (a = i, o / 4) : o / (2 * Math.PI) * Math.asin(i / a), -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  19343. },
  19344. easeOutElastic: function (e, t, i, n) {
  19345. var r = 1.70158,
  19346. o = 0,
  19347. a = i;
  19348. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n, r = a < Math.abs(i) ? (a = i, o / 4) : o / (2 * Math.PI) * Math.asin(i / a), a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  19349. },
  19350. easeInOutElastic: function (e, t, i, n) {
  19351. var r = 1.70158,
  19352. o = 0,
  19353. a = i;
  19354. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5), r = a < Math.abs(i) ? (a = i, o / 4) : o / (2 * Math.PI) * Math.asin(i / a), e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  19355. },
  19356. easeInBack: function (e, t, i, n, r) {
  19357. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t
  19358. },
  19359. easeOutBack: function (e, t, i, n, r) {
  19360. return void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  19361. },
  19362. easeInOutBack: function (e, t, i, n, r) {
  19363. return void 0 === r && (r = 1.70158), (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  19364. },
  19365. easeOutBounce: function (e, t, i, n) {
  19366. 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
  19367. },
  19368. easeInBounce: function (e, t, i, n) {
  19369. return i - r.easeOutBounce(n - e, 0, i, n) + t
  19370. },
  19371. easeInOutBounce: function (e, t, i, n) {
  19372. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  19373. }
  19374. };
  19375. t.exports = r
  19376. }, {}],
  19377. 187: [function (e, t, i) {
  19378. "use strict";
  19379. function n() {
  19380. this.events = [], this.valid = !1
  19381. }
  19382. var r = e("../enum/Joystick");
  19383. n.prototype.push = function (e, t) {
  19384. this.events.push({
  19385. direction: e,
  19386. pano: t
  19387. }), this.valid = !0
  19388. }, n.prototype.pop = function (e) {
  19389. var t = this.events.pop();
  19390. return this.events.length < 1 && (this.valid = !1), t
  19391. }, n.prototype.peek = function () {
  19392. return this.events.length ? this.events[this.events.length - 1] : {
  19393. direction: null,
  19394. pano: null
  19395. }
  19396. }, n.prototype.invalidate = function () {
  19397. this.events = [], this.valid = !1
  19398. }, n.prototype.reversePano = function (e) {
  19399. if (!this.valid) return null;
  19400. var t = this.peek();
  19401. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null
  19402. }, t.exports = n
  19403. }, {
  19404. "../enum/Joystick": 29
  19405. }],
  19406. 188: [function (e, t, i) {
  19407. "use strict";
  19408. t.exports = {
  19409. vector: function (t, i) {
  19410. var n = t.clone();
  19411. return i = i.clone(),
  19412. function (e) {
  19413. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  19414. }
  19415. },
  19416. quaternion: function (t, i) {
  19417. var n = t.clone();
  19418. return function (e) {
  19419. t.copy(n).slerp(i, e)
  19420. }
  19421. },
  19422. property: function (t, i, n, r) {
  19423. var o = t[i];
  19424. return function (e) {
  19425. t[i] = o * (1 - e) + n * e, r && r(t[i])
  19426. }
  19427. },
  19428. uniform: function (t, i, n) {
  19429. var r = t.material.uniforms[i].value;
  19430. return function (e) {
  19431. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  19432. }
  19433. },
  19434. matrix4: function (o, a) {
  19435. var s = o.clone();
  19436. return function (e) {
  19437. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++) t[r] = i[r] * (1 - e) + n[r] * e
  19438. }
  19439. },
  19440. allUniforms: function (e, t, i) {
  19441. var n = e.map(function (e) {
  19442. return this.uniform(e, t, i)
  19443. }.bind(this));
  19444. return function (t) {
  19445. n.forEach(function (e) {
  19446. e(t)
  19447. })
  19448. }
  19449. }
  19450. }
  19451. }, {}],
  19452. 189: [function (e, t, i) {
  19453. "use strict";
  19454. function h(n) {
  19455. var e, t, i, r, o = n.split("/"),
  19456. a = "[" + o[o.length - 1].replace(".js", "") + "]",
  19457. s = {};
  19458. if (h.consoleEnabled) {
  19459. var l = function (e) {
  19460. $("#debug-console").append("<p>" + e + "</p>"), $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  19461. };
  19462. e = function (e) {
  19463. l(Array.prototype.slice.call(arguments).join(" "))
  19464. }, t = function (e) {
  19465. l(Array.prototype.slice.call(arguments).join(" "))
  19466. }, i = function (e) {
  19467. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  19468. }, r = function (e) {
  19469. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  19470. }
  19471. } else console.log ? (e = console.log, t = console.info ? console.info : console.log, i = console.warn ? console.warn : console.log, r = console.error ? console.error : console.log) : e = t = i = r = function () {};
  19472. function c(e) {
  19473. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  19474. }
  19475. return {
  19476. debug: function () {
  19477. h.level >= h.levels.debug && e.apply(console, c(arguments))
  19478. },
  19479. info: function () {
  19480. h.level >= h.levels.info && t.apply(console, c(arguments))
  19481. },
  19482. warn: function () {
  19483. (function (e, t) {
  19484. if (u) {
  19485. var i = Array.prototype.slice.call(e).join(" ");
  19486. u.captureMessage(i, {
  19487. level: t,
  19488. path: n,
  19489. timestamp: h.timestamp()
  19490. })
  19491. }
  19492. })(arguments, "warn"), h.level >= h.levels.warn && i.apply(console, c(arguments))
  19493. },
  19494. error: function () {
  19495. (function (e, t) {
  19496. if (u) {
  19497. var i = Array.prototype.slice.call(e).join(" ");
  19498. u.captureException(new Error(i), {
  19499. level: t,
  19500. path: n,
  19501. timestamp: h.timestamp()
  19502. })
  19503. }
  19504. })(arguments, "error"), h.level >= h.levels.error && r.apply(console, c(arguments))
  19505. },
  19506. v3str: function (e, t) {
  19507. var i = void 0 === t ? 2 : t;
  19508. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  19509. },
  19510. eulstr: function (e, t) {
  19511. var i = void 0 === t ? 2 : t;
  19512. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  19513. },
  19514. time: function (e) {
  19515. h.level >= h.levels.debug && (s[e] = Date.now())
  19516. },
  19517. timeEnd: function (e) {
  19518. if (h.level >= h.levels.debug) {
  19519. var t = s[e];
  19520. if (!t) return;
  19521. var i = (Date.now() - t) / 1e3;
  19522. this.debug(e, i + "s")
  19523. }
  19524. }
  19525. }
  19526. }
  19527. var u = window.Raven;
  19528. h.timestamp = function () {
  19529. return (Date.now() - window.navigationStart) / 1e3 + "s"
  19530. }, h.level = (h.levels = {
  19531. debug: 3,
  19532. info: 2,
  19533. warn: 1,
  19534. error: 0
  19535. }).info, t.exports = h
  19536. }, {}],
  19537. 190: [function (e, t, i) {
  19538. "use strict";
  19539. var o = e("three"),
  19540. r = e("../enum/GLCubeFaces");
  19541. e("../constants");
  19542. t.exports = {
  19543. convertVisionVector: function (e) {
  19544. return new o.Vector3(e.x, e.z, -e.y)
  19545. },
  19546. convertVisionQuaternion: function (e) {
  19547. return new o.Quaternion(e.x, e.z, -e.y, e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0, 1, 0), o.Math.degToRad(90)))
  19548. },
  19549. convertWorkshopVector: function (e) {
  19550. return new o.Vector3(-e.x, e.y, e.z)
  19551. },
  19552. convertWorkshopQuaternion: function (e) {
  19553. return new o.Quaternion(-e.x, e.y, e.z, -e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  19554. },
  19555. convertWorkshopPanoramaQuaternion: function (e) {
  19556. return new o.Quaternion(e.x, -e.y, -e.z, e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0, 1, 0), o.Math.degToRad(270)))
  19557. },
  19558. convertWorkshopOrthoZoom: function (e) {
  19559. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  19560. },
  19561. toPrecision: function (e, t) {
  19562. function i(e, t) {
  19563. var i = Math.pow(10, t);
  19564. return Math.round(e * i) / i
  19565. }
  19566. if (e instanceof Array) {
  19567. for (var n = 0; n < e.length; n++) e[n] = i(e[n], t);
  19568. return e
  19569. }
  19570. return i(e, t)
  19571. },
  19572. isEmptyQuaternion: function (e) {
  19573. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  19574. },
  19575. projectPositionToCanvas: function (e, t, i) {
  19576. (i = i || new o.Vector3).copy(e);
  19577. var n = .5 * $("#player").width(),
  19578. r = .5 * $("#player").height();
  19579. return i.project(t), i.x = i.x * n + n, i.y = -i.y * r + r, i
  19580. },
  19581. convertScreenPositionToNDC: function (e, t, i) {
  19582. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1, i.y = -t / $("#player").height() * 2 + 1, i
  19583. },
  19584. constrainedTurn: function (e) {
  19585. var t = e % (2 * Math.PI);
  19586. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  19587. },
  19588. getFOVDotThreshold: function (e) {
  19589. return Math.cos(o.Math.degToRad(e / 2))
  19590. },
  19591. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  19592. switch (e) {
  19593. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  19594. i.set(1, t.y, t.x);
  19595. break;
  19596. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  19597. i.set(-1, t.y, -t.x);
  19598. break;
  19599. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  19600. i.set(-t.x, 1, -t.y);
  19601. break;
  19602. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  19603. i.set(-t.x, -1, t.y);
  19604. break;
  19605. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  19606. i.set(-t.x, t.y, 1);
  19607. break;
  19608. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  19609. i.set(t.x, t.y, -1)
  19610. }
  19611. n && i.normalize()
  19612. }
  19613. }
  19614. }, {
  19615. "../constants": 8,
  19616. "../enum/GLCubeFaces": 25,
  19617. three: 217
  19618. }],
  19619. 191: [function (e, t, i) {
  19620. "use strict";
  19621. function o(e) {
  19622. return r[e]
  19623. }
  19624. var n = e("../enum/GLCubeFaces"),
  19625. a = [0, 1, 2, 3, 4, 5],
  19626. r = {
  19627. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  19628. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  19629. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  19630. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  19631. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  19632. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  19633. };
  19634. t.exports = {
  19635. mapFaceToCubemapFace: o,
  19636. getCubemapUrls: function (i, n, r) {
  19637. return a.map(function (e, t) {
  19638. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  19639. }.bind(this))
  19640. }
  19641. }
  19642. }, {
  19643. "../enum/GLCubeFaces": 25
  19644. }],
  19645. 192: [function (e, t, i) {
  19646. "use strict";
  19647. t.exports = {
  19648. captureErrors: function (e, t, i) {
  19649. if ("Raven" in window) {
  19650. Raven.config(e, t).install(), i && Raven.setTagsContext(i);
  19651. var n = console.warn,
  19652. r = console.error;
  19653. console.warn = function () {
  19654. var e = Array.prototype.slice.call(arguments);
  19655. Raven.captureMessage(e.join(" "), {
  19656. level: "warning"
  19657. }), n.apply(console, e)
  19658. }, console.error = function () {
  19659. var e = Array.prototype.slice.call(arguments);
  19660. Raven.captureException(new Error(e.join(" ")), {
  19661. level: "error"
  19662. }), r.apply(console, e)
  19663. }
  19664. } else console.error("Raven not found, not capturing errors.")
  19665. }
  19666. }
  19667. }, {}],
  19668. 193: [function (c, h, e) {
  19669. (function (e) {
  19670. "use strict";
  19671. var i, n = c("./browser"),
  19672. r = c("../constants"),
  19673. o = c("url"),
  19674. t = c("./logger"),
  19675. a = c("three"),
  19676. s = new t(e),
  19677. l = {
  19678. getAuthorizationHeader: function () {
  19679. var e = n.valueFromHash("auth");
  19680. if (e) return e.replace(",", " ");
  19681. var t = n.valueFromCookie("token");
  19682. return t ? "Token " + t : null
  19683. },
  19684. parseSidUrl: function (e) {
  19685. var t, i;
  19686. if (t = g_Prefix, (e = e || "").match(/^https?/)) {
  19687. o.parse(e);
  19688. t = g_Prefix, i = e
  19689. } else i = (t = g_Prefix) + "data/" + e;
  19690. return {
  19691. urlBase: t,
  19692. urlModel: i,
  19693. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  19694. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  19695. }
  19696. },
  19697. getModelIDFromQueryString: function () {
  19698. return n.valueFromHash("model") || n.valueFromHash("m")
  19699. },
  19700. normalizeModeldata: function (e, i) {
  19701. e = JSON.parse(JSON.stringify(e));
  19702. var n = null;
  19703. if (e.images.forEach(function (t) {
  19704. if (t.metadata) {
  19705. if ("string" == typeof t.metadata) try {
  19706. t.metadata = JSON.parse(t.metadata)
  19707. } catch (e) {
  19708. s.warn("Unable to parse image metadata"), t.metadata = null
  19709. } else "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  19710. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position), t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)), t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)), t.metadata.zoom = t.metadata.zoom || 1), !n && e.icon && e.icon === t.sid && (n = t.metadata)
  19711. }
  19712. }), n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  19713. var t = {};
  19714. t.pano = {
  19715. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  19716. position: i.convertWorkshopVector(n.scan_position),
  19717. uuid: n.scan_id
  19718. }, t.camera = {
  19719. quaternion: n.camera_quaternion,
  19720. position: n.camera_position
  19721. }, e.startPano = t
  19722. }
  19723. return e
  19724. },
  19725. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")), function (e) {
  19726. if (!e) throw new Error("Vision version is required");
  19727. var t = i.exec(e);
  19728. if (null === t) throw new Error("String is not a vision version: " + e);
  19729. return parseInt(t[1])
  19730. }),
  19731. modelDataPromisesTiles: function (e) {
  19732. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  19733. if (t) try {
  19734. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  19735. } catch (e) {
  19736. s.warn("Invalid vision version: " + t)
  19737. }
  19738. return !1
  19739. }
  19740. };
  19741. h.exports = l
  19742. }).call(this, "/js/util/showcase.js")
  19743. }, {
  19744. "../constants": 8,
  19745. "./browser": 182,
  19746. "./logger": 189,
  19747. three: 217,
  19748. url: 208
  19749. }],
  19750. 194: [function (e, t, i) {
  19751. "use strict";
  19752. var r = e("../util/ajax"),
  19753. o = e("three"),
  19754. a = e("../settings"),
  19755. s = {};
  19756. t.exports = {
  19757. load: function (e, t, i) {
  19758. var n = s[e];
  19759. return n ? t && setTimeout(function () {
  19760. t(n)
  19761. }, 1) : (n = new o.Texture, a.minimalMemoryMode && (n.minFilter = o.LinearFilter, n.magFilter = o.LinearFilter, n.generateMipmaps = !1), n.sourceFile = e, s[e] = n, r.getImage(e).then(function (e) {
  19762. n.image = e, n.needsUpdate = !0, t && t(n)
  19763. }).fail(i)), n
  19764. },
  19765. loadBase64: function (e, t) {
  19766. t = t || "png";
  19767. var i = new o.Texture;
  19768. return i.image = document.createElement("img"), i.image.setAttribute("src", "data:image/" + t + ";base64," + e), a.minimalMemoryMode && (i.minFilter = o.LinearFilter, i.magFilter = o.LinearFilter, i.generateMipmaps = !1), i.needsUpdate = !0, i
  19769. },
  19770. isLoaded: function (e) {
  19771. return !!s[e]
  19772. }
  19773. }
  19774. }, {
  19775. "../settings": 166,
  19776. "../util/ajax": 181,
  19777. three: 217
  19778. }],
  19779. 195: [function (e, t, i) {
  19780. "use strict";
  19781. var l = e("./easing");
  19782. t.exports = {
  19783. globalDone: null,
  19784. funcs: [],
  19785. counter: 0,
  19786. uniqueID: 0,
  19787. start: function (e, t, i, n, r, o, a) {
  19788. return n = n || 0, this.funcs.push({
  19789. func: e,
  19790. current: -n * Math.abs(t),
  19791. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  19792. done: i,
  19793. easing: r || l.linearTween,
  19794. cycling: t < 0,
  19795. running: !0,
  19796. debug: n < 0,
  19797. name: o || "T" + this.counter,
  19798. id: void 0 === a ? this.counter : a,
  19799. paused: !1
  19800. }), e(0, 16), this.counter += 1, e
  19801. },
  19802. trigger: function (e) {
  19803. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  19804. i = e.func || function () {},
  19805. n = void 0 === e.duration ? 0 : e.duration;
  19806. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  19807. var r = e.done || null,
  19808. o = e.easing || l.linearTween,
  19809. a = e.name || "R" + this.counter,
  19810. s = void 0 === e.id ? this.counter : e.id;
  19811. return this.start(i, n, r, t, o, a, s)
  19812. },
  19813. setTimeout: function (e, t, i) {
  19814. var n = void 0 === i ? this.counter : i;
  19815. return this.trigger({
  19816. done: e,
  19817. duration: void 0 === t ? 0 : t,
  19818. name: "O" + this.counter,
  19819. id: n
  19820. })
  19821. },
  19822. pause: function () {
  19823. this.paused = !0
  19824. },
  19825. resume: function () {
  19826. this.paused = !1
  19827. },
  19828. update: function (n) {
  19829. this.funcs.forEach(function (e) {
  19830. if (!(e.paused || (e.current += 1e3 * n, e.current < 0)))
  19831. if (e.current >= e.duration && !e.cycling) {
  19832. var t = e.easing(1, 0, 1, 1);
  19833. e.func(t, 1e3 * n), e.done && e.done(), e.running = !1
  19834. } else {
  19835. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  19836. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(), e.running = !1)
  19837. }
  19838. });
  19839. var e = this.funcs.length;
  19840. this.funcs = this.funcs.filter(function (e) {
  19841. return e.running
  19842. });
  19843. var t = this.funcs.length;
  19844. if (0 < e && 0 === t && this.globalDone) {
  19845. var i = this.globalDone;
  19846. this.globalDone = null, i()
  19847. }
  19848. },
  19849. adjustSpeed: function (e, t) {
  19850. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  19851. var r = i[n];
  19852. r.duration /= t, r.current /= t
  19853. }
  19854. },
  19855. getById: function (t) {
  19856. return this.funcs.filter(function (e) {
  19857. return t === e.id
  19858. })
  19859. },
  19860. get: function (e) {
  19861. for (var t = 0; t < this.funcs.length; t += 1)
  19862. if (this.funcs[t].func === e) return this.funcs[t];
  19863. return null
  19864. },
  19865. isRunning: function (e) {
  19866. var t = this.get(e);
  19867. return null !== t && t.running
  19868. },
  19869. countActive: function () {
  19870. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running;
  19871. return e
  19872. },
  19873. listActive: function () {
  19874. for (var e = [], t = 0; t < this.funcs.length; t += 1) this.funcs[t].running && e.push(this.funcs[t].name);
  19875. return e
  19876. },
  19877. done: function (e) {
  19878. this.globalDone = e
  19879. },
  19880. cancelById: function (e) {
  19881. var t = void 0 === e ? 0 : e;
  19882. this.funcs = this.funcs.filter(function (e) {
  19883. return e.id !== t
  19884. })
  19885. },
  19886. cancel: function (t) {
  19887. this.funcs = this.funcs.filter(function (e) {
  19888. return e.func !== t
  19889. })
  19890. },
  19891. getUniqueId: function () {
  19892. return this.uniqueID -= 1, this.uniqueID
  19893. }
  19894. }
  19895. }, {
  19896. "./easing": 186
  19897. }],
  19898. 196: [function (e, t, i) {
  19899. function n(e) {
  19900. if (this.set = {}, this.infContains = function () {
  19901. return !0
  19902. }, "object" == typeof e)
  19903. if (e instanceof Array)
  19904. for (var t = 0; t < e.length; t++) this.set[e[t]] = !0;
  19905. else this.set = e;
  19906. else if ("function" == typeof e) this.infContains = e;
  19907. else if (void 0 !== e) throw new Error("set must be either an array or an object.")
  19908. }(t.exports = n).prototype.has = n.prototype.contains = function (e) {
  19909. return !!this.set[e]
  19910. }, n.prototype.add = function (e) {
  19911. if (1 == arguments.length) this.set[e] = !0;
  19912. else
  19913. for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0
  19914. }, n.prototype.addAll = function (e) {
  19915. if ("object" != typeof e && !(e instanceof Array)) throw new Error("arr must be an array.");
  19916. for (var t = 0; t < e.length; t++) this.add(e[t])
  19917. }, n.prototype.delete = n.prototype.remove = function (e) {
  19918. if (1 == arguments.length) delete this.set[e];
  19919. else
  19920. for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]]
  19921. }, n.prototype.clear = function () {
  19922. this.set = {}
  19923. }, n.prototype.size = function () {
  19924. return Object.keys(this.set).length
  19925. }, n.prototype.toString = function () {
  19926. return "{" + Object.keys(this.set).toString() + "}"
  19927. }, n.prototype["*values"] = n.prototype.toArray = function () {
  19928. return void 0 === this.set ? [] : Object.keys(this.set)
  19929. }
  19930. }, {}],
  19931. 197: [function (e, t, i) {}, {}],
  19932. 198: [function (N, e, F) {
  19933. (function (e) {
  19934. "use strict";
  19935. function i() {
  19936. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  19937. }
  19938. function o(e, t) {
  19939. if (i() < t) throw new RangeError("Invalid typed array length");
  19940. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)), e.length = t), e
  19941. }
  19942. function u(e, t, i) {
  19943. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u)) return new u(e, t, i);
  19944. if ("number" != typeof e) return n(this, e, t, i);
  19945. if ("string" == typeof t) throw new Error("If encoding is specified then the first argument must be a string");
  19946. return a(this, e)
  19947. }
  19948. function n(e, t, i, n) {
  19949. if ("number" == typeof t) throw new TypeError('"value" argument must not be a number');
  19950. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function (e, t, i, n) {
  19951. if (t.byteLength, i < 0 || t.byteLength < i) throw new RangeError("'offset' is out of bounds");
  19952. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds");
  19953. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t, i) : new Uint8Array(t, i, n), u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t), e
  19954. }(e, t, i, n) : "string" == typeof t ? function (e, t, i) {
  19955. if ("string" == typeof i && "" !== i || (i = "utf8"), !u.isEncoding(i)) throw new TypeError('"encoding" must be a valid string encoding');
  19956. var n = 0 | c(t, i),
  19957. r = (e = o(e, n)).write(t, i);
  19958. return r !== n && (e = e.slice(0, r)), e
  19959. }(e, t, i) : function (e, t) {
  19960. if (u.isBuffer(t)) {
  19961. var i = 0 | l(t.length);
  19962. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i), e
  19963. }
  19964. if (t) {
  19965. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length" in t) return "number" != typeof t.length || function (e) {
  19966. return e != e
  19967. }(t.length) ? o(e, 0) : s(e, t);
  19968. if ("Buffer" === t.type && L(t.data)) return s(e, t.data)
  19969. }
  19970. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  19971. }(e, t)
  19972. }
  19973. function r(e) {
  19974. if ("number" != typeof e) throw new TypeError('"size" argument must be a number');
  19975. if (e < 0) throw new RangeError('"size" argument must not be negative')
  19976. }
  19977. function a(e, t) {
  19978. if (r(t), e = o(e, t < 0 ? 0 : 0 | l(t)), !u.TYPED_ARRAY_SUPPORT)
  19979. for (var i = 0; i < t; ++i) e[i] = 0;
  19980. return e
  19981. }
  19982. function s(e, t) {
  19983. var i = t.length < 0 ? 0 : 0 | l(t.length);
  19984. e = o(e, i);
  19985. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n];
  19986. return e
  19987. }
  19988. function l(e) {
  19989. if (e >= i()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  19990. return 0 | e
  19991. }
  19992. function c(e, t) {
  19993. if (u.isBuffer(e)) return e.length;
  19994. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength;
  19995. "string" != typeof e && (e = "" + e);
  19996. var i = e.length;
  19997. if (0 === i) return 0;
  19998. for (var n = !1;;) switch (t) {
  19999. case "ascii":
  20000. case "latin1":
  20001. case "binary":
  20002. return i;
  20003. case "utf8":
  20004. case "utf-8":
  20005. case void 0:
  20006. return S(e).length;
  20007. case "ucs2":
  20008. case "ucs-2":
  20009. case "utf16le":
  20010. case "utf-16le":
  20011. return 2 * i;
  20012. case "hex":
  20013. return i >>> 1;
  20014. case "base64":
  20015. return M(e).length;
  20016. default:
  20017. if (n) return S(e).length;
  20018. t = ("" + t).toLowerCase(), n = !0
  20019. }
  20020. }
  20021. function h(e, t, i) {
  20022. var n = e[t];
  20023. e[t] = e[i], e[i] = n
  20024. }
  20025. function d(e, t, i, n, r) {
  20026. if (0 === e.length) return -1;
  20027. if ("string" == typeof i ? (n = i, i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648), i = +i, isNaN(i) && (i = r ? 0 : e.length - 1), i < 0 && (i = e.length + i), i >= e.length) {
  20028. if (r) return -1;
  20029. i = e.length - 1
  20030. } else if (i < 0) {
  20031. if (!r) return -1;
  20032. i = 0
  20033. }
  20034. if ("string" == typeof t && (t = u.from(t, n)), u.isBuffer(t)) return 0 === t.length ? -1 : p(e, t, i, n, r);
  20035. if ("number" == typeof t) return t &= 255, u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  20036. throw new TypeError("val must be string, number or Buffer")
  20037. }
  20038. function p(e, t, i, n, r) {
  20039. function o(e, t) {
  20040. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  20041. }
  20042. var a, s = 1,
  20043. l = e.length,
  20044. c = t.length;
  20045. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  20046. if (e.length < 2 || t.length < 2) return -1;
  20047. l /= s = 2, c /= 2, i /= 2
  20048. }
  20049. if (r) {
  20050. var h = -1;
  20051. for (a = i; a < l; a++)
  20052. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  20053. if (-1 === h && (h = a), a - h + 1 === c) return h * s
  20054. } else -1 !== h && (a -= a - h), h = -1
  20055. } else
  20056. for (l < i + c && (i = l - c), a = i; 0 <= a; a--) {
  20057. for (var u = !0, d = 0; d < c; d++)
  20058. if (o(e, a + d) !== o(t, d)) {
  20059. u = !1;
  20060. break
  20061. } if (u) return a
  20062. }
  20063. return -1
  20064. }
  20065. function g(e, t, i, n) {
  20066. i = Number(i) || 0;
  20067. var r = e.length - i;
  20068. n ? r < (n = Number(n)) && (n = r) : n = r;
  20069. var o = t.length;
  20070. if (o % 2 != 0) throw new TypeError("Invalid hex string");
  20071. o / 2 < n && (n = o / 2);
  20072. for (var a = 0; a < n; ++a) {
  20073. var s = parseInt(t.substr(2 * a, 2), 16);
  20074. if (isNaN(s)) return a;
  20075. e[i + a] = s
  20076. }
  20077. return a
  20078. }
  20079. function m(e, t, i, n) {
  20080. return R(function (e) {
  20081. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i));
  20082. return t
  20083. }(t), e, i, n)
  20084. }
  20085. function f(e, t, i) {
  20086. i = Math.min(e.length, i);
  20087. for (var n = [], r = t; r < i;) {
  20088. var o, a, s, l, c = e[r],
  20089. h = null,
  20090. u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  20091. if (r + u <= i) switch (u) {
  20092. case 1:
  20093. c < 128 && (h = c);
  20094. break;
  20095. case 2:
  20096. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  20097. break;
  20098. case 3:
  20099. o = e[r + 1], a = e[r + 2], 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  20100. break;
  20101. case 4:
  20102. o = e[r + 1], a = e[r + 2], s = e[r + 3], 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  20103. }
  20104. null === h ? (h = 65533, u = 1) : 65535 < h && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), n.push(h), r += u
  20105. }
  20106. return function (e) {
  20107. var t = e.length;
  20108. if (t <= D) return String.fromCharCode.apply(String, e);
  20109. for (var i = "", n = 0; n < t;) i += String.fromCharCode.apply(String, e.slice(n, n += D));
  20110. return i
  20111. }(n)
  20112. }
  20113. function v(e, t, i) {
  20114. var n = "";
  20115. i = Math.min(e.length, i);
  20116. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r]);
  20117. return n
  20118. }
  20119. function y(e, t, i) {
  20120. var n = "";
  20121. i = Math.min(e.length, i);
  20122. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r]);
  20123. return n
  20124. }
  20125. function A(e, t, i) {
  20126. var n, r = e.length;
  20127. (!t || t < 0) && (t = 0), (!i || i < 0 || r < i) && (i = r);
  20128. for (var o = "", a = t; a < i; ++a) o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  20129. return o
  20130. }
  20131. function C(e, t, i) {
  20132. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  20133. return r
  20134. }
  20135. function I(e, t, i) {
  20136. if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
  20137. if (i < e + t) throw new RangeError("Trying to access beyond buffer length")
  20138. }
  20139. function E(e, t, i, n, r, o) {
  20140. if (!u.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
  20141. if (r < t || t < o) throw new RangeError('"value" argument is out of bounds');
  20142. if (i + n > e.length) throw new RangeError("Index out of range")
  20143. }
  20144. function _(e, t, i, n) {
  20145. t < 0 && (t = 65535 + t + 1);
  20146. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r) e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  20147. }
  20148. function b(e, t, i, n) {
  20149. t < 0 && (t = 4294967295 + t + 1);
  20150. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r) e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  20151. }
  20152. function w(e, t, i, n) {
  20153. if (i + n > e.length) throw new RangeError("Index out of range");
  20154. if (i < 0) throw new RangeError("Index out of range")
  20155. }
  20156. function T(e, t, i, n, r) {
  20157. return r || w(e, 0, i, 4), O.write(e, t, i, n, 23, 4), i + 4
  20158. }
  20159. function x(e, t, i, n, r) {
  20160. return r || w(e, 0, i, 8), O.write(e, t, i, n, 52, 8), i + 8
  20161. }
  20162. function S(e, t) {
  20163. t = t || 1 / 0;
  20164. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  20165. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  20166. if (!r) {
  20167. if (56319 < i) {
  20168. -1 < (t -= 3) && o.push(239, 191, 189);
  20169. continue
  20170. }
  20171. if (a + 1 === n) {
  20172. -1 < (t -= 3) && o.push(239, 191, 189);
  20173. continue
  20174. }
  20175. r = i;
  20176. continue
  20177. }
  20178. if (i < 56320) {
  20179. -1 < (t -= 3) && o.push(239, 191, 189), r = i;
  20180. continue
  20181. }
  20182. i = 65536 + (r - 55296 << 10 | i - 56320)
  20183. } else r && -1 < (t -= 3) && o.push(239, 191, 189);
  20184. if (r = null, i < 128) {
  20185. if ((t -= 1) < 0) break;
  20186. o.push(i)
  20187. } else if (i < 2048) {
  20188. if ((t -= 2) < 0) break;
  20189. o.push(i >> 6 | 192, 63 & i | 128)
  20190. } else if (i < 65536) {
  20191. if ((t -= 3) < 0) break;
  20192. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  20193. } else {
  20194. if (!(i < 1114112)) throw new Error("Invalid code point");
  20195. if ((t -= 4) < 0) break;
  20196. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  20197. }
  20198. }
  20199. return o
  20200. }
  20201. function M(e) {
  20202. return P.toByteArray(function (e) {
  20203. if ((e = function (e) {
  20204. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  20205. }(e).replace(t, "")).length < 2) return "";
  20206. for (; e.length % 4 != 0;) e += "=";
  20207. return e
  20208. }(e))
  20209. }
  20210. function R(e, t, i, n) {
  20211. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r];
  20212. return r
  20213. }
  20214. var P = N("base64-js"),
  20215. O = N("ieee754"),
  20216. L = N("isarray");
  20217. F.Buffer = u, F.SlowBuffer = function (e) {
  20218. return +e != e && (e = 0), u.alloc(+e)
  20219. }, F.INSPECT_MAX_BYTES = 50, u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function () {
  20220. try {
  20221. var e = new Uint8Array(1);
  20222. return e.__proto__ = {
  20223. __proto__: Uint8Array.prototype,
  20224. foo: function () {
  20225. return 42
  20226. }
  20227. }, 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  20228. } catch (e) {
  20229. return !1
  20230. }
  20231. }(), F.kMaxLength = i(), u.poolSize = 8192, u._augment = function (e) {
  20232. return e.__proto__ = u.prototype, e
  20233. }, u.from = function (e, t, i) {
  20234. return n(null, e, t, i)
  20235. }, u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype, u.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  20236. value: null,
  20237. configurable: !0
  20238. })), u.alloc = function (e, t, i) {
  20239. return function (e, t, i, n) {
  20240. return r(t), 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)
  20241. }(null, e, t, i)
  20242. }, u.allocUnsafe = function (e) {
  20243. return a(null, e)
  20244. }, u.allocUnsafeSlow = function (e) {
  20245. return a(null, e)
  20246. }, u.isBuffer = function (e) {
  20247. return !(null == e || !e._isBuffer)
  20248. }, u.compare = function (e, t) {
  20249. if (!u.isBuffer(e) || !u.isBuffer(t)) throw new TypeError("Arguments must be Buffers");
  20250. if (e === t) return 0;
  20251. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  20252. if (e[r] !== t[r]) {
  20253. i = e[r], n = t[r];
  20254. break
  20255. } return i < n ? -1 : n < i ? 1 : 0
  20256. }, u.isEncoding = function (e) {
  20257. switch (String(e).toLowerCase()) {
  20258. case "hex":
  20259. case "utf8":
  20260. case "utf-8":
  20261. case "ascii":
  20262. case "latin1":
  20263. case "binary":
  20264. case "base64":
  20265. case "ucs2":
  20266. case "ucs-2":
  20267. case "utf16le":
  20268. case "utf-16le":
  20269. return !0;
  20270. default:
  20271. return !1
  20272. }
  20273. }, u.concat = function (e, t) {
  20274. if (!L(e)) throw new TypeError('"list" argument must be an Array of Buffers');
  20275. if (0 === e.length) return u.alloc(0);
  20276. var i;
  20277. if (void 0 === t)
  20278. for (i = t = 0; i < e.length; ++i) t += e[i].length;
  20279. var n = u.allocUnsafe(t),
  20280. r = 0;
  20281. for (i = 0; i < e.length; ++i) {
  20282. var o = e[i];
  20283. if (!u.isBuffer(o)) throw new TypeError('"list" argument must be an Array of Buffers');
  20284. o.copy(n, r), r += o.length
  20285. }
  20286. return n
  20287. }, u.byteLength = c, u.prototype._isBuffer = !0, u.prototype.swap16 = function () {
  20288. var e = this.length;
  20289. if (e % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
  20290. for (var t = 0; t < e; t += 2) h(this, t, t + 1);
  20291. return this
  20292. }, u.prototype.swap32 = function () {
  20293. var e = this.length;
  20294. if (e % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
  20295. for (var t = 0; t < e; t += 4) h(this, t, t + 3), h(this, t + 1, t + 2);
  20296. return this
  20297. }, u.prototype.swap64 = function () {
  20298. var e = this.length;
  20299. if (e % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
  20300. for (var t = 0; t < e; t += 8) h(this, t, t + 7), h(this, t + 1, t + 6), h(this, t + 2, t + 5), h(this, t + 3, t + 4);
  20301. return this
  20302. }, u.prototype.toString = function () {
  20303. var e = 0 | this.length;
  20304. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function (e, t, i) {
  20305. var n, r, o, a = !1;
  20306. if ((void 0 === t || t < 0) && (t = 0), t > this.length) return "";
  20307. if ((void 0 === i || i > this.length) && (i = this.length), i <= 0) return "";
  20308. if ((i >>>= 0) <= (t >>>= 0)) return "";
  20309. for (e = e || "utf8";;) switch (e) {
  20310. case "hex":
  20311. return A(this, t, i);
  20312. case "utf8":
  20313. case "utf-8":
  20314. return f(this, t, i);
  20315. case "ascii":
  20316. return v(this, t, i);
  20317. case "latin1":
  20318. case "binary":
  20319. return y(this, t, i);
  20320. case "base64":
  20321. return n = this, o = i, 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  20322. case "ucs2":
  20323. case "ucs-2":
  20324. case "utf16le":
  20325. case "utf-16le":
  20326. return C(this, t, i);
  20327. default:
  20328. if (a) throw new TypeError("Unknown encoding: " + e);
  20329. e = (e + "").toLowerCase(), a = !0
  20330. }
  20331. }.apply(this, arguments)
  20332. }, u.prototype.equals = function (e) {
  20333. if (!u.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
  20334. return this === e || 0 === u.compare(this, e)
  20335. }, u.prototype.inspect = function () {
  20336. var e = "",
  20337. t = F.INSPECT_MAX_BYTES;
  20338. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "), this.length > t && (e += " ... ")), "<Buffer " + e + ">"
  20339. }, u.prototype.compare = function (e, t, i, n, r) {
  20340. if (!u.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
  20341. if (void 0 === t && (t = 0), void 0 === i && (i = e ? e.length : 0), void 0 === n && (n = 0), void 0 === r && (r = this.length), t < 0 || i > e.length || n < 0 || r > this.length) throw new RangeError("out of range index");
  20342. if (r <= n && i <= t) return 0;
  20343. if (r <= n) return -1;
  20344. if (i <= t) return 1;
  20345. if (this === e) return 0;
  20346. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  20347. if (l[h] !== c[h]) {
  20348. o = l[h], a = c[h];
  20349. break
  20350. } return o < a ? -1 : a < o ? 1 : 0
  20351. }, u.prototype.includes = function (e, t, i) {
  20352. return -1 !== this.indexOf(e, t, i)
  20353. }, u.prototype.indexOf = function (e, t, i) {
  20354. return d(this, e, t, i, !0)
  20355. }, u.prototype.lastIndexOf = function (e, t, i) {
  20356. return d(this, e, t, i, !1)
  20357. }, u.prototype.write = function (e, t, i, n) {
  20358. if (void 0 === t) n = "utf8", i = this.length, t = 0;
  20359. else if (void 0 === i && "string" == typeof t) n = t, i = this.length, t = 0;
  20360. else {
  20361. if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  20362. t |= 0, isFinite(i) ? (i |= 0, void 0 === n && (n = "utf8")) : (n = i, i = void 0)
  20363. }
  20364. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  20365. if ((void 0 === i || p < i) && (i = p), 0 < e.length && (i < 0 || t < 0) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
  20366. n = n || "utf8";
  20367. for (var f = !1;;) switch (n) {
  20368. case "hex":
  20369. return g(this, e, t, i);
  20370. case "utf8":
  20371. case "utf-8":
  20372. return u = t, d = i, R(S(e, (h = this).length - u), h, u, d);
  20373. case "ascii":
  20374. return m(this, e, t, i);
  20375. case "latin1":
  20376. case "binary":
  20377. return m(this, e, t, i);
  20378. case "base64":
  20379. return s = this, l = t, c = i, R(M(e), s, l, c);
  20380. case "ucs2":
  20381. case "ucs-2":
  20382. case "utf16le":
  20383. case "utf-16le":
  20384. return o = t, a = i, R(function (e, t) {
  20385. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a) i = e.charCodeAt(a), n = i >> 8, r = i % 256, o.push(r), o.push(n);
  20386. return o
  20387. }(e, (r = this).length - o), r, o, a);
  20388. default:
  20389. if (f) throw new TypeError("Unknown encoding: " + n);
  20390. n = ("" + n).toLowerCase(), f = !0
  20391. }
  20392. }, u.prototype.toJSON = function () {
  20393. return {
  20394. type: "Buffer",
  20395. data: Array.prototype.slice.call(this._arr || this, 0)
  20396. }
  20397. };
  20398. var D = 4096;
  20399. u.prototype.slice = function (e, t) {
  20400. var i, n = this.length;
  20401. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n), (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n), t < e && (t = e), u.TYPED_ARRAY_SUPPORT)(i = this.subarray(e, t)).__proto__ = u.prototype;
  20402. else {
  20403. var r = t - e;
  20404. i = new u(r, void 0);
  20405. for (var o = 0; o < r; ++o) i[o] = this[o + e]
  20406. }
  20407. return i
  20408. }, u.prototype.readUIntLE = function (e, t, i) {
  20409. e |= 0, t |= 0, i || I(e, t, this.length);
  20410. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256);) n += this[e + o] * r;
  20411. return n
  20412. }, u.prototype.readUIntBE = function (e, t, i) {
  20413. e |= 0, t |= 0, i || I(e, t, this.length);
  20414. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256);) n += this[e + --t] * r;
  20415. return n
  20416. }, u.prototype.readUInt8 = function (e, t) {
  20417. return t || I(e, 1, this.length), this[e]
  20418. }, u.prototype.readUInt16LE = function (e, t) {
  20419. return t || I(e, 2, this.length), this[e] | this[e + 1] << 8
  20420. }, u.prototype.readUInt16BE = function (e, t) {
  20421. return t || I(e, 2, this.length), this[e] << 8 | this[e + 1]
  20422. }, u.prototype.readUInt32LE = function (e, t) {
  20423. return t || I(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  20424. }, u.prototype.readUInt32BE = function (e, t) {
  20425. return t || I(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  20426. }, u.prototype.readIntLE = function (e, t, i) {
  20427. e |= 0, t |= 0, i || I(e, t, this.length);
  20428. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256);) n += this[e + o] * r;
  20429. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)), n
  20430. }, u.prototype.readIntBE = function (e, t, i) {
  20431. e |= 0, t |= 0, i || I(e, t, this.length);
  20432. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256);) o += this[e + --n] * r;
  20433. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)), o
  20434. }, u.prototype.readInt8 = function (e, t) {
  20435. return t || I(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  20436. }, u.prototype.readInt16LE = function (e, t) {
  20437. t || I(e, 2, this.length);
  20438. var i = this[e] | this[e + 1] << 8;
  20439. return 32768 & i ? 4294901760 | i : i
  20440. }, u.prototype.readInt16BE = function (e, t) {
  20441. t || I(e, 2, this.length);
  20442. var i = this[e + 1] | this[e] << 8;
  20443. return 32768 & i ? 4294901760 | i : i
  20444. }, u.prototype.readInt32LE = function (e, t) {
  20445. return t || I(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  20446. }, u.prototype.readInt32BE = function (e, t) {
  20447. return t || I(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  20448. }, u.prototype.readFloatLE = function (e, t) {
  20449. return t || I(e, 4, this.length), O.read(this, e, !0, 23, 4)
  20450. }, u.prototype.readFloatBE = function (e, t) {
  20451. return t || I(e, 4, this.length), O.read(this, e, !1, 23, 4)
  20452. }, u.prototype.readDoubleLE = function (e, t) {
  20453. return t || I(e, 8, this.length), O.read(this, e, !0, 52, 8)
  20454. }, u.prototype.readDoubleBE = function (e, t) {
  20455. return t || I(e, 8, this.length), O.read(this, e, !1, 52, 8)
  20456. }, u.prototype.writeUIntLE = function (e, t, i, n) {
  20457. e = +e, t |= 0, i |= 0, n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  20458. var r = 1,
  20459. o = 0;
  20460. for (this[t] = 255 & e; ++o < i && (r *= 256);) this[t + o] = e / r & 255;
  20461. return t + i
  20462. }, u.prototype.writeUIntBE = function (e, t, i, n) {
  20463. e = +e, t |= 0, i |= 0, n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  20464. var r = i - 1,
  20465. o = 1;
  20466. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256);) this[t + r] = e / o & 255;
  20467. return t + i
  20468. }, u.prototype.writeUInt8 = function (e, t, i) {
  20469. return e = +e, t |= 0, i || E(this, e, t, 1, 255, 0), u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[t] = 255 & e, t + 1
  20470. }, u.prototype.writeUInt16LE = function (e, t, i) {
  20471. return e = +e, t |= 0, i || E(this, e, t, 2, 65535, 0), u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : _(this, e, t, !0), t + 2
  20472. }, u.prototype.writeUInt16BE = function (e, t, i) {
  20473. return e = +e, t |= 0, i || E(this, e, t, 2, 65535, 0), u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : _(this, e, t, !1), t + 2
  20474. }, u.prototype.writeUInt32LE = function (e, t, i) {
  20475. return e = +e, t |= 0, i || E(this, e, t, 4, 4294967295, 0), u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e) : b(this, e, t, !0), t + 4
  20476. }, u.prototype.writeUInt32BE = function (e, t, i) {
  20477. return e = +e, t |= 0, i || E(this, e, t, 4, 4294967295, 0), u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : b(this, e, t, !1), t + 4
  20478. }, u.prototype.writeIntLE = function (e, t, i, n) {
  20479. if (e = +e, t |= 0, !n) {
  20480. var r = Math.pow(2, 8 * i - 1);
  20481. E(this, e, t, i, r - 1, -r)
  20482. }
  20483. var o = 0,
  20484. a = 1,
  20485. s = 0;
  20486. for (this[t] = 255 & e; ++o < i && (a *= 256);) e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1), this[t + o] = (e / a >> 0) - s & 255;
  20487. return t + i
  20488. }, u.prototype.writeIntBE = function (e, t, i, n) {
  20489. if (e = +e, t |= 0, !n) {
  20490. var r = Math.pow(2, 8 * i - 1);
  20491. E(this, e, t, i, r - 1, -r)
  20492. }
  20493. var o = i - 1,
  20494. a = 1,
  20495. s = 0;
  20496. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256);) e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1), this[t + o] = (e / a >> 0) - s & 255;
  20497. return t + i
  20498. }, u.prototype.writeInt8 = function (e, t, i) {
  20499. return e = +e, t |= 0, i || E(this, e, t, 1, 127, -128), u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1
  20500. }, u.prototype.writeInt16LE = function (e, t, i) {
  20501. return e = +e, t |= 0, i || E(this, e, t, 2, 32767, -32768), u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : _(this, e, t, !0), t + 2
  20502. }, u.prototype.writeInt16BE = function (e, t, i) {
  20503. return e = +e, t |= 0, i || E(this, e, t, 2, 32767, -32768), u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : _(this, e, t, !1), t + 2
  20504. }, u.prototype.writeInt32LE = function (e, t, i) {
  20505. return e = +e, t |= 0, i || E(this, e, t, 4, 2147483647, -2147483648), u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24) : b(this, e, t, !0), t + 4
  20506. }, u.prototype.writeInt32BE = function (e, t, i) {
  20507. return e = +e, t |= 0, i || E(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : b(this, e, t, !1), t + 4
  20508. }, u.prototype.writeFloatLE = function (e, t, i) {
  20509. return T(this, e, t, !0, i)
  20510. }, u.prototype.writeFloatBE = function (e, t, i) {
  20511. return T(this, e, t, !1, i)
  20512. }, u.prototype.writeDoubleLE = function (e, t, i) {
  20513. return x(this, e, t, !0, i)
  20514. }, u.prototype.writeDoubleBE = function (e, t, i) {
  20515. return x(this, e, t, !1, i)
  20516. }, u.prototype.copy = function (e, t, i, n) {
  20517. if (i = i || 0, n || 0 === n || (n = this.length), t >= e.length && (t = e.length), t = t || 0, 0 < n && n < i && (n = i), n === i) return 0;
  20518. if (0 === e.length || 0 === this.length) return 0;
  20519. if (t < 0) throw new RangeError("targetStart out of bounds");
  20520. if (i < 0 || i >= this.length) throw new RangeError("sourceStart out of bounds");
  20521. if (n < 0) throw new RangeError("sourceEnd out of bounds");
  20522. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i);
  20523. var r, o = n - i;
  20524. if (this === e && i < t && t < n)
  20525. for (r = o - 1; 0 <= r; --r) e[r + t] = this[r + i];
  20526. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  20527. for (r = 0; r < o; ++r) e[r + t] = this[r + i];
  20528. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  20529. return o
  20530. }, u.prototype.fill = function (e, t, i, n) {
  20531. if ("string" == typeof e) {
  20532. if ("string" == typeof t ? (n = t, t = 0, i = this.length) : "string" == typeof i && (n = i, i = this.length), 1 === e.length) {
  20533. var r = e.charCodeAt(0);
  20534. r < 256 && (e = r)
  20535. }
  20536. if (void 0 !== n && "string" != typeof n) throw new TypeError("encoding must be a string");
  20537. if ("string" == typeof n && !u.isEncoding(n)) throw new TypeError("Unknown encoding: " + n)
  20538. } else "number" == typeof e && (e &= 255);
  20539. if (t < 0 || this.length < t || this.length < i) throw new RangeError("Out of range index");
  20540. if (i <= t) return this;
  20541. var o;
  20542. if (t >>>= 0, i = void 0 === i ? this.length : i >>> 0, "number" == typeof (e = e || 0))
  20543. for (o = t; o < i; ++o) this[o] = e;
  20544. else {
  20545. var a = u.isBuffer(e) ? e : S(new u(e, n).toString()),
  20546. s = a.length;
  20547. for (o = 0; o < i - t; ++o) this[o + t] = a[o % s]
  20548. }
  20549. return this
  20550. };
  20551. var t = /[^+\/0-9A-Za-z-_]/g
  20552. }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  20553. }, {
  20554. "base64-js": 199,
  20555. ieee754: 200,
  20556. isarray: 201
  20557. }],
  20558. 199: [function (e, t, i) {
  20559. "use strict";
  20560. function l(e) {
  20561. var t = e.length;
  20562. if (0 < t % 4) throw new Error("Invalid string. Length must be a multiple of 4");
  20563. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  20564. }
  20565. function c(e, t, i) {
  20566. for (var n, r = [], o = t; o < i; o += 3) n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2], r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  20567. var a;
  20568. return r.join("")
  20569. }
  20570. i.byteLength = function (e) {
  20571. return 3 * e.length / 4 - l(e)
  20572. }, i.toByteArray = function (e) {
  20573. var t, i, n, r, o, a = e.length;
  20574. r = l(e), o = new d(3 * a / 4 - r), i = 0 < r ? a - 4 : a;
  20575. var s = 0;
  20576. for (t = 0; t < i; t += 4, 3) n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)], o[s++] = n >> 16 & 255, o[s++] = n >> 8 & 255, o[s++] = 255 & n;
  20577. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4, o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2, o[s++] = n >> 8 & 255, o[s++] = 255 & n), o
  20578. }, i.fromByteArray = function (e) {
  20579. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383) o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  20580. return 1 == n ? (t = e[i - 1], r += h[t >> 2], r += h[t << 4 & 63], r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1], r += h[t >> 10], r += h[t >> 4 & 63], r += h[t << 2 & 63], r += "="), o.push(r), o.join("")
  20581. };
  20582. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r) h[r] = n[r], u[n.charCodeAt(r)] = r;
  20583. u["-".charCodeAt(0)] = 62, u["_".charCodeAt(0)] = 63
  20584. }, {}],
  20585. 200: [function (e, t, i) {
  20586. i.read = function (e, t, i, n, r) {
  20587. var o, a, s = 8 * r - n - 1,
  20588. l = (1 << s) - 1,
  20589. c = l >> 1,
  20590. h = -7,
  20591. u = i ? r - 1 : 0,
  20592. d = i ? -1 : 1,
  20593. p = e[t + u];
  20594. for (u += d, o = p & (1 << -h) - 1, p >>= -h, h += s; 0 < h; o = 256 * o + e[t + u], u += d, h -= 8);
  20595. for (a = o & (1 << -h) - 1, o >>= -h, h += n; 0 < h; a = 256 * a + e[t + u], u += d, h -= 8);
  20596. if (0 === o) o = 1 - c;
  20597. else {
  20598. if (o === l) return a ? NaN : 1 / 0 * (p ? -1 : 1);
  20599. a += Math.pow(2, n), o -= c
  20600. }
  20601. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  20602. }, i.write = function (e, t, i, n, r, o) {
  20603. var a, s, l, c = 8 * o - r - 1,
  20604. h = (1 << c) - 1,
  20605. u = h >> 1,
  20606. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  20607. p = n ? 0 : o - 1,
  20608. f = n ? 1 : -1,
  20609. g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  20610. for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0, a = h) : (a = Math.floor(Math.log(t) / Math.LN2), t * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++, l /= 2), h <= a + u ? (s = 0, a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r), a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r), a = 0)); 8 <= r; e[i + p] = 255 & s, p += f, s /= 256, r -= 8);
  20611. for (a = a << r | s, c += r; 0 < c; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  20612. e[i + p - f] |= 128 * g
  20613. }
  20614. }, {}],
  20615. 201: [function (e, t, i) {
  20616. var n = {}.toString;
  20617. t.exports = Array.isArray || function (e) {
  20618. return "[object Array]" == n.call(e)
  20619. }
  20620. }, {}],
  20621. 202: [function (e, t, i) {
  20622. function n() {
  20623. this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0
  20624. }
  20625. function l(e) {
  20626. return "function" == typeof e
  20627. }
  20628. function c(e) {
  20629. return "object" == typeof e && null !== e
  20630. }
  20631. function h(e) {
  20632. return void 0 === e
  20633. }((t.exports = n).EventEmitter = n).prototype._events = void 0, n.prototype._maxListeners = void 0, n.defaultMaxListeners = 10, n.prototype.setMaxListeners = function (e) {
  20634. if (! function (e) {
  20635. return "number" == typeof e
  20636. }(e) || e < 0 || isNaN(e)) throw TypeError("n must be a positive number");
  20637. return this._maxListeners = e, this
  20638. }, n.prototype.emit = function (e) {
  20639. var t, i, n, r, o, a;
  20640. if (this._events || (this._events = {}), "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  20641. if ((t = arguments[1]) instanceof Error) throw t;
  20642. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  20643. throw s.context = t, s
  20644. }
  20645. if (h(i = this._events[e])) return !1;
  20646. if (l(i)) switch (arguments.length) {
  20647. case 1:
  20648. i.call(this);
  20649. break;
  20650. case 2:
  20651. i.call(this, arguments[1]);
  20652. break;
  20653. case 3:
  20654. i.call(this, arguments[1], arguments[2]);
  20655. break;
  20656. default:
  20657. r = Array.prototype.slice.call(arguments, 1), i.apply(this, r)
  20658. } else if (c(i))
  20659. for (r = Array.prototype.slice.call(arguments, 1), n = (a = i.slice()).length, o = 0; o < n; o++) a[o].apply(this, r);
  20660. return !0
  20661. }, n.prototype.on = n.prototype.addListener = function (e, t) {
  20662. var i;
  20663. if (!l(t)) throw TypeError("listener must be a function");
  20664. return this._events || (this._events = {}), this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t), this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t, c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0, console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length), "function" == typeof console.trace && console.trace())), this
  20665. }, n.prototype.once = function (e, t) {
  20666. function i() {
  20667. this.removeListener(e, i), n || (n = !0, t.apply(this, arguments))
  20668. }
  20669. if (!l(t)) throw TypeError("listener must be a function");
  20670. var n = !1;
  20671. return i.listener = t, this.on(e, i), this
  20672. }, n.prototype.removeListener = function (e, t) {
  20673. var i, n, r, o;
  20674. if (!l(t)) throw TypeError("listener must be a function");
  20675. if (!this._events || !this._events[e]) return this;
  20676. if (r = (i = this._events[e]).length, n = -1, i === t || l(i.listener) && i.listener === t) delete this._events[e], this._events.removeListener && this.emit("removeListener", e, t);
  20677. else if (c(i)) {
  20678. for (o = r; 0 < o--;)
  20679. if (i[o] === t || i[o].listener && i[o].listener === t) {
  20680. n = o;
  20681. break
  20682. } if (n < 0) return this;
  20683. 1 === i.length ? (i.length = 0, delete this._events[e]) : i.splice(n, 1), this._events.removeListener && this.emit("removeListener", e, t)
  20684. }
  20685. return this
  20686. }, n.prototype.removeAllListeners = function (e) {
  20687. var t, i;
  20688. if (!this._events) return this;
  20689. if (!this._events.removeListener) return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e], this;
  20690. if (0 === arguments.length) {
  20691. for (t in this._events) "removeListener" !== t && this.removeAllListeners(t);
  20692. return this.removeAllListeners("removeListener"), this._events = {}, this
  20693. }
  20694. if (l(i = this._events[e])) this.removeListener(e, i);
  20695. else if (i)
  20696. for (; i.length;) this.removeListener(e, i[i.length - 1]);
  20697. return delete this._events[e], this
  20698. }, n.prototype.listeners = function (e) {
  20699. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  20700. }, n.prototype.listenerCount = function (e) {
  20701. if (this._events) {
  20702. var t = this._events[e];
  20703. if (l(t)) return 1;
  20704. if (t) return t.length
  20705. }
  20706. return 0
  20707. }, n.listenerCount = function (e, t) {
  20708. return e.listenerCount(t)
  20709. }
  20710. }, {}],
  20711. 203: [function (e, t, i) {
  20712. function n() {
  20713. throw new Error("setTimeout has not been defined")
  20714. }
  20715. function r() {
  20716. throw new Error("clearTimeout has not been defined")
  20717. }
  20718. function o(t) {
  20719. if (h === setTimeout) return setTimeout(t, 0);
  20720. if ((h === n || !h) && setTimeout) return h = setTimeout, setTimeout(t, 0);
  20721. try {
  20722. return h(t, 0)
  20723. } catch (e) {
  20724. try {
  20725. return h.call(null, t, 0)
  20726. } catch (e) {
  20727. return h.call(this, t, 0)
  20728. }
  20729. }
  20730. }
  20731. function a() {
  20732. g && p && (g = !1, p.length ? f = p.concat(f) : m = -1, f.length && s())
  20733. }
  20734. function s() {
  20735. if (!g) {
  20736. var e = o(a);
  20737. g = !0;
  20738. for (var t = f.length; t;) {
  20739. for (p = f, f = []; ++m < t;) p && p[m].run();
  20740. m = -1, t = f.length
  20741. }
  20742. p = null, g = !1,
  20743. function (t) {
  20744. if (u === clearTimeout) return clearTimeout(t);
  20745. if ((u === r || !u) && clearTimeout) return u = clearTimeout, clearTimeout(t);
  20746. try {
  20747. u(t)
  20748. } catch (e) {
  20749. try {
  20750. return u.call(null, t)
  20751. } catch (e) {
  20752. return u.call(this, t)
  20753. }
  20754. }
  20755. }(e)
  20756. }
  20757. }
  20758. function l(e, t) {
  20759. this.fun = e, this.array = t
  20760. }
  20761. function c() {}
  20762. var h, u, d = t.exports = {};
  20763. ! function () {
  20764. try {
  20765. h = "function" == typeof setTimeout ? setTimeout : n
  20766. } catch (e) {
  20767. h = n
  20768. }
  20769. try {
  20770. u = "function" == typeof clearTimeout ? clearTimeout : r
  20771. } catch (e) {
  20772. u = r
  20773. }
  20774. }();
  20775. var p, f = [],
  20776. g = !1,
  20777. m = -1;
  20778. d.nextTick = function (e) {
  20779. var t = new Array(arguments.length - 1);
  20780. if (1 < arguments.length)
  20781. for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
  20782. f.push(new l(e, t)), 1 !== f.length || g || o(s)
  20783. }, l.prototype.run = function () {
  20784. this.fun.apply(null, this.array)
  20785. }, d.title = "browser", d.browser = !0, d.env = {}, d.argv = [], d.version = "", d.versions = {}, d.on = c, d.addListener = c, d.once = c, d.off = c, d.removeListener = c, d.removeAllListeners = c, d.emit = c, d.binding = function (e) {
  20786. throw new Error("process.binding is not supported")
  20787. }, d.cwd = function () {
  20788. return "/"
  20789. }, d.chdir = function (e) {
  20790. throw new Error("process.chdir is not supported")
  20791. }, d.umask = function () {
  20792. return 0
  20793. }
  20794. }, {}],
  20795. 204: [function (e, O, L) {
  20796. (function (P) {
  20797. ! function (e) {
  20798. function v(e) {
  20799. throw new RangeError(g[e])
  20800. }
  20801. function r(e, t) {
  20802. for (var i = e.length, n = []; i--;) n[i] = t(e[i]);
  20803. return n
  20804. }
  20805. function t(e, t) {
  20806. var i = e.split("@"),
  20807. n = "";
  20808. return 1 < i.length && (n = i[0] + "@", e = i[1]), n + r((e = e.replace(f, ".")).split("."), t).join(".")
  20809. }
  20810. function y(e) {
  20811. for (var t, i, n = [], r = 0, o = e.length; r < o;) 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t), r--) : n.push(t);
  20812. return n
  20813. }
  20814. function A(e) {
  20815. return r(e, function (e) {
  20816. var t = "";
  20817. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t + R(e)
  20818. }).join("")
  20819. }
  20820. function C(e, t) {
  20821. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  20822. }
  20823. function I(e, t, i) {
  20824. var n = 0;
  20825. for (e = i ? M(e / u) : e >> 1, e += M(e / t); m * w >> 1 < e; n += _) e = M(e / m);
  20826. return M(n + (m + 1) * e / (e + h))
  20827. }
  20828. function i(e) {
  20829. var t, i, n, r, o, a, s, l, c, h, u, d = [],
  20830. p = e.length,
  20831. f = 0,
  20832. g = x,
  20833. m = T;
  20834. for ((i = e.lastIndexOf(S)) < 0 && (i = 0), n = 0; n < i; ++n) 128 <= e.charCodeAt(n) && v("not-basic"), d.push(e.charCodeAt(n));
  20835. for (r = 0 < i ? i + 1 : 0; r < p;) {
  20836. for (o = f, a = 1, s = _; p <= r && v("invalid-input"), u = e.charCodeAt(r++), (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"), f += l * a, !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _) a > M(E / (h = _ - c)) && v("overflow"), a *= h;
  20837. m = I(f - o, t = d.length + 1, 0 == o), M(f / t) > E - g && v("overflow"), g += M(f / t), f %= t, d.splice(f++, 0, g)
  20838. }
  20839. return A(d)
  20840. }
  20841. function n(e) {
  20842. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  20843. for (d = (e = y(e)).length, t = x, o = T, a = i = 0; a < d; ++a)(u = e[a]) < 128 && m.push(R(u));
  20844. for (n = r = m.length, r && m.push(S); n < d;) {
  20845. for (s = E, a = 0; a < d; ++a) t <= (u = e[a]) && u < s && (s = u);
  20846. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"), i += (s - t) * p, t = s, a = 0; a < d; ++a)
  20847. if ((u = e[a]) < t && ++i > E && v("overflow"), u == t) {
  20848. for (l = i, c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _) g = l - h, f = _ - h, m.push(R(C(h + g % f, 0))), l = M(g / f);
  20849. m.push(R(C(l, 0))), o = I(i, p, n == r), i = 0, ++n
  20850. }++ i, ++t
  20851. }
  20852. return m.join("")
  20853. }
  20854. var o = "object" == typeof L && L && !L.nodeType && L,
  20855. a = "object" == typeof O && O && !O.nodeType && O,
  20856. s = "object" == typeof P && P;
  20857. s.global !== s && s.window !== s && s.self !== s || (e = s);
  20858. var l, c, E = 2147483647,
  20859. _ = 36,
  20860. b = 1,
  20861. w = 26,
  20862. h = 38,
  20863. u = 700,
  20864. T = 72,
  20865. x = 128,
  20866. S = "-",
  20867. d = /^xn--/,
  20868. p = /[^\x20-\x7E]/,
  20869. f = /[\x2E\u3002\uFF0E\uFF61]/g,
  20870. g = {
  20871. overflow: "Overflow: input needs wider integers to process",
  20872. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  20873. "invalid-input": "Invalid input"
  20874. },
  20875. m = _ - b,
  20876. M = Math.floor,
  20877. R = String.fromCharCode;
  20878. if (l = {
  20879. version: "1.4.1",
  20880. ucs2: {
  20881. decode: y,
  20882. encode: A
  20883. },
  20884. decode: i,
  20885. encode: n,
  20886. toASCII: function (e) {
  20887. return t(e, function (e) {
  20888. return p.test(e) ? "xn--" + n(e) : e
  20889. })
  20890. },
  20891. toUnicode: function (e) {
  20892. return t(e, function (e) {
  20893. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  20894. })
  20895. }
  20896. }, "function" == typeof define && "object" == typeof define.amd && define.amd) define("punycode", function () {
  20897. return l
  20898. });
  20899. else if (o && a)
  20900. if (O.exports == o) a.exports = l;
  20901. else
  20902. for (c in l) l.hasOwnProperty(c) && (o[c] = l[c]);
  20903. else e.punycode = l
  20904. }(this)
  20905. }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  20906. }, {}],
  20907. 205: [function (e, t, i) {
  20908. "use strict";
  20909. t.exports = function (e, t, i, n) {
  20910. t = t || "&", i = i || "=";
  20911. var r = {};
  20912. if ("string" != typeof e || 0 === e.length) return r;
  20913. var o = /\+/g;
  20914. e = e.split(t);
  20915. var a = 1e3;
  20916. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  20917. var s, l, c = e.length;
  20918. 0 < a && a < c && (c = a);
  20919. for (var h = 0; h < c; ++h) {
  20920. var u, d, p, f, g = e[h].replace(o, "%20"),
  20921. m = g.indexOf(i);
  20922. d = 0 <= m ? (u = g.substr(0, m), g.substr(m + 1)) : (u = g, ""), p = decodeURIComponent(u), f = decodeURIComponent(d), s = r, l = p, Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  20923. }
  20924. return r
  20925. };
  20926. var v = Array.isArray || function (e) {
  20927. return "[object Array]" === Object.prototype.toString.call(e)
  20928. }
  20929. }, {}],
  20930. 206: [function (e, t, i) {
  20931. "use strict";
  20932. function o(e, t) {
  20933. if (e.map) return e.map(t);
  20934. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n));
  20935. return i
  20936. }
  20937. function a(e) {
  20938. switch (typeof e) {
  20939. case "string":
  20940. return e;
  20941. case "boolean":
  20942. return e ? "true" : "false";
  20943. case "number":
  20944. return isFinite(e) ? e : "";
  20945. default:
  20946. return ""
  20947. }
  20948. }
  20949. t.exports = function (i, n, r, e) {
  20950. return n = n || "&", r = r || "=", null === i && (i = void 0), "object" == typeof i ? o(l(i), function (e) {
  20951. var t = encodeURIComponent(a(e)) + r;
  20952. return s(i[e]) ? o(i[e], function (e) {
  20953. return t + encodeURIComponent(a(e))
  20954. }).join(n) : t + encodeURIComponent(a(i[e]))
  20955. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  20956. };
  20957. var s = Array.isArray || function (e) {
  20958. return "[object Array]" === Object.prototype.toString.call(e)
  20959. },
  20960. l = Object.keys || function (e) {
  20961. var t = [];
  20962. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  20963. return t
  20964. }
  20965. }, {}],
  20966. 207: [function (e, t, i) {
  20967. "use strict";
  20968. i.decode = i.parse = e("./decode"), i.encode = i.stringify = e("./encode")
  20969. }, {
  20970. "./decode": 205,
  20971. "./encode": 206
  20972. }],
  20973. 208: [function (e, t, i) {
  20974. "use strict";
  20975. function x() {
  20976. this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null
  20977. }
  20978. function n(e, t, i) {
  20979. if (e && D.isObject(e) && e instanceof x) return e;
  20980. var n = new x;
  20981. return n.parse(e, t, i), n
  20982. }
  20983. var L = e("punycode"),
  20984. D = e("./util");
  20985. i.parse = n, i.resolve = function (e, t) {
  20986. return n(e, !1, !0).resolve(t)
  20987. }, i.resolveObject = function (e, t) {
  20988. return e ? n(e, !1, !0).resolveObject(t) : t
  20989. }, i.format = function (e) {
  20990. return D.isString(e) && (e = n(e)), e instanceof x ? e.format() : x.prototype.format.call(e)
  20991. }, i.Url = x;
  20992. var N = /^([a-z0-9.+-]+:)/i,
  20993. r = /:[0-9]*$/,
  20994. F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  20995. o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"]),
  20996. B = ["'"].concat(o),
  20997. V = ["%", "/", "?", ";", "#"].concat(B),
  20998. k = ["/", "?", "#"],
  20999. U = /^[+a-z0-9A-Z_-]{0,63}$/,
  21000. H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  21001. z = {
  21002. javascript: !0,
  21003. "javascript:": !0
  21004. },
  21005. G = {
  21006. javascript: !0,
  21007. "javascript:": !0
  21008. },
  21009. W = {
  21010. http: !0,
  21011. https: !0,
  21012. ftp: !0,
  21013. gopher: !0,
  21014. file: !0,
  21015. "http:": !0,
  21016. "https:": !0,
  21017. "ftp:": !0,
  21018. "gopher:": !0,
  21019. "file:": !0
  21020. },
  21021. j = e("querystring");
  21022. x.prototype.parse = function (e, t, i) {
  21023. if (!D.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  21024. var n = e.indexOf("?"),
  21025. r = -1 !== n && n < e.indexOf("#") ? "?" : "#",
  21026. o = e.split(r);
  21027. o[0] = o[0].replace(/\\/g, "/");
  21028. var a = e = o.join(r);
  21029. if (a = a.trim(), !i && 1 === e.split("#").length) {
  21030. var s = F.exec(a);
  21031. if (s) return this.path = a, this.href = a, this.pathname = s[1], s[2] ? (this.search = s[2], this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "", this.query = {}), this
  21032. }
  21033. var l = N.exec(a);
  21034. if (l) {
  21035. var c = (l = l[0]).toLowerCase();
  21036. this.protocol = c, a = a.substr(l.length)
  21037. }
  21038. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  21039. var h = "//" === a.substr(0, 2);
  21040. !h || l && G[l] || (a = a.substr(2), this.slashes = !0)
  21041. }
  21042. if (!G[l] && (h || l && !W[l])) {
  21043. for (var u = -1, d = 0; d < k.length; d++) {
  21044. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  21045. }
  21046. var p, f; - 1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f), a = a.slice(f + 1), this.auth = decodeURIComponent(p)), u = -1;
  21047. for (d = 0; d < V.length; d++) {
  21048. var g; - 1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  21049. } - 1 === u && (u = a.length), this.host = a.slice(0, u), a = a.slice(u), this.parseHost(), this.hostname = this.hostname || "";
  21050. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  21051. if (!m)
  21052. for (var v = this.hostname.split(/\./), y = (d = 0, v.length); d < y; d++) {
  21053. var A = v[d];
  21054. if (A && !A.match(U)) {
  21055. for (var C = "", I = 0, E = A.length; I < E; I++) C += 127 < A.charCodeAt(I) ? "x" : A[I];
  21056. if (!C.match(U)) {
  21057. var _ = v.slice(0, d),
  21058. b = v.slice(d + 1),
  21059. w = A.match(H);
  21060. w && (_.push(w[1]), b.unshift(w[2])), b.length && (a = "/" + b.join(".") + a), this.hostname = _.join(".");
  21061. break
  21062. }
  21063. }
  21064. }
  21065. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), m || (this.hostname = L.toASCII(this.hostname));
  21066. var T = this.port ? ":" + this.port : "",
  21067. x = this.hostname || "";
  21068. this.host = x + T, this.href += this.host, m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== a[0] && (a = "/" + a))
  21069. }
  21070. if (!z[c])
  21071. for (d = 0, y = B.length; d < y; d++) {
  21072. var S = B[d];
  21073. if (-1 !== a.indexOf(S)) {
  21074. var M = encodeURIComponent(S);
  21075. M === S && (M = escape(S)), a = a.split(S).join(M)
  21076. }
  21077. }
  21078. var R = a.indexOf("#"); - 1 !== R && (this.hash = a.substr(R), a = a.slice(0, R));
  21079. var P = a.indexOf("?");
  21080. if (-1 !== P ? (this.search = a.substr(P), this.query = a.substr(P + 1), t && (this.query = j.parse(this.query)), a = a.slice(0, P)) : t && (this.search = "", this.query = {}), a && (this.pathname = a), W[c] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
  21081. T = this.pathname || "";
  21082. var O = this.search || "";
  21083. this.path = T + O
  21084. }
  21085. return this.href = this.format(), this
  21086. }, x.prototype.format = function () {
  21087. var e = this.auth || "";
  21088. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"), e += "@");
  21089. var t = this.protocol || "",
  21090. i = this.pathname || "",
  21091. n = this.hash || "",
  21092. r = !1,
  21093. o = "";
  21094. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (r += ":" + this.port)), this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  21095. var a = this.search || o && "?" + o || "";
  21096. return t && ":" !== t.substr(-1) && (t += ":"), this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""), i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "", n && "#" !== n.charAt(0) && (n = "#" + n), a && "?" !== a.charAt(0) && (a = "?" + a), t + r + (i = i.replace(/[?#]/g, function (e) {
  21097. return encodeURIComponent(e)
  21098. })) + (a = a.replace("#", "%23")) + n
  21099. }, x.prototype.resolve = function (e) {
  21100. return this.resolveObject(n(e, !1, !0)).format()
  21101. }, x.prototype.resolveObject = function (e) {
  21102. if (D.isString(e)) {
  21103. var t = new x;
  21104. t.parse(e, !1, !0), e = t
  21105. }
  21106. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  21107. var o = n[r];
  21108. i[o] = this[o]
  21109. }
  21110. if (i.hash = e.hash, "" === e.href) return i.href = i.format(), i;
  21111. if (e.slashes && !e.protocol) {
  21112. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  21113. var l = a[s];
  21114. "protocol" !== l && (i[l] = e[l])
  21115. }
  21116. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"), i.href = i.format(), i
  21117. }
  21118. if (e.protocol && e.protocol !== i.protocol) {
  21119. if (!W[e.protocol]) {
  21120. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  21121. var u = c[h];
  21122. i[u] = e[u]
  21123. }
  21124. return i.href = i.format(), i
  21125. }
  21126. if (i.protocol = e.protocol, e.host || G[e.protocol]) i.pathname = e.pathname;
  21127. else {
  21128. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()););
  21129. e.host || (e.host = ""), e.hostname || (e.hostname = ""), "" !== d[0] && d.unshift(""), d.length < 2 && d.unshift(""), i.pathname = d.join("/")
  21130. }
  21131. if (i.search = e.search, i.query = e.query, i.host = e.host || "", i.auth = e.auth, i.hostname = e.hostname || e.host, i.port = e.port, i.pathname || i.search) {
  21132. var p = i.pathname || "",
  21133. f = i.search || "";
  21134. i.path = p + f
  21135. }
  21136. return i.slashes = i.slashes || e.slashes, i.href = i.format(), i
  21137. }
  21138. var g = i.pathname && "/" === i.pathname.charAt(0),
  21139. m = e.host || e.pathname && "/" === e.pathname.charAt(0),
  21140. v = m || g || i.host && e.pathname,
  21141. y = v,
  21142. A = i.pathname && i.pathname.split("/") || [],
  21143. C = (d = e.pathname && e.pathname.split("/") || [], i.protocol && !W[i.protocol]);
  21144. if (C && (i.hostname = "", i.port = null, i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)), i.host = "", e.protocol && (e.hostname = null, e.port = null, e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)), e.host = null), v = v && ("" === d[0] || "" === A[0])), m) i.host = e.host || "" === e.host ? e.host : i.host, i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname, i.search = e.search, i.query = e.query, A = d;
  21145. else if (d.length)(A = A || []).pop(), A = A.concat(d), i.search = e.search, i.query = e.query;
  21146. else if (!D.isNullOrUndefined(e.search)) {
  21147. if (C) i.hostname = i.host = A.shift(), (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(), i.host = i.hostname = w.shift());
  21148. return i.search = e.search, i.query = e.query, D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")), i.href = i.format(), i
  21149. }
  21150. if (!A.length) return i.pathname = null, i.search ? i.path = "/" + i.search : i.path = null, i.href = i.format(), i;
  21151. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--) "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1), _++) : _ && (A.splice(b, 1), _--);
  21152. if (!v && !y)
  21153. for (; _--;) A.unshift("..");
  21154. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""), E && "/" !== A.join("/").substr(-1) && A.push("");
  21155. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  21156. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "", (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(), i.host = i.hostname = w.shift()));
  21157. return (v = v || i.host && A.length) && !T && A.unshift(""), A.length ? i.pathname = A.join("/") : (i.pathname = null, i.path = null), D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")), i.auth = e.auth || i.auth, i.slashes = i.slashes || e.slashes, i.href = i.format(), i
  21158. }, x.prototype.parseHost = function () {
  21159. var e = this.host,
  21160. t = r.exec(e);
  21161. t && (":" !== (t = t[0]) && (this.port = t.substr(1)), e = e.substr(0, e.length - t.length)), e && (this.hostname = e)
  21162. }
  21163. }, {
  21164. "./util": 209,
  21165. punycode: 204,
  21166. querystring: 207
  21167. }],
  21168. 209: [function (e, t, i) {
  21169. "use strict";
  21170. t.exports = {
  21171. isString: function (e) {
  21172. return "string" == typeof e
  21173. },
  21174. isObject: function (e) {
  21175. return "object" == typeof e && null !== e
  21176. },
  21177. isNull: function (e) {
  21178. return null === e
  21179. },
  21180. isNullOrUndefined: function (e) {
  21181. return null == e
  21182. }
  21183. }
  21184. }, {}],
  21185. 210: [function (e, t, i) {
  21186. "use strict";
  21187. function r(e) {
  21188. return c + e
  21189. }
  21190. function s(e) {
  21191. if ("string" != typeof e) throw new TypeError("key must be a string.")
  21192. }
  21193. var l = Object.prototype.hasOwnProperty,
  21194. c = "~";
  21195. t.exports = function (t) {
  21196. var o = Object.create(null),
  21197. n = 0,
  21198. a = {};
  21199. return function (e, t) {
  21200. for (var i in t) Object.defineProperty(e, i, {
  21201. value: t[i],
  21202. configurable: !0,
  21203. writable: !0
  21204. })
  21205. }(a, {
  21206. get: function (e, t) {
  21207. s(e);
  21208. var i = r(e);
  21209. return i in o ? o[i] : t
  21210. },
  21211. set: function (e, t) {
  21212. s(e);
  21213. var i = r(e);
  21214. return i in o || ++n, o[i] = t
  21215. },
  21216. has: function (e) {
  21217. return s(e), r(e) in o
  21218. },
  21219. delete: function (e) {
  21220. s(e);
  21221. var t = r(e);
  21222. return t in o && (--n, delete o[t], !0)
  21223. },
  21224. clear: function () {
  21225. o = Object.create(null), n = 0
  21226. },
  21227. forEach: function (e, t) {
  21228. if ("function" != typeof e) throw new TypeError("`callback` must be a function");
  21229. for (var i in o)
  21230. if (l.call(o, i)) {
  21231. var n = i.substring(c.length),
  21232. r = o[i];
  21233. e.call(t, r, n, a)
  21234. }
  21235. }
  21236. }), Object.defineProperty(a, "size", {
  21237. get: function () {
  21238. return n
  21239. },
  21240. configurable: !0
  21241. }), "object" == typeof t && null !== t && Object.keys(t).forEach(function (e) {
  21242. a.set(e, t[e])
  21243. }), a
  21244. }
  21245. }, {}],
  21246. 211: [function (e, t, i) {
  21247. t.exports = e("./lib/heap")
  21248. }, {
  21249. "./lib/heap": 212
  21250. }],
  21251. 212: [function (e, y, A) {
  21252. (function () {
  21253. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  21254. function v(e) {
  21255. this.cmp = null != e ? e : d, this.nodes = []
  21256. }
  21257. l = Math.floor, m = Math.min, d = function (e, t) {
  21258. return e < t ? -1 : t < e ? 1 : 0
  21259. }, g = function (e, t, i, n, r) {
  21260. var o;
  21261. if (null == i && (i = 0), null == r && (r = d), i < 0) throw new Error("lo must be non-negative");
  21262. for (null == n && (n = e.length); i < n;) r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  21263. return [].splice.apply(e, [i, i - i].concat(t)), t
  21264. }, t = function (e, t, i) {
  21265. return null == i && (i = d), e.push(t), h(e, 0, e.length - 1, i)
  21266. }, f = function (e, t) {
  21267. var i, n;
  21268. return null == t && (t = d), i = e.pop(), e.length ? (n = e[0], e[0] = i, u(e, 0, t)) : n = i, n
  21269. }, i = function (e, t, i) {
  21270. var n;
  21271. return null == i && (i = d), n = e[0], e[0] = t, u(e, 0, i), n
  21272. }, c = function (e, t, i) {
  21273. var n;
  21274. return null == i && (i = d), e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0], e[0] = n[1], u(e, 0, i)), t
  21275. }, p = function (i, e) {
  21276. var t, n, r, o, a, s;
  21277. for (null == e && (e = d), a = [], n = 0, r = (o = function () {
  21278. s = [];
  21279. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--) s.push(e);
  21280. return s
  21281. }.apply(this).reverse()).length; n < r; n++) t = o[n], a.push(u(i, t, e));
  21282. return a
  21283. }, o = function (e, t, i) {
  21284. var n;
  21285. if (null == i && (i = d), -1 !== (n = e.indexOf(t))) return h(e, 0, n, i), u(e, n, i)
  21286. }, n = function (e, t, i) {
  21287. var n, r, o, a, s;
  21288. if (null == i && (i = d), !(r = e.slice(0, t)).length) return r;
  21289. for (p(r, i), o = 0, a = (s = e.slice(t)).length; o < a; o++) n = s[o], c(r, n, i);
  21290. return r.sort(i).reverse()
  21291. }, r = function (e, t, i) {
  21292. var n, r, o, a, s, l, c, h, u;
  21293. if (null == i && (i = d), 10 * t <= e.length) {
  21294. if (!(o = e.slice(0, t).sort(i)).length) return o;
  21295. for (r = o[o.length - 1], a = 0, l = (c = e.slice(t)).length; a < l; a++) i(n = c[a], r) < 0 && (g(o, n, 0, null, i), o.pop(), r = o[o.length - 1]);
  21296. return o
  21297. }
  21298. for (p(e, i), u = [], s = 0, h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s) u.push(f(e, i));
  21299. return u
  21300. }, h = function (e, t, i, n) {
  21301. var r, o, a;
  21302. for (null == n && (n = d), r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0;) e[i] = o, i = a;
  21303. return e[i] = r
  21304. }, u = function (e, t, i) {
  21305. var n, r, o, a, s;
  21306. for (null == i && (i = d), r = e.length, o = e[s = t], n = 2 * t + 1; n < r;)(a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a), e[t] = e[n], n = 2 * (t = n) + 1;
  21307. return e[t] = o, h(e, s, t, i)
  21308. }, v.push = t, v.pop = f, v.replace = i, v.pushpop = c, v.heapify = p, v.updateItem = o, v.nlargest = n, v.nsmallest = r, v.prototype.push = function (e) {
  21309. return t(this.nodes, e, this.cmp)
  21310. }, v.prototype.pop = function () {
  21311. return f(this.nodes, this.cmp)
  21312. }, v.prototype.peek = function () {
  21313. return this.nodes[0]
  21314. }, v.prototype.contains = function (e) {
  21315. return -1 !== this.nodes.indexOf(e)
  21316. }, v.prototype.replace = function (e) {
  21317. return i(this.nodes, e, this.cmp)
  21318. }, v.prototype.pushpop = function (e) {
  21319. return c(this.nodes, e, this.cmp)
  21320. }, v.prototype.heapify = function () {
  21321. return p(this.nodes, this.cmp)
  21322. }, v.prototype.updateItem = function (e) {
  21323. return o(this.nodes, e, this.cmp)
  21324. }, v.prototype.clear = function () {
  21325. return this.nodes = []
  21326. }, v.prototype.empty = function () {
  21327. return 0 === this.nodes.length
  21328. }, v.prototype.size = function () {
  21329. return this.nodes.length
  21330. }, v.prototype.clone = function () {
  21331. var e;
  21332. return (e = new v).nodes = this.nodes.slice(0), e
  21333. }, v.prototype.toArray = function () {
  21334. return this.nodes.slice(0)
  21335. }, v.prototype.insert = v.prototype.push, v.prototype.top = v.prototype.peek, v.prototype.front = v.prototype.peek, v.prototype.has = v.prototype.contains, v.prototype.copy = v.prototype.clone, e = v, a = this, s = function () {
  21336. return e
  21337. }, "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  21338. }).call(this)
  21339. }, {}],
  21340. 213: [function (e, t, i) {
  21341. function n() {}
  21342. function o(e) {
  21343. if ("object" != typeof this) throw new TypeError("Promises must be constructed via new");
  21344. if ("function" != typeof e) throw new TypeError("not a function");
  21345. this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], h(e, this)
  21346. }
  21347. function r(i, n) {
  21348. for (; 3 === i._state;) i = i._value;
  21349. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0, void o._immediateFn(function () {
  21350. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  21351. if (null !== e) {
  21352. var t;
  21353. try {
  21354. t = e(i._value)
  21355. } catch (e) {
  21356. return void s(n.promise, e)
  21357. }
  21358. a(n.promise, t)
  21359. } else(1 === i._state ? a : s)(n.promise, i._value)
  21360. }))
  21361. }
  21362. function a(e, t) {
  21363. try {
  21364. if (t === e) throw new TypeError("A promise cannot be resolved with itself.");
  21365. if (t && ("object" == typeof t || "function" == typeof t)) {
  21366. var i = t.then;
  21367. if (t instanceof o) return e._state = 3, e._value = t, void l(e);
  21368. if ("function" == typeof i) return void h(function (e, t) {
  21369. return function () {
  21370. e.apply(t, arguments)
  21371. }
  21372. }(i, t), e)
  21373. }
  21374. e._state = 1, e._value = t, l(e)
  21375. } catch (t) {
  21376. s(e, t)
  21377. }
  21378. }
  21379. function s(e, t) {
  21380. e._state = 2, e._value = t, l(e)
  21381. }
  21382. function l(e) {
  21383. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function () {
  21384. e._handled || o._unhandledRejectionFn(e._value)
  21385. });
  21386. for (var t = 0, i = e._deferreds.length; t < i; t++) r(e, e._deferreds[t]);
  21387. e._deferreds = null
  21388. }
  21389. function c(e, t, i) {
  21390. this.onFulfilled = "function" == typeof e ? e : null, this.onRejected = "function" == typeof t ? t : null, this.promise = i
  21391. }
  21392. function h(e, t) {
  21393. var i = !1;
  21394. try {
  21395. e(function (e) {
  21396. i || (i = !0, a(t, e))
  21397. }, function (e) {
  21398. i || (i = !0, s(t, e))
  21399. })
  21400. } catch (e) {
  21401. if (i) return;
  21402. i = !0, s(t, e)
  21403. }
  21404. }
  21405. var u, d;
  21406. u = this, d = setTimeout, o.prototype.catch = function (e) {
  21407. return this.then(null, e)
  21408. }, o.prototype.then = function (e, t) {
  21409. var i = new this.constructor(n);
  21410. return r(this, new c(e, t, i)), i
  21411. }, o.all = function (e) {
  21412. var s = Array.prototype.slice.call(e);
  21413. return new o(function (n, r) {
  21414. function o(t, e) {
  21415. try {
  21416. if (e && ("object" == typeof e || "function" == typeof e)) {
  21417. var i = e.then;
  21418. if ("function" == typeof i) return void i.call(e, function (e) {
  21419. o(t, e)
  21420. }, r)
  21421. }
  21422. s[t] = e, 0 == --a && n(s)
  21423. } catch (e) {
  21424. r(e)
  21425. }
  21426. }
  21427. if (0 === s.length) return n([]);
  21428. for (var a = s.length, e = 0; e < s.length; e++) o(e, s[e])
  21429. })
  21430. }, o.resolve = function (t) {
  21431. return t && "object" == typeof t && t.constructor === o ? t : new o(function (e) {
  21432. e(t)
  21433. })
  21434. }, o.reject = function (i) {
  21435. return new o(function (e, t) {
  21436. t(i)
  21437. })
  21438. }, o.race = function (r) {
  21439. return new o(function (e, t) {
  21440. for (var i = 0, n = r.length; i < n; i++) r[i].then(e, t)
  21441. })
  21442. }, o._immediateFn = "function" == typeof setImmediate && function (e) {
  21443. setImmediate(e)
  21444. } || function (e) {
  21445. d(e, 0)
  21446. }, o._unhandledRejectionFn = function (e) {
  21447. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  21448. }, o._setImmediateFn = function (e) {
  21449. o._immediateFn = e
  21450. }, o._setUnhandledRejectionFn = function (e) {
  21451. o._unhandledRejectionFn = e
  21452. }, void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  21453. }, {}],
  21454. 214: [function (p, i, e) {
  21455. (function (d) {
  21456. var e, t;
  21457. e = this, t = function (I, e) {
  21458. "use strict";
  21459. var a, t, u, i, s, n, r, o = {};
  21460. return o.ByteBuffer = I, o.Long = I.Long || null, o.VERSION = "5.0.1", o.WIRE_TYPES = {}, o.WIRE_TYPES.VARINT = 0, o.WIRE_TYPES.BITS64 = 1, o.WIRE_TYPES.LDELIM = 2, o.WIRE_TYPES.STARTGROUP = 3, o.WIRE_TYPES.ENDGROUP = 4, o.WIRE_TYPES.BITS32 = 5, o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32], o.TYPES = {
  21461. int32: {
  21462. name: "int32",
  21463. wireType: o.WIRE_TYPES.VARINT,
  21464. defaultValue: 0
  21465. },
  21466. uint32: {
  21467. name: "uint32",
  21468. wireType: o.WIRE_TYPES.VARINT,
  21469. defaultValue: 0
  21470. },
  21471. sint32: {
  21472. name: "sint32",
  21473. wireType: o.WIRE_TYPES.VARINT,
  21474. defaultValue: 0
  21475. },
  21476. int64: {
  21477. name: "int64",
  21478. wireType: o.WIRE_TYPES.VARINT,
  21479. defaultValue: o.Long ? o.Long.ZERO : void 0
  21480. },
  21481. uint64: {
  21482. name: "uint64",
  21483. wireType: o.WIRE_TYPES.VARINT,
  21484. defaultValue: o.Long ? o.Long.UZERO : void 0
  21485. },
  21486. sint64: {
  21487. name: "sint64",
  21488. wireType: o.WIRE_TYPES.VARINT,
  21489. defaultValue: o.Long ? o.Long.ZERO : void 0
  21490. },
  21491. bool: {
  21492. name: "bool",
  21493. wireType: o.WIRE_TYPES.VARINT,
  21494. defaultValue: !1
  21495. },
  21496. double: {
  21497. name: "double",
  21498. wireType: o.WIRE_TYPES.BITS64,
  21499. defaultValue: 0
  21500. },
  21501. string: {
  21502. name: "string",
  21503. wireType: o.WIRE_TYPES.LDELIM,
  21504. defaultValue: ""
  21505. },
  21506. bytes: {
  21507. name: "bytes",
  21508. wireType: o.WIRE_TYPES.LDELIM,
  21509. defaultValue: null
  21510. },
  21511. fixed32: {
  21512. name: "fixed32",
  21513. wireType: o.WIRE_TYPES.BITS32,
  21514. defaultValue: 0
  21515. },
  21516. sfixed32: {
  21517. name: "sfixed32",
  21518. wireType: o.WIRE_TYPES.BITS32,
  21519. defaultValue: 0
  21520. },
  21521. fixed64: {
  21522. name: "fixed64",
  21523. wireType: o.WIRE_TYPES.BITS64,
  21524. defaultValue: o.Long ? o.Long.UZERO : void 0
  21525. },
  21526. sfixed64: {
  21527. name: "sfixed64",
  21528. wireType: o.WIRE_TYPES.BITS64,
  21529. defaultValue: o.Long ? o.Long.ZERO : void 0
  21530. },
  21531. float: {
  21532. name: "float",
  21533. wireType: o.WIRE_TYPES.BITS32,
  21534. defaultValue: 0
  21535. },
  21536. enum: {
  21537. name: "enum",
  21538. wireType: o.WIRE_TYPES.VARINT,
  21539. defaultValue: 0
  21540. },
  21541. message: {
  21542. name: "message",
  21543. wireType: o.WIRE_TYPES.LDELIM,
  21544. defaultValue: null
  21545. },
  21546. group: {
  21547. name: "group",
  21548. wireType: o.WIRE_TYPES.STARTGROUP,
  21549. defaultValue: null
  21550. }
  21551. }, o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes], o.ID_MIN = 1, o.ID_MAX = 536870911, o.convertFieldsToCamelCase = !1, o.populateAccessors = !0, o.populateDefaults = !0, o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser), r.XHR = function () {
  21552. for (var e = [function () {
  21553. return new XMLHttpRequest
  21554. }, function () {
  21555. return new ActiveXObject("Msxml2.XMLHTTP")
  21556. }, function () {
  21557. return new ActiveXObject("Msxml3.XMLHTTP")
  21558. }, function () {
  21559. return new ActiveXObject("Microsoft.XMLHTTP")
  21560. }], t = null, i = 0; i < e.length; i++) {
  21561. try {
  21562. t = e[i]()
  21563. } catch (e) {
  21564. continue
  21565. }
  21566. break
  21567. }
  21568. if (!t) throw Error("XMLHttpRequest is not supported");
  21569. return t
  21570. }, r.fetch = function (e, i) {
  21571. if (i && "function" != typeof i && (i = null), r.IS_NODE) {
  21572. var t = p("fs");
  21573. if (i) t.readFile(e, function (e, t) {
  21574. i(e ? null : "" + t)
  21575. });
  21576. else try {
  21577. return t.readFileSync(e)
  21578. } catch (e) {
  21579. return null
  21580. }
  21581. } else {
  21582. var n = r.XHR();
  21583. if (n.open("GET", e, !!i), n.setRequestHeader("Accept", "text/plain"), "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"), !i) return n.send(null), 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  21584. if (n.onreadystatechange = function () {
  21585. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  21586. }, 4 == n.readyState) return;
  21587. n.send(null)
  21588. }
  21589. }, r.toCamelCase = function (e) {
  21590. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  21591. return t.toUpperCase()
  21592. })
  21593. }, r), o.Lang = {
  21594. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  21595. RULE: /^(?:required|optional|repeated|map)$/,
  21596. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  21597. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  21598. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  21599. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  21600. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  21601. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  21602. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  21603. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  21604. NUMBER_OCT: /^0[0-7]+$/,
  21605. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  21606. BOOL: /^(?:true|false)$/i,
  21607. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  21608. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  21609. WHITESPACE: /\s/,
  21610. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  21611. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  21612. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  21613. }, o.DotProto = function (r, a) {
  21614. function s(e, t) {
  21615. var i = -1,
  21616. n = 1;
  21617. if ("-" == e.charAt(0) && (n = -1, e = e.substring(1)), a.NUMBER_DEC.test(e)) i = parseInt(e);
  21618. else if (a.NUMBER_HEX.test(e)) i = parseInt(e.substring(2), 16);
  21619. else {
  21620. if (!a.NUMBER_OCT.test(e)) throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  21621. i = parseInt(e.substring(1), 8)
  21622. }
  21623. if (i = n * i | 0, !t && i < 0) throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  21624. return i
  21625. }
  21626. function o(e) {
  21627. var t = 1;
  21628. if ("-" == e.charAt(0) && (t = -1, e = e.substring(1)), a.NUMBER_DEC.test(e)) return t * parseInt(e, 10);
  21629. if (a.NUMBER_HEX.test(e)) return t * parseInt(e.substring(2), 16);
  21630. if (a.NUMBER_OCT.test(e)) return t * parseInt(e.substring(1), 8);
  21631. if ("inf" === e) return t * (1 / 0);
  21632. if ("nan" === e) return NaN;
  21633. if (a.NUMBER_FLT.test(e)) return t * parseFloat(e);
  21634. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  21635. }
  21636. function n(e, t, i) {
  21637. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i))
  21638. }
  21639. function t(e) {
  21640. this.source = e + "", this.index = 0, this.line = 1, this.stack = [], this._stringOpen = null
  21641. }
  21642. var e = {},
  21643. i = t.prototype;
  21644. i._readString = function () {
  21645. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  21646. e.lastIndex = this.index - 1;
  21647. var t = e.exec(this.source);
  21648. if (!t) throw Error("unterminated string");
  21649. return this.index = e.lastIndex, this.stack.push(this._stringOpen), this._stringOpen = null, t[1]
  21650. }, i.next = function () {
  21651. if (0 < this.stack.length) return this.stack.shift();
  21652. if (this.index >= this.source.length) return null;
  21653. if (null !== this._stringOpen) return this._readString();
  21654. var e, t, i;
  21655. do {
  21656. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index));)
  21657. if ("\n" === i && ++this.line, ++this.index === this.source.length) return null;
  21658. if ("/" === this.source.charAt(this.index))
  21659. if (++this.index, "/" === this.source.charAt(this.index)) {
  21660. for (;
  21661. "\n" !== this.source.charAt(++this.index);)
  21662. if (this.index == this.source.length) return null;
  21663. ++this.index, ++this.line, e = !0
  21664. } else {
  21665. if ("*" !== (i = this.source.charAt(this.index))) return "/";
  21666. do {
  21667. if ("\n" === i && ++this.line, ++this.index === this.source.length) return null;
  21668. t = i, i = this.source.charAt(this.index)
  21669. } while ("*" !== t || "/" !== i);
  21670. ++this.index, e = !0
  21671. }
  21672. } while (e);
  21673. if (this.index === this.source.length) return null;
  21674. var n = this.index;
  21675. if (a.DELIM.lastIndex = 0, !a.DELIM.test(this.source.charAt(n++)))
  21676. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n));) ++n;
  21677. var r = this.source.substring(this.index, this.index = n);
  21678. return '"' !== r && "'" !== r || (this._stringOpen = r), r
  21679. }, i.peek = function () {
  21680. if (0 === this.stack.length) {
  21681. var e = this.next();
  21682. if (null === e) return null;
  21683. this.stack.push(e)
  21684. }
  21685. return this.stack[0]
  21686. }, i.skip = function (e) {
  21687. var t = this.next();
  21688. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected")
  21689. }, i.omit = function (e) {
  21690. return this.peek() === e && (this.next(), !0)
  21691. }, i.toString = function () {
  21692. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  21693. }, e.Tokenizer = t;
  21694. function l(e) {
  21695. this.tn = new t(e), this.proto3 = !1
  21696. }
  21697. var c = l.prototype;
  21698. return c.parse = function () {
  21699. var e, t, i = {
  21700. name: "[ROOT]",
  21701. package: null,
  21702. messages: [],
  21703. enums: [],
  21704. imports: [],
  21705. options: {},
  21706. services: []
  21707. },
  21708. n = !0;
  21709. try {
  21710. for (; e = this.tn.next();) switch (e) {
  21711. case "package":
  21712. if (!n || null !== i.package) throw Error("unexpected 'package'");
  21713. if (e = this.tn.next(), !a.TYPEREF.test(e)) throw Error("illegal package name: " + e);
  21714. this.tn.skip(";"), i.package = e;
  21715. break;
  21716. case "import":
  21717. if (!n) throw Error("unexpected 'import'");
  21718. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(), e = this._readString(), this.tn.skip(";"), t || i.imports.push(e);
  21719. break;
  21720. case "syntax":
  21721. if (!n) throw Error("unexpected 'syntax'");
  21722. this.tn.skip("="), "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(";");
  21723. break;
  21724. case "message":
  21725. this._parseMessage(i, null), n = !1;
  21726. break;
  21727. case "enum":
  21728. this._parseEnum(i), n = !1;
  21729. break;
  21730. case "option":
  21731. this._parseOption(i);
  21732. break;
  21733. case "service":
  21734. this._parseService(i);
  21735. break;
  21736. case "extend":
  21737. this._parseExtend(i);
  21738. break;
  21739. default:
  21740. throw Error("unexpected '" + e + "'")
  21741. }
  21742. } catch (e) {
  21743. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message, e
  21744. }
  21745. return delete i.name, i
  21746. }, l.parse = function (e) {
  21747. return new l(e).parse()
  21748. }, c._readString = function () {
  21749. var e, t, i = "";
  21750. do {
  21751. if ("'" !== (t = this.tn.next()) && '"' !== t) throw Error("illegal string delimiter: " + t);
  21752. i += this.tn.next(), this.tn.skip(t), e = this.tn.peek()
  21753. } while ('"' === e || '"' === e);
  21754. return i
  21755. }, c._readValue = function (e) {
  21756. var t = this.tn.peek();
  21757. if ('"' === t || "'" === t) return this._readString();
  21758. if (this.tn.next(), a.NUMBER.test(t)) return o(t);
  21759. if (a.BOOL.test(t)) return "true" === t.toLowerCase();
  21760. if (e && a.TYPEREF.test(t)) return t;
  21761. throw Error("illegal value: " + t)
  21762. }, c._parseOption = function (e, t) {
  21763. var i = this.tn.next(),
  21764. n = !1;
  21765. if ("(" === i && (n = !0, i = this.tn.next()), !a.TYPEREF.test(i)) throw Error("illegal option name: " + i);
  21766. var r = i;
  21767. n && (this.tn.skip(")"), r = "(" + r + ")", i = this.tn.peek(), a.FQTYPEREF.test(i) && (r += i, this.tn.next())), this.tn.skip("="), this._parseOptionValue(e, r), t || this.tn.skip(";")
  21768. }, c._parseOptionValue = function (e, t) {
  21769. var i = this.tn.peek();
  21770. if ("{" !== i) n(e.options, t, this._readValue(!0));
  21771. else
  21772. for (this.tn.skip("{");
  21773. "}" !== (i = this.tn.next());) {
  21774. if (!a.NAME.test(i)) throw Error("illegal option name: " + t + "." + i);
  21775. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  21776. }
  21777. }, c._parseService = function (e) {
  21778. var t = this.tn.next();
  21779. if (!a.NAME.test(t)) throw Error("illegal service name at line " + this.tn.line + ": " + t);
  21780. var i = {
  21781. name: t,
  21782. rpc: {},
  21783. options: {}
  21784. };
  21785. for (this.tn.skip("{");
  21786. "}" !== (t = this.tn.next());)
  21787. if ("option" === t) this._parseOption(i);
  21788. else {
  21789. if ("rpc" !== t) throw Error("illegal service token: " + t);
  21790. this._parseServiceRPC(i)
  21791. } this.tn.omit(";"), e.services.push(i)
  21792. }, c._parseServiceRPC = function (e) {
  21793. var t = this.tn.next();
  21794. if (!a.NAME.test(t)) throw Error("illegal rpc service method name: " + t);
  21795. var i = t,
  21796. n = {
  21797. request: null,
  21798. response: null,
  21799. request_stream: !1,
  21800. response_stream: !1,
  21801. options: {}
  21802. };
  21803. if (this.tn.skip("("), "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0, t = this.tn.next()), !a.TYPEREF.test(t)) throw Error("illegal rpc service request type: " + t);
  21804. if (n.request = t, this.tn.skip(")"), "returns" !== (t = this.tn.next()).toLowerCase()) throw Error("illegal rpc service request type delimiter: " + t);
  21805. if (this.tn.skip("("), "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0, t = this.tn.next()), n.response = t, this.tn.skip(")"), "{" === (t = this.tn.peek())) {
  21806. for (this.tn.next();
  21807. "}" !== (t = this.tn.next());) {
  21808. if ("option" !== t) throw Error("illegal rpc service token: " + t);
  21809. this._parseOption(n)
  21810. }
  21811. this.tn.omit(";")
  21812. } else this.tn.skip(";");
  21813. void 0 === e.rpc && (e.rpc = {}), e.rpc[i] = n
  21814. }, c._parseMessage = function (e, t) {
  21815. var i = !!t,
  21816. n = this.tn.next(),
  21817. r = {
  21818. name: "",
  21819. fields: [],
  21820. enums: [],
  21821. messages: [],
  21822. options: {},
  21823. services: [],
  21824. oneofs: {}
  21825. };
  21826. if (!a.NAME.test(n)) throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  21827. for (r.name = n, i && (this.tn.skip("="), t.id = s(this.tn.next()), r.isGroup = !0), "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t), this.tn.skip("{");
  21828. "}" !== (n = this.tn.next());)
  21829. if (a.RULE.test(n)) this._parseMessageField(r, n);
  21830. else if ("oneof" === n) this._parseMessageOneOf(r);
  21831. else if ("enum" === n) this._parseEnum(r);
  21832. else if ("message" === n) this._parseMessage(r);
  21833. else if ("option" === n) this._parseOption(r);
  21834. else if ("service" === n) this._parseService(r);
  21835. else if ("extensions" === n) r.extensions = this._parseExtensionRanges();
  21836. else if ("reserved" === n) this._parseIgnored();
  21837. else if ("extend" === n) this._parseExtend(r);
  21838. else {
  21839. if (!a.TYPEREF.test(n)) throw Error("illegal message token: " + n);
  21840. if (!this.proto3) throw Error("illegal field rule: " + n);
  21841. this._parseMessageField(r, "optional", n)
  21842. }
  21843. return this.tn.omit(";"), e.messages.push(r), r
  21844. }, c._parseIgnored = function () {
  21845. for (;
  21846. ";" !== this.tn.peek();) this.tn.next();
  21847. this.tn.skip(";")
  21848. }, c._parseMessageField = function (e, t, i) {
  21849. if (!a.RULE.test(t)) throw Error("illegal message field rule: " + t);
  21850. var n, r = {
  21851. rule: t,
  21852. type: "",
  21853. name: "",
  21854. options: {},
  21855. id: 0
  21856. };
  21857. if ("map" === t) {
  21858. if (i) throw Error("illegal type: " + i);
  21859. if (this.tn.skip("<"), n = this.tn.next(), !a.TYPE.test(n) && !a.TYPEREF.test(n)) throw Error("illegal message field type: " + n);
  21860. if (r.keytype = n, this.tn.skip(","), n = this.tn.next(), !a.TYPE.test(n) && !a.TYPEREF.test(n)) throw Error("illegal message field: " + n);
  21861. if (r.type = n, this.tn.skip(">"), n = this.tn.next(), !a.NAME.test(n)) throw Error("illegal message field name: " + n);
  21862. r.name = n, this.tn.skip("="), r.id = s(this.tn.next()), "[" === (n = this.tn.peek()) && this._parseFieldOptions(r), this.tn.skip(";")
  21863. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  21864. var o = this._parseMessage(e, r);
  21865. if (!/^[A-Z]/.test(o.name)) throw Error("illegal group name: " + o.name);
  21866. r.type = o.name, r.name = o.name.toLowerCase(), this.tn.omit(";")
  21867. } else {
  21868. if (!a.TYPE.test(i) && !a.TYPEREF.test(i)) throw Error("illegal message field type: " + i);
  21869. if (r.type = i, n = this.tn.next(), !a.NAME.test(n)) throw Error("illegal message field name: " + n);
  21870. r.name = n, this.tn.skip("="), r.id = s(this.tn.next()), "[" === (n = this.tn.peek()) && this._parseFieldOptions(r), this.tn.skip(";")
  21871. }
  21872. return e.fields.push(r), r
  21873. }, c._parseMessageOneOf = function (e) {
  21874. var t = this.tn.next();
  21875. if (!a.NAME.test(t)) throw Error("illegal oneof name: " + t);
  21876. var i, n = t,
  21877. r = [];
  21878. for (this.tn.skip("{");
  21879. "}" !== (t = this.tn.next());)(i = this._parseMessageField(e, "optional", t)).oneof = n, r.push(i.id);
  21880. this.tn.omit(";"), e.oneofs[n] = r
  21881. }, c._parseFieldOptions = function (e) {
  21882. this.tn.skip("[");
  21883. for (var t = !0;
  21884. "]" !== this.tn.peek();) t || this.tn.skip(","), this._parseOption(e, !0), t = !1;
  21885. this.tn.next()
  21886. }, c._parseEnum = function (e) {
  21887. var t = {
  21888. name: "",
  21889. values: [],
  21890. options: {}
  21891. },
  21892. i = this.tn.next();
  21893. if (!a.NAME.test(i)) throw Error("illegal name: " + i);
  21894. for (t.name = i, this.tn.skip("{");
  21895. "}" !== (i = this.tn.next());)
  21896. if ("option" === i) this._parseOption(t);
  21897. else {
  21898. if (!a.NAME.test(i)) throw Error("illegal name: " + i);
  21899. this.tn.skip("=");
  21900. var n = {
  21901. name: i,
  21902. id: s(this.tn.next(), !0)
  21903. };
  21904. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  21905. options: {}
  21906. }), this.tn.skip(";"), t.values.push(n)
  21907. } this.tn.omit(";"), e.enums.push(t)
  21908. }, c._parseExtensionRanges = function () {
  21909. var e, t, i, n = [];
  21910. do {
  21911. for (t = [];;) {
  21912. switch (e = this.tn.next()) {
  21913. case "min":
  21914. i = r.ID_MIN;
  21915. break;
  21916. case "max":
  21917. i = r.ID_MAX;
  21918. break;
  21919. default:
  21920. i = o(e)
  21921. }
  21922. if (t.push(i), 2 === t.length) break;
  21923. if ("to" !== this.tn.peek()) {
  21924. t.push(i);
  21925. break
  21926. }
  21927. this.tn.next()
  21928. }
  21929. n.push(t)
  21930. } while (this.tn.omit(","));
  21931. return this.tn.skip(";"), n
  21932. }, c._parseExtend = function (e) {
  21933. var t = this.tn.next();
  21934. if (!a.TYPEREF.test(t)) throw Error("illegal extend reference: " + t);
  21935. var i = {
  21936. ref: t,
  21937. fields: []
  21938. };
  21939. for (this.tn.skip("{");
  21940. "}" !== (t = this.tn.next());)
  21941. if (a.RULE.test(t)) this._parseMessageField(i, t);
  21942. else {
  21943. if (!a.TYPEREF.test(t)) throw Error("illegal extend token: " + t);
  21944. if (!this.proto3) throw Error("illegal field rule: " + t);
  21945. this._parseMessageField(i, "optional", t)
  21946. } return this.tn.omit(";"), e.messages.push(i), i
  21947. }, c.toString = function () {
  21948. return "Parser at line " + this.tn.line
  21949. }, e.Parser = l, e
  21950. }(o, o.Lang), o.Reflect = function (g) {
  21951. function a(e, t) {
  21952. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high) return new g.Long(e.low, e.high, void 0 === t ? e.unsigned : t);
  21953. if ("string" == typeof e) return g.Long.fromString(e, t || !1, 10);
  21954. if ("number" == typeof e) return g.Long.fromNumber(e, t || !1);
  21955. throw Error("not convertible to Long")
  21956. }
  21957. function m(e, t) {
  21958. var i = t.readVarint32(),
  21959. n = 7 & i,
  21960. r = i >>> 3;
  21961. switch (n) {
  21962. case g.WIRE_TYPES.VARINT:
  21963. for (; 128 == (128 & (i = t.readUint8())););
  21964. break;
  21965. case g.WIRE_TYPES.BITS64:
  21966. t.offset += 8;
  21967. break;
  21968. case g.WIRE_TYPES.LDELIM:
  21969. i = t.readVarint32(), t.offset += i;
  21970. break;
  21971. case g.WIRE_TYPES.STARTGROUP:
  21972. m(r, t);
  21973. break;
  21974. case g.WIRE_TYPES.ENDGROUP:
  21975. if (r === e) return !1;
  21976. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  21977. case g.WIRE_TYPES.BITS32:
  21978. t.offset += 4;
  21979. break;
  21980. default:
  21981. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  21982. }
  21983. return !0
  21984. }
  21985. function h(e, t, i) {
  21986. this.builder = e, this.parent = t, this.name = i, this.className
  21987. }
  21988. var s = {},
  21989. e = h.prototype;
  21990. e.fqn = function () {
  21991. for (var e = this.name, t = this; null != (t = t.parent);) e = t.name + "." + e;
  21992. return e
  21993. }, e.toString = function (e) {
  21994. return (e ? this.className + " " : "") + this.fqn()
  21995. }, e.build = function () {
  21996. throw Error(this.toString(!0) + " cannot be built directly")
  21997. }, s.T = h;
  21998. function l(e, t, i, n, r) {
  21999. h.call(this, e, t, i), this.className = "Namespace", this.children = [], this.options = n || {}, this.syntax = r || "proto2"
  22000. }
  22001. var t = l.prototype = Object.create(h.prototype);
  22002. t.getChildren = function (e) {
  22003. if (null == (e = e || null)) return this.children.slice();
  22004. for (var t = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof e && t.push(this.children[i]);
  22005. return t
  22006. }, t.addChild = function (e) {
  22007. var t;
  22008. if (t = this.getChild(e.name))
  22009. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName)) t.name = t.originalName;
  22010. else {
  22011. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName))) throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  22012. e.name = e.originalName
  22013. } this.children.push(e)
  22014. }, t.getChild = function (e) {
  22015. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  22016. if (this.children[i][t] === e) return this.children[i];
  22017. return null
  22018. }, t.resolve = function (e, t) {
  22019. var i, n = "string" == typeof e ? e.split(".") : e,
  22020. r = this,
  22021. o = 0;
  22022. if ("" === n[o]) {
  22023. for (; null !== r.parent;) r = r.parent;
  22024. o++
  22025. }
  22026. do {
  22027. do {
  22028. if (!(r instanceof s.Namespace)) {
  22029. r = null;
  22030. break
  22031. }
  22032. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  22033. r = null;
  22034. break
  22035. }
  22036. r = i, o++
  22037. } while (o < n.length);
  22038. if (null != r) break;
  22039. if (null !== this.parent) return this.parent.resolve(e, t)
  22040. } while (null != r);
  22041. return r
  22042. }, t.qn = function (e) {
  22043. for (var t = [], i = e; t.unshift(i.name), null !== (i = i.parent););
  22044. for (var n = 1; n <= t.length; n++) {
  22045. var r = t.slice(t.length - n);
  22046. if (e === this.resolve(r, e instanceof s.Namespace)) return r.join(".")
  22047. }
  22048. return e.fqn()
  22049. }, t.build = function () {
  22050. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)(e = i[n]) instanceof l && (t[e.name] = e.build());
  22051. return Object.defineProperty && Object.defineProperty(t, "$options", {
  22052. value: this.buildOpt()
  22053. }), t
  22054. }, t.buildOpt = function () {
  22055. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  22056. var r = t[i],
  22057. o = this.options[t[i]];
  22058. e[r] = o
  22059. }
  22060. return e
  22061. }, t.getOption = function (e) {
  22062. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  22063. }, s.Namespace = l;
  22064. function u(e, t, i, n) {
  22065. if (this.type = e, this.resolvedType = t, this.isMapKey = i, this.syntax = n, i && g.MAP_KEY_TYPES.indexOf(e) < 0) throw Error("Invalid map key type: " + e.name)
  22066. }
  22067. var i = u.prototype;
  22068. u.defaultFieldValue = function (e) {
  22069. if ("string" == typeof e && (e = g.TYPES[e]), void 0 === e.defaultValue) throw Error("default value for type " + e.name + " is not supported");
  22070. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  22071. }, i.verifyValue = function (t) {
  22072. function i(e, t) {
  22073. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  22074. }
  22075. var n = this;
  22076. switch (this.type) {
  22077. case g.TYPES.int32:
  22078. case g.TYPES.sint32:
  22079. case g.TYPES.sfixed32:
  22080. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"), 4294967295 < t ? 0 | t : t;
  22081. case g.TYPES.uint32:
  22082. case g.TYPES.fixed32:
  22083. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"), t < 0 ? t >>> 0 : t;
  22084. case g.TYPES.int64:
  22085. case g.TYPES.sint64:
  22086. case g.TYPES.sfixed64:
  22087. if (g.Long) try {
  22088. return a(t, !1)
  22089. } catch (e) {
  22090. i(typeof t, e.message)
  22091. } else i(typeof t, "requires Long.js");
  22092. case g.TYPES.uint64:
  22093. case g.TYPES.fixed64:
  22094. if (g.Long) try {
  22095. return a(t, !0)
  22096. } catch (e) {
  22097. i(typeof t, e.message)
  22098. } else i(typeof t, "requires Long.js");
  22099. case g.TYPES.bool:
  22100. return "boolean" != typeof t && i(typeof t, "not a boolean"), t;
  22101. case g.TYPES.float:
  22102. case g.TYPES.double:
  22103. return "number" != typeof t && i(typeof t, "not a number"), t;
  22104. case g.TYPES.string:
  22105. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"), "" + t;
  22106. case g.TYPES.bytes:
  22107. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  22108. case g.TYPES.enum:
  22109. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  22110. for (o = 0; o < e.length; o++) {
  22111. if (e[o].name == t) return e[o].id;
  22112. if (e[o].id == t) return e[o].id
  22113. }
  22114. if ("proto3" === this.syntax) return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"), (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"), t;
  22115. i(t, "not a valid enum value");
  22116. case g.TYPES.group:
  22117. case g.TYPES.message:
  22118. if (t && "object" == typeof t || i(typeof t, "object expected"), t instanceof this.resolvedType.clazz) return t;
  22119. if (t instanceof g.Builder.Message) {
  22120. var r = {};
  22121. for (var o in t) t.hasOwnProperty(o) && (r[o] = t[o]);
  22122. t = r
  22123. }
  22124. return new this.resolvedType.clazz(t)
  22125. }
  22126. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  22127. }, i.calculateLength = function (e, t) {
  22128. if (null === t) return 0;
  22129. var i;
  22130. switch (this.type) {
  22131. case g.TYPES.int32:
  22132. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  22133. case g.TYPES.uint32:
  22134. return I.calculateVarint32(t);
  22135. case g.TYPES.sint32:
  22136. return I.calculateVarint32(I.zigZagEncode32(t));
  22137. case g.TYPES.fixed32:
  22138. case g.TYPES.sfixed32:
  22139. case g.TYPES.float:
  22140. return 4;
  22141. case g.TYPES.int64:
  22142. case g.TYPES.uint64:
  22143. return I.calculateVarint64(t);
  22144. case g.TYPES.sint64:
  22145. return I.calculateVarint64(I.zigZagEncode64(t));
  22146. case g.TYPES.fixed64:
  22147. case g.TYPES.sfixed64:
  22148. return 8;
  22149. case g.TYPES.bool:
  22150. return 1;
  22151. case g.TYPES.enum:
  22152. return I.calculateVarint32(t);
  22153. case g.TYPES.double:
  22154. return 8;
  22155. case g.TYPES.string:
  22156. return i = I.calculateUTF8Bytes(t), I.calculateVarint32(i) + i;
  22157. case g.TYPES.bytes:
  22158. if (t.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  22159. return I.calculateVarint32(t.remaining()) + t.remaining();
  22160. case g.TYPES.message:
  22161. return i = this.resolvedType.calculate(t), I.calculateVarint32(i) + i;
  22162. case g.TYPES.group:
  22163. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  22164. }
  22165. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  22166. }, i.encodeValue = function (e, t, i) {
  22167. if (null === t) return i;
  22168. switch (this.type) {
  22169. case g.TYPES.int32:
  22170. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  22171. break;
  22172. case g.TYPES.uint32:
  22173. i.writeVarint32(t);
  22174. break;
  22175. case g.TYPES.sint32:
  22176. i.writeVarint32ZigZag(t);
  22177. break;
  22178. case g.TYPES.fixed32:
  22179. i.writeUint32(t);
  22180. break;
  22181. case g.TYPES.sfixed32:
  22182. i.writeInt32(t);
  22183. break;
  22184. case g.TYPES.int64:
  22185. case g.TYPES.uint64:
  22186. i.writeVarint64(t);
  22187. break;
  22188. case g.TYPES.sint64:
  22189. i.writeVarint64ZigZag(t);
  22190. break;
  22191. case g.TYPES.fixed64:
  22192. i.writeUint64(t);
  22193. break;
  22194. case g.TYPES.sfixed64:
  22195. i.writeInt64(t);
  22196. break;
  22197. case g.TYPES.bool:
  22198. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  22199. break;
  22200. case g.TYPES.enum:
  22201. i.writeVarint32(t);
  22202. break;
  22203. case g.TYPES.float:
  22204. i.writeFloat32(t);
  22205. break;
  22206. case g.TYPES.double:
  22207. i.writeFloat64(t);
  22208. break;
  22209. case g.TYPES.string:
  22210. i.writeVString(t);
  22211. break;
  22212. case g.TYPES.bytes:
  22213. if (t.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  22214. var n = t.offset;
  22215. i.writeVarint32(t.remaining()), i.append(t), t.offset = n;
  22216. break;
  22217. case g.TYPES.message:
  22218. var r = (new I).LE();
  22219. this.resolvedType.encode(t, r), i.writeVarint32(r.offset), i.append(r.flip());
  22220. break;
  22221. case g.TYPES.group:
  22222. this.resolvedType.encode(t, i), i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  22223. break;
  22224. default:
  22225. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  22226. }
  22227. return i
  22228. }, i.decode = function (e, t, i) {
  22229. if (t != this.type.wireType) throw Error("Unexpected wire type for element");
  22230. var n, r;
  22231. switch (this.type) {
  22232. case g.TYPES.int32:
  22233. return 0 | e.readVarint32();
  22234. case g.TYPES.uint32:
  22235. return e.readVarint32() >>> 0;
  22236. case g.TYPES.sint32:
  22237. return 0 | e.readVarint32ZigZag();
  22238. case g.TYPES.fixed32:
  22239. return e.readUint32() >>> 0;
  22240. case g.TYPES.sfixed32:
  22241. return 0 | e.readInt32();
  22242. case g.TYPES.int64:
  22243. return e.readVarint64();
  22244. case g.TYPES.uint64:
  22245. return e.readVarint64().toUnsigned();
  22246. case g.TYPES.sint64:
  22247. return e.readVarint64ZigZag();
  22248. case g.TYPES.fixed64:
  22249. return e.readUint64();
  22250. case g.TYPES.sfixed64:
  22251. return e.readInt64();
  22252. case g.TYPES.bool:
  22253. return !!e.readVarint32();
  22254. case g.TYPES.enum:
  22255. return e.readVarint32();
  22256. case g.TYPES.float:
  22257. return e.readFloat();
  22258. case g.TYPES.double:
  22259. return e.readDouble();
  22260. case g.TYPES.string:
  22261. return e.readVString();
  22262. case g.TYPES.bytes:
  22263. if (r = e.readVarint32(), e.remaining() < r) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  22264. return (n = e.clone()).limit = n.offset + r, e.offset += r, n;
  22265. case g.TYPES.message:
  22266. return r = e.readVarint32(), this.resolvedType.decode(e, r);
  22267. case g.TYPES.group:
  22268. return this.resolvedType.decode(e, -1, i)
  22269. }
  22270. throw Error("[INTERNAL] Illegal decode type")
  22271. }, i.valueFromString = function (e) {
  22272. if (!this.isMapKey) throw Error("valueFromString() called on non-map-key element");
  22273. switch (this.type) {
  22274. case g.TYPES.int32:
  22275. case g.TYPES.sint32:
  22276. case g.TYPES.sfixed32:
  22277. case g.TYPES.uint32:
  22278. case g.TYPES.fixed32:
  22279. return this.verifyValue(parseInt(e));
  22280. case g.TYPES.int64:
  22281. case g.TYPES.sint64:
  22282. case g.TYPES.sfixed64:
  22283. case g.TYPES.uint64:
  22284. case g.TYPES.fixed64:
  22285. return this.verifyValue(e);
  22286. case g.TYPES.bool:
  22287. return "true" === e;
  22288. case g.TYPES.string:
  22289. return this.verifyValue(e);
  22290. case g.TYPES.bytes:
  22291. return I.fromBinary(e)
  22292. }
  22293. }, i.valueToString = function (e) {
  22294. if (!this.isMapKey) throw Error("valueToString() called on non-map-key element");
  22295. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  22296. }, s.Element = u;
  22297. var d = function (e, t, i, n, r, o) {
  22298. l.call(this, e, t, i, n, o), this.className = "Message", this.extensions = void 0, this.clazz = null, this.isGroup = !!r, this._fields = null, this._fieldsById = null, this._fieldsByName = null
  22299. },
  22300. n = d.prototype = Object.create(l.prototype);
  22301. n.build = function (e) {
  22302. if (this.clazz && !e) return this.clazz;
  22303. var t = function (u, a) {
  22304. function d(e, i, n, r) {
  22305. if (null === e || "object" != typeof e) {
  22306. if (r && r instanceof u.Reflect.Enum) {
  22307. var t = u.Reflect.Enum.getName(r.object, e);
  22308. if (null !== t) return t
  22309. }
  22310. return e
  22311. }
  22312. if (I.isByteBuffer(e)) return i ? e.toBase64() : e.toBuffer();
  22313. if (u.Long.isLong(e)) return n ? e.toString() : u.Long.fromValue(e);
  22314. var o;
  22315. if (Array.isArray(e)) return o = [], e.forEach(function (e, t) {
  22316. o[t] = d(e, i, n, r)
  22317. }), o;
  22318. if (o = {}, e instanceof u.Map) {
  22319. for (var a = e.entries(), s = a.next(); !s.done; s = a.next()) o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  22320. return o
  22321. }
  22322. var l = e.$type,
  22323. c = void 0;
  22324. for (var h in e) e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  22325. return o
  22326. }
  22327. var s = a.getChildren(u.Reflect.Message.Field),
  22328. l = a.getChildren(u.Reflect.Message.OneOf),
  22329. c = function (e, t) {
  22330. u.Builder.Message.call(this);
  22331. for (var i = 0, n = l.length; i < n; ++i) this[l[i].name] = null;
  22332. for (i = 0, n = s.length; i < n; ++i) {
  22333. var r = s[i];
  22334. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null, !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  22335. }
  22336. var o;
  22337. if (0 < arguments.length)
  22338. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  22339. for (i = 0, n = arguments.length; i < n; ++i) void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  22340. else this.$set(e)
  22341. },
  22342. o = c.prototype = Object.create(u.Builder.Message.prototype);
  22343. o.add = function (e, t, i) {
  22344. var n = a._fieldsByName[e];
  22345. if (!i) {
  22346. if (!n) throw Error(this + "#" + e + " is undefined");
  22347. if (!(n instanceof u.Reflect.Message.Field)) throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  22348. if (!n.repeated) throw Error(this + "#" + e + " is not a repeated field");
  22349. t = n.verifyValue(t, !0)
  22350. }
  22351. return null === this[e] && (this[e] = []), this[e].push(t), this
  22352. }, o.$add = o.add, o.set = function (e, t, i) {
  22353. if (e && "object" == typeof e) {
  22354. for (var n in i = t, e) e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  22355. return this
  22356. }
  22357. var r = a._fieldsByName[e];
  22358. if (i) this[e] = t;
  22359. else {
  22360. if (!r) throw Error(this + "#" + e + " is not a field: undefined");
  22361. if (!(r instanceof u.Reflect.Message.Field)) throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  22362. this[r.name] = t = r.verifyValue(t)
  22363. }
  22364. if (r && r.oneof) {
  22365. var o = this[r.oneof.name];
  22366. null !== t ? (null !== o && o !== r.name && (this[o] = null), this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  22367. }
  22368. return this
  22369. }, o.$set = o.set, o.get = function (e, t) {
  22370. if (t) return this[e];
  22371. var i = a._fieldsByName[e];
  22372. if (!(i && i instanceof u.Reflect.Message.Field)) throw Error(this + "#" + e + " is not a field: undefined");
  22373. if (!(i instanceof u.Reflect.Message.Field)) throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  22374. return this[i.name]
  22375. }, o.$get = o.get;
  22376. for (var e = 0; e < s.length; e++) {
  22377. var t = s[e];
  22378. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function (i) {
  22379. var e = i.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  22380. return e.toUpperCase().replace("_", "")
  22381. });
  22382. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  22383. function t(e, t) {
  22384. return this[i.name] = t ? e : i.verifyValue(e), this
  22385. }
  22386. function n() {
  22387. return this[i.name]
  22388. }
  22389. var r = i.originalName.replace(/([A-Z])/g, function (e) {
  22390. return "_" + e
  22391. });
  22392. null === a.getChild("set" + e) && (o["set" + e] = t), null === a.getChild("set_" + r) && (o["set_" + r] = t), null === a.getChild("get" + e) && (o["get" + e] = n), null === a.getChild("get_" + r) && (o["get_" + r] = n)
  22393. }(t)
  22394. }
  22395. return o.encode = function (t, e) {
  22396. "boolean" == typeof t && (e = t, t = void 0);
  22397. var i = !1;
  22398. t || (t = new I, i = !0);
  22399. var n = t.littleEndian;
  22400. try {
  22401. return a.encode(this, t.LE(), e), (i ? t.flip() : t).LE(n)
  22402. } catch (e) {
  22403. throw t.LE(n), e
  22404. }
  22405. }, c.encode = function (e, t, i) {
  22406. return new c(e).encode(t, i)
  22407. }, o.calculate = function () {
  22408. return a.calculate(this)
  22409. }, o.encodeDelimited = function (e, t) {
  22410. var i = !1;
  22411. e || (e = new I, i = !0);
  22412. var n = (new I).LE();
  22413. return a.encode(this, n, t).flip(), e.writeVarint32(n.remaining()), e.append(n), i ? e.flip() : e
  22414. }, o.encodeAB = function () {
  22415. try {
  22416. return this.encode().toArrayBuffer()
  22417. } catch (e) {
  22418. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e
  22419. }
  22420. }, o.toArrayBuffer = o.encodeAB, o.encodeNB = function () {
  22421. try {
  22422. return this.encode().toBuffer()
  22423. } catch (e) {
  22424. throw e.encoded && (e.encoded = e.encoded.toBuffer()), e
  22425. }
  22426. }, o.toBuffer = o.encodeNB, o.encode64 = function () {
  22427. try {
  22428. return this.encode().toBase64()
  22429. } catch (e) {
  22430. throw e.encoded && (e.encoded = e.encoded.toBase64()), e
  22431. }
  22432. }, o.toBase64 = o.encode64, o.encodeHex = function () {
  22433. try {
  22434. return this.encode().toHex()
  22435. } catch (e) {
  22436. throw e.encoded && (e.encoded = e.encoded.toHex()), e
  22437. }
  22438. }, o.toHex = o.encodeHex, o.toRaw = function (e, t) {
  22439. return d(this, !!e, !!t, this.$type)
  22440. }, o.encodeJSON = function () {
  22441. return JSON.stringify(d(this, !0, !0, this.$type))
  22442. }, c.decode = function (t, e, i) {
  22443. "string" == typeof e && (i = e, e = -1), "string" == typeof t && (t = I.wrap(t, i || "base64"));
  22444. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  22445. try {
  22446. var r = a.decode(t.LE());
  22447. return t.LE(n), r
  22448. } catch (e) {
  22449. throw t.LE(n), e
  22450. }
  22451. }, c.decodeDelimited = function (t, e) {
  22452. if ("string" == typeof t && (t = I.wrap(t, e || "base64")), (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1) return null;
  22453. var i = t.offset,
  22454. n = t.readVarint32();
  22455. if (t.remaining() < n) return t.offset = i, null;
  22456. try {
  22457. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  22458. return t.offset += n, r
  22459. } catch (e) {
  22460. throw t.offset += n, e
  22461. }
  22462. }, c.decode64 = function (e) {
  22463. return c.decode(e, "base64")
  22464. }, c.decodeHex = function (e) {
  22465. return c.decode(e, "hex")
  22466. }, c.decodeJSON = function (e) {
  22467. return new c(JSON.parse(e))
  22468. }, o.toString = function () {
  22469. return a.toString()
  22470. }, Object.defineProperty && (Object.defineProperty(c, "$options", {
  22471. value: a.buildOpt()
  22472. }), Object.defineProperty(o, "$options", {
  22473. value: c.$options
  22474. }), Object.defineProperty(c, "$type", {
  22475. value: a
  22476. }), Object.defineProperty(o, "$type", {
  22477. value: a
  22478. })), c
  22479. }(g, this);
  22480. this._fields = [], this._fieldsById = {}, this._fieldsByName = {};
  22481. for (var i, n = 0, r = this.children.length; n < r; n++)
  22482. if ((i = this.children[n]) instanceof p || i instanceof d || i instanceof y) {
  22483. if (t.hasOwnProperty(i.name)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  22484. t[i.name] = i.build()
  22485. } else if (i instanceof d.Field) i.build(), this._fields.push(i), this._fieldsById[i.id] = i, this._fieldsByName[i.name] = i;
  22486. else if (!(i instanceof d.OneOf || i instanceof v)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  22487. return this.clazz = t
  22488. }, n.encode = function (e, t, i) {
  22489. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a) r = e[(n = this._fields[a]).name], n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  22490. if (null === o) return t;
  22491. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  22492. throw l.encoded = t, l
  22493. }, n.calculate = function (e) {
  22494. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  22495. if (i = e[(t = this._fields[r]).name], t.required && null === i) throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  22496. n += t.calculate(i, e)
  22497. }
  22498. return n
  22499. }, n.decode = function (e, t, i) {
  22500. t = "number" == typeof t ? t : -1;
  22501. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining();) {
  22502. if (o = (n = e.readVarint32()) >>> 3, (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  22503. if (o !== i) throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  22504. break
  22505. }
  22506. if (a = this._fieldsById[o]) {
  22507. if (a.repeated && !a.options.packed) l[a.name].push(a.decode(r, e));
  22508. else if (a.map) {
  22509. var c = a.decode(r, e);
  22510. l[a.name].set(c[0], c[1])
  22511. } else if (l[a.name] = a.decode(r, e), a.oneof) {
  22512. var h = l[a.oneof.name];
  22513. null !== h && h !== a.name && (l[h] = null), l[a.oneof.name] = a.name
  22514. }
  22515. } else switch (r) {
  22516. case g.WIRE_TYPES.VARINT:
  22517. e.readVarint32();
  22518. break;
  22519. case g.WIRE_TYPES.BITS32:
  22520. e.offset += 4;
  22521. break;
  22522. case g.WIRE_TYPES.BITS64:
  22523. e.offset += 8;
  22524. break;
  22525. case g.WIRE_TYPES.LDELIM:
  22526. var u = e.readVarint32();
  22527. e.offset += u;
  22528. break;
  22529. case g.WIRE_TYPES.STARTGROUP:
  22530. for (; m(o, e););
  22531. break;
  22532. default:
  22533. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  22534. }
  22535. }
  22536. for (var d = 0, p = this._fields.length; d < p; ++d)
  22537. if (null === l[(a = this._fields[d]).name])
  22538. if ("proto3" === this.syntax) l[a.name] = a.defaultValue;
  22539. else {
  22540. if (a.required) {
  22541. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  22542. throw f.decoded = l, f
  22543. }
  22544. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  22545. } return l
  22546. }, s.Message = d;
  22547. function c(e, t, i, n, r, o, a, s, l, c) {
  22548. h.call(this, e, t, o), this.className = "Message.Field", this.required = "required" === i, this.repeated = "repeated" === i, this.map = "map" === i, this.keyType = n || null, this.type = r, this.resolvedType = null, this.id = a, this.options = s || {}, this.defaultValue = null, this.oneof = l || null, this.syntax = c || "proto2", this.originalName = this.name, this.element = null, this.keyElement = null, !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  22549. }
  22550. var r = c.prototype = Object.create(h.prototype);
  22551. r.build = function () {
  22552. this.element = new u(this.type, this.resolvedType, !1, this.syntax), this.map && (this.keyElement = new u(this.keyType, void 0, !0, this.syntax)), "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  22553. }, r.verifyValue = function (e, t) {
  22554. function i(e, t) {
  22555. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  22556. }
  22557. t = t || !1;
  22558. var n, r = this;
  22559. if (null === e) return this.required && i(typeof e, "required"), "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"), null;
  22560. if (!this.repeated || t) return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"), new g.Map(this, e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"), this.element.verifyValue(e));
  22561. Array.isArray(e) || (e = [e]);
  22562. var o = [];
  22563. for (n = 0; n < e.length; n++) o.push(this.element.verifyValue(e[n]));
  22564. return o
  22565. }, r.hasWirePresence = function (e, t) {
  22566. if ("proto3" !== this.syntax) return null !== e;
  22567. if (this.oneof && t[this.oneof.name] === this.name) return !0;
  22568. switch (this.type) {
  22569. case g.TYPES.int32:
  22570. case g.TYPES.sint32:
  22571. case g.TYPES.sfixed32:
  22572. case g.TYPES.uint32:
  22573. case g.TYPES.fixed32:
  22574. return 0 !== e;
  22575. case g.TYPES.int64:
  22576. case g.TYPES.sint64:
  22577. case g.TYPES.sfixed64:
  22578. case g.TYPES.uint64:
  22579. case g.TYPES.fixed64:
  22580. return 0 !== e.low || 0 !== e.high;
  22581. case g.TYPES.bool:
  22582. return e;
  22583. case g.TYPES.float:
  22584. case g.TYPES.double:
  22585. return 0 !== e;
  22586. case g.TYPES.string:
  22587. return 0 < e.length;
  22588. case g.TYPES.bytes:
  22589. return 0 < e.remaining();
  22590. case g.TYPES.enum:
  22591. return 0 !== e;
  22592. case g.TYPES.message:
  22593. return null !== e;
  22594. default:
  22595. return !0
  22596. }
  22597. }, r.encode = function (t, r, e) {
  22598. if (null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  22599. if (null === t || this.repeated && 0 == t.length) return r;
  22600. try {
  22601. var i;
  22602. if (this.repeated)
  22603. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  22604. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM), r.ensureCapacity(r.offset += 1);
  22605. var n = r.offset;
  22606. for (i = 0; i < t.length; i++) this.element.encodeValue(this.id, t[i], r);
  22607. var o = r.offset - n,
  22608. a = I.calculateVarint32(o);
  22609. if (1 < a) {
  22610. var s = r.slice(n, r.offset);
  22611. n += a - 1, r.offset = n, r.append(s)
  22612. }
  22613. r.writeVarint32(o, n - a)
  22614. } else
  22615. for (i = 0; i < t.length; i++) r.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, t[i], r);
  22616. else this.map ? t.forEach(function (e, t, i) {
  22617. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  22618. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM), r.writeVarint32(n), r.writeVarint32(8 | this.keyType.wireType), this.keyElement.encodeValue(1, t, r), r.writeVarint32(16 | this.type.wireType), this.element.encodeValue(2, e, r)
  22619. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, t, r))
  22620. } catch (e) {
  22621. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  22622. }
  22623. return r
  22624. }, r.calculate = function (t, e) {
  22625. if (t = this.verifyValue(t), null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  22626. if (null === t || this.repeated && 0 == t.length) return 0;
  22627. var r = 0;
  22628. try {
  22629. var i, n;
  22630. if (this.repeated)
  22631. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  22632. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM), i = n = 0; i < t.length; i++) n += this.element.calculateLength(this.id, t[i]);
  22633. r += I.calculateVarint32(n), r += n
  22634. } else
  22635. for (i = 0; i < t.length; i++) r += I.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, t[i]);
  22636. else this.map ? t.forEach(function (e, t, i) {
  22637. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  22638. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM), r += I.calculateVarint32(n), r += n
  22639. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, t))
  22640. } catch (e) {
  22641. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  22642. }
  22643. return r
  22644. }, r.decode = function (e, t, i) {
  22645. var n, r;
  22646. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM)) throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  22647. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  22648. r = t.readVarint32(), r = t.offset + r;
  22649. for (var o = []; t.offset < r;) o.push(this.decode(this.type.wireType, t, !0));
  22650. return o
  22651. }
  22652. if (this.map) {
  22653. var a = u.defaultFieldValue(this.keyType);
  22654. if (n = u.defaultFieldValue(this.type), r = t.readVarint32(), t.remaining() < r) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  22655. var s = t.clone();
  22656. for (s.limit = s.offset + r, t.offset += r; 0 < s.remaining();) {
  22657. var l = s.readVarint32();
  22658. e = 7 & l;
  22659. var c = l >>> 3;
  22660. if (1 == c) a = this.keyElement.decode(s, e, c);
  22661. else {
  22662. if (2 != c) throw Error("Unexpected tag in map field key/value submessage");
  22663. n = this.element.decode(s, e, c)
  22664. }
  22665. }
  22666. return [a, n]
  22667. }
  22668. return this.element.decode(t, e, this.id)
  22669. }, s.Message.Field = c;
  22670. function o(e, t, i, n, r, o, a) {
  22671. c.call(this, e, t, i, null, n, r, o, a), this.extension
  22672. }
  22673. o.prototype = Object.create(c.prototype), s.Message.ExtensionField = o;
  22674. s.Message.OneOf = function (e, t, i) {
  22675. h.call(this, e, t, i), this.fields = []
  22676. };
  22677. var p = function (e, t, i, n, r) {
  22678. l.call(this, e, t, i, n, r), this.className = "Enum", this.object = null
  22679. };
  22680. p.getName = function (e, t) {
  22681. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  22682. if (e[i = n[r]] === t) return i;
  22683. return null
  22684. }, (p.prototype = Object.create(l.prototype)).build = function (e) {
  22685. if (this.object && !e) return this.object;
  22686. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n) t[i[n].name] = i[n].id;
  22687. return Object.defineProperty && Object.defineProperty(t, "$options", {
  22688. value: this.buildOpt(),
  22689. enumerable: !1
  22690. }), this.object = t
  22691. }, s.Enum = p;
  22692. function f(e, t, i, n) {
  22693. h.call(this, e, t, i), this.className = "Enum.Value", this.id = n
  22694. }
  22695. f.prototype = Object.create(h.prototype), s.Enum.Value = f;
  22696. var v = function (e, t, i, n) {
  22697. h.call(this, e, t, i), this.field = n
  22698. };
  22699. v.prototype = Object.create(h.prototype), s.Extension = v;
  22700. var y = function (e, t, i, n) {
  22701. l.call(this, e, t, i, n), this.className = "Service", this.clazz = null
  22702. };
  22703. (y.prototype = Object.create(l.prototype)).build = function (e) {
  22704. return this.clazz && !e ? this.clazz : this.clazz = function (t, r) {
  22705. for (var o = function (e) {
  22706. t.Builder.Service.call(this), this.rpcImpl = e || function (e, t, i) {
  22707. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  22708. }
  22709. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++) ! function (n) {
  22710. e[n.name] = function (e, i) {
  22711. try {
  22712. try {
  22713. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  22714. } catch (e) {
  22715. if (!(e instanceof TypeError)) throw e
  22716. }
  22717. if (null === e || "object" != typeof e) throw Error("Illegal arguments");
  22718. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)), this.rpcImpl(n.fqn(), e, function (e, t) {
  22719. if (!e) {
  22720. null === t && (t = "");
  22721. try {
  22722. t = n.resolvedResponseType.clazz.decode(t)
  22723. } catch (e) {}
  22724. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  22725. }
  22726. i(e)
  22727. })
  22728. } catch (e) {
  22729. setTimeout(i.bind(this, e), 0)
  22730. }
  22731. }, o[n.name] = function (e, t, i) {
  22732. new o(e)[n.name](t, i)
  22733. }, Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  22734. value: n.buildOpt()
  22735. }), Object.defineProperty(e[n.name], "$options", {
  22736. value: o[n.name].$options
  22737. }))
  22738. }(i[n]);
  22739. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  22740. value: r.buildOpt()
  22741. }), Object.defineProperty(e, "$options", {
  22742. value: o.$options
  22743. }), Object.defineProperty(o, "$type", {
  22744. value: r
  22745. }), Object.defineProperty(e, "$type", {
  22746. value: r
  22747. })), o
  22748. }(g, this)
  22749. }, s.Service = y;
  22750. function A(e, t, i, n) {
  22751. h.call(this, e, t, i), this.className = "Service.Method", this.options = n || {}
  22752. }(A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt, s.Service.Method = A;
  22753. function C(e, t, i, n, r, o, a, s) {
  22754. A.call(this, e, t, i, s), this.className = "Service.RPCMethod", this.requestName = n, this.responseName = r, this.requestStream = o, this.responseStream = a, this.resolvedRequestType = null, this.resolvedResponseType = null
  22755. }
  22756. return C.prototype = Object.create(A.prototype), s.Service.RPCMethod = C, s
  22757. }(o), o.Builder = (i = (u = o).Lang, s = o.Reflect, n = h.prototype, h.isMessage = function (e) {
  22758. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  22759. }, h.isMessageField = function (e) {
  22760. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  22761. }, h.isEnum = function (e) {
  22762. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  22763. }, h.isService = function (e) {
  22764. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  22765. }, h.isExtend = function (e) {
  22766. return "string" == typeof e.ref
  22767. }, n.reset = function () {
  22768. return this.ptr = this.ns, this
  22769. }, n.define = function (e) {
  22770. if ("string" != typeof e || !i.TYPEREF.test(e)) throw Error("illegal namespace: " + e);
  22771. return e.split(".").forEach(function (e) {
  22772. var t = this.ptr.getChild(e);
  22773. null === t && this.ptr.addChild(t = new s.Namespace(this, this.ptr, e)), this.ptr = t
  22774. }, this), this
  22775. }, n.create = function (e) {
  22776. if (!e) return this;
  22777. if (Array.isArray(e)) {
  22778. if (0 === e.length) return this;
  22779. e = e.slice()
  22780. } else e = [e];
  22781. for (var t = [e]; 0 < t.length;) {
  22782. if (e = t.pop(), !Array.isArray(e)) throw Error("not a valid namespace: " + JSON.stringify(e));
  22783. for (; 0 < e.length;) {
  22784. var i = e.shift();
  22785. if (h.isMessage(i)) {
  22786. var o = new s.Message(this, this.ptr, i.name, i.options, i.isGroup, i.syntax),
  22787. n = {};
  22788. i.oneofs && Object.keys(i.oneofs).forEach(function (e) {
  22789. o.addChild(n[e] = new s.Message.OneOf(this, o, e))
  22790. }, this), i.fields && i.fields.forEach(function (e) {
  22791. if (null !== o.getChild(0 | e.id)) throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  22792. if (e.options && "object" != typeof e.options) throw Error("illegal field options in " + o.name + "#" + e.name);
  22793. var t = null;
  22794. if ("string" == typeof e.oneof && !(t = n[e.oneof])) throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  22795. e = new s.Message.Field(this, o, e.rule, e.keytype, e.type, e.name, e.id, e.options, t, i.syntax), t && t.fields.push(e), o.addChild(e)
  22796. }, this);
  22797. var r = [];
  22798. if (i.enums && i.enums.forEach(function (e) {
  22799. r.push(e)
  22800. }), i.messages && i.messages.forEach(function (e) {
  22801. r.push(e)
  22802. }), i.services && i.services.forEach(function (e) {
  22803. r.push(e)
  22804. }), i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions), this.ptr.addChild(o), 0 < r.length) {
  22805. t.push(e), e = r, r = null, this.ptr = o, o = null;
  22806. continue
  22807. }
  22808. r = null
  22809. } else if (h.isEnum(i)) o = new s.Enum(this, this.ptr, i.name, i.options, i.syntax), i.values.forEach(function (e) {
  22810. o.addChild(new s.Enum.Value(this, o, e.name, e.id))
  22811. }, this), this.ptr.addChild(o);
  22812. else if (h.isService(i)) o = new s.Service(this, this.ptr, i.name, i.options), Object.keys(i.rpc).forEach(function (e) {
  22813. var t = i.rpc[e];
  22814. o.addChild(new s.Service.RPCMethod(this, o, e, t.request, t.response, !!t.request_stream, !!t.response_stream, t.options))
  22815. }, this), this.ptr.addChild(o);
  22816. else {
  22817. if (!h.isExtend(i)) throw Error("not a valid definition: " + JSON.stringify(i));
  22818. if (o = this.ptr.resolve(i.ref, !0)) i.fields.forEach(function (t) {
  22819. if (null !== o.getChild(0 | t.id)) throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  22820. if (o.extensions) {
  22821. var i = !1;
  22822. if (o.extensions.forEach(function (e) {
  22823. t.id >= e[0] && t.id <= e[1] && (i = !0)
  22824. }), !i) throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  22825. }
  22826. var e = t.name;
  22827. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  22828. var n = new s.Message.ExtensionField(this, o, t.rule, t.type, this.ptr.fqn() + "." + e, t.id, t.options),
  22829. r = new s.Extension(this, this.ptr, t.name, n);
  22830. n.extension = r, this.ptr.addChild(r), o.addChild(n)
  22831. }, this);
  22832. else if (!/\.?google\.protobuf\./.test(i.ref)) throw Error("extended message " + i.ref + " is not defined")
  22833. }
  22834. o = i = null
  22835. }
  22836. e = null, this.ptr = this.ptr.parent
  22837. }
  22838. return this.resolved = !1, this.result = null, this
  22839. }, n.import = function (t, e) {
  22840. var i = "/";
  22841. if ("string" == typeof e) {
  22842. if (u.Util.IS_NODE && (e = p("path").resolve(e)), !0 === this.files[e]) return this.reset();
  22843. this.files[e] = !0
  22844. } else if ("object" == typeof e) {
  22845. var n = e.root;
  22846. u.Util.IS_NODE && (n = p("path").resolve(n)), (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  22847. var r = n + i + e.file;
  22848. if (!0 === this.files[r]) return this.reset();
  22849. this.files[r] = !0
  22850. }
  22851. if (t.imports && 0 < t.imports.length) {
  22852. var o, a = !1;
  22853. "object" == typeof e ? (this.importRoot = e.root, a = !0, o = this.importRoot, e = e.file, (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""), i = "\\") : o = "." : o = null;
  22854. for (var s = 0; s < t.imports.length; s++)
  22855. if ("string" == typeof t.imports[s]) {
  22856. if (!o) throw Error("cannot determine import root");
  22857. var l = t.imports[s];
  22858. if ("google/protobuf/descriptor.proto" === l) continue;
  22859. if (l = o + i + l, !0 === this.files[l]) continue;
  22860. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  22861. var c = u.Util.fetch(l);
  22862. if (null === c) throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  22863. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  22864. } else e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  22865. return t + "_import" + s + "." + i
  22866. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  22867. a && (this.importRoot = null)
  22868. }
  22869. t.package && this.define(t.package), t.syntax && function t(i) {
  22870. i.messages && i.messages.forEach(function (e) {
  22871. e.syntax = i.syntax, t(e)
  22872. }), i.enums && i.enums.forEach(function (e) {
  22873. e.syntax = i.syntax
  22874. })
  22875. }(t);
  22876. var h = this.ptr;
  22877. return t.options && Object.keys(t.options).forEach(function (e) {
  22878. h.options[e] = t.options[e]
  22879. }), t.messages && (this.create(t.messages), this.ptr = h), t.enums && (this.create(t.enums), this.ptr = h), t.services && (this.create(t.services), this.ptr = h), t.extends && this.create(t.extends), this.reset()
  22880. }, n.resolveAll = function () {
  22881. var e;
  22882. if (null == this.ptr || "object" == typeof this.ptr.type) return this;
  22883. if (this.ptr instanceof s.Namespace) this.ptr.children.forEach(function (e) {
  22884. this.ptr = e, this.resolveAll()
  22885. }, this);
  22886. else if (this.ptr instanceof s.Message.Field) {
  22887. if (i.TYPE.test(this.ptr.type)) this.ptr.type = u.TYPES[this.ptr.type];
  22888. else {
  22889. if (!i.TYPEREF.test(this.ptr.type)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  22890. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0))) throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  22891. if ((this.ptr.resolvedType = e) instanceof s.Enum) {
  22892. if (this.ptr.type = u.TYPES.enum, "proto3" === this.ptr.syntax && "proto3" !== e.syntax) throw Error("proto3 message cannot reference proto2 enum")
  22893. } else {
  22894. if (!(e instanceof s.Message)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  22895. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  22896. }
  22897. }
  22898. if (this.ptr.map) {
  22899. if (!i.TYPE.test(this.ptr.keyType)) throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  22900. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  22901. }
  22902. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  22903. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod)) throw Error("illegal service type in " + this.ptr.toString(!0));
  22904. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  22905. if (this.ptr.resolvedRequestType = e, !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  22906. this.ptr.resolvedResponseType = e
  22907. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value)) throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  22908. return this.reset()
  22909. }, n.build = function (e) {
  22910. if (this.reset(), this.resolved || (this.resolveAll(), this.resolved = !0, this.result = null), null === this.result && (this.result = this.ns.build()), !e) return this.result;
  22911. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  22912. if (!i[t[n]]) {
  22913. i = null;
  22914. break
  22915. }
  22916. i = i[t[n]]
  22917. }
  22918. return i
  22919. }, n.lookup = function (e, t) {
  22920. return e ? this.ns.resolve(e, t) : this.ns
  22921. }, n.toString = function () {
  22922. return "Builder"
  22923. }, h.Message = function () {}, h.Enum = function () {}, h.Service = function () {}, h), o.Map = (a = o.Reflect, (t = c.prototype).clear = function () {
  22924. this.map = {}
  22925. }, t.delete = function (e) {
  22926. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  22927. i = t in this.map;
  22928. return delete this.map[t], i
  22929. }, t.entries = function () {
  22930. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++) t.push([(e = this.map[i[n]]).key, e.value]);
  22931. return l(t)
  22932. }, t.keys = function () {
  22933. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++) e.push(this.map[t[i]].key);
  22934. return l(e)
  22935. }, t.values = function () {
  22936. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++) e.push(this.map[t[i]].value);
  22937. return l(e)
  22938. }, t.forEach = function (e, t) {
  22939. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++) e.call(t, (i = this.map[n[r]]).value, i.key, this)
  22940. }, t.set = function (e, t) {
  22941. var i = this.keyElem.verifyValue(e),
  22942. n = this.valueElem.verifyValue(t);
  22943. return this.map[this.keyElem.valueToString(i)] = {
  22944. key: i,
  22945. value: n
  22946. }, this
  22947. }, t.get = function (e) {
  22948. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  22949. if (t in this.map) return this.map[t].value
  22950. }, t.has = function (e) {
  22951. return this.keyElem.valueToString(this.keyElem.verifyValue(e)) in this.map
  22952. }, c), o.loadProto = function (e, t, i) {
  22953. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t, t = void 0), o.loadJson(o.DotProto.Parser.parse(e), t, i)
  22954. }, o.protoFromString = o.loadProto, o.loadProtoFile = function (t, i, n) {
  22955. if (i && "object" == typeof i ? (n = i, i = null) : i && "function" == typeof i || (i = null), i) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function (e) {
  22956. if (null !== e) try {
  22957. i(null, o.loadProto(e, n, t))
  22958. } catch (e) {
  22959. i(e)
  22960. } else i(Error("Failed to fetch file"))
  22961. });
  22962. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  22963. return null === e ? null : o.loadProto(e, n, t)
  22964. }, o.protoFromFile = o.loadProtoFile, o.newBuilder = function (e) {
  22965. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase), void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors), new o.Builder(e)
  22966. }, o.loadJson = function (e, t, i) {
  22967. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t, t = null), t && "object" == typeof t || (t = o.newBuilder()), "string" == typeof e && (e = JSON.parse(e)), t.import(e, i), t.resolveAll(), t
  22968. }, o.loadJsonFile = function (t, i, n) {
  22969. if (i && "object" == typeof i ? (n = i, i = null) : i && "function" == typeof i || (i = null), i) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function (e) {
  22970. if (null !== e) try {
  22971. i(null, o.loadJson(JSON.parse(e), n, t))
  22972. } catch (e) {
  22973. i(e)
  22974. } else i(Error("Failed to fetch file"))
  22975. });
  22976. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  22977. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  22978. }, o;
  22979. function l(e) {
  22980. var t = 0;
  22981. return {
  22982. next: function () {
  22983. return t < e.length ? {
  22984. done: !1,
  22985. value: e[t++]
  22986. } : {
  22987. done: !0
  22988. }
  22989. }
  22990. }
  22991. }
  22992. function c(e, t) {
  22993. if (!e.map) throw Error("field is not a map");
  22994. if (this.field = e, this.keyElem = new a.Element(e.keyType, null, !0, e.syntax), this.valueElem = new a.Element(e.type, e.resolvedType, !1, e.syntax), this.map = {}, Object.defineProperty(this, "size", {
  22995. get: function () {
  22996. return Object.keys(this.map).length
  22997. }
  22998. }), t)
  22999. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  23000. var r = this.keyElem.valueFromString(i[n]),
  23001. o = this.valueElem.verifyValue(t[i[n]]);
  23002. this.map[this.keyElem.valueToString(r)] = {
  23003. key: r,
  23004. value: o
  23005. }
  23006. }
  23007. }
  23008. function h(e) {
  23009. this.ns = new s.Namespace(this, null, ""), this.ptr = this.ns, this.resolved = !1, this.result = null, this.files = {}, this.importRoot = null, this.options = e || {}
  23010. }
  23011. }, "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  23012. }).call(this, p("_process"))
  23013. }, {
  23014. _process: 203,
  23015. bytebuffer: 215,
  23016. fs: 197,
  23017. path: 197
  23018. }],
  23019. 215: [function (t, e, i) {
  23020. var n, r;
  23021. n = this, r = function (l) {
  23022. "use strict";
  23023. function s(e) {
  23024. var t = 0;
  23025. return function () {
  23026. return t < e.length ? e.charCodeAt(t++) : null
  23027. }
  23028. }
  23029. function c() {
  23030. var e = [],
  23031. t = [];
  23032. return function () {
  23033. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)), e.length = 0), void Array.prototype.push.apply(e, arguments))
  23034. }
  23035. }
  23036. function n(e, t, i, n, r) {
  23037. var o, a, s = 8 * r - n - 1,
  23038. l = (1 << s) - 1,
  23039. c = l >> 1,
  23040. h = -7,
  23041. u = i ? r - 1 : 0,
  23042. d = i ? -1 : 1,
  23043. p = e[t + u];
  23044. for (u += d, o = p & (1 << -h) - 1, p >>= -h, h += s; 0 < h; o = 256 * o + e[t + u], u += d, h -= 8);
  23045. for (a = o & (1 << -h) - 1, o >>= -h, h += n; 0 < h; a = 256 * a + e[t + u], u += d, h -= 8);
  23046. if (0 === o) o = 1 - c;
  23047. else {
  23048. if (o === l) return a ? NaN : 1 / 0 * (p ? -1 : 1);
  23049. a += Math.pow(2, n), o -= c
  23050. }
  23051. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  23052. }
  23053. function r(e, t, i, n, r, o) {
  23054. var a, s, l, c = 8 * o - r - 1,
  23055. h = (1 << c) - 1,
  23056. u = h >> 1,
  23057. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  23058. p = n ? 0 : o - 1,
  23059. f = n ? 1 : -1,
  23060. g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  23061. for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0, a = h) : (a = Math.floor(Math.log(t) / Math.LN2), t * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++, l /= 2), h <= a + u ? (s = 0, a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r), a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r), a = 0)); 8 <= r; e[i + p] = 255 & s, p += f, s /= 256, r -= 8);
  23062. for (a = a << r | s, c += r; 0 < c; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  23063. e[i + p - f] |= 128 * g
  23064. }
  23065. var f = function (e, t, i) {
  23066. if (void 0 === e && (e = f.DEFAULT_CAPACITY), void 0 === t && (t = f.DEFAULT_ENDIAN), void 0 === i && (i = f.DEFAULT_NOASSERT), !i) {
  23067. if ((e |= 0) < 0) throw RangeError("Illegal capacity");
  23068. t = !!t, i = !!i
  23069. }
  23070. this.buffer = 0 === e ? o : new ArrayBuffer(e), this.view = 0 === e ? null : new Uint8Array(this.buffer), this.offset = 0, this.markedOffset = -1, this.limit = e, this.littleEndian = t, this.noAssert = i
  23071. };
  23072. f.VERSION = "5.0.1", f.LITTLE_ENDIAN = !0, f.BIG_ENDIAN = !1, f.DEFAULT_CAPACITY = 16, f.DEFAULT_ENDIAN = f.BIG_ENDIAN, f.DEFAULT_NOASSERT = !1, f.Long = l || null;
  23073. var a = f.prototype;
  23074. a.__isByteBuffer__, Object.defineProperty(a, "__isByteBuffer__", {
  23075. value: !0,
  23076. enumerable: !1,
  23077. configurable: !1
  23078. });
  23079. var o = new ArrayBuffer(0),
  23080. i = String.fromCharCode;
  23081. f.accessor = function () {
  23082. return Uint8Array
  23083. }, f.allocate = function (e, t, i) {
  23084. return new f(e, t, i)
  23085. }, f.concat = function (e, t, i, n) {
  23086. "boolean" != typeof t && "string" == typeof t || (n = i, i = t, t = void 0);
  23087. for (var r, o = 0, a = 0, s = e.length; a < s; ++a) f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)), 0 < (r = e[a].limit - e[a].offset) && (o += r);
  23088. if (0 === o) return new f(0, i, n);
  23089. var l, c = new f(o, i, n);
  23090. for (a = 0; a < s;)(r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset), c.offset += r);
  23091. return c.limit = c.offset, c.offset = 0, c
  23092. }, f.isByteBuffer = function (e) {
  23093. return !0 === (e && e.__isByteBuffer__)
  23094. }, f.type = function () {
  23095. return ArrayBuffer
  23096. }, f.wrap = function (e, t, i, n) {
  23097. if ("string" != typeof t && (n = i, i = t, t = void 0), "string" == typeof e) switch (void 0 === t && (t = "utf8"), t) {
  23098. case "base64":
  23099. return f.fromBase64(e, i);
  23100. case "hex":
  23101. return f.fromHex(e, i);
  23102. case "binary":
  23103. return f.fromBinary(e, i);
  23104. case "utf8":
  23105. return f.fromUTF8(e, i);
  23106. case "debug":
  23107. return f.fromDebug(e, i);
  23108. default:
  23109. throw Error("Unsupported encoding: " + t)
  23110. }
  23111. if (null === e || "object" != typeof e) throw TypeError("Illegal buffer");
  23112. var r;
  23113. if (f.isByteBuffer(e)) return (r = a.clone.call(e)).markedOffset = -1, r;
  23114. if (e instanceof Uint8Array) r = new f(0, i, n), 0 < e.length && (r.buffer = e.buffer, r.offset = e.byteOffset, r.limit = e.byteOffset + e.byteLength, r.view = new Uint8Array(e.buffer));
  23115. else if (e instanceof ArrayBuffer) r = new f(0, i, n), 0 < e.byteLength && (r.buffer = e, r.offset = 0, r.limit = e.byteLength, r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  23116. else {
  23117. if ("[object Array]" !== Object.prototype.toString.call(e)) throw TypeError("Illegal buffer");
  23118. (r = new f(e.length, i, n)).limit = e.length;
  23119. for (var o = 0; o < e.length; ++o) r.view[o] = e[o]
  23120. }
  23121. return r
  23122. }, a.writeBitSet = function (e, t) {
  23123. var i = void 0 === t;
  23124. if (i && (t = this.offset), !this.noAssert) {
  23125. if (!(e instanceof Array)) throw TypeError("Illegal BitSet: Not an array");
  23126. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23127. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23128. }
  23129. var n, r = t,
  23130. o = e.length,
  23131. a = o >> 3,
  23132. s = 0;
  23133. for (t += this.writeVarint32(o, t); a--;) 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, this.writeByte(n, t++);
  23134. if (s < o) {
  23135. var l = 0;
  23136. for (n = 0; s < o;) n |= (1 & !!e[s++]) << l++;
  23137. this.writeByte(n, t++)
  23138. }
  23139. return i ? (this.offset = t, this) : t - r
  23140. }, a.readBitSet = function (e) {
  23141. var t = void 0 === e;
  23142. t && (e = this.offset);
  23143. var i, n = this.readVarint32(e),
  23144. r = n.value,
  23145. o = r >> 3,
  23146. a = 0,
  23147. s = [];
  23148. for (e += n.length; o--;) i = this.readByte(e++), s[a++] = !!(1 & i), s[a++] = !!(2 & i), s[a++] = !!(4 & i), s[a++] = !!(8 & i), s[a++] = !!(16 & i), s[a++] = !!(32 & i), s[a++] = !!(64 & i), s[a++] = !!(128 & i);
  23149. if (a < r) {
  23150. var l = 0;
  23151. for (i = this.readByte(e++); a < r;) s[a++] = !!(i >> l++ & 1)
  23152. }
  23153. return t && (this.offset = e), s
  23154. }, a.readBytes = function (e, t) {
  23155. var i = void 0 === t;
  23156. if (i && (t = this.offset), !this.noAssert) {
  23157. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23158. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  23159. }
  23160. var n = this.slice(t, t + e);
  23161. return i && (this.offset += e), n
  23162. }, a.writeBytes = a.append, a.writeInt8 = function (e, t) {
  23163. var i = void 0 === t;
  23164. if (i && (t = this.offset), !this.noAssert) {
  23165. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23166. if (e |= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23167. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23168. }
  23169. t += 1;
  23170. var n = this.buffer.byteLength;
  23171. return n < t && this.resize((n *= 2) > t ? n : t), t -= 1, this.view[t] = e, i && (this.offset += 1), this
  23172. }, a.writeByte = a.writeInt8, a.readInt8 = function (e) {
  23173. var t = void 0 === e;
  23174. if (t && (e = this.offset), !this.noAssert) {
  23175. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23176. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  23177. }
  23178. var i = this.view[e];
  23179. return 128 == (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i
  23180. }, a.readByte = a.readInt8, a.writeUint8 = function (e, t) {
  23181. var i = void 0 === t;
  23182. if (i && (t = this.offset), !this.noAssert) {
  23183. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23184. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23185. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23186. }
  23187. t += 1;
  23188. var n = this.buffer.byteLength;
  23189. return n < t && this.resize((n *= 2) > t ? n : t), t -= 1, this.view[t] = e, i && (this.offset += 1), this
  23190. }, a.writeUInt8 = a.writeUint8, a.readUint8 = function (e) {
  23191. var t = void 0 === e;
  23192. if (t && (e = this.offset), !this.noAssert) {
  23193. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23194. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  23195. }
  23196. var i = this.view[e];
  23197. return t && (this.offset += 1), i
  23198. }, a.readUInt8 = a.readUint8, a.writeInt16 = function (e, t) {
  23199. var i = void 0 === t;
  23200. if (i && (t = this.offset), !this.noAssert) {
  23201. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23202. if (e |= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23203. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23204. }
  23205. t += 2;
  23206. var n = this.buffer.byteLength;
  23207. return n < t && this.resize((n *= 2) > t ? n : t), t -= 2, this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8, this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8, this.view[t + 1] = 255 & e), i && (this.offset += 2), this
  23208. }, a.writeShort = a.writeInt16, a.readInt16 = function (e) {
  23209. var t = void 0 === e;
  23210. if (t && (e = this.offset), !this.noAssert) {
  23211. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23212. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  23213. }
  23214. var i = 0;
  23215. return this.littleEndian ? (i = this.view[e], i |= this.view[e + 1] << 8) : (i = this.view[e] << 8, i |= this.view[e + 1]), 32768 == (32768 & i) && (i = -(65535 - i + 1)), t && (this.offset += 2), i
  23216. }, a.readShort = a.readInt16, a.writeUint16 = function (e, t) {
  23217. var i = void 0 === t;
  23218. if (i && (t = this.offset), !this.noAssert) {
  23219. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23220. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23221. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23222. }
  23223. t += 2;
  23224. var n = this.buffer.byteLength;
  23225. return n < t && this.resize((n *= 2) > t ? n : t), t -= 2, this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8, this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8, this.view[t + 1] = 255 & e), i && (this.offset += 2), this
  23226. }, a.writeUInt16 = a.writeUint16, a.readUint16 = function (e) {
  23227. var t = void 0 === e;
  23228. if (t && (e = this.offset), !this.noAssert) {
  23229. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23230. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  23231. }
  23232. var i = 0;
  23233. return this.littleEndian ? (i = this.view[e], i |= this.view[e + 1] << 8) : (i = this.view[e] << 8, i |= this.view[e + 1]), t && (this.offset += 2), i
  23234. }, a.readUInt16 = a.readUint16, a.writeInt32 = function (e, t) {
  23235. var i = void 0 === t;
  23236. if (i && (t = this.offset), !this.noAssert) {
  23237. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23238. if (e |= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23239. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23240. }
  23241. t += 4;
  23242. var n = this.buffer.byteLength;
  23243. return n < t && this.resize((n *= 2) > t ? n : t), t -= 4, this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255, this.view[t + 2] = e >>> 16 & 255, this.view[t + 1] = e >>> 8 & 255, this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255, this.view[t + 1] = e >>> 16 & 255, this.view[t + 2] = e >>> 8 & 255, this.view[t + 3] = 255 & e), i && (this.offset += 4), this
  23244. }, a.writeInt = a.writeInt32, a.readInt32 = function (e) {
  23245. var t = void 0 === e;
  23246. if (t && (e = this.offset), !this.noAssert) {
  23247. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23248. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  23249. }
  23250. var i = 0;
  23251. return this.littleEndian ? (i = this.view[e + 2] << 16, i |= this.view[e + 1] << 8, i |= this.view[e], i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16, i |= this.view[e + 2] << 8, i |= this.view[e + 3], i += this.view[e] << 24 >>> 0), i |= 0, t && (this.offset += 4), i
  23252. }, a.readInt = a.readInt32, a.writeUint32 = function (e, t) {
  23253. var i = void 0 === t;
  23254. if (i && (t = this.offset), !this.noAssert) {
  23255. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23256. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23257. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23258. }
  23259. t += 4;
  23260. var n = this.buffer.byteLength;
  23261. return n < t && this.resize((n *= 2) > t ? n : t), t -= 4, this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255, this.view[t + 2] = e >>> 16 & 255, this.view[t + 1] = e >>> 8 & 255, this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255, this.view[t + 1] = e >>> 16 & 255, this.view[t + 2] = e >>> 8 & 255, this.view[t + 3] = 255 & e), i && (this.offset += 4), this
  23262. }, a.writeUInt32 = a.writeUint32, a.readUint32 = function (e) {
  23263. var t = void 0 === e;
  23264. if (t && (e = this.offset), !this.noAssert) {
  23265. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23266. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  23267. }
  23268. var i = 0;
  23269. return this.littleEndian ? (i = this.view[e + 2] << 16, i |= this.view[e + 1] << 8, i |= this.view[e], i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16, i |= this.view[e + 2] << 8, i |= this.view[e + 3], i += this.view[e] << 24 >>> 0), t && (this.offset += 4), i
  23270. }, a.readUInt32 = a.readUint32, l && (a.writeInt64 = function (e, t) {
  23271. var i = void 0 === t;
  23272. if (i && (t = this.offset), !this.noAssert) {
  23273. if ("number" == typeof e) e = l.fromNumber(e);
  23274. else if ("string" == typeof e) e = l.fromString(e);
  23275. else if (!(e && e instanceof l)) throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  23276. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23277. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23278. }
  23279. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)), t += 8;
  23280. var n = this.buffer.byteLength;
  23281. n < t && this.resize((n *= 2) > t ? n : t), t -= 8;
  23282. var r = e.low,
  23283. o = e.high;
  23284. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255, this.view[t + 2] = r >>> 16 & 255, this.view[t + 1] = r >>> 8 & 255, this.view[t] = 255 & r, t += 4, this.view[t + 3] = o >>> 24 & 255, this.view[t + 2] = o >>> 16 & 255, this.view[t + 1] = o >>> 8 & 255, this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255, this.view[t + 1] = o >>> 16 & 255, this.view[t + 2] = o >>> 8 & 255, this.view[t + 3] = 255 & o, t += 4, this.view[t] = r >>> 24 & 255, this.view[t + 1] = r >>> 16 & 255, this.view[t + 2] = r >>> 8 & 255, this.view[t + 3] = 255 & r), i && (this.offset += 8), this
  23285. }, a.writeLong = a.writeInt64, a.readInt64 = function (e) {
  23286. var t = void 0 === e;
  23287. if (t && (e = this.offset), !this.noAssert) {
  23288. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23289. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  23290. }
  23291. var i = 0,
  23292. n = 0;
  23293. this.littleEndian ? (i = this.view[e + 2] << 16, i |= this.view[e + 1] << 8, i |= this.view[e], i += this.view[e + 3] << 24 >>> 0, e += 4, n = this.view[e + 2] << 16, n |= this.view[e + 1] << 8, n |= this.view[e], n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16, n |= this.view[e + 2] << 8, n |= this.view[e + 3], n += this.view[e] << 24 >>> 0, e += 4, i = this.view[e + 1] << 16, i |= this.view[e + 2] << 8, i |= this.view[e + 3], i += this.view[e] << 24 >>> 0);
  23294. var r = new l(i, n, !1);
  23295. return t && (this.offset += 8), r
  23296. }, a.readLong = a.readInt64, a.writeUint64 = function (e, t) {
  23297. var i = void 0 === t;
  23298. if (i && (t = this.offset), !this.noAssert) {
  23299. if ("number" == typeof e) e = l.fromNumber(e);
  23300. else if ("string" == typeof e) e = l.fromString(e);
  23301. else if (!(e && e instanceof l)) throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  23302. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23303. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23304. }
  23305. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)), t += 8;
  23306. var n = this.buffer.byteLength;
  23307. n < t && this.resize((n *= 2) > t ? n : t), t -= 8;
  23308. var r = e.low,
  23309. o = e.high;
  23310. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255, this.view[t + 2] = r >>> 16 & 255, this.view[t + 1] = r >>> 8 & 255, this.view[t] = 255 & r, t += 4, this.view[t + 3] = o >>> 24 & 255, this.view[t + 2] = o >>> 16 & 255, this.view[t + 1] = o >>> 8 & 255, this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255, this.view[t + 1] = o >>> 16 & 255, this.view[t + 2] = o >>> 8 & 255, this.view[t + 3] = 255 & o, t += 4, this.view[t] = r >>> 24 & 255, this.view[t + 1] = r >>> 16 & 255, this.view[t + 2] = r >>> 8 & 255, this.view[t + 3] = 255 & r), i && (this.offset += 8), this
  23311. }, a.writeUInt64 = a.writeUint64, a.readUint64 = function (e) {
  23312. var t = void 0 === e;
  23313. if (t && (e = this.offset), !this.noAssert) {
  23314. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23315. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  23316. }
  23317. var i = 0,
  23318. n = 0;
  23319. this.littleEndian ? (i = this.view[e + 2] << 16, i |= this.view[e + 1] << 8, i |= this.view[e], i += this.view[e + 3] << 24 >>> 0, e += 4, n = this.view[e + 2] << 16, n |= this.view[e + 1] << 8, n |= this.view[e], n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16, n |= this.view[e + 2] << 8, n |= this.view[e + 3], n += this.view[e] << 24 >>> 0, e += 4, i = this.view[e + 1] << 16, i |= this.view[e + 2] << 8, i |= this.view[e + 3], i += this.view[e] << 24 >>> 0);
  23320. var r = new l(i, n, !0);
  23321. return t && (this.offset += 8), r
  23322. }, a.readUInt64 = a.readUint64), a.writeFloat32 = function (e, t) {
  23323. var i = void 0 === t;
  23324. if (i && (t = this.offset), !this.noAssert) {
  23325. if ("number" != typeof e) throw TypeError("Illegal value: " + e + " (not a number)");
  23326. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23327. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23328. }
  23329. t += 4;
  23330. var n = this.buffer.byteLength;
  23331. return n < t && this.resize((n *= 2) > t ? n : t), t -= 4, r(this.view, e, t, this.littleEndian, 23, 4), i && (this.offset += 4), this
  23332. }, a.writeFloat = a.writeFloat32, a.readFloat32 = function (e) {
  23333. var t = void 0 === e;
  23334. if (t && (e = this.offset), !this.noAssert) {
  23335. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23336. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  23337. }
  23338. var i = n(this.view, e, this.littleEndian, 23, 4);
  23339. return t && (this.offset += 4), i
  23340. }, a.readFloat = a.readFloat32, a.writeFloat64 = function (e, t) {
  23341. var i = void 0 === t;
  23342. if (i && (t = this.offset), !this.noAssert) {
  23343. if ("number" != typeof e) throw TypeError("Illegal value: " + e + " (not a number)");
  23344. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23345. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23346. }
  23347. t += 8;
  23348. var n = this.buffer.byteLength;
  23349. return n < t && this.resize((n *= 2) > t ? n : t), t -= 8, r(this.view, e, t, this.littleEndian, 52, 8), i && (this.offset += 8), this
  23350. }, a.writeDouble = a.writeFloat64, a.readFloat64 = function (e) {
  23351. var t = void 0 === e;
  23352. if (t && (e = this.offset), !this.noAssert) {
  23353. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23354. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  23355. }
  23356. var i = n(this.view, e, this.littleEndian, 52, 8);
  23357. return t && (this.offset += 8), i
  23358. }, a.readDouble = a.readFloat64, f.MAX_VARINT32_BYTES = 5, f.calculateVarint32 = function (e) {
  23359. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  23360. }, f.zigZagEncode32 = function (e) {
  23361. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  23362. }, f.zigZagDecode32 = function (e) {
  23363. return e >>> 1 ^ -(1 & e) | 0
  23364. }, a.writeVarint32 = function (e, t) {
  23365. var i = void 0 === t;
  23366. if (i && (t = this.offset), !this.noAssert) {
  23367. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23368. if (e |= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23369. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23370. }
  23371. var n, r = f.calculateVarint32(e);
  23372. t += r;
  23373. var o = this.buffer.byteLength;
  23374. for (o < t && this.resize((o *= 2) > t ? o : t), t -= r, e >>>= 0; 128 <= e;) n = 127 & e | 128, this.view[t++] = n, e >>>= 7;
  23375. return this.view[t++] = e, i ? (this.offset = t, this) : r
  23376. }, a.writeVarint32ZigZag = function (e, t) {
  23377. return this.writeVarint32(f.zigZagEncode32(e), t)
  23378. }, a.readVarint32 = function (e) {
  23379. var t = void 0 === e;
  23380. if (t && (e = this.offset), !this.noAssert) {
  23381. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23382. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  23383. }
  23384. var i, n = 0,
  23385. r = 0;
  23386. do {
  23387. if (!this.noAssert && e > this.limit) {
  23388. var o = Error("Truncated");
  23389. throw o.truncated = !0, o
  23390. }
  23391. i = this.view[e++], n < 5 && (r |= (127 & i) << 7 * n), ++n
  23392. } while (0 != (128 & i));
  23393. return r |= 0, t ? (this.offset = e, r) : {
  23394. value: r,
  23395. length: n
  23396. }
  23397. }, a.readVarint32ZigZag = function (e) {
  23398. var t = this.readVarint32(e);
  23399. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t), t
  23400. }, l && (f.MAX_VARINT64_BYTES = 10, f.calculateVarint64 = function (e) {
  23401. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  23402. var t = e.toInt() >>> 0,
  23403. i = e.shiftRightUnsigned(28).toInt() >>> 0,
  23404. n = e.shiftRightUnsigned(56).toInt() >>> 0;
  23405. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  23406. }, f.zigZagEncode64 = function (e) {
  23407. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()), e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  23408. }, f.zigZagDecode64 = function (e) {
  23409. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()), e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  23410. }, a.writeVarint64 = function (e, t) {
  23411. var i = void 0 === t;
  23412. if (i && (t = this.offset), !this.noAssert) {
  23413. if ("number" == typeof e) e = l.fromNumber(e);
  23414. else if ("string" == typeof e) e = l.fromString(e);
  23415. else if (!(e && e instanceof l)) throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  23416. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23417. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23418. }
  23419. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  23420. var n = f.calculateVarint64(e),
  23421. r = e.toInt() >>> 0,
  23422. o = e.shiftRightUnsigned(28).toInt() >>> 0,
  23423. a = e.shiftRightUnsigned(56).toInt() >>> 0;
  23424. t += n;
  23425. var s = this.buffer.byteLength;
  23426. switch (s < t && this.resize((s *= 2) > t ? s : t), t -= n, n) {
  23427. case 10:
  23428. this.view[t + 9] = a >>> 7 & 1;
  23429. case 9:
  23430. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  23431. case 8:
  23432. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  23433. case 7:
  23434. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  23435. case 6:
  23436. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  23437. case 5:
  23438. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  23439. case 4:
  23440. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  23441. case 3:
  23442. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  23443. case 2:
  23444. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  23445. case 1:
  23446. this.view[t] = 1 !== n ? 128 | r : 127 & r
  23447. }
  23448. return i ? (this.offset += n, this) : n
  23449. }, a.writeVarint64ZigZag = function (e, t) {
  23450. return this.writeVarint64(f.zigZagEncode64(e), t)
  23451. }, a.readVarint64 = function (e) {
  23452. var t = void 0 === e;
  23453. if (t && (e = this.offset), !this.noAssert) {
  23454. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23455. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  23456. }
  23457. var i = e,
  23458. n = 0,
  23459. r = 0,
  23460. o = 0,
  23461. a = 0;
  23462. if (n = 127 & (a = this.view[e++]), 128 & a && (n |= (127 & (a = this.view[e++])) << 7, (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14, (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21, (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]), (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7, (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14, (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21, (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]), (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7, 128 & a || this.noAssert && void 0 === a)))))))))) throw Error("Buffer overrun");
  23463. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  23464. return t ? (this.offset = e, s) : {
  23465. value: s,
  23466. length: e - i
  23467. }
  23468. }, a.readVarint64ZigZag = function (e) {
  23469. var t = this.readVarint64(e);
  23470. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t), t
  23471. }), a.writeCString = function (e, t) {
  23472. var i = void 0 === t;
  23473. i && (t = this.offset);
  23474. var n, r = e.length;
  23475. if (!this.noAssert) {
  23476. if ("string" != typeof e) throw TypeError("Illegal str: Not a string");
  23477. for (n = 0; n < r; ++n)
  23478. if (0 === e.charCodeAt(n)) throw RangeError("Illegal str: Contains NULL-characters");
  23479. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23480. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23481. }
  23482. r = d.calculateUTF16asUTF8(s(e))[1], t += r + 1;
  23483. var o = this.buffer.byteLength;
  23484. return o < t && this.resize((o *= 2) > t ? o : t), t -= r + 1, d.encodeUTF16toUTF8(s(e), function (e) {
  23485. this.view[t++] = e
  23486. }.bind(this)), this.view[t++] = 0, i ? (this.offset = t, this) : r
  23487. }, a.readCString = function (e) {
  23488. var t = void 0 === e;
  23489. if (t && (e = this.offset), !this.noAssert) {
  23490. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23491. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  23492. }
  23493. var i, n = e,
  23494. r = -1;
  23495. return d.decodeUTF8toUTF16(function () {
  23496. if (0 === r) return null;
  23497. if (e >= this.limit) throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  23498. return 0 === (r = this.view[e++]) ? null : r
  23499. }.bind(this), i = c(), !0), t ? (this.offset = e, i()) : {
  23500. string: i(),
  23501. length: e - n
  23502. }
  23503. }, a.writeIString = function (e, t) {
  23504. var i = void 0 === t;
  23505. if (i && (t = this.offset), !this.noAssert) {
  23506. if ("string" != typeof e) throw TypeError("Illegal str: Not a string");
  23507. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23508. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23509. }
  23510. var n, r = t;
  23511. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1], t += 4 + n;
  23512. var o = this.buffer.byteLength;
  23513. if (o < t && this.resize((o *= 2) > t ? o : t), t -= 4 + n, this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255, this.view[t + 2] = n >>> 16 & 255, this.view[t + 1] = n >>> 8 & 255, this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255, this.view[t + 1] = n >>> 16 & 255, this.view[t + 2] = n >>> 8 & 255, this.view[t + 3] = 255 & n), t += 4, d.encodeUTF16toUTF8(s(e), function (e) {
  23514. this.view[t++] = e
  23515. }.bind(this)), t !== r + 4 + n) throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  23516. return i ? (this.offset = t, this) : t - r
  23517. }, a.readIString = function (e) {
  23518. var t = void 0 === e;
  23519. if (t && (e = this.offset), !this.noAssert) {
  23520. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23521. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  23522. }
  23523. var i = e,
  23524. n = this.readUint32(e),
  23525. r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  23526. return e += r.length, t ? (this.offset = e, r.string) : {
  23527. string: r.string,
  23528. length: e - i
  23529. }
  23530. }, f.METRICS_CHARS = "c", f.METRICS_BYTES = "b", a.writeUTF8String = function (e, t) {
  23531. var i = void 0 === t;
  23532. if (i && (t = this.offset), !this.noAssert) {
  23533. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23534. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23535. }
  23536. var n, r = t;
  23537. n = d.calculateUTF16asUTF8(s(e))[1], t += n;
  23538. var o = this.buffer.byteLength;
  23539. return o < t && this.resize((o *= 2) > t ? o : t), t -= n, d.encodeUTF16toUTF8(s(e), function (e) {
  23540. this.view[t++] = e
  23541. }.bind(this)), i ? (this.offset = t, this) : t - r
  23542. }, a.writeString = a.writeUTF8String, f.calculateUTF8Chars = function (e) {
  23543. return d.calculateUTF16asUTF8(s(e))[0]
  23544. }, f.calculateUTF8Bytes = function (e) {
  23545. return d.calculateUTF16asUTF8(s(e))[1]
  23546. }, f.calculateString = f.calculateUTF8Bytes, a.readUTF8String = function (e, t, i) {
  23547. "number" == typeof t && (i = t, t = void 0);
  23548. var n = void 0 === i;
  23549. if (n && (i = this.offset), void 0 === t && (t = f.METRICS_CHARS), !this.noAssert) {
  23550. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal length: " + e + " (not an integer)");
  23551. if (e |= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  23552. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  23553. }
  23554. var r, o = 0,
  23555. a = i;
  23556. if (t === f.METRICS_CHARS) {
  23557. if (r = c(), d.decodeUTF8(function () {
  23558. return o < e && i < this.limit ? this.view[i++] : null
  23559. }.bind(this), function (e) {
  23560. ++o, d.UTF8toUTF16(e, r)
  23561. }), o !== e) throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  23562. return n ? (this.offset = i, r()) : {
  23563. string: r(),
  23564. length: i - a
  23565. }
  23566. }
  23567. if (t !== f.METRICS_BYTES) throw TypeError("Unsupported metrics: " + t);
  23568. if (!this.noAssert) {
  23569. if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  23570. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  23571. }
  23572. var s = i + e;
  23573. if (d.decodeUTF8toUTF16(function () {
  23574. return i < s ? this.view[i++] : null
  23575. }.bind(this), r = c(), this.noAssert), i !== s) throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  23576. return n ? (this.offset = i, r()) : {
  23577. string: r(),
  23578. length: i - a
  23579. }
  23580. }, a.readString = a.readUTF8String, a.writeVString = function (e, t) {
  23581. var i = void 0 === t;
  23582. if (i && (t = this.offset), !this.noAssert) {
  23583. if ("string" != typeof e) throw TypeError("Illegal str: Not a string");
  23584. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  23585. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  23586. }
  23587. var n, r, o = t;
  23588. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1], r = f.calculateVarint32(n), t += r + n;
  23589. var a = this.buffer.byteLength;
  23590. if (a < t && this.resize((a *= 2) > t ? a : t), t -= r + n, t += this.writeVarint32(n, t), d.encodeUTF16toUTF8(s(e), function (e) {
  23591. this.view[t++] = e
  23592. }.bind(this)), t !== o + n + r) throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  23593. return i ? (this.offset = t, this) : t - o
  23594. }, a.readVString = function (e) {
  23595. var t = void 0 === e;
  23596. if (t && (e = this.offset), !this.noAssert) {
  23597. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23598. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  23599. }
  23600. var i = e,
  23601. n = this.readVarint32(e),
  23602. r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  23603. return e += r.length, t ? (this.offset = e, r.string) : {
  23604. string: r.string,
  23605. length: e - i
  23606. }
  23607. }, a.append = function (e, t, i) {
  23608. "number" != typeof t && "string" == typeof t || (i = t, t = void 0);
  23609. var n = void 0 === i;
  23610. if (n && (i = this.offset), !this.noAssert) {
  23611. if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  23612. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  23613. }
  23614. e instanceof f || (e = f.wrap(e, t));
  23615. var r = e.limit - e.offset;
  23616. if (r <= 0) return this;
  23617. i += r;
  23618. var o = this.buffer.byteLength;
  23619. return o < i && this.resize((o *= 2) > i ? o : i), i -= r, this.view.set(e.view.subarray(e.offset, e.limit), i), e.offset += r, n && (this.offset += r), this
  23620. }, a.appendTo = function (e, t) {
  23621. return e.append(this, t), this
  23622. }, a.assert = function (e) {
  23623. return this.noAssert = !e, this
  23624. }, a.capacity = function () {
  23625. return this.buffer.byteLength
  23626. }, a.clear = function () {
  23627. return this.offset = 0, this.limit = this.buffer.byteLength, this.markedOffset = -1, this
  23628. }, a.clone = function (e) {
  23629. var t = new f(0, this.littleEndian, this.noAssert);
  23630. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength), t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer, t.view = this.view), t.offset = this.offset, t.markedOffset = this.markedOffset, t.limit = this.limit, t
  23631. }, a.compact = function (e, t) {
  23632. if (void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert) {
  23633. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  23634. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal end: Not an integer");
  23635. if (t >>>= 0, e < 0 || t < e || t > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  23636. }
  23637. if (0 === e && t === this.buffer.byteLength) return this;
  23638. var i = t - e;
  23639. if (0 == i) return this.buffer = o, this.view = null, 0 <= this.markedOffset && (this.markedOffset -= e), this.offset = 0, this.limit = 0, this;
  23640. var n = new ArrayBuffer(i),
  23641. r = new Uint8Array(n);
  23642. return r.set(this.view.subarray(e, t)), this.buffer = n, this.view = r, 0 <= this.markedOffset && (this.markedOffset -= e), this.offset = 0, this.limit = i, this
  23643. }, a.copy = function (e, t) {
  23644. if (void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert) {
  23645. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  23646. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal end: Not an integer");
  23647. if (t >>>= 0, e < 0 || t < e || t > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  23648. }
  23649. if (e === t) return new f(0, this.littleEndian, this.noAssert);
  23650. var i = t - e,
  23651. n = new f(i, this.littleEndian, this.noAssert);
  23652. return n.offset = 0, n.limit = i, 0 <= n.markedOffset && (n.markedOffset -= e), this.copyTo(n, 0, e, t), n
  23653. }, a.copyTo = function (e, t, i, n) {
  23654. var r, o;
  23655. if (!this.noAssert && !f.isByteBuffer(e)) throw TypeError("Illegal target: Not a ByteBuffer");
  23656. if (t = (o = void 0 === t) ? e.offset : 0 | t, i = (r = void 0 === i) ? this.offset : 0 | i, n = void 0 === n ? this.limit : 0 | n, t < 0 || t > e.buffer.byteLength) throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  23657. if (i < 0 || n > this.buffer.byteLength) throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  23658. var a = n - i;
  23659. return 0 == a ? e : (e.ensureCapacity(t + a), e.view.set(this.view.subarray(i, n), t), r && (this.offset += a), o && (e.offset += a), this)
  23660. }, a.ensureCapacity = function (e) {
  23661. var t = this.buffer.byteLength;
  23662. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  23663. }, a.fill = function (e, t, i) {
  23664. var n = void 0 === t;
  23665. if (n && (t = this.offset), "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)), void 0 === t && (t = this.offset), void 0 === i && (i = this.limit), !this.noAssert) {
  23666. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal value: " + e + " (not an integer)");
  23667. if (e |= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  23668. if (t >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal end: Not an integer");
  23669. if (i >>>= 0, t < 0 || i < t || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  23670. }
  23671. if (i <= t) return this;
  23672. for (; t < i;) this.view[t++] = e;
  23673. return n && (this.offset = t), this
  23674. }, a.flip = function () {
  23675. return this.limit = this.offset, this.offset = 0, this
  23676. }, a.mark = function (e) {
  23677. if (e = void 0 === e ? this.offset : e, !this.noAssert) {
  23678. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  23679. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  23680. }
  23681. return this.markedOffset = e, this
  23682. }, a.order = function (e) {
  23683. if (!this.noAssert && "boolean" != typeof e) throw TypeError("Illegal littleEndian: Not a boolean");
  23684. return this.littleEndian = !!e, this
  23685. }, a.LE = function (e) {
  23686. return this.littleEndian = void 0 === e || !!e, this
  23687. }, a.BE = function (e) {
  23688. return this.littleEndian = void 0 !== e && !e, this
  23689. }, a.prepend = function (e, t, i) {
  23690. "number" != typeof t && "string" == typeof t || (i = t, t = void 0);
  23691. var n = void 0 === i;
  23692. if (n && (i = this.offset), !this.noAssert) {
  23693. if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  23694. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  23695. }
  23696. e instanceof f || (e = f.wrap(e, t));
  23697. var r = e.limit - e.offset;
  23698. if (r <= 0) return this;
  23699. var o = r - i;
  23700. if (0 < o) {
  23701. var a = new ArrayBuffer(this.buffer.byteLength + o),
  23702. s = new Uint8Array(a);
  23703. s.set(this.view.subarray(i, this.buffer.byteLength), r), this.buffer = a, this.view = s, this.offset += o, 0 <= this.markedOffset && (this.markedOffset += o), this.limit += o, i += o
  23704. } else new Uint8Array(this.buffer);
  23705. return this.view.set(e.view.subarray(e.offset, e.limit), i - r), e.offset = e.limit, n && (this.offset -= r), this
  23706. }, a.prependTo = function (e, t) {
  23707. return e.prepend(this, t), this
  23708. }, a.printDebug = function (e) {
  23709. "function" != typeof e && (e = console.log.bind(console)), e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  23710. }, a.remaining = function () {
  23711. return this.limit - this.offset
  23712. }, a.reset = function () {
  23713. return 0 <= this.markedOffset ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this
  23714. }, a.resize = function (e) {
  23715. if (!this.noAssert) {
  23716. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal capacity: " + e + " (not an integer)");
  23717. if ((e |= 0) < 0) throw RangeError("Illegal capacity: 0 <= " + e)
  23718. }
  23719. if (this.buffer.byteLength < e) {
  23720. var t = new ArrayBuffer(e),
  23721. i = new Uint8Array(t);
  23722. i.set(this.view), this.buffer = t, this.view = i
  23723. }
  23724. return this
  23725. }, a.reverse = function (e, t) {
  23726. if (void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert) {
  23727. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  23728. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal end: Not an integer");
  23729. if (t >>>= 0, e < 0 || t < e || t > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  23730. }
  23731. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)), this
  23732. }, a.skip = function (e) {
  23733. if (!this.noAssert) {
  23734. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal length: " + e + " (not an integer)");
  23735. e |= 0
  23736. }
  23737. var t = this.offset + e;
  23738. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength)) throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  23739. return this.offset = t, this
  23740. }, a.slice = function (e, t) {
  23741. if (void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), !this.noAssert) {
  23742. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  23743. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal end: Not an integer");
  23744. if (t >>>= 0, e < 0 || t < e || t > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  23745. }
  23746. var i = this.clone();
  23747. return i.offset = e, i.limit = t, i
  23748. }, a.toBuffer = function (e) {
  23749. var t = this.offset,
  23750. i = this.limit;
  23751. if (!this.noAssert) {
  23752. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: Not an integer");
  23753. if (t >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal limit: Not an integer");
  23754. if (i >>>= 0, t < 0 || i < t || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  23755. }
  23756. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer;
  23757. if (t === i) return o;
  23758. var n = new ArrayBuffer(i - t);
  23759. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n
  23760. }, a.toArrayBuffer = a.toBuffer, a.toString = function (e, t, i) {
  23761. if (void 0 === e) return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  23762. switch ("number" == typeof e && (i = t = e = "utf8"), e) {
  23763. case "utf8":
  23764. return this.toUTF8(t, i);
  23765. case "base64":
  23766. return this.toBase64(t, i);
  23767. case "hex":
  23768. return this.toHex(t, i);
  23769. case "binary":
  23770. return this.toBinary(t, i);
  23771. case "debug":
  23772. return this.toDebug();
  23773. case "columns":
  23774. return this.toColumns();
  23775. default:
  23776. throw Error("Unsupported encoding: " + e)
  23777. }
  23778. };
  23779. var h = function () {
  23780. for (var e = {}, r = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], a = [], t = 0, i = r.length; t < i; ++t) a[r[t]] = t;
  23781. return e.encode = function (e, t) {
  23782. for (var i, n; null !== (i = e());) t(r[i >> 2 & 63]), n = (3 & i) << 4, null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]), n = (15 & i) << 2, null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]), t(r[63 & i])) : (t(r[63 & n]), t(61))) : (t(r[63 & n]), t(61), t(61))
  23783. }, e.decode = function (e, t) {
  23784. function i(e) {
  23785. throw Error("Illegal character code: " + e)
  23786. }
  23787. for (var n, r, o; null !== (n = e());)
  23788. if (void 0 === (r = a[n]) && i(n), null !== (n = e()) && (void 0 === (o = a[n]) && i(n), t(r << 2 >>> 0 | (48 & o) >> 4), null !== (n = e()))) {
  23789. if (void 0 === (r = a[n])) {
  23790. if (61 === n) break;
  23791. i(n)
  23792. }
  23793. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2), null !== (n = e())) {
  23794. if (void 0 === (o = a[n])) {
  23795. if (61 === n) break;
  23796. i(n)
  23797. }
  23798. t((3 & r) << 6 >>> 0 | o)
  23799. }
  23800. }
  23801. }, e.test = function (e) {
  23802. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  23803. }, e
  23804. }();
  23805. a.toBase64 = function (e, t) {
  23806. if (void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), t |= 0, (e |= 0) < 0 || t > this.capacity || t < e) throw RangeError("begin, end");
  23807. var i;
  23808. return h.encode(function () {
  23809. return e < t ? this.view[e++] : null
  23810. }.bind(this), i = c()), i()
  23811. }, f.fromBase64 = function (e, t) {
  23812. if ("string" != typeof e) throw TypeError("str");
  23813. var i = new f(e.length / 4 * 3, t),
  23814. n = 0;
  23815. return h.decode(s(e), function (e) {
  23816. i.view[n++] = e
  23817. }), i.limit = n, i
  23818. }, f.btoa = function (e) {
  23819. return f.fromBinary(e).toBase64()
  23820. }, f.atob = function (e) {
  23821. return f.fromBase64(e).toBinary()
  23822. }, a.toBinary = function (e, t) {
  23823. if (void 0 === e && (e = this.offset), void 0 === t && (t = this.limit), t |= 0, (e |= 0) < 0 || t > this.capacity() || t < e) throw RangeError("begin, end");
  23824. if (e === t) return "";
  23825. for (var i = [], n = []; e < t;) i.push(this.view[e++]), 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)), i = []);
  23826. return n.join("") + String.fromCharCode.apply(String, i)
  23827. }, f.fromBinary = function (e, t) {
  23828. if ("string" != typeof e) throw TypeError("str");
  23829. for (var i, n = 0, r = e.length, o = new f(r, t); n < r;) {
  23830. if (255 < (i = e.charCodeAt(n))) throw RangeError("illegal char code: " + i);
  23831. o.view[n++] = i
  23832. }
  23833. return o.limit = r, o
  23834. }, a.toDebug = function (e) {
  23835. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n;) {
  23836. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(), e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")), ++i, e && 0 < i && i % 16 == 0 && i !== n) {
  23837. for (; r.length < 51;) r += " ";
  23838. a += r + o + "\n", r = o = ""
  23839. }
  23840. 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 ? " " : ""
  23841. }
  23842. if (e && " " !== r) {
  23843. for (; r.length < 51;) r += " ";
  23844. a += r + o + "\n"
  23845. }
  23846. return e ? a : r
  23847. }, f.fromDebug = function (e, t, i) {
  23848. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0, t, i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o;) {
  23849. switch (n = e.charAt(s++)) {
  23850. case "!":
  23851. if (!i) {
  23852. if (h || u || d) {
  23853. p = !0;
  23854. break
  23855. }
  23856. h = u = d = !0
  23857. }
  23858. a.offset = a.markedOffset = a.limit = l, c = !1;
  23859. break;
  23860. case "|":
  23861. if (!i) {
  23862. if (h || d) {
  23863. p = !0;
  23864. break
  23865. }
  23866. h = d = !0
  23867. }
  23868. a.offset = a.limit = l, c = !1;
  23869. break;
  23870. case "[":
  23871. if (!i) {
  23872. if (h || u) {
  23873. p = !0;
  23874. break
  23875. }
  23876. h = u = !0
  23877. }
  23878. a.offset = a.markedOffset = l, c = !1;
  23879. break;
  23880. case "<":
  23881. if (!i) {
  23882. if (h) {
  23883. p = !0;
  23884. break
  23885. }
  23886. h = !0
  23887. }
  23888. a.offset = l, c = !1;
  23889. break;
  23890. case "]":
  23891. if (!i) {
  23892. if (d || u) {
  23893. p = !0;
  23894. break
  23895. }
  23896. d = u = !0
  23897. }
  23898. a.limit = a.markedOffset = l, c = !1;
  23899. break;
  23900. case ">":
  23901. if (!i) {
  23902. if (d) {
  23903. p = !0;
  23904. break
  23905. }
  23906. d = !0
  23907. }
  23908. a.limit = l, c = !1;
  23909. break;
  23910. case "'":
  23911. if (!i) {
  23912. if (u) {
  23913. p = !0;
  23914. break
  23915. }
  23916. u = !0
  23917. }
  23918. a.markedOffset = l, c = !1;
  23919. break;
  23920. case " ":
  23921. c = !1;
  23922. break;
  23923. default:
  23924. if (!i && c) {
  23925. p = !0;
  23926. break
  23927. }
  23928. if (r = parseInt(n + e.charAt(s++), 16), !i && (isNaN(r) || r < 0 || 255 < r)) throw TypeError("Illegal str: Not a debug encoded string");
  23929. a.view[l++] = r, c = !0
  23930. }
  23931. if (p) throw TypeError("Illegal str: Invalid symbol at " + s)
  23932. }
  23933. if (!i) {
  23934. if (!h || !d) throw TypeError("Illegal str: Missing offset or limit");
  23935. if (l < a.buffer.byteLength) throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  23936. }
  23937. return a
  23938. }, a.toHex = function (e, t) {
  23939. if (e = void 0 === e ? this.offset : e, t = void 0 === t ? this.limit : t, !this.noAssert) {
  23940. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  23941. if (e >>>= 0, "number" != typeof t || t % 1 != 0) throw TypeError("Illegal end: Not an integer");
  23942. if (t >>>= 0, e < 0 || t < e || t > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  23943. }
  23944. for (var i, n = new Array(t - e); e < t;)(i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  23945. return n.join("")
  23946. }, f.fromHex = function (e, t, i) {
  23947. if (!i) {
  23948. if ("string" != typeof e) throw TypeError("Illegal str: Not a string");
  23949. if (e.length % 2 != 0) throw TypeError("Illegal str: Length not a multiple of 2")
  23950. }
  23951. for (var n, r = e.length, o = new f(r / 2 | 0, t), a = 0, s = 0; a < r; a += 2) {
  23952. if (n = parseInt(e.substring(a, a + 2), 16), !i && (!isFinite(n) || n < 0 || 255 < n)) throw TypeError("Illegal str: Contains non-hex characters");
  23953. o.view[s++] = n
  23954. }
  23955. return o.limit = s, o
  23956. };
  23957. var u, d = u = {
  23958. MAX_CODEPOINT: 1114111,
  23959. encodeUTF8: function (e, t) {
  23960. var i = null;
  23961. for ("number" == typeof e && (i = e, e = function () {
  23962. return null
  23963. }); null !== i || null !== (i = e());) i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240), t(i >> 12 & 63 | 128)), t(i >> 6 & 63 | 128)), t(63 & i | 128)), i = null
  23964. },
  23965. decodeUTF8: function (e, t) {
  23966. for (var i, n, r, o, a = function (e) {
  23967. e = e.slice(0, e.indexOf(null));
  23968. var t = Error(e.toString());
  23969. throw t.name = "TruncatedError", t.bytes = e, t
  23970. }; null !== (i = e());)
  23971. if (0 == (128 & i)) t(i);
  23972. else if (192 == (224 & i)) null === (n = e()) && a([i, n]), t((31 & i) << 6 | 63 & n);
  23973. else if (224 == (240 & i)) null !== (n = e()) && null !== (r = e()) || a([i, n, r]), t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  23974. else {
  23975. if (240 != (248 & i)) throw RangeError("Illegal starting byte: " + i);
  23976. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]), t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  23977. }
  23978. },
  23979. UTF16toUTF8: function (e, t) {
  23980. for (var i, n = null; null !== (i = null !== n ? n : e());) 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536), n = null) : t(i);
  23981. null !== n && t(n)
  23982. },
  23983. UTF8toUTF16: function (e, t) {
  23984. var i = null;
  23985. for ("number" == typeof e && (i = e, e = function () {
  23986. return null
  23987. }); null !== i || null !== (i = e());) i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)), t(i % 1024 + 56320)), i = null
  23988. },
  23989. encodeUTF16toUTF8: function (e, t) {
  23990. u.UTF16toUTF8(e, function (e) {
  23991. u.encodeUTF8(e, t)
  23992. })
  23993. },
  23994. decodeUTF8toUTF16: function (e, t) {
  23995. u.decodeUTF8(e, function (e) {
  23996. u.UTF8toUTF16(e, t)
  23997. })
  23998. },
  23999. calculateCodePoint: function (e) {
  24000. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  24001. },
  24002. calculateUTF8: function (e) {
  24003. for (var t, i = 0; null !== (t = e());) i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  24004. return i
  24005. },
  24006. calculateUTF16asUTF8: function (e) {
  24007. var t = 0,
  24008. i = 0;
  24009. return u.UTF16toUTF8(e, function (e) {
  24010. ++t, i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  24011. }), [t, i]
  24012. }
  24013. };
  24014. return a.toUTF8 = function (t, i) {
  24015. if (void 0 === t && (t = this.offset), void 0 === i && (i = this.limit), !this.noAssert) {
  24016. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  24017. if (t >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal end: Not an integer");
  24018. if (i >>>= 0, t < 0 || i < t || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  24019. }
  24020. var e;
  24021. try {
  24022. d.decodeUTF8toUTF16(function () {
  24023. return t < i ? this.view[t++] : null
  24024. }.bind(this), e = c())
  24025. } catch (e) {
  24026. if (t !== i) throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  24027. }
  24028. return e()
  24029. }, f.fromUTF8 = function (e, t, i) {
  24030. if (!i && "string" != typeof e) throw TypeError("Illegal str: Not a string");
  24031. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1], t, i),
  24032. r = 0;
  24033. return d.encodeUTF16toUTF8(s(e), function (e) {
  24034. n.view[r++] = e
  24035. }), n.limit = r, n
  24036. }, f
  24037. }, "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function () {
  24038. var e;
  24039. try {
  24040. e = t("long")
  24041. } catch (e) {}
  24042. return r(e)
  24043. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  24044. }, {
  24045. long: 216
  24046. }],
  24047. 216: [function (e, t, i) {
  24048. var n, r;
  24049. n = this, r = function () {
  24050. "use strict";
  24051. function n(e, t, i) {
  24052. this.low = 0 | e, this.high = 0 | t, this.unsigned = !!i
  24053. }
  24054. function p(e) {
  24055. return !0 === (e && e.__isLong__)
  24056. }
  24057. function e(e, t) {
  24058. var i, n, r;
  24059. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0), r && (a[e] = i), i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1), r && (o[e] = i), i)
  24060. }
  24061. function f(e, t) {
  24062. if (isNaN(e) || !isFinite(e)) return t ? l : y;
  24063. if (t) {
  24064. if (e < 0) return l;
  24065. if (r <= e) return I
  24066. } else {
  24067. if (e <= -s) return E;
  24068. if (s <= e + 1) return C
  24069. }
  24070. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  24071. }
  24072. function g(e, t, i) {
  24073. return new n(e, t, i)
  24074. }
  24075. function h(e, t, i) {
  24076. if (0 === e.length) throw Error("empty string");
  24077. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e) return y;
  24078. if (t = "number" == typeof t ? (i = t, !1) : !!t, (i = i || 10) < 2 || 36 < i) throw RangeError("radix");
  24079. var n;
  24080. if (0 < (n = e.indexOf("-"))) throw Error("interior hyphen");
  24081. if (0 === n) return h(e.substring(1), t, i).neg();
  24082. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  24083. var s = Math.min(8, e.length - a),
  24084. l = parseInt(e.substring(a, a + s), i);
  24085. if (s < 8) {
  24086. var c = f(u(i, s));
  24087. o = o.mul(c).add(f(l))
  24088. } else o = (o = o.mul(r)).add(f(l))
  24089. }
  24090. return o.unsigned = t, o
  24091. }
  24092. function m(e) {
  24093. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  24094. }
  24095. Object.defineProperty(n.prototype, "__isLong__", {
  24096. value: !0,
  24097. enumerable: !1,
  24098. configurable: !1
  24099. }), n.isLong = p;
  24100. var o = {},
  24101. a = {};
  24102. n.fromInt = e, n.fromNumber = f, n.fromBits = g;
  24103. var u = Math.pow;
  24104. n.fromString = h, n.fromValue = m;
  24105. var i = 4294967296,
  24106. r = 0x10000000000000000,
  24107. s = r / 2,
  24108. v = e(1 << 24),
  24109. y = e(0);
  24110. n.ZERO = y;
  24111. var l = e(0, !0);
  24112. n.UZERO = l;
  24113. var c = e(1);
  24114. n.ONE = c;
  24115. var d = e(1, !0);
  24116. n.UONE = d;
  24117. var A = e(-1);
  24118. n.NEG_ONE = A;
  24119. var C = g(-1, 2147483647, !1);
  24120. n.MAX_VALUE = C;
  24121. var I = g(-1, -1, !0);
  24122. n.MAX_UNSIGNED_VALUE = I;
  24123. var E = g(0, -2147483648, !1);
  24124. n.MIN_VALUE = E;
  24125. var t = n.prototype;
  24126. return t.toInt = function () {
  24127. return this.unsigned ? this.low >>> 0 : this.low
  24128. }, t.toNumber = function () {
  24129. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  24130. }, t.toString = function (e) {
  24131. if ((e = e || 10) < 2 || 36 < e) throw RangeError("radix");
  24132. if (this.isZero()) return "0";
  24133. if (this.isNegative()) {
  24134. if (this.eq(E)) {
  24135. var t = f(e),
  24136. i = this.div(t),
  24137. n = i.mul(t).sub(this);
  24138. return i.toString(e) + n.toInt().toString(e)
  24139. }
  24140. return "-" + this.neg().toString(e)
  24141. }
  24142. for (var r = f(u(e, 6), this.unsigned), o = this, a = "";;) {
  24143. var s = o.div(r),
  24144. l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  24145. if ((o = s).isZero()) return l + a;
  24146. for (; l.length < 6;) l = "0" + l;
  24147. a = "" + l + a
  24148. }
  24149. }, t.getHighBits = function () {
  24150. return this.high
  24151. }, t.getHighBitsUnsigned = function () {
  24152. return this.high >>> 0
  24153. }, t.getLowBits = function () {
  24154. return this.low
  24155. }, t.getLowBitsUnsigned = function () {
  24156. return this.low >>> 0
  24157. }, t.getNumBitsAbs = function () {
  24158. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  24159. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--);
  24160. return 0 != this.high ? t + 33 : t + 1
  24161. }, t.isZero = function () {
  24162. return 0 === this.high && 0 === this.low
  24163. }, t.isNegative = function () {
  24164. return !this.unsigned && this.high < 0
  24165. }, t.isPositive = function () {
  24166. return this.unsigned || 0 <= this.high
  24167. }, t.isOdd = function () {
  24168. return 1 == (1 & this.low)
  24169. }, t.isEven = function () {
  24170. return 0 == (1 & this.low)
  24171. }, t.equals = function (e) {
  24172. return p(e) || (e = m(e)), (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  24173. }, t.eq = t.equals, t.notEquals = function (e) {
  24174. return !this.eq(e)
  24175. }, t.neq = t.notEquals, t.lessThan = function (e) {
  24176. return this.comp(e) < 0
  24177. }, t.lt = t.lessThan, t.lessThanOrEqual = function (e) {
  24178. return this.comp(e) <= 0
  24179. }, t.lte = t.lessThanOrEqual, t.greaterThan = function (e) {
  24180. return 0 < this.comp(e)
  24181. }, t.gt = t.greaterThan, t.greaterThanOrEqual = function (e) {
  24182. return 0 <= this.comp(e)
  24183. }, t.gte = t.greaterThanOrEqual, t.compare = function (e) {
  24184. if (p(e) || (e = m(e)), this.eq(e)) return 0;
  24185. var t = this.isNegative(),
  24186. i = e.isNegative();
  24187. return t && !i ? -1 : !t && i ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  24188. }, t.comp = t.compare, t.negate = function () {
  24189. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  24190. }, t.neg = t.negate, t.add = function (e) {
  24191. p(e) || (e = m(e));
  24192. var t = this.high >>> 16,
  24193. i = 65535 & this.high,
  24194. n = this.low >>> 16,
  24195. r = 65535 & this.low,
  24196. o = e.high >>> 16,
  24197. a = 65535 & e.high,
  24198. s = e.low >>> 16,
  24199. l = 0,
  24200. c = 0,
  24201. h = 0,
  24202. u = 0;
  24203. return h += (u += r + (65535 & e.low)) >>> 16, c += (h += n + s) >>> 16, l += (c += i + a) >>> 16, l += t + o, g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  24204. }, t.subtract = function (e) {
  24205. return p(e) || (e = m(e)), this.add(e.neg())
  24206. }, t.sub = t.subtract, t.multiply = function (e) {
  24207. if (this.isZero()) return y;
  24208. if (p(e) || (e = m(e)), e.isZero()) return y;
  24209. if (this.eq(E)) return e.isOdd() ? E : y;
  24210. if (e.eq(E)) return this.isOdd() ? E : y;
  24211. if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  24212. if (e.isNegative()) return this.mul(e.neg()).neg();
  24213. if (this.lt(v) && e.lt(v)) return f(this.toNumber() * e.toNumber(), this.unsigned);
  24214. var t = this.high >>> 16,
  24215. i = 65535 & this.high,
  24216. n = this.low >>> 16,
  24217. r = 65535 & this.low,
  24218. o = e.high >>> 16,
  24219. a = 65535 & e.high,
  24220. s = e.low >>> 16,
  24221. l = 65535 & e.low,
  24222. c = 0,
  24223. h = 0,
  24224. u = 0,
  24225. d = 0;
  24226. return u += (d += r * l) >>> 16, h += (u += n * l) >>> 16, u &= 65535, h += (u += r * s) >>> 16, c += (h += i * l) >>> 16, h &= 65535, c += (h += n * s) >>> 16, h &= 65535, c += (h += r * a) >>> 16, c += t * l + i * s + n * a + r * o, g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  24227. }, t.mul = t.multiply, t.divide = function (e) {
  24228. if (p(e) || (e = m(e)), e.isZero()) throw Error("division by zero");
  24229. if (this.isZero()) return this.unsigned ? l : y;
  24230. var t, i, n;
  24231. if (this.unsigned) {
  24232. if (e.unsigned || (e = e.toUnsigned()), e.gt(this)) return l;
  24233. if (e.gt(this.shru(1))) return d;
  24234. n = l
  24235. } else {
  24236. if (this.eq(E)) return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)), n = t.add(i.div(e)));
  24237. if (e.eq(E)) return this.unsigned ? l : y;
  24238. if (this.isNegative()) return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  24239. if (e.isNegative()) return this.div(e.neg()).neg();
  24240. n = y
  24241. }
  24242. for (i = this; i.gte(e);) {
  24243. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  24244. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i);) s = (a = f(t -= o, this.unsigned)).mul(e);
  24245. a.isZero() && (a = c), n = n.add(a), i = i.sub(s)
  24246. }
  24247. return n
  24248. }, t.div = t.divide, t.modulo = function (e) {
  24249. return p(e) || (e = m(e)), this.sub(this.div(e).mul(e))
  24250. }, t.mod = t.modulo, t.not = function () {
  24251. return g(~this.low, ~this.high, this.unsigned)
  24252. }, t.and = function (e) {
  24253. return p(e) || (e = m(e)), g(this.low & e.low, this.high & e.high, this.unsigned)
  24254. }, t.or = function (e) {
  24255. return p(e) || (e = m(e)), g(this.low | e.low, this.high | e.high, this.unsigned)
  24256. }, t.xor = function (e) {
  24257. return p(e) || (e = m(e)), g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  24258. }, t.shiftLeft = function (e) {
  24259. return p(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  24260. }, t.shl = t.shiftLeft, t.shiftRight = function (e) {
  24261. return p(e) && (e = e.toInt()), 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  24262. }, t.shr = t.shiftRight, t.shiftRightUnsigned = function (e) {
  24263. if (p(e) && (e = e.toInt()), 0 === (e &= 63)) return this;
  24264. var t = this.high;
  24265. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  24266. }, t.shru = t.shiftRightUnsigned, t.toSigned = function () {
  24267. return this.unsigned ? g(this.low, this.high, !1) : this
  24268. }, t.toUnsigned = function () {
  24269. return this.unsigned ? this : g(this.low, this.high, !0)
  24270. }, t.toBytes = function (e) {
  24271. return e ? this.toBytesLE() : this.toBytesBE()
  24272. }, t.toBytesLE = function () {
  24273. var e = this.high,
  24274. t = this.low;
  24275. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  24276. }, t.toBytesBE = function () {
  24277. var e = this.high,
  24278. t = this.low;
  24279. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  24280. }, n
  24281. }, "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  24282. }, {}],
  24283. 217: [function (e, t, i) {
  24284. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  24285. REVISION: "75"
  24286. };
  24287. function Ii(e, t) {
  24288. return e.distance - t.distance
  24289. }
  24290. function Ei(e, t, i, n) {
  24291. if (!1 !== e.visible && (e.raycast(t, i), !0 === n))
  24292. for (var r = e.children, o = 0, a = r.length; o < a; o++) Ei(r[o], t, i, !0)
  24293. }
  24294. function _i(e, t, i) {
  24295. return i < 0 && (i += 1), 1 < i && (i -= 1), i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  24296. }
  24297. function bi(e, t, i, n, r, o, a) {
  24298. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt), r.multiplyScalar(Vt.x), o.multiplyScalar(Vt.y), a.multiplyScalar(Vt.z), r.add(o).add(a), r.clone()
  24299. }
  24300. function wi(e, t, i, n, r, o, a) {
  24301. var s = e.material;
  24302. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a))) return null;
  24303. Ut.copy(a), Ut.applyMatrix4(e.matrixWorld);
  24304. var l = t.ray.origin.distanceTo(Ut);
  24305. return l < t.near || l > t.far ? null : {
  24306. distance: l,
  24307. point: Ut.clone(),
  24308. object: e
  24309. }
  24310. }
  24311. function Ti(e, t, i, n, r, o, a, s) {
  24312. Mt.fromArray(n, 3 * o), Rt.fromArray(n, 3 * a), Pt.fromArray(n, 3 * s);
  24313. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  24314. return l && (r && (Nt.fromArray(r, 2 * o), Ft.fromArray(r, 2 * a), Bt.fromArray(r, 2 * s), l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)), l.face = new Ci.Face3(o, a, s, Ci.Triangle.normal(Mt, Rt, Pt)), l.faceIndex = o), l
  24315. }
  24316. function xi() {}
  24317. function Si(e, t, i, n, r, o) {
  24318. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  24319. if (s = e[o[t]].x, l = e[o[t]].y, c = e[o[i]].x, h = e[o[i]].y, u = e[o[n]].x, d = e[o[n]].y, Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s)) return !1;
  24320. for (g = u - c, m = d - h, v = s - u, y = l - d, A = c - s, C = h - l, a = 0; a < r; a++)
  24321. if (p = e[o[a]].x, f = e[o[a]].y, !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s), E = v * (f - d) - y * (p - u), g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON)) return !1;
  24322. return !0
  24323. }
  24324. function Mi(e) {
  24325. switch (e) {
  24326. case Ci.LinearEncoding:
  24327. return ["Linear", "( value )"];
  24328. case Ci.sRGBEncoding:
  24329. return ["sRGB", "( value )"];
  24330. case Ci.RGBEEncoding:
  24331. return ["RGBE", "( value )"];
  24332. case Ci.RGBM7Encoding:
  24333. return ["RGBM", "( value, 7.0 )"];
  24334. case Ci.RGBM16Encoding:
  24335. return ["RGBM", "( value, 16.0 )"];
  24336. case Ci.RGBDEncoding:
  24337. return ["RGBD", "( value, 256.0 )"];
  24338. case Ci.GammaEncoding:
  24339. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  24340. default:
  24341. throw new Error("unsupported encoding: " + e)
  24342. }
  24343. }
  24344. function Ri(e, t) {
  24345. var i = Mi(t);
  24346. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  24347. }
  24348. function Pi(e) {
  24349. return "" !== e
  24350. }
  24351. function Oi(e, t) {
  24352. 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)
  24353. }
  24354. function Li(e) {
  24355. return e.replace(/#include +<([\w\d.]+)>/g, function (e, t) {
  24356. var i = Ci.ShaderChunk[t];
  24357. if (void 0 === i) throw new Error("Can not resolve #include <" + t + ">");
  24358. return Li(i)
  24359. })
  24360. }
  24361. function Di(e) {
  24362. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function (e, t, i, n) {
  24363. for (var r = "", o = parseInt(t); o < parseInt(i); o++) r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  24364. return r
  24365. })
  24366. }
  24367. function Ni(e, t, i, n) {
  24368. gi.set(t, i, n).unproject(mi);
  24369. var r = fi[e];
  24370. if (void 0 !== r)
  24371. for (var o = 0, a = r.length; o < a; o++) pi.vertices[r[o]].copy(gi)
  24372. }
  24373. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci), void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)), void 0 === Math.sign && (Math.sign = function (e) {
  24374. return e < 0 ? -1 : 0 < e ? 1 : +e
  24375. }), void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  24376. get: function () {
  24377. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  24378. }
  24379. }), void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  24380. writable: !0,
  24381. configurable: !0,
  24382. value: function (e) {
  24383. "use strict";
  24384. if (null == e) throw new TypeError("Cannot convert first argument to object");
  24385. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  24386. var r = arguments[i];
  24387. if (null != r) {
  24388. r = Object(r);
  24389. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  24390. var l = o[a],
  24391. c = Object.getOwnPropertyDescriptor(r, l);
  24392. void 0 !== c && c.enumerable && (t[l] = r[l])
  24393. }
  24394. }
  24395. }
  24396. return t
  24397. }
  24398. }), Ci.MOUSE = {
  24399. LEFT: 0,
  24400. MIDDLE: 1,
  24401. RIGHT: 2
  24402. }, Ci.CullFaceNone = 0, Ci.CullFaceBack = 1, Ci.CullFaceFront = 2, Ci.CullFaceFrontBack = 3, Ci.FrontFaceDirectionCW = 0, Ci.FrontFaceDirectionCCW = 1, Ci.BasicShadowMap = 0, Ci.PCFShadowMap = 1, Ci.PCFSoftShadowMap = 2, Ci.FrontSide = 0, Ci.BackSide = 1, Ci.DoubleSide = 2, Ci.FlatShading = 1, Ci.SmoothShading = 2, Ci.NoColors = 0, Ci.FaceColors = 1, Ci.VertexColors = 2, Ci.NoBlending = 0, Ci.NormalBlending = 1, Ci.AdditiveBlending = 2, Ci.SubtractiveBlending = 3, Ci.MultiplyBlending = 4, Ci.CustomBlending = 5, Ci.AddEquation = 100, Ci.SubtractEquation = 101, Ci.ReverseSubtractEquation = 102, Ci.MinEquation = 103, Ci.MaxEquation = 104, Ci.ZeroFactor = 200, Ci.OneFactor = 201, Ci.SrcColorFactor = 202, Ci.OneMinusSrcColorFactor = 203, Ci.SrcAlphaFactor = 204, Ci.OneMinusSrcAlphaFactor = 205, Ci.DstAlphaFactor = 206, Ci.OneMinusDstAlphaFactor = 207, Ci.DstColorFactor = 208, Ci.OneMinusDstColorFactor = 209, Ci.SrcAlphaSaturateFactor = 210, Ci.NeverDepth = 0, Ci.AlwaysDepth = 1, Ci.LessDepth = 2, Ci.LessEqualDepth = 3, Ci.EqualDepth = 4, Ci.GreaterEqualDepth = 5, Ci.GreaterDepth = 6, Ci.NotEqualDepth = 7, Ci.MultiplyOperation = 0, Ci.MixOperation = 1, Ci.AddOperation = 2, Ci.NoToneMapping = 0, Ci.LinearToneMapping = 1, Ci.ReinhardToneMapping = 2, Ci.Uncharted2ToneMapping = 3, Ci.CineonToneMapping = 4, Ci.UVMapping = 300, Ci.CubeReflectionMapping = 301, Ci.CubeRefractionMapping = 302, Ci.EquirectangularReflectionMapping = 303, Ci.EquirectangularRefractionMapping = 304, Ci.SphericalReflectionMapping = 305, Ci.CubeUVReflectionMapping = 306, Ci.CubeUVRefractionMapping = 307, Ci.RepeatWrapping = 1e3, Ci.ClampToEdgeWrapping = 1001, Ci.MirroredRepeatWrapping = 1002, Ci.NearestFilter = 1003, Ci.NearestMipMapNearestFilter = 1004, Ci.NearestMipMapLinearFilter = 1005, Ci.LinearFilter = 1006, Ci.LinearMipMapNearestFilter = 1007, Ci.LinearMipMapLinearFilter = 1008, Ci.UnsignedByteType = 1009, Ci.ByteType = 1010, Ci.ShortType = 1011, Ci.UnsignedShortType = 1012, Ci.IntType = 1013, Ci.UnsignedIntType = 1014, Ci.FloatType = 1015, Ci.HalfFloatType = 1025, Ci.UnsignedShort4444Type = 1016, Ci.UnsignedShort5551Type = 1017, Ci.UnsignedShort565Type = 1018, Ci.AlphaFormat = 1019, Ci.RGBFormat = 1020, Ci.RGBAFormat = 1021, Ci.LuminanceFormat = 1022, Ci.LuminanceAlphaFormat = 1023, Ci.RGBEFormat = Ci.RGBAFormat, Ci.RGB_S3TC_DXT1_Format = 2001, Ci.RGBA_S3TC_DXT1_Format = 2002, Ci.RGBA_S3TC_DXT3_Format = 2003, Ci.RGBA_S3TC_DXT5_Format = 2004, Ci.RGB_PVRTC_4BPPV1_Format = 2100, Ci.RGB_PVRTC_2BPPV1_Format = 2101, Ci.RGBA_PVRTC_4BPPV1_Format = 2102, Ci.RGBA_PVRTC_2BPPV1_Format = 2103, Ci.RGB_ETC1_Format = 2151, Ci.LoopOnce = 2200, Ci.LoopRepeat = 2201, Ci.LoopPingPong = 2202, Ci.InterpolateDiscrete = 2300, Ci.InterpolateLinear = 2301, Ci.InterpolateSmooth = 2302, Ci.ZeroCurvatureEnding = 2400, Ci.ZeroSlopeEnding = 2401, Ci.WrapAroundEnding = 2402, Ci.TrianglesDrawMode = 0, Ci.TriangleStripDrawMode = 1, Ci.TriangleFanDrawMode = 2, Ci.LinearEncoding = 3e3, Ci.sRGBEncoding = 3001, Ci.GammaEncoding = 3007, Ci.RGBEEncoding = 3002, Ci.LogLuvEncoding = 3003, Ci.RGBM7Encoding = 3004, Ci.RGBM16Encoding = 3005, Ci.RGBDEncoding = 3006, Ci.Color = function (e) {
  24403. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  24404. }, Ci.Color.prototype = {
  24405. constructor: Ci.Color,
  24406. r: 1,
  24407. g: 1,
  24408. b: 1,
  24409. set: function (e) {
  24410. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e), this
  24411. },
  24412. setScalar: function (e) {
  24413. this.r = e, this.g = e, this.b = e
  24414. },
  24415. setHex: function (e) {
  24416. return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (255 & e) / 255, this
  24417. },
  24418. setRGB: function (e, t, i) {
  24419. return this.r = e, this.g = t, this.b = i, this
  24420. },
  24421. setHSL: function (e, t, i) {
  24422. if (e = Ci.Math.euclideanModulo(e, 1), t = Ci.Math.clamp(t, 0, 1), i = Ci.Math.clamp(i, 0, 1), 0 === t) this.r = this.g = this.b = i;
  24423. else {
  24424. var n = i <= .5 ? i * (1 + t) : i + t - i * t,
  24425. r = 2 * i - n;
  24426. this.r = _i(r, n, e + 1 / 3), this.g = _i(r, n, e), this.b = _i(r, n, e - 1 / 3)
  24427. }
  24428. return this
  24429. },
  24430. setStyle: function (t) {
  24431. function e(e) {
  24432. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  24433. }
  24434. var i;
  24435. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  24436. var n, r = i[1],
  24437. o = i[2];
  24438. switch (r) {
  24439. case "rgb":
  24440. case "rgba":
  24441. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) return this.r = Math.min(255, parseInt(n[1], 10)) / 255, this.g = Math.min(255, parseInt(n[2], 10)) / 255, this.b = Math.min(255, parseInt(n[3], 10)) / 255, e(n[5]), this;
  24442. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) return this.r = Math.min(100, parseInt(n[1], 10)) / 100, this.g = Math.min(100, parseInt(n[2], 10)) / 100, this.b = Math.min(100, parseInt(n[3], 10)) / 100, e(n[5]), this;
  24443. break;
  24444. case "hsl":
  24445. case "hsla":
  24446. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  24447. var a = parseFloat(n[1]) / 360,
  24448. s = parseInt(n[2], 10) / 100,
  24449. l = parseInt(n[3], 10) / 100;
  24450. return e(n[5]), this.setHSL(a, s, l)
  24451. }
  24452. }
  24453. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  24454. var c, h = (c = i[1]).length;
  24455. if (3 === h) return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255, this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255, this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255, this;
  24456. if (6 === h) return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255, this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255, this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255, this
  24457. }
  24458. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  24459. return this
  24460. },
  24461. clone: function () {
  24462. return new this.constructor(this.r, this.g, this.b)
  24463. },
  24464. copy: function (e) {
  24465. return this.r = e.r, this.g = e.g, this.b = e.b, this
  24466. },
  24467. copyGammaToLinear: function (e, t) {
  24468. return void 0 === t && (t = 2), this.r = Math.pow(e.r, t), this.g = Math.pow(e.g, t), this.b = Math.pow(e.b, t), this
  24469. },
  24470. copyLinearToGamma: function (e, t) {
  24471. void 0 === t && (t = 2);
  24472. var i = 0 < t ? 1 / t : 1;
  24473. return this.r = Math.pow(e.r, i), this.g = Math.pow(e.g, i), this.b = Math.pow(e.b, i), this
  24474. },
  24475. convertGammaToLinear: function () {
  24476. var e = this.r,
  24477. t = this.g,
  24478. i = this.b;
  24479. return this.r = e * e, this.g = t * t, this.b = i * i, this
  24480. },
  24481. convertLinearToGamma: function () {
  24482. return this.r = Math.sqrt(this.r), this.g = Math.sqrt(this.g), this.b = Math.sqrt(this.b), this
  24483. },
  24484. getHex: function () {
  24485. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  24486. },
  24487. getHexString: function () {
  24488. return ("000000" + this.getHex().toString(16)).slice(-6)
  24489. },
  24490. getHSL: function (e) {
  24491. var t, i, n = e || {
  24492. h: 0,
  24493. s: 0,
  24494. l: 0
  24495. },
  24496. r = this.r,
  24497. o = this.g,
  24498. a = this.b,
  24499. s = Math.max(r, o, a),
  24500. l = Math.min(r, o, a),
  24501. c = (l + s) / 2;
  24502. if (l === s) i = t = 0;
  24503. else {
  24504. var h = s - l;
  24505. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l), s) {
  24506. case r:
  24507. t = (o - a) / h + (o < a ? 6 : 0);
  24508. break;
  24509. case o:
  24510. t = (a - r) / h + 2;
  24511. break;
  24512. case a:
  24513. t = (r - o) / h + 4
  24514. }
  24515. t /= 6
  24516. }
  24517. return n.h = t, n.s = i, n.l = c, n
  24518. },
  24519. getStyle: function () {
  24520. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  24521. },
  24522. offsetHSL: function (e, t, i) {
  24523. var n = this.getHSL();
  24524. return n.h += e, n.s += t, n.l += i, this.setHSL(n.h, n.s, n.l), this
  24525. },
  24526. add: function (e) {
  24527. return this.r += e.r, this.g += e.g, this.b += e.b, this
  24528. },
  24529. addColors: function (e, t) {
  24530. return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this
  24531. },
  24532. addScalar: function (e) {
  24533. return this.r += e, this.g += e, this.b += e, this
  24534. },
  24535. multiply: function (e) {
  24536. return this.r *= e.r, this.g *= e.g, this.b *= e.b, this
  24537. },
  24538. multiplyScalar: function (e) {
  24539. return this.r *= e, this.g *= e, this.b *= e, this
  24540. },
  24541. lerp: function (e, t) {
  24542. return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this
  24543. },
  24544. equals: function (e) {
  24545. return e.r === this.r && e.g === this.g && e.b === this.b
  24546. },
  24547. fromArray: function (e, t) {
  24548. return void 0 === t && (t = 0), this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this
  24549. },
  24550. toArray: function (e, t) {
  24551. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e
  24552. }
  24553. }, Ci.ColorKeywords = {
  24554. aliceblue: 15792383,
  24555. antiquewhite: 16444375,
  24556. aqua: 65535,
  24557. aquamarine: 8388564,
  24558. azure: 15794175,
  24559. beige: 16119260,
  24560. bisque: 16770244,
  24561. black: 0,
  24562. blanchedalmond: 16772045,
  24563. blue: 255,
  24564. blueviolet: 9055202,
  24565. brown: 10824234,
  24566. burlywood: 14596231,
  24567. cadetblue: 6266528,
  24568. chartreuse: 8388352,
  24569. chocolate: 13789470,
  24570. coral: 16744272,
  24571. cornflowerblue: 6591981,
  24572. cornsilk: 16775388,
  24573. crimson: 14423100,
  24574. cyan: 65535,
  24575. darkblue: 139,
  24576. darkcyan: 35723,
  24577. darkgoldenrod: 12092939,
  24578. darkgray: 11119017,
  24579. darkgreen: 25600,
  24580. darkgrey: 11119017,
  24581. darkkhaki: 12433259,
  24582. darkmagenta: 9109643,
  24583. darkolivegreen: 5597999,
  24584. darkorange: 16747520,
  24585. darkorchid: 10040012,
  24586. darkred: 9109504,
  24587. darksalmon: 15308410,
  24588. darkseagreen: 9419919,
  24589. darkslateblue: 4734347,
  24590. darkslategray: 3100495,
  24591. darkslategrey: 3100495,
  24592. darkturquoise: 52945,
  24593. darkviolet: 9699539,
  24594. deeppink: 16716947,
  24595. deepskyblue: 49151,
  24596. dimgray: 6908265,
  24597. dimgrey: 6908265,
  24598. dodgerblue: 2003199,
  24599. firebrick: 11674146,
  24600. floralwhite: 16775920,
  24601. forestgreen: 2263842,
  24602. fuchsia: 16711935,
  24603. gainsboro: 14474460,
  24604. ghostwhite: 16316671,
  24605. gold: 16766720,
  24606. goldenrod: 14329120,
  24607. gray: 8421504,
  24608. green: 32768,
  24609. greenyellow: 11403055,
  24610. grey: 8421504,
  24611. honeydew: 15794160,
  24612. hotpink: 16738740,
  24613. indianred: 13458524,
  24614. indigo: 4915330,
  24615. ivory: 16777200,
  24616. khaki: 15787660,
  24617. lavender: 15132410,
  24618. lavenderblush: 16773365,
  24619. lawngreen: 8190976,
  24620. lemonchiffon: 16775885,
  24621. lightblue: 11393254,
  24622. lightcoral: 15761536,
  24623. lightcyan: 14745599,
  24624. lightgoldenrodyellow: 16448210,
  24625. lightgray: 13882323,
  24626. lightgreen: 9498256,
  24627. lightgrey: 13882323,
  24628. lightpink: 16758465,
  24629. lightsalmon: 16752762,
  24630. lightseagreen: 2142890,
  24631. lightskyblue: 8900346,
  24632. lightslategray: 7833753,
  24633. lightslategrey: 7833753,
  24634. lightsteelblue: 11584734,
  24635. lightyellow: 16777184,
  24636. lime: 65280,
  24637. limegreen: 3329330,
  24638. linen: 16445670,
  24639. magenta: 16711935,
  24640. maroon: 8388608,
  24641. mediumaquamarine: 6737322,
  24642. mediumblue: 205,
  24643. mediumorchid: 12211667,
  24644. mediumpurple: 9662683,
  24645. mediumseagreen: 3978097,
  24646. mediumslateblue: 8087790,
  24647. mediumspringgreen: 64154,
  24648. mediumturquoise: 4772300,
  24649. mediumvioletred: 13047173,
  24650. midnightblue: 1644912,
  24651. mintcream: 16121850,
  24652. mistyrose: 16770273,
  24653. moccasin: 16770229,
  24654. navajowhite: 16768685,
  24655. navy: 128,
  24656. oldlace: 16643558,
  24657. olive: 8421376,
  24658. olivedrab: 7048739,
  24659. orange: 16753920,
  24660. orangered: 16729344,
  24661. orchid: 14315734,
  24662. palegoldenrod: 15657130,
  24663. palegreen: 10025880,
  24664. paleturquoise: 11529966,
  24665. palevioletred: 14381203,
  24666. papayawhip: 16773077,
  24667. peachpuff: 16767673,
  24668. peru: 13468991,
  24669. pink: 16761035,
  24670. plum: 14524637,
  24671. powderblue: 11591910,
  24672. purple: 8388736,
  24673. red: 16711680,
  24674. rosybrown: 12357519,
  24675. royalblue: 4286945,
  24676. saddlebrown: 9127187,
  24677. salmon: 16416882,
  24678. sandybrown: 16032864,
  24679. seagreen: 3050327,
  24680. seashell: 16774638,
  24681. sienna: 10506797,
  24682. silver: 12632256,
  24683. skyblue: 8900331,
  24684. slateblue: 6970061,
  24685. slategray: 7372944,
  24686. slategrey: 7372944,
  24687. snow: 16775930,
  24688. springgreen: 65407,
  24689. steelblue: 4620980,
  24690. tan: 13808780,
  24691. teal: 32896,
  24692. thistle: 14204888,
  24693. tomato: 16737095,
  24694. turquoise: 4251856,
  24695. violet: 15631086,
  24696. wheat: 16113331,
  24697. white: 16777215,
  24698. whitesmoke: 16119285,
  24699. yellow: 16776960,
  24700. yellowgreen: 10145074
  24701. }, Ci.Quaternion = function (e, t, i, n) {
  24702. this._x = e || 0, this._y = t || 0, this._z = i || 0, this._w = void 0 !== n ? n : 1
  24703. }, Ci.Quaternion.prototype = {
  24704. constructor: Ci.Quaternion,
  24705. get x() {
  24706. return this._x
  24707. },
  24708. set x(e) {
  24709. this._x = e, this.onChangeCallback()
  24710. },
  24711. get y() {
  24712. return this._y
  24713. },
  24714. set y(e) {
  24715. this._y = e, this.onChangeCallback()
  24716. },
  24717. get z() {
  24718. return this._z
  24719. },
  24720. set z(e) {
  24721. this._z = e, this.onChangeCallback()
  24722. },
  24723. get w() {
  24724. return this._w
  24725. },
  24726. set w(e) {
  24727. this._w = e, this.onChangeCallback()
  24728. },
  24729. set: function (e, t, i, n) {
  24730. return this._x = e, this._y = t, this._z = i, this._w = n, this.onChangeCallback(), this
  24731. },
  24732. clone: function () {
  24733. return new this.constructor(this._x, this._y, this._z, this._w)
  24734. },
  24735. copy: function (e) {
  24736. return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this.onChangeCallback(), this
  24737. },
  24738. setFromEuler: function (e, t) {
  24739. if (e instanceof Ci.Euler == 0) throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  24740. var i = Math.cos(e._x / 2),
  24741. n = Math.cos(e._y / 2),
  24742. r = Math.cos(e._z / 2),
  24743. o = Math.sin(e._x / 2),
  24744. a = Math.sin(e._y / 2),
  24745. s = Math.sin(e._z / 2),
  24746. l = e.order;
  24747. return "XYZ" === l ? (this._x = o * n * r + i * a * s, this._y = i * a * r - o * n * s, this._z = i * n * s + o * a * r, this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s, this._y = i * a * r - o * n * s, this._z = i * n * s - o * a * r, this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s, this._y = i * a * r + o * n * s, this._z = i * n * s + o * a * r, this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s, this._y = i * a * r + o * n * s, this._z = i * n * s - o * a * r, this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s, this._y = i * a * r + o * n * s, this._z = i * n * s - o * a * r, this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s, this._y = i * a * r - o * n * s, this._z = i * n * s + o * a * r, this._w = i * n * r + o * a * s), !1 !== t && this.onChangeCallback(), this
  24748. },
  24749. setFromAxisAngle: function (e, t) {
  24750. var i = t / 2,
  24751. n = Math.sin(i);
  24752. return this._x = e.x * n, this._y = e.y * n, this._z = e.z * n, this._w = Math.cos(i), this.onChangeCallback(), this
  24753. },
  24754. setFromRotationMatrix: function (e) {
  24755. var t, i = e.elements,
  24756. n = i[0],
  24757. r = i[4],
  24758. o = i[8],
  24759. a = i[1],
  24760. s = i[5],
  24761. l = i[9],
  24762. c = i[2],
  24763. h = i[6],
  24764. u = i[10],
  24765. d = n + s + u;
  24766. return 0 < d ? (t = .5 / Math.sqrt(d + 1), this._w = .25 / t, this._x = (h - l) * t, this._y = (o - c) * t, this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u), this._w = (h - l) / t, this._x = .25 * t, this._y = (r + a) / t, this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u), this._w = (o - c) / t, this._x = (r + a) / t, this._y = .25 * t, this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s), this._w = (a - r) / t, this._x = (o + c) / t, this._y = (l + h) / t, this._z = .25 * t), this.onChangeCallback(), this
  24767. },
  24768. setFromUnitVectors: function (e, t) {
  24769. return void 0 === Be && (Be = new Ci.Vector3), (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0, Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t), this._x = Be.x, this._y = Be.y, this._z = Be.z, this._w = Ve, this.normalize(), this
  24770. },
  24771. inverse: function () {
  24772. return this.conjugate().normalize(), this
  24773. },
  24774. conjugate: function () {
  24775. return this._x *= -1, this._y *= -1, this._z *= -1, this.onChangeCallback(), this
  24776. },
  24777. dot: function (e) {
  24778. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  24779. },
  24780. lengthSq: function () {
  24781. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  24782. },
  24783. length: function () {
  24784. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  24785. },
  24786. normalize: function () {
  24787. var e = this.length();
  24788. return 0 === e ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this.onChangeCallback(), this
  24789. },
  24790. multiply: function (e, t) {
  24791. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  24792. },
  24793. multiplyQuaternions: function (e, t) {
  24794. var i = e._x,
  24795. n = e._y,
  24796. r = e._z,
  24797. o = e._w,
  24798. a = t._x,
  24799. s = t._y,
  24800. l = t._z,
  24801. c = t._w;
  24802. return this._x = i * c + o * a + n * l - r * s, this._y = n * c + o * s + r * a - i * l, this._z = r * c + o * l + i * s - n * a, this._w = o * c - i * a - n * s - r * l, this.onChangeCallback(), this
  24803. },
  24804. slerp: function (e, t) {
  24805. if (0 === t) return this;
  24806. if (1 === t) return this.copy(e);
  24807. var i = this._x,
  24808. n = this._y,
  24809. r = this._z,
  24810. o = this._w,
  24811. a = o * e._w + i * e._x + n * e._y + r * e._z;
  24812. if (a < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, a = -a) : this.copy(e), 1 <= a) return this._w = o, this._x = i, this._y = n, this._z = r, this;
  24813. var s = Math.sqrt(1 - a * a);
  24814. if (Math.abs(s) < .001) return this._w = .5 * (o + this._w), this._x = .5 * (i + this._x), this._y = .5 * (n + this._y), this._z = .5 * (r + this._z), this;
  24815. var l = Math.atan2(s, a),
  24816. c = Math.sin((1 - t) * l) / s,
  24817. h = Math.sin(t * l) / s;
  24818. return this._w = o * c + this._w * h, this._x = i * c + this._x * h, this._y = n * c + this._y * h, this._z = r * c + this._z * h, this.onChangeCallback(), this
  24819. },
  24820. equals: function (e) {
  24821. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  24822. },
  24823. fromArray: function (e, t) {
  24824. return void 0 === t && (t = 0), this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this.onChangeCallback(), this
  24825. },
  24826. toArray: function (e, t) {
  24827. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e
  24828. },
  24829. onChange: function (e) {
  24830. return this.onChangeCallback = e, this
  24831. },
  24832. onChangeCallback: function () {}
  24833. }, Object.assign(Ci.Quaternion, {
  24834. slerp: function (e, t, i, n) {
  24835. return i.copy(e).slerp(t, n)
  24836. },
  24837. slerpFlat: function (e, t, i, n, r, o, a) {
  24838. var s = i[n + 0],
  24839. l = i[n + 1],
  24840. c = i[n + 2],
  24841. h = i[n + 3],
  24842. u = r[o + 0],
  24843. d = r[o + 1],
  24844. p = r[o + 2],
  24845. f = r[o + 3];
  24846. if (h !== f || s !== u || l !== d || c !== p) {
  24847. var g = 1 - a,
  24848. m = s * u + l * d + c * p + h * f,
  24849. v = 0 <= m ? 1 : -1,
  24850. y = 1 - m * m;
  24851. if (y > Number.EPSILON) {
  24852. var A = Math.sqrt(y),
  24853. C = Math.atan2(A, m * v);
  24854. g = Math.sin(g * C) / A, a = Math.sin(a * C) / A
  24855. }
  24856. var I = a * v;
  24857. if (s = s * g + u * I, l = l * g + d * I, c = c * g + p * I, h = h * g + f * I, g === 1 - a) {
  24858. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  24859. s *= E, l *= E, c *= E, h *= E
  24860. }
  24861. }
  24862. e[t] = s, e[t + 1] = l, e[t + 2] = c, e[t + 3] = h
  24863. }
  24864. }), Ci.Vector2 = function (e, t) {
  24865. this.x = e || 0, this.y = t || 0
  24866. }, Ci.Vector2.prototype = {
  24867. constructor: Ci.Vector2,
  24868. get width() {
  24869. return this.x
  24870. },
  24871. set width(e) {
  24872. this.x = e
  24873. },
  24874. get height() {
  24875. return this.y
  24876. },
  24877. set height(e) {
  24878. this.y = e
  24879. },
  24880. set: function (e, t) {
  24881. return this.x = e, this.y = t, this
  24882. },
  24883. setScalar: function (e) {
  24884. return this.x = e, this.y = e, this
  24885. },
  24886. setX: function (e) {
  24887. return this.x = e, this
  24888. },
  24889. setY: function (e) {
  24890. return this.y = e, this
  24891. },
  24892. setComponent: function (e, t) {
  24893. switch (e) {
  24894. case 0:
  24895. this.x = t;
  24896. break;
  24897. case 1:
  24898. this.y = t;
  24899. break;
  24900. default:
  24901. throw new Error("index is out of range: " + e)
  24902. }
  24903. },
  24904. getComponent: function (e) {
  24905. switch (e) {
  24906. case 0:
  24907. return this.x;
  24908. case 1:
  24909. return this.y;
  24910. default:
  24911. throw new Error("index is out of range: " + e)
  24912. }
  24913. },
  24914. clone: function () {
  24915. return new this.constructor(this.x, this.y)
  24916. },
  24917. copy: function (e) {
  24918. return this.x = e.x, this.y = e.y, this
  24919. },
  24920. add: function (e, t) {
  24921. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this)
  24922. },
  24923. addScalar: function (e) {
  24924. return this.x += e, this.y += e, this
  24925. },
  24926. addVectors: function (e, t) {
  24927. return this.x = e.x + t.x, this.y = e.y + t.y, this
  24928. },
  24929. addScaledVector: function (e, t) {
  24930. return this.x += e.x * t, this.y += e.y * t, this
  24931. },
  24932. sub: function (e, t) {
  24933. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this)
  24934. },
  24935. subScalar: function (e) {
  24936. return this.x -= e, this.y -= e, this
  24937. },
  24938. subVectors: function (e, t) {
  24939. return this.x = e.x - t.x, this.y = e.y - t.y, this
  24940. },
  24941. multiply: function (e) {
  24942. return this.x *= e.x, this.y *= e.y, this
  24943. },
  24944. multiplyScalar: function (e) {
  24945. return isFinite(e) ? (this.x *= e, this.y *= e) : (this.x = 0, this.y = 0), this
  24946. },
  24947. divide: function (e) {
  24948. return this.x /= e.x, this.y /= e.y, this
  24949. },
  24950. divideScalar: function (e) {
  24951. return this.multiplyScalar(1 / e)
  24952. },
  24953. min: function (e) {
  24954. return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this
  24955. },
  24956. max: function (e) {
  24957. return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this
  24958. },
  24959. clamp: function (e, t) {
  24960. return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this
  24961. },
  24962. clampScalar: function (e, t) {
  24963. return void 0 === Ne && (Ne = new Ci.Vector2, Fe = new Ci.Vector2), Ne.set(e, e), Fe.set(t, t), this.clamp(Ne, Fe)
  24964. },
  24965. clampLength: function (e, t) {
  24966. var i = this.length();
  24967. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  24968. },
  24969. floor: function () {
  24970. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
  24971. },
  24972. ceil: function () {
  24973. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
  24974. },
  24975. round: function () {
  24976. return this.x = Math.round(this.x), this.y = Math.round(this.y), this
  24977. },
  24978. roundToZero: function () {
  24979. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this
  24980. },
  24981. negate: function () {
  24982. return this.x = -this.x, this.y = -this.y, this
  24983. },
  24984. dot: function (e) {
  24985. return this.x * e.x + this.y * e.y
  24986. },
  24987. lengthSq: function () {
  24988. return this.x * this.x + this.y * this.y
  24989. },
  24990. length: function () {
  24991. return Math.sqrt(this.x * this.x + this.y * this.y)
  24992. },
  24993. lengthManhattan: function () {
  24994. return Math.abs(this.x) + Math.abs(this.y)
  24995. },
  24996. normalize: function () {
  24997. return this.divideScalar(this.length())
  24998. },
  24999. angle: function () {
  25000. var e = Math.atan2(this.y, this.x);
  25001. return e < 0 && (e += 2 * Math.PI), e
  25002. },
  25003. distanceTo: function (e) {
  25004. return Math.sqrt(this.distanceToSquared(e))
  25005. },
  25006. distanceToSquared: function (e) {
  25007. var t = this.x - e.x,
  25008. i = this.y - e.y;
  25009. return t * t + i * i
  25010. },
  25011. setLength: function (e) {
  25012. return this.multiplyScalar(e / this.length())
  25013. },
  25014. lerp: function (e, t) {
  25015. return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this
  25016. },
  25017. lerpVectors: function (e, t, i) {
  25018. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  25019. },
  25020. equals: function (e) {
  25021. return e.x === this.x && e.y === this.y
  25022. },
  25023. fromArray: function (e, t) {
  25024. return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this
  25025. },
  25026. toArray: function (e, t) {
  25027. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e
  25028. },
  25029. fromAttribute: function (e, t, i) {
  25030. return void 0 === i && (i = 0), t = t * e.itemSize + i, this.x = e.array[t], this.y = e.array[t + 1], this
  25031. },
  25032. rotateAround: function (e, t) {
  25033. var i = Math.cos(t),
  25034. n = Math.sin(t),
  25035. r = this.x - e.x,
  25036. o = this.y - e.y;
  25037. return this.x = r * i - o * n + e.x, this.y = r * n + o * i + e.y, this
  25038. }
  25039. }, Ci.Vector3 = function (e, t, i) {
  25040. this.x = e || 0, this.y = t || 0, this.z = i || 0
  25041. }, Ci.Vector3.prototype = {
  25042. constructor: Ci.Vector3,
  25043. set: function (e, t, i) {
  25044. return this.x = e, this.y = t, this.z = i, this
  25045. },
  25046. setScalar: function (e) {
  25047. return this.x = e, this.y = e, this.z = e, this
  25048. },
  25049. setX: function (e) {
  25050. return this.x = e, this
  25051. },
  25052. setY: function (e) {
  25053. return this.y = e, this
  25054. },
  25055. setZ: function (e) {
  25056. return this.z = e, this
  25057. },
  25058. setComponent: function (e, t) {
  25059. switch (e) {
  25060. case 0:
  25061. this.x = t;
  25062. break;
  25063. case 1:
  25064. this.y = t;
  25065. break;
  25066. case 2:
  25067. this.z = t;
  25068. break;
  25069. default:
  25070. throw new Error("index is out of range: " + e)
  25071. }
  25072. },
  25073. getComponent: function (e) {
  25074. switch (e) {
  25075. case 0:
  25076. return this.x;
  25077. case 1:
  25078. return this.y;
  25079. case 2:
  25080. return this.z;
  25081. default:
  25082. throw new Error("index is out of range: " + e)
  25083. }
  25084. },
  25085. clone: function () {
  25086. return new this.constructor(this.x, this.y, this.z)
  25087. },
  25088. copy: function (e) {
  25089. return this.x = e.x, this.y = e.y, this.z = e.z, this
  25090. },
  25091. add: function (e, t) {
  25092. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this)
  25093. },
  25094. addScalar: function (e) {
  25095. return this.x += e, this.y += e, this.z += e, this
  25096. },
  25097. addVectors: function (e, t) {
  25098. return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this
  25099. },
  25100. addScaledVector: function (e, t) {
  25101. return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this
  25102. },
  25103. sub: function (e, t) {
  25104. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this)
  25105. },
  25106. subScalar: function (e) {
  25107. return this.x -= e, this.y -= e, this.z -= e, this
  25108. },
  25109. subVectors: function (e, t) {
  25110. return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this
  25111. },
  25112. multiply: function (e, t) {
  25113. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t)) : (this.x *= e.x, this.y *= e.y, this.z *= e.z, this)
  25114. },
  25115. multiplyScalar: function (e) {
  25116. return isFinite(e) ? (this.x *= e, this.y *= e, this.z *= e) : (this.x = 0, this.y = 0, this.z = 0), this
  25117. },
  25118. multiplyVectors: function (e, t) {
  25119. return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this
  25120. },
  25121. applyEuler: function (e) {
  25122. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."), void 0 === De && (De = new Ci.Quaternion), this.applyQuaternion(De.setFromEuler(e)), this
  25123. },
  25124. applyAxisAngle: function (e, t) {
  25125. return void 0 === Le && (Le = new Ci.Quaternion), this.applyQuaternion(Le.setFromAxisAngle(e, t)), this
  25126. },
  25127. applyMatrix3: function (e) {
  25128. var t = this.x,
  25129. i = this.y,
  25130. n = this.z,
  25131. r = e.elements;
  25132. return this.x = r[0] * t + r[3] * i + r[6] * n, this.y = r[1] * t + r[4] * i + r[7] * n, this.z = r[2] * t + r[5] * i + r[8] * n, this
  25133. },
  25134. applyMatrix4: function (e) {
  25135. var t = this.x,
  25136. i = this.y,
  25137. n = this.z,
  25138. r = e.elements;
  25139. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12], this.y = r[1] * t + r[5] * i + r[9] * n + r[13], this.z = r[2] * t + r[6] * i + r[10] * n + r[14], this
  25140. },
  25141. applyProjection: function (e) {
  25142. var t = this.x,
  25143. i = this.y,
  25144. n = this.z,
  25145. r = e.elements,
  25146. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  25147. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o, this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o, this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o, this
  25148. },
  25149. applyQuaternion: function (e) {
  25150. var t = this.x,
  25151. i = this.y,
  25152. n = this.z,
  25153. r = e.x,
  25154. o = e.y,
  25155. a = e.z,
  25156. s = e.w,
  25157. l = s * t + o * n - a * i,
  25158. c = s * i + a * t - r * n,
  25159. h = s * n + r * i - o * t,
  25160. u = -r * t - o * i - a * n;
  25161. return this.x = l * s + u * -r + c * -a - h * -o, this.y = c * s + u * -o + h * -r - l * -a, this.z = h * s + u * -a + l * -o - c * -r, this
  25162. },
  25163. project: function (e) {
  25164. return void 0 === Oe && (Oe = new Ci.Matrix4), Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)), this.applyProjection(Oe)
  25165. },
  25166. unproject: function (e) {
  25167. return void 0 === Pe && (Pe = new Ci.Matrix4), Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)), this.applyProjection(Pe)
  25168. },
  25169. transformDirection: function (e) {
  25170. var t = this.x,
  25171. i = this.y,
  25172. n = this.z,
  25173. r = e.elements;
  25174. return this.x = r[0] * t + r[4] * i + r[8] * n, this.y = r[1] * t + r[5] * i + r[9] * n, this.z = r[2] * t + r[6] * i + r[10] * n, this.normalize(), this
  25175. },
  25176. divide: function (e) {
  25177. return this.x /= e.x, this.y /= e.y, this.z /= e.z, this
  25178. },
  25179. divideScalar: function (e) {
  25180. return this.multiplyScalar(1 / e)
  25181. },
  25182. min: function (e) {
  25183. return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this
  25184. },
  25185. max: function (e) {
  25186. return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this
  25187. },
  25188. clamp: function (e, t) {
  25189. return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this
  25190. },
  25191. clampScalar: function (e, t) {
  25192. return void 0 === Me && (Me = new Ci.Vector3, Re = new Ci.Vector3), Me.set(e, e, e), Re.set(t, t, t), this.clamp(Me, Re)
  25193. },
  25194. clampLength: function (e, t) {
  25195. var i = this.length();
  25196. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  25197. },
  25198. floor: function () {
  25199. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this
  25200. },
  25201. ceil: function () {
  25202. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this
  25203. },
  25204. round: function () {
  25205. return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this
  25206. },
  25207. roundToZero: function () {
  25208. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this
  25209. },
  25210. negate: function () {
  25211. return this.x = -this.x, this.y = -this.y, this.z = -this.z, this
  25212. },
  25213. dot: function (e) {
  25214. return this.x * e.x + this.y * e.y + this.z * e.z
  25215. },
  25216. lengthSq: function () {
  25217. return this.x * this.x + this.y * this.y + this.z * this.z
  25218. },
  25219. length: function () {
  25220. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  25221. },
  25222. lengthManhattan: function () {
  25223. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  25224. },
  25225. normalize: function () {
  25226. return this.divideScalar(this.length())
  25227. },
  25228. setLength: function (e) {
  25229. return this.multiplyScalar(e / this.length())
  25230. },
  25231. lerp: function (e, t) {
  25232. return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this
  25233. },
  25234. lerpVectors: function (e, t, i) {
  25235. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  25236. },
  25237. cross: function (e, t) {
  25238. if (void 0 !== t) return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t);
  25239. var i = this.x,
  25240. n = this.y,
  25241. r = this.z;
  25242. return this.x = n * e.z - r * e.y, this.y = r * e.x - i * e.z, this.z = i * e.y - n * e.x, this
  25243. },
  25244. crossVectors: function (e, t) {
  25245. var i = e.x,
  25246. n = e.y,
  25247. r = e.z,
  25248. o = t.x,
  25249. a = t.y,
  25250. s = t.z;
  25251. return this.x = n * s - r * a, this.y = r * o - i * s, this.z = i * a - n * o, this
  25252. },
  25253. projectOnVector: function (e) {
  25254. return void 0 === xe && (xe = new Ci.Vector3), xe.copy(e).normalize(), Se = this.dot(xe), this.copy(xe).multiplyScalar(Se)
  25255. },
  25256. projectOnPlane: function (e) {
  25257. return void 0 === Te && (Te = new Ci.Vector3), Te.copy(this).projectOnVector(e), this.sub(Te)
  25258. },
  25259. reflect: function (e) {
  25260. return void 0 === we && (we = new Ci.Vector3), this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  25261. },
  25262. angleTo: function (e) {
  25263. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  25264. return Math.acos(Ci.Math.clamp(t, -1, 1))
  25265. },
  25266. distanceTo: function (e) {
  25267. return Math.sqrt(this.distanceToSquared(e))
  25268. },
  25269. distanceToSquared: function (e) {
  25270. var t = this.x - e.x,
  25271. i = this.y - e.y,
  25272. n = this.z - e.z;
  25273. return t * t + i * i + n * n
  25274. },
  25275. setFromSpherical: function (e) {
  25276. var t = Math.sin(e.phi) * e.radius;
  25277. return this.x = t * Math.sin(e.theta), this.y = Math.cos(e.phi) * e.radius, this.z = t * Math.cos(e.theta), this
  25278. },
  25279. setFromMatrixPosition: function (e) {
  25280. return this.setFromMatrixColumn(e, 3)
  25281. },
  25282. setFromMatrixScale: function (e) {
  25283. var t = this.setFromMatrixColumn(e, 0).length(),
  25284. i = this.setFromMatrixColumn(e, 1).length(),
  25285. n = this.setFromMatrixColumn(e, 2).length();
  25286. return this.x = t, this.y = i, this.z = n, this
  25287. },
  25288. setFromMatrixColumn: function (e, t) {
  25289. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."), t = e = t), this.fromArray(e.elements, 4 * t)
  25290. },
  25291. equals: function (e) {
  25292. return e.x === this.x && e.y === this.y && e.z === this.z
  25293. },
  25294. fromArray: function (e, t) {
  25295. return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this
  25296. },
  25297. toArray: function (e, t) {
  25298. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e
  25299. },
  25300. fromAttribute: function (e, t, i) {
  25301. return void 0 === i && (i = 0), t = t * e.itemSize + i, this.x = e.array[t], this.y = e.array[t + 1], this.z = e.array[t + 2], this
  25302. }
  25303. }, Ci.Vector4 = function (e, t, i, n) {
  25304. this.x = e || 0, this.y = t || 0, this.z = i || 0, this.w = void 0 !== n ? n : 1
  25305. }, Ci.Vector4.prototype = {
  25306. constructor: Ci.Vector4,
  25307. set: function (e, t, i, n) {
  25308. return this.x = e, this.y = t, this.z = i, this.w = n, this
  25309. },
  25310. setScalar: function (e) {
  25311. return this.x = e, this.y = e, this.z = e, this.w = e, this
  25312. },
  25313. setX: function (e) {
  25314. return this.x = e, this
  25315. },
  25316. setY: function (e) {
  25317. return this.y = e, this
  25318. },
  25319. setZ: function (e) {
  25320. return this.z = e, this
  25321. },
  25322. setW: function (e) {
  25323. return this.w = e, this
  25324. },
  25325. setComponent: function (e, t) {
  25326. switch (e) {
  25327. case 0:
  25328. this.x = t;
  25329. break;
  25330. case 1:
  25331. this.y = t;
  25332. break;
  25333. case 2:
  25334. this.z = t;
  25335. break;
  25336. case 3:
  25337. this.w = t;
  25338. break;
  25339. default:
  25340. throw new Error("index is out of range: " + e)
  25341. }
  25342. },
  25343. getComponent: function (e) {
  25344. switch (e) {
  25345. case 0:
  25346. return this.x;
  25347. case 1:
  25348. return this.y;
  25349. case 2:
  25350. return this.z;
  25351. case 3:
  25352. return this.w;
  25353. default:
  25354. throw new Error("index is out of range: " + e)
  25355. }
  25356. },
  25357. clone: function () {
  25358. return new this.constructor(this.x, this.y, this.z, this.w)
  25359. },
  25360. copy: function (e) {
  25361. return this.x = e.x, this.y = e.y, this.z = e.z, this.w = void 0 !== e.w ? e.w : 1, this
  25362. },
  25363. add: function (e, t) {
  25364. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this)
  25365. },
  25366. addScalar: function (e) {
  25367. return this.x += e, this.y += e, this.z += e, this.w += e, this
  25368. },
  25369. addVectors: function (e, t) {
  25370. return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this
  25371. },
  25372. addScaledVector: function (e, t) {
  25373. return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this
  25374. },
  25375. sub: function (e, t) {
  25376. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this)
  25377. },
  25378. subScalar: function (e) {
  25379. return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this
  25380. },
  25381. subVectors: function (e, t) {
  25382. return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.w, this
  25383. },
  25384. multiplyScalar: function (e) {
  25385. return isFinite(e) ? (this.x *= e, this.y *= e, this.z *= e, this.w *= e) : (this.x = 0, this.y = 0, this.z = 0, this.w = 0), this
  25386. },
  25387. applyMatrix4: function (e) {
  25388. var t = this.x,
  25389. i = this.y,
  25390. n = this.z,
  25391. r = this.w,
  25392. o = e.elements;
  25393. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r, this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r, this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r, this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r, this
  25394. },
  25395. divideScalar: function (e) {
  25396. return this.multiplyScalar(1 / e)
  25397. },
  25398. setAxisAngleFromQuaternion: function (e) {
  25399. this.w = 2 * Math.acos(e.w);
  25400. var t = Math.sqrt(1 - e.w * e.w);
  25401. return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this
  25402. },
  25403. setAxisAngleFromRotationMatrix: function (e) {
  25404. var t, i, n, r, o = e.elements,
  25405. a = o[0],
  25406. s = o[4],
  25407. l = o[8],
  25408. c = o[1],
  25409. h = o[5],
  25410. u = o[9],
  25411. d = o[2],
  25412. p = o[6],
  25413. f = o[10];
  25414. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  25415. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1) return this.set(1, 0, 0, 0), this;
  25416. t = Math.PI;
  25417. var g = (a + 1) / 2,
  25418. m = (h + 1) / 2,
  25419. v = (f + 1) / 2,
  25420. y = (s + c) / 4,
  25421. A = (l + d) / 4,
  25422. C = (u + p) / 4;
  25423. return m < g && v < g ? r = g < .01 ? (i = 0, n = .707106781) : (n = y / (i = Math.sqrt(g)), A / i) : v < m ? r = m < .01 ? (n = 0, i = .707106781) : (i = y / (n = Math.sqrt(m)), C / n) : v < .01 ? (n = i = .707106781, r = 0) : (i = A / (r = Math.sqrt(v)), n = C / r), this.set(i, n, r, t), this
  25424. }
  25425. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  25426. return Math.abs(I) < .001 && (I = 1), this.x = (p - u) / I, this.y = (l - d) / I, this.z = (c - s) / I, this.w = Math.acos((a + h + f - 1) / 2), this
  25427. },
  25428. min: function (e) {
  25429. return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this
  25430. },
  25431. max: function (e) {
  25432. return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this.w = Math.max(this.w, e.w), this
  25433. },
  25434. clamp: function (e, t) {
  25435. return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this.w = Math.max(e.w, Math.min(t.w, this.w)), this
  25436. },
  25437. clampScalar: function (e, t) {
  25438. return void 0 === _e && (_e = new Ci.Vector4, be = new Ci.Vector4), _e.set(e, e, e, e), be.set(t, t, t, t), this.clamp(_e, be)
  25439. },
  25440. floor: function () {
  25441. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this
  25442. },
  25443. ceil: function () {
  25444. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this
  25445. },
  25446. round: function () {
  25447. return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this
  25448. },
  25449. roundToZero: function () {
  25450. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w), this
  25451. },
  25452. negate: function () {
  25453. return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this
  25454. },
  25455. dot: function (e) {
  25456. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  25457. },
  25458. lengthSq: function () {
  25459. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  25460. },
  25461. length: function () {
  25462. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  25463. },
  25464. lengthManhattan: function () {
  25465. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  25466. },
  25467. normalize: function () {
  25468. return this.divideScalar(this.length())
  25469. },
  25470. setLength: function (e) {
  25471. return this.multiplyScalar(e / this.length())
  25472. },
  25473. lerp: function (e, t) {
  25474. return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this
  25475. },
  25476. lerpVectors: function (e, t, i) {
  25477. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  25478. },
  25479. equals: function (e) {
  25480. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  25481. },
  25482. fromArray: function (e, t) {
  25483. return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this
  25484. },
  25485. toArray: function (e, t) {
  25486. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e
  25487. },
  25488. fromAttribute: function (e, t, i) {
  25489. return void 0 === i && (i = 0), t = t * e.itemSize + i, this.x = e.array[t], this.y = e.array[t + 1], this.z = e.array[t + 2], this.w = e.array[t + 3], this
  25490. }
  25491. }, Ci.Euler = function (e, t, i, n) {
  25492. this._x = e || 0, this._y = t || 0, this._z = i || 0, this._order = n || Ci.Euler.DefaultOrder
  25493. }, Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"], Ci.Euler.DefaultOrder = "XYZ", Ci.Euler.prototype = {
  25494. constructor: Ci.Euler,
  25495. get x() {
  25496. return this._x
  25497. },
  25498. set x(e) {
  25499. this._x = e, this.onChangeCallback()
  25500. },
  25501. get y() {
  25502. return this._y
  25503. },
  25504. set y(e) {
  25505. this._y = e, this.onChangeCallback()
  25506. },
  25507. get z() {
  25508. return this._z
  25509. },
  25510. set z(e) {
  25511. this._z = e, this.onChangeCallback()
  25512. },
  25513. get order() {
  25514. return this._order
  25515. },
  25516. set order(e) {
  25517. this._order = e, this.onChangeCallback()
  25518. },
  25519. set: function (e, t, i, n) {
  25520. return this._x = e, this._y = t, this._z = i, this._order = n || this._order, this.onChangeCallback(), this
  25521. },
  25522. clone: function () {
  25523. return new this.constructor(this._x, this._y, this._z, this._order)
  25524. },
  25525. copy: function (e) {
  25526. return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this.onChangeCallback(), this
  25527. },
  25528. setFromRotationMatrix: function (e, t, i) {
  25529. var n = Ci.Math.clamp,
  25530. r = e.elements,
  25531. o = r[0],
  25532. a = r[4],
  25533. s = r[8],
  25534. l = r[1],
  25535. c = r[5],
  25536. h = r[9],
  25537. u = r[2],
  25538. d = r[6],
  25539. p = r[10];
  25540. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)), Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p), this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c), this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)), Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p), this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o), this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)), Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p), this._z = Math.atan2(-a, c)) : (this._y = 0, this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)), Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p), this._z = Math.atan2(l, o)) : (this._x = 0, this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)), Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c), this._y = Math.atan2(-u, o)) : (this._x = 0, this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)), Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c), this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p), this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t), this._order = t, !1 !== i && this.onChangeCallback(), this
  25541. },
  25542. setFromQuaternion: function (e, t, i) {
  25543. return void 0 === Ee && (Ee = new Ci.Matrix4), Ee.makeRotationFromQuaternion(e), this.setFromRotationMatrix(Ee, t, i), this
  25544. },
  25545. setFromVector3: function (e, t) {
  25546. return this.set(e.x, e.y, e.z, t || this._order)
  25547. },
  25548. reorder: (Ie = new Ci.Quaternion, function (e) {
  25549. Ie.setFromEuler(this), this.setFromQuaternion(Ie, e)
  25550. }),
  25551. equals: function (e) {
  25552. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  25553. },
  25554. fromArray: function (e) {
  25555. return this._x = e[0], this._y = e[1], this._z = e[2], void 0 !== e[3] && (this._order = e[3]), this.onChangeCallback(), this
  25556. },
  25557. toArray: function (e, t) {
  25558. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e
  25559. },
  25560. toVector3: function (e) {
  25561. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x, this._y, this._z)
  25562. },
  25563. onChange: function (e) {
  25564. return this.onChangeCallback = e, this
  25565. },
  25566. onChangeCallback: function () {}
  25567. }, Ci.Line3 = function (e, t) {
  25568. this.start = void 0 !== e ? e : new Ci.Vector3, this.end = void 0 !== t ? t : new Ci.Vector3
  25569. }, Ci.Line3.prototype = {
  25570. constructor: Ci.Line3,
  25571. set: function (e, t) {
  25572. return this.start.copy(e), this.end.copy(t), this
  25573. },
  25574. clone: function () {
  25575. return (new this.constructor).copy(this)
  25576. },
  25577. copy: function (e) {
  25578. return this.start.copy(e.start), this.end.copy(e.end), this
  25579. },
  25580. center: function (e) {
  25581. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  25582. },
  25583. delta: function (e) {
  25584. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  25585. },
  25586. distanceSq: function () {
  25587. return this.start.distanceToSquared(this.end)
  25588. },
  25589. distance: function () {
  25590. return this.start.distanceTo(this.end)
  25591. },
  25592. at: function (e, t) {
  25593. var i = t || new Ci.Vector3;
  25594. return this.delta(i).multiplyScalar(e).add(this.start)
  25595. },
  25596. closestPointToPointParameter: (Ae = new Ci.Vector3, Ce = new Ci.Vector3, function (e, t) {
  25597. Ae.subVectors(e, this.start), Ce.subVectors(this.end, this.start);
  25598. var i = Ce.dot(Ce),
  25599. n = Ce.dot(Ae) / i;
  25600. return t && (n = Ci.Math.clamp(n, 0, 1)), n
  25601. }),
  25602. closestPointToPoint: function (e, t, i) {
  25603. var n = this.closestPointToPointParameter(e, t),
  25604. r = i || new Ci.Vector3;
  25605. return this.delta(r).multiplyScalar(n).add(this.start)
  25606. },
  25607. applyMatrix4: function (e) {
  25608. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
  25609. },
  25610. equals: function (e) {
  25611. return e.start.equals(this.start) && e.end.equals(this.end)
  25612. }
  25613. }, Ci.Box2 = function (e, t) {
  25614. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0, 1 / 0), this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0, -1 / 0)
  25615. }, Ci.Box2.prototype = {
  25616. constructor: Ci.Box2,
  25617. set: function (e, t) {
  25618. return this.min.copy(e), this.max.copy(t), this
  25619. },
  25620. setFromPoints: function (e) {
  25621. this.makeEmpty();
  25622. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]);
  25623. return this
  25624. },
  25625. setFromCenterAndSize: (ye = new Ci.Vector2, function (e, t) {
  25626. var i = ye.copy(t).multiplyScalar(.5);
  25627. return this.min.copy(e).sub(i), this.max.copy(e).add(i), this
  25628. }),
  25629. clone: function () {
  25630. return (new this.constructor).copy(this)
  25631. },
  25632. copy: function (e) {
  25633. return this.min.copy(e.min), this.max.copy(e.max), this
  25634. },
  25635. makeEmpty: function () {
  25636. return this.min.x = this.min.y = 1 / 0, this.max.x = this.max.y = -1 / 0, this
  25637. },
  25638. isEmpty: function () {
  25639. return this.max.x < this.min.x || this.max.y < this.min.y
  25640. },
  25641. center: function (e) {
  25642. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  25643. },
  25644. size: function (e) {
  25645. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  25646. },
  25647. expandByPoint: function (e) {
  25648. return this.min.min(e), this.max.max(e), this
  25649. },
  25650. expandByVector: function (e) {
  25651. return this.min.sub(e), this.max.add(e), this
  25652. },
  25653. expandByScalar: function (e) {
  25654. return this.min.addScalar(-e), this.max.addScalar(e), this
  25655. },
  25656. containsPoint: function (e) {
  25657. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  25658. },
  25659. containsBox: function (e) {
  25660. 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
  25661. },
  25662. getParameter: function (e, t) {
  25663. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  25664. },
  25665. intersectsBox: function (e) {
  25666. 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)
  25667. },
  25668. clampPoint: function (e, t) {
  25669. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  25670. },
  25671. distanceToPoint: (ve = new Ci.Vector2, function (e) {
  25672. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  25673. }),
  25674. intersect: function (e) {
  25675. return this.min.max(e.min), this.max.min(e.max), this
  25676. },
  25677. union: function (e) {
  25678. return this.min.min(e.min), this.max.max(e.max), this
  25679. },
  25680. translate: function (e) {
  25681. return this.min.add(e), this.max.add(e), this
  25682. },
  25683. equals: function (e) {
  25684. return e.min.equals(this.min) && e.max.equals(this.max)
  25685. }
  25686. }, Ci.Box3 = function (e, t) {
  25687. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0, 1 / 0, 1 / 0), this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0, -1 / 0, -1 / 0)
  25688. }, Ci.Box3.prototype = {
  25689. constructor: Ci.Box3,
  25690. set: function (e, t) {
  25691. return this.min.copy(e), this.max.copy(t), this
  25692. },
  25693. setFromArray: function (e) {
  25694. this.makeEmpty();
  25695. 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) {
  25696. var c = e[s],
  25697. h = e[s + 1],
  25698. u = e[s + 2];
  25699. c < t && (t = c), h < i && (i = h), u < n && (n = u), r < c && (r = c), o < h && (o = h), a < u && (a = u)
  25700. }
  25701. this.min.set(t, i, n), this.max.set(r, o, a)
  25702. },
  25703. setFromPoints: function (e) {
  25704. this.makeEmpty();
  25705. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]);
  25706. return this
  25707. },
  25708. setFromCenterAndSize: (me = new Ci.Vector3, function (e, t) {
  25709. var i = me.copy(t).multiplyScalar(.5);
  25710. return this.min.copy(e).sub(i), this.max.copy(e).add(i), this
  25711. }),
  25712. setFromObject: function (e) {
  25713. void 0 === ge && (ge = new Ci.Box3);
  25714. var i = this;
  25715. return this.makeEmpty(), e.updateMatrixWorld(!0), e.traverse(function (e) {
  25716. var t = e.geometry;
  25717. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(), !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox), ge.applyMatrix4(e.matrixWorld), i.union(ge)))
  25718. }), this
  25719. },
  25720. clone: function () {
  25721. return (new this.constructor).copy(this)
  25722. },
  25723. copy: function (e) {
  25724. return this.min.copy(e.min), this.max.copy(e.max), this
  25725. },
  25726. makeEmpty: function () {
  25727. return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this
  25728. },
  25729. isEmpty: function () {
  25730. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  25731. },
  25732. center: function (e) {
  25733. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  25734. },
  25735. size: function (e) {
  25736. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  25737. },
  25738. expandByPoint: function (e) {
  25739. return this.min.min(e), this.max.max(e), this
  25740. },
  25741. expandByVector: function (e) {
  25742. return this.min.sub(e), this.max.add(e), this
  25743. },
  25744. expandByScalar: function (e) {
  25745. return this.min.addScalar(-e), this.max.addScalar(e), this
  25746. },
  25747. containsPoint: function (e) {
  25748. 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)
  25749. },
  25750. containsBox: function (e) {
  25751. 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
  25752. },
  25753. getParameter: function (e, t) {
  25754. return (t || new Ci.Vector3).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  25755. },
  25756. intersectsBox: function (e) {
  25757. 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)
  25758. },
  25759. intersectsSphere: function (e) {
  25760. return void 0 === fe && (fe = new Ci.Vector3), this.clampPoint(e.center, fe), fe.distanceToSquared(e.center) <= e.radius * e.radius
  25761. },
  25762. intersectsPlane: function (e) {
  25763. var t, i;
  25764. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x, e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, e.normal.x * this.min.x), 0 < e.normal.y ? (t += e.normal.y * this.min.y, i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, i += e.normal.y * this.min.y), 0 < e.normal.z ? (t += e.normal.z * this.min.z, i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, i += e.normal.z * this.min.z), t <= e.constant && i >= e.constant
  25765. },
  25766. clampPoint: function (e, t) {
  25767. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  25768. },
  25769. distanceToPoint: (pe = new Ci.Vector3, function (e) {
  25770. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  25771. }),
  25772. getBoundingSphere: (de = new Ci.Vector3, function (e) {
  25773. var t = e || new Ci.Sphere;
  25774. return t.center = this.center(), t.radius = .5 * this.size(de).length(), t
  25775. }),
  25776. intersect: function (e) {
  25777. return this.min.max(e.min), this.max.min(e.max), this
  25778. },
  25779. union: function (e) {
  25780. return this.min.min(e.min), this.max.max(e.max), this
  25781. },
  25782. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3], function (e) {
  25783. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.makeEmpty(), this.setFromPoints(ue), this
  25784. }),
  25785. translate: function (e) {
  25786. return this.min.add(e), this.max.add(e), this
  25787. },
  25788. equals: function (e) {
  25789. return e.min.equals(this.min) && e.max.equals(this.max)
  25790. }
  25791. }, Ci.Matrix3 = function () {
  25792. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]), 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  25793. }, Ci.Matrix3.prototype = {
  25794. constructor: Ci.Matrix3,
  25795. set: function (e, t, i, n, r, o, a, s, l) {
  25796. var c = this.elements;
  25797. return c[0] = e, c[1] = n, c[2] = a, c[3] = t, c[4] = r, c[5] = s, c[6] = i, c[7] = o, c[8] = l, this
  25798. },
  25799. identity: function () {
  25800. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  25801. },
  25802. clone: function () {
  25803. return (new this.constructor).fromArray(this.elements)
  25804. },
  25805. copy: function (e) {
  25806. var t = e.elements;
  25807. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
  25808. },
  25809. setFromMatrix4: function (e) {
  25810. var t = e.elements;
  25811. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  25812. },
  25813. applyToVector3Array: function (e, t, i) {
  25814. void 0 === he && (he = new Ci.Vector3), void 0 === t && (t = 0), void 0 === i && (i = e.length);
  25815. for (var n = 0, r = t; n < i; n += 3, r += 3) he.fromArray(e, r), he.applyMatrix3(this), he.toArray(e, r);
  25816. return e
  25817. },
  25818. applyToBuffer: function (e, t, i) {
  25819. void 0 === ce && (ce = new Ci.Vector3), void 0 === t && (t = 0), void 0 === i && (i = e.length / e.itemSize);
  25820. for (var n = 0, r = t; n < i; n++, r++) ce.x = e.getX(r), ce.y = e.getY(r), ce.z = e.getZ(r), ce.applyMatrix3(this), e.setXYZ(ce.x, ce.y, ce.z);
  25821. return e
  25822. },
  25823. multiplyScalar: function (e) {
  25824. var t = this.elements;
  25825. return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this
  25826. },
  25827. determinant: function () {
  25828. var e = this.elements,
  25829. t = e[0],
  25830. i = e[1],
  25831. n = e[2],
  25832. r = e[3],
  25833. o = e[4],
  25834. a = e[5],
  25835. s = e[6],
  25836. l = e[7],
  25837. c = e[8];
  25838. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  25839. },
  25840. getInverse: function (e, t) {
  25841. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  25842. var i = e.elements,
  25843. n = this.elements,
  25844. r = i[0],
  25845. o = i[1],
  25846. a = i[2],
  25847. s = i[3],
  25848. l = i[4],
  25849. c = i[5],
  25850. h = i[6],
  25851. u = i[7],
  25852. d = i[8],
  25853. p = d * l - c * u,
  25854. f = c * h - d * s,
  25855. g = u * s - l * h,
  25856. m = r * p + o * f + a * g;
  25857. if (0 != m) return n[0] = p, n[1] = a * u - d * o, n[2] = c * o - a * l, n[3] = f, n[4] = d * r - a * h, n[5] = a * s - c * r, n[6] = g, n[7] = o * h - u * r, n[8] = l * r - o * s, this.multiplyScalar(1 / m);
  25858. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  25859. if (t) throw new Error(v);
  25860. return console.warn(v), this.identity()
  25861. },
  25862. transpose: function () {
  25863. var e, t = this.elements;
  25864. return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this
  25865. },
  25866. flattenToArrayOffset: function (e, t) {
  25867. var i = this.elements;
  25868. return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e
  25869. },
  25870. getNormalMatrix: function (e) {
  25871. return this.setFromMatrix4(e).getInverse(this).transpose()
  25872. },
  25873. transposeIntoArray: function (e) {
  25874. var t = this.elements;
  25875. return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this
  25876. },
  25877. fromArray: function (e) {
  25878. return this.elements.set(e), this
  25879. },
  25880. toArray: function () {
  25881. var e = this.elements;
  25882. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  25883. }
  25884. }, Ci.Matrix4 = function () {
  25885. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  25886. }, Ci.Matrix4.prototype = {
  25887. constructor: Ci.Matrix4,
  25888. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  25889. var m = this.elements;
  25890. return m[0] = e, m[4] = t, m[8] = i, m[12] = n, m[1] = r, m[5] = o, m[9] = a, m[13] = s, m[2] = l, m[6] = c, m[10] = h, m[14] = u, m[3] = d, m[7] = p, m[11] = f, m[15] = g, this
  25891. },
  25892. identity: function () {
  25893. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  25894. },
  25895. clone: function () {
  25896. return (new Ci.Matrix4).fromArray(this.elements)
  25897. },
  25898. copy: function (e) {
  25899. return this.elements.set(e.elements), this
  25900. },
  25901. copyPosition: function (e) {
  25902. var t = this.elements,
  25903. i = e.elements;
  25904. return t[12] = i[12], t[13] = i[13], t[14] = i[14], this
  25905. },
  25906. extractBasis: function (e, t, i) {
  25907. return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this
  25908. },
  25909. makeBasis: function (e, t, i) {
  25910. 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), this
  25911. },
  25912. extractRotation: function (e) {
  25913. void 0 === le && (le = new Ci.Vector3);
  25914. var t = this.elements,
  25915. i = e.elements,
  25916. n = 1 / le.setFromMatrixColumn(e, 0).length(),
  25917. r = 1 / le.setFromMatrixColumn(e, 1).length(),
  25918. o = 1 / le.setFromMatrixColumn(e, 2).length();
  25919. return t[0] = i[0] * n, t[1] = i[1] * n, t[2] = i[2] * n, t[4] = i[4] * r, t[5] = i[5] * r, t[6] = i[6] * r, t[8] = i[8] * o, t[9] = i[9] * o, t[10] = i[10] * o, this
  25920. },
  25921. makeRotationFromEuler: function (e) {
  25922. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  25923. var t = this.elements,
  25924. i = e.x,
  25925. n = e.y,
  25926. r = e.z,
  25927. o = Math.cos(i),
  25928. a = Math.sin(i),
  25929. s = Math.cos(n),
  25930. l = Math.sin(n),
  25931. c = Math.cos(r),
  25932. h = Math.sin(r);
  25933. if ("XYZ" === e.order) {
  25934. var u = o * c,
  25935. d = o * h,
  25936. p = a * c,
  25937. f = a * h;
  25938. t[0] = s * c, t[4] = -s * h, t[8] = l, t[1] = d + p * l, t[5] = u - f * l, t[9] = -a * s, t[2] = f - u * l, t[6] = p + d * l, t[10] = o * s
  25939. } else if ("YXZ" === e.order) {
  25940. var g = s * c,
  25941. m = s * h,
  25942. v = l * c,
  25943. y = l * h;
  25944. t[0] = g + y * a, t[4] = v * a - m, t[8] = o * l, t[1] = o * h, t[5] = o * c, t[9] = -a, t[2] = m * a - v, t[6] = y + g * a, t[10] = o * s
  25945. } else if ("ZXY" === e.order) {
  25946. g = s * c, m = s * h, v = l * c, y = l * h;
  25947. t[0] = g - y * a, t[4] = -o * h, t[8] = v + m * a, t[1] = m + v * a, t[5] = o * c, t[9] = y - g * a, t[2] = -o * l, t[6] = a, t[10] = o * s
  25948. } else if ("ZYX" === e.order) {
  25949. u = o * c, d = o * h, p = a * c, f = a * h;
  25950. t[0] = s * c, t[4] = p * l - d, t[8] = u * l + f, t[1] = s * h, t[5] = f * l + u, t[9] = d * l - p, t[2] = -l, t[6] = a * s, t[10] = o * s
  25951. } else if ("YZX" === e.order) {
  25952. var A = o * s,
  25953. C = o * l,
  25954. I = a * s,
  25955. E = a * l;
  25956. t[0] = s * c, t[4] = E - A * h, t[8] = I * h + C, t[1] = h, t[5] = o * c, t[9] = -a * c, t[2] = -l * c, t[6] = C * h + I, t[10] = A - E * h
  25957. } else if ("XZY" === e.order) {
  25958. A = o * s, C = o * l, I = a * s, E = a * l;
  25959. t[0] = s * c, t[4] = -h, t[8] = l * c, t[1] = A * h + E, t[5] = o * c, t[9] = C * h - I, t[2] = I * h - C, t[6] = a * c, t[10] = E * h + A
  25960. }
  25961. return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this
  25962. },
  25963. makeRotationFromQuaternion: function (e) {
  25964. var t = this.elements,
  25965. i = e.x,
  25966. n = e.y,
  25967. r = e.z,
  25968. o = e.w,
  25969. a = i + i,
  25970. s = n + n,
  25971. l = r + r,
  25972. c = i * a,
  25973. h = i * s,
  25974. u = i * l,
  25975. d = n * s,
  25976. p = n * l,
  25977. f = r * l,
  25978. g = o * a,
  25979. m = o * s,
  25980. v = o * l;
  25981. return t[0] = 1 - (d + f), t[4] = h - v, t[8] = u + m, t[1] = h + v, t[5] = 1 - (c + f), t[9] = p - g, t[2] = u - m, t[6] = p + g, t[10] = 1 - (c + d), t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this
  25982. },
  25983. lookAt: function (e, t, i) {
  25984. void 0 === oe && (oe = new Ci.Vector3), void 0 === ae && (ae = new Ci.Vector3), void 0 === se && (se = new Ci.Vector3);
  25985. var n = this.elements;
  25986. return se.subVectors(e, t).normalize(), 0 === se.lengthSq() && (se.z = 1), oe.crossVectors(i, se).normalize(), 0 === oe.lengthSq() && (se.x += 1e-4, oe.crossVectors(i, se).normalize()), ae.crossVectors(se, oe), n[0] = oe.x, n[4] = ae.x, n[8] = se.x, n[1] = oe.y, n[5] = ae.y, n[9] = se.y, n[2] = oe.z, n[6] = ae.z, n[10] = se.z, this
  25987. },
  25988. multiply: function (e, t) {
  25989. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  25990. },
  25991. multiplyMatrices: function (e, t) {
  25992. var i = e.elements,
  25993. n = t.elements,
  25994. r = this.elements,
  25995. o = i[0],
  25996. a = i[4],
  25997. s = i[8],
  25998. l = i[12],
  25999. c = i[1],
  26000. h = i[5],
  26001. u = i[9],
  26002. d = i[13],
  26003. p = i[2],
  26004. f = i[6],
  26005. g = i[10],
  26006. m = i[14],
  26007. v = i[3],
  26008. y = i[7],
  26009. A = i[11],
  26010. C = i[15],
  26011. I = n[0],
  26012. E = n[4],
  26013. _ = n[8],
  26014. b = n[12],
  26015. w = n[1],
  26016. T = n[5],
  26017. x = n[9],
  26018. S = n[13],
  26019. M = n[2],
  26020. R = n[6],
  26021. P = n[10],
  26022. O = n[14],
  26023. L = n[3],
  26024. D = n[7],
  26025. N = n[11],
  26026. F = n[15];
  26027. return r[0] = o * I + a * w + s * M + l * L, r[4] = o * E + a * T + s * R + l * D, r[8] = o * _ + a * x + s * P + l * N, r[12] = o * b + a * S + s * O + l * F, r[1] = c * I + h * w + u * M + d * L, r[5] = c * E + h * T + u * R + d * D, r[9] = c * _ + h * x + u * P + d * N, r[13] = c * b + h * S + u * O + d * F, r[2] = p * I + f * w + g * M + m * L, r[6] = p * E + f * T + g * R + m * D, r[10] = p * _ + f * x + g * P + m * N, r[14] = p * b + f * S + g * O + m * F, r[3] = v * I + y * w + A * M + C * L, r[7] = v * E + y * T + A * R + C * D, r[11] = v * _ + y * x + A * P + C * N, r[15] = v * b + y * S + A * O + C * F, this
  26028. },
  26029. multiplyToArray: function (e, t, i) {
  26030. var n = this.elements;
  26031. return this.multiplyMatrices(e, t), i[0] = n[0], i[1] = n[1], i[2] = n[2], i[3] = n[3], i[4] = n[4], i[5] = n[5], i[6] = n[6], i[7] = n[7], i[8] = n[8], i[9] = n[9], i[10] = n[10], i[11] = n[11], i[12] = n[12], i[13] = n[13], i[14] = n[14], i[15] = n[15], this
  26032. },
  26033. multiplyScalar: function (e) {
  26034. var t = this.elements;
  26035. return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this
  26036. },
  26037. applyToVector3Array: function (e, t, i) {
  26038. void 0 === re && (re = new Ci.Vector3), void 0 === t && (t = 0), void 0 === i && (i = e.length);
  26039. for (var n = 0, r = t; n < i; n += 3, r += 3) re.fromArray(e, r), re.applyMatrix4(this), re.toArray(e, r);
  26040. return e
  26041. },
  26042. applyToBuffer: function (e, t, i) {
  26043. void 0 === ne && (ne = new Ci.Vector3), void 0 === t && (t = 0), void 0 === i && (i = e.length / e.itemSize);
  26044. for (var n = 0, r = t; n < i; n++, r++) ne.x = e.getX(r), ne.y = e.getY(r), ne.z = e.getZ(r), ne.applyMatrix4(this), e.setXYZ(ne.x, ne.y, ne.z);
  26045. return e
  26046. },
  26047. determinant: function () {
  26048. var e = this.elements,
  26049. t = e[0],
  26050. i = e[4],
  26051. n = e[8],
  26052. r = e[12],
  26053. o = e[1],
  26054. a = e[5],
  26055. s = e[9],
  26056. l = e[13],
  26057. c = e[2],
  26058. h = e[6],
  26059. u = e[10],
  26060. d = e[14];
  26061. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  26062. },
  26063. transpose: function () {
  26064. var e, t = this.elements;
  26065. return e = t[1], t[1] = t[4], t[4] = e, e = t[2], t[2] = t[8], t[8] = e, e = t[6], t[6] = t[9], t[9] = e, e = t[3], t[3] = t[12], t[12] = e, e = t[7], t[7] = t[13], t[13] = e, e = t[11], t[11] = t[14], t[14] = e, this
  26066. },
  26067. flattenToArrayOffset: function (e, t) {
  26068. var i = this.elements;
  26069. return e[t] = i[0], e[t + 1] = i[1], e[t + 2] = i[2], e[t + 3] = i[3], e[t + 4] = i[4], e[t + 5] = i[5], e[t + 6] = i[6], e[t + 7] = i[7], e[t + 8] = i[8], e[t + 9] = i[9], e[t + 10] = i[10], e[t + 11] = i[11], e[t + 12] = i[12], e[t + 13] = i[13], e[t + 14] = i[14], e[t + 15] = i[15], e
  26070. },
  26071. getPosition: function () {
  26072. return void 0 === ie && (ie = new Ci.Vector3), console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."), ie.setFromMatrixColumn(this, 3)
  26073. },
  26074. setPosition: function (e) {
  26075. var t = this.elements;
  26076. return t[12] = e.x, t[13] = e.y, t[14] = e.z, this
  26077. },
  26078. getInverse: function (e, t) {
  26079. var i = this.elements,
  26080. n = e.elements,
  26081. r = n[0],
  26082. o = n[1],
  26083. a = n[2],
  26084. s = n[3],
  26085. l = n[4],
  26086. c = n[5],
  26087. h = n[6],
  26088. u = n[7],
  26089. d = n[8],
  26090. p = n[9],
  26091. f = n[10],
  26092. g = n[11],
  26093. m = n[12],
  26094. v = n[13],
  26095. y = n[14],
  26096. A = n[15],
  26097. C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A,
  26098. I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A,
  26099. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A,
  26100. _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y,
  26101. b = r * C + o * I + a * E + s * _;
  26102. if (0 != b) return i[0] = C, i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A, i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A, i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g, i[4] = I, i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A, i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A, i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g, i[8] = E, i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A, i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A, i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g, i[12] = _, i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y, i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y, i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f, this.multiplyScalar(1 / b);
  26103. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26104. if (t) throw new Error(w);
  26105. return console.warn(w), this.identity()
  26106. },
  26107. scale: function (e) {
  26108. var t = this.elements,
  26109. i = e.x,
  26110. n = e.y,
  26111. r = e.z;
  26112. return t[0] *= i, t[4] *= n, t[8] *= r, t[1] *= i, t[5] *= n, t[9] *= r, t[2] *= i, t[6] *= n, t[10] *= r, t[3] *= i, t[7] *= n, t[11] *= r, this
  26113. },
  26114. getMaxScaleOnAxis: function () {
  26115. var e = this.elements,
  26116. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  26117. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  26118. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  26119. return Math.sqrt(Math.max(t, i, n))
  26120. },
  26121. makeTranslation: function (e, t, i) {
  26122. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  26123. },
  26124. makeRotationX: function (e) {
  26125. var t = Math.cos(e),
  26126. i = Math.sin(e);
  26127. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  26128. },
  26129. makeRotationY: function (e) {
  26130. var t = Math.cos(e),
  26131. i = Math.sin(e);
  26132. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  26133. },
  26134. makeRotationZ: function (e) {
  26135. var t = Math.cos(e),
  26136. i = Math.sin(e);
  26137. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  26138. },
  26139. makeRotationAxis: function (e, t) {
  26140. var i = Math.cos(t),
  26141. n = Math.sin(t),
  26142. r = 1 - i,
  26143. o = e.x,
  26144. a = e.y,
  26145. s = e.z,
  26146. l = r * o,
  26147. c = r * a;
  26148. 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), this
  26149. },
  26150. makeScale: function (e, t, i) {
  26151. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  26152. },
  26153. compose: function (e, t, i) {
  26154. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this
  26155. },
  26156. decompose: function (e, t, i) {
  26157. void 0 === ee && (ee = new Ci.Vector3), void 0 === te && (te = new Ci.Matrix4);
  26158. var n = this.elements,
  26159. r = ee.set(n[0], n[1], n[2]).length(),
  26160. o = ee.set(n[4], n[5], n[6]).length(),
  26161. a = ee.set(n[8], n[9], n[10]).length();
  26162. this.determinant() < 0 && (r = -r), e.x = n[12], e.y = n[13], e.z = n[14], te.elements.set(this.elements);
  26163. var s = 1 / r,
  26164. l = 1 / o,
  26165. c = 1 / a;
  26166. return te.elements[0] *= s, te.elements[1] *= s, te.elements[2] *= s, te.elements[4] *= l, te.elements[5] *= l, te.elements[6] *= l, te.elements[8] *= c, te.elements[9] *= c, te.elements[10] *= c, t.setFromRotationMatrix(te), i.x = r, i.y = o, i.z = a, this
  26167. },
  26168. makeFrustum: function (e, t, i, n, r, o) {
  26169. var a = this.elements,
  26170. s = 2 * r / (t - e),
  26171. l = 2 * r / (n - i),
  26172. c = (t + e) / (t - e),
  26173. h = (n + i) / (n - i),
  26174. u = -(o + r) / (o - r),
  26175. d = -2 * o * r / (o - r);
  26176. return a[0] = s, a[4] = 0, a[8] = c, a[12] = 0, a[1] = 0, a[5] = l, a[9] = h, a[13] = 0, a[2] = 0, a[6] = 0, a[10] = u, a[14] = d, a[3] = 0, a[7] = 0, a[11] = -1, a[15] = 0, this
  26177. },
  26178. makePerspective: function (e, t, i, n) {
  26179. var r = i * Math.tan(Ci.Math.degToRad(.5 * e)),
  26180. o = -r,
  26181. a = o * t,
  26182. s = r * t;
  26183. return this.makeFrustum(a, s, o, r, i, n)
  26184. },
  26185. makeOrthographic: function (e, t, i, n, r, o) {
  26186. var a = this.elements,
  26187. s = 1 / (t - e),
  26188. l = 1 / (i - n),
  26189. c = 1 / (o - r),
  26190. h = (t + e) * s,
  26191. u = (i + n) * l,
  26192. d = (o + r) * c;
  26193. return a[0] = 2 * s, a[4] = 0, a[8] = 0, a[12] = -h, a[1] = 0, a[5] = 2 * l, a[9] = 0, a[13] = -u, a[2] = 0, a[6] = 0, a[10] = -2 * c, a[14] = -d, a[3] = 0, a[7] = 0, a[11] = 0, a[15] = 1, this
  26194. },
  26195. equals: function (e) {
  26196. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  26197. if (t[n] !== i[n]) return !1;
  26198. return !0
  26199. },
  26200. fromArray: function (e) {
  26201. return this.elements.set(e), this
  26202. },
  26203. toArray: function () {
  26204. var e = this.elements;
  26205. 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]]
  26206. }
  26207. }, Ci.Ray = function (e, t) {
  26208. this.origin = void 0 !== e ? e : new Ci.Vector3, this.direction = void 0 !== t ? t : new Ci.Vector3
  26209. }, Ci.Ray.prototype = {
  26210. constructor: Ci.Ray,
  26211. set: function (e, t) {
  26212. return this.origin.copy(e), this.direction.copy(t), this
  26213. },
  26214. clone: function () {
  26215. return (new this.constructor).copy(this)
  26216. },
  26217. copy: function (e) {
  26218. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  26219. },
  26220. at: function (e, t) {
  26221. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  26222. },
  26223. lookAt: function (e) {
  26224. this.direction.copy(e).sub(this.origin).normalize()
  26225. },
  26226. recast: ($ = new Ci.Vector3, function (e) {
  26227. return this.origin.copy(this.at(e, $)), this
  26228. }),
  26229. closestPointToPoint: function (e, t) {
  26230. var i = t || new Ci.Vector3;
  26231. i.subVectors(e, this.origin);
  26232. var n = i.dot(this.direction);
  26233. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  26234. },
  26235. distanceToPoint: function (e) {
  26236. return Math.sqrt(this.distanceSqToPoint(e))
  26237. },
  26238. distanceSqToPoint: (J = new Ci.Vector3, function (e) {
  26239. var t = J.subVectors(e, this.origin).dot(this.direction);
  26240. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin), J.distanceToSquared(e))
  26241. }),
  26242. distanceSqToSegment: (Z = new Ci.Vector3, K = new Ci.Vector3, Q = new Ci.Vector3, function (e, t, i, n) {
  26243. Z.copy(e).add(t).multiplyScalar(.5), K.copy(t).sub(e).normalize(), Q.copy(this.origin).sub(Z);
  26244. var r, o, a, s, l = .5 * e.distanceTo(t),
  26245. c = -this.direction.dot(K),
  26246. h = Q.dot(this.direction),
  26247. u = -Q.dot(K),
  26248. d = Q.lengthSq(),
  26249. p = Math.abs(1 - c * c);
  26250. if (0 < p)
  26251. if (o = c * h - u, s = l * p, 0 <= (r = c * u - h))
  26252. if (-s <= o)
  26253. if (o <= s) {
  26254. var f = 1 / p;
  26255. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  26256. } else o = l, a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  26257. else o = -l, a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  26258. else a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0, (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  26259. else o = 0 < c ? -l : l, a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  26260. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin), n && n.copy(K).multiplyScalar(o).add(Z), a
  26261. }),
  26262. intersectSphere: (X = new Ci.Vector3, function (e, t) {
  26263. X.subVectors(e.center, this.origin);
  26264. var i = X.dot(this.direction),
  26265. n = X.dot(X) - i * i,
  26266. r = e.radius * e.radius;
  26267. if (r < n) return null;
  26268. var o = Math.sqrt(r - n),
  26269. a = i - o,
  26270. s = i + o;
  26271. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  26272. }),
  26273. intersectsSphere: function (e) {
  26274. return this.distanceToPoint(e.center) <= e.radius
  26275. },
  26276. distanceToPlane: function (e) {
  26277. var t = e.normal.dot(this.direction);
  26278. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  26279. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  26280. return 0 <= i ? i : null
  26281. },
  26282. intersectPlane: function (e, t) {
  26283. var i = this.distanceToPlane(e);
  26284. return null === i ? null : this.at(i, t)
  26285. },
  26286. intersectsPlane: function (e) {
  26287. var t = e.distanceToPoint(this.origin);
  26288. return 0 === t || e.normal.dot(this.direction) * t < 0
  26289. },
  26290. intersectBox: function (e, t) {
  26291. var i, n, r, o, a, s, l = 1 / this.direction.x,
  26292. c = 1 / this.direction.y,
  26293. h = 1 / this.direction.z,
  26294. u = this.origin;
  26295. return n = 0 <= l ? (i = (e.min.x - u.x) * l, (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l, (e.min.x - u.x) * l), (o = 0 <= c ? (r = (e.min.y - u.y) * c, (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c, (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r), (o < n || n != n) && (n = o), (s = 0 <= h ? (a = (e.min.z - u.z) * h, (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h, (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a), (s < n || n != n) && (n = s), n < 0 ? null : this.at(0 <= i ? i : n, t)))
  26296. },
  26297. intersectsBox: (q = new Ci.Vector3, function (e) {
  26298. return null !== this.intersectBox(e, q)
  26299. }),
  26300. intersectTriangle: (G = new Ci.Vector3, W = new Ci.Vector3, j = new Ci.Vector3, Y = new Ci.Vector3, function (e, t, i, n, r) {
  26301. W.subVectors(t, e), j.subVectors(i, e), Y.crossVectors(W, j);
  26302. var o, a = this.direction.dot(Y);
  26303. if (0 < a) {
  26304. if (n) return null;
  26305. o = 1
  26306. } else {
  26307. if (!(a < 0)) return null;
  26308. o = -1, a = -a
  26309. }
  26310. G.subVectors(this.origin, e);
  26311. var s = o * this.direction.dot(j.crossVectors(G, j));
  26312. if (s < 0) return null;
  26313. var l = o * this.direction.dot(W.cross(G));
  26314. if (l < 0) return null;
  26315. if (a < s + l) return null;
  26316. var c = -o * G.dot(Y);
  26317. return c < 0 ? null : this.at(c / a, r)
  26318. }),
  26319. applyMatrix4: function (e) {
  26320. return this.direction.add(this.origin).applyMatrix4(e), this.origin.applyMatrix4(e), this.direction.sub(this.origin), this.direction.normalize(), this
  26321. },
  26322. equals: function (e) {
  26323. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  26324. }
  26325. }, Ci.Sphere = function (e, t) {
  26326. this.center = void 0 !== e ? e : new Ci.Vector3, this.radius = void 0 !== t ? t : 0
  26327. }, Ci.Sphere.prototype = {
  26328. constructor: Ci.Sphere,
  26329. set: function (e, t) {
  26330. return this.center.copy(e), this.radius = t, this
  26331. },
  26332. setFromPoints: (z = new Ci.Box3, function (e, t) {
  26333. var i = this.center;
  26334. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  26335. for (var n = 0, r = 0, o = e.length; r < o; r++) n = Math.max(n, i.distanceToSquared(e[r]));
  26336. return this.radius = Math.sqrt(n), this
  26337. }),
  26338. clone: function () {
  26339. return (new this.constructor).copy(this)
  26340. },
  26341. copy: function (e) {
  26342. return this.center.copy(e.center), this.radius = e.radius, this
  26343. },
  26344. empty: function () {
  26345. return this.radius <= 0
  26346. },
  26347. containsPoint: function (e) {
  26348. return e.distanceToSquared(this.center) <= this.radius * this.radius
  26349. },
  26350. distanceToPoint: function (e) {
  26351. return e.distanceTo(this.center) - this.radius
  26352. },
  26353. intersectsSphere: function (e) {
  26354. var t = this.radius + e.radius;
  26355. return e.center.distanceToSquared(this.center) <= t * t
  26356. },
  26357. intersectsBox: function (e) {
  26358. return e.intersectsSphere(this)
  26359. },
  26360. intersectsPlane: function (e) {
  26361. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  26362. },
  26363. clampPoint: function (e, t) {
  26364. var i = this.center.distanceToSquared(e),
  26365. n = t || new Ci.Vector3;
  26366. return n.copy(e), i > this.radius * this.radius && (n.sub(this.center).normalize(), n.multiplyScalar(this.radius).add(this.center)), n
  26367. },
  26368. getBoundingBox: function (e) {
  26369. var t = e || new Ci.Box3;
  26370. return t.set(this.center, this.center), t.expandByScalar(this.radius), t
  26371. },
  26372. applyMatrix4: function (e) {
  26373. return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this
  26374. },
  26375. translate: function (e) {
  26376. return this.center.add(e), this
  26377. },
  26378. equals: function (e) {
  26379. return e.center.equals(this.center) && e.radius === this.radius
  26380. }
  26381. }, Ci.Frustum = function (e, t, i, n, r, o) {
  26382. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  26383. }, Ci.Frustum.prototype = {
  26384. constructor: Ci.Frustum,
  26385. set: function (e, t, i, n, r, o) {
  26386. var a = this.planes;
  26387. return a[0].copy(e), a[1].copy(t), a[2].copy(i), a[3].copy(n), a[4].copy(r), a[5].copy(o), this
  26388. },
  26389. clone: function () {
  26390. return (new this.constructor).copy(this)
  26391. },
  26392. copy: function (e) {
  26393. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i]);
  26394. return this
  26395. },
  26396. setFromMatrix: function (e) {
  26397. var t = this.planes,
  26398. i = e.elements,
  26399. n = i[0],
  26400. r = i[1],
  26401. o = i[2],
  26402. a = i[3],
  26403. s = i[4],
  26404. l = i[5],
  26405. c = i[6],
  26406. h = i[7],
  26407. u = i[8],
  26408. d = i[9],
  26409. p = i[10],
  26410. f = i[11],
  26411. g = i[12],
  26412. m = i[13],
  26413. v = i[14],
  26414. y = i[15];
  26415. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(), t[1].setComponents(a + n, h + s, f + u, y + g).normalize(), t[2].setComponents(a + r, h + l, f + d, y + m).normalize(), t[3].setComponents(a - r, h - l, f - d, y - m).normalize(), t[4].setComponents(a - o, h - c, f - p, y - v).normalize(), t[5].setComponents(a + o, h + c, f + p, y + v).normalize(), this
  26416. },
  26417. intersectsObject: (H = new Ci.Sphere, function (e) {
  26418. var t = e.geometry;
  26419. return null === t.boundingSphere && t.computeBoundingSphere(), H.copy(t.boundingSphere), H.applyMatrix4(e.matrixWorld), this.intersectsSphere(H)
  26420. }),
  26421. intersectsSphere: function (e) {
  26422. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  26423. if (t[r].distanceToPoint(i) < n) return !1
  26424. }
  26425. return !0
  26426. },
  26427. intersectsBox: (k = new Ci.Vector3, U = new Ci.Vector3, function (e) {
  26428. for (var t = this.planes, i = 0; i < 6; i++) {
  26429. var n = t[i];
  26430. k.x = 0 < n.normal.x ? e.min.x : e.max.x, U.x = 0 < n.normal.x ? e.max.x : e.min.x, k.y = 0 < n.normal.y ? e.min.y : e.max.y, U.y = 0 < n.normal.y ? e.max.y : e.min.y, k.z = 0 < n.normal.z ? e.min.z : e.max.z, U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  26431. var r = n.distanceToPoint(k),
  26432. o = n.distanceToPoint(U);
  26433. if (r < 0 && o < 0) return !1
  26434. }
  26435. return !0
  26436. }),
  26437. containsPoint: function (e) {
  26438. for (var t = this.planes, i = 0; i < 6; i++)
  26439. if (t[i].distanceToPoint(e) < 0) return !1;
  26440. return !0
  26441. }
  26442. }, Ci.Plane = function (e, t) {
  26443. this.normal = void 0 !== e ? e : new Ci.Vector3(1, 0, 0), this.constant = void 0 !== t ? t : 0
  26444. }, Ci.Plane.prototype = {
  26445. constructor: Ci.Plane,
  26446. set: function (e, t) {
  26447. return this.normal.copy(e), this.constant = t, this
  26448. },
  26449. setComponents: function (e, t, i, n) {
  26450. return this.normal.set(e, t, i), this.constant = n, this
  26451. },
  26452. setFromNormalAndCoplanarPoint: function (e, t) {
  26453. return this.normal.copy(e), this.constant = -t.dot(this.normal), this
  26454. },
  26455. setFromCoplanarPoints: (B = new Ci.Vector3, V = new Ci.Vector3, function (e, t, i) {
  26456. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  26457. return this.setFromNormalAndCoplanarPoint(n, e), this
  26458. }),
  26459. clone: function () {
  26460. return (new this.constructor).copy(this)
  26461. },
  26462. copy: function (e) {
  26463. return this.normal.copy(e.normal), this.constant = e.constant, this
  26464. },
  26465. normalize: function () {
  26466. var e = 1 / this.normal.length();
  26467. return this.normal.multiplyScalar(e), this.constant *= e, this
  26468. },
  26469. negate: function () {
  26470. return this.constant *= -1, this.normal.negate(), this
  26471. },
  26472. distanceToPoint: function (e) {
  26473. return this.normal.dot(e) + this.constant
  26474. },
  26475. distanceToSphere: function (e) {
  26476. return this.distanceToPoint(e.center) - e.radius
  26477. },
  26478. projectPoint: function (e, t) {
  26479. return this.orthoPoint(e, t).sub(e).negate()
  26480. },
  26481. orthoPoint: function (e, t) {
  26482. var i = this.distanceToPoint(e);
  26483. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  26484. },
  26485. intersectLine: (F = new Ci.Vector3, function (e, t) {
  26486. var i = t || new Ci.Vector3,
  26487. n = e.delta(F),
  26488. r = this.normal.dot(n);
  26489. if (0 !== r) {
  26490. var o = -(e.start.dot(this.normal) + this.constant) / r;
  26491. if (!(o < 0 || 1 < o)) return i.copy(n).multiplyScalar(o).add(e.start)
  26492. } else if (0 === this.distanceToPoint(e.start)) return i.copy(e.start)
  26493. }),
  26494. intersectsLine: function (e) {
  26495. var t = this.distanceToPoint(e.start),
  26496. i = this.distanceToPoint(e.end);
  26497. return t < 0 && 0 < i || i < 0 && 0 < t
  26498. },
  26499. intersectsBox: function (e) {
  26500. return e.intersectsPlane(this)
  26501. },
  26502. intersectsSphere: function (e) {
  26503. return e.intersectsPlane(this)
  26504. },
  26505. coplanarPoint: function (e) {
  26506. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  26507. },
  26508. applyMatrix4: (L = new Ci.Vector3, D = new Ci.Vector3, N = new Ci.Matrix3, function (e, t) {
  26509. var i = t || N.getNormalMatrix(e),
  26510. n = L.copy(this.normal).applyMatrix3(i),
  26511. r = this.coplanarPoint(D);
  26512. return r.applyMatrix4(e), this.setFromNormalAndCoplanarPoint(n, r), this
  26513. }),
  26514. translate: function (e) {
  26515. return this.constant = this.constant - e.dot(this.normal), this
  26516. },
  26517. equals: function (e) {
  26518. return e.normal.equals(this.normal) && e.constant === this.constant
  26519. }
  26520. }, Ci.Spherical = function (e, t, i) {
  26521. return this.radius = void 0 !== e ? e : 1, this.phi = void 0 !== t ? t : 0, this.theta = void 0 !== i ? i : 0, this
  26522. }, Ci.Spherical.prototype = {
  26523. constructor: Ci.Spherical,
  26524. set: function (e, t, i) {
  26525. this.radius = e, this.phi = t, this.theta = i
  26526. },
  26527. clone: function () {
  26528. return (new this.constructor).copy(this)
  26529. },
  26530. copy: function (e) {
  26531. return this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  26532. },
  26533. makeSafe: function () {
  26534. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  26535. },
  26536. setFromVector3: function (e) {
  26537. return this.radius = e.length(), 0 === this.radius ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e.x, e.z), this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))), this
  26538. }
  26539. }, Ci.Math = {
  26540. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), P = new Array(36), O = 0, function () {
  26541. for (var e = 0; e < 36; e++) 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0), M = 15 & O, O >>= 4, P[e] = R[19 === e ? 3 & M | 8 : M]);
  26542. return P.join("")
  26543. }),
  26544. clamp: function (e, t, i) {
  26545. return Math.max(t, Math.min(i, e))
  26546. },
  26547. euclideanModulo: function (e, t) {
  26548. return (e % t + t) % t
  26549. },
  26550. mapLinear: function (e, t, i, n, r) {
  26551. return n + (e - t) * (r - n) / (i - t)
  26552. },
  26553. smoothstep: function (e, t, i) {
  26554. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  26555. },
  26556. smootherstep: function (e, t, i) {
  26557. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  26558. },
  26559. random16: function () {
  26560. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."), Math.random()
  26561. },
  26562. randInt: function (e, t) {
  26563. return e + Math.floor(Math.random() * (t - e + 1))
  26564. },
  26565. randFloat: function (e, t) {
  26566. return e + Math.random() * (t - e)
  26567. },
  26568. randFloatSpread: function (e) {
  26569. return e * (.5 - Math.random())
  26570. },
  26571. degToRad: (S = Math.PI / 180, function (e) {
  26572. return e * S
  26573. }),
  26574. radToDeg: (x = 180 / Math.PI, function (e) {
  26575. return e * x
  26576. }),
  26577. isPowerOfTwo: function (e) {
  26578. return 0 == (e & e - 1) && 0 !== e
  26579. },
  26580. nearestPowerOfTwo: function (e) {
  26581. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  26582. },
  26583. nextPowerOfTwo: function (e) {
  26584. return e--, e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, ++e
  26585. }
  26586. }, Ci.Spline = function (e) {
  26587. function t(e, t, i, n, r, o, a) {
  26588. var s = .5 * (i - e),
  26589. l = .5 * (n - t);
  26590. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  26591. }
  26592. this.points = e;
  26593. var i, n, r, o, a, s, l, c, h, u = [],
  26594. d = {
  26595. x: 0,
  26596. y: 0,
  26597. z: 0
  26598. };
  26599. this.initFromArray = function (e) {
  26600. this.points = [];
  26601. for (var t = 0; t < e.length; t++) this.points[t] = {
  26602. x: e[t][0],
  26603. y: e[t][1],
  26604. z: e[t][2]
  26605. }
  26606. }, this.getPoint = function (e) {
  26607. return i = (this.points.length - 1) * e, n = Math.floor(i), r = i - n, u[0] = 0 === n ? n : n - 1, u[1] = n, u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1, u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2, s = this.points[u[0]], l = this.points[u[1]], c = this.points[u[2]], h = this.points[u[3]], a = r * (o = r * r), d.x = t(s.x, l.x, c.x, h.x, r, o, a), d.y = t(s.y, l.y, c.y, h.y, r, o, a), d.z = t(s.z, l.z, c.z, h.z, r, o, a), d
  26608. }, this.getControlPointsArray = function () {
  26609. var e, t, i = this.points.length,
  26610. n = [];
  26611. for (e = 0; e < i; e++) t = this.points[e], n[e] = [t.x, t.y, t.z];
  26612. return n
  26613. }, this.getLength = function (e) {
  26614. var t, i, n, r, o = 0,
  26615. a = 0,
  26616. s = 0,
  26617. l = new Ci.Vector3,
  26618. c = new Ci.Vector3,
  26619. h = [],
  26620. u = 0;
  26621. for (h[0] = 0, e = e || 100, n = this.points.length * e, l.copy(this.points[0]), t = 1; t < n; t++) i = t / n, r = this.getPoint(i), c.copy(r), u += c.distanceTo(l), l.copy(r), o = (this.points.length - 1) * i, (a = Math.floor(o)) !== s && (h[a] = u, s = a);
  26622. return h[h.length] = u, {
  26623. chunks: h,
  26624. total: u
  26625. }
  26626. }, this.reparametrizeByArcLength = function (e) {
  26627. var t, i, n, r, o, a, s, l, c = [],
  26628. h = new Ci.Vector3,
  26629. u = this.getLength();
  26630. for (c.push(h.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  26631. for (a = u.chunks[t] - u.chunks[t - 1], s = Math.ceil(e * a / u.total), r = (t - 1) / (this.points.length - 1), o = t / (this.points.length - 1), i = 1; i < s - 1; i++) n = r + i * (1 / s) * (o - r), l = this.getPoint(n), c.push(h.copy(l).clone());
  26632. c.push(h.copy(this.points[t]).clone())
  26633. }
  26634. this.points = c
  26635. }
  26636. }, Ci.Triangle = function (e, t, i) {
  26637. this.a = void 0 !== e ? e : new Ci.Vector3, this.b = void 0 !== t ? t : new Ci.Vector3, this.c = void 0 !== i ? i : new Ci.Vector3
  26638. }, Ci.Triangle.normal = (T = new Ci.Vector3, function (e, t, i, n) {
  26639. var r = n || new Ci.Vector3;
  26640. r.subVectors(i, t), T.subVectors(e, t), r.cross(T);
  26641. var o = r.lengthSq();
  26642. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  26643. }), Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3, b = new Ci.Vector3, w = new Ci.Vector3, function (e, t, i, n, r) {
  26644. _.subVectors(n, t), b.subVectors(i, t), w.subVectors(e, t);
  26645. var o = _.dot(_),
  26646. a = _.dot(b),
  26647. s = _.dot(w),
  26648. l = b.dot(b),
  26649. c = b.dot(w),
  26650. h = o * l - a * a,
  26651. u = r || new Ci.Vector3;
  26652. if (0 == h) return u.set(-2, -1, -1);
  26653. var d = 1 / h,
  26654. p = (l * s - a * c) * d,
  26655. f = (o * c - a * s) * d;
  26656. return u.set(1 - p - f, f, p)
  26657. }), Ci.Triangle.containsPoint = (E = new Ci.Vector3, function (e, t, i, n) {
  26658. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  26659. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  26660. }), Ci.Triangle.prototype = {
  26661. constructor: Ci.Triangle,
  26662. set: function (e, t, i) {
  26663. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this
  26664. },
  26665. setFromPointsAndIndices: function (e, t, i, n) {
  26666. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  26667. },
  26668. clone: function () {
  26669. return (new this.constructor).copy(this)
  26670. },
  26671. copy: function (e) {
  26672. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  26673. },
  26674. area: (C = new Ci.Vector3, I = new Ci.Vector3, function () {
  26675. return C.subVectors(this.c, this.b), I.subVectors(this.a, this.b), .5 * C.cross(I).length()
  26676. }),
  26677. midpoint: function (e) {
  26678. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  26679. },
  26680. normal: function (e) {
  26681. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  26682. },
  26683. plane: function (e) {
  26684. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  26685. },
  26686. barycoordFromPoint: function (e, t) {
  26687. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  26688. },
  26689. containsPoint: function (e) {
  26690. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  26691. },
  26692. equals: function (e) {
  26693. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  26694. }
  26695. }, Ci.Interpolant = function (e, t, i, n) {
  26696. this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = void 0 !== n ? n : new t.constructor(i), this.sampleValues = t, this.valueSize = i
  26697. }, Ci.Interpolant.prototype = {
  26698. constructor: Ci.Interpolant,
  26699. evaluate: function (e) {
  26700. var t = this.parameterPositions,
  26701. i = this._cachedIndex,
  26702. n = t[i],
  26703. r = t[i - 1];
  26704. e: {
  26705. t: {
  26706. var o;i: {
  26707. n: if (!(e < n)) {
  26708. for (var a = i + 2;;) {
  26709. if (void 0 === n) {
  26710. if (e < r) break n;
  26711. return i = t.length, this._cachedIndex = i, this.afterEnd_(i - 1, e, r)
  26712. }
  26713. if (i === a) break;
  26714. if (r = n, e < (n = t[++i])) break t
  26715. }
  26716. o = t.length;
  26717. break i
  26718. }if (r <= e) break e;
  26719. var s = t[1];e < s && (i = 2, r = s);
  26720. for (a = i - 2;;) {
  26721. if (void 0 === r) return this._cachedIndex = 0, this.beforeStart_(0, e, n);
  26722. if (i === a) break;
  26723. if (n = r, (r = t[--i - 1]) <= e) break t
  26724. }
  26725. o = i,
  26726. i = 0
  26727. }
  26728. for (; i < o;) {
  26729. var l = i + o >>> 1;
  26730. e < t[l] ? o = l : i = 1 + l
  26731. }
  26732. if (n = t[i], void 0 === (r = t[i - 1])) return this._cachedIndex = 0,
  26733. this.beforeStart_(0, e, n);
  26734. if (void 0 === n) return i = t.length,
  26735. this._cachedIndex = i,
  26736. this.afterEnd_(i - 1, r, e)
  26737. }
  26738. this._cachedIndex = i,
  26739. this.intervalChanged_(i, r, n)
  26740. }
  26741. return this.interpolate_(i, r, e, n)
  26742. },
  26743. settings: null,
  26744. DefaultSettings_: {},
  26745. getSettings_: function () {
  26746. return this.settings || this.DefaultSettings_
  26747. },
  26748. copySampleValue_: function (e) {
  26749. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o) t[o] = i[r + o];
  26750. return t
  26751. },
  26752. interpolate_: function (e, t, i, n) {
  26753. throw new Error("call to abstract method")
  26754. },
  26755. intervalChanged_: function (e, t, i) {}
  26756. }, Object.assign(Ci.Interpolant.prototype, {
  26757. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  26758. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  26759. }), Ci.CubicInterpolant = function (e, t, i, n) {
  26760. Ci.Interpolant.call(this, e, t, i, n), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0
  26761. }, Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  26762. constructor: Ci.CubicInterpolant,
  26763. DefaultSettings_: {
  26764. endingStart: Ci.ZeroCurvatureEnding,
  26765. endingEnd: Ci.ZeroCurvatureEnding
  26766. },
  26767. intervalChanged_: function (e, t, i) {
  26768. var n = this.parameterPositions,
  26769. r = e - 2,
  26770. o = e + 1,
  26771. a = n[r],
  26772. s = n[o];
  26773. if (void 0 === a) switch (this.getSettings_().endingStart) {
  26774. case Ci.ZeroSlopeEnding:
  26775. r = e, a = 2 * t - i;
  26776. break;
  26777. case Ci.WrapAroundEnding:
  26778. a = t + n[r = n.length - 2] - n[r + 1];
  26779. break;
  26780. default:
  26781. r = e, a = i
  26782. }
  26783. if (void 0 === s) switch (this.getSettings_().endingEnd) {
  26784. case Ci.ZeroSlopeEnding:
  26785. o = e, s = 2 * i - t;
  26786. break;
  26787. case Ci.WrapAroundEnding:
  26788. s = i + n[o = 1] - n[0];
  26789. break;
  26790. default:
  26791. o = e - 1, s = t
  26792. }
  26793. var l = .5 * (i - t),
  26794. c = this.valueSize;
  26795. this._weightPrev = l / (t - a), this._weightNext = l / (s - i), this._offsetPrev = r * c, this._offsetNext = o * c
  26796. },
  26797. interpolate_: function (e, t, i, n) {
  26798. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C) r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  26799. return r
  26800. }
  26801. }), Ci.DiscreteInterpolant = function (e, t, i, n) {
  26802. Ci.Interpolant.call(this, e, t, i, n)
  26803. }, Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  26804. constructor: Ci.DiscreteInterpolant,
  26805. interpolate_: function (e, t, i, n) {
  26806. return this.copySampleValue_(e - 1)
  26807. }
  26808. }), Ci.LinearInterpolant = function (e, t, i, n) {
  26809. Ci.Interpolant.call(this, e, t, i, n)
  26810. }, Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  26811. constructor: Ci.LinearInterpolant,
  26812. interpolate_: function (e, t, i, n) {
  26813. 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) r[u] = o[l + u] * h + o[s + u] * c;
  26814. return r
  26815. }
  26816. }), Ci.QuaternionLinearInterpolant = function (e, t, i, n) {
  26817. Ci.Interpolant.call(this, e, t, i, n)
  26818. }, Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  26819. constructor: Ci.QuaternionLinearInterpolant,
  26820. interpolate_: function (e, t, i, n) {
  26821. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4) Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  26822. return r
  26823. }
  26824. }), Ci.Clock = function (e) {
  26825. this.autoStart = void 0 === e || e, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = !1
  26826. }, Ci.Clock.prototype = {
  26827. constructor: Ci.Clock,
  26828. start: function () {
  26829. this.startTime = performance.now(), this.oldTime = this.startTime, this.running = !0
  26830. },
  26831. stop: function () {
  26832. this.getElapsedTime(), this.running = !1
  26833. },
  26834. getElapsedTime: function () {
  26835. return this.getDelta(), this.elapsedTime
  26836. },
  26837. getDelta: function () {
  26838. var e = 0;
  26839. if (this.autoStart && !this.running && this.start(), this.running) {
  26840. var t = performance.now();
  26841. e = .001 * (t - this.oldTime), this.oldTime = t, this.elapsedTime += e
  26842. }
  26843. return e
  26844. }
  26845. }, Ci.EventDispatcher = function () {}, Ci.EventDispatcher.prototype = {
  26846. constructor: Ci.EventDispatcher,
  26847. apply: function (e) {
  26848. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener, e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener, e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener, e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  26849. },
  26850. addEventListener: function (e, t) {
  26851. void 0 === this._listeners && (this._listeners = {});
  26852. var i = this._listeners;
  26853. void 0 === i[e] && (i[e] = []), -1 === i[e].indexOf(t) && i[e].push(t)
  26854. },
  26855. hasEventListener: function (e, t) {
  26856. if (void 0 === this._listeners) return !1;
  26857. var i = this._listeners;
  26858. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  26859. },
  26860. removeEventListener: function (e, t) {
  26861. if (void 0 !== this._listeners) {
  26862. var i = this._listeners[e];
  26863. if (void 0 !== i) {
  26864. var n = i.indexOf(t); - 1 !== n && i.splice(n, 1)
  26865. }
  26866. }
  26867. },
  26868. dispatchEvent: function (e) {
  26869. if (void 0 !== this._listeners) {
  26870. var t = this._listeners[e.type];
  26871. if (void 0 !== t) {
  26872. e.target = this;
  26873. for (var i = [], n = t.length, r = 0; r < n; r++) i[r] = t[r];
  26874. for (r = 0; r < n; r++) i[r].call(this, e)
  26875. }
  26876. }
  26877. }
  26878. }, Ci.Layers = function () {
  26879. this.mask = 1
  26880. }, Ci.Layers.prototype = {
  26881. constructor: Ci.Layers,
  26882. set: function (e) {
  26883. this.mask = 1 << e
  26884. },
  26885. enable: function (e) {
  26886. this.mask |= 1 << e
  26887. },
  26888. toggle: function (e) {
  26889. this.mask ^= 1 << e
  26890. },
  26891. disable: function (e) {
  26892. this.mask &= ~(1 << e)
  26893. },
  26894. test: function (e) {
  26895. return 0 != (this.mask & e.mask)
  26896. }
  26897. }, (A = Ci).Raycaster = function (e, t, i, n) {
  26898. this.ray = new A.Ray(e, t), this.near = i || 0, this.far = n || 1 / 0, this.params = {
  26899. Mesh: {},
  26900. Line: {},
  26901. LOD: {},
  26902. Points: {
  26903. threshold: 1
  26904. },
  26905. Sprite: {}
  26906. }, Object.defineProperties(this.params, {
  26907. PointCloud: {
  26908. get: function () {
  26909. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."), this.Points
  26910. }
  26911. }
  26912. })
  26913. }, A.Raycaster.prototype = {
  26914. constructor: A.Raycaster,
  26915. linePrecision: 1,
  26916. set: function (e, t) {
  26917. this.ray.set(e, t)
  26918. },
  26919. setFromCamera: function (e, t) {
  26920. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  26921. },
  26922. intersectObject: function (e, t) {
  26923. var i = [];
  26924. return Ei(e, this, i, t), i.sort(Ii), i
  26925. },
  26926. intersectObjects: function (e, t) {
  26927. var i = [];
  26928. if (!1 === Array.isArray(e)) return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."), i;
  26929. for (var n = 0, r = e.length; n < r; n++) Ei(e[n], this, i, t);
  26930. return i.sort(Ii), i
  26931. }
  26932. }, Ci.Object3D = function () {
  26933. Object.defineProperty(this, "id", {
  26934. value: Ci.Object3DIdCount++
  26935. }), this.uuid = Ci.Math.generateUUID(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = Ci.Object3D.DefaultUp.clone();
  26936. var e = new Ci.Vector3,
  26937. t = new Ci.Euler,
  26938. i = new Ci.Quaternion,
  26939. n = new Ci.Vector3(1, 1, 1);
  26940. t.onChange(function () {
  26941. i.setFromEuler(t, !1)
  26942. }), i.onChange(function () {
  26943. t.setFromQuaternion(i, void 0, !1)
  26944. }), Object.defineProperties(this, {
  26945. position: {
  26946. enumerable: !0,
  26947. value: e
  26948. },
  26949. rotation: {
  26950. enumerable: !0,
  26951. value: t
  26952. },
  26953. quaternion: {
  26954. enumerable: !0,
  26955. value: i
  26956. },
  26957. scale: {
  26958. enumerable: !0,
  26959. value: n
  26960. },
  26961. modelViewMatrix: {
  26962. value: new Ci.Matrix4
  26963. },
  26964. normalMatrix: {
  26965. value: new Ci.Matrix3
  26966. }
  26967. }), this.rotationAutoUpdate = !0, this.matrix = new Ci.Matrix4, this.matrixWorld = new Ci.Matrix4, this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = !1, this.layers = new Ci.Layers, this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.userData = {}
  26968. }, Ci.Object3D.DefaultUp = new Ci.Vector3(0, 1, 0), Ci.Object3D.DefaultMatrixAutoUpdate = !0, Ci.Object3D.prototype = {
  26969. constructor: Ci.Object3D,
  26970. applyMatrix: function (e) {
  26971. this.matrix.multiplyMatrices(e, this.matrix), this.matrix.decompose(this.position, this.quaternion, this.scale)
  26972. },
  26973. setRotationFromAxisAngle: function (e, t) {
  26974. this.quaternion.setFromAxisAngle(e, t)
  26975. },
  26976. setRotationFromEuler: function (e) {
  26977. this.quaternion.setFromEuler(e, !0)
  26978. },
  26979. setRotationFromMatrix: function (e) {
  26980. this.quaternion.setFromRotationMatrix(e)
  26981. },
  26982. setRotationFromQuaternion: function (e) {
  26983. this.quaternion.copy(e)
  26984. },
  26985. rotateOnAxis: (y = new Ci.Quaternion, function (e, t) {
  26986. return y.setFromAxisAngle(e, t), this.quaternion.multiply(y), this
  26987. }),
  26988. rotateX: (v = new Ci.Vector3(1, 0, 0), function (e) {
  26989. return this.rotateOnAxis(v, e)
  26990. }),
  26991. rotateY: (m = new Ci.Vector3(0, 1, 0), function (e) {
  26992. return this.rotateOnAxis(m, e)
  26993. }),
  26994. rotateZ: (g = new Ci.Vector3(0, 0, 1), function (e) {
  26995. return this.rotateOnAxis(g, e)
  26996. }),
  26997. translateOnAxis: (f = new Ci.Vector3, function (e, t) {
  26998. return f.copy(e).applyQuaternion(this.quaternion), this.position.add(f.multiplyScalar(t)), this
  26999. }),
  27000. translateX: (p = new Ci.Vector3(1, 0, 0), function (e) {
  27001. return this.translateOnAxis(p, e)
  27002. }),
  27003. translateY: (d = new Ci.Vector3(0, 1, 0), function (e) {
  27004. return this.translateOnAxis(d, e)
  27005. }),
  27006. translateZ: (u = new Ci.Vector3(0, 0, 1), function (e) {
  27007. return this.translateOnAxis(u, e)
  27008. }),
  27009. localToWorld: function (e) {
  27010. return e.applyMatrix4(this.matrixWorld)
  27011. },
  27012. worldToLocal: (h = new Ci.Matrix4, function (e) {
  27013. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  27014. }),
  27015. lookAt: (c = new Ci.Matrix4, function (e) {
  27016. c.lookAt(e, this.position, this.up), this.quaternion.setFromRotationMatrix(c)
  27017. }),
  27018. add: function (e) {
  27019. if (1 < arguments.length) {
  27020. for (var t = 0; t < arguments.length; t++) this.add(arguments[t]);
  27021. return this
  27022. }
  27023. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e), e.parent = this, e.dispatchEvent({
  27024. type: "added"
  27025. }), this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this
  27026. },
  27027. remove: function (e) {
  27028. if (1 < arguments.length)
  27029. for (var t = 0; t < arguments.length; t++) this.remove(arguments[t]);
  27030. var i = this.children.indexOf(e); - 1 !== i && (e.parent = null, e.dispatchEvent({
  27031. type: "removed"
  27032. }), this.children.splice(i, 1))
  27033. },
  27034. getObjectById: function (e) {
  27035. return this.getObjectByProperty("id", e)
  27036. },
  27037. getObjectByName: function (e) {
  27038. return this.getObjectByProperty("name", e)
  27039. },
  27040. getObjectByProperty: function (e, t) {
  27041. if (this[e] === t) return this;
  27042. for (var i = 0, n = this.children.length; i < n; i++) {
  27043. var r = this.children[i].getObjectByProperty(e, t);
  27044. if (void 0 !== r) return r
  27045. }
  27046. },
  27047. getWorldPosition: function (e) {
  27048. var t = e || new Ci.Vector3;
  27049. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
  27050. },
  27051. getWorldQuaternion: (s = new Ci.Vector3, l = new Ci.Vector3, function (e) {
  27052. var t = e || new Ci.Quaternion;
  27053. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(s, t, l), t
  27054. }),
  27055. getWorldRotation: (a = new Ci.Quaternion, function (e) {
  27056. var t = e || new Ci.Euler;
  27057. return this.getWorldQuaternion(a), t.setFromQuaternion(a, this.rotation.order, !1)
  27058. }),
  27059. getWorldScale: (r = new Ci.Vector3, o = new Ci.Quaternion, function (e) {
  27060. var t = e || new Ci.Vector3;
  27061. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(r, o, t), t
  27062. }),
  27063. getWorldDirection: (n = new Ci.Quaternion, function (e) {
  27064. var t = e || new Ci.Vector3;
  27065. return this.getWorldQuaternion(n), t.set(0, 0, 1).applyQuaternion(n)
  27066. }),
  27067. raycast: function () {},
  27068. traverse: function (e) {
  27069. e(this);
  27070. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e)
  27071. },
  27072. traverseVisible: function (e) {
  27073. if (!1 !== this.visible) {
  27074. e(this);
  27075. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverseVisible(e)
  27076. }
  27077. },
  27078. traverseAncestors: function (e) {
  27079. var t = this.parent;
  27080. null !== t && (e(t), t.traverseAncestors(e))
  27081. },
  27082. updateMatrix: function () {
  27083. this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0
  27084. },
  27085. updateMatrixWorld: function (e) {
  27086. !0 === this.matrixAutoUpdate && this.updateMatrix(), !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), e = !(this.matrixWorldNeedsUpdate = !1));
  27087. for (var t = 0, i = this.children.length; t < i; t++) this.children[t].updateMatrixWorld(e)
  27088. },
  27089. toJSON: function (e) {
  27090. function t(e) {
  27091. var t = [];
  27092. for (var i in e) {
  27093. var n = e[i];
  27094. delete n.metadata, t.push(n)
  27095. }
  27096. return t
  27097. }
  27098. var i = void 0 === e,
  27099. n = {};
  27100. i && (e = {
  27101. geometries: {},
  27102. materials: {},
  27103. textures: {},
  27104. images: {}
  27105. }, n.metadata = {
  27106. version: 4.4,
  27107. type: "Object",
  27108. generator: "Object3D.toJSON"
  27109. });
  27110. var r = {};
  27111. if (r.uuid = this.uuid, r.type = this.type, "" !== this.name && (r.name = this.name), "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData), !0 === this.castShadow && (r.castShadow = !0), !0 === this.receiveShadow && (r.receiveShadow = !0), !1 === this.visible && (r.visible = !1), r.matrix = this.matrix.toArray(), void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)), r.geometry = this.geometry.uuid), void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)), r.material = this.material.uuid), 0 < this.children.length) {
  27112. r.children = [];
  27113. for (var o = 0; o < this.children.length; o++) r.children.push(this.children[o].toJSON(e).object)
  27114. }
  27115. if (i) {
  27116. var a = t(e.geometries),
  27117. s = t(e.materials),
  27118. l = t(e.textures),
  27119. c = t(e.images);
  27120. 0 < a.length && (n.geometries = a), 0 < s.length && (n.materials = s), 0 < l.length && (n.textures = l), 0 < c.length && (n.images = c)
  27121. }
  27122. return n.object = r, n
  27123. },
  27124. clone: function (e) {
  27125. return (new this.constructor).copy(this, e)
  27126. },
  27127. copy: function (e, t) {
  27128. if (void 0 === t && (t = !0), this.name = e.name, this.up.copy(e.up), this.position.copy(e.position), this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.rotationAutoUpdate = e.rotationAutoUpdate, this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate, this.visible = e.visible, this.castShadow = e.castShadow, this.receiveShadow = e.receiveShadow, this.frustumCulled = e.frustumCulled, this.renderOrder = e.renderOrder, this.userData = JSON.parse(JSON.stringify(e.userData)), !0 === t)
  27129. for (var i = 0; i < e.children.length; i++) {
  27130. var n = e.children[i];
  27131. this.add(n.clone())
  27132. }
  27133. return this
  27134. }
  27135. }, Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype), Ci.Object3DIdCount = 0, Ci.Face3 = function (e, t, i, n, r, o) {
  27136. this.a = e, this.b = t, this.c = i, this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3, this.vertexNormals = Array.isArray(n) ? n : [], this.color = r instanceof Ci.Color ? r : new Ci.Color, this.vertexColors = Array.isArray(r) ? r : [], this.materialIndex = void 0 !== o ? o : 0
  27137. }, Ci.Face3.prototype = {
  27138. constructor: Ci.Face3,
  27139. clone: function () {
  27140. return (new this.constructor).copy(this)
  27141. },
  27142. copy: function (e) {
  27143. this.a = e.a, this.b = e.b, this.c = e.c, this.normal.copy(e.normal), this.color.copy(e.color), this.materialIndex = e.materialIndex;
  27144. for (var t = 0, i = e.vertexNormals.length; t < i; t++) this.vertexNormals[t] = e.vertexNormals[t].clone();
  27145. for (t = 0, i = e.vertexColors.length; t < i; t++) this.vertexColors[t] = e.vertexColors[t].clone();
  27146. return this
  27147. }
  27148. }, Ci.BufferAttribute = function (e, t) {
  27149. this.uuid = Ci.Math.generateUUID(), this.array = e, this.itemSize = t, this.dynamic = !1, this.updateRange = {
  27150. offset: 0,
  27151. count: -1
  27152. }, this.version = 0
  27153. }, Ci.BufferAttribute.prototype = {
  27154. constructor: Ci.BufferAttribute,
  27155. get count() {
  27156. return this.array.length / this.itemSize
  27157. },
  27158. set needsUpdate(e) {
  27159. !0 === e && this.version++
  27160. },
  27161. setDynamic: function (e) {
  27162. return this.dynamic = e, this
  27163. },
  27164. copy: function (e) {
  27165. return this.array = new e.array.constructor(e.array), this.itemSize = e.itemSize, this.dynamic = e.dynamic, this
  27166. },
  27167. copyAt: function (e, t, i) {
  27168. e *= this.itemSize, i *= t.itemSize;
  27169. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n];
  27170. return this
  27171. },
  27172. copyArray: function (e) {
  27173. return this.array.set(e), this
  27174. },
  27175. copyColorsArray: function (e) {
  27176. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  27177. var o = e[n];
  27178. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n), o = new Ci.Color), t[i++] = o.r, t[i++] = o.g, t[i++] = o.b
  27179. }
  27180. return this
  27181. },
  27182. copyIndicesArray: function (e) {
  27183. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  27184. var o = e[n];
  27185. t[i++] = o.a, t[i++] = o.b, t[i++] = o.c
  27186. }
  27187. return this
  27188. },
  27189. copyVector2sArray: function (e) {
  27190. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  27191. var o = e[n];
  27192. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n), o = new Ci.Vector2), t[i++] = o.x, t[i++] = o.y
  27193. }
  27194. return this
  27195. },
  27196. copyVector3sArray: function (e) {
  27197. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  27198. var o = e[n];
  27199. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n), o = new Ci.Vector3), t[i++] = o.x, t[i++] = o.y, t[i++] = o.z
  27200. }
  27201. return this
  27202. },
  27203. copyVector4sArray: function (e) {
  27204. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  27205. var o = e[n];
  27206. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n), o = new Ci.Vector4), t[i++] = o.x, t[i++] = o.y, t[i++] = o.z, t[i++] = o.w
  27207. }
  27208. return this
  27209. },
  27210. set: function (e, t) {
  27211. return void 0 === t && (t = 0), this.array.set(e, t), this
  27212. },
  27213. getX: function (e) {
  27214. return this.array[e * this.itemSize]
  27215. },
  27216. setX: function (e, t) {
  27217. return this.array[e * this.itemSize] = t, this
  27218. },
  27219. getY: function (e) {
  27220. return this.array[e * this.itemSize + 1]
  27221. },
  27222. setY: function (e, t) {
  27223. return this.array[e * this.itemSize + 1] = t, this
  27224. },
  27225. getZ: function (e) {
  27226. return this.array[e * this.itemSize + 2]
  27227. },
  27228. setZ: function (e, t) {
  27229. return this.array[e * this.itemSize + 2] = t, this
  27230. },
  27231. getW: function (e) {
  27232. return this.array[e * this.itemSize + 3]
  27233. },
  27234. setW: function (e, t) {
  27235. return this.array[e * this.itemSize + 3] = t, this
  27236. },
  27237. setXY: function (e, t, i) {
  27238. return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this
  27239. },
  27240. setXYZ: function (e, t, i, n) {
  27241. return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = n, this
  27242. },
  27243. setXYZW: function (e, t, i, n, r) {
  27244. return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = i, this.array[e + 2] = n, this.array[e + 3] = r, this
  27245. },
  27246. clone: function () {
  27247. return (new this.constructor).copy(this)
  27248. }
  27249. }, Ci.Int8Attribute = function (e, t) {
  27250. return new Ci.BufferAttribute(new Int8Array(e), t)
  27251. }, Ci.Uint8Attribute = function (e, t) {
  27252. return new Ci.BufferAttribute(new Uint8Array(e), t)
  27253. }, Ci.Uint8ClampedAttribute = function (e, t) {
  27254. return new Ci.BufferAttribute(new Uint8ClampedArray(e), t)
  27255. }, Ci.Int16Attribute = function (e, t) {
  27256. return new Ci.BufferAttribute(new Int16Array(e), t)
  27257. }, Ci.Uint16Attribute = function (e, t) {
  27258. return new Ci.BufferAttribute(new Uint16Array(e), t)
  27259. }, Ci.Int32Attribute = function (e, t) {
  27260. return new Ci.BufferAttribute(new Int32Array(e), t)
  27261. }, Ci.Uint32Attribute = function (e, t) {
  27262. return new Ci.BufferAttribute(new Uint32Array(e), t)
  27263. }, Ci.Float32Attribute = function (e, t) {
  27264. return new Ci.BufferAttribute(new Float32Array(e), t)
  27265. }, Ci.Float64Attribute = function (e, t) {
  27266. return new Ci.BufferAttribute(new Float64Array(e), t)
  27267. }, Ci.DynamicBufferAttribute = function (e, t) {
  27268. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."), new Ci.BufferAttribute(e, t).setDynamic(!0)
  27269. }, Ci.InstancedBufferAttribute = function (e, t, i) {
  27270. Ci.BufferAttribute.call(this, e, t), this.meshPerAttribute = i || 1
  27271. }, Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype), Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute, Ci.InstancedBufferAttribute.prototype.copy = function (e) {
  27272. return Ci.BufferAttribute.prototype.copy.call(this, e), this.meshPerAttribute = e.meshPerAttribute, this
  27273. }, Ci.InterleavedBuffer = function (e, t) {
  27274. this.uuid = Ci.Math.generateUUID(), this.array = e, this.stride = t, this.dynamic = !1, this.updateRange = {
  27275. offset: 0,
  27276. count: -1
  27277. }, this.version = 0
  27278. }, Ci.InterleavedBuffer.prototype = {
  27279. constructor: Ci.InterleavedBuffer,
  27280. get length() {
  27281. return this.array.length
  27282. },
  27283. get count() {
  27284. return this.array.length / this.stride
  27285. },
  27286. set needsUpdate(e) {
  27287. !0 === e && this.version++
  27288. },
  27289. setDynamic: function (e) {
  27290. return this.dynamic = e, this
  27291. },
  27292. copy: function (e) {
  27293. return this.array = new e.array.constructor(e.array), this.stride = e.stride, this.dynamic = e.dynamic, this
  27294. },
  27295. copyAt: function (e, t, i) {
  27296. e *= this.stride, i *= t.stride;
  27297. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n];
  27298. return this
  27299. },
  27300. set: function (e, t) {
  27301. return void 0 === t && (t = 0), this.array.set(e, t), this
  27302. },
  27303. clone: function () {
  27304. return (new this.constructor).copy(this)
  27305. }
  27306. }, Ci.InstancedInterleavedBuffer = function (e, t, i) {
  27307. Ci.InterleavedBuffer.call(this, e, t), this.meshPerAttribute = i || 1
  27308. }, Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype), Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer, Ci.InstancedInterleavedBuffer.prototype.copy = function (e) {
  27309. return Ci.InterleavedBuffer.prototype.copy.call(this, e), this.meshPerAttribute = e.meshPerAttribute, this
  27310. }, Ci.InterleavedBufferAttribute = function (e, t, i) {
  27311. this.uuid = Ci.Math.generateUUID(), this.data = e, this.itemSize = t, this.offset = i
  27312. }, Ci.InterleavedBufferAttribute.prototype = {
  27313. constructor: Ci.InterleavedBufferAttribute,
  27314. get length() {
  27315. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."), this.array.length
  27316. },
  27317. get count() {
  27318. return this.data.count
  27319. },
  27320. setX: function (e, t) {
  27321. return this.data.array[e * this.data.stride + this.offset] = t, this
  27322. },
  27323. setY: function (e, t) {
  27324. return this.data.array[e * this.data.stride + this.offset + 1] = t, this
  27325. },
  27326. setZ: function (e, t) {
  27327. return this.data.array[e * this.data.stride + this.offset + 2] = t, this
  27328. },
  27329. setW: function (e, t) {
  27330. return this.data.array[e * this.data.stride + this.offset + 3] = t, this
  27331. },
  27332. getX: function (e) {
  27333. return this.data.array[e * this.data.stride + this.offset]
  27334. },
  27335. getY: function (e) {
  27336. return this.data.array[e * this.data.stride + this.offset + 1]
  27337. },
  27338. getZ: function (e) {
  27339. return this.data.array[e * this.data.stride + this.offset + 2]
  27340. },
  27341. getW: function (e) {
  27342. return this.data.array[e * this.data.stride + this.offset + 3]
  27343. },
  27344. setXY: function (e, t, i) {
  27345. return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = i, this
  27346. },
  27347. setXYZ: function (e, t, i, n) {
  27348. return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = n, this
  27349. },
  27350. setXYZW: function (e, t, i, n, r) {
  27351. return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t, this.data.array[e + 1] = i, this.data.array[e + 2] = n, this.data.array[e + 3] = r, this
  27352. }
  27353. }, Ci.Geometry = function () {
  27354. Object.defineProperty(this, "id", {
  27355. value: Ci.GeometryIdCount++
  27356. }), this.uuid = Ci.Math.generateUUID(), this.name = "", this.type = "Geometry", this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [
  27357. []
  27358. ], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.verticesNeedUpdate = !1, this.elementsNeedUpdate = !1, this.uvsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.lineDistancesNeedUpdate = !1, this.groupsNeedUpdate = !1
  27359. }, Ci.Geometry.prototype = {
  27360. constructor: Ci.Geometry,
  27361. applyMatrix: function (e) {
  27362. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  27363. this.vertices[i].applyMatrix4(e)
  27364. }
  27365. for (i = 0, n = this.faces.length; i < n; i++) {
  27366. var r = this.faces[i];
  27367. r.normal.applyMatrix3(t).normalize();
  27368. for (var o = 0, a = r.vertexNormals.length; o < a; o++) r.vertexNormals[o].applyMatrix3(t).normalize()
  27369. }
  27370. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this.verticesNeedUpdate = !0, this.normalsNeedUpdate = !0, this
  27371. },
  27372. rotateX: function (e) {
  27373. return void 0 === mt && (mt = new Ci.Matrix4), mt.makeRotationX(e), this.applyMatrix(mt), this
  27374. },
  27375. rotateY: function (e) {
  27376. return void 0 === gt && (gt = new Ci.Matrix4), gt.makeRotationY(e), this.applyMatrix(gt), this
  27377. },
  27378. rotateZ: function (e) {
  27379. return void 0 === ft && (ft = new Ci.Matrix4), ft.makeRotationZ(e), this.applyMatrix(ft), this
  27380. },
  27381. translate: function (e, t, i) {
  27382. return void 0 === pt && (pt = new Ci.Matrix4), pt.makeTranslation(e, t, i), this.applyMatrix(pt), this
  27383. },
  27384. scale: function (e, t, i) {
  27385. return void 0 === dt && (dt = new Ci.Matrix4), dt.makeScale(e, t, i), this.applyMatrix(dt), this
  27386. },
  27387. lookAt: function (e) {
  27388. void 0 === ut && (ut = new Ci.Object3D), ut.lookAt(e), ut.updateMatrix(), this.applyMatrix(ut.matrix)
  27389. },
  27390. fromBufferGeometry: function (e) {
  27391. function t(e, t, i, n) {
  27392. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : [],
  27393. o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : [],
  27394. a = new Ci.Face3(e, t, i, r, o, n);
  27395. s.faces.push(a), void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]), void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  27396. }
  27397. var s = this,
  27398. i = null !== e.index ? e.index.array : void 0,
  27399. n = e.attributes,
  27400. r = n.position.array,
  27401. l = void 0 !== n.normal ? n.normal.array : void 0,
  27402. c = void 0 !== n.color ? n.color.array : void 0,
  27403. h = void 0 !== n.uv ? n.uv.array : void 0,
  27404. u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  27405. void 0 !== u && (this.faceVertexUvs[1] = []);
  27406. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3, a += 2) s.vertices.push(new Ci.Vector3(r[o], r[o + 1], r[o + 2])), void 0 !== l && d.push(new Ci.Vector3(l[o], l[o + 1], l[o + 2])), void 0 !== c && s.colors.push(new Ci.Color(c[o], c[o + 1], c[o + 2])), void 0 !== h && p.push(new Ci.Vector2(h[a], h[a + 1])), void 0 !== u && f.push(new Ci.Vector2(u[a], u[a + 1]));
  27407. if (void 0 !== i) {
  27408. var g = e.groups;
  27409. if (0 < g.length)
  27410. for (o = 0; o < g.length; o++)
  27411. for (var m = g[o], v = m.start, y = (a = v, v + m.count); a < y; a += 3) t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  27412. else
  27413. for (o = 0; o < i.length; o += 3) t(i[o], i[o + 1], i[o + 2])
  27414. } else
  27415. for (o = 0; o < r.length / 3; o += 3) t(o, o + 1, o + 2);
  27416. return this.computeFaceNormals(), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this
  27417. },
  27418. center: function () {
  27419. this.computeBoundingBox();
  27420. var e = this.boundingBox.center().negate();
  27421. return this.translate(e.x, e.y, e.z), e
  27422. },
  27423. normalize: function () {
  27424. this.computeBoundingSphere();
  27425. var e = this.boundingSphere.center,
  27426. t = this.boundingSphere.radius,
  27427. i = 0 === t ? 1 : 1 / t,
  27428. n = new Ci.Matrix4;
  27429. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1), this.applyMatrix(n), this
  27430. },
  27431. computeFaceNormals: function () {
  27432. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  27433. var r = this.faces[i],
  27434. o = this.vertices[r.a],
  27435. a = this.vertices[r.b],
  27436. s = this.vertices[r.c];
  27437. e.subVectors(s, a), t.subVectors(o, a), e.cross(t), e.normalize(), r.normal.copy(e)
  27438. }
  27439. },
  27440. computeVertexNormals: function (e) {
  27441. var t, i, n, r, o, a;
  27442. for (void 0 === e && (e = !0), a = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++) a[t] = new Ci.Vector3;
  27443. if (e) {
  27444. var s, l, c, h = new Ci.Vector3,
  27445. u = new Ci.Vector3;
  27446. for (n = 0, r = this.faces.length; n < r; n++) o = this.faces[n], s = this.vertices[o.a], l = this.vertices[o.b], c = this.vertices[o.c], h.subVectors(c, l), u.subVectors(s, l), h.cross(u), a[o.a].add(h), a[o.b].add(h), a[o.c].add(h)
  27447. } else
  27448. for (n = 0, r = this.faces.length; n < r; n++) a[(o = this.faces[n]).a].add(o.normal), a[o.b].add(o.normal), a[o.c].add(o.normal);
  27449. for (t = 0, i = this.vertices.length; t < i; t++) a[t].normalize();
  27450. for (n = 0, r = this.faces.length; n < r; n++) {
  27451. var d = (o = this.faces[n]).vertexNormals;
  27452. 3 === d.length ? (d[0].copy(a[o.a]), d[1].copy(a[o.b]), d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(), d[1] = a[o.b].clone(), d[2] = a[o.c].clone())
  27453. }
  27454. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  27455. },
  27456. computeMorphNormals: function () {
  27457. var e, t, i, n, r;
  27458. for (i = 0, n = this.faces.length; i < n; i++)
  27459. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(), r.__originalVertexNormals || (r.__originalVertexNormals = []), e = 0, t = r.vertexNormals.length; e < t; e++) r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  27460. var o = new Ci.Geometry;
  27461. for (o.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  27462. if (!this.morphNormals[e]) {
  27463. this.morphNormals[e] = {}, this.morphNormals[e].faceNormals = [], this.morphNormals[e].vertexNormals = [];
  27464. var a = this.morphNormals[e].faceNormals,
  27465. s = this.morphNormals[e].vertexNormals;
  27466. for (i = 0, n = this.faces.length; i < n; i++) l = new Ci.Vector3, c = {
  27467. a: new Ci.Vector3,
  27468. b: new Ci.Vector3,
  27469. c: new Ci.Vector3
  27470. }, a.push(l), s.push(c)
  27471. }
  27472. var l, c, h = this.morphNormals[e];
  27473. for (o.vertices = this.morphTargets[e].vertices, o.computeFaceNormals(), o.computeVertexNormals(), i = 0, n = this.faces.length; i < n; i++) r = this.faces[i], l = h.faceNormals[i], c = h.vertexNormals[i], l.copy(r.normal), c.a.copy(r.vertexNormals[0]), c.b.copy(r.vertexNormals[1]), c.c.copy(r.vertexNormals[2])
  27474. }
  27475. for (i = 0, n = this.faces.length; i < n; i++)(r = this.faces[i]).normal = r.__originalFaceNormal, r.vertexNormals = r.__originalVertexNormals
  27476. },
  27477. computeTangents: function () {
  27478. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  27479. },
  27480. computeLineDistances: function () {
  27481. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++) 0 < i && (e += t[i].distanceTo(t[i - 1])), this.lineDistances[i] = e
  27482. },
  27483. computeBoundingBox: function () {
  27484. null === this.boundingBox && (this.boundingBox = new Ci.Box3), this.boundingBox.setFromPoints(this.vertices)
  27485. },
  27486. computeBoundingSphere: function () {
  27487. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere), this.boundingSphere.setFromPoints(this.vertices)
  27488. },
  27489. merge: function (e, t, i) {
  27490. if (e instanceof Ci.Geometry != 0) {
  27491. var n, r = this.vertices.length,
  27492. o = this.vertices,
  27493. a = e.vertices,
  27494. s = this.faces,
  27495. l = e.faces,
  27496. c = this.faceVertexUvs[0],
  27497. h = e.faceVertexUvs[0];
  27498. void 0 === i && (i = 0), void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  27499. for (var u = 0, d = a.length; u < d; u++) {
  27500. var p = a[u].clone();
  27501. void 0 !== t && p.applyMatrix4(t), o.push(p)
  27502. }
  27503. for (u = 0, d = l.length; u < d; u++) {
  27504. var f, g, m, v = l[u],
  27505. y = v.vertexNormals,
  27506. A = v.vertexColors;
  27507. (f = new Ci.Face3(v.a + r, v.b + r, v.c + r)).normal.copy(v.normal), void 0 !== n && f.normal.applyMatrix3(n).normalize();
  27508. for (var C = 0, I = y.length; C < I; C++) g = y[C].clone(), void 0 !== n && g.applyMatrix3(n).normalize(), f.vertexNormals.push(g);
  27509. f.color.copy(v.color);
  27510. for (C = 0, I = A.length; C < I; C++) m = A[C], f.vertexColors.push(m.clone());
  27511. f.materialIndex = v.materialIndex + i, s.push(f)
  27512. }
  27513. for (u = 0, d = h.length; u < d; u++) {
  27514. var E = h[u],
  27515. _ = [];
  27516. if (void 0 !== E) {
  27517. for (C = 0, I = E.length; C < I; C++) _.push(E[C].clone());
  27518. c.push(_)
  27519. }
  27520. }
  27521. } else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  27522. },
  27523. mergeMesh: function (e) {
  27524. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix))
  27525. },
  27526. mergeVertices: function () {
  27527. var e, t, i, n, r, o, a, s, l = {},
  27528. c = [],
  27529. h = [],
  27530. u = Math.pow(10, 4);
  27531. for (i = 0, n = this.vertices.length; i < n; i++) e = this.vertices[i], void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i, c.push(this.vertices[i]), h[i] = c.length - 1) : h[i] = h[l[t]];
  27532. var d = [];
  27533. for (i = 0, n = this.faces.length; i < n; i++) {
  27534. (r = this.faces[i]).a = h[r.a], r.b = h[r.b], r.c = h[r.c], o = [r.a, r.b, r.c];
  27535. for (var p = 0; p < 3; p++)
  27536. if (o[p] === o[(p + 1) % 3]) {
  27537. p,
  27538. d.push(i);
  27539. break
  27540. }
  27541. }
  27542. for (i = d.length - 1; 0 <= i; i--) {
  27543. var f = d[i];
  27544. for (this.faces.splice(f, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++) this.faceVertexUvs[a].splice(f, 1)
  27545. }
  27546. var g = this.vertices.length - c.length;
  27547. return this.vertices = c, g
  27548. },
  27549. sortFacesByMaterialIndex: function () {
  27550. for (var e = this.faces, t = e.length, i = 0; i < t; i++) e[i]._id = i;
  27551. e.sort(function (e, t) {
  27552. return e.materialIndex - t.materialIndex
  27553. });
  27554. var n, r, o = this.faceVertexUvs[0],
  27555. a = this.faceVertexUvs[1];
  27556. o && o.length === t && (n = []), a && a.length === t && (r = []);
  27557. for (i = 0; i < t; i++) {
  27558. var s = e[i]._id;
  27559. n && n.push(o[s]), r && r.push(a[s])
  27560. }
  27561. n && (this.faceVertexUvs[0] = n), r && (this.faceVertexUvs[1] = r)
  27562. },
  27563. toJSON: function () {
  27564. function e(e, t, i) {
  27565. return i ? e | 1 << t : e & ~(1 << t)
  27566. }
  27567. function t(e) {
  27568. var t = e.x.toString() + e.y.toString() + e.z.toString();
  27569. return void 0 !== d[t] || (d[t] = u.length / 3, u.push(e.x, e.y, e.z)), d[t]
  27570. }
  27571. function i(e) {
  27572. var t = e.r.toString() + e.g.toString() + e.b.toString();
  27573. return void 0 !== f[t] || (f[t] = p.length, p.push(e.getHex())), f[t]
  27574. }
  27575. function n(e) {
  27576. var t = e.x.toString() + e.y.toString();
  27577. return void 0 !== m[t] || (m[t] = g.length / 2, g.push(e.x, e.y)), m[t]
  27578. }
  27579. var r = {
  27580. metadata: {
  27581. version: 4.4,
  27582. type: "Geometry",
  27583. generator: "Geometry.toJSON"
  27584. }
  27585. };
  27586. if (r.uuid = this.uuid, r.type = this.type, "" !== this.name && (r.name = this.name), void 0 !== this.parameters) {
  27587. var o = this.parameters;
  27588. for (var a in o) void 0 !== o[a] && (r[a] = o[a]);
  27589. return r
  27590. }
  27591. for (var s = [], l = 0; l < this.vertices.length; l++) {
  27592. var c = this.vertices[l];
  27593. s.push(c.x, c.y, c.z)
  27594. }
  27595. var h = [],
  27596. u = [],
  27597. d = {},
  27598. p = [],
  27599. f = {},
  27600. g = [],
  27601. m = {};
  27602. for (l = 0; l < this.faces.length; l++) {
  27603. var v = this.faces[l],
  27604. y = void 0 !== this.faceVertexUvs[0][l],
  27605. A = 0 < v.normal.length(),
  27606. C = 0 < v.vertexNormals.length,
  27607. I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  27608. E = 0 < v.vertexColors.length,
  27609. _ = 0;
  27610. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E), h.push(_), h.push(v.a, v.b, v.c), h.push(v.materialIndex), y) {
  27611. var b = this.faceVertexUvs[0][l];
  27612. h.push(n(b[0]), n(b[1]), n(b[2]))
  27613. }
  27614. if (A && h.push(t(v.normal)), C) {
  27615. var w = v.vertexNormals;
  27616. h.push(t(w[0]), t(w[1]), t(w[2]))
  27617. }
  27618. if (I && h.push(i(v.color)), E) {
  27619. var T = v.vertexColors;
  27620. h.push(i(T[0]), i(T[1]), i(T[2]))
  27621. }
  27622. }
  27623. return r.data = {}, r.data.vertices = s, r.data.normals = u, 0 < p.length && (r.data.colors = p), 0 < g.length && (r.data.uvs = [g]), r.data.faces = h, r
  27624. },
  27625. clone: function () {
  27626. return (new Ci.Geometry).copy(this)
  27627. },
  27628. copy: function (e) {
  27629. this.vertices = [], this.faces = [], this.faceVertexUvs = [
  27630. []
  27631. ];
  27632. for (var t = e.vertices, i = 0, n = t.length; i < n; i++) this.vertices.push(t[i].clone());
  27633. var r = e.faces;
  27634. for (i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone());
  27635. for (i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  27636. var o = e.faceVertexUvs[i];
  27637. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  27638. for (var a = 0, s = o.length; a < s; a++) {
  27639. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  27640. var d = l[h];
  27641. c.push(d.clone())
  27642. }
  27643. this.faceVertexUvs[i].push(c)
  27644. }
  27645. }
  27646. return this
  27647. },
  27648. dispose: function () {
  27649. this.dispatchEvent({
  27650. type: "dispose"
  27651. })
  27652. }
  27653. }, Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype), Ci.GeometryIdCount = 0, Ci.DirectGeometry = function () {
  27654. Object.defineProperty(this, "id", {
  27655. value: Ci.GeometryIdCount++
  27656. }), this.uuid = Ci.Math.generateUUID(), this.name = "", this.type = "DirectGeometry", this.indices = [], this.vertices = [], this.normals = [], this.colors = [], this.uvs = [], this.uvs2 = [], this.groups = [], this.morphTargets = {}, this.skinWeights = [], this.skinIndices = [], this.boundingBox = null, this.boundingSphere = null, this.verticesNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.uvsNeedUpdate = !1, this.groupsNeedUpdate = !1
  27657. }, Ci.DirectGeometry.prototype = {
  27658. constructor: Ci.DirectGeometry,
  27659. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  27660. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  27661. computeFaceNormals: function () {
  27662. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  27663. },
  27664. computeVertexNormals: function () {
  27665. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  27666. },
  27667. computeGroups: function (e) {
  27668. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  27669. var a = r[o];
  27670. a.materialIndex !== i && (i = a.materialIndex, void 0 !== t && (t.count = 3 * o - t.start, n.push(t)), t = {
  27671. start: 3 * o,
  27672. materialIndex: i
  27673. })
  27674. }
  27675. void 0 !== t && (t.count = 3 * o - t.start, n.push(t)), this.groups = n
  27676. },
  27677. fromGeometry: function (e) {
  27678. var t, i = e.faces,
  27679. n = e.vertices,
  27680. r = e.faceVertexUvs,
  27681. o = r[0] && 0 < r[0].length,
  27682. a = r[1] && 0 < r[1].length,
  27683. s = e.morphTargets,
  27684. l = s.length;
  27685. if (0 < l) {
  27686. t = [];
  27687. for (var c = 0; c < l; c++) t[c] = [];
  27688. this.morphTargets.position = t
  27689. }
  27690. var h, u = e.morphNormals,
  27691. d = u.length;
  27692. if (0 < d) {
  27693. h = [];
  27694. for (c = 0; c < d; c++) h[c] = [];
  27695. this.morphTargets.normal = h
  27696. }
  27697. var p = e.skinIndices,
  27698. f = e.skinWeights,
  27699. g = p.length === n.length,
  27700. m = f.length === n.length;
  27701. for (c = 0; c < i.length; c++) {
  27702. var v = i[c];
  27703. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  27704. var y = v.vertexNormals;
  27705. if (3 === y.length) this.normals.push(y[0], y[1], y[2]);
  27706. else {
  27707. var A = v.normal;
  27708. this.normals.push(A, A, A)
  27709. }
  27710. var C, I = v.vertexColors;
  27711. if (3 === I.length) this.colors.push(I[0], I[1], I[2]);
  27712. else {
  27713. var E = v.color;
  27714. this.colors.push(E, E, E)
  27715. }
  27716. if (!0 === o) void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c), this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  27717. if (!0 === a) void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c), this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  27718. for (var _ = 0; _ < l; _++) {
  27719. var b = s[_].vertices;
  27720. t[_].push(b[v.a], b[v.b], b[v.c])
  27721. }
  27722. for (_ = 0; _ < d; _++) {
  27723. var w = u[_].vertexNormals[c];
  27724. h[_].push(w.a, w.b, w.c)
  27725. }
  27726. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]), m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  27727. }
  27728. return this.computeGroups(e), this.verticesNeedUpdate = e.verticesNeedUpdate, this.normalsNeedUpdate = e.normalsNeedUpdate, this.colorsNeedUpdate = e.colorsNeedUpdate, this.uvsNeedUpdate = e.uvsNeedUpdate, this.groupsNeedUpdate = e.groupsNeedUpdate, this
  27729. },
  27730. dispose: function () {
  27731. this.dispatchEvent({
  27732. type: "dispose"
  27733. })
  27734. }
  27735. }, Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype), Ci.BufferGeometry = function () {
  27736. Object.defineProperty(this, "id", {
  27737. value: Ci.GeometryIdCount++
  27738. }), this.uuid = Ci.Math.generateUUID(), this.name = "", this.type = "BufferGeometry", this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = {
  27739. start: 0,
  27740. count: 1 / 0
  27741. }
  27742. }, Ci.BufferGeometry.prototype = {
  27743. constructor: Ci.BufferGeometry,
  27744. getIndex: function () {
  27745. return this.index
  27746. },
  27747. setIndex: function (e) {
  27748. this.index = e
  27749. },
  27750. addAttribute: function (e, t) {
  27751. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."), void this.addAttribute(e, new Ci.BufferAttribute(t, arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."), void this.setIndex(t)) : (this.attributes[e] = t, this)
  27752. },
  27753. getAttribute: function (e) {
  27754. return this.attributes[e]
  27755. },
  27756. removeAttribute: function (e) {
  27757. return delete this.attributes[e], this
  27758. },
  27759. addGroup: function (e, t, i) {
  27760. this.groups.push({
  27761. start: e,
  27762. count: t,
  27763. materialIndex: void 0 !== i ? i : 0
  27764. })
  27765. },
  27766. clearGroups: function () {
  27767. this.groups = []
  27768. },
  27769. setDrawRange: function (e, t) {
  27770. this.drawRange.start = e, this.drawRange.count = t
  27771. },
  27772. applyMatrix: function (e) {
  27773. var t = this.attributes.position;
  27774. void 0 !== t && (e.applyToVector3Array(t.array), t.needsUpdate = !0);
  27775. var i = this.attributes.normal;
  27776. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array), i.needsUpdate = !0);
  27777. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this
  27778. },
  27779. rotateX: function (e) {
  27780. return void 0 === ht && (ht = new Ci.Matrix4), ht.makeRotationX(e), this.applyMatrix(ht), this
  27781. },
  27782. rotateY: function (e) {
  27783. return void 0 === ct && (ct = new Ci.Matrix4), ct.makeRotationY(e), this.applyMatrix(ct), this
  27784. },
  27785. rotateZ: function (e) {
  27786. return void 0 === lt && (lt = new Ci.Matrix4), lt.makeRotationZ(e), this.applyMatrix(lt), this
  27787. },
  27788. translate: function (e, t, i) {
  27789. return void 0 === st && (st = new Ci.Matrix4), st.makeTranslation(e, t, i), this.applyMatrix(st), this
  27790. },
  27791. scale: function (e, t, i) {
  27792. return void 0 === at && (at = new Ci.Matrix4), at.makeScale(e, t, i), this.applyMatrix(at), this
  27793. },
  27794. lookAt: function (e) {
  27795. void 0 === ot && (ot = new Ci.Object3D), ot.lookAt(e), ot.updateMatrix(), this.applyMatrix(ot.matrix)
  27796. },
  27797. center: function () {
  27798. this.computeBoundingBox();
  27799. var e = this.boundingBox.center().negate();
  27800. return this.translate(e.x, e.y, e.z), e
  27801. },
  27802. setFromObject: function (e) {
  27803. var t = e.geometry;
  27804. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  27805. var i = new Ci.Float32Attribute(3 * t.vertices.length, 3),
  27806. n = new Ci.Float32Attribute(3 * t.colors.length, 3);
  27807. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)), this.addAttribute("color", n.copyColorsArray(t.colors)), t.lineDistances && t.lineDistances.length === t.vertices.length) {
  27808. var r = new Ci.Float32Attribute(t.lineDistances.length, 1);
  27809. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  27810. }
  27811. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()), null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  27812. } else e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  27813. return this
  27814. },
  27815. updateFromObject: function (e) {
  27816. var t, i = e.geometry;
  27817. if (e instanceof Ci.Mesh) {
  27818. var n = i.__directGeometry;
  27819. if (void 0 === n) return this.fromGeometry(i);
  27820. n.verticesNeedUpdate = i.verticesNeedUpdate, n.normalsNeedUpdate = i.normalsNeedUpdate, n.colorsNeedUpdate = i.colorsNeedUpdate, n.uvsNeedUpdate = i.uvsNeedUpdate, n.groupsNeedUpdate = i.groupsNeedUpdate, i.verticesNeedUpdate = !1, i.normalsNeedUpdate = !1, i.colorsNeedUpdate = !1, i.uvsNeedUpdate = !1, i.groupsNeedUpdate = !1, i = n
  27821. }!0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices), t.needsUpdate = !0), i.verticesNeedUpdate = !1);
  27822. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals), t.needsUpdate = !0), i.normalsNeedUpdate = !1);
  27823. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors), t.needsUpdate = !0), i.colorsNeedUpdate = !1);
  27824. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs), t.needsUpdate = !0), i.uvsNeedUpdate = !1);
  27825. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances), t.needsUpdate = !0), i.lineDistancesNeedUpdate = !1);
  27826. return i.groupsNeedUpdate && (i.computeGroups(e.geometry), this.groups = i.groups, i.groupsNeedUpdate = !1), this
  27827. },
  27828. fromGeometry: function (e) {
  27829. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e), this.fromDirectGeometry(e.__directGeometry)
  27830. },
  27831. fromDirectGeometry: function (e) {
  27832. var t = new Float32Array(3 * e.vertices.length);
  27833. if (this.addAttribute("position", new Ci.BufferAttribute(t, 3).copyVector3sArray(e.vertices)), 0 < e.normals.length) {
  27834. var i = new Float32Array(3 * e.normals.length);
  27835. this.addAttribute("normal", new Ci.BufferAttribute(i, 3).copyVector3sArray(e.normals))
  27836. }
  27837. if (0 < e.colors.length) {
  27838. var n = new Float32Array(3 * e.colors.length);
  27839. this.addAttribute("color", new Ci.BufferAttribute(n, 3).copyColorsArray(e.colors))
  27840. }
  27841. if (0 < e.uvs.length) {
  27842. var r = new Float32Array(2 * e.uvs.length);
  27843. this.addAttribute("uv", new Ci.BufferAttribute(r, 2).copyVector2sArray(e.uvs))
  27844. }
  27845. if (0 < e.uvs2.length) {
  27846. var o = new Float32Array(2 * e.uvs2.length);
  27847. this.addAttribute("uv2", new Ci.BufferAttribute(o, 2).copyVector2sArray(e.uvs2))
  27848. }
  27849. if (0 < e.indices.length) {
  27850. var a = new(65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  27851. this.setIndex(new Ci.BufferAttribute(a, 1).copyIndicesArray(e.indices))
  27852. }
  27853. for (var s in this.groups = e.groups, e.morphTargets) {
  27854. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  27855. var d = c[h],
  27856. p = new Ci.Float32Attribute(3 * d.length, 3);
  27857. l.push(p.copyVector3sArray(d))
  27858. }
  27859. this.morphAttributes[s] = l
  27860. }
  27861. if (0 < e.skinIndices.length) {
  27862. var f = new Ci.Float32Attribute(4 * e.skinIndices.length, 4);
  27863. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  27864. }
  27865. if (0 < e.skinWeights.length) {
  27866. var g = new Ci.Float32Attribute(4 * e.skinWeights.length, 4);
  27867. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  27868. }
  27869. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
  27870. },
  27871. computeBoundingBox: (new Ci.Vector3, function () {
  27872. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  27873. var e = this.attributes.position.array;
  27874. e && this.boundingBox.setFromArray(e), void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)), (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)
  27875. }),
  27876. computeBoundingSphere: (nt = new Ci.Box3, rt = new Ci.Vector3, function () {
  27877. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  27878. var e = this.attributes.position.array;
  27879. if (e) {
  27880. var t = this.boundingSphere.center;
  27881. nt.setFromArray(e), nt.center(t);
  27882. for (var i = 0, n = 0, r = e.length; n < r; n += 3) rt.fromArray(e, n), i = Math.max(i, t.distanceToSquared(rt));
  27883. this.boundingSphere.radius = Math.sqrt(i), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  27884. }
  27885. }),
  27886. computeFaceNormals: function () {},
  27887. computeVertexNormals: function () {
  27888. var e = this.index,
  27889. t = this.attributes,
  27890. i = this.groups;
  27891. if (t.position) {
  27892. var n = t.position.array;
  27893. if (void 0 === t.normal) this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length), 3));
  27894. else
  27895. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++) r[o] = 0;
  27896. var s, l, c, h = t.normal.array,
  27897. u = new Ci.Vector3,
  27898. d = new Ci.Vector3,
  27899. p = new Ci.Vector3,
  27900. f = new Ci.Vector3,
  27901. g = new Ci.Vector3;
  27902. if (e) {
  27903. var m = e.array;
  27904. 0 === i.length && this.addGroup(0, m.length);
  27905. for (var v = 0, y = i.length; v < y; ++v) {
  27906. var A = i[v],
  27907. C = A.start;
  27908. for (o = C, a = C + A.count; o < a; o += 3) s = 3 * m[o + 0], l = 3 * m[o + 1], c = 3 * m[o + 2], u.fromArray(n, s), d.fromArray(n, l), p.fromArray(n, c), f.subVectors(p, d), g.subVectors(u, d), f.cross(g), h[s] += f.x, h[1 + s] += f.y, h[2 + s] += f.z, h[l] += f.x, h[1 + l] += f.y, h[2 + l] += f.z, h[c] += f.x, h[1 + c] += f.y, h[2 + c] += f.z
  27909. }
  27910. } else
  27911. for (o = 0, a = n.length; o < a; o += 9) u.fromArray(n, o), d.fromArray(n, o + 3), p.fromArray(n, o + 6), f.subVectors(p, d), g.subVectors(u, d), f.cross(g), h[o] = f.x, h[o + 1] = f.y, h[o + 2] = f.z, h[o + 3] = f.x, h[o + 4] = f.y, h[o + 5] = f.z, h[o + 6] = f.x, h[o + 7] = f.y, h[o + 8] = f.z;
  27912. this.normalizeNormals(), t.normal.needsUpdate = !0
  27913. }
  27914. },
  27915. merge: function (e, t) {
  27916. if (e instanceof Ci.BufferGeometry != 0) {
  27917. void 0 === t && (t = 0);
  27918. var i = this.attributes;
  27919. for (var n in i)
  27920. if (void 0 !== e.attributes[n])
  27921. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++, l++) r[l] = a[s];
  27922. return this
  27923. }
  27924. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  27925. },
  27926. normalizeNormals: function () {
  27927. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3) e = r[o], t = r[o + 1], i = r[o + 2], n = 1 / Math.sqrt(e * e + t * t + i * i), r[o] *= n, r[o + 1] *= n, r[o + 2] *= n
  27928. },
  27929. toNonIndexed: function () {
  27930. if (null === this.index) return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."), this;
  27931. var e = new Ci.BufferGeometry,
  27932. t = this.index.array,
  27933. i = this.attributes;
  27934. for (var n in i) {
  27935. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  27936. l = t[h] * a;
  27937. for (var d = 0; d < a; d++) s[c++] = o[l++]
  27938. }
  27939. e.addAttribute(n, new Ci.BufferAttribute(s, a))
  27940. }
  27941. return e
  27942. },
  27943. toJSON: function () {
  27944. var e = {
  27945. metadata: {
  27946. version: 4.4,
  27947. type: "BufferGeometry",
  27948. generator: "BufferGeometry.toJSON"
  27949. }
  27950. };
  27951. if (e.uuid = this.uuid, e.type = this.type, "" !== this.name && (e.name = this.name), void 0 !== this.parameters) {
  27952. var t = this.parameters;
  27953. for (var i in t) void 0 !== t[i] && (e[i] = t[i]);
  27954. return e
  27955. }
  27956. e.data = {
  27957. attributes: {}
  27958. };
  27959. var n = this.index;
  27960. if (null !== n) {
  27961. var r = Array.prototype.slice.call(n.array);
  27962. e.data.index = {
  27963. type: n.array.constructor.name,
  27964. array: r
  27965. }
  27966. }
  27967. var o = this.attributes;
  27968. for (var i in o) {
  27969. var a = o[i];
  27970. r = Array.prototype.slice.call(a.array);
  27971. e.data.attributes[i] = {
  27972. itemSize: a.itemSize,
  27973. type: a.array.constructor.name,
  27974. array: r
  27975. }
  27976. }
  27977. var s = this.groups;
  27978. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  27979. var l = this.boundingSphere;
  27980. return null !== l && (e.data.boundingSphere = {
  27981. center: l.center.toArray(),
  27982. radius: l.radius
  27983. }), e
  27984. },
  27985. clone: function () {
  27986. return (new Ci.BufferGeometry).copy(this)
  27987. },
  27988. copy: function (e) {
  27989. var t = e.index;
  27990. null !== t && this.setIndex(t.clone());
  27991. var i = e.attributes;
  27992. for (var n in i) {
  27993. var r = i[n];
  27994. this.addAttribute(n, r.clone())
  27995. }
  27996. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  27997. var l = o[a];
  27998. this.addGroup(l.start, l.count)
  27999. }
  28000. return this
  28001. },
  28002. dispose: function () {
  28003. this.dispatchEvent({
  28004. type: "dispose"
  28005. })
  28006. }
  28007. }, Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype), Ci.BufferGeometry.MaxIndex = 65535, Ci.InstancedBufferGeometry = function () {
  28008. Ci.BufferGeometry.call(this), this.type = "InstancedBufferGeometry", this.maxInstancedCount = void 0
  28009. }, Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry, Ci.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  28010. this.groups.push({
  28011. start: e,
  28012. count: t,
  28013. instances: i
  28014. })
  28015. }, Ci.InstancedBufferGeometry.prototype.copy = function (e) {
  28016. var t = e.index;
  28017. null !== t && this.setIndex(t.clone());
  28018. var i = e.attributes;
  28019. for (var n in i) {
  28020. var r = i[n];
  28021. this.addAttribute(n, r.clone())
  28022. }
  28023. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  28024. var l = o[a];
  28025. this.addGroup(l.start, l.count, l.instances)
  28026. }
  28027. return this
  28028. }, Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype), Ci.Uniform = function (e, t) {
  28029. this.type = e, this.value = t, this.dynamic = !1
  28030. }, Ci.Uniform.prototype = {
  28031. constructor: Ci.Uniform,
  28032. onUpdate: function (e) {
  28033. return this.dynamic = !0, this.onUpdateCallback = e, this
  28034. }
  28035. }, Ci.AnimationClip = function (e, t, i) {
  28036. this.name = e || Ci.Math.generateUUID(), this.tracks = i, this.duration = void 0 !== t ? t : -1, this.duration < 0 && this.resetDuration(), this.trim(), this.optimize()
  28037. }, Ci.AnimationClip.prototype = {
  28038. constructor: Ci.AnimationClip,
  28039. resetDuration: function () {
  28040. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  28041. var n = this.tracks[t];
  28042. e = Math.max(e, n.times[n.times.length - 1])
  28043. }
  28044. this.duration = e
  28045. },
  28046. trim: function () {
  28047. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration);
  28048. return this
  28049. },
  28050. optimize: function () {
  28051. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize();
  28052. return this
  28053. }
  28054. }, Object.assign(Ci.AnimationClip, {
  28055. parse: function (e) {
  28056. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r) t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  28057. return new Ci.AnimationClip(e.name, e.duration, t)
  28058. },
  28059. toJSON: function (e) {
  28060. for (var t = [], i = e.tracks, n = {
  28061. name: e.name,
  28062. duration: e.duration,
  28063. tracks: t
  28064. }, r = 0, o = i.length; r !== o; ++r) t.push(Ci.KeyframeTrack.toJSON(i[r]));
  28065. return n
  28066. },
  28067. CreateFromMorphTargetSequence: function (e, t, i) {
  28068. for (var n = t.length, r = [], o = 0; o < n; o++) {
  28069. var a = [],
  28070. s = [];
  28071. a.push((o + n - 1) % n, o, (o + 1) % n), s.push(0, 1, 0);
  28072. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  28073. a = Ci.AnimationUtils.sortedArray(a, 1, l), s = Ci.AnimationUtils.sortedArray(s, 1, l), 0 === a[0] && (a.push(n), s.push(s[0])), r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]", a, s).scale(1 / i))
  28074. }
  28075. return new Ci.AnimationClip(e, -1, r)
  28076. },
  28077. findByName: function (e, t) {
  28078. for (var i = 0; i < e.length; i++)
  28079. if (e[i].name === t) return e[i];
  28080. return null
  28081. },
  28082. CreateClipsFromMorphTargetSequences: function (e, t) {
  28083. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  28084. var a = e[r],
  28085. s = a.name.match(n);
  28086. if (s && 1 < s.length) {
  28087. var l = i[h = s[1]];
  28088. l || (i[h] = l = []), l.push(a)
  28089. }
  28090. }
  28091. var c = [];
  28092. for (var h in i) c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  28093. return c
  28094. },
  28095. parseAnimation: function (e, t, i) {
  28096. if (!e) return console.error(" no animation in JSONLoader data"), null;
  28097. function n(e, t, i, n, r) {
  28098. if (0 !== i.length) {
  28099. var o = [],
  28100. a = [];
  28101. Ci.AnimationUtils.flattenJSON(i, o, a, n), 0 !== o.length && r.push(new e(t, o, a))
  28102. }
  28103. }
  28104. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  28105. var h = l[c].keys;
  28106. if (h && 0 != h.length)
  28107. if (h[0].morphTargets) {
  28108. for (var u = {}, d = 0; d < h.length; d++)
  28109. if (h[d].morphTargets)
  28110. for (var p = 0; p < h[d].morphTargets.length; p++) u[h[d].morphTargets[p]] = -1;
  28111. for (var f in u) {
  28112. var g = [],
  28113. m = [];
  28114. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  28115. var v = h[d];
  28116. g.push(v.time), m.push(v.morphTarget === f ? 1 : 0)
  28117. }
  28118. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]", g, m))
  28119. }
  28120. a = u.length * (s || 1)
  28121. } else {
  28122. var y = ".bones[" + t[c].name + "]";
  28123. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r), n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r), n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  28124. }
  28125. }
  28126. return 0 === r.length ? null : new Ci.AnimationClip(o, a, r)
  28127. }
  28128. }), Ci.AnimationMixer = function (e) {
  28129. this._root = e, this._initMemoryManager(), this._accuIndex = 0, this.time = 0, this.timeScale = 1
  28130. }, Ci.AnimationMixer.prototype = {
  28131. constructor: Ci.AnimationMixer,
  28132. clipAction: function (e, t) {
  28133. var i, n = (t || this._root).uuid,
  28134. r = "string" == typeof e ? e : e.name,
  28135. o = e !== r ? e : null,
  28136. a = this._actionsByClip[r];
  28137. if (void 0 !== a) {
  28138. var s = a.actionByRoot[n];
  28139. if (void 0 !== s) return s;
  28140. if (o = (i = a.knownActions[0])._clip, e !== r && e !== o) throw new Error("Different clips with the same name detected!")
  28141. }
  28142. if (null === o) return null;
  28143. var l = new Ci.AnimationMixer._Action(this, o, t);
  28144. return this._bindAction(l, i), this._addInactiveAction(l, r, n), l
  28145. },
  28146. existingAction: function (e, t) {
  28147. var i = (t || this._root).uuid,
  28148. n = "string" == typeof e ? e : e.name,
  28149. r = this._actionsByClip[n];
  28150. return void 0 !== r && r.actionByRoot[i] || null
  28151. },
  28152. stopAllAction: function () {
  28153. var e = this._actions,
  28154. t = this._nActiveActions,
  28155. i = this._bindings,
  28156. n = this._nActiveBindings;
  28157. this._nActiveActions = 0;
  28158. for (var r = this._nActiveBindings = 0; r !== t; ++r) e[r].reset();
  28159. for (r = 0; r !== n; ++r) i[r].useCount = 0;
  28160. return this
  28161. },
  28162. update: function (e) {
  28163. e *= this.timeScale;
  28164. 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) {
  28165. var s = t[a];
  28166. s.enabled && s._update(n, e, r, o)
  28167. }
  28168. var l = this._bindings,
  28169. c = this._nActiveBindings;
  28170. for (a = 0; a !== c; ++a) l[a].apply(o);
  28171. return this
  28172. },
  28173. getRoot: function () {
  28174. return this._root
  28175. },
  28176. uncacheClip: function (e) {
  28177. var t = this._actions,
  28178. i = e.name,
  28179. n = this._actionsByClip,
  28180. r = n[i];
  28181. if (void 0 !== r) {
  28182. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  28183. var l = o[a];
  28184. this._deactivateAction(l);
  28185. var c = l._cacheIndex,
  28186. h = t[t.length - 1];
  28187. l._cacheIndex = null, l._byClipCacheIndex = null, t[h._cacheIndex = c] = h, t.pop(), this._removeInactiveBindingsForAction(l)
  28188. }
  28189. delete n[i]
  28190. }
  28191. },
  28192. uncacheRoot: function (e) {
  28193. var t = e.uuid,
  28194. i = this._actionsByClip;
  28195. for (var n in i) {
  28196. var r = i[n].actionByRoot[t];
  28197. void 0 !== r && (this._deactivateAction(r), this._removeInactiveAction(r))
  28198. }
  28199. var o = this._bindingsByRootAndName[t];
  28200. if (void 0 !== o)
  28201. for (var a in o) {
  28202. var s = o[a];
  28203. s.restoreOriginalState(), this._removeInactiveBinding(s)
  28204. }
  28205. },
  28206. uncacheAction: function (e, t) {
  28207. var i = this.existingAction(e, t);
  28208. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
  28209. }
  28210. }, Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype), Ci.AnimationMixer._Action = function (e, t, i) {
  28211. this._mixer = e, this._clip = t, this._localRoot = i || null;
  28212. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  28213. endingStart: Ci.ZeroCurvatureEnding,
  28214. endingEnd: Ci.ZeroCurvatureEnding
  28215. }, s = 0; s !== r; ++s) {
  28216. var l = n[s].createInterpolant(null);
  28217. (o[s] = l).settings = a
  28218. }
  28219. this._interpolantSettings = a, this._interpolants = o, this._propertyBindings = new Array(r), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._weightInterpolant = null, this.loop = Ci.LoopRepeat, this._loopCount = -1, this._startTime = null, this.time = 0, this.timeScale = 1, this._effectiveTimeScale = 1, this.weight = 1, this._effectiveWeight = 1, this.repetitions = 1 / 0, this.paused = !1, this.enabled = !0, this.clampWhenFinished = !1, this.zeroSlopeAtStart = !0, this.zeroSlopeAtEnd = !0
  28220. }, Ci.AnimationMixer._Action.prototype = {
  28221. constructor: Ci.AnimationMixer._Action,
  28222. play: function () {
  28223. return this._mixer._activateAction(this), this
  28224. },
  28225. stop: function () {
  28226. return this._mixer._deactivateAction(this), this.reset()
  28227. },
  28228. reset: function () {
  28229. return this.paused = !1, this.enabled = !0, this.time = 0, this._loopCount = -1, this._startTime = null, this.stopFading().stopWarping()
  28230. },
  28231. isRunning: function () {
  28232. return this._startTime, this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  28233. },
  28234. isScheduled: function () {
  28235. return this._mixer._isActiveAction(this)
  28236. },
  28237. startAt: function (e) {
  28238. return this._startTime = e, this
  28239. },
  28240. setLoop: function (e, t) {
  28241. return this.loop = e, this.repetitions = t, this
  28242. },
  28243. setEffectiveWeight: function (e) {
  28244. return this.weight = e, this._effectiveWeight = this.enabled ? e : 0, this.stopFading()
  28245. },
  28246. getEffectiveWeight: function () {
  28247. return this._effectiveWeight
  28248. },
  28249. fadeIn: function (e) {
  28250. return this._scheduleFading(e, 0, 1)
  28251. },
  28252. fadeOut: function (e) {
  28253. return this._scheduleFading(e, 1, 0)
  28254. },
  28255. crossFadeFrom: function (e, t, i) {
  28256. if (this._mixer, e.fadeOut(t), this.fadeIn(t), i) {
  28257. var n = this._clip.duration,
  28258. r = e._clip.duration,
  28259. o = r / n,
  28260. a = n / r;
  28261. e.warp(1, o, t), this.warp(a, 1, t)
  28262. }
  28263. return this
  28264. },
  28265. crossFadeTo: function (e, t, i) {
  28266. return e.crossFadeFrom(this, t, i)
  28267. },
  28268. stopFading: function () {
  28269. var e = this._weightInterpolant;
  28270. return null !== e && (this._weightInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this
  28271. },
  28272. setEffectiveTimeScale: function (e) {
  28273. return this.timeScale = e, this._effectiveTimeScale = this.paused ? 0 : e, this.stopWarping()
  28274. },
  28275. getEffectiveTimeScale: function () {
  28276. return this._effectiveTimeScale
  28277. },
  28278. setDuration: function (e) {
  28279. return this.timeScale = this._clip.duration / e, this.stopWarping()
  28280. },
  28281. syncWith: function (e) {
  28282. return this.time = e.time, this.timeScale = e.timeScale, this.stopWarping()
  28283. },
  28284. halt: function (e) {
  28285. return this.warp(this._currentTimeScale, 0, e)
  28286. },
  28287. warp: function (e, t, i) {
  28288. var n = this._mixer,
  28289. r = n.time,
  28290. o = this._timeScaleInterpolant,
  28291. a = this.timeScale;
  28292. null === o && (o = n._lendControlInterpolant(), this._timeScaleInterpolant = o);
  28293. var s = o.parameterPositions,
  28294. l = o.sampleValues;
  28295. return s[0] = r, s[1] = r + i, l[0] = e / a, l[1] = t / a, this
  28296. },
  28297. stopWarping: function () {
  28298. var e = this._timeScaleInterpolant;
  28299. return null !== e && (this._timeScaleInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this
  28300. },
  28301. getMixer: function () {
  28302. return this._mixer
  28303. },
  28304. getClip: function () {
  28305. return this._clip
  28306. },
  28307. getRoot: function () {
  28308. return this._localRoot || this._mixer._root
  28309. },
  28310. _update: function (e, t, i, n) {
  28311. var r = this._startTime;
  28312. if (null !== r) {
  28313. var o = (e - r) * i;
  28314. if (o < 0 || 0 === i) return;
  28315. this._startTime = null, t = i * o
  28316. }
  28317. t *= this._updateTimeScale(e);
  28318. var a = this._updateTime(t),
  28319. s = this._updateWeight(e);
  28320. if (0 < s)
  28321. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h) l[h].evaluate(a), c[h].accumulate(n, s)
  28322. },
  28323. _updateWeight: function (e) {
  28324. var t = 0;
  28325. if (this.enabled) {
  28326. t = this.weight;
  28327. var i = this._weightInterpolant;
  28328. if (null !== i) {
  28329. var n = i.evaluate(e)[0];
  28330. t *= n, e > i.parameterPositions[1] && (this.stopFading(), 0 === n && (this.enabled = !1))
  28331. }
  28332. }
  28333. return this._effectiveWeight = t
  28334. },
  28335. _updateTimeScale: function (e) {
  28336. var t = 0;
  28337. if (!this.paused) {
  28338. t = this.timeScale;
  28339. var i = this._timeScaleInterpolant;
  28340. if (null !== i) t *= i.evaluate(e)[0], e > i.parameterPositions[1] && (this.stopWarping(), 0 === t ? this.pause = !0 : this.timeScale = t)
  28341. }
  28342. return this._effectiveTimeScale = t
  28343. },
  28344. _updateTime: function (e) {
  28345. var t = this.time + e;
  28346. if (0 === e) return t;
  28347. var i = this._clip.duration,
  28348. n = this.loop,
  28349. r = this._loopCount,
  28350. o = !1;
  28351. switch (n) {
  28352. case Ci.LoopOnce:
  28353. if (-1 === r && (this.loopCount = 0, this._setEndings(!0, !0, !1)), i <= t) t = i;
  28354. else {
  28355. if (!(t < 0)) break;
  28356. t = 0
  28357. }
  28358. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1, this._mixer.dispatchEvent({
  28359. type: "finished",
  28360. action: this,
  28361. direction: e < 0 ? -1 : 1
  28362. });
  28363. break;
  28364. case Ci.LoopPingPong:
  28365. o = !0;
  28366. case Ci.LoopRepeat:
  28367. if (-1 === r && (0 < e ? (r = 0, this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)), i <= t || t < 0) {
  28368. var a = Math.floor(t / i);
  28369. t -= i * a, r += Math.abs(a);
  28370. var s = this.repetitions - r;
  28371. if (s < 0) {
  28372. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1, t = 0 < e ? i : 0, this._mixer.dispatchEvent({
  28373. type: "finished",
  28374. action: this,
  28375. direction: 0 < e ? 1 : -1
  28376. });
  28377. break
  28378. }
  28379. if (0 == s) {
  28380. var l = e < 0;
  28381. this._setEndings(l, !l, o)
  28382. } else this._setEndings(!1, !1, o);
  28383. this._loopCount = r, this._mixer.dispatchEvent({
  28384. type: "loop",
  28385. action: this,
  28386. loopDelta: a
  28387. })
  28388. }
  28389. if (n === Ci.LoopPingPong && 1 == (1 & r)) return i - (this.time = t)
  28390. }
  28391. return this.time = t
  28392. },
  28393. _setEndings: function (e, t, i) {
  28394. var n = this._interpolantSettings;
  28395. i ? (n.endingStart = Ci.ZeroSlopeEnding, n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding, n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  28396. },
  28397. _scheduleFading: function (e, t, i) {
  28398. var n = this._mixer,
  28399. r = n.time,
  28400. o = this._weightInterpolant;
  28401. null === o && (o = n._lendControlInterpolant(), this._weightInterpolant = o);
  28402. var a = o.parameterPositions,
  28403. s = o.sampleValues;
  28404. return a[0] = r, s[0] = t, a[1] = r + e, s[1] = i, this
  28405. }
  28406. }, Object.assign(Ci.AnimationMixer.prototype, {
  28407. _bindAction: function (e, t) {
  28408. var i = e._localRoot || this._root,
  28409. n = e._clip.tracks,
  28410. r = n.length,
  28411. o = e._propertyBindings,
  28412. a = e._interpolants,
  28413. s = i.uuid,
  28414. l = this._bindingsByRootAndName,
  28415. c = l[s];
  28416. void 0 === c && (c = {}, l[s] = c);
  28417. for (var h = 0; h !== r; ++h) {
  28418. var u = n[h],
  28419. d = u.name,
  28420. p = c[d];
  28421. if (void 0 !== p) o[h] = p;
  28422. else {
  28423. if (void 0 !== (p = o[h])) {
  28424. null === p._cacheIndex && (++p.referenceCount, this._addInactiveBinding(p, s, d));
  28425. continue
  28426. }
  28427. var f = t && t._propertyBindings[h].binding.parsedPath;
  28428. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f), u.ValueTypeName, u.getValueSize())).referenceCount, this._addInactiveBinding(p, s, d), o[h] = p
  28429. }
  28430. a[h].resultBuffer = p.buffer
  28431. }
  28432. },
  28433. _activateAction: function (e) {
  28434. if (!this._isActiveAction(e)) {
  28435. if (null === e._cacheIndex) {
  28436. var t = (e._localRoot || this._root).uuid,
  28437. i = e._clip.name,
  28438. n = this._actionsByClip[i];
  28439. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t)
  28440. }
  28441. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  28442. var s = r[o];
  28443. 0 == s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
  28444. }
  28445. this._lendAction(e)
  28446. }
  28447. },
  28448. _deactivateAction: function (e) {
  28449. if (this._isActiveAction(e)) {
  28450. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  28451. var r = t[i];
  28452. 0 == --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r))
  28453. }
  28454. this._takeBackAction(e)
  28455. }
  28456. },
  28457. _initMemoryManager: function () {
  28458. this._actions = [], this._nActiveActions = 0, this._actionsByClip = {}, this._bindings = [], this._nActiveBindings = 0, this._bindingsByRootAndName = {}, this._controlInterpolants = [], this._nActiveControlInterpolants = 0;
  28459. var e = this;
  28460. this.stats = {
  28461. actions: {
  28462. get total() {
  28463. return e._actions.length
  28464. },
  28465. get inUse() {
  28466. return e._nActiveActions
  28467. }
  28468. },
  28469. bindings: {
  28470. get total() {
  28471. return e._bindings.length
  28472. },
  28473. get inUse() {
  28474. return e._nActiveBindings
  28475. }
  28476. },
  28477. controlInterpolants: {
  28478. get total() {
  28479. return e._controlInterpolants.length
  28480. },
  28481. get inUse() {
  28482. return e._nActiveControlInterpolants
  28483. }
  28484. }
  28485. }
  28486. },
  28487. _isActiveAction: function (e) {
  28488. var t = e._cacheIndex;
  28489. return null !== t && t < this._nActiveActions
  28490. },
  28491. _addInactiveAction: function (e, t, i) {
  28492. var n = this._actions,
  28493. r = this._actionsByClip,
  28494. o = r[t];
  28495. if (void 0 === o) o = {
  28496. knownActions: [e],
  28497. actionByRoot: {}
  28498. }, e._byClipCacheIndex = 0, r[t] = o;
  28499. else {
  28500. var a = o.knownActions;
  28501. e._byClipCacheIndex = a.length, a.push(e)
  28502. }
  28503. e._cacheIndex = n.length, n.push(e), o.actionByRoot[i] = e
  28504. },
  28505. _removeInactiveAction: function (e) {
  28506. var t = this._actions,
  28507. i = t[t.length - 1],
  28508. n = e._cacheIndex;
  28509. t[i._cacheIndex = n] = i, t.pop(), e._cacheIndex = null;
  28510. var r = e._clip.name,
  28511. o = this._actionsByClip,
  28512. a = o[r],
  28513. s = a.knownActions,
  28514. l = s[s.length - 1],
  28515. c = e._byClipCacheIndex;
  28516. s[l._byClipCacheIndex = c] = l, s.pop(), e._byClipCacheIndex = null, delete a.actionByRoot[(t._localRoot || this._root).uuid], 0 === s.length && delete o[r], this._removeInactiveBindingsForAction(e)
  28517. },
  28518. _removeInactiveBindingsForAction: function (e) {
  28519. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  28520. var r = t[i];
  28521. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  28522. }
  28523. },
  28524. _lendAction: function (e) {
  28525. var t = this._actions,
  28526. i = e._cacheIndex,
  28527. n = this._nActiveActions++,
  28528. r = t[n];
  28529. t[e._cacheIndex = n] = e, t[r._cacheIndex = i] = r
  28530. },
  28531. _takeBackAction: function (e) {
  28532. var t = this._actions,
  28533. i = e._cacheIndex,
  28534. n = --this._nActiveActions,
  28535. r = t[n];
  28536. t[e._cacheIndex = n] = e, t[r._cacheIndex = i] = r
  28537. },
  28538. _addInactiveBinding: function (e, t, i) {
  28539. var n = this._bindingsByRootAndName,
  28540. r = n[t],
  28541. o = this._bindings;
  28542. void 0 === r && (r = {}, n[t] = r), (r[i] = e)._cacheIndex = o.length, o.push(e)
  28543. },
  28544. _removeInactiveBinding: function (e) {
  28545. var t = this._bindings,
  28546. i = e.binding,
  28547. n = i.rootNode.uuid,
  28548. r = i.path,
  28549. o = this._bindingsByRootAndName,
  28550. a = o[n],
  28551. s = t[t.length - 1],
  28552. l = e._cacheIndex;
  28553. t[s._cacheIndex = l] = s, t.pop(), delete a[r];
  28554. e: {
  28555. for (var c in a) break e;delete o[n]
  28556. }
  28557. },
  28558. _lendBinding: function (e) {
  28559. var t = this._bindings,
  28560. i = e._cacheIndex,
  28561. n = this._nActiveBindings++,
  28562. r = t[n];
  28563. t[e._cacheIndex = n] = e, t[r._cacheIndex = i] = r
  28564. },
  28565. _takeBackBinding: function (e) {
  28566. var t = this._bindings,
  28567. i = e._cacheIndex,
  28568. n = --this._nActiveBindings,
  28569. r = t[n];
  28570. t[e._cacheIndex = n] = e, t[r._cacheIndex = i] = r
  28571. },
  28572. _lendControlInterpolant: function () {
  28573. var e = this._controlInterpolants,
  28574. t = this._nActiveControlInterpolants++,
  28575. i = e[t];
  28576. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i), i
  28577. },
  28578. _takeBackControlInterpolant: function (e) {
  28579. var t = this._controlInterpolants,
  28580. i = e.__cacheIndex,
  28581. n = --this._nActiveControlInterpolants,
  28582. r = t[n];
  28583. t[e.__cacheIndex = n] = e, t[r.__cacheIndex = i] = r
  28584. },
  28585. _controlInterpolantsResultBuffer: new Float32Array(1)
  28586. }), Ci.AnimationObjectGroup = function (e) {
  28587. this.uuid = Ci.Math.generateUUID(), this._objects = Array.prototype.slice.call(arguments), this.nCachedObjects_ = 0;
  28588. var t = {};
  28589. this._indicesByUUID = t;
  28590. for (var i = 0, n = arguments.length; i !== n; ++i) t[arguments[i].uuid] = i;
  28591. this._paths = [], this._parsedPaths = [], this._bindings = [], this._bindingsIndicesByPath = {};
  28592. var r = this;
  28593. this.stats = {
  28594. objects: {
  28595. get total() {
  28596. return r._objects.length
  28597. },
  28598. get inUse() {
  28599. return this.total - r.nCachedObjects_
  28600. }
  28601. },
  28602. get bindingsPerObject() {
  28603. return r._bindings.length
  28604. }
  28605. }
  28606. }, Ci.AnimationObjectGroup.prototype = {
  28607. constructor: Ci.AnimationObjectGroup,
  28608. add: function (e) {
  28609. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  28610. var u = arguments[c],
  28611. d = u.uuid,
  28612. p = r[d];
  28613. if (void 0 === p) {
  28614. p = i++, r[d] = p, t.push(u);
  28615. for (var f = 0, g = l; f !== g; ++f) s[f].push(new Ci.PropertyBinding(u, o[f], a[f]))
  28616. } else if (p < n) {
  28617. var m = t[p],
  28618. v = --n,
  28619. y = t[v];
  28620. t[r[y.uuid] = p] = y, t[r[d] = v] = u;
  28621. for (f = 0, g = l; f !== g; ++f) {
  28622. var A = s[f],
  28623. C = A[v],
  28624. I = A[p];
  28625. A[p] = C, void 0 === I && (I = new Ci.PropertyBinding(u, o[f], a[f])), A[v] = I
  28626. }
  28627. } else t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  28628. }
  28629. this.nCachedObjects_ = n
  28630. },
  28631. remove: function (e) {
  28632. for (var t = this._objects, i = (t.length, this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  28633. var l = arguments[a],
  28634. c = l.uuid,
  28635. h = n[c];
  28636. if (void 0 !== h && i <= h) {
  28637. var u = i++,
  28638. d = t[u];
  28639. t[n[d.uuid] = h] = d, t[n[c] = u] = l;
  28640. for (var p = 0, f = o; p !== f; ++p) {
  28641. var g = r[p],
  28642. m = g[u],
  28643. v = g[h];
  28644. g[h] = m, g[u] = v
  28645. }
  28646. }
  28647. }
  28648. this.nCachedObjects_ = i
  28649. },
  28650. uncache: function (e) {
  28651. 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) {
  28652. var c = arguments[s].uuid,
  28653. h = r[c];
  28654. if (void 0 !== h)
  28655. if (delete r[c], h < n) {
  28656. var u = --n,
  28657. d = t[u],
  28658. p = t[y = --i];
  28659. t[r[d.uuid] = h] = d, t[r[p.uuid] = u] = p, t.pop();
  28660. for (var f = 0, g = a; f !== g; ++f) {
  28661. var m = (A = o[f])[u],
  28662. v = A[y];
  28663. A[h] = m, A[u] = v, A.pop()
  28664. }
  28665. } else {
  28666. var y;
  28667. t[r[(p = t[y = --i]).uuid] = h] = p, t.pop();
  28668. for (f = 0, g = a; f !== g; ++f) {
  28669. var A;
  28670. (A = o[f])[h] = A[y], A.pop()
  28671. }
  28672. }
  28673. }
  28674. this.nCachedObjects_ = n
  28675. },
  28676. subscribe_: function (e, t) {
  28677. var i = this._bindingsIndicesByPath,
  28678. n = i[e],
  28679. r = this._bindings;
  28680. if (void 0 !== n) return r[n];
  28681. var o = this._paths,
  28682. a = this._parsedPaths,
  28683. s = this._objects,
  28684. l = s.length,
  28685. c = this.nCachedObjects_,
  28686. h = new Array(l);
  28687. n = r.length, i[e] = n, o.push(e), a.push(t), r.push(h);
  28688. for (var u = c, d = s.length; u !== d; ++u) {
  28689. var p = s[u];
  28690. h[u] = new Ci.PropertyBinding(p, e, t)
  28691. }
  28692. return h
  28693. },
  28694. unsubscribe_: function (e) {
  28695. var t = this._bindingsIndicesByPath,
  28696. i = t[e];
  28697. if (void 0 !== i) {
  28698. var n = this._paths,
  28699. r = this._parsedPaths,
  28700. o = this._bindings,
  28701. a = o.length - 1,
  28702. s = o[a];
  28703. o[t[e[a]] = i] = s, o.pop(), r[i] = r[a], r.pop(), n[i] = n[a], n.pop()
  28704. }
  28705. }
  28706. }, Ci.AnimationUtils = {
  28707. arraySlice: function (e, t, i) {
  28708. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  28709. },
  28710. convertArray: function (e, t, i) {
  28711. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  28712. },
  28713. isTypedArray: function (e) {
  28714. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  28715. },
  28716. getKeyframeOrder: function (i) {
  28717. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n) t[n] = n;
  28718. return t.sort(function (e, t) {
  28719. return i[e] - i[t]
  28720. }), t
  28721. },
  28722. sortedArray: function (e, t, i) {
  28723. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  28724. for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l];
  28725. return r
  28726. },
  28727. flattenJSON: function (e, t, i, n) {
  28728. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n];) o = e[r++];
  28729. if (void 0 !== o) {
  28730. var a = o[n];
  28731. if (void 0 !== a)
  28732. if (Array.isArray(a))
  28733. for (; void 0 !== (a = o[n]) && (t.push(o.time), i.push.apply(i, a)), void 0 !== (o = e[r++]););
  28734. else if (void 0 !== a.toArray)
  28735. for (; void 0 !== (a = o[n]) && (t.push(o.time), a.toArray(i, i.length)), void 0 !== (o = e[r++]););
  28736. else
  28737. for (; void 0 !== (a = o[n]) && (t.push(o.time), i.push(a)), void 0 !== (o = e[r++]););
  28738. }
  28739. }
  28740. }, Ci.KeyframeTrack = function (e, t, i, n) {
  28741. if (void 0 === e) throw new Error("track name is undefined");
  28742. if (void 0 === t || 0 === t.length) throw new Error("no keyframes in track named " + e);
  28743. this.name = e, this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType), this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType), this.setInterpolation(n || this.DefaultInterpolation), this.validate(), this.optimize()
  28744. }, Ci.KeyframeTrack.prototype = {
  28745. constructor: Ci.KeyframeTrack,
  28746. TimeBufferType: Float32Array,
  28747. ValueBufferType: Float32Array,
  28748. DefaultInterpolation: Ci.InterpolateLinear,
  28749. InterpolantFactoryMethodDiscrete: function (e) {
  28750. return new Ci.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e)
  28751. },
  28752. InterpolantFactoryMethodLinear: function (e) {
  28753. return new Ci.LinearInterpolant(this.times, this.values, this.getValueSize(), e)
  28754. },
  28755. InterpolantFactoryMethodSmooth: function (e) {
  28756. return new Ci.CubicInterpolant(this.times, this.values, this.getValueSize(), e)
  28757. },
  28758. setInterpolation: function (e) {
  28759. var t = void 0;
  28760. switch (e) {
  28761. case Ci.InterpolateDiscrete:
  28762. t = this.InterpolantFactoryMethodDiscrete;
  28763. break;
  28764. case Ci.InterpolateLinear:
  28765. t = this.InterpolantFactoryMethodLinear;
  28766. break;
  28767. case Ci.InterpolateSmooth:
  28768. t = this.InterpolantFactoryMethodSmooth
  28769. }
  28770. if (void 0 !== t) this.createInterpolant = t;
  28771. else {
  28772. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  28773. if (void 0 === this.createInterpolant) {
  28774. if (e === this.DefaultInterpolation) throw new Error(i);
  28775. this.setInterpolation(this.DefaultInterpolation)
  28776. }
  28777. console.warn(i)
  28778. }
  28779. },
  28780. getInterpolation: function () {
  28781. switch (this.createInterpolant) {
  28782. case this.InterpolantFactoryMethodDiscrete:
  28783. return Ci.InterpolateDiscrete;
  28784. case this.InterpolantFactoryMethodLinear:
  28785. return Ci.InterpolateLinear;
  28786. case this.InterpolantFactoryMethodSmooth:
  28787. return Ci.InterpolateSmooth
  28788. }
  28789. },
  28790. getValueSize: function () {
  28791. return this.values.length / this.times.length
  28792. },
  28793. shift: function (e) {
  28794. if (0 !== e)
  28795. for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e;
  28796. return this
  28797. },
  28798. scale: function (e) {
  28799. if (1 !== e)
  28800. for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e;
  28801. return this
  28802. },
  28803. trim: function (e, t) {
  28804. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e;) ++r;
  28805. for (; - 1 !== o && i[o] > t;) --o;
  28806. if (++o, 0 !== r || o !== n) {
  28807. o <= r && (r = (o = Math.max(o, 1)) - 1);
  28808. var a = this.getValueSize();
  28809. this.times = Ci.AnimationUtils.arraySlice(i, r, o), this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  28810. }
  28811. return this
  28812. },
  28813. validate: function () {
  28814. var e = !0,
  28815. t = this.getValueSize();
  28816. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this), e = !1);
  28817. var i = this.times,
  28818. n = this.values,
  28819. r = i.length;
  28820. 0 === r && (console.error("track is empty", this), e = !1);
  28821. for (var o = null, a = 0; a !== r; a++) {
  28822. var s = i[a];
  28823. if ("number" == typeof s && isNaN(s)) {
  28824. console.error("time is not a valid number", this, a, s), e = !1;
  28825. break
  28826. }
  28827. if (null !== o && s < o) {
  28828. console.error("out of order keys", this, a, s, o), e = !1;
  28829. break
  28830. }
  28831. o = s
  28832. }
  28833. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  28834. a = 0;
  28835. for (var l = n.length; a !== l; ++a) {
  28836. var c = n[a];
  28837. if (isNaN(c)) {
  28838. console.error("value is not a valid number", this, a, c), e = !1;
  28839. break
  28840. }
  28841. }
  28842. }
  28843. return e
  28844. },
  28845. optimize: function () {
  28846. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  28847. var a = !1,
  28848. s = e[r];
  28849. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  28850. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  28851. var d = t[l + u];
  28852. if (d !== t[c + u] || d !== t[h + u]) {
  28853. a = !0;
  28854. break
  28855. }
  28856. }
  28857. if (a) {
  28858. if (r !== n) {
  28859. e[n] = e[r];
  28860. var p = r * i,
  28861. f = n * i;
  28862. for (u = 0; u !== i; ++u) t[f + u] = t[p + u]
  28863. }++n
  28864. }
  28865. }
  28866. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n), this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)), this
  28867. }
  28868. }, Object.assign(Ci.KeyframeTrack, {
  28869. parse: function (e) {
  28870. if (void 0 === e.type) throw new Error("track type undefined, can not parse");
  28871. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  28872. if (void 0 === e.times) {
  28873. console.warn("legacy JSON format detected, converting");
  28874. var i = [],
  28875. n = [];
  28876. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"), e.times = i, e.values = n
  28877. }
  28878. return void 0 !== t.parse ? t.parse(e) : new t(e.name, e.times, e.values, e.interpolation)
  28879. },
  28880. toJSON: function (e) {
  28881. var t, i = e.constructor;
  28882. if (void 0 !== i.toJSON) t = i.toJSON(e);
  28883. else {
  28884. t = {
  28885. name: e.name,
  28886. times: Ci.AnimationUtils.convertArray(e.times, Array),
  28887. values: Ci.AnimationUtils.convertArray(e.values, Array)
  28888. };
  28889. var n = e.getInterpolation();
  28890. n !== e.DefaultInterpolation && (t.interpolation = n)
  28891. }
  28892. return t.type = e.ValueTypeName, t
  28893. },
  28894. _getTrackTypeForValueTypeName: function (e) {
  28895. switch (e.toLowerCase()) {
  28896. case "scalar":
  28897. case "double":
  28898. case "float":
  28899. case "number":
  28900. case "integer":
  28901. return Ci.NumberKeyframeTrack;
  28902. case "vector":
  28903. case "vector2":
  28904. case "vector3":
  28905. case "vector4":
  28906. return Ci.VectorKeyframeTrack;
  28907. case "color":
  28908. return Ci.ColorKeyframeTrack;
  28909. case "quaternion":
  28910. return Ci.QuaternionKeyframeTrack;
  28911. case "bool":
  28912. case "boolean":
  28913. return Ci.BooleanKeyframeTrack;
  28914. case "string":
  28915. return Ci.StringKeyframeTrack
  28916. }
  28917. throw new Error("Unsupported typeName: " + e)
  28918. }
  28919. }), Ci.PropertyBinding = function (e, t, i) {
  28920. this.path = t, this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t), this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e, this.rootNode = e
  28921. }, Ci.PropertyBinding.prototype = {
  28922. constructor: Ci.PropertyBinding,
  28923. getValue: function (e, t) {
  28924. this.bind(), this.getValue(e, t)
  28925. },
  28926. setValue: function (e, t) {
  28927. this.bind(), this.setValue(e, t)
  28928. },
  28929. bind: function () {
  28930. var e = this.node,
  28931. t = this.parsedPath,
  28932. i = t.objectName,
  28933. n = t.propertyName,
  28934. r = t.propertyIndex;
  28935. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode, this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, e) {
  28936. if (i) {
  28937. var o = t.objectIndex;
  28938. switch (i) {
  28939. case "materials":
  28940. if (!e.material) return void console.error(" can not bind to material as node does not have a material", this);
  28941. if (!e.material.materials) return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  28942. e = e.material.materials;
  28943. break;
  28944. case "bones":
  28945. if (!e.skeleton) return void console.error(" can not bind to bones as node does not have a skeleton", this);
  28946. e = e.skeleton.bones;
  28947. for (var a = 0; a < e.length; a++)
  28948. if (e[a].name === o) {
  28949. o = a;
  28950. break
  28951. } break;
  28952. default:
  28953. if (void 0 === e[i]) return void console.error(" can not bind to objectName of node, undefined", this);
  28954. e = e[i]
  28955. }
  28956. if (void 0 !== o) {
  28957. if (void 0 === e[o]) return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  28958. e = e[o]
  28959. }
  28960. }
  28961. var s = e[n];
  28962. if (s) {
  28963. var l = this.Versioning.None;
  28964. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate, this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate, this.targetObject = e);
  28965. var c = this.BindingType.Direct;
  28966. if (void 0 !== r) {
  28967. if ("morphTargetInfluences" === n) {
  28968. if (!e.geometry) return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  28969. if (!e.geometry.morphTargets) return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  28970. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  28971. if (e.geometry.morphTargets[a].name === r) {
  28972. r = a;
  28973. break
  28974. }
  28975. }
  28976. c = this.BindingType.ArrayElement, this.resolvedProperty = s, this.propertyIndex = r
  28977. } else void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray, this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray, this.resolvedProperty = s) : this.propertyName = n;
  28978. this.getValue = this.GetterByBindingType[c], this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  28979. } else {
  28980. var h = t.nodeName;
  28981. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  28982. }
  28983. } else console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  28984. },
  28985. unbind: function () {
  28986. this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound
  28987. }
  28988. }, Object.assign(Ci.PropertyBinding.prototype, {
  28989. _getValue_unavailable: function () {},
  28990. _setValue_unavailable: function () {},
  28991. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  28992. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  28993. BindingType: {
  28994. Direct: 0,
  28995. EntireArray: 1,
  28996. ArrayElement: 2,
  28997. HasFromToArray: 3
  28998. },
  28999. Versioning: {
  29000. None: 0,
  29001. NeedsUpdate: 1,
  29002. MatrixWorldNeedsUpdate: 2
  29003. },
  29004. GetterByBindingType: [function (e, t) {
  29005. e[t] = this.node[this.propertyName]
  29006. }, function (e, t) {
  29007. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) e[t++] = i[n]
  29008. }, function (e, t) {
  29009. e[t] = this.resolvedProperty[this.propertyIndex]
  29010. }, function (e, t) {
  29011. this.resolvedProperty.toArray(e, t)
  29012. }],
  29013. SetterByBindingTypeAndVersioning: [
  29014. [function (e, t) {
  29015. this.node[this.propertyName] = e[t]
  29016. }, function (e, t) {
  29017. this.node[this.propertyName] = e[t], this.targetObject.needsUpdate = !0
  29018. }, function (e, t) {
  29019. this.node[this.propertyName] = e[t], this.targetObject.matrixWorldNeedsUpdate = !0
  29020. }],
  29021. [function (e, t) {
  29022. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  29023. }, function (e, t) {
  29024. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++];
  29025. this.targetObject.needsUpdate = !0
  29026. }, function (e, t) {
  29027. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++];
  29028. this.targetObject.matrixWorldNeedsUpdate = !0
  29029. }],
  29030. [function (e, t) {
  29031. this.resolvedProperty[this.propertyIndex] = e[t]
  29032. }, function (e, t) {
  29033. this.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.needsUpdate = !0
  29034. }, function (e, t) {
  29035. this.resolvedProperty[this.propertyIndex] = e[t], this.targetObject.matrixWorldNeedsUpdate = !0
  29036. }],
  29037. [function (e, t) {
  29038. this.resolvedProperty.fromArray(e, t)
  29039. }, function (e, t) {
  29040. this.resolvedProperty.fromArray(e, t), this.targetObject.needsUpdate = !0
  29041. }, function (e, t) {
  29042. this.resolvedProperty.fromArray(e, t), this.targetObject.matrixWorldNeedsUpdate = !0
  29043. }]
  29044. ]
  29045. }), Ci.PropertyBinding.Composite = function (e, t, i) {
  29046. var n = i || Ci.PropertyBinding.parseTrackName(t);
  29047. this._targetGroup = e, this._bindings = e.subscribe_(t, n)
  29048. }, Ci.PropertyBinding.Composite.prototype = {
  29049. constructor: Ci.PropertyBinding.Composite,
  29050. getValue: function (e, t) {
  29051. this.bind();
  29052. var i = this._targetGroup.nCachedObjects_,
  29053. n = this._bindings[i];
  29054. void 0 !== n && n.getValue(e, t)
  29055. },
  29056. setValue: function (e, t) {
  29057. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n) i[n].setValue(e, t)
  29058. },
  29059. bind: function () {
  29060. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].bind()
  29061. },
  29062. unbind: function () {
  29063. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].unbind()
  29064. }
  29065. }, Ci.PropertyBinding.create = function (e, t, i) {
  29066. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e, t, i) : new Ci.PropertyBinding(e, t, i)
  29067. }, Ci.PropertyBinding.parseTrackName = function (e) {
  29068. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  29069. i = t.exec(e);
  29070. if (!i) throw new Error("cannot parse trackName at all: " + e);
  29071. i.index === t.lastIndex && t.lastIndex++;
  29072. var n = {
  29073. nodeName: i[3],
  29074. objectName: i[5],
  29075. objectIndex: i[7],
  29076. propertyName: i[9],
  29077. propertyIndex: i[11]
  29078. };
  29079. if (null === n.propertyName || 0 === n.propertyName.length) throw new Error("can not parse propertyName from trackName: " + e);
  29080. return n
  29081. }, Ci.PropertyBinding.findNode = function (e, r) {
  29082. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid) return e;
  29083. if (e.skeleton) {
  29084. var t = function (e) {
  29085. for (var t = 0; t < e.bones.length; t++) {
  29086. var i = e.bones[t];
  29087. if (i.name === r) return i
  29088. }
  29089. return null
  29090. }(e.skeleton);
  29091. if (t) return t
  29092. }
  29093. if (e.children) {
  29094. var o = function (e) {
  29095. for (var t = 0; t < e.length; t++) {
  29096. var i = e[t];
  29097. if (i.name === r || i.uuid === r) return i;
  29098. var n = o(i.children);
  29099. if (n) return n
  29100. }
  29101. return null
  29102. },
  29103. i = o(e.children);
  29104. if (i) return i
  29105. }
  29106. return null
  29107. }, Ci.PropertyMixer = function (e, t, i) {
  29108. this.binding = e, this.valueSize = i;
  29109. var n, r = Float64Array;
  29110. switch (t) {
  29111. case "quaternion":
  29112. n = this._slerp;
  29113. break;
  29114. case "string":
  29115. case "bool":
  29116. r = Array, n = this._select;
  29117. break;
  29118. default:
  29119. n = this._lerp
  29120. }
  29121. this.buffer = new r(4 * i), this._mixBufferRegion = n, this.cumulativeWeight = 0, this.useCount = 0, this.referenceCount = 0
  29122. }, Ci.PropertyMixer.prototype = {
  29123. constructor: Ci.PropertyMixer,
  29124. accumulate: function (e, t) {
  29125. var i = this.buffer,
  29126. n = this.valueSize,
  29127. r = e * n + n,
  29128. o = this.cumulativeWeight;
  29129. if (0 === o) {
  29130. for (var a = 0; a !== n; ++a) i[r + a] = i[a];
  29131. o = t
  29132. } else {
  29133. var s = t / (o += t);
  29134. this._mixBufferRegion(i, r, 0, s, n)
  29135. }
  29136. this.cumulativeWeight = o
  29137. },
  29138. apply: function (e) {
  29139. var t = this.valueSize,
  29140. i = this.buffer,
  29141. n = e * t + t,
  29142. r = this.cumulativeWeight,
  29143. o = this.binding;
  29144. if (this.cumulativeWeight = 0, r < 1) {
  29145. var a = 3 * t;
  29146. this._mixBufferRegion(i, n, a, 1 - r, t)
  29147. }
  29148. for (var s = t, l = t + t; s !== l; ++s)
  29149. if (i[s] !== i[s + t]) {
  29150. o.setValue(i, n);
  29151. break
  29152. }
  29153. },
  29154. saveOriginalState: function () {
  29155. var e = this.binding,
  29156. t = this.buffer,
  29157. i = this.valueSize,
  29158. n = 3 * i;
  29159. e.getValue(t, n);
  29160. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + r % i];
  29161. this.cumulativeWeight = 0
  29162. },
  29163. restoreOriginalState: function () {
  29164. var e = 3 * this.valueSize;
  29165. this.binding.setValue(this.buffer, e)
  29166. },
  29167. _select: function (e, t, i, n, r) {
  29168. if (.5 <= n)
  29169. for (var o = 0; o !== r; ++o) e[t + o] = e[i + o]
  29170. },
  29171. _slerp: function (e, t, i, n, r) {
  29172. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  29173. },
  29174. _lerp: function (e, t, i, n, r) {
  29175. for (var o = 1 - n, a = 0; a !== r; ++a) {
  29176. var s = t + a;
  29177. e[s] = e[s] * o + e[i + a] * n
  29178. }
  29179. }
  29180. }, Ci.BooleanKeyframeTrack = function (e, t, i) {
  29181. Ci.KeyframeTrack.call(this, e, t, i)
  29182. }, Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  29183. constructor: Ci.BooleanKeyframeTrack,
  29184. ValueTypeName: "bool",
  29185. ValueBufferType: Array,
  29186. DefaultInterpolation: Ci.IntepolateDiscrete,
  29187. InterpolantFactoryMethodLinear: void 0,
  29188. InterpolantFactoryMethodSmooth: void 0
  29189. }), Ci.NumberKeyframeTrack = function (e, t, i, n) {
  29190. Ci.KeyframeTrack.call(this, e, t, i, n)
  29191. }, Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  29192. constructor: Ci.NumberKeyframeTrack,
  29193. ValueTypeName: "number"
  29194. }), Ci.QuaternionKeyframeTrack = function (e, t, i, n) {
  29195. Ci.KeyframeTrack.call(this, e, t, i, n)
  29196. }, Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  29197. constructor: Ci.QuaternionKeyframeTrack,
  29198. ValueTypeName: "quaternion",
  29199. DefaultInterpolation: Ci.InterpolateLinear,
  29200. InterpolantFactoryMethodLinear: function (e) {
  29201. return new Ci.QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), e)
  29202. },
  29203. InterpolantFactoryMethodSmooth: void 0
  29204. }), Ci.StringKeyframeTrack = function (e, t, i, n) {
  29205. Ci.KeyframeTrack.call(this, e, t, i, n)
  29206. }, Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  29207. constructor: Ci.StringKeyframeTrack,
  29208. ValueTypeName: "string",
  29209. ValueBufferType: Array,
  29210. DefaultInterpolation: Ci.IntepolateDiscrete,
  29211. InterpolantFactoryMethodLinear: void 0,
  29212. InterpolantFactoryMethodSmooth: void 0
  29213. }), Ci.VectorKeyframeTrack = function (e, t, i, n) {
  29214. Ci.KeyframeTrack.call(this, e, t, i, n)
  29215. }, Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  29216. constructor: Ci.VectorKeyframeTrack,
  29217. ValueTypeName: "vector"
  29218. }), Ci.Audio = function (e) {
  29219. Ci.Object3D.call(this), this.type = "Audio", this.context = e.context, this.source = this.context.createBufferSource(), this.source.onended = this.onEnded.bind(this), this.gain = this.context.createGain(), this.gain.connect(e.getInput()), this.autoplay = !1, this.startTime = 0, this.playbackRate = 1, this.isPlaying = !1, this.hasPlaybackControl = !0, this.sourceType = "empty", this.filter = null
  29220. }, Ci.Audio.prototype = Object.create(Ci.Object3D.prototype), Ci.Audio.prototype.constructor = Ci.Audio, Ci.Audio.prototype.getOutput = function () {
  29221. return this.gain
  29222. }, Ci.Audio.prototype.load = function (e) {
  29223. var t = new Ci.AudioBuffer(this.context);
  29224. return t.load(e), this.setBuffer(t), this
  29225. }, Ci.Audio.prototype.setNodeSource = function (e) {
  29226. return this.hasPlaybackControl = !1, this.sourceType = "audioNode", this.source = e, this.connect(), this
  29227. }, Ci.Audio.prototype.setBuffer = function (e) {
  29228. var t = this;
  29229. return e.onReady(function (e) {
  29230. t.source.buffer = e, t.sourceType = "buffer", t.autoplay && t.play()
  29231. }), this
  29232. }, Ci.Audio.prototype.play = function () {
  29233. if (!0 !== this.isPlaying)
  29234. if (!1 !== this.hasPlaybackControl) {
  29235. var e = this.context.createBufferSource();
  29236. e.buffer = this.source.buffer, e.loop = this.source.loop, e.onended = this.source.onended, e.start(0, this.startTime), e.playbackRate.value = this.playbackRate, this.isPlaying = !0, this.source = e, this.connect()
  29237. } else console.warn("THREE.Audio: this Audio has no playback control.");
  29238. else console.warn("THREE.Audio: Audio is already playing.")
  29239. }, Ci.Audio.prototype.pause = function () {
  29240. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(), void(this.startTime = this.context.currentTime))
  29241. }, Ci.Audio.prototype.stop = function () {
  29242. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(), void(this.startTime = 0))
  29243. }, Ci.Audio.prototype.connect = function () {
  29244. null !== this.filter ? (this.source.connect(this.filter), this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  29245. }, Ci.Audio.prototype.disconnect = function () {
  29246. null !== this.filter ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  29247. }, Ci.Audio.prototype.getFilter = function () {
  29248. return this.filter
  29249. }, Ci.Audio.prototype.setFilter = function (e) {
  29250. void 0 === e && (e = null), !0 === this.isPlaying ? (this.disconnect(), this.filter = e, this.connect()) : this.filter = e
  29251. }, Ci.Audio.prototype.setPlaybackRate = function (e) {
  29252. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e, void(!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  29253. }, Ci.Audio.prototype.getPlaybackRate = function () {
  29254. return this.playbackRate
  29255. }, Ci.Audio.prototype.onEnded = function () {
  29256. this.isPlaying = !1
  29257. }, Ci.Audio.prototype.setLoop = function (e) {
  29258. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void(this.source.loop = e)
  29259. }, Ci.Audio.prototype.getLoop = function () {
  29260. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."), !1) : this.source.loop
  29261. }, Ci.Audio.prototype.setVolume = function (e) {
  29262. this.gain.gain.value = e
  29263. }, Ci.Audio.prototype.getVolume = function () {
  29264. return this.gain.gain.value
  29265. }, Ci.AudioAnalyser = function (e, t) {
  29266. this.analyser = e.context.createAnalyser(), this.analyser.fftSize = void 0 !== t ? t : 2048, this.data = new Uint8Array(this.analyser.frequencyBinCount), e.getOutput().connect(this.analyser)
  29267. }, Ci.AudioAnalyser.prototype = {
  29268. constructor: Ci.AudioAnalyser,
  29269. getData: function () {
  29270. return this.analyser.getByteFrequencyData(this.data), this.data
  29271. }
  29272. }, Ci.AudioBuffer = function (e) {
  29273. this.context = e, this.ready = !1, this.readyCallbacks = []
  29274. }, Ci.AudioBuffer.prototype.load = function (e) {
  29275. var i = this,
  29276. t = new XMLHttpRequest;
  29277. return t.open("GET", e, !0), t.responseType = "arraybuffer", t.onload = function (e) {
  29278. i.context.decodeAudioData(this.response, function (e) {
  29279. i.buffer = e, i.ready = !0;
  29280. for (var t = 0; t < i.readyCallbacks.length; t++) i.readyCallbacks[t](i.buffer);
  29281. i.readyCallbacks = []
  29282. })
  29283. }, t.send(), this
  29284. }, Ci.AudioBuffer.prototype.onReady = function (e) {
  29285. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  29286. }, Ci.PositionalAudio = function (e) {
  29287. Ci.Audio.call(this, e), this.panner = this.context.createPanner(), this.panner.connect(this.gain)
  29288. }, Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype), Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio, Ci.PositionalAudio.prototype.getOutput = function () {
  29289. return this.panner
  29290. }, Ci.PositionalAudio.prototype.setRefDistance = function (e) {
  29291. this.panner.refDistance = e
  29292. }, Ci.PositionalAudio.prototype.getRefDistance = function () {
  29293. return this.panner.refDistance
  29294. }, Ci.PositionalAudio.prototype.setRolloffFactor = function (e) {
  29295. this.panner.rolloffFactor = e
  29296. }, Ci.PositionalAudio.prototype.getRolloffFactor = function () {
  29297. return this.panner.rolloffFactor
  29298. }, Ci.PositionalAudio.prototype.setDistanceModel = function (e) {
  29299. this.panner.distanceModel = e
  29300. }, Ci.PositionalAudio.prototype.getDistanceModel = function () {
  29301. return this.panner.distanceModel
  29302. }, Ci.PositionalAudio.prototype.setMaxDistance = function (e) {
  29303. this.panner.maxDistance = e
  29304. }, Ci.PositionalAudio.prototype.getMaxDistance = function () {
  29305. return this.panner.maxDistance
  29306. }, Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3, function (e) {
  29307. Ci.Object3D.prototype.updateMatrixWorld.call(this, e), it.setFromMatrixPosition(this.matrixWorld), this.panner.setPosition(it.x, it.y, it.z)
  29308. }), Ci.AudioListener = function () {
  29309. Ci.Object3D.call(this), this.type = "AudioListener", this.context = new(window.AudioContext || window.webkitAudioContext), this.gain = this.context.createGain(), this.gain.connect(this.context.destination), this.filter = null
  29310. }, Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype), Ci.AudioListener.prototype.constructor = Ci.AudioListener, Ci.AudioListener.prototype.getInput = function () {
  29311. return this.gain
  29312. }, Ci.AudioListener.prototype.removeFilter = function () {
  29313. null !== this.filter && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), this.filter = null)
  29314. }, Ci.AudioListener.prototype.setFilter = function (e) {
  29315. null !== this.filter ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination), this.filter = e, this.gain.connect(this.filter), this.filter.connect(this.context.destination)
  29316. }, Ci.AudioListener.prototype.getFilter = function () {
  29317. return this.filter
  29318. }, Ci.AudioListener.prototype.setMasterVolume = function (e) {
  29319. this.gain.gain.value = e
  29320. }, Ci.AudioListener.prototype.getMasterVolume = function () {
  29321. return this.gain.gain.value
  29322. }, Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3, $e = new Ci.Quaternion, et = new Ci.Vector3, tt = new Ci.Vector3, function (e) {
  29323. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  29324. var t = this.context.listener,
  29325. i = this.up;
  29326. this.matrixWorld.decompose(Je, $e, et), tt.set(0, 0, -1).applyQuaternion($e), t.setPosition(Je.x, Je.y, Je.z), t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  29327. }), Ci.Camera = function () {
  29328. Ci.Object3D.call(this), this.type = "Camera", this.matrixWorldInverse = new Ci.Matrix4, this.projectionMatrix = new Ci.Matrix4
  29329. }, Ci.Camera.prototype = Object.create(Ci.Object3D.prototype), Ci.Camera.prototype.constructor = Ci.Camera, Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion, function (e) {
  29330. var t = e || new Ci.Vector3;
  29331. return this.getWorldQuaternion(Qe), t.set(0, 0, -1).applyQuaternion(Qe)
  29332. }), Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4, function (e) {
  29333. Ke.lookAt(this.position, e, this.up), this.quaternion.setFromRotationMatrix(Ke)
  29334. }), Ci.Camera.prototype.clone = function () {
  29335. return (new this.constructor).copy(this)
  29336. }, Ci.Camera.prototype.copy = function (e) {
  29337. return Ci.Object3D.prototype.copy.call(this, e), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this
  29338. }, Ci.CubeCamera = function (e, t, i) {
  29339. Ci.Object3D.call(this), this.type = "CubeCamera";
  29340. var r = new Ci.PerspectiveCamera(90, 1, e, t);
  29341. r.up.set(0, -1, 0), r.lookAt(new Ci.Vector3(1, 0, 0)), this.add(r);
  29342. var o = new Ci.PerspectiveCamera(90, 1, e, t);
  29343. o.up.set(0, -1, 0), o.lookAt(new Ci.Vector3(-1, 0, 0)), this.add(o);
  29344. var a = new Ci.PerspectiveCamera(90, 1, e, t);
  29345. a.up.set(0, 0, 1), a.lookAt(new Ci.Vector3(0, 1, 0)), this.add(a);
  29346. var s = new Ci.PerspectiveCamera(90, 1, e, t);
  29347. s.up.set(0, 0, -1), s.lookAt(new Ci.Vector3(0, -1, 0)), this.add(s);
  29348. var l = new Ci.PerspectiveCamera(90, 1, e, t);
  29349. l.up.set(0, -1, 0), l.lookAt(new Ci.Vector3(0, 0, 1)), this.add(l);
  29350. var c = new Ci.PerspectiveCamera(90, 1, e, t);
  29351. c.up.set(0, -1, 0), c.lookAt(new Ci.Vector3(0, 0, -1)), this.add(c);
  29352. var n = {
  29353. format: Ci.RGBFormat,
  29354. magFilter: Ci.LinearFilter,
  29355. minFilter: Ci.LinearFilter
  29356. };
  29357. this.renderTarget = new Ci.WebGLRenderTargetCube(i, i, n), this.updateCubeMap = function (e, t) {
  29358. null === this.parent && this.updateMatrixWorld();
  29359. var i = this.renderTarget,
  29360. n = i.texture.generateMipmaps;
  29361. i.texture.generateMipmaps = !1, i.activeCubeFace = 0, e.render(t, r, i), i.activeCubeFace = 1, e.render(t, o, i), i.activeCubeFace = 2, e.render(t, a, i), i.activeCubeFace = 3, e.render(t, s, i), i.activeCubeFace = 4, e.render(t, l, i), i.texture.generateMipmaps = n, i.activeCubeFace = 5, e.render(t, c, i), e.setRenderTarget(null)
  29362. }
  29363. }, Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype), Ci.CubeCamera.prototype.constructor = Ci.CubeCamera, Ci.OrthographicCamera = function (e, t, i, n, r, o) {
  29364. Ci.Camera.call(this), this.type = "OrthographicCamera", this.zoom = 1, this.left = e, this.right = t, this.top = i, this.bottom = n, this.near = void 0 !== r ? r : .1, this.far = void 0 !== o ? o : 2e3, this.updateProjectionMatrix()
  29365. }, Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype), Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera, Ci.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  29366. var e = (this.right - this.left) / (2 * this.zoom),
  29367. t = (this.top - this.bottom) / (2 * this.zoom),
  29368. i = (this.right + this.left) / 2,
  29369. n = (this.top + this.bottom) / 2;
  29370. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  29371. }, Ci.OrthographicCamera.prototype.copy = function (e) {
  29372. return Ci.Camera.prototype.copy.call(this, e), this.left = e.left, this.right = e.right, this.top = e.top, this.bottom = e.bottom, this.near = e.near, this.far = e.far, this.zoom = e.zoom, this
  29373. }, Ci.OrthographicCamera.prototype.toJSON = function (e) {
  29374. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  29375. return t.object.zoom = this.zoom, t.object.left = this.left, t.object.right = this.right, t.object.top = this.top, t.object.bottom = this.bottom, t.object.near = this.near, t.object.far = this.far, t
  29376. }, Ci.PerspectiveCamera = function (e, t, i, n) {
  29377. Ci.Camera.call(this), this.type = "PerspectiveCamera", this.focalLength = 10, this.zoom = 1, this.fov = void 0 !== e ? e : 50, this.aspect = void 0 !== t ? t : 1, this.near = void 0 !== i ? i : .1, this.far = void 0 !== n ? n : 2e3, this.updateProjectionMatrix()
  29378. }, Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype), Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera, Ci.PerspectiveCamera.prototype.setLens = function (e, t) {
  29379. void 0 === t && (t = 24), this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))), this.updateProjectionMatrix()
  29380. }, Ci.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  29381. this.fullWidth = e, this.fullHeight = t, this.x = i, this.y = n, this.width = r, this.height = o, this.updateProjectionMatrix()
  29382. }, Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  29383. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  29384. if (this.fullWidth) {
  29385. var t = this.fullWidth / this.fullHeight,
  29386. i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near,
  29387. n = -i,
  29388. r = t * n,
  29389. o = t * i,
  29390. a = Math.abs(o - r),
  29391. s = Math.abs(i - n);
  29392. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  29393. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  29394. }, Ci.PerspectiveCamera.prototype.copy = function (e) {
  29395. return Ci.Camera.prototype.copy.call(this, e), this.focalLength = e.focalLength, this.zoom = e.zoom, this.fov = e.fov, this.aspect = e.aspect, this.near = e.near, this.far = e.far, this
  29396. }, Ci.PerspectiveCamera.prototype.toJSON = function (e) {
  29397. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  29398. return t.object.focalLength = this.focalLength, t.object.zoom = this.zoom, t.object.fov = this.fov, t.object.aspect = this.aspect, t.object.near = this.near, t.object.far = this.far, t
  29399. }, Ci.StereoCamera = function () {
  29400. this.type = "StereoCamera", this.aspect = 1, this.cameraL = new Ci.PerspectiveCamera, this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new Ci.PerspectiveCamera, this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1
  29401. }, Ci.StereoCamera.prototype = {
  29402. constructor: Ci.StereoCamera,
  29403. update: (Xe = new Ci.Matrix4, Ze = new Ci.Matrix4, function (e) {
  29404. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  29405. Ge = e.focalLength, We = e.fov, je = e.aspect * this.aspect, Ye = e.near, qe = e.far;
  29406. var t, i, n = e.projectionMatrix.clone(),
  29407. r = .032 * Ye / Ge,
  29408. o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  29409. Ze.elements[12] = -.032, Xe.elements[12] = .032, t = -o * je + r, i = o * je + r, n.elements[0] = 2 * Ye / (i - t), n.elements[8] = (i + t) / (i - t), this.cameraL.projectionMatrix.copy(n), t = -o * je - r, i = o * je - r, n.elements[0] = 2 * Ye / (i - t), n.elements[8] = (i + t) / (i - t), this.cameraR.projectionMatrix.copy(n)
  29410. }
  29411. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  29412. })
  29413. }, Ci.Light = function (e, t) {
  29414. Ci.Object3D.call(this), this.type = "Light", this.color = new Ci.Color(e), this.intensity = void 0 !== t ? t : 1, this.receiveShadow = void 0
  29415. }, Ci.Light.prototype = Object.create(Ci.Object3D.prototype), Ci.Light.prototype.constructor = Ci.Light, Ci.Light.prototype.copy = function (e) {
  29416. return Ci.Object3D.prototype.copy.call(this, e), this.color.copy(e.color), this.intensity = e.intensity, this
  29417. }, Ci.Light.prototype.toJSON = function (e) {
  29418. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  29419. return t.object.color = this.color.getHex(), t.object.intensity = this.intensity, void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()), void 0 !== this.distance && (t.object.distance = this.distance), void 0 !== this.angle && (t.object.angle = this.angle), void 0 !== this.decay && (t.object.decay = this.decay), void 0 !== this.penumbra && (t.object.penumbra = this.penumbra), t
  29420. }, Ci.LightShadow = function (e) {
  29421. this.camera = e, this.bias = 0, this.radius = 1, this.mapSize = new Ci.Vector2(512, 512), this.map = null, this.matrix = new Ci.Matrix4
  29422. }, Ci.LightShadow.prototype = {
  29423. constructor: Ci.LightShadow,
  29424. copy: function (e) {
  29425. return this.camera = e.camera.clone(), this.bias = e.bias, this.radius = e.radius, this.mapSize.copy(e.mapSize), this
  29426. },
  29427. clone: function () {
  29428. return (new this.constructor).copy(this)
  29429. }
  29430. }, Ci.AmbientLight = function (e, t) {
  29431. Ci.Light.call(this, e, t), this.type = "AmbientLight", this.castShadow = void 0
  29432. }, Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype), Ci.AmbientLight.prototype.constructor = Ci.AmbientLight, Ci.DirectionalLight = function (e, t) {
  29433. Ci.Light.call(this, e, t), this.type = "DirectionalLight", this.position.set(0, 1, 0), this.updateMatrix(), this.target = new Ci.Object3D, this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5, 5, 5, -5, .5, 500))
  29434. }, Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype), Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight, Ci.DirectionalLight.prototype.copy = function (e) {
  29435. return Ci.Light.prototype.copy.call(this, e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this
  29436. }, Ci.HemisphereLight = function (e, t, i) {
  29437. Ci.Light.call(this, e, i), this.type = "HemisphereLight", this.castShadow = void 0, this.position.set(0, 1, 0), this.updateMatrix(), this.groundColor = new Ci.Color(t)
  29438. }, Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype), Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight, Ci.HemisphereLight.prototype.copy = function (e) {
  29439. return Ci.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this
  29440. }, Ci.PointLight = function (e, t, i, n) {
  29441. Ci.Light.call(this, e, t), this.type = "PointLight", this.distance = void 0 !== i ? i : 0, this.decay = void 0 !== n ? n : 1, this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90, 1, .5, 500))
  29442. }, Ci.PointLight.prototype = Object.create(Ci.Light.prototype), Ci.PointLight.prototype.constructor = Ci.PointLight, Object.defineProperty(Ci.PointLight.prototype, "power", {
  29443. get: function () {
  29444. return 4 * this.intensity * Math.PI
  29445. },
  29446. set: function (e) {
  29447. this.intensity = e / (4 * Math.PI)
  29448. }
  29449. }), Ci.PointLight.prototype.copy = function (e) {
  29450. return Ci.Light.prototype.copy.call(this, e), this.distance = e.distance, this.decay = e.decay, this.shadow = e.shadow.clone(), this
  29451. }, Ci.SpotLight = function (e, t, i, n, r, o) {
  29452. Ci.Light.call(this, e, t), this.type = "SpotLight", this.position.set(0, 1, 0), this.updateMatrix(), this.target = new Ci.Object3D, this.distance = void 0 !== i ? i : 0, this.angle = void 0 !== n ? n : Math.PI / 3, this.penumbra = void 0 !== r ? r : 0, this.decay = void 0 !== o ? o : 1, this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50, 1, .5, 500))
  29453. }, Ci.SpotLight.prototype = Object.create(Ci.Light.prototype), Ci.SpotLight.prototype.constructor = Ci.SpotLight, Object.defineProperty(Ci.SpotLight.prototype, "power", {
  29454. get: function () {
  29455. return this.intensity * Math.PI
  29456. },
  29457. set: function (e) {
  29458. this.intensity = e / Math.PI
  29459. }
  29460. }), Ci.SpotLight.prototype.copy = function (e) {
  29461. return Ci.Light.prototype.copy.call(this, e), this.distance = e.distance, this.angle = e.angle, this.penumbra = e.penumbra, this.decay = e.decay, this.target = e.target.clone(), this.shadow = e.shadow.clone(), this
  29462. }, Ci.Cache = {
  29463. enabled: !1,
  29464. files: {},
  29465. add: function (e, t) {
  29466. !1 !== this.enabled && (this.files[e] = t)
  29467. },
  29468. get: function (e) {
  29469. if (!1 !== this.enabled) return this.files[e]
  29470. },
  29471. remove: function (e) {
  29472. delete this.files[e]
  29473. },
  29474. clear: function () {
  29475. this.files = {}
  29476. }
  29477. }, Ci.Loader = function () {
  29478. this.onLoadStart = function () {}, this.onLoadProgress = function () {}, this.onLoadComplete = function () {}
  29479. }, Ci.Loader.prototype = {
  29480. constructor: Ci.Loader,
  29481. crossOrigin: void 0,
  29482. extractUrlBase: function (e) {
  29483. var t = e.split("/");
  29484. return 1 === t.length ? "./" : (t.pop(), t.join("/") + "/")
  29485. },
  29486. initMaterials: function (e, t, i) {
  29487. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i);
  29488. return n
  29489. },
  29490. createMaterial: function (e, c, h) {
  29491. function t(e, t, i, n, r) {
  29492. var o, a = c + e,
  29493. s = Ci.Loader.Handlers.get(a);
  29494. o = null !== s ? s.load(a) : (He.setCrossOrigin(h), He.load(a)), void 0 !== t && (o.repeat.fromArray(t), 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping), 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)), void 0 !== i && o.offset.fromArray(i), void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping), "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping), "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping), "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)), void 0 !== r && (o.anisotropy = r);
  29495. var l = Ci.Math.generateUUID();
  29496. return u[l] = o, l
  29497. }
  29498. void 0 === Ue && (Ue = new Ci.Color), void 0 === He && (He = new Ci.TextureLoader), void 0 === ze && (ze = new Ci.MaterialLoader);
  29499. var u = {},
  29500. i = {
  29501. uuid: Ci.Math.generateUUID(),
  29502. type: "MeshLambertMaterial"
  29503. };
  29504. for (var n in e) {
  29505. var r = e[n];
  29506. switch (n) {
  29507. case "DbgColor":
  29508. case "DbgIndex":
  29509. case "opticalDensity":
  29510. case "illumination":
  29511. break;
  29512. case "DbgName":
  29513. i.name = r;
  29514. break;
  29515. case "blending":
  29516. i.blending = Ci[r];
  29517. break;
  29518. case "colorAmbient":
  29519. case "mapAmbient":
  29520. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  29521. break;
  29522. case "colorDiffuse":
  29523. i.color = Ue.fromArray(r).getHex();
  29524. break;
  29525. case "colorSpecular":
  29526. i.specular = Ue.fromArray(r).getHex();
  29527. break;
  29528. case "colorEmissive":
  29529. i.emissive = Ue.fromArray(r).getHex();
  29530. break;
  29531. case "specularCoef":
  29532. i.shininess = r;
  29533. break;
  29534. case "shading":
  29535. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"), "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  29536. break;
  29537. case "mapDiffuse":
  29538. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  29539. break;
  29540. case "mapDiffuseRepeat":
  29541. case "mapDiffuseOffset":
  29542. case "mapDiffuseWrap":
  29543. case "mapDiffuseAnisotropy":
  29544. break;
  29545. case "mapLight":
  29546. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  29547. break;
  29548. case "mapLightRepeat":
  29549. case "mapLightOffset":
  29550. case "mapLightWrap":
  29551. case "mapLightAnisotropy":
  29552. break;
  29553. case "mapAO":
  29554. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  29555. break;
  29556. case "mapAORepeat":
  29557. case "mapAOOffset":
  29558. case "mapAOWrap":
  29559. case "mapAOAnisotropy":
  29560. break;
  29561. case "mapBump":
  29562. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  29563. break;
  29564. case "mapBumpScale":
  29565. i.bumpScale = r;
  29566. break;
  29567. case "mapBumpRepeat":
  29568. case "mapBumpOffset":
  29569. case "mapBumpWrap":
  29570. case "mapBumpAnisotropy":
  29571. break;
  29572. case "mapNormal":
  29573. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  29574. break;
  29575. case "mapNormalFactor":
  29576. i.normalScale = [r, r];
  29577. break;
  29578. case "mapNormalRepeat":
  29579. case "mapNormalOffset":
  29580. case "mapNormalWrap":
  29581. case "mapNormalAnisotropy":
  29582. break;
  29583. case "mapSpecular":
  29584. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  29585. break;
  29586. case "mapSpecularRepeat":
  29587. case "mapSpecularOffset":
  29588. case "mapSpecularWrap":
  29589. case "mapSpecularAnisotropy":
  29590. break;
  29591. case "mapAlpha":
  29592. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  29593. break;
  29594. case "mapAlphaRepeat":
  29595. case "mapAlphaOffset":
  29596. case "mapAlphaWrap":
  29597. case "mapAlphaAnisotropy":
  29598. break;
  29599. case "flipSided":
  29600. i.side = Ci.BackSide;
  29601. break;
  29602. case "doubleSided":
  29603. i.side = Ci.DoubleSide;
  29604. break;
  29605. case "transparency":
  29606. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"), i.opacity = r;
  29607. break;
  29608. case "depthTest":
  29609. case "depthWrite":
  29610. case "colorWrite":
  29611. case "opacity":
  29612. case "reflectivity":
  29613. case "transparent":
  29614. case "visible":
  29615. case "wireframe":
  29616. i[n] = r;
  29617. break;
  29618. case "vertexColors":
  29619. !0 === r && (i.vertexColors = Ci.VertexColors), "face" === r && (i.vertexColors = Ci.FaceColors);
  29620. break;
  29621. default:
  29622. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  29623. }
  29624. }
  29625. return "MeshBasicMaterial" === i.type && delete i.emissive, "MeshPhongMaterial" !== i.type && delete i.specular, i.opacity < 1 && (i.transparent = !0), ze.setTextures(u), ze.parse(i)
  29626. }
  29627. }, Ci.Loader.Handlers = {
  29628. handlers: [],
  29629. add: function (e, t) {
  29630. this.handlers.push(e, t)
  29631. },
  29632. get: function (e) {
  29633. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  29634. var r = t[i],
  29635. o = t[i + 1];
  29636. if (r.test(e)) return o
  29637. }
  29638. return null
  29639. }
  29640. }, Ci.XHRLoader = function (e) {
  29641. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  29642. }, Ci.XHRLoader.prototype = {
  29643. constructor: Ci.XHRLoader,
  29644. load: function (i, n, t, r) {
  29645. void 0 !== this.path && (i = this.path + i);
  29646. var o = this,
  29647. e = Ci.Cache.get(i);
  29648. if (void 0 !== e) return n && setTimeout(function () {
  29649. n(e)
  29650. }, 0), e;
  29651. var a = new XMLHttpRequest;
  29652. return a.overrideMimeType("text/plain"), a.open("GET", i, !0), a.addEventListener("load", function (e) {
  29653. var t = e.target.response;
  29654. Ci.Cache.add(i, t), 200 === this.status ? (n && n(t), o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."), n && n(t), o.manager.itemEnd(i)) : (r && r(e), o.manager.itemError(i))
  29655. }, !1), void 0 !== t && a.addEventListener("progress", function (e) {
  29656. t(e)
  29657. }, !1), a.addEventListener("error", function (e) {
  29658. r && r(e), o.manager.itemError(i)
  29659. }, !1), void 0 !== this.responseType && (a.responseType = this.responseType), void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials), a.send(null), o.manager.itemStart(i), a
  29660. },
  29661. setPath: function (e) {
  29662. this.path = e
  29663. },
  29664. setResponseType: function (e) {
  29665. this.responseType = e
  29666. },
  29667. setWithCredentials: function (e) {
  29668. this.withCredentials = e
  29669. }
  29670. }, Ci.FontLoader = function (e) {
  29671. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  29672. }, Ci.FontLoader.prototype = {
  29673. constructor: Ci.FontLoader,
  29674. load: function (e, t, i, n) {
  29675. new Ci.XHRLoader(this.manager).load(e, function (e) {
  29676. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  29677. }, i, n)
  29678. }
  29679. }, Ci.ImageLoader = function (e) {
  29680. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  29681. }, Ci.ImageLoader.prototype = {
  29682. constructor: Ci.ImageLoader,
  29683. load: function (t, i, n, r) {
  29684. void 0 !== this.path && (t = this.path + t);
  29685. var o = this,
  29686. e = Ci.Cache.get(t);
  29687. if (void 0 !== e) return o.manager.itemStart(t), i ? setTimeout(function () {
  29688. i(e), o.manager.itemEnd(t)
  29689. }, 0) : o.manager.itemEnd(t), e;
  29690. var a = document.createElement("img");
  29691. return a.addEventListener("load", function (e) {
  29692. Ci.Cache.add(t, this), i && i(this), o.manager.itemEnd(t)
  29693. }, !1), void 0 !== n && a.addEventListener("progress", function (e) {
  29694. n(e)
  29695. }, !1), a.addEventListener("error", function (e) {
  29696. r && r(e), o.manager.itemError(t)
  29697. }, !1), void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin), o.manager.itemStart(t), a.src = t, a
  29698. },
  29699. setCrossOrigin: function (e) {
  29700. this.crossOrigin = e
  29701. },
  29702. setPath: function (e) {
  29703. this.path = e
  29704. }
  29705. }, Ci.JSONLoader = function (e) {
  29706. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."), e = void 0), this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager, this.withCredentials = !1
  29707. }, Ci.JSONLoader.prototype = {
  29708. constructor: Ci.JSONLoader,
  29709. get statusDomElement() {
  29710. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")), console.warn("THREE.JSONLoader: .statusDomElement has been removed."), this._statusDomElement
  29711. },
  29712. load: function (o, a, e, t) {
  29713. var s = this,
  29714. l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o),
  29715. i = new Ci.XHRLoader(this.manager);
  29716. i.setWithCredentials(this.withCredentials), i.load(o, function (e) {
  29717. var t = JSON.parse(e),
  29718. i = t.metadata;
  29719. if (void 0 !== i) {
  29720. var n = i.type;
  29721. if (void 0 !== n) {
  29722. if ("object" === n.toLowerCase()) return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  29723. if ("scene" === n.toLowerCase()) return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  29724. }
  29725. }
  29726. var r = s.parse(t, l);
  29727. a(r.geometry, r.materials)
  29728. }, e, t)
  29729. },
  29730. setTexturePath: function (e) {
  29731. this.texturePath = e
  29732. },
  29733. parse: function (D, e) {
  29734. var N = new Ci.Geometry,
  29735. t = void 0 !== D.scale ? 1 / D.scale : 1;
  29736. if (function (e) {
  29737. function t(e, t) {
  29738. return e & 1 << t
  29739. }
  29740. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces,
  29741. R = D.vertices,
  29742. P = D.normals,
  29743. O = D.colors,
  29744. L = 0;
  29745. if (void 0 !== D.uvs) {
  29746. for (i = 0; i < D.uvs.length; i++) D.uvs[i].length && L++;
  29747. for (i = 0; i < L; i++) N.faceVertexUvs[i] = []
  29748. }
  29749. for (o = 0, a = R.length; o < a;)(A = new Ci.Vector3).x = R[o++] * e, A.y = R[o++] * e, A.z = R[o++] * e, N.vertices.push(A);
  29750. for (o = 0, a = M.length; o < a;)
  29751. if (d = t(u = M[o++], 0), p = t(u, 1), f = t(u, 3), g = t(u, 4), m = t(u, 5), v = t(u, 6), y = t(u, 7), d) {
  29752. if ((I = new Ci.Face3).a = M[o], I.b = M[o + 1], I.c = M[o + 3], (E = new Ci.Face3).a = M[o + 1], E.b = M[o + 2], E.c = M[o + 3], o += 4, p && (h = M[o++], I.materialIndex = h, E.materialIndex = h), r = N.faces.length, f)
  29753. for (i = 0; i < L; i++)
  29754. for (w = D.uvs[i], N.faceVertexUvs[i][r] = [], N.faceVertexUvs[i][r + 1] = [], n = 0; n < 4; n++) x = w[2 * (c = M[o++])], S = w[2 * c + 1], T = new Ci.Vector2(x, S), 2 !== n && N.faceVertexUvs[i][r].push(T), 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  29755. if (g && (l = 3 * M[o++], I.normal.set(P[l++], P[l++], P[l]), E.normal.copy(I.normal)), m)
  29756. for (i = 0; i < 4; i++) l = 3 * M[o++], b = new Ci.Vector3(P[l++], P[l++], P[l]), 2 !== i && I.vertexNormals.push(b), 0 !== i && E.vertexNormals.push(b);
  29757. if (v && (_ = O[s = M[o++]], I.color.setHex(_), E.color.setHex(_)), y)
  29758. for (i = 0; i < 4; i++) _ = O[s = M[o++]], 2 !== i && I.vertexColors.push(new Ci.Color(_)), 0 !== i && E.vertexColors.push(new Ci.Color(_));
  29759. N.faces.push(I), N.faces.push(E)
  29760. } else {
  29761. if ((C = new Ci.Face3).a = M[o++], C.b = M[o++], C.c = M[o++], p && (h = M[o++], C.materialIndex = h), r = N.faces.length, f)
  29762. for (i = 0; i < L; i++)
  29763. for (w = D.uvs[i], N.faceVertexUvs[i][r] = [], n = 0; n < 3; n++) x = w[2 * (c = M[o++])], S = w[2 * c + 1], T = new Ci.Vector2(x, S), N.faceVertexUvs[i][r].push(T);
  29764. if (g && (l = 3 * M[o++], C.normal.set(P[l++], P[l++], P[l])), m)
  29765. for (i = 0; i < 3; i++) l = 3 * M[o++], b = new Ci.Vector3(P[l++], P[l++], P[l]), C.vertexNormals.push(b);
  29766. if (v && (s = M[o++], C.color.setHex(O[s])), y)
  29767. for (i = 0; i < 3; i++) s = M[o++], C.vertexColors.push(new Ci.Color(O[s]));
  29768. N.faces.push(C)
  29769. }
  29770. }(t), function () {
  29771. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  29772. if (D.skinWeights)
  29773. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  29774. var n = D.skinWeights[t],
  29775. r = 1 < e ? D.skinWeights[t + 1] : 0,
  29776. o = 2 < e ? D.skinWeights[t + 2] : 0,
  29777. a = 3 < e ? D.skinWeights[t + 3] : 0;
  29778. N.skinWeights.push(new Ci.Vector4(n, r, o, a))
  29779. }
  29780. if (D.skinIndices)
  29781. for (t = 0, i = D.skinIndices.length; t < i; t += e) {
  29782. var s = D.skinIndices[t],
  29783. l = 1 < e ? D.skinIndices[t + 1] : 0,
  29784. c = 2 < e ? D.skinIndices[t + 2] : 0,
  29785. h = 3 < e ? D.skinIndices[t + 3] : 0;
  29786. N.skinIndices.push(new Ci.Vector4(s, l, c, h))
  29787. }
  29788. N.bones = D.bones, N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  29789. }(), function (e) {
  29790. if (void 0 !== D.morphTargets)
  29791. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  29792. N.morphTargets[t] = {}, N.morphTargets[t].name = D.morphTargets[t].name, N.morphTargets[t].vertices = [];
  29793. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  29794. var s = new Ci.Vector3;
  29795. s.x = r[o] * e, s.y = r[o + 1] * e, s.z = r[o + 2] * e, n.push(s)
  29796. }
  29797. }
  29798. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  29799. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  29800. var l = N.faces,
  29801. c = D.morphColors[0].colors;
  29802. for (t = 0, i = l.length; t < i; t++) l[t].color.fromArray(c, 3 * t)
  29803. }
  29804. }(t), function () {
  29805. var e = [],
  29806. t = [];
  29807. void 0 !== D.animation && t.push(D.animation), void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  29808. for (var i = 0; i < t.length; i++) {
  29809. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  29810. n && e.push(n)
  29811. }
  29812. if (N.morphTargets) {
  29813. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  29814. e = e.concat(r)
  29815. }
  29816. 0 < e.length && (N.animations = e)
  29817. }(), N.computeFaceNormals(), N.computeBoundingSphere(), void 0 === D.materials || 0 === D.materials.length) return {
  29818. geometry: N
  29819. };
  29820. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  29821. return {
  29822. geometry: N,
  29823. materials: i
  29824. }
  29825. }
  29826. }, Ci.LoadingManager = function (e, t, i) {
  29827. var n = this,
  29828. r = !1,
  29829. o = 0,
  29830. a = 0;
  29831. this.onStart = void 0, this.onLoad = e, this.onProgress = t, this.onError = i, this.itemStart = function (e) {
  29832. a++, !1 === r && void 0 !== n.onStart && n.onStart(e, o, a), r = !0
  29833. }, this.itemEnd = function (e) {
  29834. o++, void 0 !== n.onProgress && n.onProgress(e, o, a), o === a && (r = !1, void 0 !== n.onLoad && n.onLoad())
  29835. }, this.itemError = function (e) {
  29836. void 0 !== n.onError && n.onError(e)
  29837. }
  29838. }, Ci.DefaultLoadingManager = new Ci.LoadingManager, Ci.BufferGeometryLoader = function (e) {
  29839. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  29840. }, Ci.BufferGeometryLoader.prototype = {
  29841. constructor: Ci.BufferGeometryLoader,
  29842. load: function (e, t, i, n) {
  29843. var r = this;
  29844. new Ci.XHRLoader(r.manager).load(e, function (e) {
  29845. t(r.parse(JSON.parse(e)))
  29846. }, i, n)
  29847. },
  29848. parse: function (e) {
  29849. var t = new Ci.BufferGeometry,
  29850. i = e.data.index,
  29851. n = {
  29852. Int8Array: Int8Array,
  29853. Uint8Array: Uint8Array,
  29854. Uint8ClampedArray: Uint8ClampedArray,
  29855. Int16Array: Int16Array,
  29856. Uint16Array: Uint16Array,
  29857. Int32Array: Int32Array,
  29858. Uint32Array: Uint32Array,
  29859. Float32Array: Float32Array,
  29860. Float64Array: Float64Array
  29861. };
  29862. if (void 0 !== i) {
  29863. var r = new n[i.type](i.array);
  29864. t.setIndex(new Ci.BufferAttribute(r, 1))
  29865. }
  29866. var o = e.data.attributes;
  29867. for (var a in o) {
  29868. var s = o[a];
  29869. r = new n[s.type](s.array);
  29870. t.addAttribute(a, new Ci.BufferAttribute(r, s.itemSize))
  29871. }
  29872. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  29873. if (void 0 !== l)
  29874. for (var c = 0, h = l.length; c !== h; ++c) {
  29875. var u = l[c];
  29876. t.addGroup(u.start, u.count, u.materialIndex)
  29877. }
  29878. var d = e.data.boundingSphere;
  29879. if (void 0 !== d) {
  29880. var p = new Ci.Vector3;
  29881. void 0 !== d.center && p.fromArray(d.center), t.boundingSphere = new Ci.Sphere(p, d.radius)
  29882. }
  29883. return t
  29884. }
  29885. }, Ci.MaterialLoader = function (e) {
  29886. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager, this.textures = {}
  29887. }, Ci.MaterialLoader.prototype = {
  29888. constructor: Ci.MaterialLoader,
  29889. load: function (e, t, i, n) {
  29890. var r = this;
  29891. new Ci.XHRLoader(r.manager).load(e, function (e) {
  29892. t(r.parse(JSON.parse(e)))
  29893. }, i, n)
  29894. },
  29895. setTextures: function (e) {
  29896. this.textures = e
  29897. },
  29898. getTexture: function (e) {
  29899. var t = this.textures;
  29900. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e), t[e]
  29901. },
  29902. parse: function (e) {
  29903. var t = new Ci[e.type];
  29904. if (void 0 !== e.uuid && (t.uuid = e.uuid), void 0 !== e.name && (t.name = e.name), void 0 !== e.color && t.color.setHex(e.color), void 0 !== e.roughness && (t.roughness = e.roughness), void 0 !== e.metalness && (t.metalness = e.metalness), void 0 !== e.emissive && t.emissive.setHex(e.emissive), void 0 !== e.specular && t.specular.setHex(e.specular), void 0 !== e.shininess && (t.shininess = e.shininess), void 0 !== e.uniforms && (t.uniforms = e.uniforms), void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader), void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader), void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors), void 0 !== e.shading && (t.shading = e.shading), void 0 !== e.blending && (t.blending = e.blending), void 0 !== e.side && (t.side = e.side), void 0 !== e.opacity && (t.opacity = e.opacity), void 0 !== e.transparent && (t.transparent = e.transparent), void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest), void 0 !== e.depthTest && (t.depthTest = e.depthTest), void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite), void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite), void 0 !== e.wireframe && (t.wireframe = e.wireframe), void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth), void 0 !== e.size && (t.size = e.size), void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation), void 0 !== e.map && (t.map = this.getTexture(e.map)), void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap), t.transparent = !0), void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)), void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale), void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)), void 0 !== e.normalScale) {
  29905. var i = e.normalScale;
  29906. !1 === Array.isArray(i) && (i = [i, i]), t.normalScale = (new Ci.Vector2).fromArray(i)
  29907. }
  29908. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)), void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale), void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias), void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)), void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)), void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)), void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity), void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)), void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap), t.combine = Ci.MultiplyOperation), e.reflectivity && (t.reflectivity = e.reflectivity), void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)), void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity), void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)), void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity), void 0 !== e.materials)
  29909. for (var n = 0, r = e.materials.length; n < r; n++) t.materials.push(this.parse(e.materials[n]));
  29910. return t
  29911. }
  29912. }, Ci.ObjectLoader = function (e) {
  29913. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager, this.texturePath = ""
  29914. }, Ci.ObjectLoader.prototype = {
  29915. constructor: Ci.ObjectLoader,
  29916. load: function (e, t, i, n) {
  29917. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  29918. var r = this;
  29919. new Ci.XHRLoader(r.manager).load(e, function (e) {
  29920. r.parse(JSON.parse(e), t)
  29921. }, i, n)
  29922. },
  29923. setTexturePath: function (e) {
  29924. this.texturePath = e
  29925. },
  29926. setCrossOrigin: function (e) {
  29927. this.crossOrigin = e
  29928. },
  29929. parse: function (e, t) {
  29930. var i = this.parseGeometries(e.geometries),
  29931. n = this.parseImages(e.images, function () {
  29932. void 0 !== t && t(a)
  29933. }),
  29934. r = this.parseTextures(e.textures, n),
  29935. o = this.parseMaterials(e.materials, r),
  29936. a = this.parseObject(e.object, i, o);
  29937. return e.animations && (a.animations = this.parseAnimations(e.animations)), void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a), a
  29938. },
  29939. parseGeometries: function (e) {
  29940. var t = {};
  29941. if (void 0 !== e)
  29942. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  29943. var a, s = e[r];
  29944. switch (s.type) {
  29945. case "PlaneGeometry":
  29946. case "PlaneBufferGeometry":
  29947. a = new Ci[s.type](s.width, s.height, s.widthSegments, s.heightSegments);
  29948. break;
  29949. case "BoxGeometry":
  29950. case "BoxBufferGeometry":
  29951. case "CubeGeometry":
  29952. a = new Ci[s.type](s.width, s.height, s.depth, s.widthSegments, s.heightSegments, s.depthSegments);
  29953. break;
  29954. case "CircleGeometry":
  29955. case "CircleBufferGeometry":
  29956. a = new Ci[s.type](s.radius, s.segments, s.thetaStart, s.thetaLength);
  29957. break;
  29958. case "CylinderGeometry":
  29959. case "CylinderBufferGeometry":
  29960. a = new Ci[s.type](s.radiusTop, s.radiusBottom, s.height, s.radialSegments, s.heightSegments, s.openEnded, s.thetaStart, s.thetaLength);
  29961. break;
  29962. case "SphereGeometry":
  29963. case "SphereBufferGeometry":
  29964. a = new Ci[s.type](s.radius, s.widthSegments, s.heightSegments, s.phiStart, s.phiLength, s.thetaStart, s.thetaLength);
  29965. break;
  29966. case "DodecahedronGeometry":
  29967. a = new Ci.DodecahedronGeometry(s.radius, s.detail);
  29968. break;
  29969. case "IcosahedronGeometry":
  29970. a = new Ci.IcosahedronGeometry(s.radius, s.detail);
  29971. break;
  29972. case "OctahedronGeometry":
  29973. a = new Ci.OctahedronGeometry(s.radius, s.detail);
  29974. break;
  29975. case "TetrahedronGeometry":
  29976. a = new Ci.TetrahedronGeometry(s.radius, s.detail);
  29977. break;
  29978. case "RingGeometry":
  29979. case "RingBufferGeometry":
  29980. a = new Ci[s.type](s.innerRadius, s.outerRadius, s.thetaSegments, s.phiSegments, s.thetaStart, s.thetaLength);
  29981. break;
  29982. case "TorusGeometry":
  29983. case "TorusBufferGeometry":
  29984. a = new Ci[s.type](s.radius, s.tube, s.radialSegments, s.tubularSegments, s.arc);
  29985. break;
  29986. case "TorusKnotGeometry":
  29987. case "TorusKnotBufferGeometry":
  29988. a = new Ci[s.type](s.radius, s.tube, s.tubularSegments, s.radialSegments, s.p, s.q);
  29989. break;
  29990. case "LatheGeometry":
  29991. a = new Ci.LatheGeometry(s.points, s.segments, s.phiStart, s.phiLength);
  29992. break;
  29993. case "BufferGeometry":
  29994. a = n.parse(s);
  29995. break;
  29996. case "Geometry":
  29997. a = i.parse(s.data, this.texturePath).geometry;
  29998. break;
  29999. default:
  30000. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  30001. continue
  30002. }
  30003. a.uuid = s.uuid, void 0 !== s.name && (a.name = s.name), t[s.uuid] = a
  30004. }
  30005. return t
  30006. },
  30007. parseMaterials: function (e, t) {
  30008. var i = {};
  30009. if (void 0 !== e) {
  30010. var n = new Ci.MaterialLoader;
  30011. n.setTextures(t);
  30012. for (var r = 0, o = e.length; r < o; r++) {
  30013. var a = n.parse(e[r]);
  30014. i[a.uuid] = a
  30015. }
  30016. }
  30017. return i
  30018. },
  30019. parseAnimations: function (e) {
  30020. for (var t = [], i = 0; i < e.length; i++) {
  30021. var n = Ci.AnimationClip.parse(e[i]);
  30022. t.push(n)
  30023. }
  30024. return t
  30025. },
  30026. parseImages: function (e, t) {
  30027. function i(e) {
  30028. return n.manager.itemStart(e), a.load(e, function () {
  30029. n.manager.itemEnd(e)
  30030. })
  30031. }
  30032. var n = this,
  30033. r = {};
  30034. if (void 0 !== e && 0 < e.length) {
  30035. var o = new Ci.LoadingManager(t),
  30036. a = new Ci.ImageLoader(o);
  30037. a.setCrossOrigin(this.crossOrigin);
  30038. for (var s = 0, l = e.length; s < l; s++) {
  30039. var c = e[s],
  30040. h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  30041. r[c.uuid] = i(h)
  30042. }
  30043. }
  30044. return r
  30045. },
  30046. parseTextures: function (e, t) {
  30047. function i(e) {
  30048. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e), Ci[e])
  30049. }
  30050. var n = {};
  30051. if (void 0 !== e)
  30052. for (var r = 0, o = e.length; r < o; r++) {
  30053. var a = e[r];
  30054. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid), void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  30055. var s = new Ci.Texture(t[a.image]);
  30056. s.needsUpdate = !0, s.uuid = a.uuid, void 0 !== a.name && (s.name = a.name), void 0 !== a.mapping && (s.mapping = i(a.mapping)), void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0], a.offset[1])), void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0], a.repeat[1])), void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)), void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)), void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy), Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]), s.wrapT = i(a.wrap[1])), n[a.uuid] = s
  30057. }
  30058. return n
  30059. },
  30060. parseObject: (ke = new Ci.Matrix4, function (e, t, i) {
  30061. function n(e) {
  30062. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e), t[e]
  30063. }
  30064. function r(e) {
  30065. if (void 0 !== e) return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e), i[e]
  30066. }
  30067. var o;
  30068. switch (e.type) {
  30069. case "Scene":
  30070. o = new Ci.Scene;
  30071. break;
  30072. case "PerspectiveCamera":
  30073. o = new Ci.PerspectiveCamera(e.fov, e.aspect, e.near, e.far);
  30074. break;
  30075. case "OrthographicCamera":
  30076. o = new Ci.OrthographicCamera(e.left, e.right, e.top, e.bottom, e.near, e.far);
  30077. break;
  30078. case "AmbientLight":
  30079. o = new Ci.AmbientLight(e.color, e.intensity);
  30080. break;
  30081. case "DirectionalLight":
  30082. o = new Ci.DirectionalLight(e.color, e.intensity);
  30083. break;
  30084. case "PointLight":
  30085. o = new Ci.PointLight(e.color, e.intensity, e.distance, e.decay);
  30086. break;
  30087. case "SpotLight":
  30088. o = new Ci.SpotLight(e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay);
  30089. break;
  30090. case "HemisphereLight":
  30091. o = new Ci.HemisphereLight(e.color, e.groundColor, e.intensity);
  30092. break;
  30093. case "Mesh":
  30094. var a = n(e.geometry),
  30095. s = r(e.material);
  30096. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a, s) : new Ci.Mesh(a, s);
  30097. break;
  30098. case "LOD":
  30099. o = new Ci.LOD;
  30100. break;
  30101. case "Line":
  30102. o = new Ci.Line(n(e.geometry), r(e.material), e.mode);
  30103. break;
  30104. case "PointCloud":
  30105. case "Points":
  30106. o = new Ci.Points(n(e.geometry), r(e.material));
  30107. break;
  30108. case "Sprite":
  30109. o = new Ci.Sprite(r(e.material));
  30110. break;
  30111. case "Group":
  30112. o = new Ci.Group;
  30113. break;
  30114. default:
  30115. o = new Ci.Object3D
  30116. }
  30117. if (o.uuid = e.uuid, void 0 !== e.name && (o.name = e.name), void 0 !== e.matrix ? (ke.fromArray(e.matrix), ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position), void 0 !== e.rotation && o.rotation.fromArray(e.rotation), void 0 !== e.scale && o.scale.fromArray(e.scale)), void 0 !== e.castShadow && (o.castShadow = e.castShadow), void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow), void 0 !== e.visible && (o.visible = e.visible), void 0 !== e.userData && (o.userData = e.userData), void 0 !== e.children)
  30118. for (var l in e.children) o.add(this.parseObject(e.children[l], t, i));
  30119. if ("LOD" === e.type)
  30120. for (var c = e.levels, h = 0; h < c.length; h++) {
  30121. var u = c[h];
  30122. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  30123. }
  30124. return o
  30125. })
  30126. }, Ci.TextureLoader = function (e) {
  30127. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  30128. }, Ci.TextureLoader.prototype = {
  30129. constructor: Ci.TextureLoader,
  30130. load: function (e, t, i, n) {
  30131. var r = new Ci.Texture,
  30132. o = new Ci.ImageLoader(this.manager);
  30133. return o.setCrossOrigin(this.crossOrigin), o.setPath(this.path), o.load(e, function (e) {
  30134. r.image = e, r.needsUpdate = !0, void 0 !== t && t(r)
  30135. }, i, n), r
  30136. },
  30137. setCrossOrigin: function (e) {
  30138. this.crossOrigin = e
  30139. },
  30140. setPath: function (e) {
  30141. this.path = e
  30142. }
  30143. }, Ci.CubeTextureLoader = function (e) {
  30144. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  30145. }, Ci.CubeTextureLoader.prototype = {
  30146. constructor: Ci.CubeTextureLoader,
  30147. load: function (e, i, t, n) {
  30148. function r(t) {
  30149. a.load(e[t], function (e) {
  30150. o.images[t] = e, 6 === ++s && (o.needsUpdate = !0, i && i(o))
  30151. }, void 0, n)
  30152. }
  30153. var o = new Ci.CubeTexture,
  30154. a = new Ci.ImageLoader(this.manager);
  30155. a.setCrossOrigin(this.crossOrigin), a.setPath(this.path);
  30156. for (var s = 0, l = 0; l < e.length; ++l) r(l);
  30157. return o
  30158. },
  30159. setCrossOrigin: function (e) {
  30160. this.crossOrigin = e
  30161. },
  30162. setPath: function (e) {
  30163. this.path = e
  30164. }
  30165. }, Ci.DataTextureLoader = Ci.BinaryTextureLoader = function (e) {
  30166. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager, this._parser = null
  30167. }, Ci.BinaryTextureLoader.prototype = {
  30168. constructor: Ci.BinaryTextureLoader,
  30169. load: function (e, i, t, n) {
  30170. var r = this,
  30171. o = new Ci.DataTexture,
  30172. a = new Ci.XHRLoader(this.manager);
  30173. return a.setResponseType("arraybuffer"), a.load(e, function (e) {
  30174. var t = r._parser(e);
  30175. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width, o.image.height = t.height, o.image.data = t.data), o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping, o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping, o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter, o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter, o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1, void 0 !== t.format && (o.format = t.format), void 0 !== t.type && (o.type = t.type), void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps), 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter), o.needsUpdate = !0, i && i(o, t))
  30176. }, t, n), o
  30177. }
  30178. }, Ci.CompressedTextureLoader = function (e) {
  30179. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager, this._parser = null
  30180. }, Ci.CompressedTextureLoader.prototype = {
  30181. constructor: Ci.CompressedTextureLoader,
  30182. load: function (e, o, t, n) {
  30183. function i(i) {
  30184. r.load(e[i], function (e) {
  30185. var t = a._parser(e, !0);
  30186. s[i] = {
  30187. width: t.width,
  30188. height: t.height,
  30189. format: t.format,
  30190. mipmaps: t.mipmaps
  30191. }, 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter), l.format = t.format, l.needsUpdate = !0, o && o(l))
  30192. }, t, n)
  30193. }
  30194. var a = this,
  30195. s = [],
  30196. l = new Ci.CompressedTexture;
  30197. l.image = s;
  30198. var r = new Ci.XHRLoader(this.manager);
  30199. if (r.setPath(this.path), r.setResponseType("arraybuffer"), Array.isArray(e))
  30200. for (var c = 0, h = 0, u = e.length; h < u; ++h) i(h);
  30201. else r.load(e, function (e) {
  30202. var t = a._parser(e, !0);
  30203. if (t.isCubemap)
  30204. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  30205. s[n] = {
  30206. mipmaps: []
  30207. };
  30208. for (var r = 0; r < t.mipmapCount; r++) s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]), s[n].format = t.format, s[n].width = t.width, s[n].height = t.height
  30209. } else l.image.width = t.width, l.image.height = t.height, l.mipmaps = t.mipmaps;
  30210. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter), l.format = t.format, l.needsUpdate = !0, o && o(l)
  30211. }, t, n);
  30212. return l
  30213. },
  30214. setPath: function (e) {
  30215. this.path = e
  30216. }
  30217. }, Ci.Material = function () {
  30218. Object.defineProperty(this, "id", {
  30219. value: Ci.MaterialIdCount++
  30220. }), this.uuid = Ci.Math.generateUUID(), this.name = "", this.type = "Material", this.side = Ci.FrontSide, this.opacity = 1, this.transparent = !1, this.blending = Ci.NormalBlending, this.blendSrc = Ci.SrcAlphaFactor, this.blendDst = Ci.OneMinusSrcAlphaFactor, this.blendEquation = Ci.AddEquation, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = Ci.LessEqualDepth, this.depthTest = !0, this.depthWrite = !0, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.alphaTest = 0, this.premultipliedAlpha = !1, this.overdraw = 0, this.visible = !0, this._needsUpdate = !0
  30221. }, Ci.Material.prototype = {
  30222. constructor: Ci.Material,
  30223. get needsUpdate() {
  30224. return this._needsUpdate
  30225. },
  30226. set needsUpdate(e) {
  30227. !0 === e && this.update(), this._needsUpdate = e
  30228. },
  30229. setValues: function (e) {
  30230. if (void 0 !== e)
  30231. for (var t in e) {
  30232. var i = e[t];
  30233. if (void 0 !== i) {
  30234. var n = this[t];
  30235. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  30236. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  30237. }
  30238. },
  30239. toJSON: function (e) {
  30240. function t(e) {
  30241. var t = [];
  30242. for (var i in e) {
  30243. var n = e[i];
  30244. delete n.metadata, t.push(n)
  30245. }
  30246. return t
  30247. }
  30248. var i = void 0 === e;
  30249. i && (e = {
  30250. textures: {},
  30251. images: {}
  30252. });
  30253. var n = {
  30254. metadata: {
  30255. version: 4.4,
  30256. type: "Material",
  30257. generator: "Material.toJSON"
  30258. }
  30259. };
  30260. if (n.uuid = this.uuid, n.type = this.type, "" !== this.name && (n.name = this.name), this.color instanceof Ci.Color && (n.color = this.color.getHex()), .5 !== this.roughness && (n.roughness = this.roughness), .5 !== this.metalness && (n.metalness = this.metalness), this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()), this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()), void 0 !== this.shininess && (n.shininess = this.shininess), this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid), this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid), this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalScale = this.normalScale.toArray()), this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid, n.reflectivity = this.reflectivity), void 0 !== this.size && (n.size = this.size), void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation), void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors), void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading), void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending), void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side), this.opacity < 1 && (n.opacity = this.opacity), !0 === this.transparent && (n.transparent = this.transparent), 0 < this.alphaTest && (n.alphaTest = this.alphaTest), !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha), !0 === this.wireframe && (n.wireframe = this.wireframe), 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth), i) {
  30261. var r = t(e.textures),
  30262. o = t(e.images);
  30263. 0 < r.length && (n.textures = r), 0 < o.length && (n.images = o)
  30264. }
  30265. return n
  30266. },
  30267. clone: function () {
  30268. return (new this.constructor).copy(this)
  30269. },
  30270. copy: function (e) {
  30271. return this.name = e.name, this.side = e.side, this.opacity = e.opacity, this.transparent = e.transparent, this.blending = e.blending, this.blendSrc = e.blendSrc, this.blendDst = e.blendDst, this.blendEquation = e.blendEquation, this.blendSrcAlpha = e.blendSrcAlpha, this.blendDstAlpha = e.blendDstAlpha, this.blendEquationAlpha = e.blendEquationAlpha, this.depthFunc = e.depthFunc, this.depthTest = e.depthTest, this.depthWrite = e.depthWrite, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.alphaTest = e.alphaTest, this.premultipliedAlpha = e.premultipliedAlpha, this.overdraw = e.overdraw, this.visible = e.visible, this
  30272. },
  30273. update: function () {
  30274. this.dispatchEvent({
  30275. type: "update"
  30276. })
  30277. },
  30278. dispose: function () {
  30279. this.dispatchEvent({
  30280. type: "dispose"
  30281. })
  30282. }
  30283. }, Ci.EventDispatcher.prototype.apply(Ci.Material.prototype), Ci.MaterialIdCount = 0, Ci.LineBasicMaterial = function (e) {
  30284. Ci.Material.call(this), this.type = "LineBasicMaterial", this.color = new Ci.Color(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.blending = Ci.NormalBlending, this.vertexColors = Ci.NoColors, this.fog = !0, this.setValues(e)
  30285. }, Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype), Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial, Ci.LineBasicMaterial.prototype.copy = function (e) {
  30286. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.vertexColors = e.vertexColors, this.fog = e.fog, this
  30287. }, Ci.LineDashedMaterial = function (e) {
  30288. Ci.Material.call(this), this.type = "LineDashedMaterial", this.color = new Ci.Color(16777215), this.linewidth = 1, this.scale = 1, this.dashSize = 3, this.gapSize = 1, this.blending = Ci.NormalBlending, this.vertexColors = Ci.NoColors, this.fog = !0, this.setValues(e)
  30289. }, Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype), Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial, Ci.LineDashedMaterial.prototype.copy = function (e) {
  30290. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.linewidth = e.linewidth, this.scale = e.scale, this.dashSize = e.dashSize, this.gapSize = e.gapSize, this.vertexColors = e.vertexColors, this.fog = e.fog, this
  30291. }, Ci.MeshBasicMaterial = function (e) {
  30292. Ci.Material.call(this), this.type = "MeshBasicMaterial", this.color = new Ci.Color(16777215), this.map = null, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = Ci.MultiplyOperation, this.reflectivity = 1, this.refractionRatio = .98, this.fog = !0, this.shading = Ci.SmoothShading, this.blending = Ci.NormalBlending, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.vertexColors = Ci.NoColors, this.skinning = !1, this.morphTargets = !1, this.setValues(e)
  30293. }, Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype), Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial, Ci.MeshBasicMaterial.prototype.copy = function (e) {
  30294. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.map = e.map, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.fog = e.fog, this.shading = e.shading, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.vertexColors = e.vertexColors, this.skinning = e.skinning, this.morphTargets = e.morphTargets, this
  30295. }, Ci.MeshLambertMaterial = function (e) {
  30296. Ci.Material.call(this), this.type = "MeshLambertMaterial", this.color = new Ci.Color(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Ci.Color(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = Ci.MultiplyOperation, this.reflectivity = 1, this.refractionRatio = .98, this.fog = !0, this.blending = Ci.NormalBlending, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.vertexColors = Ci.NoColors, this.skinning = !1, this.morphTargets = !1, this.morphNormals = !1, this.setValues(e)
  30297. }, Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype), Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial, Ci.MeshLambertMaterial.prototype.copy = function (e) {
  30298. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.fog = e.fog, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.vertexColors = e.vertexColors, this.skinning = e.skinning, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this
  30299. }, Ci.MeshPhongMaterial = function (e) {
  30300. Ci.Material.call(this), this.type = "MeshPhongMaterial", this.color = new Ci.Color(16777215), this.specular = new Ci.Color(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Ci.Color(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalScale = new Ci.Vector2(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = Ci.MultiplyOperation, this.reflectivity = 1, this.refractionRatio = .98, this.fog = !0, this.shading = Ci.SmoothShading, this.blending = Ci.NormalBlending, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.vertexColors = Ci.NoColors, this.skinning = !1, this.morphTargets = !1, this.morphNormals = !1, this.setValues(e)
  30301. }, Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype), Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial, Ci.MeshPhongMaterial.prototype.copy = function (e) {
  30302. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.specular.copy(e.specular), this.shininess = e.shininess, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.fog = e.fog, this.shading = e.shading, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.vertexColors = e.vertexColors, this.skinning = e.skinning, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this
  30303. }, Ci.MeshStandardMaterial = function (e) {
  30304. Ci.Material.call(this), this.type = "MeshStandardMaterial", this.color = new Ci.Color(16777215), this.roughness = .5, this.metalness = .5, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Ci.Color(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalScale = new Ci.Vector2(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapIntensity = 1, this.refractionRatio = .98, this.fog = !0, this.shading = Ci.SmoothShading, this.blending = Ci.NormalBlending, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.vertexColors = Ci.NoColors, this.skinning = !1, this.morphTargets = !1, this.morphNormals = !1, this.setValues(e)
  30305. }, Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype), Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial, Ci.MeshStandardMaterial.prototype.copy = function (e) {
  30306. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.roughness = e.roughness, this.metalness = e.metalness, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.roughnessMap = e.roughnessMap, this.metalnessMap = e.metalnessMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapIntensity = e.envMapIntensity, this.refractionRatio = e.refractionRatio, this.fog = e.fog, this.shading = e.shading, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.vertexColors = e.vertexColors, this.skinning = e.skinning, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this
  30307. }, Ci.MeshDepthMaterial = function (e) {
  30308. Ci.Material.call(this), this.type = "MeshDepthMaterial", this.morphTargets = !1, this.wireframe = !1, this.wireframeLinewidth = 1, this.setValues(e)
  30309. }, Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype), Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial, Ci.MeshDepthMaterial.prototype.copy = function (e) {
  30310. return Ci.Material.prototype.copy.call(this, e), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this
  30311. }, Ci.MeshNormalMaterial = function (e) {
  30312. Ci.Material.call(this, e), this.type = "MeshNormalMaterial", this.wireframe = !1, this.wireframeLinewidth = 1, this.morphTargets = !1, this.setValues(e)
  30313. }, Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype), Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial, Ci.MeshNormalMaterial.prototype.copy = function (e) {
  30314. return Ci.Material.prototype.copy.call(this, e), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this
  30315. }, Ci.MultiMaterial = function (e) {
  30316. this.uuid = Ci.Math.generateUUID(), this.type = "MultiMaterial", this.materials = e instanceof Array ? e : [], this.visible = !0
  30317. }, Ci.MultiMaterial.prototype = {
  30318. constructor: Ci.MultiMaterial,
  30319. toJSON: function (e) {
  30320. for (var t = {
  30321. metadata: {
  30322. version: 4.2,
  30323. type: "material",
  30324. generator: "MaterialExporter"
  30325. },
  30326. uuid: this.uuid,
  30327. type: this.type,
  30328. materials: []
  30329. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  30330. var o = i[n].toJSON(e);
  30331. delete o.metadata, t.materials.push(o)
  30332. }
  30333. return t.visible = this.visible, t
  30334. },
  30335. clone: function () {
  30336. for (var e = new this.constructor, t = 0; t < this.materials.length; t++) e.materials.push(this.materials[t].clone());
  30337. return e.visible = this.visible, e
  30338. }
  30339. }, Ci.PointsMaterial = function (e) {
  30340. Ci.Material.call(this), this.type = "PointsMaterial", this.color = new Ci.Color(16777215), this.map = null, this.size = 1, this.sizeAttenuation = !0, this.blending = Ci.NormalBlending, this.vertexColors = Ci.NoColors, this.fog = !0, this.setValues(e)
  30341. }, Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype), Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial, Ci.PointsMaterial.prototype.copy = function (e) {
  30342. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.map = e.map, this.size = e.size, this.sizeAttenuation = e.sizeAttenuation, this.vertexColors = e.vertexColors, this.fog = e.fog, this
  30343. }, Ci.ShaderMaterial = function (e) {
  30344. Ci.Material.call(this), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}", this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}", this.shading = Ci.SmoothShading, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.vertexColors = Ci.NoColors, this.skinning = !1, this.morphTargets = !1, this.morphNormals = !1, this.extensions = {
  30345. derivatives: !1,
  30346. fragDepth: !1,
  30347. drawBuffers: !1,
  30348. shaderTextureLOD: !1
  30349. }, this.defaultAttributeValues = {
  30350. color: [1, 1, 1],
  30351. uv: [0, 0],
  30352. uv2: [0, 0]
  30353. }, (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."), this.setValues(e))
  30354. }, Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype), Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial, Ci.ShaderMaterial.prototype.copy = function (e) {
  30355. return Ci.Material.prototype.copy.call(this, e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = Ci.UniformsUtils.clone(e.uniforms), this.defines = e.defines, this.shading = e.shading, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.fog = e.fog, this.lights = e.lights, this.vertexColors = e.vertexColors, this.skinning = e.skinning, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.extensions = e.extensions, this
  30356. }, Ci.ShaderMaterial.prototype.toJSON = function (e) {
  30357. var t = Ci.Material.prototype.toJSON.call(this, e);
  30358. return t.uniforms = this.uniforms, t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader, t
  30359. }, Ci.RawShaderMaterial = function (e) {
  30360. Ci.ShaderMaterial.call(this, e), this.type = "RawShaderMaterial"
  30361. }, Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype), Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial, Ci.SpriteMaterial = function (e) {
  30362. Ci.Material.call(this), this.type = "SpriteMaterial", this.color = new Ci.Color(16777215), this.map = null, this.rotation = 0, this.fog = !1, this.setValues(e)
  30363. }, Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype), Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial, Ci.SpriteMaterial.prototype.copy = function (e) {
  30364. return Ci.Material.prototype.copy.call(this, e), this.color.copy(e.color), this.map = e.map, this.rotation = e.rotation, this.fog = e.fog, this
  30365. }, Ci.Texture = function (e, t, i, n, r, o, a, s, l) {
  30366. Object.defineProperty(this, "id", {
  30367. value: Ci.TextureIdCount++
  30368. }), this.uuid = Ci.Math.generateUUID(), this.name = "", this.sourceFile = "", this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE, this.mipmaps = [], this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING, this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping, this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping, this.magFilter = void 0 !== r ? r : Ci.LinearFilter, this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter, this.anisotropy = void 0 !== l ? l : 1, this.format = void 0 !== a ? a : Ci.RGBAFormat, this.type = void 0 !== s ? s : Ci.UnsignedByteType, this.offset = new Ci.Vector2(0, 0), this.repeat = new Ci.Vector2(1, 1), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.encoding = Ci.LinearEncoding, this.version = 0, this.onUpdate = null
  30369. }, Ci.Texture.DEFAULT_IMAGE = void 0, Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping, Ci.Texture.prototype = {
  30370. constructor: Ci.Texture,
  30371. set needsUpdate(e) {
  30372. !0 === e && this.version++
  30373. },
  30374. clone: function () {
  30375. return (new this.constructor).copy(this)
  30376. },
  30377. copy: function (e) {
  30378. return this.image = e.image, this.mipmaps = e.mipmaps.slice(0), this.mapping = e.mapping, this.wrapS = e.wrapS, this.wrapT = e.wrapT, this.magFilter = e.magFilter, this.minFilter = e.minFilter, this.anisotropy = e.anisotropy, this.format = e.format, this.type = e.type, this.offset.copy(e.offset), this.repeat.copy(e.repeat), this.generateMipmaps = e.generateMipmaps, this.premultiplyAlpha = e.premultiplyAlpha, this.flipY = e.flipY, this.unpackAlignment = e.unpackAlignment, this.encoding = e.encoding, this
  30379. },
  30380. toJSON: function (e) {
  30381. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid];
  30382. var t, i, n = {
  30383. metadata: {
  30384. version: 4.4,
  30385. type: "Texture",
  30386. generator: "Texture.toJSON"
  30387. },
  30388. uuid: this.uuid,
  30389. name: this.name,
  30390. mapping: this.mapping,
  30391. repeat: [this.repeat.x, this.repeat.y],
  30392. offset: [this.offset.x, this.offset.y],
  30393. wrap: [this.wrapS, this.wrapT],
  30394. minFilter: this.minFilter,
  30395. magFilter: this.magFilter,
  30396. anisotropy: this.anisotropy
  30397. };
  30398. if (void 0 !== this.image) {
  30399. var r = this.image;
  30400. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()), void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  30401. uuid: r.uuid,
  30402. url: (t = r, void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width, i.height = t.height, i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)), 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  30403. }), n.image = r.uuid
  30404. }
  30405. return e.textures[this.uuid] = n
  30406. },
  30407. dispose: function () {
  30408. this.dispatchEvent({
  30409. type: "dispose"
  30410. })
  30411. },
  30412. transformUv: function (e) {
  30413. if (this.mapping === Ci.UVMapping) {
  30414. if (e.multiply(this.repeat), e.add(this.offset), e.x < 0 || 1 < e.x) switch (this.wrapS) {
  30415. case Ci.RepeatWrapping:
  30416. e.x = e.x - Math.floor(e.x);
  30417. break;
  30418. case Ci.ClampToEdgeWrapping:
  30419. e.x = e.x < 0 ? 0 : 1;
  30420. break;
  30421. case Ci.MirroredRepeatWrapping:
  30422. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  30423. }
  30424. if (e.y < 0 || 1 < e.y) switch (this.wrapT) {
  30425. case Ci.RepeatWrapping:
  30426. e.y = e.y - Math.floor(e.y);
  30427. break;
  30428. case Ci.ClampToEdgeWrapping:
  30429. e.y = e.y < 0 ? 0 : 1;
  30430. break;
  30431. case Ci.MirroredRepeatWrapping:
  30432. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  30433. }
  30434. this.flipY && (e.y = 1 - e.y)
  30435. }
  30436. }
  30437. }, Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype), Ci.TextureIdCount = 0, Ci.CanvasTexture = function (e, t, i, n, r, o, a, s, l) {
  30438. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l), this.needsUpdate = !0
  30439. }, Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype), Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture, Ci.CubeTexture = function (e, t, i, n, r, o, a, s, l) {
  30440. e = void 0 !== e ? e : [], t = void 0 !== t ? t : Ci.CubeReflectionMapping, Ci.Texture.call(this, e, t, i, n, r, o, a, s, l), this.flipY = !1
  30441. }, Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype), Ci.CubeTexture.prototype.constructor = Ci.CubeTexture, Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  30442. get: function () {
  30443. return this.image
  30444. },
  30445. set: function (e) {
  30446. this.image = e
  30447. }
  30448. }), Ci.CompressedTexture = function (e, t, i, n, r, o, a, s, l, c, h) {
  30449. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h), this.image = {
  30450. width: t,
  30451. height: i
  30452. }, this.mipmaps = e, this.flipY = !1, this.generateMipmaps = !1
  30453. }, Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype), Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture, Ci.DataTexture = function (e, t, i, n, r, o, a, s, l, c, h) {
  30454. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h), this.image = {
  30455. data: e,
  30456. width: t,
  30457. height: i
  30458. }, this.magFilter = void 0 !== l ? l : Ci.NearestFilter, this.minFilter = void 0 !== c ? c : Ci.NearestFilter, this.flipY = !1, this.generateMipmaps = !1
  30459. }, Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype), Ci.DataTexture.prototype.constructor = Ci.DataTexture, Ci.VideoTexture = function (t, e, i, n, r, o, a, s, l) {
  30460. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l), this.generateMipmaps = !1;
  30461. var c = this;
  30462. ! function e() {
  30463. requestAnimationFrame(e), t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  30464. }()
  30465. }, Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype), Ci.VideoTexture.prototype.constructor = Ci.VideoTexture, Ci.Group = function () {
  30466. Ci.Object3D.call(this), this.type = "Group"
  30467. }, Ci.Group.prototype = Object.create(Ci.Object3D.prototype), Ci.Group.prototype.constructor = Ci.Group, Ci.Points = function (e, t) {
  30468. Ci.Object3D.call(this), this.type = "Points", this.geometry = void 0 !== e ? e : new Ci.Geometry, this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  30469. color: 16777215 * Math.random()
  30470. })
  30471. }, Ci.Points.prototype = Object.create(Ci.Object3D.prototype), Ci.Points.prototype.constructor = Ci.Points, Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4, jt = new Ci.Ray, Yt = new Ci.Sphere, function (o, a) {
  30472. function e(e, t) {
  30473. var i = jt.distanceSqToPoint(e);
  30474. if (i < c) {
  30475. var n = jt.closestPointToPoint(e);
  30476. n.applyMatrix4(l);
  30477. var r = o.ray.origin.distanceTo(n);
  30478. if (r < o.near || r > o.far) return;
  30479. a.push({
  30480. distance: r,
  30481. distanceToRay: Math.sqrt(i),
  30482. point: n.clone(),
  30483. index: t,
  30484. face: null,
  30485. object: s
  30486. })
  30487. }
  30488. }
  30489. var s = this,
  30490. t = this.geometry,
  30491. l = this.matrixWorld,
  30492. i = o.params.Points.threshold;
  30493. if (null === t.boundingSphere && t.computeBoundingSphere(), Yt.copy(t.boundingSphere), Yt.applyMatrix4(l), !1 !== o.ray.intersectsSphere(Yt)) {
  30494. Wt.getInverse(l), jt.copy(o.ray).applyMatrix4(Wt);
  30495. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  30496. c = n * n,
  30497. r = new Ci.Vector3;
  30498. if (t instanceof Ci.BufferGeometry) {
  30499. var h = t.index,
  30500. u = t.attributes.position.array;
  30501. if (null !== h)
  30502. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  30503. var g = d[p];
  30504. r.fromArray(u, 3 * g), e(r, g)
  30505. } else {
  30506. p = 0;
  30507. for (var m = u.length / 3; p < m; p++) r.fromArray(u, 3 * p), e(r, p)
  30508. }
  30509. } else {
  30510. var v = t.vertices;
  30511. for (p = 0, m = v.length; p < m; p++) e(v[p], p)
  30512. }
  30513. }
  30514. }), Ci.Points.prototype.clone = function () {
  30515. return new this.constructor(this.geometry, this.material).copy(this)
  30516. }, Ci.Line = function (e, t, i) {
  30517. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."), new Ci.LineSegments(e, t)) : (Ci.Object3D.call(this), this.type = "Line", this.geometry = void 0 !== e ? e : new Ci.Geometry, void(this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  30518. color: 16777215 * Math.random()
  30519. })))
  30520. }, Ci.Line.prototype = Object.create(Ci.Object3D.prototype), Ci.Line.prototype.constructor = Ci.Line, Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4, zt = new Ci.Ray, Gt = new Ci.Sphere, function (e, t) {
  30521. var i = e.linePrecision,
  30522. n = i * i,
  30523. r = this.geometry,
  30524. o = this.matrixWorld;
  30525. if (null === r.boundingSphere && r.computeBoundingSphere(), Gt.copy(r.boundingSphere), Gt.applyMatrix4(o), !1 !== e.ray.intersectsSphere(Gt)) {
  30526. Ht.getInverse(o), zt.copy(e.ray).applyMatrix4(Ht);
  30527. var a = new Ci.Vector3,
  30528. s = new Ci.Vector3,
  30529. l = new Ci.Vector3,
  30530. c = new Ci.Vector3,
  30531. h = this instanceof Ci.LineSegments ? 2 : 1;
  30532. if (r instanceof Ci.BufferGeometry) {
  30533. var u = r.index,
  30534. d = r.attributes.position.array;
  30535. if (null !== u)
  30536. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  30537. var m = p[f],
  30538. v = p[f + 1];
  30539. a.fromArray(d, 3 * m), s.fromArray(d, 3 * v), n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld), (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  30540. distance: C,
  30541. point: l.clone().applyMatrix4(this.matrixWorld),
  30542. index: f,
  30543. face: null,
  30544. faceIndex: null,
  30545. object: this
  30546. }))
  30547. } else
  30548. for (f = 0, g = d.length / 3 - 1; f < g; f += h) a.fromArray(d, 3 * f), s.fromArray(d, 3 * f + 3), n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld), (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  30549. distance: C,
  30550. point: l.clone().applyMatrix4(this.matrixWorld),
  30551. index: f,
  30552. face: null,
  30553. faceIndex: null,
  30554. object: this
  30555. }))
  30556. } else if (r instanceof Ci.Geometry) {
  30557. var y = r.vertices,
  30558. A = y.length;
  30559. for (f = 0; f < A - 1; f += h) {
  30560. var C;
  30561. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld), (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  30562. distance: C,
  30563. point: l.clone().applyMatrix4(this.matrixWorld),
  30564. index: f,
  30565. face: null,
  30566. faceIndex: null,
  30567. object: this
  30568. }))
  30569. }
  30570. }
  30571. }
  30572. }), Ci.Line.prototype.clone = function () {
  30573. return new this.constructor(this.geometry, this.material).copy(this)
  30574. }, Ci.LineStrip = 0, Ci.LinePieces = 1, Ci.LineSegments = function (e, t) {
  30575. Ci.Line.call(this, e, t), this.type = "LineSegments"
  30576. }, Ci.LineSegments.prototype = Object.create(Ci.Line.prototype), Ci.LineSegments.prototype.constructor = Ci.LineSegments, Ci.Mesh = function (e, t) {
  30577. Ci.Object3D.call(this), this.type = "Mesh", this.geometry = void 0 !== e ? e : new Ci.Geometry, this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  30578. color: 16777215 * Math.random()
  30579. }), this.drawMode = Ci.TrianglesDrawMode, this.updateMorphTargets()
  30580. }, Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype), Ci.Mesh.prototype.constructor = Ci.Mesh, Ci.Mesh.prototype.setDrawMode = function (e) {
  30581. this.drawMode = e
  30582. }, Ci.Mesh.prototype.updateMorphTargets = function () {
  30583. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  30584. this.morphTargetBase = -1, this.morphTargetInfluences = [], this.morphTargetDictionary = {};
  30585. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++) this.morphTargetInfluences.push(0), this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  30586. }
  30587. }, Ci.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  30588. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."), 0)
  30589. }, Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4, xt = new Ci.Ray, St = new Ci.Sphere, Mt = new Ci.Vector3, Rt = new Ci.Vector3, Pt = new Ci.Vector3, Ot = new Ci.Vector3, Lt = new Ci.Vector3, Dt = new Ci.Vector3, Nt = new Ci.Vector2, Ft = new Ci.Vector2, Bt = new Ci.Vector2, Vt = new Ci.Vector3, kt = new Ci.Vector3, Ut = new Ci.Vector3, function (e, t) {
  30590. var i, n, r = this.geometry,
  30591. o = this.material,
  30592. a = this.matrixWorld;
  30593. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(), St.copy(r.boundingSphere), St.applyMatrix4(a), !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a), xt.copy(e.ray).applyMatrix4(Tt), null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  30594. if (r instanceof Ci.BufferGeometry) {
  30595. var s, l, c, h = r.index,
  30596. u = r.attributes,
  30597. d = u.position.array;
  30598. if (void 0 !== u.uv && (i = u.uv.array), null !== h)
  30599. for (var p = h.array, f = 0, g = p.length; f < g; f += 3) s = p[f], l = p[f + 1], c = p[f + 2], (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3), t.push(n));
  30600. else
  30601. for (f = 0, g = d.length; f < g; f += 9)(n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s, t.push(n))
  30602. } else if (r instanceof Ci.Geometry) {
  30603. var m, v, y, A = o instanceof Ci.MultiMaterial,
  30604. C = 1 == A ? o.materials : null,
  30605. I = r.vertices,
  30606. E = r.faces,
  30607. _ = r.faceVertexUvs[0];
  30608. 0 < _.length && (i = _);
  30609. for (var b = 0, w = E.length; b < w; b++) {
  30610. var T = E[b],
  30611. x = 1 == A ? C[T.materialIndex] : o;
  30612. if (void 0 !== x) {
  30613. if (m = I[T.a], v = I[T.b], y = I[T.c], !0 === x.morphTargets) {
  30614. var S = r.morphTargets,
  30615. M = this.morphTargetInfluences;
  30616. Mt.set(0, 0, 0), Rt.set(0, 0, 0), Pt.set(0, 0, 0);
  30617. for (var R = 0, P = S.length; R < P; R++) {
  30618. var O = M[R];
  30619. if (0 !== O) {
  30620. var L = S[R].vertices;
  30621. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O), Rt.addScaledVector(Lt.subVectors(L[T.b], v), O), Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  30622. }
  30623. }
  30624. Mt.add(m), Rt.add(v), Pt.add(y), m = Mt, v = Rt, y = Pt
  30625. }
  30626. if (n = wi(this, e, xt, m, v, y, kt)) {
  30627. if (i) {
  30628. var D = i[b];
  30629. Nt.copy(D[0]), Ft.copy(D[1]), Bt.copy(D[2]), n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  30630. }
  30631. n.face = T, n.faceIndex = b, t.push(n)
  30632. }
  30633. }
  30634. }
  30635. }
  30636. }), Ci.Mesh.prototype.clone = function () {
  30637. return new this.constructor(this.geometry, this.material).copy(this)
  30638. }, Ci.Bone = function (e) {
  30639. Ci.Object3D.call(this), this.type = "Bone", this.skin = e
  30640. }, Ci.Bone.prototype = Object.create(Ci.Object3D.prototype), Ci.Bone.prototype.constructor = Ci.Bone, Ci.Bone.prototype.copy = function (e) {
  30641. return Ci.Object3D.prototype.copy.call(this, e), this.skin = e.skin, this
  30642. }, Ci.Skeleton = function (e, t, i) {
  30643. if (this.useVertexTexture = void 0 === i || i, this.identityMatrix = new Ci.Matrix4, e = e || [], this.bones = e.slice(0), this.useVertexTexture) {
  30644. var n = Math.sqrt(4 * this.bones.length);
  30645. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)), n = Math.max(n, 4), this.boneTextureWidth = n, this.boneTextureHeight = n, this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4), this.boneTexture = new Ci.DataTexture(this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, Ci.RGBAFormat, Ci.FloatType)
  30646. } else this.boneMatrices = new Float32Array(16 * this.bones.length);
  30647. if (void 0 === t) this.calculateInverses();
  30648. else if (this.bones.length === t.length) this.boneInverses = t.slice(0);
  30649. else {
  30650. console.warn("THREE.Skeleton bonInverses is the wrong length."), this.boneInverses = [];
  30651. for (var r = 0, o = this.bones.length; r < o; r++) this.boneInverses.push(new Ci.Matrix4)
  30652. }
  30653. }, Ci.Skeleton.prototype.calculateInverses = function () {
  30654. this.boneInverses = [];
  30655. for (var e = 0, t = this.bones.length; e < t; e++) {
  30656. var i = new Ci.Matrix4;
  30657. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i)
  30658. }
  30659. }, Ci.Skeleton.prototype.pose = function () {
  30660. for (var e, t = 0, i = this.bones.length; t < i; t++)(e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  30661. for (t = 0, i = this.bones.length; t < i; t++)(e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld), e.matrix.decompose(e.position, e.quaternion, e.scale))
  30662. }, Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4, function () {
  30663. for (var e = 0, t = this.bones.length; e < t; e++) {
  30664. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  30665. wt.multiplyMatrices(i, this.boneInverses[e]), wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  30666. }
  30667. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  30668. }), Ci.Skeleton.prototype.clone = function () {
  30669. return new Ci.Skeleton(this.bones, this.boneInverses, this.useVertexTexture)
  30670. }, Ci.SkinnedMesh = function (e, t, i) {
  30671. Ci.Mesh.call(this, e, t), this.type = "SkinnedMesh", this.bindMode = "attached", this.bindMatrix = new Ci.Matrix4, this.bindMatrixInverse = new Ci.Matrix4;
  30672. var n = [];
  30673. if (this.geometry && void 0 !== this.geometry.bones) {
  30674. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a) o = this.geometry.bones[a], r = new Ci.Bone(this), n.push(r), r.name = o.name, r.position.fromArray(o.pos), r.quaternion.fromArray(o.rotq), void 0 !== o.scl && r.scale.fromArray(o.scl);
  30675. for (a = 0, s = this.geometry.bones.length; a < s; ++a) - 1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  30676. }
  30677. this.normalizeSkinWeights(), this.updateMatrixWorld(!0), this.bind(new Ci.Skeleton(n, void 0, i), this.matrixWorld)
  30678. }, Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype), Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh, Ci.SkinnedMesh.prototype.bind = function (e, t) {
  30679. this.skeleton = e, void 0 === t && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), t = this.matrixWorld), this.bindMatrix.copy(t), this.bindMatrixInverse.getInverse(t)
  30680. }, Ci.SkinnedMesh.prototype.pose = function () {
  30681. this.skeleton.pose()
  30682. }, Ci.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  30683. if (this.geometry instanceof Ci.Geometry)
  30684. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  30685. var t = this.geometry.skinWeights[e];
  30686. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  30687. } else if (this.geometry instanceof Ci.BufferGeometry) {
  30688. var i = new Ci.Vector4,
  30689. n = this.geometry.attributes.skinWeight;
  30690. for (e = 0; e < n.count; e++) {
  30691. var r;
  30692. i.x = n.getX(e), i.y = n.getY(e), i.z = n.getZ(e), i.w = n.getW(e), (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0), n.setXYZW(e, i.x, i.y, i.z, i.w)
  30693. }
  30694. }
  30695. }, Ci.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  30696. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0), "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  30697. }, Ci.SkinnedMesh.prototype.clone = function () {
  30698. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(this)
  30699. }, Ci.LOD = function () {
  30700. Ci.Object3D.call(this), this.type = "LOD", Object.defineProperties(this, {
  30701. levels: {
  30702. enumerable: !0,
  30703. value: []
  30704. },
  30705. objects: {
  30706. get: function () {
  30707. return console.warn("THREE.LOD: .objects has been renamed to .levels."), this.levels
  30708. }
  30709. }
  30710. })
  30711. }, Ci.LOD.prototype = Object.create(Ci.Object3D.prototype), Ci.LOD.prototype.constructor = Ci.LOD, Ci.LOD.prototype.addLevel = function (e, t) {
  30712. void 0 === t && (t = 0), t = Math.abs(t);
  30713. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  30714. i.splice(n, 0, {
  30715. distance: t,
  30716. object: e
  30717. }), this.add(e)
  30718. }, Ci.LOD.prototype.getObjectForDistance = function (e) {
  30719. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  30720. return t[i - 1].object
  30721. }, Ci.LOD.prototype.raycast = (bt = new Ci.Vector3, function (e, t) {
  30722. bt.setFromMatrixPosition(this.matrixWorld);
  30723. var i = e.ray.origin.distanceTo(bt);
  30724. this.getObjectForDistance(i).raycast(e, t)
  30725. }), Ci.LOD.prototype.update = (Et = new Ci.Vector3, _t = new Ci.Vector3, function (e) {
  30726. var t = this.levels;
  30727. if (1 < t.length) {
  30728. Et.setFromMatrixPosition(e.matrixWorld), _t.setFromMatrixPosition(this.matrixWorld);
  30729. var i = Et.distanceTo(_t);
  30730. t[0].object.visible = !0;
  30731. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++) t[n - 1].object.visible = !1, t[n].object.visible = !0;
  30732. for (; n < r; n++) t[n].object.visible = !1
  30733. }
  30734. }), Ci.LOD.prototype.copy = function (e) {
  30735. Ci.Object3D.prototype.copy.call(this, e, !1);
  30736. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  30737. var r = t[i];
  30738. this.addLevel(r.object.clone(), r.distance)
  30739. }
  30740. return this
  30741. }, Ci.LOD.prototype.toJSON = function (e) {
  30742. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  30743. t.object.levels = [];
  30744. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  30745. var o = i[n];
  30746. t.object.levels.push({
  30747. object: o.object.uuid,
  30748. distance: o.distance
  30749. })
  30750. }
  30751. return t
  30752. }, Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]), At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]), Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt, 1)), It.addAttribute("position", new Ci.BufferAttribute(At, 3)), It.addAttribute("uv", new Ci.BufferAttribute(Ct, 2)), function (e) {
  30753. Ci.Object3D.call(this), this.type = "Sprite", this.geometry = It, this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  30754. }), Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype), Ci.Sprite.prototype.constructor = Ci.Sprite, Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3, function (e, t) {
  30755. vt.setFromMatrixPosition(this.matrixWorld);
  30756. var i = e.ray.distanceSqToPoint(vt);
  30757. this.scale.x * this.scale.y < i || t.push({
  30758. distance: Math.sqrt(i),
  30759. point: this.position,
  30760. face: null,
  30761. object: this
  30762. })
  30763. }), Ci.Sprite.prototype.clone = function () {
  30764. return new this.constructor(this.material).copy(this)
  30765. }, Ci.Particle = Ci.Sprite, Ci.LensFlare = function (e, t, i, n, r) {
  30766. Ci.Object3D.call(this), this.lensFlares = [], this.positionScreen = new Ci.Vector3, (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  30767. }, Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype), Ci.LensFlare.prototype.constructor = Ci.LensFlare, Ci.LensFlare.prototype.add = function (e, t, i, n, r, o) {
  30768. void 0 === t && (t = -1), void 0 === i && (i = 0), void 0 === o && (o = 1), void 0 === r && (r = new Ci.Color(16777215)), void 0 === n && (n = Ci.NormalBlending), i = Math.min(i, Math.max(0, i)), this.lensFlares.push({
  30769. texture: e,
  30770. size: t,
  30771. distance: i,
  30772. x: 0,
  30773. y: 0,
  30774. z: 0,
  30775. scale: 1,
  30776. rotation: 0,
  30777. opacity: o,
  30778. color: r,
  30779. blending: n
  30780. })
  30781. }, Ci.LensFlare.prototype.updateLensFlares = function () {
  30782. var e, t, i = this.lensFlares.length,
  30783. n = 2 * -this.positionScreen.x,
  30784. r = 2 * -this.positionScreen.y;
  30785. for (e = 0; e < i; e++)(t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance, t.y = this.positionScreen.y + r * t.distance, t.wantedRotation = t.x * Math.PI * .25, t.rotation += .25 * (t.wantedRotation - t.rotation)
  30786. }, Ci.LensFlare.prototype.copy = function (e) {
  30787. Ci.Object3D.prototype.copy.call(this, e), this.positionScreen.copy(e.positionScreen), this.customUpdateCallback = e.customUpdateCallback;
  30788. for (var t = 0, i = e.lensFlares.length; t < i; t++) this.lensFlares.push(e.lensFlares[t]);
  30789. return this
  30790. }, Ci.Scene = function () {
  30791. Ci.Object3D.call(this), this.type = "Scene", this.fog = null, this.overrideMaterial = null, this.autoUpdate = !0
  30792. }, Ci.Scene.prototype = Object.create(Ci.Object3D.prototype), Ci.Scene.prototype.constructor = Ci.Scene, Ci.Scene.prototype.copy = function (e, t) {
  30793. return Ci.Object3D.prototype.copy.call(this, e, t), null !== e.fog && (this.fog = e.fog.clone()), null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()), this.autoUpdate = e.autoUpdate, this.matrixAutoUpdate = e.matrixAutoUpdate, this
  30794. }, Ci.Fog = function (e, t, i) {
  30795. this.name = "", this.color = new Ci.Color(e), this.near = void 0 !== t ? t : 1, this.far = void 0 !== i ? i : 1e3
  30796. }, Ci.Fog.prototype.clone = function () {
  30797. return new Ci.Fog(this.color.getHex(), this.near, this.far)
  30798. }, Ci.FogExp2 = function (e, t) {
  30799. this.name = "", this.color = new Ci.Color(e), this.density = void 0 !== t ? t : 25e-5
  30800. }, Ci.FogExp2.prototype.clone = function () {
  30801. return new Ci.FogExp2(this.color.getHex(), this.density)
  30802. }, Ci.ShaderChunk = {}, Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n", Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n", Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n", Ci.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n", Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif", Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n", Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n", Ci.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n", Ci.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n", Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif", Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n", Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif", Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif", Ci.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n", Ci.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n", Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n", Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n", Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n", Ci.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n", Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n", Ci.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n", Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n", Ci.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n", Ci.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n", Ci.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n", Ci.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n", Ci.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n", Ci.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif", Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n", Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif", Ci.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n", Ci.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n", Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n", Ci.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n", Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n", Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n", Ci.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n", Ci.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n", Ci.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n", Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif", Ci.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n", Ci.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif", Ci.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n", Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n", Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n", Ci.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n", Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n", Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n", Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif", Ci.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n", Ci.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif", Ci.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n", Ci.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n", Ci.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n", Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n", Ci.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n", Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n", Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif", Ci.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n", Ci.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n", Ci.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n", Ci.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n", Ci.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif", Ci.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n", Ci.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n", Ci.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n", Ci.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif", Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif", Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n", Ci.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n", Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif", Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif", Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif", Ci.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif", Ci.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n", Ci.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif", Ci.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n", Ci.UniformsUtils = {
  30803. merge: function (e) {
  30804. for (var t = {}, i = 0; i < e.length; i++) {
  30805. var n = this.clone(e[i]);
  30806. for (var r in n) t[r] = n[r]
  30807. }
  30808. return t
  30809. },
  30810. clone: function (e) {
  30811. var t = {};
  30812. for (var i in e)
  30813. for (var n in t[i] = {}, e[i]) {
  30814. var r = e[i][n];
  30815. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  30816. }
  30817. return t
  30818. }
  30819. }, Ci.UniformsLib = {
  30820. common: {
  30821. diffuse: {
  30822. type: "c",
  30823. value: new Ci.Color(15658734)
  30824. },
  30825. opacity: {
  30826. type: "f",
  30827. value: 1
  30828. },
  30829. map: {
  30830. type: "t",
  30831. value: null
  30832. },
  30833. offsetRepeat: {
  30834. type: "v4",
  30835. value: new Ci.Vector4(0, 0, 1, 1)
  30836. },
  30837. specularMap: {
  30838. type: "t",
  30839. value: null
  30840. },
  30841. alphaMap: {
  30842. type: "t",
  30843. value: null
  30844. },
  30845. envMap: {
  30846. type: "t",
  30847. value: null
  30848. },
  30849. flipEnvMap: {
  30850. type: "f",
  30851. value: -1
  30852. },
  30853. reflectivity: {
  30854. type: "f",
  30855. value: 1
  30856. },
  30857. refractionRatio: {
  30858. type: "f",
  30859. value: .98
  30860. }
  30861. },
  30862. aomap: {
  30863. aoMap: {
  30864. type: "t",
  30865. value: null
  30866. },
  30867. aoMapIntensity: {
  30868. type: "f",
  30869. value: 1
  30870. }
  30871. },
  30872. lightmap: {
  30873. lightMap: {
  30874. type: "t",
  30875. value: null
  30876. },
  30877. lightMapIntensity: {
  30878. type: "f",
  30879. value: 1
  30880. }
  30881. },
  30882. emissivemap: {
  30883. emissiveMap: {
  30884. type: "t",
  30885. value: null
  30886. }
  30887. },
  30888. bumpmap: {
  30889. bumpMap: {
  30890. type: "t",
  30891. value: null
  30892. },
  30893. bumpScale: {
  30894. type: "f",
  30895. value: 1
  30896. }
  30897. },
  30898. normalmap: {
  30899. normalMap: {
  30900. type: "t",
  30901. value: null
  30902. },
  30903. normalScale: {
  30904. type: "v2",
  30905. value: new Ci.Vector2(1, 1)
  30906. }
  30907. },
  30908. displacementmap: {
  30909. displacementMap: {
  30910. type: "t",
  30911. value: null
  30912. },
  30913. displacementScale: {
  30914. type: "f",
  30915. value: 1
  30916. },
  30917. displacementBias: {
  30918. type: "f",
  30919. value: 0
  30920. }
  30921. },
  30922. roughnessmap: {
  30923. roughnessMap: {
  30924. type: "t",
  30925. value: null
  30926. }
  30927. },
  30928. metalnessmap: {
  30929. metalnessMap: {
  30930. type: "t",
  30931. value: null
  30932. }
  30933. },
  30934. fog: {
  30935. fogDensity: {
  30936. type: "f",
  30937. value: 25e-5
  30938. },
  30939. fogNear: {
  30940. type: "f",
  30941. value: 1
  30942. },
  30943. fogFar: {
  30944. type: "f",
  30945. value: 2e3
  30946. },
  30947. fogColor: {
  30948. type: "c",
  30949. value: new Ci.Color(16777215)
  30950. }
  30951. },
  30952. lights: {
  30953. ambientLightColor: {
  30954. type: "fv",
  30955. value: []
  30956. },
  30957. directionalLights: {
  30958. type: "sa",
  30959. value: [],
  30960. properties: {
  30961. direction: {
  30962. type: "v3"
  30963. },
  30964. color: {
  30965. type: "c"
  30966. },
  30967. shadow: {
  30968. type: "i"
  30969. },
  30970. shadowBias: {
  30971. type: "f"
  30972. },
  30973. shadowRadius: {
  30974. type: "f"
  30975. },
  30976. shadowMapSize: {
  30977. type: "v2"
  30978. }
  30979. }
  30980. },
  30981. directionalShadowMap: {
  30982. type: "tv",
  30983. value: []
  30984. },
  30985. directionalShadowMatrix: {
  30986. type: "m4v",
  30987. value: []
  30988. },
  30989. spotLights: {
  30990. type: "sa",
  30991. value: [],
  30992. properties: {
  30993. color: {
  30994. type: "c"
  30995. },
  30996. position: {
  30997. type: "v3"
  30998. },
  30999. direction: {
  31000. type: "v3"
  31001. },
  31002. distance: {
  31003. type: "f"
  31004. },
  31005. coneCos: {
  31006. type: "f"
  31007. },
  31008. penumbraCos: {
  31009. type: "f"
  31010. },
  31011. decay: {
  31012. type: "f"
  31013. },
  31014. shadow: {
  31015. type: "i"
  31016. },
  31017. shadowBias: {
  31018. type: "f"
  31019. },
  31020. shadowRadius: {
  31021. type: "f"
  31022. },
  31023. shadowMapSize: {
  31024. type: "v2"
  31025. }
  31026. }
  31027. },
  31028. spotShadowMap: {
  31029. type: "tv",
  31030. value: []
  31031. },
  31032. spotShadowMatrix: {
  31033. type: "m4v",
  31034. value: []
  31035. },
  31036. pointLights: {
  31037. type: "sa",
  31038. value: [],
  31039. properties: {
  31040. color: {
  31041. type: "c"
  31042. },
  31043. position: {
  31044. type: "v3"
  31045. },
  31046. decay: {
  31047. type: "f"
  31048. },
  31049. distance: {
  31050. type: "f"
  31051. },
  31052. shadow: {
  31053. type: "i"
  31054. },
  31055. shadowBias: {
  31056. type: "f"
  31057. },
  31058. shadowRadius: {
  31059. type: "f"
  31060. },
  31061. shadowMapSize: {
  31062. type: "v2"
  31063. }
  31064. }
  31065. },
  31066. pointShadowMap: {
  31067. type: "tv",
  31068. value: []
  31069. },
  31070. pointShadowMatrix: {
  31071. type: "m4v",
  31072. value: []
  31073. },
  31074. hemisphereLights: {
  31075. type: "sa",
  31076. value: [],
  31077. properties: {
  31078. direction: {
  31079. type: "v3"
  31080. },
  31081. skyColor: {
  31082. type: "c"
  31083. },
  31084. groundColor: {
  31085. type: "c"
  31086. }
  31087. }
  31088. }
  31089. },
  31090. points: {
  31091. diffuse: {
  31092. type: "c",
  31093. value: new Ci.Color(15658734)
  31094. },
  31095. opacity: {
  31096. type: "f",
  31097. value: 1
  31098. },
  31099. size: {
  31100. type: "f",
  31101. value: 1
  31102. },
  31103. scale: {
  31104. type: "f",
  31105. value: 1
  31106. },
  31107. map: {
  31108. type: "t",
  31109. value: null
  31110. },
  31111. offsetRepeat: {
  31112. type: "v4",
  31113. value: new Ci.Vector4(0, 0, 1, 1)
  31114. }
  31115. }
  31116. }, Ci.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n", Ci.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n", Ci.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n", Ci.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n", Ci.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n", Ci.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n", Ci.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n", Ci.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n", Ci.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n", Ci.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n", Ci.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n", Ci.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n", Ci.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n", Ci.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n", Ci.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n", Ci.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n", Ci.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n", Ci.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n", Ci.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n", Ci.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n", Ci.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n", Ci.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n", Ci.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n", Ci.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n", Ci.ShaderLib = {
  31117. basic: {
  31118. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  31119. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  31120. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  31121. },
  31122. lambert: {
  31123. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  31124. emissive: {
  31125. type: "c",
  31126. value: new Ci.Color(0)
  31127. }
  31128. }]),
  31129. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  31130. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  31131. },
  31132. phong: {
  31133. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  31134. emissive: {
  31135. type: "c",
  31136. value: new Ci.Color(0)
  31137. },
  31138. specular: {
  31139. type: "c",
  31140. value: new Ci.Color(1118481)
  31141. },
  31142. shininess: {
  31143. type: "f",
  31144. value: 30
  31145. }
  31146. }]),
  31147. vertexShader: Ci.ShaderChunk.meshphong_vert,
  31148. fragmentShader: Ci.ShaderChunk.meshphong_frag
  31149. },
  31150. standard: {
  31151. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  31152. emissive: {
  31153. type: "c",
  31154. value: new Ci.Color(0)
  31155. },
  31156. roughness: {
  31157. type: "f",
  31158. value: .5
  31159. },
  31160. metalness: {
  31161. type: "f",
  31162. value: 0
  31163. },
  31164. envMapIntensity: {
  31165. type: "f",
  31166. value: 1
  31167. }
  31168. }]),
  31169. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  31170. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  31171. },
  31172. points: {
  31173. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  31174. vertexShader: Ci.ShaderChunk.points_vert,
  31175. fragmentShader: Ci.ShaderChunk.points_frag
  31176. },
  31177. dashed: {
  31178. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  31179. scale: {
  31180. type: "f",
  31181. value: 1
  31182. },
  31183. dashSize: {
  31184. type: "f",
  31185. value: 1
  31186. },
  31187. totalSize: {
  31188. type: "f",
  31189. value: 2
  31190. }
  31191. }]),
  31192. vertexShader: Ci.ShaderChunk.linedashed_vert,
  31193. fragmentShader: Ci.ShaderChunk.linedashed_frag
  31194. },
  31195. depth: {
  31196. uniforms: {
  31197. mNear: {
  31198. type: "f",
  31199. value: 1
  31200. },
  31201. mFar: {
  31202. type: "f",
  31203. value: 2e3
  31204. },
  31205. opacity: {
  31206. type: "f",
  31207. value: 1
  31208. }
  31209. },
  31210. vertexShader: Ci.ShaderChunk.depth_vert,
  31211. fragmentShader: Ci.ShaderChunk.depth_frag
  31212. },
  31213. normal: {
  31214. uniforms: {
  31215. opacity: {
  31216. type: "f",
  31217. value: 1
  31218. }
  31219. },
  31220. vertexShader: Ci.ShaderChunk.normal_vert,
  31221. fragmentShader: Ci.ShaderChunk.normal_frag
  31222. },
  31223. cube: {
  31224. uniforms: {
  31225. tCube: {
  31226. type: "t",
  31227. value: null
  31228. },
  31229. tFlip: {
  31230. type: "f",
  31231. value: -1
  31232. }
  31233. },
  31234. vertexShader: Ci.ShaderChunk.cube_vert,
  31235. fragmentShader: Ci.ShaderChunk.cube_frag
  31236. },
  31237. equirect: {
  31238. uniforms: {
  31239. tEquirect: {
  31240. type: "t",
  31241. value: null
  31242. },
  31243. tFlip: {
  31244. type: "f",
  31245. value: -1
  31246. }
  31247. },
  31248. vertexShader: Ci.ShaderChunk.equirect_vert,
  31249. fragmentShader: Ci.ShaderChunk.equirect_frag
  31250. },
  31251. depthRGBA: {
  31252. uniforms: {},
  31253. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  31254. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  31255. },
  31256. distanceRGBA: {
  31257. uniforms: {
  31258. lightPos: {
  31259. type: "v3",
  31260. value: new Ci.Vector3(0, 0, 0)
  31261. }
  31262. },
  31263. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  31264. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  31265. }
  31266. }, Ci.WebGLRenderer = function (e) {
  31267. function S() {
  31268. return null === Q ? he : 1
  31269. }
  31270. function i(e, t, i, n) {
  31271. !0 === V && (e *= n, t *= n, i *= n), _e.clearColor(e, t, i, n)
  31272. }
  31273. function t() {
  31274. _e.init(), _e.scissor(ie.copy(ue).multiplyScalar(he)), _e.viewport(re.copy(pe).multiplyScalar(he)), i(ae.r, ae.g, ae.b, se)
  31275. }
  31276. function n() {
  31277. te = K = null, ee = "", $ = -1, _e.reset()
  31278. }
  31279. function r(e) {
  31280. e.preventDefault(), n(), t(), be.clear()
  31281. }
  31282. function f(e) {
  31283. var t = e.target;
  31284. t.removeEventListener("dispose", f),
  31285. function (e) {
  31286. var t = be.get(e);
  31287. if (e.image && t.__image__webglTextureCube) X.deleteTexture(t.__image__webglTextureCube);
  31288. else {
  31289. if (void 0 === t.__webglInit) return;
  31290. X.deleteTexture(t.__webglTexture)
  31291. }
  31292. be.delete(e)
  31293. }(t), ye.textures--
  31294. }
  31295. function a(e) {
  31296. var t = e.target;
  31297. t.removeEventListener("dispose", a),
  31298. function (e) {
  31299. var t = be.get(e),
  31300. i = be.get(e.texture);
  31301. if (e && void 0 !== i.__webglTexture) {
  31302. if (X.deleteTexture(i.__webglTexture), e instanceof Ci.WebGLRenderTargetCube)
  31303. for (var n = 0; n < 6; n++) X.deleteFramebuffer(t.__webglFramebuffer[n]), X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  31304. else X.deleteFramebuffer(t.__webglFramebuffer), X.deleteRenderbuffer(t.__webglDepthbuffer);
  31305. be.delete(e.texture), be.delete(e)
  31306. }
  31307. }(t), ye.textures--
  31308. }
  31309. function v(e) {
  31310. var t = e.target;
  31311. t.removeEventListener("dispose", v),
  31312. function (e) {
  31313. y(e), be.delete(e)
  31314. }(t)
  31315. }
  31316. function y(e) {
  31317. var t = be.get(e).program;
  31318. (e.program = void 0) !== t && Te.releaseProgram(t)
  31319. }
  31320. function M(e, t) {
  31321. return Math.abs(t[0]) - Math.abs(e[0])
  31322. }
  31323. function s(e, t) {
  31324. 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
  31325. }
  31326. function l(e, t) {
  31327. 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
  31328. }
  31329. function d(e, t, i, n, r) {
  31330. var o, a;
  31331. a = i.transparent ? (o = G, ++W) : (o = H, ++z);
  31332. var s = o[a];
  31333. void 0 !== s ? (s.id = e.id, s.object = e, s.geometry = t, s.material = i, s.z = me.z, s.group = r) : (s = {
  31334. id: e.id,
  31335. object: e,
  31336. geometry: t,
  31337. material: i,
  31338. z: me.z,
  31339. group: r
  31340. }, o.push(s))
  31341. }
  31342. function c(e, t, i, n) {
  31343. for (var r = 0, o = e.length; r < o; r++) {
  31344. var a = e[r],
  31345. s = a.object,
  31346. l = a.geometry,
  31347. c = void 0 === n ? a.material : n,
  31348. h = a.group;
  31349. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld), s.normalMatrix.getNormalMatrix(s.modelViewMatrix), s instanceof Ci.ImmediateRenderObject) {
  31350. R(c);
  31351. var u = P(t, i, c, s);
  31352. ee = "", s.render(function (e) {
  31353. Z.renderBufferImmediate(e, u, c)
  31354. })
  31355. } else Z.renderBufferDirect(t, i, l, c, s, h)
  31356. }
  31357. }
  31358. function R(e) {
  31359. (function (e) {
  31360. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE), _e.setFlipSided(e.side === Ci.BackSide)
  31361. })(e), !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending), _e.setDepthFunc(e.depthFunc), _e.setDepthTest(e.depthTest), _e.setDepthWrite(e.depthWrite), _e.setColorWrite(e.colorWrite), _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  31362. }
  31363. function P(e, t, i, n) {
  31364. oe = 0;
  31365. var r = be.get(i);
  31366. void 0 === r.program && (i.needsUpdate = !0), void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0), i.needsUpdate && (function (e, t, i) {
  31367. var n = be.get(e),
  31368. r = Te.getParameters(e, ve, t, i),
  31369. o = Te.getProgramCode(e, r),
  31370. a = n.program,
  31371. s = !0;
  31372. if (void 0 === a) e.addEventListener("dispose", v);
  31373. else if (a.code !== o) y(e);
  31374. else {
  31375. if (void 0 !== r.shaderID) return;
  31376. s = !1
  31377. }
  31378. if (s) {
  31379. if (r.shaderID) {
  31380. var l = Ci.ShaderLib[r.shaderID];
  31381. n.__webglShader = {
  31382. name: e.type,
  31383. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  31384. vertexShader: l.vertexShader,
  31385. fragmentShader: l.fragmentShader
  31386. }
  31387. } else n.__webglShader = {
  31388. name: e.type,
  31389. uniforms: e.uniforms,
  31390. vertexShader: e.vertexShader,
  31391. fragmentShader: e.fragmentShader
  31392. };
  31393. e.__webglShader = n.__webglShader, a = Te.acquireProgram(e, r, o), n.program = a, e.program = a
  31394. }
  31395. var c = a.getAttributes();
  31396. if (e.morphTargets)
  31397. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++) 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  31398. if (e.morphNormals)
  31399. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++) 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  31400. n.uniformsList = [];
  31401. var u = n.__webglShader.uniforms,
  31402. d = n.program.getUniforms();
  31403. for (var p in u) {
  31404. var f = d[p];
  31405. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  31406. }(e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash, u.ambientLightColor.value = ve.ambient, u.directionalLights.value = ve.directional, u.spotLights.value = ve.spot, u.pointLights.value = ve.point, u.hemisphereLights.value = ve.hemi, u.directionalShadowMap.value = ve.directionalShadowMap, u.directionalShadowMatrix.value = ve.directionalShadowMatrix, u.spotShadowMap.value = ve.spotShadowMap, u.spotShadowMatrix.value = ve.spotShadowMatrix, u.pointShadowMap.value = ve.pointShadowMap, u.pointShadowMatrix.value = ve.pointShadowMatrix), n.hasDynamicUniforms = !1;
  31407. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  31408. if (!0 === n.uniformsList[g][0].dynamic) {
  31409. n.hasDynamicUniforms = !0;
  31410. break
  31411. }
  31412. }
  31413. }(i, t, n), i.needsUpdate = !1);
  31414. var o = !1,
  31415. a = !1,
  31416. s = !1,
  31417. l = r.program,
  31418. c = l.getUniforms(),
  31419. h = r.__webglShader.uniforms;
  31420. if (l.id !== K && (X.useProgram(l.program), K = l.id, s = a = o = !0), i.id !== $ && ($ = i.id, a = !0), !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements), Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)), e !== te && (te = e, s = a = !0), (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld), X.uniform3f(c.cameraPosition, me.x, me.y, me.z)), (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements), void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure), void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)), i.skinning)
  31421. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements), n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements), Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  31422. if (void 0 !== c.boneTexture) {
  31423. var u = A();
  31424. X.uniform1i(c.boneTexture, u), Z.setTexture(n.skeleton.boneTexture, u)
  31425. }
  31426. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth), void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  31427. } else n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  31428. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function (e, t) {
  31429. e.ambientLightColor.needsUpdate = t, e.directionalLights.needsUpdate = t, e.pointLights.needsUpdate = t, e.spotLights.needsUpdate = t, e.hemisphereLights.needsUpdate = t
  31430. }(h, s), t && i.fog && function (e, t) {
  31431. e.fogColor.value = t.color, t instanceof Ci.Fog ? (e.fogNear.value = t.near, e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  31432. }(h, t), (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function (e, t) {
  31433. var i;
  31434. if (e.opacity.value = t.opacity, e.diffuse.value = t.color, t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity), e.map.value = t.map, e.specularMap.value = t.specularMap, e.alphaMap.value = t.alphaMap, t.aoMap && (e.aoMap.value = t.aoMap, e.aoMapIntensity.value = t.aoMapIntensity), 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), void 0 !== i) {
  31435. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  31436. var n = i.offset,
  31437. r = i.repeat;
  31438. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  31439. }
  31440. e.envMap.value = t.envMap, e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1, e.reflectivity.value = t.reflectivity, e.refractionRatio.value = t.refractionRatio
  31441. }(h, i), i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i), function (e, t) {
  31442. e.dashSize.value = t.dashSize, e.totalSize.value = t.dashSize + t.gapSize, e.scale.value = t.scale
  31443. }(h, i)) : i instanceof Ci.PointsMaterial ? function (e, t) {
  31444. if (e.diffuse.value = t.color, e.opacity.value = t.opacity, e.size.value = t.size * he, e.scale.value = O.clientHeight / 2, e.map.value = t.map, null !== t.map) {
  31445. var i = t.map.offset,
  31446. n = t.map.repeat;
  31447. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  31448. }
  31449. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function (e, t) {
  31450. t.lightMap && (e.lightMap.value = t.lightMap, e.lightMapIntensity.value = t.lightMapIntensity), t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  31451. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function (e, t) {
  31452. e.specular.value = t.specular, e.shininess.value = Math.max(t.shininess, 1e-4), t.lightMap && (e.lightMap.value = t.lightMap, e.lightMapIntensity.value = t.lightMapIntensity), t.emissiveMap && (e.emissiveMap.value = t.emissiveMap), t.bumpMap && (e.bumpMap.value = t.bumpMap, e.bumpScale.value = t.bumpScale), t.normalMap && (e.normalMap.value = t.normalMap, e.normalScale.value.copy(t.normalScale)), t.displacementMap && (e.displacementMap.value = t.displacementMap, e.displacementScale.value = t.displacementScale, e.displacementBias.value = t.displacementBias)
  31453. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function (e, t) {
  31454. e.roughness.value = t.roughness, e.metalness.value = t.metalness, t.roughnessMap && (e.roughnessMap.value = t.roughnessMap), t.metalnessMap && (e.metalnessMap.value = t.metalnessMap), t.lightMap && (e.lightMap.value = t.lightMap, e.lightMapIntensity.value = t.lightMapIntensity), t.emissiveMap && (e.emissiveMap.value = t.emissiveMap), t.bumpMap && (e.bumpMap.value = t.bumpMap, e.bumpScale.value = t.bumpScale), t.normalMap && (e.normalMap.value = t.normalMap, e.normalScale.value.copy(t.normalScale)), t.displacementMap && (e.displacementMap.value = t.displacementMap, e.displacementScale.value = t.displacementScale, e.displacementBias.value = t.displacementBias), t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  31455. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near, h.mFar.value = e.far, h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity), g(r.uniformsList)),
  31456. function (e, t) {
  31457. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements), e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  31458. }(c, n), void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements), !0 === r.hasDynamicUniforms && function (e, t, i) {
  31459. for (var n = [], r = 0, o = e.length; r < o; r++) {
  31460. var a = e[r][0],
  31461. s = a.onUpdateCallback;
  31462. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]))
  31463. }
  31464. g(n)
  31465. }(r.uniformsList, n, e), l
  31466. }
  31467. function p(e, t) {
  31468. e.diffuse.value = t.color, e.opacity.value = t.opacity
  31469. }
  31470. function A() {
  31471. var e = oe;
  31472. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures), oe += 1, e
  31473. }
  31474. function C(e, t, i, n) {
  31475. var r, o;
  31476. if ("1i" === t) X.uniform1i(i, n);
  31477. else if ("1f" === t) X.uniform1f(i, n);
  31478. else if ("2f" === t) X.uniform2f(i, n[0], n[1]);
  31479. else if ("3f" === t) X.uniform3f(i, n[0], n[1], n[2]);
  31480. else if ("4f" === t) X.uniform4f(i, n[0], n[1], n[2], n[3]);
  31481. else if ("1iv" === t) X.uniform1iv(i, n);
  31482. else if ("3iv" === t) X.uniform3iv(i, n);
  31483. else if ("1fv" === t) X.uniform1fv(i, n);
  31484. else if ("2fv" === t) X.uniform2fv(i, n);
  31485. else if ("3fv" === t) X.uniform3fv(i, n);
  31486. else if ("4fv" === t) X.uniform4fv(i, n);
  31487. else if ("Matrix2fv" === t) X.uniformMatrix2fv(i, !1, n);
  31488. else if ("Matrix3fv" === t) X.uniformMatrix3fv(i, !1, n);
  31489. else if ("Matrix4fv" === t) X.uniformMatrix4fv(i, !1, n);
  31490. else if ("i" === t) X.uniform1i(i, n);
  31491. else if ("f" === t) X.uniform1f(i, n);
  31492. else if ("v2" === t) X.uniform2f(i, n.x, n.y);
  31493. else if ("v3" === t) X.uniform3f(i, n.x, n.y, n.z);
  31494. else if ("v4" === t) X.uniform4f(i, n.x, n.y, n.z, n.w);
  31495. else if ("c" === t) X.uniform3f(i, n.r, n.g, n.b);
  31496. else if ("s" === t) {
  31497. var a = e.properties;
  31498. for (var s in a) {
  31499. var l = a[s],
  31500. c = i[s],
  31501. h = n[s];
  31502. C(l, l.type, c, h)
  31503. }
  31504. } else if ("sa" === t) {
  31505. a = e.properties;
  31506. for (var u = 0, d = n.length; u < d; u++)
  31507. for (var s in a) {
  31508. l = a[s], c = i[u][s], h = n[u][s];
  31509. C(l, l.type, c, h)
  31510. }
  31511. } else if ("iv1" === t) X.uniform1iv(i, n);
  31512. else if ("iv" === t) X.uniform3iv(i, n);
  31513. else if ("fv1" === t) X.uniform1fv(i, n);
  31514. else if ("fv" === t) X.uniform3fv(i, n);
  31515. else if ("v2v" === t) {
  31516. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  31517. u = 0;
  31518. for (var p = 0, f = n.length; u < f; u++, p += 2) e._array[p + 0] = n[u].x, e._array[p + 1] = n[u].y;
  31519. X.uniform2fv(i, e._array)
  31520. } else if ("v3v" === t) {
  31521. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  31522. u = 0;
  31523. var g = 0;
  31524. for (f = n.length; u < f; u++, g += 3) e._array[g + 0] = n[u].x, e._array[g + 1] = n[u].y, e._array[g + 2] = n[u].z;
  31525. X.uniform3fv(i, e._array)
  31526. } else if ("v4v" === t) {
  31527. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  31528. u = 0;
  31529. var m = 0;
  31530. for (f = n.length; u < f; u++, m += 4) e._array[m + 0] = n[u].x, e._array[m + 1] = n[u].y, e._array[m + 2] = n[u].z, e._array[m + 3] = n[u].w;
  31531. X.uniform4fv(i, e._array)
  31532. } else if ("m2" === t) X.uniformMatrix2fv(i, !1, n.elements);
  31533. else if ("m3" === t) X.uniformMatrix3fv(i, !1, n.elements);
  31534. else if ("m3v" === t) {
  31535. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  31536. for (u = 0, f = n.length; u < f; u++) n[u].flattenToArrayOffset(e._array, 9 * u);
  31537. X.uniformMatrix3fv(i, !1, e._array)
  31538. } else if ("m4" === t) X.uniformMatrix4fv(i, !1, n.elements);
  31539. else if ("m4v" === t) {
  31540. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  31541. for (u = 0, f = n.length; u < f; u++) n[u].flattenToArrayOffset(e._array, 16 * u);
  31542. X.uniformMatrix4fv(i, !1, e._array)
  31543. } else if ("t" === t) {
  31544. if (r = n, o = A(), X.uniform1i(i, o), !r) return;
  31545. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  31546. } else if ("tv" === t) {
  31547. void 0 === e._array && (e._array = []);
  31548. for (u = 0, f = e.value.length; u < f; u++) e._array[u] = A();
  31549. X.uniform1iv(i, e._array);
  31550. for (u = 0, f = e.value.length; u < f; u++) r = e.value[u], o = e._array[u], r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  31551. } else console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  31552. }
  31553. function g(e) {
  31554. for (var t = 0, i = e.length; t < i; t++) {
  31555. var n = e[t][0];
  31556. if (!1 !== n.needsUpdate) C(n, n.type, e[t][1], n.value)
  31557. }
  31558. }
  31559. function m(e, t, i) {
  31560. var n;
  31561. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)), X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)), X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)), X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE), X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE), t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t), X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)), X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)), t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)), n = Ie.get("EXT_texture_filter_anisotropic")) {
  31562. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear")) return;
  31563. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear")) return;
  31564. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())), be.get(t).__currentAnisotropy = t.anisotropy)
  31565. }
  31566. }
  31567. function o(e, t, i) {
  31568. void 0 === e.__webglInit && (e.__webglInit = !0, t.addEventListener("dispose", f), e.__webglTexture = X.createTexture(), ye.textures++), _e.activeTexture(X.TEXTURE0 + i), _e.bindTexture(X.TEXTURE_2D, e.__webglTexture), X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY), X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha), X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  31569. var n = I(t.image, Ee.maxTextureSize);
  31570. ! function (e) {
  31571. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  31572. }(t) || !1 !== E(n) || (n = function (e) {
  31573. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  31574. var t = document.createElement("canvas");
  31575. return t.width = Ci.Math.nearestPowerOfTwo(e.width), t.height = Ci.Math.nearestPowerOfTwo(e.height), t.getContext("2d").drawImage(e, 0, 0, t.width, t.height), console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e), t
  31576. }
  31577. return e
  31578. }(n));
  31579. var r = E(n),
  31580. o = x(t.format),
  31581. a = x(t.type);
  31582. m(X.TEXTURE_2D, t, r);
  31583. var s, l = t.mipmaps;
  31584. if (t instanceof Ci.DataTexture)
  31585. if (0 < l.length && r) {
  31586. for (var c = 0, h = l.length; c < h; c++) s = l[c], _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  31587. t.generateMipmaps = !1
  31588. } else _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  31589. else if (t instanceof Ci.CompressedTexture)
  31590. for (c = 0, h = l.length; c < h; c++) s = l[c], t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  31591. else if (0 < l.length && r) {
  31592. for (c = 0, h = l.length; c < h; c++) s = l[c], _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  31593. t.generateMipmaps = !1
  31594. } else _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  31595. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D), e.__version = t.version, t.onUpdate && t.onUpdate(t)
  31596. }
  31597. function I(e, t) {
  31598. if (e.width > t || e.height > t) {
  31599. var i = t / Math.max(e.width, e.height),
  31600. n = document.createElement("canvas");
  31601. return n.width = Math.floor(e.width * i), n.height = Math.floor(e.height * i), n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height), console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e), n
  31602. }
  31603. return e
  31604. }
  31605. function E(e) {
  31606. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  31607. }
  31608. function _(e, t) {
  31609. var i = be.get(e);
  31610. if (6 === e.image.length)
  31611. if (0 < e.version && i.__version !== e.version) {
  31612. i.__image__webglTextureCube || (e.addEventListener("dispose", f), i.__image__webglTextureCube = X.createTexture(), ye.textures++), _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube), X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  31613. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0] instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++) !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  31614. var s = E(o[0]),
  31615. l = x(e.format),
  31616. c = x(e.type);
  31617. m(X.TEXTURE_CUBE_MAP, e, s);
  31618. for (a = 0; a < 6; a++)
  31619. if (n)
  31620. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++) h = u[d], e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  31621. else r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  31622. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP), i.__version = e.version, e.onUpdate && e.onUpdate(e)
  31623. } else _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  31624. }
  31625. function b(e, t) {
  31626. _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  31627. }
  31628. function h(e, t, i, n) {
  31629. var r = x(t.texture.format),
  31630. o = x(t.texture.type);
  31631. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null), X.bindFramebuffer(X.FRAMEBUFFER, e), X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0), X.bindFramebuffer(X.FRAMEBUFFER, null)
  31632. }
  31633. function u(e, t) {
  31634. X.bindRenderbuffer(X.RENDERBUFFER, e), t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height), X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height), X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height), X.bindRenderbuffer(X.RENDERBUFFER, null)
  31635. }
  31636. function w(e) {
  31637. var t = be.get(e),
  31638. i = be.get(e.texture);
  31639. e.addEventListener("dispose", a), i.__webglTexture = X.createTexture(), ye.textures++;
  31640. var n = e instanceof Ci.WebGLRenderTargetCube,
  31641. r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  31642. if (n) {
  31643. t.__webglFramebuffer = [];
  31644. for (var o = 0; o < 6; o++) t.__webglFramebuffer[o] = X.createFramebuffer()
  31645. } else t.__webglFramebuffer = X.createFramebuffer();
  31646. if (n) {
  31647. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture), m(X.TEXTURE_CUBE_MAP, e.texture, r);
  31648. for (o = 0; o < 6; o++) h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  31649. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP), _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  31650. } else _e.bindTexture(X.TEXTURE_2D, i.__webglTexture), m(X.TEXTURE_2D, e.texture, r), h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D), e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D), _e.bindTexture(X.TEXTURE_2D, null);
  31651. e.depthBuffer && function (e) {
  31652. var t = be.get(e);
  31653. if (e instanceof Ci.WebGLRenderTargetCube) {
  31654. t.__webglDepthbuffer = [];
  31655. for (var i = 0; i < 6; i++) X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]), t.__webglDepthbuffer[i] = X.createRenderbuffer(), u(t.__webglDepthbuffer[i], e)
  31656. } else X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer), t.__webglDepthbuffer = X.createRenderbuffer(), u(t.__webglDepthbuffer, e);
  31657. X.bindFramebuffer(X.FRAMEBUFFER, null)
  31658. }(e)
  31659. }
  31660. function T(e) {
  31661. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  31662. }
  31663. function x(e) {
  31664. var t;
  31665. if (e === Ci.RepeatWrapping) return X.REPEAT;
  31666. if (e === Ci.ClampToEdgeWrapping) return X.CLAMP_TO_EDGE;
  31667. if (e === Ci.MirroredRepeatWrapping) return X.MIRRORED_REPEAT;
  31668. if (e === Ci.NearestFilter) return X.NEAREST;
  31669. if (e === Ci.NearestMipMapNearestFilter) return X.NEAREST_MIPMAP_NEAREST;
  31670. if (e === Ci.NearestMipMapLinearFilter) return X.NEAREST_MIPMAP_LINEAR;
  31671. if (e === Ci.LinearFilter) return X.LINEAR;
  31672. if (e === Ci.LinearMipMapNearestFilter) return X.LINEAR_MIPMAP_NEAREST;
  31673. if (e === Ci.LinearMipMapLinearFilter) return X.LINEAR_MIPMAP_LINEAR;
  31674. if (e === Ci.UnsignedByteType) return X.UNSIGNED_BYTE;
  31675. if (e === Ci.UnsignedShort4444Type) return X.UNSIGNED_SHORT_4_4_4_4;
  31676. if (e === Ci.UnsignedShort5551Type) return X.UNSIGNED_SHORT_5_5_5_1;
  31677. if (e === Ci.UnsignedShort565Type) return X.UNSIGNED_SHORT_5_6_5;
  31678. if (e === Ci.ByteType) return X.BYTE;
  31679. if (e === Ci.ShortType) return X.SHORT;
  31680. if (e === Ci.UnsignedShortType) return X.UNSIGNED_SHORT;
  31681. if (e === Ci.IntType) return X.INT;
  31682. if (e === Ci.UnsignedIntType) return X.UNSIGNED_INT;
  31683. if (e === Ci.FloatType) return X.FLOAT;
  31684. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType) return t.HALF_FLOAT_OES;
  31685. if (e === Ci.AlphaFormat) return X.ALPHA;
  31686. if (e === Ci.RGBFormat) return X.RGB;
  31687. if (e === Ci.RGBAFormat) return X.RGBA;
  31688. if (e === Ci.LuminanceFormat) return X.LUMINANCE;
  31689. if (e === Ci.LuminanceAlphaFormat) return X.LUMINANCE_ALPHA;
  31690. if (e === Ci.AddEquation) return X.FUNC_ADD;
  31691. if (e === Ci.SubtractEquation) return X.FUNC_SUBTRACT;
  31692. if (e === Ci.ReverseSubtractEquation) return X.FUNC_REVERSE_SUBTRACT;
  31693. if (e === Ci.ZeroFactor) return X.ZERO;
  31694. if (e === Ci.OneFactor) return X.ONE;
  31695. if (e === Ci.SrcColorFactor) return X.SRC_COLOR;
  31696. if (e === Ci.OneMinusSrcColorFactor) return X.ONE_MINUS_SRC_COLOR;
  31697. if (e === Ci.SrcAlphaFactor) return X.SRC_ALPHA;
  31698. if (e === Ci.OneMinusSrcAlphaFactor) return X.ONE_MINUS_SRC_ALPHA;
  31699. if (e === Ci.DstAlphaFactor) return X.DST_ALPHA;
  31700. if (e === Ci.OneMinusDstAlphaFactor) return X.ONE_MINUS_DST_ALPHA;
  31701. if (e === Ci.DstColorFactor) return X.DST_COLOR;
  31702. if (e === Ci.OneMinusDstColorFactor) return X.ONE_MINUS_DST_COLOR;
  31703. if (e === Ci.SrcAlphaSaturateFactor) return X.SRC_ALPHA_SATURATE;
  31704. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  31705. if (e === Ci.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  31706. if (e === Ci.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  31707. if (e === Ci.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  31708. if (e === Ci.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  31709. }
  31710. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  31711. if (e === Ci.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  31712. if (e === Ci.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  31713. if (e === Ci.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  31714. if (e === Ci.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  31715. }
  31716. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format) return t.COMPRESSED_RGB_ETC1_WEBGL;
  31717. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  31718. if (e === Ci.MinEquation) return t.MIN_EXT;
  31719. if (e === Ci.MaxEquation) return t.MAX_EXT
  31720. }
  31721. return 0
  31722. }
  31723. console.log("THREE.WebGLRenderer", Ci.REVISION);
  31724. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas"),
  31725. L = void 0 !== e.context ? e.context : null,
  31726. D = void 0 !== e.alpha && e.alpha,
  31727. N = void 0 === e.depth || e.depth,
  31728. F = void 0 === e.stencil || e.stencil,
  31729. B = void 0 !== e.antialias && e.antialias,
  31730. V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  31731. k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  31732. U = [],
  31733. H = [],
  31734. z = -1,
  31735. G = [],
  31736. W = -1,
  31737. j = new Float32Array(8),
  31738. Y = [],
  31739. q = [];
  31740. this.domElement = O, this.context = null, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.gammaFactor = 2, this.gammaInput = !1, this.gammaOutput = !1, this.physicallyCorrectLights = !1, this.toneMapping = Ci.LinearToneMapping, this.toneMappingExposure = 1, this.toneMappingWhitePoint = 1, this.maxMorphTargets = 8, this.maxMorphNormals = 4, this.autoScaleCubemaps = !0;
  31741. var X, Z = this,
  31742. K = null,
  31743. Q = null,
  31744. J = null,
  31745. $ = -1,
  31746. ee = "",
  31747. te = null,
  31748. ie = new Ci.Vector4,
  31749. ne = null,
  31750. re = new Ci.Vector4,
  31751. oe = 0,
  31752. ae = new Ci.Color(0),
  31753. se = 0,
  31754. le = O.width,
  31755. ce = O.height,
  31756. he = 1,
  31757. ue = new Ci.Vector4(0, 0, le, ce),
  31758. de = !1,
  31759. pe = new Ci.Vector4(0, 0, le, ce),
  31760. fe = new Ci.Frustum,
  31761. ge = new Ci.Matrix4,
  31762. me = new Ci.Vector3,
  31763. ve = {
  31764. hash: "",
  31765. ambient: [0, 0, 0],
  31766. directional: [],
  31767. directionalShadowMap: [],
  31768. directionalShadowMatrix: [],
  31769. spot: [],
  31770. spotShadowMap: [],
  31771. spotShadowMatrix: [],
  31772. point: [],
  31773. pointShadowMap: [],
  31774. pointShadowMatrix: [],
  31775. hemi: [],
  31776. shadows: [],
  31777. shadowsPointLight: 0
  31778. },
  31779. ye = {
  31780. geometries: 0,
  31781. textures: 0
  31782. },
  31783. Ae = {
  31784. calls: 0,
  31785. vertices: 0,
  31786. faces: 0,
  31787. points: 0
  31788. };
  31789. this.info = {
  31790. render: Ae,
  31791. memory: ye,
  31792. programs: null
  31793. };
  31794. try {
  31795. var Ce = {
  31796. alpha: D,
  31797. depth: N,
  31798. stencil: F,
  31799. antialias: B,
  31800. premultipliedAlpha: V,
  31801. preserveDrawingBuffer: k
  31802. };
  31803. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce))) throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  31804. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function () {
  31805. return {
  31806. rangeMin: 1,
  31807. rangeMax: 1,
  31808. precision: 1
  31809. }
  31810. }), O.addEventListener("webglcontextlost", r, !1)
  31811. } catch (e) {
  31812. console.error("THREE.WebGLRenderer: " + e)
  31813. }
  31814. var Ie = new Ci.WebGLExtensions(X);
  31815. Ie.get("OES_texture_float"), Ie.get("OES_texture_float_linear"), Ie.get("OES_texture_half_float"), Ie.get("OES_texture_half_float_linear"), Ie.get("OES_standard_derivatives"), Ie.get("ANGLE_instanced_arrays"), Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  31816. var Ee = new Ci.WebGLCapabilities(X, Ie, e),
  31817. _e = new Ci.WebGLState(X, Ie, x),
  31818. be = new Ci.WebGLProperties,
  31819. we = new Ci.WebGLObjects(X, be, this.info),
  31820. Te = new Ci.WebGLPrograms(this, Ee),
  31821. xe = new Ci.WebGLLights;
  31822. this.info.programs = Te.programs;
  31823. var Se = new Ci.WebGLBufferRenderer(X, Ie, Ae),
  31824. Me = new Ci.WebGLIndexedBufferRenderer(X, Ie, Ae);
  31825. t(), this.context = X, this.capabilities = Ee, this.extensions = Ie, this.properties = be, this.state = _e;
  31826. var Re = new Ci.WebGLShadowMap(this, ve, we);
  31827. this.shadowMap = Re;
  31828. var Pe, Oe = new Ci.SpritePlugin(this, Y),
  31829. Le = new Ci.LensFlarePlugin(this, q);
  31830. this.getContext = function () {
  31831. return X
  31832. }, this.getContextAttributes = function () {
  31833. return X.getContextAttributes()
  31834. }, this.forceContextLoss = function () {
  31835. Ie.get("WEBGL_lose_context").loseContext()
  31836. }, this.getMaxAnisotropy = function () {
  31837. if (void 0 !== Pe) return Pe;
  31838. var e = Ie.get("EXT_texture_filter_anisotropic");
  31839. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  31840. }, this.getPrecision = function () {
  31841. return Ee.precision
  31842. }, this.getPixelRatio = function () {
  31843. return he
  31844. }, this.setPixelRatio = function (e) {
  31845. void 0 !== e && (he = e, this.setSize(pe.z, pe.w, !1))
  31846. }, this.getSize = function () {
  31847. return {
  31848. width: le,
  31849. height: ce
  31850. }
  31851. }, this.setSize = function (e, t, i, n) {
  31852. null != n && (he = n), le = e, ce = t, O.width = e * he, O.height = t * he, !1 !== i && (O.style.width = e + "px", O.style.height = t + "px"), this.setViewport(0, 0, e, t)
  31853. }, this.setViewport = function (e, t, i, n) {
  31854. _e.viewport(pe.set(e, t, i, n))
  31855. }, this.setScissor = function (e, t, i, n) {
  31856. _e.scissor(ue.set(e, t, i, n))
  31857. }, this.setScissorTest = function (e) {
  31858. _e.setScissorTest(de = e)
  31859. }, this.getClearColor = function () {
  31860. return ae
  31861. }, this.setClearColor = function (e, t) {
  31862. ae.set(e), se = void 0 !== t ? t : 1, i(ae.r, ae.g, ae.b, se)
  31863. }, this.getClearAlpha = function () {
  31864. return se
  31865. }, this.setClearAlpha = function (e) {
  31866. se = e, i(ae.r, ae.g, ae.b, se)
  31867. }, this.clear = function (e, t, i) {
  31868. var n = 0;
  31869. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT), void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT), void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT), X.clear(n)
  31870. }, this.clearColor = function () {
  31871. this.clear(!0, !1, !1)
  31872. }, this.clearDepth = function () {
  31873. this.clear(!1, !0, !1)
  31874. }, this.clearStencil = function () {
  31875. this.clear(!1, !1, !0)
  31876. }, this.clearTarget = function (e, t, i, n) {
  31877. this.setRenderTarget(e), this.clear(t, i, n)
  31878. }, this.resetGLState = n, this.dispose = function () {
  31879. O.removeEventListener("webglcontextlost", r, !1)
  31880. }, this.renderBufferImmediate = function (e, t, i) {
  31881. _e.initAttributes();
  31882. var n = be.get(e);
  31883. e.hasPositions && !n.position && (n.position = X.createBuffer()), e.hasNormals && !n.normal && (n.normal = X.createBuffer()), e.hasUvs && !n.uv && (n.uv = X.createBuffer()), e.hasColors && !n.color && (n.color = X.createBuffer());
  31884. var r = t.getAttributes();
  31885. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position), X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW), _e.enableAttribute(r.position), X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)), e.hasNormals) {
  31886. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal), "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  31887. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  31888. var s = e.normalArray,
  31889. l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3,
  31890. c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3,
  31891. h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  31892. s[o + 0] = l, s[o + 1] = c, s[o + 2] = h, s[o + 3] = l, s[o + 4] = c, s[o + 5] = h, s[o + 6] = l, s[o + 7] = c, s[o + 8] = h
  31893. }
  31894. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW), _e.enableAttribute(r.normal), X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  31895. }
  31896. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv), X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW), _e.enableAttribute(r.uv), X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)), e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color), X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW), _e.enableAttribute(r.color), X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)), _e.disableUnusedAttributes(), X.drawArrays(X.TRIANGLES, 0, e.count), e.count = 0
  31897. }, this.renderBufferDirect = function (e, t, i, n, r, o) {
  31898. R(n);
  31899. var a = P(e, t, n, r),
  31900. s = !1,
  31901. l = i.id + "_" + a.id + "_" + n.wireframe;
  31902. l !== ee && (ee = l, s = !0);
  31903. var c = r.morphTargetInfluences;
  31904. if (void 0 !== c) {
  31905. for (var h = [], u = 0, d = c.length; u < d; u++) {
  31906. var p = c[u];
  31907. h.push([p, u])
  31908. }
  31909. h.sort(M), 8 < h.length && (h.length = 8);
  31910. var f = i.morphAttributes;
  31911. for (u = 0, d = h.length; u < d; u++) {
  31912. p = h[u];
  31913. if (j[u] = p[0], 0 !== p[0]) {
  31914. var g = p[1];
  31915. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]), !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  31916. } else !0 === n.morphTargets && i.removeAttribute("morphTarget" + u), !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  31917. }
  31918. var m = a.getUniforms();
  31919. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j), s = !0
  31920. }
  31921. g = i.index;
  31922. var v, y = i.attributes.position;
  31923. !0 === n.wireframe && (g = we.getWireframeAttribute(i)), null !== g ? (v = Me).setIndex(g) : v = Se, s && (function (e, t, i, n) {
  31924. var r;
  31925. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays"))) console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  31926. else {
  31927. void 0 === n && (n = 0), _e.initAttributes();
  31928. var o = i.attributes,
  31929. a = t.getAttributes(),
  31930. s = e.defaultAttributeValues;
  31931. for (var l in a) {
  31932. var c = a[l];
  31933. if (0 <= c) {
  31934. var h = o[l];
  31935. if (void 0 !== h) {
  31936. var u = h.itemSize,
  31937. d = we.getAttributeBuffer(h);
  31938. if (h instanceof Ci.InterleavedBufferAttribute) {
  31939. var p = h.data,
  31940. f = p.stride,
  31941. g = h.offset;
  31942. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r), void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c), X.bindBuffer(X.ARRAY_BUFFER, d), X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  31943. } else h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r), void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c), X.bindBuffer(X.ARRAY_BUFFER, d), X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  31944. } else if (void 0 !== s) {
  31945. var m = s[l];
  31946. if (void 0 !== m) switch (m.length) {
  31947. case 2:
  31948. X.vertexAttrib2fv(c, m);
  31949. break;
  31950. case 3:
  31951. X.vertexAttrib3fv(c, m);
  31952. break;
  31953. case 4:
  31954. X.vertexAttrib4fv(c, m);
  31955. break;
  31956. default:
  31957. X.vertexAttrib1fv(c, m)
  31958. }
  31959. }
  31960. }
  31961. }
  31962. _e.disableUnusedAttributes()
  31963. }
  31964. }(n, a, i), null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  31965. var A = 1 / 0;
  31966. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  31967. var C = i.drawRange.start,
  31968. I = i.drawRange.count,
  31969. E = null !== o ? o.start : 0,
  31970. _ = null !== o ? o.count : 1 / 0,
  31971. b = Math.max(0, C, E),
  31972. w = Math.min(0 + A, C + I, E + _) - 1,
  31973. T = Math.max(0, w - b + 1);
  31974. if (r instanceof Ci.Mesh)
  31975. if (!0 === n.wireframe) _e.setLineWidth(n.wireframeLinewidth * S()), v.setMode(X.LINES);
  31976. else switch (r.drawMode) {
  31977. case Ci.TrianglesDrawMode:
  31978. v.setMode(X.TRIANGLES);
  31979. break;
  31980. case Ci.TriangleStripDrawMode:
  31981. v.setMode(X.TRIANGLE_STRIP);
  31982. break;
  31983. case Ci.TriangleFanDrawMode:
  31984. v.setMode(X.TRIANGLE_FAN)
  31985. } else if (r instanceof Ci.Line) {
  31986. var x = n.linewidth;
  31987. void 0 === x && (x = 1), _e.setLineWidth(x * S()), r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  31988. } else r instanceof Ci.Points && v.setMode(X.POINTS);
  31989. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  31990. }, this.render = function (e, t, i, n) {
  31991. if (t instanceof Ci.Camera != 0) {
  31992. var r = e.fog;
  31993. if (ee = "", $ = -1, !(te = null) === e.autoUpdate && e.updateMatrixWorld(), null === t.parent && t.updateMatrixWorld(), t.matrixWorldInverse.getInverse(t.matrixWorld), ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), fe.setFromMatrix(ge), U.length = 0, W = z = -1, Y.length = 0, q.length = 0, function e(t, i) {
  31994. if (!1 !== t.visible) {
  31995. if (t.layers.test(i.layers))
  31996. if (t instanceof Ci.Light) U.push(t);
  31997. else if (t instanceof Ci.Sprite) !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  31998. else if (t instanceof Ci.LensFlare) q.push(t);
  31999. else if (t instanceof Ci.ImmediateRenderObject) !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld), me.applyProjection(ge)), d(t, null, t.material, me.z, null);
  32000. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(), !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  32001. var n = t.material;
  32002. if (!0 === n.visible) {
  32003. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld), me.applyProjection(ge));
  32004. var r = we.update(t);
  32005. if (n instanceof Ci.MultiMaterial)
  32006. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  32007. var c = o[s],
  32008. h = a[c.materialIndex];
  32009. !0 === h.visible && d(t, r, h, me.z, c)
  32010. } else d(t, r, n, me.z, null)
  32011. }
  32012. }
  32013. var u = t.children;
  32014. for (s = 0, l = u.length; s < l; s++) e(u[s], i)
  32015. }
  32016. }(e, t), H.length = z + 1, G.length = W + 1, !0 === Z.sortObjects && (H.sort(s), G.sort(l)), function (e, t) {
  32017. var i, n, r, o, a, s, l = 0,
  32018. c = 0,
  32019. h = 0,
  32020. u = t.matrixWorldInverse,
  32021. d = 0,
  32022. p = 0,
  32023. f = 0,
  32024. g = 0,
  32025. m = 0;
  32026. for (i = ve.shadowsPointLight = 0, n = e.length; i < n; i++)
  32027. if (o = (r = e[i]).color, a = r.intensity, s = r.distance, r instanceof Ci.AmbientLight) l += o.r * a, c += o.g * a, h += o.b * a;
  32028. else if (r instanceof Ci.DirectionalLight) {
  32029. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity), v.direction.setFromMatrixPosition(r.matrixWorld), me.setFromMatrixPosition(r.target.matrixWorld), v.direction.sub(me), v.direction.transformDirection(u), v.shadow = r.castShadow, r.castShadow && (v.shadowBias = r.shadow.bias, v.shadowRadius = r.shadow.radius, v.shadowMapSize = r.shadow.mapSize, ve.shadows[m++] = r), ve.directionalShadowMap[d] = r.shadow.map, ve.directionalShadowMatrix[d] = r.shadow.matrix, ve.directional[d++] = v
  32030. } else if (r instanceof Ci.SpotLight) {
  32031. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld), v.position.applyMatrix4(u), v.color.copy(o).multiplyScalar(a), v.distance = s, v.direction.setFromMatrixPosition(r.matrixWorld), me.setFromMatrixPosition(r.target.matrixWorld), v.direction.sub(me), v.direction.transformDirection(u), v.coneCos = Math.cos(r.angle), v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)), v.decay = 0 === r.distance ? 0 : r.decay, v.shadow = r.castShadow, r.castShadow && (v.shadowBias = r.shadow.bias, v.shadowRadius = r.shadow.radius, v.shadowMapSize = r.shadow.mapSize, ve.shadows[m++] = r), ve.spotShadowMap[f] = r.shadow.map, ve.spotShadowMatrix[f] = r.shadow.matrix, ve.spot[f++] = v
  32032. } else if (r instanceof Ci.PointLight) {
  32033. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld), v.position.applyMatrix4(u), v.color.copy(r.color).multiplyScalar(r.intensity), v.distance = r.distance, v.decay = 0 === r.distance ? 0 : r.decay, v.shadow = r.castShadow, r.castShadow && (v.shadowBias = r.shadow.bias, v.shadowRadius = r.shadow.radius, v.shadowMapSize = r.shadow.mapSize, ve.shadows[m++] = r), ve.pointShadowMap[p] = r.shadow.map, void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4), me.setFromMatrixPosition(r.matrixWorld).negate(), ve.pointShadowMatrix[p].identity().setPosition(me), ve.point[p++] = v
  32034. } else if (r instanceof Ci.HemisphereLight) {
  32035. var v;
  32036. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld), v.direction.transformDirection(u), v.direction.normalize(), v.skyColor.copy(r.color).multiplyScalar(a), v.groundColor.copy(r.groundColor).multiplyScalar(a), ve.hemi[g++] = v
  32037. }
  32038. ve.ambient[0] = l, ve.ambient[1] = c, ve.ambient[2] = h, ve.directional.length = d, ve.spot.length = f, ve.point.length = p, ve.hemi.length = g, ve.shadows.length = m, ve.hash = d + "," + p + "," + f + "," + g + "," + m
  32039. }(U, t), Re.render(e, t), Ae.calls = 0, Ae.vertices = 0, Ae.faces = 0, void(Ae.points = 0) === i && (i = null), this.setRenderTarget(i), (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil), e.overrideMaterial) {
  32040. var o = e.overrideMaterial;
  32041. c(H, t, r, o), c(G, t, r, o)
  32042. } else _e.setBlending(Ci.NoBlending), c(H, t, r), c(G, t, r);
  32043. if (Oe.render(e, t), Le.render(e, t, re), i) {
  32044. var a = i.texture;
  32045. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function (e) {
  32046. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D,
  32047. i = be.get(e.texture).__webglTexture;
  32048. _e.bindTexture(t, i), X.generateMipmap(t), _e.bindTexture(t, null)
  32049. }(i)
  32050. }
  32051. _e.setDepthTest(!0), _e.setDepthWrite(!0), _e.setColorWrite(!0)
  32052. } else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  32053. }, this.setFaceCulling = function (e, t) {
  32054. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW), e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK), _e.enable(X.CULL_FACE))
  32055. }, this.setTexture = function (e, t) {
  32056. var i = be.get(e);
  32057. if (0 < e.version && i.__version !== e.version) {
  32058. var n = e.image;
  32059. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  32060. }
  32061. _e.activeTexture(X.TEXTURE0 + t), _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  32062. }, this.getCurrentRenderTarget = function () {
  32063. return Q
  32064. }, this.setRenderTarget = function (e) {
  32065. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  32066. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  32067. if (e) {
  32068. var n = be.get(e);
  32069. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer, ie.copy(e.scissor), ne = e.scissorTest, re.copy(e.viewport)
  32070. } else t = null, ie.copy(ue).multiplyScalar(he), ne = de, re.copy(pe).multiplyScalar(he);
  32071. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t), J = t), _e.scissor(ie), _e.setScissorTest(ne), _e.viewport(re), i) {
  32072. var r = be.get(e.texture);
  32073. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  32074. }
  32075. }, this.readRenderTargetPixels = function (e, t, i, n, r, o) {
  32076. if (e instanceof Ci.WebGLRenderTarget != 0) {
  32077. var a = be.get(e).__webglFramebuffer;
  32078. if (a) {
  32079. var s = !1;
  32080. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a), s = !0);
  32081. try {
  32082. var l = e.texture;
  32083. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT)) return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  32084. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float"))) return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  32085. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  32086. } finally {
  32087. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  32088. }
  32089. }
  32090. } else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  32091. }
  32092. }, Ci.WebGLRenderTarget = function (e, t, i) {
  32093. this.uuid = Ci.Math.generateUUID(), this.width = e, this.height = t, this.scissor = new Ci.Vector4(0, 0, e, t), this.scissorTest = !1, this.viewport = new Ci.Vector4(0, 0, e, t), void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter), this.texture = new Ci.Texture(void 0, void 0, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy), this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer, this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  32094. }, Ci.WebGLRenderTarget.prototype = {
  32095. constructor: Ci.WebGLRenderTarget,
  32096. setSize: function (e, t) {
  32097. this.width === e && this.height === t || (this.width = e, this.height = t, this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t)
  32098. },
  32099. clone: function () {
  32100. return (new this.constructor).copy(this)
  32101. },
  32102. copy: function (e) {
  32103. return this.width = e.width, this.height = e.height, this.viewport.copy(e.viewport), this.texture = e.texture.clone(), this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this
  32104. },
  32105. dispose: function () {
  32106. this.dispatchEvent({
  32107. type: "dispose"
  32108. })
  32109. }
  32110. }, Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype), Ci.WebGLRenderTargetCube = function (e, t, i) {
  32111. Ci.WebGLRenderTarget.call(this, e, t, i), this.activeCubeFace = 0, this.activeMipMapLevel = 0
  32112. }, Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype), Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube, Ci.WebGLBufferRenderer = function (r, o, a) {
  32113. var s;
  32114. this.setMode = function (e) {
  32115. s = e
  32116. }, this.render = function (e, t) {
  32117. r.drawArrays(s, e, t), a.calls++, a.vertices += t, s === r.TRIANGLES && (a.faces += t / 3)
  32118. }, this.renderInstances = function (e) {
  32119. var t = o.get("ANGLE_instanced_arrays");
  32120. if (null !== t) {
  32121. var i = e.attributes.position,
  32122. n = 0;
  32123. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count, t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount), a.calls++, a.vertices += n * e.maxInstancedCount, s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  32124. } else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  32125. }
  32126. }, Ci.WebGLIndexedBufferRenderer = function (r, o, a) {
  32127. var s, l, c;
  32128. this.setMode = function (e) {
  32129. s = e
  32130. }, this.setIndex = function (e) {
  32131. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT, 4) : (l = r.UNSIGNED_SHORT, 2)
  32132. }, this.render = function (e, t) {
  32133. r.drawElements(s, t, l, e * c), a.calls++, a.vertices += t, s === r.TRIANGLES && (a.faces += t / 3)
  32134. }, this.renderInstances = function (e, t, i) {
  32135. var n = o.get("ANGLE_instanced_arrays");
  32136. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount), a.calls++, a.vertices += i * e.maxInstancedCount, void(s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  32137. }
  32138. }, Ci.WebGLExtensions = function (i) {
  32139. var n = {};
  32140. this.get = function (e) {
  32141. if (void 0 !== n[e]) return n[e];
  32142. var t;
  32143. switch (e) {
  32144. case "EXT_texture_filter_anisotropic":
  32145. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  32146. break;
  32147. case "WEBGL_compressed_texture_s3tc":
  32148. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  32149. break;
  32150. case "WEBGL_compressed_texture_pvrtc":
  32151. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  32152. break;
  32153. case "WEBGL_compressed_texture_etc1":
  32154. t = i.getExtension("WEBGL_compressed_texture_etc1");
  32155. break;
  32156. default:
  32157. t = i.getExtension(e)
  32158. }
  32159. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."), n[e] = t
  32160. }
  32161. }, Ci.WebGLCapabilities = function (t, e, i) {
  32162. function n(e) {
  32163. if ("highp" === e) {
  32164. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision) return "highp";
  32165. e = "mediump"
  32166. }
  32167. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  32168. }
  32169. this.getMaxPrecision = n, this.precision = void 0 !== i.precision ? i.precision : "highp", this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer, this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS), this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS), this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE), this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE), this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS), this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS), this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS), this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS), this.vertexTextures = 0 < this.maxVertexTextures, this.floatFragmentTextures = !!e.get("OES_texture_float"), this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  32170. var r = n(this.precision);
  32171. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."), this.precision = r), this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  32172. }, Ci.WebGLGeometries = function (i, o, a) {
  32173. function s(e) {
  32174. var t = e.target,
  32175. i = c[t.id];
  32176. null !== i.index && l(i.index),
  32177. function (e) {
  32178. for (var t in e) l(e[t])
  32179. }(i.attributes), t.removeEventListener("dispose", s), delete c[t.id];
  32180. var n = o.get(t);
  32181. n.wireframe && l(n.wireframe), o.delete(t);
  32182. var r = o.get(i);
  32183. r.wireframe && l(r.wireframe), o.delete(i), a.memory.geometries--
  32184. }
  32185. function l(e) {
  32186. var t = function (e) {
  32187. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  32188. }(e);
  32189. void 0 !== t && (i.deleteBuffer(t), function (e) {
  32190. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  32191. }(e))
  32192. }
  32193. var c = {};
  32194. this.get = function (e) {
  32195. var t, i = e.geometry;
  32196. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s), i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)), t = i._bufferGeometry), c[i.id] = t, a.memory.geometries++, t)
  32197. }
  32198. }, Ci.WebGLLights = function () {
  32199. var i = {};
  32200. this.get = function (e) {
  32201. if (void 0 !== i[e.id]) return i[e.id];
  32202. var t;
  32203. switch (e.type) {
  32204. case "DirectionalLight":
  32205. t = {
  32206. direction: new Ci.Vector3,
  32207. color: new Ci.Color,
  32208. shadow: !1,
  32209. shadowBias: 0,
  32210. shadowRadius: 1,
  32211. shadowMapSize: new Ci.Vector2
  32212. };
  32213. break;
  32214. case "SpotLight":
  32215. t = {
  32216. position: new Ci.Vector3,
  32217. direction: new Ci.Vector3,
  32218. color: new Ci.Color,
  32219. distance: 0,
  32220. coneCos: 0,
  32221. penumbraCos: 0,
  32222. decay: 0,
  32223. shadow: !1,
  32224. shadowBias: 0,
  32225. shadowRadius: 1,
  32226. shadowMapSize: new Ci.Vector2
  32227. };
  32228. break;
  32229. case "PointLight":
  32230. t = {
  32231. position: new Ci.Vector3,
  32232. color: new Ci.Color,
  32233. distance: 0,
  32234. decay: 0,
  32235. shadow: !1,
  32236. shadowBias: 0,
  32237. shadowRadius: 1,
  32238. shadowMapSize: new Ci.Vector2
  32239. };
  32240. break;
  32241. case "HemisphereLight":
  32242. t = {
  32243. direction: new Ci.Vector3,
  32244. skyColor: new Ci.Color,
  32245. groundColor: new Ci.Color
  32246. }
  32247. }
  32248. return i[e.id] = t
  32249. }
  32250. }, Ci.WebGLObjects = function (g, m, e) {
  32251. function v(e, t) {
  32252. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e,
  32253. n = m.get(i);
  32254. void 0 === n.__webglBuffer ? function (e, t, i) {
  32255. e.__webglBuffer = g.createBuffer(), g.bindBuffer(i, e.__webglBuffer);
  32256. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  32257. g.bufferData(i, t.array, n), e.version = t.version
  32258. }(n, i, t) : n.version !== i.version && function (e, t, i) {
  32259. g.bindBuffer(i, e.__webglBuffer), !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)), t.updateRange.count = 0), e.version = t.version
  32260. }(n, i, t)
  32261. }
  32262. function y(e, t, i) {
  32263. if (i < t) {
  32264. var n = t;
  32265. t = i, i = n
  32266. }
  32267. var r = e[t];
  32268. return void 0 === r ? (e[t] = [i], !0) : -1 === r.indexOf(i) && (r.push(i), !0)
  32269. }
  32270. var c = new Ci.WebGLGeometries(g, m, e);
  32271. this.getAttributeBuffer = function (e) {
  32272. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  32273. }, this.getWireframeAttribute = function (e) {
  32274. var t = m.get(e);
  32275. if (void 0 !== t.wireframe) return t.wireframe;
  32276. var i, n = [],
  32277. r = e.index,
  32278. o = e.attributes,
  32279. a = o.position;
  32280. if (null !== r)
  32281. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  32282. var h = i[l + 0],
  32283. u = i[l + 1],
  32284. d = i[l + 2];
  32285. y(s, h, u) && n.push(h, u), y(s, u, d) && n.push(u, d), y(s, d, h) && n.push(d, h)
  32286. } else
  32287. for (l = 0, c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  32288. h = l + 0, u = l + 1, d = l + 2;
  32289. n.push(h, u, u, d, d, h)
  32290. }
  32291. var p = 65535 < a.count ? Uint32Array : Uint16Array,
  32292. f = new Ci.BufferAttribute(new p(n), 1);
  32293. return v(f, g.ELEMENT_ARRAY_BUFFER), t.wireframe = f
  32294. }, this.update = function (e) {
  32295. var t = c.get(e);
  32296. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  32297. var i = t.index,
  32298. n = t.attributes;
  32299. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER), n) v(n[r], g.ARRAY_BUFFER);
  32300. var o = t.morphAttributes;
  32301. for (var r in o)
  32302. for (var a = o[r], s = 0, l = a.length; s < l; s++) v(a[s], g.ARRAY_BUFFER);
  32303. return t
  32304. }
  32305. }, Ci.WebGLProgram = (Qt = 0, Jt = /^([\w\d_]+)\.([\w\d_]+)$/, $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/, ei = /^([\w\d_]+)\[0\]$/, function (e, t, i, n) {
  32306. var r = e.context,
  32307. o = i.extensions,
  32308. a = i.defines,
  32309. s = i.__webglShader.vertexShader,
  32310. l = i.__webglShader.fragmentShader,
  32311. c = "SHADOWMAP_TYPE_BASIC";
  32312. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  32313. var h = "ENVMAP_TYPE_CUBE",
  32314. u = "ENVMAP_MODE_REFLECTION",
  32315. d = "ENVMAP_BLENDING_MULTIPLY";
  32316. if (n.envMap) {
  32317. switch (i.envMap.mapping) {
  32318. case Ci.CubeReflectionMapping:
  32319. case Ci.CubeRefractionMapping:
  32320. h = "ENVMAP_TYPE_CUBE";
  32321. break;
  32322. case Ci.CubeUVReflectionMapping:
  32323. case Ci.CubeUVRefractionMapping:
  32324. h = "ENVMAP_TYPE_CUBE_UV";
  32325. break;
  32326. case Ci.EquirectangularReflectionMapping:
  32327. case Ci.EquirectangularRefractionMapping:
  32328. h = "ENVMAP_TYPE_EQUIREC";
  32329. break;
  32330. case Ci.SphericalReflectionMapping:
  32331. h = "ENVMAP_TYPE_SPHERE"
  32332. }
  32333. switch (i.envMap.mapping) {
  32334. case Ci.CubeRefractionMapping:
  32335. case Ci.EquirectangularRefractionMapping:
  32336. u = "ENVMAP_MODE_REFRACTION"
  32337. }
  32338. switch (i.combine) {
  32339. case Ci.MultiplyOperation:
  32340. d = "ENVMAP_BLENDING_MULTIPLY";
  32341. break;
  32342. case Ci.MixOperation:
  32343. d = "ENVMAP_BLENDING_MIX";
  32344. break;
  32345. case Ci.AddOperation:
  32346. d = "ENVMAP_BLENDING_ADD"
  32347. }
  32348. }
  32349. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1,
  32350. m = function (e, t, i) {
  32351. return [(e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(Pi).join("\n")
  32352. }(o, n, e.extensions),
  32353. v = function (e) {
  32354. var t = [];
  32355. for (var i in e) {
  32356. var n = e[i];
  32357. !1 !== n && t.push("#define " + i + " " + n)
  32358. }
  32359. return t.join("\n")
  32360. }(a),
  32361. y = r.createProgram();
  32362. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(Pi).join("\n"), [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function (e, t) {
  32363. var i;
  32364. switch (t) {
  32365. case Ci.LinearToneMapping:
  32366. i = "Linear";
  32367. break;
  32368. case Ci.ReinhardToneMapping:
  32369. i = "Reinhard";
  32370. break;
  32371. case Ci.Uncharted2ToneMapping:
  32372. i = "Uncharted2";
  32373. break;
  32374. case Ci.CineonToneMapping:
  32375. i = "OptimizedCineon";
  32376. break;
  32377. default:
  32378. throw new Error("unsupported toneMapping: " + t)
  32379. }
  32380. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  32381. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function (e, t) {
  32382. var i = Mi(t);
  32383. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  32384. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")), s = Oi(s = Li(s), n), l = Oi(l = Li(l), n), i instanceof Ci.ShaderMaterial == 0 && (s = Di(s), l = Di(l));
  32385. var A = p + s,
  32386. C = f + l,
  32387. I = Ci.WebGLShader(r, r.VERTEX_SHADER, A),
  32388. E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  32389. r.attachShader(y, I), r.attachShader(y, E), void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"), r.linkProgram(y);
  32390. var _, b, w = r.getProgramInfoLog(y),
  32391. T = r.getShaderInfoLog(I),
  32392. x = r.getShaderInfoLog(E),
  32393. S = !0,
  32394. M = !0;
  32395. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1, console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1), M && (this.diagnostics = {
  32396. runnable: S,
  32397. material: i,
  32398. programLog: w,
  32399. vertexShader: {
  32400. log: T,
  32401. prefix: p
  32402. },
  32403. fragmentShader: {
  32404. log: x,
  32405. prefix: f
  32406. }
  32407. }), r.deleteShader(I), r.deleteShader(E), this.getUniforms = function () {
  32408. return void 0 === _ && (_ = function (e, t) {
  32409. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  32410. var o = e.getActiveUniform(t, r).name,
  32411. a = e.getUniformLocation(t, o),
  32412. s = Jt.exec(o);
  32413. if (s) {
  32414. var l = s[1],
  32415. c = s[2],
  32416. h = i[l];
  32417. (h = h || (i[l] = {}))[c] = a
  32418. } else if (s = $t.exec(o)) {
  32419. var u = s[1],
  32420. d = s[2],
  32421. p = s[3],
  32422. f = i[u],
  32423. g = (f = f || (i[u] = []))[d];
  32424. (g = g || (f[d] = {}))[p] = a
  32425. } else(s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  32426. }
  32427. return i
  32428. }(r, y)), _
  32429. }, this.getAttributes = function () {
  32430. return void 0 === b && (b = function (e, t) {
  32431. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  32432. var o = e.getActiveAttrib(t, r).name;
  32433. i[o] = e.getAttribLocation(t, o)
  32434. }
  32435. return i
  32436. }(r, y)), b
  32437. }, this.destroy = function () {
  32438. r.deleteProgram(y), this.program = void 0
  32439. }, Object.defineProperties(this, {
  32440. uniforms: {
  32441. get: function () {
  32442. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."), this.getUniforms()
  32443. }
  32444. },
  32445. attributes: {
  32446. get: function () {
  32447. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."), this.getAttributes()
  32448. }
  32449. }
  32450. }), this.id = Qt++, this.code = t, this.usedTimes = 1, this.program = y, this.vertexShader = I, this.fragmentShader = E, this
  32451. }), Ci.WebGLPrograms = function (s, l) {
  32452. function c(e, t) {
  32453. var i;
  32454. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding, i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding), i
  32455. }
  32456. var h = [],
  32457. u = {
  32458. MeshDepthMaterial: "depth",
  32459. MeshNormalMaterial: "normal",
  32460. MeshBasicMaterial: "basic",
  32461. MeshLambertMaterial: "lambert",
  32462. MeshPhongMaterial: "phong",
  32463. MeshStandardMaterial: "standard",
  32464. LineBasicMaterial: "basic",
  32465. LineDashedMaterial: "dashed",
  32466. PointsMaterial: "points"
  32467. },
  32468. a = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  32469. this.getParameters = function (e, t, i, n) {
  32470. var r = u[e.type],
  32471. o = function (e) {
  32472. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture) return 1024;
  32473. var t = l.maxVertexUniforms,
  32474. i = Math.floor((t - 20) / 4);
  32475. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")), i
  32476. }(n),
  32477. a = s.getPrecision();
  32478. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."), {
  32479. shaderID: r,
  32480. precision: a,
  32481. supportsVertexTextures: l.vertexTextures,
  32482. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  32483. map: !!e.map,
  32484. mapEncoding: c(e.map, s.gammaInput),
  32485. envMap: !!e.envMap,
  32486. envMapMode: e.envMap && e.envMap.mapping,
  32487. envMapEncoding: c(e.envMap, s.gammaInput),
  32488. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  32489. lightMap: !!e.lightMap,
  32490. aoMap: !!e.aoMap,
  32491. emissiveMap: !!e.emissiveMap,
  32492. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  32493. bumpMap: !!e.bumpMap,
  32494. normalMap: !!e.normalMap,
  32495. displacementMap: !!e.displacementMap,
  32496. roughnessMap: !!e.roughnessMap,
  32497. metalnessMap: !!e.metalnessMap,
  32498. specularMap: !!e.specularMap,
  32499. alphaMap: !!e.alphaMap,
  32500. combine: e.combine,
  32501. vertexColors: e.vertexColors,
  32502. fog: i,
  32503. useFog: e.fog,
  32504. fogExp: i instanceof Ci.FogExp2,
  32505. flatShading: e.shading === Ci.FlatShading,
  32506. sizeAttenuation: e.sizeAttenuation,
  32507. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  32508. skinning: e.skinning,
  32509. maxBones: o,
  32510. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  32511. morphTargets: e.morphTargets,
  32512. morphNormals: e.morphNormals,
  32513. maxMorphTargets: s.maxMorphTargets,
  32514. maxMorphNormals: s.maxMorphNormals,
  32515. numDirLights: t.directional.length,
  32516. numPointLights: t.point.length,
  32517. numSpotLights: t.spot.length,
  32518. numHemiLights: t.hemi.length,
  32519. pointLightShadows: t.shadowsPointLight,
  32520. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  32521. shadowMapType: s.shadowMap.type,
  32522. toneMapping: s.toneMapping,
  32523. physicallyCorrectLights: s.physicallyCorrectLights,
  32524. premultipliedAlpha: e.premultipliedAlpha,
  32525. alphaTest: e.alphaTest,
  32526. doubleSided: e.side === Ci.DoubleSide,
  32527. flipSided: e.side === Ci.BackSide
  32528. }
  32529. }, this.getProgramCode = function (e, t) {
  32530. var i = [];
  32531. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader), i.push(e.vertexShader)), void 0 !== e.defines)
  32532. for (var n in e.defines) i.push(n), i.push(e.defines[n]);
  32533. for (var r = 0; r < a.length; r++) {
  32534. var o = a[r];
  32535. i.push(o), i.push(t[o])
  32536. }
  32537. return i.join()
  32538. }, this.acquireProgram = function (e, t, i) {
  32539. for (var n, r = 0, o = h.length; r < o; r++) {
  32540. var a = h[r];
  32541. if (a.code === i) {
  32542. ++(n = a).usedTimes;
  32543. break
  32544. }
  32545. }
  32546. return void 0 === n && (n = new Ci.WebGLProgram(s, i, e, t), h.push(n)), n
  32547. }, this.releaseProgram = function (e) {
  32548. if (0 == --e.usedTimes) {
  32549. var t = h.indexOf(e);
  32550. h[t] = h[h.length - 1], h.pop(), e.destroy()
  32551. }
  32552. }, this.programs = h
  32553. }, Ci.WebGLProperties = function () {
  32554. var n = {};
  32555. this.get = function (e) {
  32556. var t = e.uuid,
  32557. i = n[t];
  32558. return void 0 === i && (i = {}, n[t] = i), i
  32559. }, this.delete = function (e) {
  32560. delete n[e.uuid]
  32561. }, this.clear = function () {
  32562. n = {}
  32563. }
  32564. }, Ci.WebGLShader = function (e, t, i) {
  32565. var n = e.createShader(t);
  32566. return e.shaderSource(n, i), e.compileShader(n), !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."), "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function (e) {
  32567. for (var t = e.split("\n"), i = 0; i < t.length; i++) t[i] = i + 1 + ": " + t[i];
  32568. return t.join("\n")
  32569. }(i)), n
  32570. }, Ci.WebGLShadowMap = function (P, O, L) {
  32571. function D(e, t, i, n) {
  32572. var r = e.geometry,
  32573. o = null,
  32574. a = p,
  32575. s = e.customDepthMaterial;
  32576. if (i && (a = f, s = e.customDistanceMaterial), s) o = s;
  32577. else {
  32578. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets,
  32579. c = e instanceof Ci.SkinnedMesh && t.skinning,
  32580. h = 0;
  32581. l && (h |= u), c && (h |= d), o = a[h]
  32582. }
  32583. return o.visible = t.visible, o.wireframe = t.wireframe, o.wireframeLinewidth = t.wireframeLinewidth, i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n), o
  32584. }
  32585. function N(e, t, i) {
  32586. if (!1 !== e.visible) {
  32587. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e))) !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld), G.push(e));
  32588. for (var n = e.children, r = 0, o = n.length; r < o; r++) N(n[r], t, i)
  32589. }
  32590. }
  32591. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1, 0, 0), new Ci.Vector3(-1, 0, 0), new Ci.Vector3(0, 0, 1), new Ci.Vector3(0, 0, -1), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, -1, 0)], j = [new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 1, 0), new Ci.Vector3(0, 0, 1), new Ci.Vector3(0, 0, -1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  32592. var a = 0 != (o & u),
  32593. s = 0 != (o & d),
  32594. l = new Ci.ShaderMaterial({
  32595. uniforms: i,
  32596. vertexShader: t.vertexShader,
  32597. fragmentShader: t.fragmentShader,
  32598. morphTargets: a,
  32599. skinning: s
  32600. });
  32601. p[o] = l;
  32602. var c = new Ci.ShaderMaterial({
  32603. defines: {
  32604. USE_SHADOWMAP: ""
  32605. },
  32606. uniforms: r,
  32607. vertexShader: n.vertexShader,
  32608. fragmentShader: n.fragmentShader,
  32609. morphTargets: a,
  32610. skinning: s
  32611. });
  32612. f[o] = c
  32613. }
  32614. var q = this;
  32615. this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = Ci.PCFShadowMap, this.cullFace = Ci.CullFaceFront, this.render = function (e, t) {
  32616. var i, n, r = O.shadows;
  32617. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  32618. B.clearColor(1, 1, 1, 1), B.disable(F.BLEND), B.enable(F.CULL_FACE), F.frontFace(F.CCW), F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK), B.setDepthTest(!0), B.setScissorTest(!1);
  32619. for (var o = 0, a = r.length; o < a; o++) {
  32620. var s = r[o],
  32621. l = s.shadow,
  32622. c = l.camera;
  32623. if (U.copy(l.mapSize), s instanceof Ci.PointLight) {
  32624. i = 6, n = !0;
  32625. var h = U.x,
  32626. u = U.y;
  32627. Y[0].set(2 * h, u, h, u), Y[1].set(0, u, h, u), Y[2].set(3 * h, u, h, u), Y[3].set(h, u, h, u), Y[4].set(3 * h, 0, h, u), Y[5].set(h, 0, h, u), U.x *= 4, U.y *= 2
  32628. } else n = !(i = 1);
  32629. if (null === l.map) {
  32630. var d = {
  32631. minFilter: Ci.NearestFilter,
  32632. magFilter: Ci.NearestFilter,
  32633. format: Ci.RGBAFormat
  32634. };
  32635. l.map = new Ci.WebGLRenderTarget(U.x, U.y, d), s instanceof Ci.SpotLight && (c.aspect = U.x / U.y), c.updateProjectionMatrix()
  32636. }
  32637. var p = l.map,
  32638. f = l.matrix;
  32639. z.setFromMatrixPosition(s.matrixWorld), c.position.copy(z), P.setRenderTarget(p), P.clear();
  32640. for (var g = 0; g < i; g++) {
  32641. if (n) {
  32642. H.copy(c.position), H.add(W[g]), c.up.copy(j[g]), c.lookAt(H);
  32643. var m = Y[g];
  32644. B.viewport(m)
  32645. } else H.setFromMatrixPosition(s.target.matrixWorld), c.lookAt(H);
  32646. c.updateMatrixWorld(), c.matrixWorldInverse.getInverse(c.matrixWorld), f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1), f.multiply(c.projectionMatrix), f.multiply(c.matrixWorldInverse), k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse), V.setFromMatrix(k), G.length = 0, N(e, t, c);
  32647. for (var v = 0, y = G.length; v < y; v++) {
  32648. var A = G[v],
  32649. C = L.update(A),
  32650. I = A.material;
  32651. if (I instanceof Ci.MultiMaterial)
  32652. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  32653. var T = E[b],
  32654. x = _[T.materialIndex];
  32655. if (!0 === x.visible) {
  32656. var S = D(A, x, n, z);
  32657. P.renderBufferDirect(c, null, C, S, A, T)
  32658. }
  32659. } else {
  32660. S = D(A, I, n, z);
  32661. P.renderBufferDirect(c, null, C, S, A, null)
  32662. }
  32663. }
  32664. }
  32665. }
  32666. var M = P.getClearColor(),
  32667. R = P.getClearAlpha();
  32668. P.setClearColor(M, R), B.enable(F.BLEND), q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK), q.needsUpdate = !1
  32669. }
  32670. }
  32671. }, Ci.WebGLState = function (l, i, c) {
  32672. var n = this,
  32673. r = new Ci.Vector4,
  32674. o = new Uint8Array(16),
  32675. a = new Uint8Array(16),
  32676. s = new Uint8Array(16),
  32677. t = {},
  32678. h = null,
  32679. u = null,
  32680. d = null,
  32681. p = null,
  32682. f = null,
  32683. g = null,
  32684. m = null,
  32685. v = null,
  32686. y = !1,
  32687. A = null,
  32688. C = null,
  32689. I = null,
  32690. E = null,
  32691. _ = null,
  32692. b = null,
  32693. w = null,
  32694. T = null,
  32695. x = null,
  32696. S = null,
  32697. M = null,
  32698. R = null,
  32699. P = null,
  32700. O = null,
  32701. L = null,
  32702. D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
  32703. N = void 0,
  32704. F = {},
  32705. B = new Ci.Vector4,
  32706. V = null,
  32707. k = null,
  32708. U = new Ci.Vector4,
  32709. H = new Ci.Vector4,
  32710. z = l.createTexture();
  32711. l.bindTexture(l.TEXTURE_2D, z), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR), l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)), this.init = function () {
  32712. this.clearColor(0, 0, 0, 1), this.clearDepth(1), this.clearStencil(0), this.enable(l.DEPTH_TEST), l.depthFunc(l.LEQUAL), l.frontFace(l.CCW), l.cullFace(l.BACK), this.enable(l.CULL_FACE), this.enable(l.BLEND), l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  32713. }, this.initAttributes = function () {
  32714. for (var e = 0, t = o.length; e < t; e++) o[e] = 0
  32715. }, this.enableAttribute = function (e) {
  32716. o[e] = 1, 0 === a[e] && (l.enableVertexAttribArray(e), a[e] = 1), 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0), s[e] = 0)
  32717. }, this.enableAttributeAndDivisor = function (e, t, i) {
  32718. o[e] = 1, 0 === a[e] && (l.enableVertexAttribArray(e), a[e] = 1), s[e] !== t && (i.vertexAttribDivisorANGLE(e, t), s[e] = t)
  32719. }, this.disableUnusedAttributes = function () {
  32720. for (var e = 0, t = a.length; e < t; e++) a[e] !== o[e] && (l.disableVertexAttribArray(e), a[e] = 0)
  32721. }, this.enable = function (e) {
  32722. !0 !== t[e] && (l.enable(e), t[e] = !0)
  32723. }, this.disable = function (e) {
  32724. !1 !== t[e] && (l.disable(e), t[e] = !1)
  32725. }, this.getCompressedTextureFormats = function () {
  32726. if (null === h && (h = [], i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  32727. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++) h.push(e[t]);
  32728. return h
  32729. }, this.setBlending = function (e, t, i, n, r, o, a, s) {
  32730. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND), e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD), l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)), u = e, y = s), e === Ci.CustomBlending ? (r = r || t, o = o || i, a = a || n, t === d && r === g || (l.blendEquationSeparate(c(t), c(r)), d = t, g = r), i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)), p = i, f = n, m = o, v = a)) : v = m = g = f = p = d = null
  32731. }, this.setDepthFunc = function (e) {
  32732. if (A !== e) {
  32733. if (e) switch (e) {
  32734. case Ci.NeverDepth:
  32735. l.depthFunc(l.NEVER);
  32736. break;
  32737. case Ci.AlwaysDepth:
  32738. l.depthFunc(l.ALWAYS);
  32739. break;
  32740. case Ci.LessDepth:
  32741. l.depthFunc(l.LESS);
  32742. break;
  32743. case Ci.LessEqualDepth:
  32744. l.depthFunc(l.LEQUAL);
  32745. break;
  32746. case Ci.EqualDepth:
  32747. l.depthFunc(l.EQUAL);
  32748. break;
  32749. case Ci.GreaterEqualDepth:
  32750. l.depthFunc(l.GEQUAL);
  32751. break;
  32752. case Ci.GreaterDepth:
  32753. l.depthFunc(l.GREATER);
  32754. break;
  32755. case Ci.NotEqualDepth:
  32756. l.depthFunc(l.NOTEQUAL);
  32757. break;
  32758. default:
  32759. l.depthFunc(l.LEQUAL)
  32760. } else l.depthFunc(l.LEQUAL);
  32761. A = e
  32762. }
  32763. }, this.setDepthTest = function (e) {
  32764. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  32765. }, this.setDepthWrite = function (e) {
  32766. C !== e && (l.depthMask(e), C = e)
  32767. }, this.setColorWrite = function (e) {
  32768. I !== e && (l.colorMask(e, e, e, e), I = e)
  32769. }, this.setStencilFunc = function (e, t, i) {
  32770. _ === e && b === t && w === i || (l.stencilFunc(e, t, i), _ = e, b = t, w = i)
  32771. }, this.setStencilOp = function (e, t, i) {
  32772. T === e && x === t && S === i || (l.stencilOp(e, t, i), T = e, x = t, S = i)
  32773. }, this.setStencilTest = function (e) {
  32774. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  32775. }, this.setStencilWrite = function (e) {
  32776. E !== e && (l.stencilMask(e), E = e)
  32777. }, this.setFlipSided = function (e) {
  32778. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW), M = e)
  32779. }, this.setLineWidth = function (e) {
  32780. e !== R && (l.lineWidth(e), R = e)
  32781. }, this.setPolygonOffset = function (e, t, i) {
  32782. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL), !e || P === t && O === i || (l.polygonOffset(t, i), P = t, O = i)
  32783. }, this.getScissorTest = function () {
  32784. return L
  32785. }, this.setScissorTest = function (e) {
  32786. (L = e) ? this.enable(l.SCISSOR_TEST): this.disable(l.SCISSOR_TEST)
  32787. }, this.activeTexture = function (e) {
  32788. void 0 === e && (e = l.TEXTURE0 + D - 1), N !== e && (l.activeTexture(e), N = e)
  32789. }, this.bindTexture = function (e, t) {
  32790. void 0 === N && n.activeTexture();
  32791. var i = F[N];
  32792. void 0 === i && (i = {
  32793. type: void 0,
  32794. texture: void 0
  32795. }, F[N] = i), i.type === e && i.texture === t || (l.bindTexture(e, t || z), i.type = e, i.texture = t)
  32796. }, this.compressedTexImage2D = function () {
  32797. try {
  32798. l.compressedTexImage2D.apply(l, arguments)
  32799. } catch (e) {
  32800. console.error(e)
  32801. }
  32802. }, this.texImage2D = function () {
  32803. try {
  32804. l.texImage2D.apply(l, arguments)
  32805. } catch (e) {
  32806. console.error(e)
  32807. }
  32808. }, this.clearColor = function (e, t, i, n) {
  32809. r.set(e, t, i, n), !1 === B.equals(r) && (l.clearColor(e, t, i, n), B.copy(r))
  32810. }, this.clearDepth = function (e) {
  32811. V !== e && (l.clearDepth(e), V = e)
  32812. }, this.clearStencil = function (e) {
  32813. k !== e && (l.clearStencil(e), k = e)
  32814. }, this.scissor = function (e) {
  32815. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w), U.copy(e))
  32816. }, this.viewport = function (e) {
  32817. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w), H.copy(e))
  32818. }, this.reset = function () {
  32819. for (var e = 0; e < a.length; e++) 1 === a[e] && (l.disableVertexAttribArray(e), a[e] = 0);
  32820. t = {}, N = void 0, F = {}, M = E = C = I = u = h = null
  32821. }
  32822. }, Ci.LensFlarePlugin = function (v, y) {
  32823. function A() {
  32824. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  32825. i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  32826. C = S.createBuffer(), I = S.createBuffer(), S.bindBuffer(S.ARRAY_BUFFER, C), S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW), S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I), S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW), T = S.createTexture(), x = S.createTexture(), M.bindTexture(S.TEXTURE_2D, T), S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST), M.bindTexture(S.TEXTURE_2D, x), S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST), S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST), e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  32827. 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"),
  32828. 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")
  32829. } : {
  32830. 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"),
  32831. 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")
  32832. }, E = function (e) {
  32833. var t = S.createProgram(),
  32834. i = S.createShader(S.FRAGMENT_SHADER),
  32835. n = S.createShader(S.VERTEX_SHADER),
  32836. r = "precision " + v.getPrecision() + " float;\n";
  32837. return S.shaderSource(i, r + e.fragmentShader), S.shaderSource(n, r + e.vertexShader), S.compileShader(i), S.compileShader(n), S.attachShader(t, i), S.attachShader(t, n), S.linkProgram(t), t
  32838. }(e), _ = {
  32839. vertex: S.getAttribLocation(E, "position"),
  32840. uv: S.getAttribLocation(E, "uv")
  32841. }, b = {
  32842. renderType: S.getUniformLocation(E, "renderType"),
  32843. map: S.getUniformLocation(E, "map"),
  32844. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  32845. opacity: S.getUniformLocation(E, "opacity"),
  32846. color: S.getUniformLocation(E, "color"),
  32847. scale: S.getUniformLocation(E, "scale"),
  32848. rotation: S.getUniformLocation(E, "rotation"),
  32849. screenPosition: S.getUniformLocation(E, "screenPosition")
  32850. }
  32851. }
  32852. var C, I, E, _, b, w, T, x, S = v.context,
  32853. M = v.state;
  32854. this.render = function (e, t, i) {
  32855. if (0 !== y.length) {
  32856. var n = new Ci.Vector3,
  32857. r = i.w / i.z,
  32858. o = .5 * i.z,
  32859. a = .5 * i.w,
  32860. s = 16 / i.w,
  32861. l = new Ci.Vector2(s * r, s),
  32862. c = new Ci.Vector3(1, 1, 0),
  32863. h = new Ci.Vector2(1, 1);
  32864. void 0 === E && A(), S.useProgram(E), M.initAttributes(), M.enableAttribute(_.vertex), M.enableAttribute(_.uv), M.disableUnusedAttributes(), S.uniform1i(b.occlusionMap, 0), S.uniform1i(b.map, 1), S.bindBuffer(S.ARRAY_BUFFER, C), S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0), S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8), S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I), M.disable(S.CULL_FACE), M.setDepthWrite(!1);
  32865. for (var u = 0, d = y.length; u < d; u++) {
  32866. s = 16 / i.w, l.set(s * r, s);
  32867. var p = y[u];
  32868. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]), n.applyMatrix4(t.matrixWorldInverse), n.applyProjection(t.projectionMatrix), c.copy(n), h.x = c.x * o + o, h.y = c.y * a + a, w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  32869. M.activeTexture(S.TEXTURE0), M.bindTexture(S.TEXTURE_2D, null), M.activeTexture(S.TEXTURE1), M.bindTexture(S.TEXTURE_2D, T), S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0), S.uniform1i(b.renderType, 0), S.uniform2f(b.scale, l.x, l.y), S.uniform3f(b.screenPosition, c.x, c.y, c.z), M.disable(S.BLEND), M.enable(S.DEPTH_TEST), S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0), M.activeTexture(S.TEXTURE0), M.bindTexture(S.TEXTURE_2D, x), S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0), S.uniform1i(b.renderType, 1), M.disable(S.DEPTH_TEST), M.activeTexture(S.TEXTURE1), M.bindTexture(S.TEXTURE_2D, T), S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0), p.positionScreen.copy(c), p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(), S.uniform1i(b.renderType, 2), M.enable(S.BLEND);
  32870. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  32871. var m = p.lensFlares[f];
  32872. .001 < m.opacity && .001 < m.scale && (c.x = m.x, c.y = m.y, c.z = m.z, s = m.size * m.scale / i.w, l.x = s * r, l.y = s, S.uniform3f(b.screenPosition, c.x, c.y, c.z), S.uniform2f(b.scale, l.x, l.y), S.uniform1f(b.rotation, m.rotation), S.uniform1f(b.opacity, m.opacity), S.uniform3f(b.color, m.color.r, m.color.g, m.color.b), M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst), v.setTexture(m.texture, 1), S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  32873. }
  32874. }
  32875. }
  32876. M.enable(S.CULL_FACE), M.enable(S.DEPTH_TEST), M.setDepthWrite(!0), v.resetGLState()
  32877. }
  32878. }
  32879. }, Ci.SpritePlugin = function (u, d) {
  32880. function p() {
  32881. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1]),
  32882. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  32883. g = I.createBuffer(), m = I.createBuffer(), I.bindBuffer(I.ARRAY_BUFFER, g), I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW), I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m), I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW), v = function () {
  32884. var e = I.createProgram(),
  32885. t = I.createShader(I.VERTEX_SHADER),
  32886. i = I.createShader(I.FRAGMENT_SHADER);
  32887. return I.shaderSource(t, ["precision " + u.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")), I.shaderSource(i, ["precision " + u.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")), I.compileShader(t), I.compileShader(i), I.attachShader(e, t), I.attachShader(e, i), I.linkProgram(e), e
  32888. }(), y = {
  32889. position: I.getAttribLocation(v, "position"),
  32890. uv: I.getAttribLocation(v, "uv")
  32891. }, A = {
  32892. uvOffset: I.getUniformLocation(v, "uvOffset"),
  32893. uvScale: I.getUniformLocation(v, "uvScale"),
  32894. rotation: I.getUniformLocation(v, "rotation"),
  32895. scale: I.getUniformLocation(v, "scale"),
  32896. color: I.getUniformLocation(v, "color"),
  32897. map: I.getUniformLocation(v, "map"),
  32898. opacity: I.getUniformLocation(v, "opacity"),
  32899. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  32900. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  32901. fogType: I.getUniformLocation(v, "fogType"),
  32902. fogDensity: I.getUniformLocation(v, "fogDensity"),
  32903. fogNear: I.getUniformLocation(v, "fogNear"),
  32904. fogFar: I.getUniformLocation(v, "fogFar"),
  32905. fogColor: I.getUniformLocation(v, "fogColor"),
  32906. alphaTest: I.getUniformLocation(v, "alphaTest")
  32907. };
  32908. var i = document.createElement("canvas");
  32909. i.width = 8, i.height = 8;
  32910. var n = i.getContext("2d");
  32911. n.fillStyle = "white", n.fillRect(0, 0, 8, 8), (C = new Ci.Texture(i)).needsUpdate = !0
  32912. }
  32913. function f(e, t) {
  32914. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  32915. }
  32916. var g, m, v, y, A, C, I = u.context,
  32917. E = u.state,
  32918. _ = new Ci.Vector3,
  32919. b = new Ci.Quaternion,
  32920. w = new Ci.Vector3;
  32921. this.render = function (e, t) {
  32922. if (0 !== d.length) {
  32923. void 0 === v && p(), I.useProgram(v), E.initAttributes(), E.enableAttribute(y.position), E.enableAttribute(y.uv), E.disableUnusedAttributes(), E.disable(I.CULL_FACE), E.enable(I.BLEND), I.bindBuffer(I.ARRAY_BUFFER, g), I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0), I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8), I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m), I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements), E.activeTexture(I.TEXTURE0), I.uniform1i(A.map, 0);
  32924. var i = 0,
  32925. n = 0,
  32926. r = e.fog;
  32927. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b), r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near), I.uniform1f(A.fogFar, r.far), I.uniform1i(A.fogType, 1), n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density), I.uniform1i(A.fogType, 2), n = i = 2)) : (I.uniform1i(A.fogType, 0), n = i = 0);
  32928. for (var o = 0, a = d.length; o < a; o++) {
  32929. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld), l.z = -l.modelViewMatrix.elements[14]
  32930. }
  32931. d.sort(f);
  32932. var s = [];
  32933. for (o = 0, a = d.length; o < a; o++) {
  32934. var l, c = (l = d[o]).material;
  32935. I.uniform1f(A.alphaTest, c.alphaTest), I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements), l.matrixWorld.decompose(_, b, w), s[0] = w.x, s[1] = w.y;
  32936. var h = 0;
  32937. e.fog && c.fog && (h = n), i !== h && (I.uniform1i(A.fogType, h), i = h), null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y), I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0), I.uniform2f(A.uvScale, 1, 1)), I.uniform1f(A.opacity, c.opacity), I.uniform3f(A.color, c.color.r, c.color.g, c.color.b), I.uniform1f(A.rotation, c.rotation), I.uniform2fv(A.scale, s), E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst), E.setDepthTest(c.depthTest), E.setDepthWrite(c.depthWrite), c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0), I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  32938. }
  32939. E.enable(I.CULL_FACE), u.resetGLState()
  32940. }
  32941. }
  32942. }, Object.defineProperties(Ci.Box2.prototype, {
  32943. empty: {
  32944. value: function () {
  32945. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."), this.isEmpty()
  32946. }
  32947. },
  32948. isIntersectionBox: {
  32949. value: function (e) {
  32950. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(e)
  32951. }
  32952. }
  32953. }), Object.defineProperties(Ci.Box3.prototype, {
  32954. empty: {
  32955. value: function () {
  32956. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."), this.isEmpty()
  32957. }
  32958. },
  32959. isIntersectionBox: {
  32960. value: function (e) {
  32961. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(e)
  32962. }
  32963. },
  32964. isIntersectionSphere: {
  32965. value: function (e) {
  32966. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(e)
  32967. }
  32968. }
  32969. }), Object.defineProperties(Ci.Matrix3.prototype, {
  32970. multiplyVector3: {
  32971. value: function (e) {
  32972. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."), e.applyMatrix3(this)
  32973. }
  32974. },
  32975. multiplyVector3Array: {
  32976. value: function (e) {
  32977. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."), this.applyToVector3Array(e)
  32978. }
  32979. }
  32980. }), Object.defineProperties(Ci.Matrix4.prototype, {
  32981. extractPosition: {
  32982. value: function (e) {
  32983. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."), this.copyPosition(e)
  32984. }
  32985. },
  32986. setRotationFromQuaternion: {
  32987. value: function (e) {
  32988. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."), this.makeRotationFromQuaternion(e)
  32989. }
  32990. },
  32991. multiplyVector3: {
  32992. value: function (e) {
  32993. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."), e.applyProjection(this)
  32994. }
  32995. },
  32996. multiplyVector4: {
  32997. value: function (e) {
  32998. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."), e.applyMatrix4(this)
  32999. }
  33000. },
  33001. multiplyVector3Array: {
  33002. value: function (e) {
  33003. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."), this.applyToVector3Array(e)
  33004. }
  33005. },
  33006. rotateAxis: {
  33007. value: function (e) {
  33008. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."), e.transformDirection(this)
  33009. }
  33010. },
  33011. crossVector: {
  33012. value: function (e) {
  33013. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."), e.applyMatrix4(this)
  33014. }
  33015. },
  33016. translate: {
  33017. value: function (e) {
  33018. console.error("THREE.Matrix4: .translate() has been removed.")
  33019. }
  33020. },
  33021. rotateX: {
  33022. value: function (e) {
  33023. console.error("THREE.Matrix4: .rotateX() has been removed.")
  33024. }
  33025. },
  33026. rotateY: {
  33027. value: function (e) {
  33028. console.error("THREE.Matrix4: .rotateY() has been removed.")
  33029. }
  33030. },
  33031. rotateZ: {
  33032. value: function (e) {
  33033. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  33034. }
  33035. },
  33036. rotateByAxis: {
  33037. value: function (e, t) {
  33038. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  33039. }
  33040. }
  33041. }), Object.defineProperties(Ci.Plane.prototype, {
  33042. isIntersectionLine: {
  33043. value: function (e) {
  33044. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."), this.intersectsLine(e)
  33045. }
  33046. }
  33047. }), Object.defineProperties(Ci.Quaternion.prototype, {
  33048. multiplyVector3: {
  33049. value: function (e) {
  33050. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."), e.applyQuaternion(this)
  33051. }
  33052. }
  33053. }), Object.defineProperties(Ci.Ray.prototype, {
  33054. isIntersectionBox: {
  33055. value: function (e) {
  33056. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(e)
  33057. }
  33058. },
  33059. isIntersectionPlane: {
  33060. value: function (e) {
  33061. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."), this.intersectsPlane(e)
  33062. }
  33063. },
  33064. isIntersectionSphere: {
  33065. value: function (e) {
  33066. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(e)
  33067. }
  33068. }
  33069. }), Object.defineProperties(Ci.Vector3.prototype, {
  33070. setEulerFromRotationMatrix: {
  33071. value: function () {
  33072. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  33073. }
  33074. },
  33075. setEulerFromQuaternion: {
  33076. value: function () {
  33077. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  33078. }
  33079. },
  33080. getPositionFromMatrix: {
  33081. value: function (e) {
  33082. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."), this.setFromMatrixPosition(e)
  33083. }
  33084. },
  33085. getScaleFromMatrix: {
  33086. value: function (e) {
  33087. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."), this.setFromMatrixScale(e)
  33088. }
  33089. },
  33090. getColumnFromMatrix: {
  33091. value: function (e, t) {
  33092. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."), this.setFromMatrixColumn(e, t)
  33093. }
  33094. }
  33095. }), Ci.Face4 = function (e, t, i, n, r, o, a) {
  33096. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."), new Ci.Face3(e, t, i, r, o, a)
  33097. }, Ci.Vertex = function (e, t, i) {
  33098. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."), new Ci.Vector3(e, t, i)
  33099. }, Object.defineProperties(Ci.Object3D.prototype, {
  33100. eulerOrder: {
  33101. get: function () {
  33102. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order
  33103. },
  33104. set: function (e) {
  33105. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order = e
  33106. }
  33107. },
  33108. getChildByName: {
  33109. value: function (e) {
  33110. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."), this.getObjectByName(e)
  33111. }
  33112. },
  33113. renderDepth: {
  33114. set: function (e) {
  33115. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  33116. }
  33117. },
  33118. translate: {
  33119. value: function (e, t) {
  33120. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."), this.translateOnAxis(t, e)
  33121. }
  33122. },
  33123. useQuaternion: {
  33124. get: function () {
  33125. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  33126. },
  33127. set: function (e) {
  33128. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  33129. }
  33130. }
  33131. }), Object.defineProperties(Ci, {
  33132. PointCloud: {
  33133. value: function (e, t) {
  33134. return console.warn("THREE.PointCloud has been renamed to THREE.Points."), new Ci.Points(e, t)
  33135. }
  33136. },
  33137. ParticleSystem: {
  33138. value: function (e, t) {
  33139. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."), new Ci.Points(e, t)
  33140. }
  33141. }
  33142. }), Object.defineProperties(Ci.Light.prototype, {
  33143. onlyShadow: {
  33144. set: function (e) {
  33145. console.warn("THREE.Light: .onlyShadow has been removed.")
  33146. }
  33147. },
  33148. shadowCameraFov: {
  33149. set: function (e) {
  33150. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."), this.shadow.camera.fov = e
  33151. }
  33152. },
  33153. shadowCameraLeft: {
  33154. set: function (e) {
  33155. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."), this.shadow.camera.left = e
  33156. }
  33157. },
  33158. shadowCameraRight: {
  33159. set: function (e) {
  33160. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."), this.shadow.camera.right = e
  33161. }
  33162. },
  33163. shadowCameraTop: {
  33164. set: function (e) {
  33165. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."), this.shadow.camera.top = e
  33166. }
  33167. },
  33168. shadowCameraBottom: {
  33169. set: function (e) {
  33170. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."), this.shadow.camera.bottom = e
  33171. }
  33172. },
  33173. shadowCameraNear: {
  33174. set: function (e) {
  33175. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."), this.shadow.camera.near = e
  33176. }
  33177. },
  33178. shadowCameraFar: {
  33179. set: function (e) {
  33180. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."), this.shadow.camera.far = e
  33181. }
  33182. },
  33183. shadowCameraVisible: {
  33184. set: function (e) {
  33185. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  33186. }
  33187. },
  33188. shadowBias: {
  33189. set: function (e) {
  33190. console.warn("THREE.Light: .shadowBias is now .shadow.bias."), this.shadow.bias = e
  33191. }
  33192. },
  33193. shadowDarkness: {
  33194. set: function (e) {
  33195. console.warn("THREE.Light: .shadowDarkness has been removed.")
  33196. }
  33197. },
  33198. shadowMapWidth: {
  33199. set: function (e) {
  33200. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."), this.shadow.mapSize.width = e
  33201. }
  33202. },
  33203. shadowMapHeight: {
  33204. set: function (e) {
  33205. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."), this.shadow.mapSize.height = e
  33206. }
  33207. }
  33208. }), Object.defineProperties(Ci.BufferAttribute.prototype, {
  33209. length: {
  33210. get: function () {
  33211. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."), this.array.length
  33212. }
  33213. }
  33214. }), Object.defineProperties(Ci.BufferGeometry.prototype, {
  33215. drawcalls: {
  33216. get: function () {
  33217. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."), this.groups
  33218. }
  33219. },
  33220. offsets: {
  33221. get: function () {
  33222. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."), this.groups
  33223. }
  33224. },
  33225. addIndex: {
  33226. value: function (e) {
  33227. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."), this.setIndex(e)
  33228. }
  33229. },
  33230. addDrawCall: {
  33231. value: function (e, t, i) {
  33232. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."), console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."), this.addGroup(e, t)
  33233. }
  33234. },
  33235. clearDrawCalls: {
  33236. value: function () {
  33237. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."), this.clearGroups()
  33238. }
  33239. },
  33240. computeTangents: {
  33241. value: function () {
  33242. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  33243. }
  33244. },
  33245. computeOffsets: {
  33246. value: function () {
  33247. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  33248. }
  33249. }
  33250. }), Object.defineProperties(Ci.Material.prototype, {
  33251. wrapAround: {
  33252. get: function () {
  33253. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  33254. },
  33255. set: function (e) {
  33256. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  33257. }
  33258. },
  33259. wrapRGB: {
  33260. get: function () {
  33261. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."), new Ci.Color
  33262. }
  33263. }
  33264. }), Object.defineProperties(Ci, {
  33265. PointCloudMaterial: {
  33266. value: function (e) {
  33267. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."), new Ci.PointsMaterial(e)
  33268. }
  33269. },
  33270. ParticleBasicMaterial: {
  33271. value: function (e) {
  33272. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."), new Ci.PointsMaterial(e)
  33273. }
  33274. },
  33275. ParticleSystemMaterial: {
  33276. value: function (e) {
  33277. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."), new Ci.PointsMaterial(e)
  33278. }
  33279. }
  33280. }), Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  33281. metal: {
  33282. get: function () {
  33283. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."), !1
  33284. },
  33285. set: function (e) {
  33286. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  33287. }
  33288. }
  33289. }), Object.defineProperties(Ci.ShaderMaterial.prototype, {
  33290. derivatives: {
  33291. get: function () {
  33292. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives
  33293. },
  33294. set: function (e) {
  33295. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives = e
  33296. }
  33297. }
  33298. }), Object.defineProperties(Ci.WebGLRenderer.prototype, {
  33299. supportsFloatTextures: {
  33300. value: function () {
  33301. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get("OES_texture_float")
  33302. }
  33303. },
  33304. supportsHalfFloatTextures: {
  33305. value: function () {
  33306. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get("OES_texture_half_float")
  33307. }
  33308. },
  33309. supportsStandardDerivatives: {
  33310. value: function () {
  33311. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get("OES_standard_derivatives")
  33312. }
  33313. },
  33314. supportsCompressedTextureS3TC: {
  33315. value: function () {
  33316. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."), this.extensions.get("WEBGL_compressed_texture_s3tc")
  33317. }
  33318. },
  33319. supportsCompressedTexturePVRTC: {
  33320. value: function () {
  33321. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."), this.extensions.get("WEBGL_compressed_texture_pvrtc")
  33322. }
  33323. },
  33324. supportsBlendMinMax: {
  33325. value: function () {
  33326. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get("EXT_blend_minmax")
  33327. }
  33328. },
  33329. supportsVertexTextures: {
  33330. value: function () {
  33331. return this.capabilities.vertexTextures
  33332. }
  33333. },
  33334. supportsInstancedArrays: {
  33335. value: function () {
  33336. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get("ANGLE_instanced_arrays")
  33337. }
  33338. },
  33339. enableScissorTest: {
  33340. value: function (e) {
  33341. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."), this.setScissorTest(e)
  33342. }
  33343. },
  33344. initMaterial: {
  33345. value: function () {
  33346. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  33347. }
  33348. },
  33349. addPrePlugin: {
  33350. value: function () {
  33351. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  33352. }
  33353. },
  33354. addPostPlugin: {
  33355. value: function () {
  33356. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  33357. }
  33358. },
  33359. updateShadowMap: {
  33360. value: function () {
  33361. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  33362. }
  33363. },
  33364. shadowMapEnabled: {
  33365. get: function () {
  33366. return this.shadowMap.enabled
  33367. },
  33368. set: function (e) {
  33369. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."), this.shadowMap.enabled = e
  33370. }
  33371. },
  33372. shadowMapType: {
  33373. get: function () {
  33374. return this.shadowMap.type
  33375. },
  33376. set: function (e) {
  33377. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."), this.shadowMap.type = e
  33378. }
  33379. },
  33380. shadowMapCullFace: {
  33381. get: function () {
  33382. return this.shadowMap.cullFace
  33383. },
  33384. set: function (e) {
  33385. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."), this.shadowMap.cullFace = e
  33386. }
  33387. }
  33388. }), Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  33389. wrapS: {
  33390. get: function () {
  33391. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS
  33392. },
  33393. set: function (e) {
  33394. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS = e
  33395. }
  33396. },
  33397. wrapT: {
  33398. get: function () {
  33399. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT
  33400. },
  33401. set: function (e) {
  33402. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT = e
  33403. }
  33404. },
  33405. magFilter: {
  33406. get: function () {
  33407. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter
  33408. },
  33409. set: function (e) {
  33410. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter = e
  33411. }
  33412. },
  33413. minFilter: {
  33414. get: function () {
  33415. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter
  33416. },
  33417. set: function (e) {
  33418. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter = e
  33419. }
  33420. },
  33421. anisotropy: {
  33422. get: function () {
  33423. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy
  33424. },
  33425. set: function (e) {
  33426. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy = e
  33427. }
  33428. },
  33429. offset: {
  33430. get: function () {
  33431. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset
  33432. },
  33433. set: function (e) {
  33434. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset = e
  33435. }
  33436. },
  33437. repeat: {
  33438. get: function () {
  33439. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat
  33440. },
  33441. set: function (e) {
  33442. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat = e
  33443. }
  33444. },
  33445. format: {
  33446. get: function () {
  33447. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format
  33448. },
  33449. set: function (e) {
  33450. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format = e
  33451. }
  33452. },
  33453. type: {
  33454. get: function () {
  33455. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type
  33456. },
  33457. set: function (e) {
  33458. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type = e
  33459. }
  33460. },
  33461. generateMipmaps: {
  33462. get: function () {
  33463. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps
  33464. },
  33465. set: function (e) {
  33466. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps = e
  33467. }
  33468. }
  33469. }), Ci.GeometryUtils = {
  33470. merge: function (e, t, i) {
  33471. var n;
  33472. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."), t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(), n = t.matrix, t = t.geometry), e.merge(t, n, i)
  33473. },
  33474. center: function (e) {
  33475. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."), e.center()
  33476. }
  33477. }, Ci.ImageUtils = {
  33478. crossOrigin: void 0,
  33479. loadTexture: function (e, t, i, n) {
  33480. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  33481. var r = new Ci.TextureLoader;
  33482. r.setCrossOrigin(this.crossOrigin);
  33483. var o = r.load(e, i, void 0, n);
  33484. return t && (o.mapping = t), o
  33485. },
  33486. loadTextureCube: function (e, t, i, n) {
  33487. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  33488. var r = new Ci.CubeTextureLoader;
  33489. r.setCrossOrigin(this.crossOrigin);
  33490. var o = r.load(e, i, void 0, n);
  33491. return t && (o.mapping = t), o
  33492. },
  33493. loadCompressedTexture: function () {
  33494. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  33495. },
  33496. loadCompressedTextureCube: function () {
  33497. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  33498. }
  33499. }, Ci.Projector = function () {
  33500. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."), this.projectVector = function (e, t) {
  33501. console.warn("THREE.Projector: .projectVector() is now vector.project()."), e.project(t)
  33502. }, this.unprojectVector = function (e, t) {
  33503. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."), e.unproject(t)
  33504. }, this.pickingRay = function (e, t) {
  33505. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  33506. }
  33507. }, Ci.CanvasRenderer = function () {
  33508. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"), this.domElement = document.createElement("canvas"), this.clear = function () {}, this.render = function () {}, this.setClearColor = function () {}, this.setSize = function () {}
  33509. }, Ci.MeshFaceMaterial = Ci.MultiMaterial, Ci.CurveUtils = {
  33510. tangentQuadraticBezier: function (e, t, i, n) {
  33511. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  33512. },
  33513. tangentCubicBezier: function (e, t, i, n, r) {
  33514. 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
  33515. },
  33516. tangentSpline: function (e, t, i, n, r) {
  33517. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  33518. },
  33519. interpolate: function (e, t, i, n, r) {
  33520. var o = .5 * (i - e),
  33521. a = .5 * (n - t),
  33522. s = r * r;
  33523. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  33524. }
  33525. }, Ci.SceneUtils = {
  33526. createMultiMaterialObject: function (e, t) {
  33527. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++) i.add(new Ci.Mesh(e, t[n]));
  33528. return i
  33529. },
  33530. detach: function (e, t, i) {
  33531. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e)
  33532. },
  33533. attach: function (e, t, i) {
  33534. var n = new Ci.Matrix4;
  33535. n.getInverse(i.matrixWorld), e.applyMatrix(n), t.remove(e), i.add(e)
  33536. }
  33537. }, Ci.ShapeUtils = {
  33538. area: function (e) {
  33539. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++) i += e[n].x * e[r].y - e[r].x * e[n].y;
  33540. return .5 * i
  33541. },
  33542. triangulate: function (e, t) {
  33543. var i = e.length;
  33544. if (i < 3) return null;
  33545. var n, r, o, a = [],
  33546. s = [],
  33547. l = [];
  33548. if (0 < Ci.ShapeUtils.area(e))
  33549. for (r = 0; r < i; r++) s[r] = r;
  33550. else
  33551. for (r = 0; r < i; r++) s[r] = i - 1 - r;
  33552. var c = i,
  33553. h = 2 * c;
  33554. for (r = c - 1; 2 < c;) {
  33555. if (h-- <= 0) return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"), t ? l : a;
  33556. if (c <= (n = r) && (n = 0), c <= (r = n + 1) && (r = 0), c <= (o = r + 1) && (o = 0), Si(e, n, r, o, c, s)) {
  33557. var u, d, p, f, g;
  33558. for (u = s[n], d = s[r], p = s[o], a.push([e[u], e[d], e[p]]), l.push([s[n], s[r], s[o]]), g = (f = r) + 1; g < c; f++, g++) s[f] = s[g];
  33559. h = 2 * --c
  33560. }
  33561. }
  33562. return t ? l : a
  33563. },
  33564. triangulateShape: function (e, t) {
  33565. function w(e, t, i) {
  33566. 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
  33567. }
  33568. function b(e, t, i, n, r) {
  33569. var o = t.x - e.x,
  33570. a = t.y - e.y,
  33571. s = n.x - i.x,
  33572. l = n.y - i.y,
  33573. c = e.x - i.x,
  33574. h = e.y - i.y,
  33575. u = a * s - o * l,
  33576. d = a * c - o * h;
  33577. if (Math.abs(u) > Number.EPSILON) {
  33578. var p;
  33579. if (0 < u) {
  33580. if (d < 0 || u < d) return [];
  33581. if ((p = l * c - s * h) < 0 || u < p) return []
  33582. } else {
  33583. if (0 < d || d < u) return [];
  33584. if (0 < (p = l * c - s * h) || p < u) return []
  33585. }
  33586. if (0 === p) return !r || 0 != d && d != u ? [e] : [];
  33587. if (p === u) return !r || 0 != d && d != u ? [t] : [];
  33588. if (0 == d) return [i];
  33589. if (d == u) return [n];
  33590. var f = p / u;
  33591. return [{
  33592. x: e.x + f * o,
  33593. y: e.y + f * a
  33594. }]
  33595. }
  33596. if (0 != d || l * c != s * h) return [];
  33597. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a,
  33598. b = 0 == s && 0 == l;
  33599. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x, (m = t).x) : (v = (g = t).x, (m = e).x), i.x < n.x ? (I = (A = i).x, (C = n).x) : (I = (A = n).x, (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y, (m = t).y) : (v = (g = t).y, (m = e).y), i.y < n.y ? (I = (A = i).y, (C = n).y) : (I = (A = n).y, (C = i).y)), v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  33600. }
  33601. function T(e, t, i, n) {
  33602. var r = t.x - e.x,
  33603. o = t.y - e.y,
  33604. a = i.x - e.x,
  33605. s = i.y - e.y,
  33606. l = n.x - e.x,
  33607. c = n.y - e.y,
  33608. h = r * s - o * a,
  33609. u = r * c - o * l;
  33610. if (Math.abs(h) > Number.EPSILON) {
  33611. var d = l * s - c * a;
  33612. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  33613. }
  33614. return 0 < u
  33615. }
  33616. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++) Array.prototype.push.apply(c, t[h]);
  33617. for (i = 0, n = c.length; i < n; i++) void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a), l[a] = i;
  33618. var d = function (e, a) {
  33619. function t(e, t) {
  33620. var i = m.length - 1,
  33621. n = e - 1;
  33622. n < 0 && (n = i);
  33623. var r = e + 1;
  33624. i < r && (r = 0);
  33625. var o = T(m[e], m[n], m[r], c[t]);
  33626. if (!o) return !1;
  33627. var a = c.length - 1,
  33628. s = t - 1;
  33629. s < 0 && (s = a);
  33630. var l = t + 1;
  33631. return a < l && (l = 0), !!(o = T(c[t], c[s], c[l], m[e]))
  33632. }
  33633. function i(e, t) {
  33634. var i, n;
  33635. for (i = 0; i < m.length; i++)
  33636. if (n = i + 1, n %= m.length, 0 < b(e, t, m[i], m[n], !0).length) return !0;
  33637. return !1
  33638. }
  33639. function n(e, t) {
  33640. var i, n, r, o;
  33641. for (i = 0; i < v.length; i++)
  33642. for (n = a[v[i]], r = 0; r < n.length; r++)
  33643. if (o = r + 1, o %= n.length, 0 < b(e, t, n[r], n[o], !0).length) return !0;
  33644. return !1
  33645. }
  33646. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++) v.push(A);
  33647. for (var I = 0, E = 2 * v.length; 0 < v.length;) {
  33648. if (--E < 0) {
  33649. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  33650. break
  33651. }
  33652. for (o = I; o < m.length; o++) {
  33653. s = m[o], r = -1;
  33654. for (A = 0; A < v.length; A++)
  33655. if (h = v[A], void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  33656. c = a[h];
  33657. for (var _ = 0; _ < c.length; _++)
  33658. if (l = c[_], t(o, _) && !i(s, l) && !n(s, l)) {
  33659. r = _, v.splice(A, 1), d = m.slice(0, o + 1), p = m.slice(o), f = c.slice(r), g = c.slice(0, r + 1), m = d.concat(f).concat(g).concat(p), I = o;
  33660. break
  33661. } if (0 <= r) break;
  33662. y[u] = !0
  33663. } if (0 <= r) break
  33664. }
  33665. }
  33666. return m
  33667. }(e, t),
  33668. p = Ci.ShapeUtils.triangulate(d, !1);
  33669. for (i = 0, n = p.length; i < n; i++)
  33670. for (o = p[i], r = 0; r < 3; r++) void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  33671. return p.concat()
  33672. },
  33673. isClockWise: function (e) {
  33674. return Ci.ShapeUtils.area(e) < 0
  33675. },
  33676. b2: function (e, t, i, n) {
  33677. return function (e, t) {
  33678. var i = 1 - e;
  33679. return i * i * t
  33680. }(e, t) + function (e, t) {
  33681. return 2 * (1 - e) * e * t
  33682. }(e, i) + function (e, t) {
  33683. return e * e * t
  33684. }(e, n)
  33685. },
  33686. b3: function (e, t, i, n, r) {
  33687. return function (e, t) {
  33688. var i = 1 - e;
  33689. return i * i * i * t
  33690. }(e, t) + function (e, t) {
  33691. var i = 1 - e;
  33692. return 3 * i * i * e * t
  33693. }(e, i) + function (e, t) {
  33694. return 3 * (1 - e) * e * e * t
  33695. }(e, n) + function (e, t) {
  33696. return e * e * e * t
  33697. }(e, r)
  33698. }
  33699. }, Ci.Curve = function () {}, Ci.Curve.prototype = {
  33700. constructor: Ci.Curve,
  33701. getPoint: function (e) {
  33702. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"), null
  33703. },
  33704. getPointAt: function (e) {
  33705. var t = this.getUtoTmapping(e);
  33706. return this.getPoint(t)
  33707. },
  33708. getPoints: function (e) {
  33709. e = e || 5;
  33710. var t, i = [];
  33711. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e));
  33712. return i
  33713. },
  33714. getSpacedPoints: function (e) {
  33715. e = e || 5;
  33716. var t, i = [];
  33717. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e));
  33718. return i
  33719. },
  33720. getLength: function () {
  33721. var e = this.getLengths();
  33722. return e[e.length - 1]
  33723. },
  33724. getLengths: function (e) {
  33725. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200), this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate) return this.cacheArcLengths;
  33726. this.needsUpdate = !1;
  33727. var t, i, n = [],
  33728. r = this.getPoint(0),
  33729. o = 0;
  33730. for (n.push(0), i = 1; i <= e; i++) o += (t = this.getPoint(i / e)).distanceTo(r), n.push(o), r = t;
  33731. return this.cacheArcLengths = n
  33732. },
  33733. updateArcLengths: function () {
  33734. this.needsUpdate = !0, this.getLengths()
  33735. },
  33736. getUtoTmapping: function (e, t) {
  33737. var i, n = this.getLengths(),
  33738. r = 0,
  33739. o = n.length;
  33740. i = t || e * n[o - 1];
  33741. for (var a, s = 0, l = o - 1; s <= l;)
  33742. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0) s = r + 1;
  33743. else {
  33744. if (!(0 < a)) {
  33745. l = r;
  33746. break
  33747. }
  33748. l = r - 1
  33749. } if (n[r = l] === i) return r / (o - 1);
  33750. var c = n[r];
  33751. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  33752. },
  33753. getTangent: function (e) {
  33754. var t = e - 1e-4,
  33755. i = e + 1e-4;
  33756. t < 0 && (t = 0), 1 < i && (i = 1);
  33757. var n = this.getPoint(t);
  33758. return this.getPoint(i).clone().sub(n).normalize()
  33759. },
  33760. getTangentAt: function (e) {
  33761. var t = this.getUtoTmapping(e);
  33762. return this.getTangent(t)
  33763. }
  33764. }, Ci.Curve.create = function (e, t) {
  33765. return e.prototype = Object.create(Ci.Curve.prototype), (e.prototype.constructor = e).prototype.getPoint = t, e
  33766. }, Ci.CurvePath = function () {
  33767. this.curves = [], this.autoClose = !1
  33768. }, Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype), Ci.CurvePath.prototype.constructor = Ci.CurvePath, Ci.CurvePath.prototype.add = function (e) {
  33769. this.curves.push(e)
  33770. }, Ci.CurvePath.prototype.closePath = function () {
  33771. var e = this.curves[0].getPoint(0),
  33772. t = this.curves[this.curves.length - 1].getPoint(1);
  33773. e.equals(t) || this.curves.push(new Ci.LineCurve(t, e))
  33774. }, Ci.CurvePath.prototype.getPoint = function (e) {
  33775. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length;) {
  33776. if (i[n] >= t) {
  33777. var r = i[n] - t,
  33778. o = this.curves[n],
  33779. a = 1 - r / o.getLength();
  33780. return o.getPointAt(a)
  33781. }
  33782. n++
  33783. }
  33784. return null
  33785. }, Ci.CurvePath.prototype.getLength = function () {
  33786. var e = this.getCurveLengths();
  33787. return e[e.length - 1]
  33788. }, Ci.CurvePath.prototype.getCurveLengths = function () {
  33789. if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths;
  33790. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++) t += this.curves[i].getLength(), e.push(t);
  33791. return this.cacheLengths = e
  33792. }, Ci.CurvePath.prototype.createPointsGeometry = function (e) {
  33793. var t = this.getPoints(e);
  33794. return this.createGeometry(t)
  33795. }, Ci.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  33796. var t = this.getSpacedPoints(e);
  33797. return this.createGeometry(t)
  33798. }, Ci.CurvePath.prototype.createGeometry = function (e) {
  33799. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  33800. var r = e[i];
  33801. t.vertices.push(new Ci.Vector3(r.x, r.y, r.z || 0))
  33802. }
  33803. return t
  33804. }, Ci.Font = function (e) {
  33805. this.data = e
  33806. }, Ci.Font.prototype = {
  33807. constructor: Ci.Font,
  33808. generateShapes: function (e, s, b) {
  33809. function l(e, t, i) {
  33810. var n = w.glyphs[e] || w.glyphs["?"];
  33811. if (n) {
  33812. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path,
  33813. m = [],
  33814. v = Ci.ShapeUtils.b2,
  33815. y = Ci.ShapeUtils.b3;
  33816. if (n.o)
  33817. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I;) {
  33818. switch (A[C++]) {
  33819. case "m":
  33820. r = A[C++] * t + i, o = A[C++] * t, g.moveTo(r, o);
  33821. break;
  33822. case "l":
  33823. r = A[C++] * t + i, o = A[C++] * t, g.lineTo(r, o);
  33824. break;
  33825. case "q":
  33826. if (a = A[C++] * t + i, s = A[C++] * t, h = A[C++] * t + i, u = A[C++] * t, g.quadraticCurveTo(h, u, a, s), f = m[m.length - 1]) {
  33827. l = f.x, c = f.y;
  33828. for (var E = 1; E <= b; E++) {
  33829. v(_ = E / b, l, h, a), v(_, c, u, s)
  33830. }
  33831. }
  33832. break;
  33833. case "b":
  33834. if (a = A[C++] * t + i, s = A[C++] * t, h = A[C++] * t + i, u = A[C++] * t, d = A[C++] * t + i, p = A[C++] * t, g.bezierCurveTo(h, u, d, p, a, s), f = m[m.length - 1]) {
  33835. l = f.x, c = f.y;
  33836. for (E = 1; E <= b; E++) {
  33837. var _;
  33838. y(_ = E / b, l, h, d, a), y(_, c, u, p, s)
  33839. }
  33840. }
  33841. }
  33842. }
  33843. return {
  33844. offset: n.ha * t,
  33845. path: g
  33846. }
  33847. }
  33848. }
  33849. void 0 === s && (s = 100), void 0 === b && (b = 4);
  33850. for (var w = this.data, t = function (e) {
  33851. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  33852. var a = l(t[o], i, n);
  33853. n += a.offset, r.push(a.path)
  33854. }
  33855. return r
  33856. }(e), i = [], n = 0, r = t.length; n < r; n++) Array.prototype.push.apply(i, t[n].toShapes());
  33857. return i
  33858. }
  33859. }, Ci.Path = function (e) {
  33860. Ci.CurvePath.call(this), this.actions = [], e && this.fromPoints(e)
  33861. }, Ci.Path.prototype = Object.create(Ci.CurvePath.prototype), Ci.Path.prototype.constructor = Ci.Path, Ci.Path.prototype.fromPoints = function (e) {
  33862. this.moveTo(e[0].x, e[0].y);
  33863. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y)
  33864. }, Ci.Path.prototype.moveTo = function (e, t) {
  33865. this.actions.push({
  33866. action: "moveTo",
  33867. args: [e, t]
  33868. })
  33869. }, Ci.Path.prototype.lineTo = function (e, t) {
  33870. var i = this.actions[this.actions.length - 1].args,
  33871. n = i[i.length - 2],
  33872. r = i[i.length - 1],
  33873. o = new Ci.LineCurve(new Ci.Vector2(n, r), new Ci.Vector2(e, t));
  33874. this.curves.push(o), this.actions.push({
  33875. action: "lineTo",
  33876. args: [e, t]
  33877. })
  33878. }, Ci.Path.prototype.quadraticCurveTo = function (e, t, i, n) {
  33879. var r = this.actions[this.actions.length - 1].args,
  33880. o = r[r.length - 2],
  33881. a = r[r.length - 1],
  33882. s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o, a), new Ci.Vector2(e, t), new Ci.Vector2(i, n));
  33883. this.curves.push(s), this.actions.push({
  33884. action: "quadraticCurveTo",
  33885. args: [e, t, i, n]
  33886. })
  33887. }, Ci.Path.prototype.bezierCurveTo = function (e, t, i, n, r, o) {
  33888. var a = this.actions[this.actions.length - 1].args,
  33889. s = a[a.length - 2],
  33890. l = a[a.length - 1],
  33891. c = new Ci.CubicBezierCurve(new Ci.Vector2(s, l), new Ci.Vector2(e, t), new Ci.Vector2(i, n), new Ci.Vector2(r, o));
  33892. this.curves.push(c), this.actions.push({
  33893. action: "bezierCurveTo",
  33894. args: [e, t, i, n, r, o]
  33895. })
  33896. }, Ci.Path.prototype.splineThru = function (e) {
  33897. var t = Array.prototype.slice.call(arguments),
  33898. i = this.actions[this.actions.length - 1].args,
  33899. n = i[i.length - 2],
  33900. r = i[i.length - 1],
  33901. o = [new Ci.Vector2(n, r)];
  33902. Array.prototype.push.apply(o, e);
  33903. var a = new Ci.SplineCurve(o);
  33904. this.curves.push(a), this.actions.push({
  33905. action: "splineThru",
  33906. args: t
  33907. })
  33908. }, Ci.Path.prototype.arc = function (e, t, i, n, r, o) {
  33909. var a = this.actions[this.actions.length - 1].args,
  33910. s = a[a.length - 2],
  33911. l = a[a.length - 1];
  33912. this.absarc(e + s, t + l, i, n, r, o)
  33913. }, Ci.Path.prototype.absarc = function (e, t, i, n, r, o) {
  33914. this.absellipse(e, t, i, i, n, r, o)
  33915. }, Ci.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  33916. var l = this.actions[this.actions.length - 1].args,
  33917. c = l[l.length - 2],
  33918. h = l[l.length - 1];
  33919. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  33920. }, Ci.Path.prototype.absellipse = function (e, t, i, n, r, o, a, s) {
  33921. var l = [e, t, i, n, r, o, a, s || 0],
  33922. c = new Ci.EllipseCurve(e, t, i, n, r, o, a, s);
  33923. this.curves.push(c);
  33924. var h = c.getPoint(1);
  33925. l.push(h.x), l.push(h.y), this.actions.push({
  33926. action: "ellipse",
  33927. args: l
  33928. })
  33929. }, Ci.Path.prototype.getSpacedPoints = function (e) {
  33930. e = e || 40;
  33931. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e));
  33932. return this.autoClose && t.push(t[0]), t
  33933. }, Ci.Path.prototype.getPoints = function (e) {
  33934. e = e || 12;
  33935. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  33936. var v = this.actions[g],
  33937. y = v.action,
  33938. A = v.args;
  33939. switch (y) {
  33940. case "moveTo":
  33941. case "lineTo":
  33942. f.push(new Ci.Vector2(A[0], A[1]));
  33943. break;
  33944. case "quadraticCurveTo":
  33945. t = A[2], i = A[3], o = A[0], a = A[1], l = 0 < f.length ? (s = (c = f[f.length - 1]).x, c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2], c[c.length - 1]);
  33946. for (var C = 1; C <= e; C++) {
  33947. h = d(O = C / e, s, o, t), u = d(O, l, a, i), f.push(new Ci.Vector2(h, u))
  33948. }
  33949. break;
  33950. case "bezierCurveTo":
  33951. t = A[4], i = A[5], o = A[0], a = A[1], n = A[2], r = A[3], l = 0 < f.length ? (s = (c = f[f.length - 1]).x, c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2], c[c.length - 1]);
  33952. for (C = 1; C <= e; C++) {
  33953. h = p(O = C / e, s, o, n, t), u = p(O, l, a, r, i), f.push(new Ci.Vector2(h, u))
  33954. }
  33955. break;
  33956. case "splineThru":
  33957. c = this.actions[g - 1].args;
  33958. var I = [new Ci.Vector2(c[c.length - 2], c[c.length - 1])],
  33959. E = e * A[0].length;
  33960. I = I.concat(A[0]);
  33961. var _ = new Ci.SplineCurve(I);
  33962. for (C = 1; C <= E; C++) f.push(_.getPointAt(C / E));
  33963. break;
  33964. case "arc":
  33965. var b = A[0],
  33966. w = A[1],
  33967. T = A[2],
  33968. x = A[3],
  33969. S = A[4],
  33970. M = !!A[5],
  33971. R = S - x,
  33972. P = 2 * e;
  33973. for (C = 1; C <= P; C++) {
  33974. var O = C / P;
  33975. M || (O = 1 - O), L = x + O * R, h = b + T * Math.cos(L), u = w + T * Math.sin(L), f.push(new Ci.Vector2(h, u))
  33976. }
  33977. break;
  33978. case "ellipse":
  33979. b = A[0], w = A[1];
  33980. var L, D, N, F = A[2],
  33981. B = A[3],
  33982. V = (x = A[4], S = A[5], M = !!A[6], A[7]);
  33983. R = S - x, P = 2 * e;
  33984. 0 !== V && (D = Math.cos(V), N = Math.sin(V));
  33985. for (C = 1; C <= P; C++) {
  33986. O = C / P;
  33987. if (M || (O = 1 - O), L = x + O * R, h = b + F * Math.cos(L), u = w + B * Math.sin(L), 0 !== V) {
  33988. var k = h;
  33989. h = (k - b) * D - (u - w) * N + b, u = (k - b) * N + (u - w) * D + w
  33990. }
  33991. f.push(new Ci.Vector2(h, u))
  33992. }
  33993. }
  33994. }
  33995. var U = f[f.length - 1];
  33996. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1), this.autoClose && f.push(f[0]), f
  33997. }, Ci.Path.prototype.toShapes = function (e, t) {
  33998. function i(e) {
  33999. for (var t = [], i = 0, n = e.length; i < n; i++) {
  34000. var r = e[i],
  34001. o = new Ci.Shape;
  34002. o.actions = r.actions, o.curves = r.curves, t.push(o)
  34003. }
  34004. return t
  34005. }
  34006. function n(e, t) {
  34007. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  34008. var a = t[r],
  34009. s = t[o],
  34010. l = s.x - a.x,
  34011. c = s.y - a.y;
  34012. if (Math.abs(c) > Number.EPSILON) {
  34013. if (c < 0 && (a = t[o], l = -l, s = t[r], c = -c), e.y < a.y || e.y > s.y) continue;
  34014. if (e.y === a.y) {
  34015. if (e.x === a.x) return !0
  34016. } else {
  34017. var h = c * (e.x - a.x) - l * (e.y - a.y);
  34018. if (0 == h) return !0;
  34019. if (h < 0) continue;
  34020. n = !n
  34021. }
  34022. } else {
  34023. if (e.y !== a.y) continue;
  34024. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x) return !0
  34025. }
  34026. }
  34027. return n
  34028. }
  34029. var r = Ci.ShapeUtils.isClockWise,
  34030. o = function (e) {
  34031. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  34032. var o = e[n],
  34033. a = o.args,
  34034. s = o.action;
  34035. "moveTo" === s && 0 !== i.actions.length && (t.push(i), i = new Ci.Path), i[s].apply(i, a)
  34036. }
  34037. return 0 !== i.actions.length && t.push(i), t
  34038. }(this.actions);
  34039. if (0 === o.length) return [];
  34040. if (!0 === t) return i(o);
  34041. var a, s, l, c = [];
  34042. if (1 === o.length) return s = o[0], (l = new Ci.Shape).actions = s.actions, l.curves = s.curves, c.push(l), c;
  34043. var h = !r(o[0].getPoints());
  34044. h = e ? !h : h;
  34045. var u, d = [],
  34046. p = [],
  34047. f = [],
  34048. g = 0;
  34049. p[g] = void 0, f[g] = [];
  34050. for (var m = 0, v = o.length; m < v; m++) a = r(u = (s = o[m]).getPoints()), (a = e ? !a : a) ? (!h && p[g] && g++, p[g] = {
  34051. s: new Ci.Shape,
  34052. p: u
  34053. }, p[g].s.actions = s.actions, p[g].s.curves = s.curves, h && g++, f[g] = []) : f[g].push({
  34054. h: s,
  34055. p: u[0]
  34056. });
  34057. if (!p[0]) return i(o);
  34058. if (1 < p.length) {
  34059. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++) d[C] = [];
  34060. for (C = 0, I = p.length; C < I; C++)
  34061. for (var E = f[C], _ = 0; _ < E.length; _++) {
  34062. for (var b = E[_], w = !0, T = 0; T < p.length; T++) n(b.p, p[T].p) && (C !== T && A.push({
  34063. froms: C,
  34064. tos: T,
  34065. hole: _
  34066. }), w ? (w = !1, d[T].push(b)) : y = !0);
  34067. w && d[C].push(b)
  34068. }
  34069. 0 < A.length && (y || (f = d))
  34070. }
  34071. m = 0;
  34072. for (var x, S = p.length; m < S; m++) {
  34073. l = p[m].s, c.push(l);
  34074. for (var M = 0, R = (x = f[m]).length; M < R; M++) l.holes.push(x[M].h)
  34075. }
  34076. return c
  34077. }, Ci.Shape = function () {
  34078. Ci.Path.apply(this, arguments), this.holes = []
  34079. }, Ci.Shape.prototype = Object.create(Ci.Path.prototype), Ci.Shape.prototype.constructor = Ci.Shape, Ci.Shape.prototype.extrude = function (e) {
  34080. return new Ci.ExtrudeGeometry(this, e)
  34081. }, Ci.Shape.prototype.makeGeometry = function (e) {
  34082. return new Ci.ShapeGeometry(this, e)
  34083. }, Ci.Shape.prototype.getPointsHoles = function (e) {
  34084. for (var t = [], i = 0, n = this.holes.length; i < n; i++) t[i] = this.holes[i].getPoints(e);
  34085. return t
  34086. }, Ci.Shape.prototype.extractAllPoints = function (e) {
  34087. return {
  34088. shape: this.getPoints(e),
  34089. holes: this.getPointsHoles(e)
  34090. }
  34091. }, Ci.Shape.prototype.extractPoints = function (e) {
  34092. return this.extractAllPoints(e)
  34093. }, Ci.LineCurve = function (e, t) {
  34094. this.v1 = e, this.v2 = t
  34095. }, Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype), Ci.LineCurve.prototype.constructor = Ci.LineCurve, Ci.LineCurve.prototype.getPoint = function (e) {
  34096. var t = this.v2.clone().sub(this.v1);
  34097. return t.multiplyScalar(e).add(this.v1), t
  34098. }, Ci.LineCurve.prototype.getPointAt = function (e) {
  34099. return this.getPoint(e)
  34100. }, Ci.LineCurve.prototype.getTangent = function (e) {
  34101. return this.v2.clone().sub(this.v1).normalize()
  34102. }, Ci.QuadraticBezierCurve = function (e, t, i) {
  34103. this.v0 = e, this.v1 = t, this.v2 = i
  34104. }, Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype), Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve, Ci.QuadraticBezierCurve.prototype.getPoint = function (e) {
  34105. var t = Ci.ShapeUtils.b2;
  34106. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y))
  34107. }, Ci.QuadraticBezierCurve.prototype.getTangent = function (e) {
  34108. var t = Ci.CurveUtils.tangentQuadraticBezier;
  34109. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  34110. }, Ci.CubicBezierCurve = function (e, t, i, n) {
  34111. this.v0 = e, this.v1 = t, this.v2 = i, this.v3 = n
  34112. }, Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype), Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve, Ci.CubicBezierCurve.prototype.getPoint = function (e) {
  34113. var t = Ci.ShapeUtils.b3;
  34114. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  34115. }, Ci.CubicBezierCurve.prototype.getTangent = function (e) {
  34116. var t = Ci.CurveUtils.tangentCubicBezier;
  34117. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  34118. }, Ci.SplineCurve = function (e) {
  34119. this.points = null == e ? [] : e
  34120. }, Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype), Ci.SplineCurve.prototype.constructor = Ci.SplineCurve, Ci.SplineCurve.prototype.getPoint = function (e) {
  34121. var t = this.points,
  34122. i = (t.length - 1) * e,
  34123. n = Math.floor(i),
  34124. r = i - n,
  34125. o = t[0 === n ? n : n - 1],
  34126. a = t[n],
  34127. s = t[n > t.length - 2 ? t.length - 1 : n + 1],
  34128. l = t[n > t.length - 3 ? t.length - 1 : n + 2],
  34129. c = Ci.CurveUtils.interpolate;
  34130. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r), c(o.y, a.y, s.y, l.y, r))
  34131. }, Ci.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  34132. this.aX = e, this.aY = t, this.xRadius = i, this.yRadius = n, this.aStartAngle = r, this.aEndAngle = o, this.aClockwise = a, this.aRotation = s || 0
  34133. }, Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype), Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve, Ci.EllipseCurve.prototype.getPoint = function (e) {
  34134. var t, i = this.aEndAngle - this.aStartAngle;
  34135. i < 0 && (i += 2 * Math.PI), i > 2 * Math.PI && (i -= 2 * Math.PI), t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  34136. var n = this.aX + this.xRadius * Math.cos(t),
  34137. r = this.aY + this.yRadius * Math.sin(t);
  34138. if (0 !== this.aRotation) {
  34139. var o = Math.cos(this.aRotation),
  34140. a = Math.sin(this.aRotation),
  34141. s = n,
  34142. l = r;
  34143. n = (s - this.aX) * o - (l - this.aY) * a + this.aX, r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  34144. }
  34145. return new Ci.Vector2(n, r)
  34146. }, Ci.ArcCurve = function (e, t, i, n, r, o) {
  34147. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  34148. }, Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype), Ci.ArcCurve.prototype.constructor = Ci.ArcCurve, Ci.LineCurve3 = Ci.Curve.create(function (e, t) {
  34149. this.v1 = e, this.v2 = t
  34150. }, function (e) {
  34151. var t = new Ci.Vector3;
  34152. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t
  34153. }), Ci.QuadraticBezierCurve3 = Ci.Curve.create(function (e, t, i) {
  34154. this.v0 = e, this.v1 = t, this.v2 = i
  34155. }, function (e) {
  34156. var t = Ci.ShapeUtils.b2;
  34157. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x), t(e, this.v0.y, this.v1.y, this.v2.y), t(e, this.v0.z, this.v1.z, this.v2.z))
  34158. }), Ci.CubicBezierCurve3 = Ci.Curve.create(function (e, t, i, n) {
  34159. this.v0 = e, this.v1 = t, this.v2 = i, this.v3 = n
  34160. }, function (e) {
  34161. var t = Ci.ShapeUtils.b3;
  34162. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x), t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y), t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  34163. }), Ci.SplineCurve3 = Ci.Curve.create(function (e) {
  34164. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"), this.points = null == e ? [] : e
  34165. }, function (e) {
  34166. var t = this.points,
  34167. i = (t.length - 1) * e,
  34168. n = Math.floor(i),
  34169. r = i - n,
  34170. o = t[0 == n ? n : n - 1],
  34171. a = t[n],
  34172. s = t[n > t.length - 2 ? t.length - 1 : n + 1],
  34173. l = t[n > t.length - 3 ? t.length - 1 : n + 2],
  34174. c = Ci.CurveUtils.interpolate;
  34175. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r), c(o.y, a.y, s.y, l.y, r), c(o.z, a.z, s.z, l.z, r))
  34176. }), Ci.CatmullRomCurve3 = (qt = new Ci.Vector3, Xt = new xi, Zt = new xi, Kt = new xi, xi.prototype.init = function (e, t, i, n) {
  34177. this.c0 = e, this.c1 = i, this.c2 = -3 * e + 3 * t - 2 * i - n, this.c3 = 2 * e - 2 * t + i + n
  34178. }, xi.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  34179. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  34180. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  34181. s *= o, l *= o, this.init(t, i, s, l)
  34182. }, xi.prototype.initCatmullRom = function (e, t, i, n, r) {
  34183. this.init(t, i, r * (i - e), r * (n - t))
  34184. }, xi.prototype.calc = function (e) {
  34185. var t = e * e,
  34186. i = t * e;
  34187. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  34188. }, Ci.Curve.create(function (e) {
  34189. this.points = e || [], this.closed = !1
  34190. }, function (e) {
  34191. var t, i, n, r, o, a, s, l, c = this.points;
  34192. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"), n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)), this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2, n = 1), o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]), qt), a = c[i % r], s = c[(i + 1) % r], l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]), qt), void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  34193. var h = "chordal" === this.type ? .5 : .25,
  34194. u = Math.pow(o.distanceToSquared(a), h),
  34195. d = Math.pow(a.distanceToSquared(s), h),
  34196. p = Math.pow(s.distanceToSquared(l), h);
  34197. d < 1e-4 && (d = 1), u < 1e-4 && (u = d), p < 1e-4 && (p = d), Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p), Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p), Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  34198. } else if ("catmullrom" === this.type) {
  34199. var f = void 0 !== this.tension ? this.tension : .5;
  34200. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f), Zt.initCatmullRom(o.y, a.y, s.y, l.y, f), Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  34201. }
  34202. return new Ci.Vector3(Xt.calc(n), Zt.calc(n), Kt.calc(n))
  34203. })), Ci.ClosedSplineCurve3 = function (e) {
  34204. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."), Ci.CatmullRomCurve3.call(this, e), this.type = "catmullrom", this.closed = !0
  34205. }, Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype), Ci.BoxGeometry = function (e, t, i, n, r, o) {
  34206. Ci.Geometry.call(this), this.type = "BoxGeometry", this.parameters = {
  34207. width: e,
  34208. height: t,
  34209. depth: i,
  34210. widthSegments: n,
  34211. heightSegments: r,
  34212. depthSegments: o
  34213. }, this.fromBufferGeometry(new Ci.BoxBufferGeometry(e, t, i, n, r, o)), this.mergeVertices()
  34214. }, Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry, Ci.CubeGeometry = Ci.BoxGeometry, Ci.BoxBufferGeometry = function (e, t, i, n, r, o) {
  34215. function a(e, t, i, n, r, o, a, s, l, c, h) {
  34216. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  34217. for (var E = I * d - f, _ = 0; _ < m; _++) {
  34218. var b = _ * u - p;
  34219. C[e] = b * n, C[t] = E * r, C[i] = g, P[D] = C.x, P[D + 1] = C.y, P[D + 2] = C.z, C[e] = 0, C[t] = 0, C[i] = 0 < s ? 1 : -1, O[D] = C.x, O[D + 1] = C.y, O[D + 2] = C.z, L[N] = _ / l, L[N + 1] = 1 - I / c, D += 3, N += 2, y += 1
  34220. }
  34221. for (I = 0; I < c; I++)
  34222. for (_ = 0; _ < l; _++) {
  34223. var w = B + _ + m * I,
  34224. T = B + _ + m * (I + 1),
  34225. x = B + (_ + 1) + m * (I + 1),
  34226. S = B + (_ + 1) + m * I;
  34227. R[F] = w, R[F + 1] = T, R[F + 2] = S, R[F + 3] = T, R[F + 4] = x, R[F + 5] = S, F += 6, A += 6
  34228. }
  34229. M.addGroup(V, A, h), V += A, B += y
  34230. }
  34231. Ci.BufferGeometry.call(this), this.type = "BoxBufferGeometry", this.parameters = {
  34232. width: e,
  34233. height: t,
  34234. depth: i,
  34235. widthSegments: n,
  34236. heightSegments: r,
  34237. depthSegments: o
  34238. };
  34239. var M = this;
  34240. n = Math.floor(n) || 1, r = Math.floor(r) || 1, o = Math.floor(o) || 1;
  34241. var s, l, c, h, u = (h = 0, h += (s = n) * (l = r) * 2, h += s * (c = o) * 2, 4 * (h += c * l * 2)),
  34242. d = u / 4 * 6,
  34243. R = new(65535 < d ? Uint32Array : Uint16Array)(d),
  34244. P = new Float32Array(3 * u),
  34245. O = new Float32Array(3 * u),
  34246. L = new Float32Array(2 * u),
  34247. D = 0,
  34248. N = 0,
  34249. F = 0,
  34250. B = 0,
  34251. V = 0;
  34252. a("z", "y", "x", -1, -1, i, t, e, o, r, 0), a("z", "y", "x", 1, -1, i, t, -e, o, r, 1), a("x", "z", "y", 1, 1, e, i, t, n, o, 2), a("x", "z", "y", 1, -1, e, i, -t, n, o, 3), a("x", "y", "z", 1, -1, e, t, i, n, r, 4), a("x", "y", "z", -1, -1, e, t, -i, n, r, 5), this.setIndex(new Ci.BufferAttribute(R, 1)), this.addAttribute("position", new Ci.BufferAttribute(P, 3)), this.addAttribute("normal", new Ci.BufferAttribute(O, 3)), this.addAttribute("uv", new Ci.BufferAttribute(L, 2))
  34253. }, Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry, Ci.CircleGeometry = function (e, t, i, n) {
  34254. Ci.Geometry.call(this), this.type = "CircleGeometry", this.parameters = {
  34255. radius: e,
  34256. segments: t,
  34257. thetaStart: i,
  34258. thetaLength: n
  34259. }, this.fromBufferGeometry(new Ci.CircleBufferGeometry(e, t, i, n))
  34260. }, Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry, Ci.CircleBufferGeometry = function (e, t, i, n) {
  34261. Ci.BufferGeometry.call(this), this.type = "CircleBufferGeometry", this.parameters = {
  34262. radius: e,
  34263. segments: t,
  34264. thetaStart: i,
  34265. thetaLength: n
  34266. }, e = e || 50, t = void 0 !== t ? Math.max(3, t) : 8, i = void 0 !== i ? i : 0, n = void 0 !== n ? n : 2 * Math.PI;
  34267. var r = t + 2,
  34268. o = new Float32Array(3 * r),
  34269. a = new Float32Array(3 * r),
  34270. s = new Float32Array(2 * r);
  34271. a[2] = 1, s[0] = .5, s[1] = .5;
  34272. for (var l = 0, c = 3, h = 2; l <= t; l++, c += 3, h += 2) {
  34273. var u = i + l / t * n;
  34274. o[c] = e * Math.cos(u), o[c + 1] = e * Math.sin(u), a[c + 2] = 1, s[h] = (o[c] / e + 1) / 2, s[h + 1] = (o[c + 1] / e + 1) / 2
  34275. }
  34276. var d = [];
  34277. for (c = 1; c <= t; c++) d.push(c, c + 1, 0);
  34278. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d), 1)), this.addAttribute("position", new Ci.BufferAttribute(o, 3)), this.addAttribute("normal", new Ci.BufferAttribute(a, 3)), this.addAttribute("uv", new Ci.BufferAttribute(s, 2)), this.boundingSphere = new Ci.Sphere(new Ci.Vector3, e)
  34279. }, Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry, Ci.CylinderBufferGeometry = function (p, f, g, m, v, e, y, A) {
  34280. function t(e) {
  34281. var t, i, n, r = new Ci.Vector2,
  34282. o = new Ci.Vector3,
  34283. a = !0 === e ? p : f,
  34284. s = !0 === e ? 1 : -1;
  34285. for (i = b, t = 1; t <= m; t++) I.setXYZ(b, 0, x * s, 0), E.setXYZ(b, 0, s, 0), !0 === e ? (r.x = t / m, r.y = 0) : (r.x = (t - 1) / m, r.y = 1), _.setXY(b, r.x, r.y), b++;
  34286. for (n = b, t = 0; t <= m; t++) {
  34287. var l = t / m;
  34288. o.x = a * Math.sin(l * A + y), o.y = x * s, o.z = a * Math.cos(l * A + y), I.setXYZ(b, o.x, o.y, o.z), E.setXYZ(b, 0, s, 0), _.setXY(b, l, !0 === e ? 1 : 0), b++
  34289. }
  34290. for (t = 0; t < m; t++) {
  34291. var c = i + t,
  34292. h = n + t;
  34293. !0 === e ? (C.setX(w, h), w++, C.setX(w, h + 1)) : (C.setX(w, h + 1), w++, C.setX(w, h)), w++, C.setX(w, c), w++
  34294. }
  34295. }
  34296. Ci.BufferGeometry.call(this), this.type = "CylinderBufferGeometry", this.parameters = {
  34297. radiusTop: p,
  34298. radiusBottom: f,
  34299. height: g,
  34300. radialSegments: m,
  34301. heightSegments: v,
  34302. openEnded: e,
  34303. thetaStart: y,
  34304. thetaLength: A
  34305. }, p = void 0 !== p ? p : 20, f = void 0 !== f ? f : 20, g = void 0 !== g ? g : 100, m = Math.floor(m) || 8, v = Math.floor(v) || 1, e = void 0 !== e && e, y = void 0 !== y ? y : 0, A = void 0 !== A ? A : 2 * Math.PI;
  34306. var i, n, r = (n = (m + 1) * (v + 1), !1 === e && (n += 2 * (m + 1) + 2 * m), n),
  34307. o = (i = m * v * 2 * 3, !1 === e && (i += 2 * m * 3), i),
  34308. C = new Ci.BufferAttribute(new(65535 < o ? Uint32Array : Uint16Array)(o), 1),
  34309. I = new Ci.BufferAttribute(new Float32Array(3 * r), 3),
  34310. E = new Ci.BufferAttribute(new Float32Array(3 * r), 3),
  34311. _ = new Ci.BufferAttribute(new Float32Array(2 * r), 2),
  34312. b = 0,
  34313. w = 0,
  34314. T = [],
  34315. x = g / 2;
  34316. (function () {
  34317. var e, t, i = new Ci.Vector3,
  34318. n = new Ci.Vector3,
  34319. r = (f - p) / g;
  34320. for (t = 0; t <= v; t++) {
  34321. var o = [],
  34322. a = t / v,
  34323. s = a * (f - p) + p;
  34324. for (e = 0; e <= m; e++) {
  34325. var l = e / m;
  34326. n.x = s * Math.sin(l * A + y), n.y = -a * g + x, n.z = s * Math.cos(l * A + y), I.setXYZ(b, n.x, n.y, n.z), i.copy(n), (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y), i.z = Math.cos(l * A + y)), i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(), E.setXYZ(b, i.x, i.y, i.z), _.setXY(b, l, 1 - a), o.push(b), b++
  34327. }
  34328. T.push(o)
  34329. }
  34330. for (e = 0; e < m; e++)
  34331. for (t = 0; t < v; t++) {
  34332. var c = T[t][e],
  34333. h = T[t + 1][e],
  34334. u = T[t + 1][e + 1],
  34335. d = T[t][e + 1];
  34336. C.setX(w, c), w++, C.setX(w, h), w++, C.setX(w, d), w++, C.setX(w, h), w++, C.setX(w, u), w++, C.setX(w, d), w++
  34337. }
  34338. })(), !1 === e && (0 < p && t(!0), 0 < f && t(!1)), this.setIndex(C), this.addAttribute("position", I), this.addAttribute("normal", E), this.addAttribute("uv", _)
  34339. }, Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry, Ci.CylinderGeometry = function (e, t, i, n, r, o, a, s) {
  34340. Ci.Geometry.call(this), this.type = "CylinderGeometry", this.parameters = {
  34341. radiusTop: e,
  34342. radiusBottom: t,
  34343. height: i,
  34344. radialSegments: n,
  34345. heightSegments: r,
  34346. openEnded: o,
  34347. thetaStart: a,
  34348. thetaLength: s
  34349. }, this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e, t, i, n, r, o, a, s)), this.mergeVertices()
  34350. }, Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry, Ci.EdgesGeometry = function (e, t) {
  34351. function i(e, t) {
  34352. return e - t
  34353. }
  34354. Ci.BufferGeometry.call(this), t = void 0 !== t ? t : 1;
  34355. var n, r = Math.cos(Ci.Math.degToRad(t)),
  34356. o = [0, 0],
  34357. a = {},
  34358. s = ["a", "b", "c"];
  34359. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(), n.mergeVertices(), n.computeFaceNormals();
  34360. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  34361. for (var d = c[h], p = 0; p < 3; p++) {
  34362. o[0] = d[s[p]], o[1] = d[s[(p + 1) % 3]], o.sort(i), void 0 === a[g = o.toString()] ? a[g] = {
  34363. vert1: o[0],
  34364. vert2: o[1],
  34365. face1: h,
  34366. face2: void 0
  34367. } : a[g].face2 = h
  34368. }
  34369. var f = [];
  34370. for (var g in a) {
  34371. var m = a[g];
  34372. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  34373. var v = l[m.vert1];
  34374. f.push(v.x), f.push(v.y), f.push(v.z), v = l[m.vert2], f.push(v.x), f.push(v.y), f.push(v.z)
  34375. }
  34376. }
  34377. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f), 3))
  34378. }, Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry, Ci.ExtrudeGeometry = function (e, t) {
  34379. return void 0 === e ? void(e = []) : (Ci.Geometry.call(this), this.type = "ExtrudeGeometry", e = Array.isArray(e) ? e : [e], this.addShapeList(e, t), void this.computeFaceNormals())
  34380. };
  34381. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry, Ci.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  34382. for (var i = e.length, n = 0; n < i; n++) {
  34383. var r = e[n];
  34384. this.addShape(r, t)
  34385. }
  34386. }, Ci.ExtrudeGeometry.prototype.addShape = function (e, t) {
  34387. function i(e, t, i) {
  34388. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"), t.clone().multiplyScalar(i).add(e)
  34389. }
  34390. function n(e, t, i) {
  34391. var n, r, o = 1,
  34392. a = e.x - t.x,
  34393. s = e.y - t.y,
  34394. l = i.x - e.x,
  34395. c = i.y - e.y,
  34396. h = a * a + s * s,
  34397. u = a * c - s * l;
  34398. if (Math.abs(u) > Number.EPSILON) {
  34399. var d = Math.sqrt(h),
  34400. p = Math.sqrt(l * l + c * c),
  34401. f = t.x - s / d,
  34402. g = t.y + a / d,
  34403. m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l),
  34404. v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  34405. if (v <= 2) return new Ci.Vector2(n, r);
  34406. o = Math.sqrt(v / 2)
  34407. } else {
  34408. var y = !1;
  34409. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0), o = y ? (n = -s, r = a, Math.sqrt(h)) : (n = a, r = s, Math.sqrt(h / 2))
  34410. }
  34411. return new Ci.Vector2(n / o, r / o)
  34412. }
  34413. function r(e, t) {
  34414. var i, n;
  34415. for (G = e.length; 0 <= --G;) {
  34416. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  34417. var r = 0,
  34418. o = A + 2 * m;
  34419. for (r = 0; r < o; r++) {
  34420. var a = U * r,
  34421. s = U * (r + 1);
  34422. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  34423. }
  34424. }
  34425. }
  34426. function o(e, t, i) {
  34427. T.vertices.push(new Ci.Vector3(e, t, i))
  34428. }
  34429. function a(e, t, i) {
  34430. e += x, t += x, i += x, T.faces.push(new Ci.Face3(e, t, i, null, null, 0));
  34431. var n = E.generateTopUV(T, e, t, i);
  34432. T.faceVertexUvs[0].push(n)
  34433. }
  34434. function l(e, t, i, n) {
  34435. e += x, t += x, i += x, n += x, T.faces.push(new Ci.Face3(e, t, n, null, null, 1)), T.faces.push(new Ci.Face3(t, i, n, null, null, 1));
  34436. var r = E.generateSideWallUV(T, e, t, i, n);
  34437. T.faceVertexUvs[0].push([r[0], r[1], r[3]]), T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  34438. }
  34439. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100,
  34440. f = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  34441. g = void 0 !== t.bevelSize ? t.bevelSize : f - 2,
  34442. m = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  34443. v = void 0 === t.bevelEnabled || t.bevelEnabled,
  34444. y = void 0 !== t.curveSegments ? t.curveSegments : 12,
  34445. A = void 0 !== t.steps ? t.steps : 1,
  34446. C = t.extrudePath,
  34447. I = !1,
  34448. E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  34449. C && (s = C.getSpacedPoints(A), v = !(I = !0), c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C, A, !1), h = new Ci.Vector3, u = new Ci.Vector3, d = new Ci.Vector3), v || (g = f = m = 0);
  34450. var _, b, w, T = this,
  34451. x = this.vertices.length,
  34452. S = e.extractPoints(y),
  34453. M = S.shape,
  34454. R = S.holes,
  34455. P = !Ci.ShapeUtils.isClockWise(M);
  34456. if (P) {
  34457. for (M = M.reverse(), b = 0, w = R.length; b < w; b++) _ = R[b], Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  34458. P = !1
  34459. }
  34460. var O = Ci.ShapeUtils.triangulateShape(M, R),
  34461. L = M;
  34462. for (b = 0, w = R.length; b < w; b++) _ = R[b], M = M.concat(_);
  34463. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++, j++, Y++) j === W && (j = 0), Y === W && (Y = 0), z[G] = n(L[G], L[j], L[Y]);
  34464. var q, X, Z = [],
  34465. K = z.concat();
  34466. for (b = 0, w = R.length; b < w; b++) {
  34467. for (_ = R[b], q = [], G = 0, j = (W = _.length) - 1, Y = G + 1; G < W; G++, j++, Y++) j === W && (j = 0), Y === W && (Y = 0), q[G] = n(_[G], _[j], _[Y]);
  34468. Z.push(q), K = K.concat(q)
  34469. }
  34470. for (D = 0; D < m; D++) {
  34471. for (B = f * (1 - (F = D / m)), N = g * Math.sin(F * Math.PI / 2), G = 0, W = L.length; G < W; G++) o((V = i(L[G], z[G], N)).x, V.y, -B);
  34472. for (b = 0, w = R.length; b < w; b++)
  34473. for (_ = R[b], q = Z[b], G = 0, W = _.length; G < W; G++) o((V = i(_[G], q[G], N)).x, V.y, -B)
  34474. }
  34475. for (N = g, G = 0; G < U; G++) V = v ? i(M[G], K[G], N) : M[G], I ? (u.copy(c.normals[0]).multiplyScalar(V.x), h.copy(c.binormals[0]).multiplyScalar(V.y), d.copy(s[0]).add(u).add(h), o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  34476. for (X = 1; X <= A; X++)
  34477. for (G = 0; G < U; G++) V = v ? i(M[G], K[G], N) : M[G], I ? (u.copy(c.normals[X]).multiplyScalar(V.x), h.copy(c.binormals[X]).multiplyScalar(V.y), d.copy(s[X]).add(u).add(h), o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  34478. for (D = m - 1; 0 <= D; D--) {
  34479. for (B = f * (1 - (F = D / m)), N = g * Math.sin(F * Math.PI / 2), G = 0, W = L.length; G < W; G++) o((V = i(L[G], z[G], N)).x, V.y, p + B);
  34480. for (b = 0, w = R.length; b < w; b++)
  34481. for (_ = R[b], q = Z[b], G = 0, W = _.length; G < W; G++) V = i(_[G], q[G], N), I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  34482. }(function () {
  34483. if (v) {
  34484. var e = 0,
  34485. t = U * e;
  34486. for (G = 0; G < H; G++) a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  34487. for (t = U * (e = A + 2 * m), G = 0; G < H; G++) a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  34488. } else {
  34489. for (G = 0; G < H; G++) a((k = O[G])[2], k[1], k[0]);
  34490. for (G = 0; G < H; G++) a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  34491. }
  34492. })(),
  34493. function () {
  34494. var e = 0;
  34495. for (r(L, e), e += L.length, b = 0, w = R.length; b < w; b++) r(_ = R[b], e), e += _.length
  34496. }()
  34497. }, Ci.ExtrudeGeometry.WorldUVGenerator = {
  34498. generateTopUV: function (e, t, i, n) {
  34499. var r = e.vertices,
  34500. o = r[t],
  34501. a = r[i],
  34502. s = r[n];
  34503. return [new Ci.Vector2(o.x, o.y), new Ci.Vector2(a.x, a.y), new Ci.Vector2(s.x, s.y)]
  34504. },
  34505. generateSideWallUV: function (e, t, i, n, r) {
  34506. var o = e.vertices,
  34507. a = o[t],
  34508. s = o[i],
  34509. l = o[n],
  34510. c = o[r];
  34511. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x, 1 - a.z), new Ci.Vector2(s.x, 1 - s.z), new Ci.Vector2(l.x, 1 - l.z), new Ci.Vector2(c.x, 1 - c.z)] : [new Ci.Vector2(a.y, 1 - a.z), new Ci.Vector2(s.y, 1 - s.z), new Ci.Vector2(l.y, 1 - l.z), new Ci.Vector2(c.y, 1 - c.z)]
  34512. }
  34513. }, Ci.ShapeGeometry = function (e, t) {
  34514. Ci.Geometry.call(this), !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]), this.addShapeList(e, t), this.computeFaceNormals()
  34515. }, Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry, Ci.ShapeGeometry.prototype.addShapeList = function (e, t) {
  34516. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t);
  34517. return this
  34518. }, Ci.ShapeGeometry.prototype.addShape = function (e, t) {
  34519. void 0 === t && (t = {});
  34520. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12,
  34521. a = t.material,
  34522. s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  34523. l = this.vertices.length,
  34524. c = e.extractPoints(o),
  34525. h = c.shape,
  34526. u = c.holes,
  34527. d = !Ci.ShapeUtils.isClockWise(h);
  34528. if (d) {
  34529. for (h = h.reverse(), i = 0, n = u.length; i < n; i++) r = u[i], Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  34530. d = !1
  34531. }
  34532. var p = Ci.ShapeUtils.triangulateShape(h, u);
  34533. for (i = 0, n = u.length; i < n; i++) r = u[i], h = h.concat(r);
  34534. var f, g, m = h.length,
  34535. v = p.length;
  34536. for (i = 0; i < m; i++) f = h[i], this.vertices.push(new Ci.Vector3(f.x, f.y, 0));
  34537. for (i = 0; i < v; i++) {
  34538. var y = (g = p[i])[0] + l,
  34539. A = g[1] + l,
  34540. C = g[2] + l;
  34541. this.faces.push(new Ci.Face3(y, A, C, null, null, a)), this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  34542. }
  34543. }, Ci.LatheBufferGeometry = function (e, t, i, n) {
  34544. Ci.BufferGeometry.call(this), this.type = "LatheBufferGeometry", this.parameters = {
  34545. points: e,
  34546. segments: t,
  34547. phiStart: i,
  34548. phiLength: n
  34549. }, t = Math.floor(t) || 12, i = i || 0, n = n || 2 * Math.PI, n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  34550. var r, o, a, s = (t + 1) * e.length,
  34551. l = t * e.length * 2 * 3,
  34552. c = new Ci.BufferAttribute(new(65535 < l ? Uint32Array : Uint16Array)(l), 1),
  34553. h = new Ci.BufferAttribute(new Float32Array(3 * s), 3),
  34554. u = new Ci.BufferAttribute(new Float32Array(2 * s), 2),
  34555. d = 0,
  34556. p = 0,
  34557. f = (e.length, 1 / t),
  34558. g = new Ci.Vector3,
  34559. m = new Ci.Vector2;
  34560. for (o = 0; o <= t; o++) {
  34561. var v = i + o * f * n,
  34562. y = Math.sin(v),
  34563. A = Math.cos(v);
  34564. for (a = 0; a <= e.length - 1; a++) g.x = e[a].x * y, g.y = e[a].y, g.z = e[a].x * A, h.setXYZ(d, g.x, g.y, g.z), m.x = o / t, m.y = a / (e.length - 1), u.setXY(d, m.x, m.y), d++
  34565. }
  34566. for (o = 0; o < t; o++)
  34567. for (a = 0; a < e.length - 1; a++) {
  34568. var C = r = a + o * e.length,
  34569. I = r + e.length,
  34570. E = r + e.length + 1,
  34571. _ = r + 1;
  34572. c.setX(p, C), p++, c.setX(p, I), p++, c.setX(p, _), p++, c.setX(p, I), p++, c.setX(p, E), p++, c.setX(p, _), p++
  34573. }
  34574. if (this.setIndex(c), this.addAttribute("position", h), this.addAttribute("uv", u), this.computeVertexNormals(), n === 2 * Math.PI) {
  34575. var b = this.attributes.normal.array,
  34576. w = new Ci.Vector3,
  34577. T = new Ci.Vector3,
  34578. x = new Ci.Vector3;
  34579. for (r = t * e.length * 3, a = o = 0; o < e.length; o++, a += 3) w.x = b[a + 0], w.y = b[a + 1], w.z = b[a + 2], T.x = b[r + a + 0], T.y = b[r + a + 1], T.z = b[r + a + 2], x.addVectors(w, T).normalize(), b[a + 0] = b[r + a + 0] = x.x, b[a + 1] = b[r + a + 1] = x.y, b[a + 2] = b[r + a + 2] = x.z
  34580. }
  34581. }, Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry, Ci.LatheGeometry = function (e, t, i, n) {
  34582. Ci.Geometry.call(this), this.type = "LatheGeometry", this.parameters = {
  34583. points: e,
  34584. segments: t,
  34585. phiStart: i,
  34586. phiLength: n
  34587. }, this.fromBufferGeometry(new Ci.LatheBufferGeometry(e, t, i, n)), this.mergeVertices()
  34588. }, Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry, Ci.PlaneGeometry = function (e, t, i, n) {
  34589. Ci.Geometry.call(this), this.type = "PlaneGeometry", this.parameters = {
  34590. width: e,
  34591. height: t,
  34592. widthSegments: i,
  34593. heightSegments: n
  34594. }, this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e, t, i, n))
  34595. }, Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry, Ci.PlaneBufferGeometry = function (e, t, i, n) {
  34596. Ci.BufferGeometry.call(this), this.type = "PlaneBufferGeometry", this.parameters = {
  34597. width: e,
  34598. height: t,
  34599. widthSegments: i,
  34600. heightSegments: n
  34601. };
  34602. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  34603. for (var y = v * u - o, A = 0; A < l; A++) {
  34604. var C = A * h - r;
  34605. d[g] = C, d[g + 1] = -y, p[g + 2] = 1, f[m] = A / a, f[m + 1] = 1 - v / s, g += 3, m += 2
  34606. }
  34607. g = 0;
  34608. var I = new(65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  34609. for (v = 0; v < s; v++)
  34610. for (A = 0; A < a; A++) {
  34611. var E = A + l * v,
  34612. _ = A + l * (v + 1),
  34613. b = A + 1 + l * (v + 1),
  34614. w = A + 1 + l * v;
  34615. I[g] = E, I[g + 1] = _, I[g + 2] = w, I[g + 3] = _, I[g + 4] = b, I[g + 5] = w, g += 6
  34616. }
  34617. this.setIndex(new Ci.BufferAttribute(I, 1)), this.addAttribute("position", new Ci.BufferAttribute(d, 3)), this.addAttribute("normal", new Ci.BufferAttribute(p, 3)), this.addAttribute("uv", new Ci.BufferAttribute(f, 2))
  34618. }, Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry, Ci.RingBufferGeometry = function (e, t, i, n, r, o) {
  34619. Ci.BufferGeometry.call(this), this.type = "RingBufferGeometry", this.parameters = {
  34620. innerRadius: e,
  34621. outerRadius: t,
  34622. thetaSegments: i,
  34623. phiSegments: n,
  34624. thetaStart: r,
  34625. thetaLength: o
  34626. }, e = e || 20, t = t || 50, r = void 0 !== r ? r : 0, o = void 0 !== o ? o : 2 * Math.PI;
  34627. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1),
  34628. h = i * n * 2 * 3,
  34629. u = new Ci.BufferAttribute(new(65535 < h ? Uint32Array : Uint16Array)(h), 1),
  34630. d = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  34631. p = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  34632. f = new Ci.BufferAttribute(new Float32Array(2 * c), 2),
  34633. g = 0,
  34634. m = 0,
  34635. v = e,
  34636. y = (t - e) / n,
  34637. A = new Ci.Vector3,
  34638. C = new Ci.Vector2;
  34639. for (s = 0; s <= n; s++) {
  34640. for (l = 0; l <= i; l++) a = r + l / i * o, A.x = v * Math.cos(a), A.y = v * Math.sin(a), d.setXYZ(g, A.x, A.y, A.z), p.setXYZ(g, 0, 0, 1), C.x = (A.x / t + 1) / 2, C.y = (A.y / t + 1) / 2, f.setXY(g, C.x, C.y), g++;
  34641. v += y
  34642. }
  34643. for (s = 0; s < n; s++) {
  34644. var I = s * (i + 1);
  34645. for (l = 0; l < i; l++) {
  34646. var E = a = l + I,
  34647. _ = a + i + 1,
  34648. b = a + i + 2,
  34649. w = a + 1;
  34650. u.setX(m, E), m++, u.setX(m, _), m++, u.setX(m, b), m++, u.setX(m, E), m++, u.setX(m, b), m++, u.setX(m, w), m++
  34651. }
  34652. }
  34653. this.setIndex(u), this.addAttribute("position", d), this.addAttribute("normal", p), this.addAttribute("uv", f)
  34654. }, Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry, Ci.RingGeometry = function (e, t, i, n, r, o) {
  34655. Ci.Geometry.call(this), this.type = "RingGeometry", this.parameters = {
  34656. innerRadius: e,
  34657. outerRadius: t,
  34658. thetaSegments: i,
  34659. phiSegments: n,
  34660. thetaStart: r,
  34661. thetaLength: o
  34662. }, this.fromBufferGeometry(new Ci.RingBufferGeometry(e, t, i, n, r, o))
  34663. }, Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.RingGeometry.prototype.constructor = Ci.RingGeometry, Ci.SphereGeometry = function (e, t, i, n, r, o, a) {
  34664. Ci.Geometry.call(this), this.type = "SphereGeometry", this.parameters = {
  34665. radius: e,
  34666. widthSegments: t,
  34667. heightSegments: i,
  34668. phiStart: n,
  34669. phiLength: r,
  34670. thetaStart: o,
  34671. thetaLength: a
  34672. }, this.fromBufferGeometry(new Ci.SphereBufferGeometry(e, t, i, n, r, o, a))
  34673. }, Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry, Ci.SphereBufferGeometry = function (e, t, i, n, r, o, a) {
  34674. Ci.BufferGeometry.call(this), this.type = "SphereBufferGeometry", this.parameters = {
  34675. radius: e,
  34676. widthSegments: t,
  34677. heightSegments: i,
  34678. phiStart: n,
  34679. phiLength: r,
  34680. thetaStart: o,
  34681. thetaLength: a
  34682. }, e = e || 50, t = Math.max(3, Math.floor(t) || 8), i = Math.max(2, Math.floor(i) || 6), n = void 0 !== n ? n : 0, r = void 0 !== r ? r : 2 * Math.PI;
  34683. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l), 3), h = new Ci.BufferAttribute(new Float32Array(3 * l), 3), u = new Ci.BufferAttribute(new Float32Array(2 * l), 2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  34684. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  34685. var A = y / t,
  34686. C = -e * Math.cos(n + A * r) * Math.sin(o + v * a),
  34687. I = e * Math.cos(o + v * a),
  34688. E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  34689. f.set(C, I, E).normalize(), c.setXYZ(d, C, I, E), h.setXYZ(d, f.x, f.y, f.z), u.setXY(d, A, 1 - v), m.push(d), d++
  34690. }
  34691. p.push(m)
  34692. }
  34693. var _ = [];
  34694. for (g = 0; g < i; g++)
  34695. for (y = 0; y < t; y++) {
  34696. var b = p[g][y + 1],
  34697. w = p[g][y],
  34698. T = p[g + 1][y],
  34699. x = p[g + 1][y + 1];
  34700. (0 !== g || 0 < o) && _.push(b, w, x), (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  34701. }
  34702. this.setIndex(new(65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_, 1)), this.addAttribute("position", c), this.addAttribute("normal", h), this.addAttribute("uv", u), this.boundingSphere = new Ci.Sphere(new Ci.Vector3, e)
  34703. }, Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry, Ci.TextGeometry = function (e, t) {
  34704. var i = (t = t || {}).font;
  34705. if (i instanceof Ci.Font == 0) return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."), new Ci.Geometry;
  34706. var n = i.generateShapes(e, t.size, t.curveSegments);
  34707. t.amount = void 0 !== t.height ? t.height : 50, void 0 === t.bevelThickness && (t.bevelThickness = 10), void 0 === t.bevelSize && (t.bevelSize = 8), void 0 === t.bevelEnabled && (t.bevelEnabled = !1), Ci.ExtrudeGeometry.call(this, n, t), this.type = "TextGeometry"
  34708. }, Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype), Ci.TextGeometry.prototype.constructor = Ci.TextGeometry, Ci.TorusBufferGeometry = function (e, t, i, n, r) {
  34709. Ci.BufferGeometry.call(this), this.type = "TorusBufferGeometry", this.parameters = {
  34710. radius: e,
  34711. tube: t,
  34712. radialSegments: i,
  34713. tubularSegments: n,
  34714. arc: r
  34715. }, e = e || 100, t = t || 40, i = Math.floor(i) || 8, n = Math.floor(n) || 6, r = r || 2 * Math.PI;
  34716. var o, a, s = (i + 1) * (n + 1),
  34717. l = i * n * 2 * 3,
  34718. c = new(65535 < l ? Uint32Array : Uint16Array)(l),
  34719. h = new Float32Array(3 * s),
  34720. u = new Float32Array(3 * s),
  34721. d = new Float32Array(2 * s),
  34722. p = 0,
  34723. f = 0,
  34724. g = 0,
  34725. m = new Ci.Vector3,
  34726. v = new Ci.Vector3,
  34727. y = new Ci.Vector3;
  34728. for (o = 0; o <= i; o++)
  34729. for (a = 0; a <= n; a++) {
  34730. var A = a / n * r,
  34731. C = o / i * Math.PI * 2;
  34732. v.x = (e + t * Math.cos(C)) * Math.cos(A), v.y = (e + t * Math.cos(C)) * Math.sin(A), v.z = t * Math.sin(C), h[p] = v.x, h[p + 1] = v.y, h[p + 2] = v.z, m.x = e * Math.cos(A), m.y = e * Math.sin(A), y.subVectors(v, m).normalize(), u[p] = y.x, u[p + 1] = y.y, u[p + 2] = y.z, d[f] = a / n, d[f + 1] = o / i, p += 3, f += 2
  34733. }
  34734. for (o = 1; o <= i; o++)
  34735. for (a = 1; a <= n; a++) {
  34736. var I = (n + 1) * o + a - 1,
  34737. E = (n + 1) * (o - 1) + a - 1,
  34738. _ = (n + 1) * (o - 1) + a,
  34739. b = (n + 1) * o + a;
  34740. c[g] = I, c[g + 1] = E, c[g + 2] = b, c[g + 3] = E, c[g + 4] = _, c[g + 5] = b, g += 6
  34741. }
  34742. this.setIndex(new Ci.BufferAttribute(c, 1)), this.addAttribute("position", new Ci.BufferAttribute(h, 3)), this.addAttribute("normal", new Ci.BufferAttribute(u, 3)), this.addAttribute("uv", new Ci.BufferAttribute(d, 2))
  34743. }, Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry, Ci.TorusGeometry = function (e, t, i, n, r) {
  34744. Ci.Geometry.call(this), this.type = "TorusGeometry", this.parameters = {
  34745. radius: e,
  34746. tube: t,
  34747. radialSegments: i,
  34748. tubularSegments: n,
  34749. arc: r
  34750. }, this.fromBufferGeometry(new Ci.TorusBufferGeometry(e, t, i, n, r))
  34751. }, Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry, Ci.TorusKnotBufferGeometry = function (e, t, i, n, r, o) {
  34752. function a(e, t, i, n, r) {
  34753. var o = Math.cos(e),
  34754. a = Math.sin(e),
  34755. s = i / t * e,
  34756. l = Math.cos(s);
  34757. r.x = n * (2 + l) * .5 * o, r.y = n * (2 + l) * a * .5, r.z = n * Math.sin(s) * .5
  34758. }
  34759. Ci.BufferGeometry.call(this), this.type = "TorusKnotBufferGeometry", this.parameters = {
  34760. radius: e,
  34761. tube: t,
  34762. tubularSegments: i,
  34763. radialSegments: n,
  34764. p: r,
  34765. q: o
  34766. }, e = e || 100, t = t || 40, i = Math.floor(i) || 64, r = r || 2, o = o || 3;
  34767. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1),
  34768. h = n * i * 2 * 3,
  34769. u = new Ci.BufferAttribute(new(65535 < h ? Uint32Array : Uint16Array)(h), 1),
  34770. d = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  34771. p = new Ci.BufferAttribute(new Float32Array(3 * c), 3),
  34772. f = new Ci.BufferAttribute(new Float32Array(2 * c), 2),
  34773. g = 0,
  34774. m = 0,
  34775. v = new Ci.Vector3,
  34776. y = new Ci.Vector3,
  34777. A = new Ci.Vector2,
  34778. C = new Ci.Vector3,
  34779. I = new Ci.Vector3,
  34780. E = new Ci.Vector3,
  34781. _ = new Ci.Vector3,
  34782. b = new Ci.Vector3;
  34783. for (s = 0; s <= i; ++s) {
  34784. var w = s / i * r * Math.PI * 2;
  34785. for (a(w, r, o, e, C), a(.01 + w, r, o, e, I), _.subVectors(I, C), b.addVectors(I, C), E.crossVectors(_, b), b.crossVectors(E, _), E.normalize(), b.normalize(), l = 0; l <= n; ++l) {
  34786. var T = l / n * Math.PI * 2,
  34787. x = -t * Math.cos(T),
  34788. S = t * Math.sin(T);
  34789. v.x = C.x + (x * b.x + S * E.x), v.y = C.y + (x * b.y + S * E.y), v.z = C.z + (x * b.z + S * E.z), d.setXYZ(g, v.x, v.y, v.z), y.subVectors(v, C).normalize(), p.setXYZ(g, y.x, y.y, y.z), A.x = s / i, A.y = l / n, f.setXY(g, A.x, A.y), g++
  34790. }
  34791. }
  34792. for (l = 1; l <= i; l++)
  34793. for (s = 1; s <= n; s++) {
  34794. var M = (n + 1) * (l - 1) + (s - 1),
  34795. R = (n + 1) * l + (s - 1),
  34796. P = (n + 1) * l + s,
  34797. O = (n + 1) * (l - 1) + s;
  34798. u.setX(m, M), m++, u.setX(m, R), m++, u.setX(m, O), m++, u.setX(m, R), m++, u.setX(m, P), m++, u.setX(m, O), m++
  34799. }
  34800. this.setIndex(u), this.addAttribute("position", d), this.addAttribute("normal", p), this.addAttribute("uv", f)
  34801. }, Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry, Ci.TorusKnotGeometry = function (e, t, i, n, r, o, a) {
  34802. Ci.Geometry.call(this), this.type = "TorusKnotGeometry", this.parameters = {
  34803. radius: e,
  34804. tube: t,
  34805. tubularSegments: i,
  34806. radialSegments: n,
  34807. p: r,
  34808. q: o
  34809. }, void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."), this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e, t, i, n, r, o)), this.mergeVertices()
  34810. }, Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry, Ci.TubeGeometry = function (e, t, i, n, r, o) {
  34811. Ci.Geometry.call(this), this.type = "TubeGeometry", this.parameters = {
  34812. path: e,
  34813. segments: t,
  34814. radius: i,
  34815. radialSegments: n,
  34816. closed: r,
  34817. taper: o
  34818. }, t = t || 64, i = i || 1, n = n || 8, r = r || !1, o = o || Ci.TubeGeometry.NoTaper;
  34819. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [],
  34820. R = this,
  34821. P = t + 1,
  34822. O = new Ci.Vector3,
  34823. L = new Ci.TubeGeometry.FrenetFrames(e, t, r),
  34824. D = L.tangents,
  34825. N = L.normals,
  34826. F = L.binormals;
  34827. for (this.tangents = D, this.normals = N, this.binormals = F, f = 0; f < P; f++)
  34828. for (M[f] = [], l = f / (P - 1), p = e.getPointAt(l), D[f], a = N[f], s = F[f], h = i * o(l), g = 0; g < n; g++) c = g / n * 2 * Math.PI, u = -h * Math.cos(c), d = h * Math.sin(c), O.copy(p), O.x += u * a.x + d * s.x, O.y += u * a.y + d * s.y, O.z += u * a.z + d * s.z, M[f][g] = (T = O.x, x = O.y, S = O.z, R.vertices.push(new Ci.Vector3(T, x, S)) - 1);
  34829. for (f = 0; f < t; f++)
  34830. for (g = 0; g < n; g++) m = r ? (f + 1) % t : f + 1, v = (g + 1) % n, y = M[f][g], A = M[m][g], C = M[m][v], I = M[f][v], E = new Ci.Vector2(f / t, g / n), _ = new Ci.Vector2((f + 1) / t, g / n), b = new Ci.Vector2((f + 1) / t, (g + 1) / n), w = new Ci.Vector2(f / t, (g + 1) / n), this.faces.push(new Ci.Face3(y, A, I)), this.faceVertexUvs[0].push([E, _, w]), this.faces.push(new Ci.Face3(A, C, I)), this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  34831. this.computeFaceNormals(), this.computeVertexNormals()
  34832. }, Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry, Ci.TubeGeometry.NoTaper = function (e) {
  34833. return 1
  34834. }, Ci.TubeGeometry.SinusoidalTaper = function (e) {
  34835. return Math.sin(Math.PI * e)
  34836. }, Ci.TubeGeometry.FrenetFrames = function (e, t, i) {
  34837. var n, r, o, a, s, l, c, h = new Ci.Vector3,
  34838. u = [],
  34839. d = [],
  34840. p = [],
  34841. f = new Ci.Vector3,
  34842. g = new Ci.Matrix4,
  34843. m = t + 1;
  34844. for (this.tangents = u, this.normals = d, this.binormals = p, l = 0; l < m; l++) c = l / (m - 1), u[l] = e.getTangentAt(c), u[l].normalize();
  34845. for (d[0] = new Ci.Vector3, p[0] = new Ci.Vector3, r = Number.MAX_VALUE, o = Math.abs(u[0].x), a = Math.abs(u[0].y), s = Math.abs(u[0].z), o <= r && (r = o, h.set(1, 0, 0)), a <= r && (r = a, h.set(0, 1, 0)), s <= r && h.set(0, 0, 1), f.crossVectors(u[0], h).normalize(), d[0].crossVectors(u[0], f), p[0].crossVectors(u[0], d[0]), l = 1; l < m; l++) d[l] = d[l - 1].clone(), p[l] = p[l - 1].clone(), f.crossVectors(u[l - 1], u[l]), f.length() > Number.EPSILON && (f.normalize(), n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)), d[l].applyMatrix4(g.makeRotationAxis(f, n))), p[l].crossVectors(u[l], d[l]);
  34846. if (i)
  34847. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)), n /= m - 1, 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n), l = 1; l < m; l++) d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)), p[l].crossVectors(u[l], d[l])
  34848. }, Ci.PolyhedronGeometry = function (e, t, i, n) {
  34849. function f(e) {
  34850. var t = e.normalize().clone();
  34851. t.index = m.vertices.push(t) - 1;
  34852. var i = a(e) / 2 / Math.PI + .5,
  34853. n = function (e) {
  34854. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  34855. }(e) / Math.PI + .5;
  34856. return t.uv = new Ci.Vector2(i, 1 - n), t
  34857. }
  34858. function g(e, t, i, n) {
  34859. var r = new Ci.Face3(e.index, t.index, i.index, [e.clone(), t.clone(), i.clone()], void 0, n);
  34860. m.faces.push(r), y.copy(e).add(t).add(i).divideScalar(3);
  34861. var o = a(y);
  34862. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  34863. }
  34864. function r(e, t) {
  34865. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  34866. a[l] = [];
  34867. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++) a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  34868. }
  34869. for (l = 0; l < i; l++)
  34870. for (d = 0; d < 2 * (i - l) - 1; d++) {
  34871. var p = Math.floor(d / 2);
  34872. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  34873. }
  34874. }
  34875. function a(e) {
  34876. return Math.atan2(e.z, -e.x)
  34877. }
  34878. function s(e, t, i) {
  34879. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1, e.y)), 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5, e.y)), e.clone()
  34880. }
  34881. Ci.Geometry.call(this), this.type = "PolyhedronGeometry", this.parameters = {
  34882. vertices: e,
  34883. indices: t,
  34884. radius: i,
  34885. detail: n
  34886. }, i = i || 1, n = n || 0;
  34887. for (var m = this, o = 0, l = e.length; o < l; o += 3) f(new Ci.Vector3(e[o], e[o + 1], e[o + 2]));
  34888. var c = this.vertices,
  34889. h = [],
  34890. u = (o = 0, 0);
  34891. for (l = t.length; o < l; o += 3, u++) {
  34892. var d = c[t[o]],
  34893. p = c[t[o + 1]],
  34894. v = c[t[o + 2]];
  34895. h[u] = new Ci.Face3(d.index, p.index, v.index, [d.clone(), p.clone(), v.clone()], void 0, u)
  34896. }
  34897. var y = new Ci.Vector3;
  34898. for (o = 0, l = h.length; o < l; o++) r(h[o], n);
  34899. for (o = 0, l = this.faceVertexUvs[0].length; o < l; o++) {
  34900. var A = this.faceVertexUvs[0][o],
  34901. C = A[0].x,
  34902. I = A[1].x,
  34903. E = A[2].x,
  34904. _ = Math.max(C, I, E),
  34905. b = Math.min(C, I, E);
  34906. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1), I < .2 && (A[1].x += 1), E < .2 && (A[2].x += 1))
  34907. }
  34908. for (o = 0, l = this.vertices.length; o < l; o++) this.vertices[o].multiplyScalar(i);
  34909. this.mergeVertices(), this.computeFaceNormals(), this.boundingSphere = new Ci.Sphere(new Ci.Vector3, i)
  34910. }, Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry, Ci.DodecahedronGeometry = function (e, t) {
  34911. var i = (1 + Math.sqrt(5)) / 2,
  34912. n = 1 / i,
  34913. r = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  34914. Ci.PolyhedronGeometry.call(this, r, [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9], e, t), this.type = "DodecahedronGeometry", this.parameters = {
  34915. radius: e,
  34916. detail: t
  34917. }
  34918. }, Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype), Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry, Ci.IcosahedronGeometry = function (e, t) {
  34919. var i = (1 + Math.sqrt(5)) / 2,
  34920. n = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1];
  34921. Ci.PolyhedronGeometry.call(this, n, [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1], e, t), this.type = "IcosahedronGeometry", this.parameters = {
  34922. radius: e,
  34923. detail: t
  34924. }
  34925. }, Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype), Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry, Ci.OctahedronGeometry = function (e, t) {
  34926. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t), this.type = "OctahedronGeometry", this.parameters = {
  34927. radius: e,
  34928. detail: t
  34929. }
  34930. }, Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype), Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry, Ci.TetrahedronGeometry = function (e, t) {
  34931. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t), this.type = "TetrahedronGeometry", this.parameters = {
  34932. radius: e,
  34933. detail: t
  34934. }
  34935. }, Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype), Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry, Ci.ParametricGeometry = function (e, t, i) {
  34936. Ci.Geometry.call(this), this.type = "ParametricGeometry", this.parameters = {
  34937. func: e,
  34938. slices: t,
  34939. stacks: i
  34940. };
  34941. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices,
  34942. m = this.faces,
  34943. v = this.faceVertexUvs[0],
  34944. y = t + 1;
  34945. for (n = 0; n <= i; n++)
  34946. for (a = n / i, r = 0; r <= t; r++) o = e(r / t, a), g.push(o);
  34947. for (n = 0; n < i; n++)
  34948. for (r = 0; r < t; r++) l = (s = n * y + r) + 1, c = (n + 1) * y + r + 1, h = (n + 1) * y + r, u = new Ci.Vector2(r / t, n / i), d = new Ci.Vector2((r + 1) / t, n / i), p = new Ci.Vector2((r + 1) / t, (n + 1) / i), f = new Ci.Vector2(r / t, (n + 1) / i), m.push(new Ci.Face3(s, l, h)), v.push([u, d, f]), m.push(new Ci.Face3(l, c, h)), v.push([d.clone(), p, f.clone()]);
  34949. this.computeFaceNormals(), this.computeVertexNormals()
  34950. }, Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype), Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry, Ci.WireframeGeometry = function (e) {
  34951. function t(e, t) {
  34952. return e - t
  34953. }
  34954. Ci.BufferGeometry.call(this);
  34955. var i = [0, 0],
  34956. n = {},
  34957. r = ["a", "b", "c"];
  34958. if (e instanceof Ci.Geometry) {
  34959. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  34960. for (var u = a[c], d = 0; d < 3; d++) {
  34961. i[0] = u[r[d]], i[1] = u[r[(d + 1) % 3]], i.sort(t), void 0 === n[E = i.toString()] && (l[2 * s] = i[0], l[2 * s + 1] = i[1], n[E] = !0, s++)
  34962. }
  34963. var p = new Float32Array(2 * s * 3);
  34964. for (c = 0, h = s; c < h; c++)
  34965. for (d = 0; d < 2; d++) {
  34966. var f = o[l[2 * c + d]];
  34967. p[(_ = 6 * c + 3 * d) + 0] = f.x, p[_ + 1] = f.y, p[_ + 2] = f.z
  34968. }
  34969. this.addAttribute("position", new Ci.BufferAttribute(p, 3))
  34970. } else if (e instanceof Ci.BufferGeometry)
  34971. if (null !== e.index) {
  34972. var g = e.index.array,
  34973. m = (o = e.attributes.position, e.groups);
  34974. s = 0;
  34975. 0 === m.length && e.addGroup(0, g.length);
  34976. l = new Uint32Array(2 * g.length);
  34977. for (var v = 0, y = m.length; v < y; ++v)
  34978. for (var A = m[v], C = A.start, I = (c = C, C + A.count); c < I; c += 3)
  34979. for (d = 0; d < 3; d++) {
  34980. var E;
  34981. i[0] = g[c + d], i[1] = g[c + (d + 1) % 3], i.sort(t), void 0 === n[E = i.toString()] && (l[2 * s] = i[0], l[2 * s + 1] = i[1], n[E] = !0, s++)
  34982. }
  34983. for (p = new Float32Array(2 * s * 3), c = 0, h = s; c < h; c++)
  34984. for (d = 0; d < 2; d++) {
  34985. var _ = 6 * c + 3 * d,
  34986. b = l[2 * c + d];
  34987. p[_ + 0] = o.getX(b), p[_ + 1] = o.getY(b), p[_ + 2] = o.getZ(b)
  34988. }
  34989. this.addAttribute("position", new Ci.BufferAttribute(p, 3))
  34990. } else {
  34991. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  34992. for (p = new Float32Array(2 * s * 3), c = 0, h = w; c < h; c++)
  34993. for (d = 0; d < 3; d++) {
  34994. var T = 9 * c + 3 * d;
  34995. p[(_ = 18 * c + 6 * d) + 0] = o[T], p[_ + 1] = o[1 + T], p[_ + 2] = o[2 + T];
  34996. b = 9 * c + (d + 1) % 3 * 3;
  34997. p[_ + 3] = o[b], p[_ + 4] = o[b + 1], p[_ + 5] = o[b + 2]
  34998. }
  34999. this.addAttribute("position", new Ci.BufferAttribute(p, 3))
  35000. }
  35001. }, Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype), Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry, Ci.AxisHelper = function (e) {
  35002. e = e || 1;
  35003. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  35004. i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1]),
  35005. n = new Ci.BufferGeometry;
  35006. n.addAttribute("position", new Ci.BufferAttribute(t, 3)), n.addAttribute("color", new Ci.BufferAttribute(i, 3));
  35007. var r = new Ci.LineBasicMaterial({
  35008. vertexColors: Ci.VertexColors
  35009. });
  35010. Ci.LineSegments.call(this, n, r)
  35011. }, Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.AxisHelper.prototype.constructor = Ci.AxisHelper, Ci.ArrowHelper = function () {
  35012. var a = new Ci.Geometry;
  35013. a.vertices.push(new Ci.Vector3(0, 0, 0), new Ci.Vector3(0, 1, 0));
  35014. var s = new Ci.CylinderGeometry(0, .5, 1, 5, 1);
  35015. return s.translate(0, -.5, 0),
  35016. function (e, t, i, n, r, o) {
  35017. Ci.Object3D.call(this), void 0 === n && (n = 16776960), void 0 === i && (i = 1), void 0 === r && (r = .2 * i), void 0 === o && (o = .2 * r), this.position.copy(t), this.line = new Ci.Line(a, new Ci.LineBasicMaterial({
  35018. color: n
  35019. })), this.line.matrixAutoUpdate = !1, this.add(this.line), this.cone = new Ci.Mesh(s, new Ci.MeshBasicMaterial({
  35020. color: n
  35021. })), this.cone.matrixAutoUpdate = !1, this.add(this.cone), this.setDirection(e), this.setLength(i, r, o)
  35022. }
  35023. }(), Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype), Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper, Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3, function (e) {
  35024. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(), yi = Math.acos(e.y), this.quaternion.setFromAxisAngle(Ai, yi))
  35025. }), Ci.ArrowHelper.prototype.setLength = function (e, t, i) {
  35026. void 0 === t && (t = .2 * e), void 0 === i && (i = .2 * t), this.line.scale.set(1, Math.max(0, e - t), 1), this.line.updateMatrix(), this.cone.scale.set(i, t, i), this.cone.position.y = e, this.cone.updateMatrix()
  35027. }, Ci.ArrowHelper.prototype.setColor = function (e) {
  35028. this.line.material.color.set(e), this.cone.material.color.set(e)
  35029. }, Ci.BoxHelper = function (e) {
  35030. 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]),
  35031. i = new Float32Array(24),
  35032. n = new Ci.BufferGeometry;
  35033. n.setIndex(new Ci.BufferAttribute(t, 1)), n.addAttribute("position", new Ci.BufferAttribute(i, 3)), Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  35034. color: 16776960
  35035. })), void 0 !== e && this.update(e)
  35036. }, Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.BoxHelper.prototype.constructor = Ci.BoxHelper, Ci.BoxHelper.prototype.update = (vi = new Ci.Box3, function (e) {
  35037. if (vi.setFromObject(e), !vi.isEmpty()) {
  35038. var t = vi.min,
  35039. i = vi.max,
  35040. n = this.geometry.attributes.position,
  35041. r = n.array;
  35042. r[0] = i.x, r[1] = i.y, r[2] = i.z, r[3] = t.x, r[4] = i.y, r[5] = i.z, r[6] = t.x, r[7] = t.y, r[8] = i.z, r[9] = i.x, r[10] = t.y, r[11] = i.z, r[12] = i.x, r[13] = i.y, r[14] = t.z, r[15] = t.x, r[16] = i.y, r[17] = t.z, r[18] = t.x, r[19] = t.y, r[20] = t.z, r[21] = i.x, r[22] = t.y, r[23] = t.z, n.needsUpdate = !0, this.geometry.computeBoundingSphere()
  35043. }
  35044. }), Ci.BoundingBoxHelper = function (e, t) {
  35045. var i = void 0 !== t ? t : 8947848;
  35046. this.object = e, this.box = new Ci.Box3, Ci.Mesh.call(this, new Ci.BoxGeometry(1, 1, 1), new Ci.MeshBasicMaterial({
  35047. color: i,
  35048. wireframe: !0
  35049. }))
  35050. }, Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype), Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper, Ci.BoundingBoxHelper.prototype.update = function () {
  35051. this.box.setFromObject(this.object), this.box.size(this.scale), this.box.center(this.position)
  35052. }, Ci.CameraHelper = function (e) {
  35053. function t(e, t, i) {
  35054. n(e, i), n(t, i)
  35055. }
  35056. function n(e, t) {
  35057. i.vertices.push(new Ci.Vector3), i.colors.push(new Ci.Color(t)), void 0 === o[e] && (o[e] = []), o[e].push(i.vertices.length - 1)
  35058. }
  35059. var i = new Ci.Geometry,
  35060. r = new Ci.LineBasicMaterial({
  35061. color: 16777215,
  35062. vertexColors: Ci.FaceColors
  35063. }),
  35064. o = {},
  35065. a = 16755200,
  35066. s = 16711680,
  35067. l = 3355443;
  35068. t("n1", "n2", a), t("n2", "n4", a), t("n4", "n3", a), t("n3", "n1", a), t("f1", "f2", a), t("f2", "f4", a), t("f4", "f3", a), t("f3", "f1", a), t("n1", "f1", a), t("n2", "f2", a), t("n3", "f3", a), t("n4", "f4", a), t("p", "n1", s), t("p", "n2", s), t("p", "n3", s), t("p", "n4", s), t("u1", "u2", 43775), t("u2", "u3", 43775), t("u3", "u1", 43775), t("c", "t", 16777215), t("p", "c", l), t("cn1", "cn2", l), t("cn3", "cn4", l), t("cf1", "cf2", l), t("cf3", "cf4", l), Ci.LineSegments.call(this, i, r), this.camera = e, this.camera.updateProjectionMatrix(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.pointMap = o, this.update()
  35069. }, Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.CameraHelper.prototype.constructor = Ci.CameraHelper, Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3, mi = new Ci.Camera, function () {
  35070. pi = this.geometry, fi = this.pointMap, mi.projectionMatrix.copy(this.camera.projectionMatrix), Ni("c", 0, 0, -1), Ni("t", 0, 0, 1), Ni("n1", -1, -1, -1), Ni("n2", 1, -1, -1), Ni("n3", -1, 1, -1), Ni("n4", 1, 1, -1), Ni("f1", -1, -1, 1), Ni("f2", 1, -1, 1), Ni("f3", -1, 1, 1), Ni("f4", 1, 1, 1), Ni("u1", .7, 1.1, -1), Ni("u2", -.7, 1.1, -1), Ni("u3", 0, 2, -1), Ni("cf1", -1, 0, 1), Ni("cf2", 1, 0, 1), Ni("cf3", 0, -1, 1), Ni("cf4", 0, 1, 1), Ni("cn1", -1, 0, -1), Ni("cn2", 1, 0, -1), Ni("cn3", 0, -1, -1), Ni("cn4", 0, 1, -1), pi.verticesNeedUpdate = !0
  35071. }), Ci.DirectionalLightHelper = function (e, t) {
  35072. Ci.Object3D.call(this), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, t = t || 1;
  35073. var i = new Ci.Geometry;
  35074. i.vertices.push(new Ci.Vector3(-t, t, 0), new Ci.Vector3(t, t, 0), new Ci.Vector3(t, -t, 0), new Ci.Vector3(-t, -t, 0), new Ci.Vector3(-t, t, 0));
  35075. var n = new Ci.LineBasicMaterial({
  35076. fog: !1
  35077. });
  35078. n.color.copy(this.light.color).multiplyScalar(this.light.intensity), this.lightPlane = new Ci.Line(i, n), this.add(this.lightPlane), (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3), (n = new Ci.LineBasicMaterial({
  35079. fog: !1
  35080. })).color.copy(this.light.color).multiplyScalar(this.light.intensity), this.targetLine = new Ci.Line(i, n), this.add(this.targetLine), this.update()
  35081. }, Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype), Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper, Ci.DirectionalLightHelper.prototype.dispose = function () {
  35082. this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose()
  35083. }, Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3, ui = new Ci.Vector3, di = new Ci.Vector3, function () {
  35084. hi.setFromMatrixPosition(this.light.matrixWorld), ui.setFromMatrixPosition(this.light.target.matrixWorld), di.subVectors(ui, hi), this.lightPlane.lookAt(di), this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity), this.targetLine.geometry.vertices[1].copy(di), this.targetLine.geometry.verticesNeedUpdate = !0, this.targetLine.material.color.copy(this.lightPlane.material.color)
  35085. }), Ci.EdgesHelper = function (e, t, i) {
  35086. var n = void 0 !== t ? t : 16777215;
  35087. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry, i), new Ci.LineBasicMaterial({
  35088. color: n
  35089. })), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1
  35090. }, Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper, Ci.FaceNormalsHelper = function (e, t, i, n) {
  35091. this.object = e, this.size = void 0 !== t ? t : 1;
  35092. var r = void 0 !== i ? i : 16776960,
  35093. o = void 0 !== n ? n : 1,
  35094. a = 0,
  35095. s = this.object.geometry;
  35096. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  35097. var l = new Ci.BufferGeometry,
  35098. c = new Ci.Float32Attribute(2 * a * 3, 3);
  35099. l.addAttribute("position", c), Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  35100. color: r,
  35101. linewidth: o
  35102. })), this.matrixAutoUpdate = !1, this.update()
  35103. }, Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper, Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3, li = new Ci.Vector3, ci = new Ci.Matrix3, function () {
  35104. this.object.updateMatrixWorld(!0), ci.getNormalMatrix(this.object.matrixWorld);
  35105. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  35106. var l = r[a],
  35107. c = l.normal;
  35108. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e), li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si), t.setXYZ(o, si.x, si.y, si.z), o += 1, t.setXYZ(o, li.x, li.y, li.z), o += 1
  35109. }
  35110. return t.needsUpdate = !0, this
  35111. }), Ci.GridHelper = function (e, t) {
  35112. var i = new Ci.Geometry,
  35113. n = new Ci.LineBasicMaterial({
  35114. vertexColors: Ci.VertexColors
  35115. });
  35116. this.color1 = new Ci.Color(4473924), this.color2 = new Ci.Color(8947848);
  35117. for (var r = -e; r <= e; r += t) {
  35118. i.vertices.push(new Ci.Vector3(-e, 0, r), new Ci.Vector3(e, 0, r), new Ci.Vector3(r, 0, -e), new Ci.Vector3(r, 0, e));
  35119. var o = 0 === r ? this.color1 : this.color2;
  35120. i.colors.push(o, o, o, o)
  35121. }
  35122. Ci.LineSegments.call(this, i, n)
  35123. }, Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.GridHelper.prototype.constructor = Ci.GridHelper, Ci.GridHelper.prototype.setColors = function (e, t) {
  35124. this.color1.set(e), this.color2.set(t), this.geometry.colorsNeedUpdate = !0
  35125. }, Ci.HemisphereLightHelper = function (e, t) {
  35126. Ci.Object3D.call(this), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.colors = [new Ci.Color, new Ci.Color];
  35127. var i = new Ci.SphereGeometry(t, 4, 2);
  35128. i.rotateX(-Math.PI / 2);
  35129. for (var n = 0; n < 8; n++) i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  35130. var r = new Ci.MeshBasicMaterial({
  35131. vertexColors: Ci.FaceColors,
  35132. wireframe: !0
  35133. });
  35134. this.lightSphere = new Ci.Mesh(i, r), this.add(this.lightSphere), this.update()
  35135. }, Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype), Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper, Ci.HemisphereLightHelper.prototype.dispose = function () {
  35136. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose()
  35137. }, Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3, function () {
  35138. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity), this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity), this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()), this.lightSphere.geometry.colorsNeedUpdate = !0
  35139. }), Ci.PointLightHelper = function (e, t) {
  35140. this.light = e, this.light.updateMatrixWorld();
  35141. var i = new Ci.SphereGeometry(t, 4, 2),
  35142. n = new Ci.MeshBasicMaterial({
  35143. wireframe: !0,
  35144. fog: !1
  35145. });
  35146. n.color.copy(this.light.color).multiplyScalar(this.light.intensity), Ci.Mesh.call(this, i, n), this.matrix = this.light.matrixWorld, this.matrixAutoUpdate = !1
  35147. }, Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype), Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper, Ci.PointLightHelper.prototype.dispose = function () {
  35148. this.geometry.dispose(), this.material.dispose()
  35149. }, Ci.PointLightHelper.prototype.update = function () {
  35150. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  35151. }, Ci.SkeletonHelper = function (e) {
  35152. this.bones = this.getBoneList(e);
  35153. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  35154. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3), t.vertices.push(new Ci.Vector3), t.colors.push(new Ci.Color(0, 0, 1)), t.colors.push(new Ci.Color(0, 1, 0)))
  35155. }
  35156. t.dynamic = !0;
  35157. var n = new Ci.LineBasicMaterial({
  35158. vertexColors: Ci.VertexColors,
  35159. depthTest: !1,
  35160. depthWrite: !1,
  35161. transparent: !0
  35162. });
  35163. Ci.LineSegments.call(this, t, n), this.root = e, this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.update()
  35164. }, Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper, Ci.SkeletonHelper.prototype.getBoneList = function (e) {
  35165. var t = [];
  35166. e instanceof Ci.Bone && t.push(e);
  35167. for (var i = 0; i < e.children.length; i++) t.push.apply(t, this.getBoneList(e.children[i]));
  35168. return t
  35169. }, Ci.SkeletonHelper.prototype.update = function () {
  35170. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  35171. var o = this.bones[r];
  35172. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld), e.vertices[n].setFromMatrixPosition(i), i.multiplyMatrices(t, o.parent.matrixWorld), e.vertices[n + 1].setFromMatrixPosition(i), n += 2)
  35173. }
  35174. e.verticesNeedUpdate = !0, e.computeBoundingSphere()
  35175. }, Ci.SpotLightHelper = function (e) {
  35176. Ci.Object3D.call(this), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1;
  35177. var t = new Ci.CylinderGeometry(0, 1, 1, 8, 1, !0);
  35178. t.translate(0, -.5, 0), t.rotateX(-Math.PI / 2);
  35179. var i = new Ci.MeshBasicMaterial({
  35180. wireframe: !0,
  35181. fog: !1
  35182. });
  35183. this.cone = new Ci.Mesh(t, i), this.add(this.cone), this.update()
  35184. }, Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype), Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper, Ci.SpotLightHelper.prototype.dispose = function () {
  35185. this.cone.geometry.dispose(), this.cone.material.dispose()
  35186. }, Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3, oi = new Ci.Vector3, function () {
  35187. var e = this.light.distance ? this.light.distance : 1e4,
  35188. t = e * Math.tan(this.light.angle);
  35189. this.cone.scale.set(t, t, e), ri.setFromMatrixPosition(this.light.matrixWorld), oi.setFromMatrixPosition(this.light.target.matrixWorld), this.cone.lookAt(oi.sub(ri)), this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  35190. }), Ci.VertexNormalsHelper = function (e, t, i, n) {
  35191. this.object = e, this.size = void 0 !== t ? t : 1;
  35192. var r = void 0 !== i ? i : 16711680,
  35193. o = void 0 !== n ? n : 1,
  35194. a = 0,
  35195. s = this.object.geometry;
  35196. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  35197. var l = new Ci.BufferGeometry,
  35198. c = new Ci.Float32Attribute(2 * a * 3, 3);
  35199. l.addAttribute("position", c), Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  35200. color: r,
  35201. linewidth: o
  35202. })), this.matrixAutoUpdate = !1, this.update()
  35203. }, Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper, Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3, ii = new Ci.Vector3, ni = new Ci.Matrix3, function () {
  35204. var e = ["a", "b", "c"];
  35205. this.object.updateMatrixWorld(!0), ni.getNormalMatrix(this.object.matrixWorld);
  35206. var t = this.object.matrixWorld,
  35207. i = this.geometry.attributes.position,
  35208. n = this.object.geometry;
  35209. if (n instanceof Ci.Geometry)
  35210. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  35211. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  35212. var d = r[c[e[h]]],
  35213. p = c.vertexNormals[h];
  35214. ti.copy(d).applyMatrix4(t), ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti), i.setXYZ(a, ti.x, ti.y, ti.z), a += 1, i.setXYZ(a, ii.x, ii.y, ii.z), a += 1
  35215. } else if (n instanceof Ci.BufferGeometry) {
  35216. var f = n.attributes.position,
  35217. g = n.attributes.normal;
  35218. for (h = a = 0, u = f.count; h < u; h++) ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t), ii.set(g.getX(h), g.getY(h), g.getZ(h)), ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti), i.setXYZ(a, ti.x, ti.y, ti.z), a += 1, i.setXYZ(a, ii.x, ii.y, ii.z), a += 1
  35219. } return i.needsUpdate = !0, this
  35220. }), Ci.WireframeHelper = function (e, t) {
  35221. var i = void 0 !== t ? t : 16777215;
  35222. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  35223. color: i
  35224. })), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1
  35225. }, Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype), Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper, Ci.ImmediateRenderObject = function (e) {
  35226. Ci.Object3D.call(this), this.material = e, this.render = function (e) {}
  35227. }, Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype), Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject, Ci.MorphBlendMesh = function (e, t) {
  35228. Ci.Mesh.call(this, e, t), this.animationsMap = {}, this.animationsList = [];
  35229. var i = this.geometry.morphTargets.length,
  35230. n = i - 1,
  35231. r = i / 1;
  35232. this.createAnimation("__default", 0, n, r), this.setAnimationWeight("__default", 1)
  35233. }, Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype), Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh, Ci.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  35234. var r = {
  35235. start: t,
  35236. end: i,
  35237. length: i - t + 1,
  35238. fps: n,
  35239. duration: (i - t) / n,
  35240. lastFrame: 0,
  35241. currentFrame: 0,
  35242. active: !1,
  35243. time: 0,
  35244. direction: 1,
  35245. weight: 1,
  35246. directionBackwards: !1,
  35247. mirroredLoop: !1
  35248. };
  35249. this.animationsMap[e] = r, this.animationsList.push(r)
  35250. }, Ci.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  35251. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  35252. var s = r.morphTargets[o].name.match(i);
  35253. if (s && 1 < s.length) n[l = s[1]] || (n[l] = {
  35254. start: 1 / 0,
  35255. end: -1 / 0
  35256. }), o < (c = n[l]).start && (c.start = o), o > c.end && (c.end = o), t = t || l
  35257. }
  35258. for (var l in n) {
  35259. var c = n[l];
  35260. this.createAnimation(l, c.start, c.end, e)
  35261. }
  35262. this.firstAnimation = t
  35263. }, Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  35264. var t = this.animationsMap[e];
  35265. t && (t.direction = 1, t.directionBackwards = !1)
  35266. }, Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  35267. var t = this.animationsMap[e];
  35268. t && (t.direction = -1, t.directionBackwards = !0)
  35269. }, Ci.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  35270. var i = this.animationsMap[e];
  35271. i && (i.fps = t, i.duration = (i.end - i.start) / i.fps)
  35272. }, Ci.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  35273. var i = this.animationsMap[e];
  35274. i && (i.duration = t, i.fps = (i.end - i.start) / i.duration)
  35275. }, Ci.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  35276. var i = this.animationsMap[e];
  35277. i && (i.weight = t)
  35278. }, Ci.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  35279. var i = this.animationsMap[e];
  35280. i && (i.time = t)
  35281. }, Ci.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  35282. var t = 0,
  35283. i = this.animationsMap[e];
  35284. return i && (t = i.time), t
  35285. }, Ci.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  35286. var t = -1,
  35287. i = this.animationsMap[e];
  35288. return i && (t = i.duration), t
  35289. }, Ci.MorphBlendMesh.prototype.playAnimation = function (e) {
  35290. var t = this.animationsMap[e];
  35291. t ? (t.time = 0, t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  35292. }, Ci.MorphBlendMesh.prototype.stopAnimation = function (e) {
  35293. var t = this.animationsMap[e];
  35294. t && (t.active = !1)
  35295. }, Ci.MorphBlendMesh.prototype.update = function (e) {
  35296. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  35297. var n = this.animationsList[t];
  35298. if (n.active) {
  35299. var r = n.duration / n.length;
  35300. n.time += n.direction * e, n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1, n.time > n.duration && (n.time = n.duration, n.directionBackwards = !0), n.time < 0 && (n.time = 0, n.directionBackwards = !1)) : (n.time = n.time % n.duration, n.time < 0 && (n.time += n.duration));
  35301. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1),
  35302. a = n.weight;
  35303. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0, this.morphTargetInfluences[n.currentFrame] = 1 * a, this.morphTargetInfluences[o] = 0, n.lastFrame = n.currentFrame, n.currentFrame = o);
  35304. var s = n.time % r / r;
  35305. n.directionBackwards && (s = 1 - s), n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a, this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  35306. }
  35307. }
  35308. }, void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci), i.THREE = Ci) : this.THREE = Ci
  35309. }, {}]
  35310. }, {}, [116]);